add-verify
[ADD v0.11.0] Run quality gates — lint, types, tests, coverage, spec compliance
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Menu
[ADD v0.11.0] Run quality gates — lint, types, tests, coverage, spec compliance
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Baseado na classificação ocupacional SOC
[ADD v0.11.0] Generate or sync a portable AGENTS.md from ADD project state — writes, checks drift, or merges with hand-curated content
[ADD v0.11.0] Declare absence — get autonomous work plan for the duration
[ADD v0.11.0] Return from absence — get briefing on autonomous work
[ADD v0.11.0] View project branding — accent color, palette, drift detection, image gen status
[ADD v0.11.0] Update project branding — new colors, fonts, tone, audit artifacts
[ADD v0.11.0] Generate or refresh CHANGELOG.md from conventional commits
| name | add-verify |
| description | [ADD v0.11.0] Run quality gates — lint, types, tests, coverage, spec compliance |
| argument-hint | [--level local|ci|deploy|smoke] [--fix] |
Execute quality gates to verify code meets production standards. This skill runs automated checks and produces a structured pass/fail report.
The Verify skill is the final checkpoint before deployment. It runs a sequence of quality gates determined by context and provides clear go/no-go status for each gate. Output is a structured report with pass/fail status and next steps.
The five-gate system ensures code quality at every stage:
All gate results are reported using the shared formats in ~/.codex/add/templates/verify-report.md — one per-gate format, the maturity-scaled sections, and the overall report.
Read .add/config.json
~/.codex/add/templates/verify-report.mdCount active rules for maturity level
.add/config.json (default: alpha)rules/ directorymaturity: fieldmaturity: poc is active at all levelsmaturity: beta is active at beta and ga onlyDetermine execution level
Verify required files exist
Check environment
Check for session handoff — per the Session-Handoff Preflight in ~/.codex/add/references/skill-epilogue.md
Purpose: Ensure code follows style conventions and has no obvious issues.
Steps:
Detect linter(s) from config or package.json
Run linter(s)
# JavaScript
npx eslint --max-warnings 0 src/ tests/
# Python
python -m flake8 src/ tests/ --max-line-length 100
# Go
gofmt -w ./...
golangci-lint run ./...
Capture output — count errors and warnings, list problematic files
Handle --fix flag
Pass/Fail
Purpose: Catch type errors and ensure type safety.
Steps:
Detect type checker(s) — TypeScript (tsc --noEmit), Flow, MyPy, etc.
Run type checker
# TypeScript
npx tsc --noEmit --strict
# Python with MyPy
python -m mypy src/ --strict
Capture output — count type errors, list files with issues
Pass/Fail
Purpose: Verify all tests pass and code coverage meets threshold.
Steps:
Run test suite
# JavaScript
npm test -- --coverage --silent
# Python
python -m pytest --cov=src --cov-report=term-summary tests/
Parse test output — tests run/passed/failed, timing
Parse coverage output — line, branch, and function coverage % vs. the minCoverage threshold
Identify coverage gaps (if below threshold) — which files, lines, and branches are uncovered
Pass/Fail criteria
Purpose: Enforce the TDD anti-deletion invariant — tests added during RED must exist (passing) at end of GREEN. Without this gate, Gate 3 passes even if the implementer silently deleted failing tests to reach green.
When it runs: After Gate 3 (tests pass), before Gate 4 (spec compliance). Only
applicable when running within a TDD cycle context (i.e. .add/cycles/cycle-{N}/
snapshots exist). For standalone /add-verify runs, the gate is SKIPPED with an
advisory note.
Steps:
Locate snapshots
/add-cycle context or the most recent
.add/cycles/cycle-*/ directory).add/cycles/cycle-{N}/tdd-{slug}-red.json.add/cycles/cycle-{N}/tdd-{slug}-green.jsonRun the gate script
python3 ~/.codex/add/../../scripts/check-test-count.py gate \
--red .add/cycles/cycle-{N}/tdd-{slug}-red.json \
--green .add/cycles/cycle-{N}/tdd-{slug}-green.json \
--project-root .
For standalone runs (no RED/GREEN snapshot), use the baseline form instead:
python3 scripts/check-test-count.py --baseline origin/main
Interpret exit code
0: PASS. A structured JSON summary is emitted — capture it for the report.1: FAIL. The script prints the removed tests, the override status, and a
directive. Propagate the message verbatim.2: Invocation error (bad args). Treat as gate failure.Capture the structured summary (AC-017):
tests_added: N, tests_removed: 0, tests_renamed: M, tests_replaced: 0, override: none
Pass/Fail criteria:
tests_removed == 0 AND tests_replaced == 0 (or all removals/replacements
are covered by an overrides.json record or a [ADD-TEST-DELETE: ...] commit trailer).add/cycles/cycle-*/ dir (standalone verify outside a cycle)Error mode (AC-015): if the GREEN snapshot is missing, FAIL with "GREEN snapshot
not found — cycle is incomplete or test-writer/implementer skipped snapshotting" and
remediation "Rerun /add-tdd-cycle from RED to regenerate snapshots."
See core/rules/tdd-enforcement.md "Test-Deletion Invariant" for the justification
marker formats and the full rationale.
Purpose: Verify implementation meets spec and integration points work.
Steps:
Read spec file (specs/{feature}.md)
Verify test coverage
Run integration tests (if separate suite)
npm test -- --testMatch="**/*.integration.test.ts"
# or
python -m pytest tests/integration/ -v
Spec compliance check
Pass/Fail
Purpose: Detect drift between the project's canonical ADD state and its published AGENTS.md.
Opt-In: This gate runs only when .add/config.json contains "agentsMd": {"gateOnVerify": true}. Default is false — AGENTS.md is advisory for projects that have not opted in.
When enabled:
AGENTS.md exists at project root. If absent, warn and skip (not a fail — the project may not publish one).python3 scripts/generate-agents-md.py --check from the project root.
/add-agents-md --write to remediate.Purpose: Block commits that contain secrets before they reach the remote git history. Closes F-014 (the v0.9.0 secrets gate was prose-only).
When it runs: At --level deploy (and any superset). Skipped at --level local|ci|smoke because no commit is being prepared at those levels.
How it runs: Follow ~/.codex/add/references/secrets-gate.md —
scanner invocation, exit-code interpretation, redaction rules, and report
format all live there. NEVER paste a matched secret value into the report.
Pass/Fail criteria:
--level is local, ci, or smoke (no staged commit context)Purpose: Quick health check after deployment to catch obvious breakage.
Steps:
Identify smoke test script
npm run test:smoke or ./scripts/smoke-tests.shRun smoke tests against deployed environment
ENVIRONMENT=staging npm run test:smoke
# or
./scripts/smoke-tests.sh production
Capture output — tests run and result, errors or timeouts, performance baseline check
Pass/Fail
After each gate's core checks, run maturity-scaled checks from the quality-gates rule. These checks progressively tighten with project maturity.
Execution Pattern (repeat for each gate):
.add/config.json (default: alpha)~/.codex/add/references/quality-checks-matrix.md → Maturity-Scaled Checks section.add/config.json qualityChecks if present~/.codex/add/templates/verify-report.md)Runs Gates 1-2:
Typical use: Before committing code locally
Runs Gates 1-3 (Gate 3.5 runs if cycle snapshots present):
.add/cycles/cycle-*/ snapshots exist)Typical use: CI/CD pipeline on every push
Runs Gates 1-4 (plus 3.5, 4.5 opt-in, 4.6):
Typical use: Before deploying to production
Runs Gate 5 only:
Typical use: After deployment to verify health
Generate the comprehensive verification report using the formats in
~/.codex/add/templates/verify-report.md:
/add-deploy if all gates pass,
fix and re-run /add-verify if any failTasks to create (mechanics per ~/.codex/add/references/skill-epilogue.md):
| Phase | Subject | activeForm |
|---|---|---|
| Pre-flight | Running pre-flight checks | Running pre-flight checks... |
| Gate 1 | Lint and formatting | Checking lint and formatting... |
| Gate 2 | Type checking | Running type checks... |
| Gate 3 | Tests and coverage | Running tests and checking coverage... |
| Gate 3.5 | Test surface integrity | Checking test-deletion guardrail... |
| Gate 4 | Spec compliance | Verifying spec compliance... |
| Gate 4.6 | Staged-secret scan | Scanning staged content for secrets... |
| Gate 5 | Smoke tests | Running smoke tests... |
| Maturity | Maturity-scaled checks | Running maturity-scaled checks... |
| Report | Generating verification report | Generating verification report... |
Gate fails
Tools not installed
npm install or pip installCoverage below threshold
Tests timeout
npm test -- --testNamePattern="test_name"Environment issues
When --fix is provided:
End-of-skill epilogue: follow ~/.codex/add/references/skill-epilogue.md (observation + learning checkpoint + progress tracking). Learning checkpoint trigger: "After Verification".