Verify completed implementation against the plan. Checks that all tasks were implemented, nothing was forgotten, code compiles, tests pass, and quality standards are met. Use after "/aif-implement" completes, or when user says "verify", "check work", "did we miss anything".
68
85%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Verify that the completed implementation matches the plan, nothing was missed, and the code is production-ready.
This skill is optional — invoked after /aif-implement finishes all tasks, or manually at any time.
FIRST: Read .ai-factory/config.yaml if it exists to resolve:
paths.description, paths.architecture, paths.rules_file, paths.roadmap, paths.research, paths.plan, paths.plans, paths.fix_plan, paths.specs, paths.rules, and paths.archive; derive research_bundles_dir = <parent directory of paths.research>/research/strict | normal | lenient)git.enabled, git.base_branch, git.create_branchesrules.base + named rules.<area> entrieslanguage.ui for prompts, user-visible explanations, verification reports, context-gate summaries, issue remediation prompts, and next-step guidanceworkflow.plan_id_format (default: slug) — used by branch-based plan discovery in Step 0.2.
Active values: slug and sequential. Discovery treats root *.md files as
full plans except the resolved fast/fix paths, and direct child */index.md
files as ultra entrypoints only when they contain exactly one
<!-- aif:plan-mode:ultra -->. When
sequential, search both numbered shapes and choose the highest prefix.
timestamp and uuid are reserved values and currently behave like slug.
Treat any unknown value as slug.verify_mode priority:
--strict CLI flag → always use strictworkflow.verify_mode → use configured valuenormalIf config.yaml doesn't exist, use defaults:
.ai-factory/ for all artifacts.ai-factory/RESEARCH.mdnormalui_language: enworkflow.plan_id_format: slugResolved language value:
ui_language = language.ui || "en"All AskUserQuestion prompts, user-visible explanations, verification reports, context-gate summaries, issue remediation prompts, and next-step guidance MUST be written in ui_language.
Preserve machine-readable aif-gate-result JSON schema fields and enum values (pass, warn, fail) unchanged. Preserve WARN/ERROR gate labels, commands, paths, config keys, code identifiers, package names, API names, and raw command output unchanged.
references/CONTEXT-GATES-AND-OWNERSHIP.md first.references/GATE-RESULT-CONTRACT.md for the machine-readable quality gate summary.aif-commit/aif-review/aif-verify,Same logic as /aif-implement — produce the canonical branch stem before any plans-dir glob so producer and consumers agree by construction.
1. Check current git branch:
git branch --show-current
2. Convert branch to filename stem (git mode only):
branch_stem = current branch with every "/" replaced by "-"
Example: feature/user-auth → feature-user-auth
3. Resolve the plan artifact using <branch_stem>:
→ When `workflow.plan_id_format = sequential`, glob both
<configured plans dir>/[0-9][0-9][0-9][0-9]_<branch_stem>.md
<configured plans dir>/[0-9][0-9][0-9][0-9]_<branch_stem>/index.md
Read every directory candidate and retain it only when `index.md` contains
exactly one <!-- aif:plan-mode:ultra -->. Choose the highest prefix across
valid artifacts and warn when multiple valid candidates exist; prefer ultra
if both shapes share the highest prefix.
→ Otherwise/fallback check the ultra entrypoint and full file:
<configured plans dir>/<branch_stem>/index.md
<configured plans dir>/<branch_stem>.md
Read the directory entrypoint before selection and ignore it unless it
contains exactly one <!-- aif:plan-mode:ultra -->. If both valid shapes
exist, warn and prefer ultra.
4. If the branch-based plan is missing or git mode is off:
→ Count root `*.md` full plans and declared-ultra direct child `*/index.md`
entrypoints as artifacts; exclude resolved fast/fix paths and do not count
phase files
→ If exactly one exists, use it
→ If multiple exist, ask the user to choose or use `@<path>` via `/aif-implement`
5. No named full/ultra plan → Check the resolved fast plan path
6. No regular plan and no resolved fast plan → fall back to standalone verification choicesNote: Plan discovery scans paths.plans/ only. Plans archived to paths.archive/plans/ by /aif-archive are excluded from discovery. If a plan is found only in the archive, emit WARN [aif-verify] plan <name> is archived; verifying archived plan.
If no plan artifact is found:
AskUserQuestion: No plan artifact found. What should I verify?
Options:
1. Verify last commit — Check the most recent commit for completeness
2. Verify branch diff — Compare current branch against the configured base branch
3. Cancel<!-- aif:plan-mode:ultra -->; ignore unrelated */index.md files.index.md. A missing/broken/escaping phase link is
a blocking plan-integrity failure because the committed specification is incomplete.Task N in index.md against exactly one matching
## Task N section in its linked phase file. Unmapped tasks, duplicate task
sections, and unlinked phase-*.md files are blocking plan-integrity failures.TaskList → get all tasks and their statuses.ai-factory/DESCRIPTION.md (use path from config) for project context (tech stack, conventions).ai-factory/ARCHITECTURE.md (use path from config) for dependency and boundary rules (if present)rules.api, rules.frontend).ai-factory/ROADMAP.md (use path from config) for milestone alignment checks (if present)## Original Request, treat it as useful original scope context. Use it to understand the user's starting intent, while the task list, committed ## Research Context, and ultra phase specifications remain the executable verification inputs.## Research Context, treat its embedded copy as the committed requirements snapshot. Parse the first Source: / Reference: line with canonical ^(?:Source|Reference):\s+\x60([^\x60]+)\x60\s+\( syntax; for older bare-path lines, fall back to ^(?:Source|Reference):\s+(.+?)\s+\(. Fall back to configured paths.research only when neither form identifies a usable path.research_bundles_dir, require its sibling INDEX.md to contain <!-- aif:research-mode:ultra --> exactly once and link that RESEARCH.md from ## Artifact Index; otherwise emit WARN [research-drift]. Sibling C4/ADR/dependency files remain rationale only.SHA256: is present, extract the current source text strictly between <!-- aif:active-summary:start --> and <!-- aif:active-summary:end -->, remove HTML comment blocks, preserve line order and leading whitespace, trim trailing spaces from every line, use LF endings, and end with one newline. Hash through stdin with shasum -a 256 or sha256sum; the digest is authoritative. Use Updated: only as a legacy fallback when SHA256: is absent. A missing/invalid source or revision mismatch emits WARN [research-drift]; verify against the embedded Research Context and do not expand scope unless the user explicitly requests a rebase/refinement. Skipping this drift check is a verification bug.WARN [research-drift] and
verify against the plan's embedded Research Context.Read .ai-factory/skill-context/aif-verify/SKILL.md — MANDATORY if the file exists.
This file contains project-specific rules accumulated by /aif-evolve from patches,
codebase conventions, and tech-stack analysis. These rules are tailored to the current project.
How to apply skill-context rules:
Enforcement: After generating any output artifact, verify it against all skill-context rules. If any rule is violated — fix the output before presenting it to the user.
# All files changed during this feature/plan
git diff --name-only <configured-base-branch>...HEAD
# Or if on the base branch / in no-git mode, check recent commits
git diff --name-only HEAD~$(number_of_tasks)..HEADIf git.enabled = false, skip branch diffing entirely and gather changed files from:
Store as CHANGED_FILES.
Go through every task in the plan and verify it was actually implemented.
For each task:
TaskGet(taskId) → Get full description, requirements, acceptance criteriaFor each requirement in the task description:
Glob and Grep to find the code that implements itFor each task, produce a verification result:
✅ Task #1: Create user model — COMPLETE
- User model created at src/models/user.ts
- All fields present (id, email, name, createdAt, updatedAt)
- Validation decorators added
⚠️ Task #3: Add password reset endpoint — PARTIAL
- Endpoint created at src/api/auth/reset.ts
- MISSING: Email sending logic (task mentioned SendGrid integration)
- MISSING: Token expiration check
❌ Task #5: Add rate limiting — NOT FOUND
- No rate limiting middleware detected
- No rate-limit related packages in dependenciesStatuses:
✅ COMPLETE — all requirements verified in code⚠️ PARTIAL — some requirements implemented, some missing❌ NOT FOUND — implementation not detected⏭️ SKIPPED — task was intentionally skipped by user during implementDetect the build system and verify the project compiles:
| Detection | Command |
|---|---|
go.mod | go build ./... |
tsconfig.json | npx tsc --noEmit |
package.json with build script | npm run build (or pnpm/yarn/bun) |
pyproject.toml | python -m py_compile on changed files |
Cargo.toml | cargo check |
composer.json | composer validate |
If build fails → report errors with file:line references.
If the project has tests and they were part of the plan:
| Detection | Command |
|---|---|
jest.config.* or vitest | npm test |
pytest | pytest |
go test | go test ./... |
phpunit.xml* | ./vendor/bin/phpunit |
Cargo.toml | cargo test |
If tests fail → report which tests failed and whether they relate to the implemented tasks.
If no tests exist or testing was explicitly skipped in the plan → note it but don't fail.
If linters are configured:
| Detection | Command |
|---|---|
eslint.config.* / .eslintrc* | npx eslint [changed files] |
.golangci.yml | golangci-lint run ./... |
ruff in pyproject.toml | ruff check [changed files] |
.php-cs-fixer* | ./vendor/bin/php-cs-fixer fix --dry-run --diff |
Only lint the changed files to keep output focused.
package.json, go.mod, requirements.txt, composer.json)Verify the full chain authoritative requirements → plan → implementation → verification evidence, not only plan-to-code agreement.
## Requirements Reconciliation, resolve citations to
the selected research source against the embedded ## Research Context; the
live research file remains drift-only unless the user explicitly rebases the
plan. Re-read other cited source passages. Otherwise use the Original Request,
committed Research Context, project rules, and authoritative sources they
explicitly reference.WARN [requirement-ambiguity] in normal or
lenient mode, and ERROR [requirement-ambiguity] in strict mode.ERROR [requirement-conflict] and blocks verification even
when the plan, code, and tests agree with one another.Respect the plan's testing setting. If tests were intentionally skipped, use static inspection plus the plan's runnable/manual verification evidence; report missing evidence as a warning in normal mode and a failure in strict mode.
Check for discrepancies between what the plan says and what was built:
Search for things that should have been cleaned up:
Grep in CHANGED_FILES: [T][O][D][O]|[F][I][X][M][E]|HACK|[X][X][X]|TEMP|PLACEHOLDER|console\.log\(.*debug|print\(.*debugReport any found — they might be intentional, but flag them.
Check if the implementation introduced any new config requirements:
Grep in CHANGED_FILES: process\.env\.|os\.Getenv\(|os\.environ|env\(|getenv\(|config\(Cross-reference with .env.example, .env.local, README, or docs to ensure they're documented.
Check if .ai-factory/DESCRIPTION.md reflects the current state:
Apply the canonical contract from references/CONTEXT-GATES-AND-OWNERSHIP.md.
Evaluate and report each gate explicitly:
Architecture gate
Rules gate
Roadmap gate
## Roadmap Linkage from the plan when present).ai-factory/ROADMAP.md missing, ambiguous mapping, or no milestone linkage for feat/fix/perf scopeNormal mode behavior:
Strict mode behavior:
feat/fix/perf remains a warning (even when .ai-factory/ROADMAP.md exists).Human logging/reporting format:
WARN [gate-name] ...ERROR [gate-name] ...If the user wants a standalone rules-only pass, suggest /aif-rules-check. Keep human context-gate labels at WARN / ERROR, then derive the final machine-readable gate result from the full verification report.
Machine-readable gate result:
aif-gate-result JSON block after the human-readable verification report."gate": "verify"."status": "pass|warn|fail" where:
fail = incomplete required tasks, failed blocking quality checks, strict-mode context gate failures, or other blockers requiring remediation.warn = only non-blocking warnings remain, optional checks were skipped, docs/test gaps were accepted as warnings, or context drift is ambiguous.pass = no blocking or warning findings remain."blocking": true|false; set it to true only when the result should stop commit or merge flow."blockers": [; keep non-blocking notes in the human summary."affected_files": [."suggested_next": { to /aif-fix, /aif-rules, /aif-architecture, /aif-roadmap, /aif-commit, or null according to references/GATE-RESULT-CONTRACT.md./aif-verify is read-only for context artifacts. Do not edit or regenerate .ai-factory/* files here.
If you detect that a context artifact is stale, missing, or ambiguous, report it as a drift finding and provide the owner-command remediation:
DESCRIPTION.md drift → suggest /aif (or note that /aif-implement should have updated it during implementation)ARCHITECTURE.md drift → suggest /aif-architectureROADMAP.md drift → suggest /aif-roadmap check (or /aif-roadmap <update request>)RULES.md drift → suggest /aif-rules <rule text>Ask the user a single optional question only if drift was detected and fixing it now would materially improve correctness:
AskUserQuestion: Context drift detected. Capture updates now?
Options:
1. Yes — show the exact commands to run (recommended)
2. No — proceed without updating contextWrite the human-readable verification report in ui_language. The template below defines structure only; keep stable technical tokens and the final aif-gate-result JSON schema unchanged.
## Verification Report
### Task Completion: 7/8 (87%)
| # | Task | Status | Notes |
|---|------|--------|-------|
| 1 | Create user model | ✅ Complete | |
| 2 | Add registration endpoint | ✅ Complete | |
| 3 | Add password reset | ⚠️ Partial | Missing: email sending |
| 4 | Add JWT auth middleware | ✅ Complete | |
| 5 | Add rate limiting | ✅ Complete | |
| 6 | Add input validation | ✅ Complete | |
| 7 | Add error handling | ✅ Complete | |
| 8 | Update API docs | ❌ Not found | No changes in docs/ |
### Code Quality
- Build: ✅ Passes
- Tests: ✅ 42 passed, 0 failed
- Lint: ⚠️ 2 warnings in src/api/auth/reset.ts
### Requirements Consistency
- Source reconciliation: ✅ Passes
- Supported combinations: ✅ Covered
- Representative artifact path: ✅ Verified / ⏭️ Not applicable
### Issues Found
1. **Task #3 incomplete** — Password reset endpoint created but email sending not implemented (SendGrid integration missing)
2. **Task #8 not done** — API documentation not updated despite plan requirement
3. **2 unfinished markers found** — src/services/auth.ts:45, src/middleware/rate-limit.ts:12
4. **New env var undocumented** — `SENDGRID_API_KEY` referenced but not in .env.example
### No Issues
- All imports resolved
- No unused dependencies
- DESCRIPTION.md up to date
- No leftover debug logsAfter the human-readable report and overall status, append exactly one final aif-gate-result fenced JSON block.
{
"schema_version": 1,
"gate": "verify",
"status": "pass",
"blocking": false,
"blockers": [],
"affected_files": [],
"suggested_next": {
"command": "/aif-commit",
"reason": "Verification passed without blockers."
}
}Schema reminder: "status": "pass|warn|fail", "blocking": true|false, "blockers": [, "affected_files": [, "suggested_next": {.
If issues were found:
AskUserQuestion: Verification found issues. What should we do?
Options:
1. Fix now (recommended) — Use /aif-fix to address all issues
2. Fix critical only — Use /aif-fix for incomplete tasks, skip warnings
3. Fix directly here — Address issues in this session without /aif-fix
4. Accept as-is — Mark everything as done, move onIf "Fix now" or "Fix critical only":
/aif-fix and pass a concise issue summary as argument/aif-fix complete Task #3 password reset email flow, implement Task #8 docs update, remove unfinished markers in src/services/auth.ts and src/middleware/rate-limit.ts, document SENDGRID_API_KEY in .env.example/aif-fix/aif-fix, continue with direct implementation in this session/aif-implement).env.example and docsIf "Accept as-is":
After verification is complete, suggest next steps based on result:
/aif-fix first## Verification Complete
Suggested next steps:
1. 🛠️ /aif-fix [issue summary] — Fix remaining verification issues
2. 🔒 /aif-security-checklist — Run security audit on the new code
3. 👀 /aif-review — Code review of the implementation
4. 💾 /aif-commit — Commit the changes
Which would you like to run? (or skip all)AskUserQuestion: Run additional checks?
Options:
1. Fix issues — Run /aif-fix with verification findings
2. Security check — Run /aif-security-checklist on changed files
3. Code review — Run /aif-review on the implementation
4. Both — Run security check, then code review
5. Skip — Proceed to commitIf fix issues selected → suggest invoking /aif-fix <issue summary>
If security check selected → suggest invoking /aif-security-checklist
If code review selected → suggest invoking /aif-review
If both → suggest security first, then review
If skip → suggest /aif-commit
Suggest the user to free up context space if needed: /clear (full reset) or /compact (compress history).
When invoked with --strict:
/aif-verify --strictfeat/fix/perf is a warning even in strict modeStrict mode is recommended before merging to the configured base branch or creating a pull request.
/aif-verify/aif-verify --strict/aif-verify
→ No plan found → verify branch diff against the configured base branch06a84d3
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.