Code Verification
Overview
Complete verification workflow ensuring NO code is EVER committed without passing ALL quality checks. ZERO TOLERANCE for violations.
Usage Type: EDUCATIONAL - Learn verification patterns and implement in workflow.
When to Use
Use this skill when:
- Main Agent needs to verify code before commit
- Verification agent spawned to run quality checks
- Need to understand what checks are required
- Implementing verification in your workflow
Prerequisites
- Access to language language skills (
language-specific skill files) - Understanding of verification tools (cargo, npm, pytest, etc.)
- Clear understanding of what files changed
Core Principle
Task Complete → Report → Verify → Pass? → Commit → Push
↓
Fail → Fix → Loop
CRITICAL: Code commits ONLY after ALL checks pass.
Agent Hierarchy
Main Agent (Only agent with verification authority):
- Directly interacting with user
- ONLY agent that spawns verification agents
- Commits code after verification passes
Sub-Agents:
- NEVER spawn verification agents
- Report completion to Main Agent
- Wait for Main Agent to coordinate verification
Identity Check: Spawned by another agent? → You are SUB-AGENT (no verification authority)
Verification Workflow
Phase 1: Main Agent Analyzes
After implementation agent reports completion:
- Identify language(s) modified from changed files
- Spawn ONE verification agent per language (NEVER more)
- Provide context (files, description, specification)
- Wait for verification results
Phase 2: Verification Agent Runs ALL Checks
Check Order (MANDATORY):
- Incomplete Implementation Check (FIRST - if fail, stop immediately)
- Format check
- Lint check
- Type check (if applicable)
- Tests (ALL must pass)
- Build
- Security scan
- Standards compliance
Phase 3: Main Agent Decision
If ALL Pass ✅:
git add [files]git commit -m "[message with verification status]"git push- Update specification
- Proceed to next task
If ANY Fail ❌:
- Create urgent fix task
- Provide failure details to implementation agent
- Wait for fix
- Return to Phase 2 (verify again)
- Loop until all pass
Mandatory Checks by Language
Rust
Commands:
# 1. Incomplete implementation check (MANDATORY FIRST)
grep -rn "TODO\|FIXME\|unimplemented!\|todo!\|panic!(\"not implemented\")" src/
# 2. Format
cargo fmt -- --check
# 3. Lint (zero warnings)
cargo clippy -- -D warnings
# 4. Tests
cargo test
# 5. Build
cargo build --all-features
# 6. Documentation
cargo doc --no-deps
# 7. Security
cargo audit
# 8. Standards compliance (no unwrap(), proper docs)
JavaScript/TypeScript
Commands:
# 1. Incomplete implementation check (MANDATORY FIRST)
grep -rn "TODO\|FIXME\|// stub" src/
# 2. Format
npx prettier --check .
# 3. Type check (zero errors)
npx tsc --noEmit
# 4. Lint (zero warnings)
npx eslint . --max-warnings 0
# 5. Tests (with coverage)
npm test
# 6. Build
npm run build
# 7. Security
npm audit
# 8. Standards compliance (no any type)
Python
Commands:
# 1. Incomplete implementation check (MANDATORY FIRST)
grep -rn "TODO\|FIXME\|NotImplementedError\|pass # stub" src/
# 2. Format
black --check .
# 3. Lint (zero errors)
ruff check .
# 4. Type check (strict mode)
mypy .
# 5. Tests (with coverage)
pytest --cov
# 6. Import check
python -m py_compile src/**/*.py
# 7. Security
pip-audit
# 8. Standards compliance (no mutable defaults)
Incomplete Implementation Check (MANDATORY FIRST)
Before any other checks, search for:
TODO,FIXMEmarkersunimplemented!(),todo!(),panic!("not implemented")- Stub methods (functions returning default/Ok(()) only)
- Functions with just
passin Python - Functions with
NotImplementedErrorin Python
If ANY found → FAIL IMMEDIATELY
Why: Features claiming "complete" cannot have incomplete implementations.
Test Quality Validation
Valid Tests:
- ✅ Unit tests with real components (localhost, temp files)
- ✅ Integration tests with real local services (test servers, test DBs)
- ✅ End-to-end tests with full workflows
- ✅ Limited mocks only for external services (payment gateways, third-party APIs)
Invalid Tests (FAIL verification):
- ❌ Mocking our own code (HTTP clients, databases we wrote)
- ❌ Integration tests without integration (all calls mocked)
- ❌ Mock-only testing (no real validation)
- ❌ Untested integration points
Example - Bad:
#[test]
fn test_http_client() {
let mock_dns = MockDnsResolver::new(); // ❌ Mocking our own code
let mock_tcp = MockTcpConnection::new(); // ❌ Mocking our own code
let client = HttpClient::new(mock_dns, mock_tcp);
assert!(client.get("http://example.com").is_ok());
}
Example - Good:
#[tokio::test]
async fn test_http_client_real() {
let server = TestHttpServer::new("127.0.0.1:8080"); // ✅ Real test server
server.respond_with(200, "OK");
let client = HttpClient::new(); // ✅ Real client
let response = client.get("http://127.0.0.1:8080").await.unwrap();
assert_eq!(response.status(), 200);
}
Verification Report Format
# [Language] Verification Report
## Status: PASS ✅ / FAIL ❌
## Files Verified
- [list of files]
## Check Results
1. Incomplete Implementation: PASS ✅ / FAIL ❌
2. Format: PASS ✅ / FAIL ❌
3. Lint: PASS ✅ / FAIL ❌
4. Type Check: PASS ✅ / FAIL ❌
5. Tests: N/N PASS ✅ / FAIL ❌
6. Build: PASS ✅ / FAIL ❌
7. Security: PASS ✅ / FAIL ❌
8. Standards: PASS ✅ / FAIL ❌
## Test Results
- Total: [N]
- Passed: [N]
- Failed: [N]
- Coverage: [N]%
## Failures (if any)
[Detailed failure information for each failed check]
Commit Message with Verification
After ALL checks pass:
git commit -m "$(cat <<'EOF'
Add authentication middleware
Implemented JWT-based authentication middleware.
Changes made:
- Created auth.js with token validation
- Added JWT verification
- Implemented error handling
- Wrote comprehensive tests
Verified by JavaScript Verification Agent: All checks passed
- Incomplete Implementation: PASS
- Format: PASS (prettier)
- Lint: PASS (eslint, 0 warnings)
- Type Check: PASS (tsc)
- Tests: 12/12 PASS, coverage 95%
- Build: PASS
- Security: PASS (npm audit, 0 vulnerabilities)
- Standards: PASS
Co-Authored-By: Claude <noreply@anthropic.com>
EOF
)"
Verification Patterns
Pattern: Single Language
1. Implementation agent reports completion
2. Main Agent identifies language (e.g., Rust)
3. Main Agent spawns Rust verification agent
4. Verification agent runs ALL Rust checks
5. If PASS: Main Agent commits + pushes
6. If FAIL: Main Agent creates fix task, resumes implementation agent
Pattern: Multiple Languages
1. Implementation agent reports completion
2. Main Agent identifies languages (e.g., Rust + TypeScript)
3. Main Agent spawns Rust verification agent
4. Main Agent spawns TypeScript verification agent
5. Wait for BOTH verification results
6. If ALL PASS: Main Agent commits + pushes
7. If ANY FAIL: Main Agent creates fix tasks for failed languages
Pattern: Fix Loop
1. Verification FAILS
2. Main Agent creates urgent fix task with failure details
3. Main Agent resumes/spawns implementation agent with fix requirements
4. Implementation agent fixes ALL failures
5. Implementation agent reports fix completion
6. Main Agent spawns verification agent again
7. Loop until ALL checks PASS
Common Verification Failures
Incomplete Implementation
Found: TODO markers, unimplemented!() macros, stub methods
Fix: Complete all implementations before marking as done
Format Failures
Found: Code not formatted per project standards
Fix: Run formatter (cargo fmt, prettier, black)
Lint Failures
Found: Warnings from linter
Fix: Address all warnings (zero tolerance)
Test Failures
Found: Tests failing or insufficient coverage
Fix: Fix failing tests, add tests for uncovered code
Build Failures
Found: Compilation errors, missing dependencies
Fix: Resolve compilation errors, add missing dependencies
Enforcement
Must Do
- Check for incomplete implementations FIRST
- Run ALL checks from language language skill
- Validate test quality (real vs mock)
- Main Agent spawns verification agents (one per language)
- Include verification status in commits
- Fix ALL failures before commit
- Push after successful commit
Must Not Do
- Skip any verification checks
- Commit with incomplete implementations
- Use mock-only testing
- Sub-agents spawn verification
- Commit before verification passes
- Ignore failed checks
Critical Violations
- Committing code without verification
- Sub-agent spawning verification agents
- Committing with failed verification
- Skipping required checks
- Using integration theater (mocking own code)
- Committing incomplete implementations (TODO, FIXME, stubs)
Summary
Verification Workflow:
Implement → Report → Main Agent → Spawn Verification →
Run ALL Checks → PASS? → Commit + Push : Fix → Loop
Mandatory Checks (per language):
- Incomplete implementation (FIRST)
- Format
- Lint
- Type check
- Tests (ALL pass)
- Build
- Security
- Standards
Key Principles:
- NO code committed without verification
- ONLY Main Agent spawns verification agents
- ALL checks must pass
- Check incomplete implementations FIRST
- Real tests over mocks
- Fix ALL failures before commit
- Include verification status in commits
Version: 1.0 - Last Updated: 2026-02-27