| name | validation |
| description | Runs production readiness validation checks. Includes type checking, linting, tests, coverage, security, and dead code detection. Stack-agnostic. |
| model | sonnet |
| tools | Read, Write, Edit, Glob, Grep, Bash |
Validation Skill
This skill defines how to run comprehensive production readiness validation checks across any tech stack.
The 6 Core Quality Gates
Every codebase, regardless of language, must pass these gates:
- Type Checking - No type errors (if language supports types)
- Linting - Code follows project style guide
- Tests - All tests passing
- Coverage - Minimum 80% code coverage
- Security - No known vulnerabilities, hardcoded secrets
- Dead Code - No unused exports, imports, files, dependencies
Stack Detection
Before running validation, detect the tech stack:
if exists("package.json"): stack = "JavaScript/TypeScript"
if exists("requirements.txt") OR exists("pyproject.toml"): stack = "Python"
if exists("go.mod"): stack = "Go"
if exists("pom.xml") OR exists("build.gradle"): stack = "Java"
if exists("Gemfile"): stack = "Ruby"
if exists("Cargo.toml"): stack = "Rust"
if exists("composer.json"): stack = "PHP"
if exists("mix.exs"): stack = "Elixir"
Gate 1: Type Checking
JavaScript/TypeScript
if exists("tsconfig.json"):
type_checker = "tsc"
npx tsc --noEmit
exit_code == 0
Python
if "mypy" in requirements.txt OR pyproject.toml:
type_checker = "mypy"
mypy . --ignore-missing-imports
exit_code == 0
Go
go vet ./...
exit_code == 0
Java
mvn compile
gradle build --dry-run
exit_code == 0
Rust
cargo check
exit_code == 0
Other Languages
If no type checker found, skip this gate and note in report.
Gate 2: Linting
JavaScript/TypeScript
Check package.json for: eslint, @typescript-eslint, prettier
npm run lint
npx eslint .
exit_code == 0 (errors = 0, warnings acceptable)
Python
Check for: pylint, flake8, black, ruff
pylint **/*.py
flake8 .
ruff check .
No errors (warnings acceptable)
Go
golangci-lint run
exit_code == 0
Java
Check for: checkstyle, spotless
mvn checkstyle:check
gradle checkstyleMain
exit_code == 0
Ruby
rubocop
exit_code == 0
Rust
cargo clippy -- -D warnings
exit_code == 0
Gate 3: Dead Code Detection
JavaScript/TypeScript
npx knip --reporter json 2>/dev/null && exit 0
npx ts-prune 2>/dev/null && exit 0
grep -r "export.*function\|export.*class\|export.*const" src/ --include="*.ts" --include="*.tsx" -h | \
while read line; do
export_name=$(echo "$line" | grep -oE "\w+")
usage=$(grep -r "$export_name" src/ | wc -l)
if [ "$usage" -eq 1 ]; then
echo "Unused: $export_name"
fi
done
Python
vulture . --min-confidence 80
No unused code detected
Go
go install golang.org/x/tools/cmd/deadcode@latest
deadcode ./...
No dead code found
Java
mvn pmd:check
No dead code violations
Other Languages
Manual Grep-based detection as fallback for any language.
Gate 4: Test Execution
JavaScript/TypeScript
Check package.json for: jest, vitest, mocha
npm test
npx vitest run
npx jest
exit_code == 0, all tests passing
Python
Check for: pytest, unittest, nose
pytest
python -m unittest discover
exit_code == 0
Go
go test ./...
exit_code == 0
Java
mvn test
gradle test
exit_code == 0
Ruby
bundle exec rspec
rake test
exit_code == 0
Rust
cargo test
exit_code == 0
Gate 5: Coverage Check
JavaScript/TypeScript
npm test -- --coverage
npx vitest run --coverage
coverage=$(cat coverage/coverage-summary.json | jq '.total.lines.pct')
coverage >= 80
Python
pytest --cov --cov-report=json
coverage=$(cat coverage.json | jq '.totals.percent_covered')
coverage >= 80
Go
go test -cover -coverprofile=coverage.out ./...
coverage=$(go tool cover -func=coverage.out | grep total | awk '{print $3}' | sed 's/%//')
coverage >= 80
Java
mvn test jacoco:report
Ruby
bundle exec rspec --coverage
Rust
cargo tarpaulin --out Json
Gate 6: Security Audit
Dependency Vulnerabilities
JavaScript/TypeScript:
npm audit --production --json
Python:
pip-audit --format json
safety check --json
Go:
go list -json -m all | nancy sleuth
Java:
mvn dependency-check:check
Ruby:
bundle audit
Rust:
cargo audit
Hardcoded Secrets (Language-Agnostic)
grep -rE "(password|secret|token|api_key|apikey|private_key)\s*[:=]\s*['\"][^'\"]{10,}['\"]" \
src/ --include="*.{ts,tsx,js,jsx,py,go,java,rb,rs,php}" -n
No hardcoded secrets found
Debug Statements (Language-Specific)
JavaScript/TypeScript:
grep -rn "console\.(log|debug|warn)" src/ --include="*.ts" --include="*.tsx" --include="*.js"
Python:
grep -rn "print(" src/ --include="*.py" | grep -v "# allowed print"
Go:
grep -rn "fmt.Println" . --include="*.go" | grep -v "main.go"
Java:
grep -rn "System.out.println" src/ --include="*.java"
Type Escape Hatches
TypeScript:
grep -rn "@ts-ignore\|@ts-nocheck" src/ --include="*.ts" --include="*.tsx"
Python:
grep -rn "# type: ignore" src/ --include="*.py"
Validation Report Format
{
"timestamp": "2026-01-22T00:00:00Z",
"stack": "JavaScript/TypeScript",
"overall": "passed" | "failed",
"checks": {
"typescript": {
"passed": true,
"error_count": 0,
"files_checked": 47
},
"lint": {
"passed": true,
"error_count": 0,
"warning_count": 3
},
"dead_code": {
"passed": false,
"issues": [
{
"type": "unused_export",
"file": "src/utils/date.ts",
"name": "formatDate"
},
{
"type": "unused_file",
"file": "src/components/OldWidget.tsx"
}
]
},
"tests": {
"passed": true,
"test_count": 47,
"failed": 0,
"skipped": 2
},
"coverage": {
"passed": false,
"actual": 72.3,
"required": 80,
"diff": -7.7
},
"security": {
"passed": false,
"vulnerabilities": {
"critical": 0,
"high": 0,
"moderate": 2,
"low": 5
},
"hardcoded_secrets": 1,
"debug_statements": 3
}
},
"must_fix": [
"Remove unused export: formatDate in src/utils/date.ts",
"Delete unused file: src/components/OldWidget.tsx",
"Add tests to reach 80% coverage (currently 72.3%)",
"Remove hardcoded secret from src/config/api.ts:12",
"Remove console.log from src/auth/login.ts:45"
],
"can_ignore": [
"3 lint warnings in legacy code",
"5 low severity npm vulnerabilities (dev dependencies)"
]
}
Save Report
cat > .agentful/last-validation.json << 'EOF'
{...report json...}
EOF
Update Completion Gates
{
"gates": {
"tests_passing": true,
"no_type_errors": true,
"no_dead_code": false,
"coverage_80": false,
"security_clean": false
}
}
Quick Validation (Faster Feedback)
For faster iteration during development:
npx tsc --noEmit
mypy .
go vet ./...
npm test
pytest
go test ./...
npm test -- --coverage
pytest --cov
go test -cover ./...
CI/CD Integration
GitHub Actions Example
name: Validation
on: [push, pull_request]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup environment
run: |
# Install dependencies based on detected stack
- name: Type check
run: npx tsc --noEmit
- name: Lint
run: npm run lint
- name: Tests
run: npm test
- name: Coverage
run: npm test -- --coverage
- name: Security
run: npm audit --production
Adapt for Other Stacks
Replace commands based on stack detection logic above.
Error Handling
Tool Not Available
If a validation tool is not installed or unavailable:
- Check if tool is in dependencies
- Try alternative tool (e.g., eslint → prettier)
- Skip that specific check if no alternatives
- Note in report that check was skipped
- Continue with remaining checks
Timeout on Large Codebases
If validation takes too long:
- Run incrementally (check changed files only)
- Increase timeout in CI/CD
- Use caching (e.g., tsc --incremental)
- Parallelize where possible
False Positives
If dead code detection finds false positives:
- Verify manually with Grep
- Check for dynamic imports/requires
- Exclude known false positives (update tool config)
- Report findings with confidence levels
Best Practices
- Run locally before pushing - Catch issues early
- Run in CI/CD - Ensure all contributions pass gates
- Fix issues incrementally - Don't accumulate technical debt
- Update tools regularly - Security vulnerabilities change
- Customize thresholds - Adjust coverage target if needed (but ≥80% recommended)
- Review reports - Don't just pass/fail, understand issues
Integration with agentful
The reviewer agent uses this skill to run all validation checks.
The fixer agent uses this skill to understand what needs fixing.
The orchestrator uses this skill to determine if features are truly complete.
This skill is stack-agnostic - it adapts to whatever tech stack is detected in the project.