spec-audit-en
Treat spec documents as the Single Source of Truth. Detect implementation gaps and create GitHub Issues.
Prerequisites
- Claude Code environment
gh CLI (for Issue creation)
Arguments
- No arguments: Auto-discover docs and run full check
- Path (e.g.,
/spec-audit-en docs/api-spec.md): Check specific document(s)
Phase 1: Discovery
If no path argument is given, auto-discover documents from the project root using Glob:
docs/, spec/ directories
README.md, ARCHITECTURE.md, CLAUDE.md
- OpenAPI/Swagger definitions (
*.yaml, *.json)
- Other
.md files
Show the discovered document list to the user and confirm the check targets.
Detection granularity is per function/endpoint. Report specific items like "DELETE /users/:id is not implemented", not entire sections.
Detection covers all of:
- Spec vs Implementation: Features defined in specs but not implemented
- TODO/FIXME/HACK: Incomplete markers in code
- Skipped tests:
skip, pending, xit, xdescribe, etc.
- API schema gaps: OpenAPI/Swagger definitions vs actual handlers
Phase 2: Document Analysis
- Read target documents determined in Phase 1
- Extract concrete claims and specifications:
- Endpoint definitions, function signatures, CLI arguments
- Data models, table definitions
- Feature lists, behavior descriptions
- Config items, environment variables
- Create tasks with
TaskCreate to track check targets
Phase 3: Implementation Cross-check
Refer to references/check-criteria.md for detection criteria.
3-1: Spec vs Implementation
- Extract claims from documents (function names, paths, config values, behaviors) one by one
- Search for corresponding implementation using
Explore agent or Grep/Glob
- Determine: matches / mismatches / not implemented
- Record document-side line numbers and implementation-side file:line for mismatches
3-2: TODO/FIXME/HACK
Grep for TODO, FIXME, HACK, XXX, TEMP
- Record each marker's content, file, and line number
- Link to spec if related
3-3: Skipped Tests
Grep for:
- JS/TS:
it.skip, describe.skip, xit, xdescribe, test.skip
- Go:
t.Skip
- Python:
@pytest.mark.skip, @unittest.skip, self.skipTest
- Ruby:
skip, pending
- Others: adjust based on project language
- Record skip reason comments, file, and line number
3-4: API Schema Gaps
- Read OpenAPI/Swagger definitions if present
- Search for handlers/routes corresponding to defined endpoints
- Record unimplemented endpoints
Phase 4: Report Generation and Output
- Aggregate results by severity (see
references/check-criteria.md)
- Generate report using
templates/report.md format
- Ask user via
AskUserQuestion for output destination:
- Create GitHub Issues (Recommended)
- Save as local MD file: Generate
spec-audit-report.md at project root
- Console output: Display report in conversation
Phase 5: Issue Creation
When "Create GitHub Issues" is selected:
- Show a summary list of all findings (title + severity)
- Ask via
AskUserQuestion for Issue creation mode:
- Single Issue (Recommended): Combine all findings into one Issue with a checklist
- Individual Issues: Create one Issue per finding
- Duplicate check:
gh issue list --state open --search "<summary>" for existing Issues. If duplicate found: ask to skip or create new
- Issue body follows
templates/issue.md
gh issue create with labels: spec-audit + severity label (severity:critical, severity:high, severity:medium, severity:low)
- Report created Issue URL(s) to user
Rules
- Never report gaps based on speculation. Verify against actual implementation code
- Show both document-side and implementation-side locations for every gap
- Do not modify code. Deliverables are Issues and reports only
- Always get user approval before creating Issues
- Track progress with
TaskCreate/TaskUpdate
- When many gaps are found, prioritize severity 🔴🟠; 🟡🟢 may be omitted
1---2name: spec-audit-en3description: Detect unimplemented features, TODOs, skipped tests, and API schema gaps, then create Issues4---56# spec-audit-en78Treat spec documents as the Single Source of Truth. Detect implementation gaps and create GitHub Issues.910## Prerequisites1112- Claude Code environment13- `gh` CLI (for Issue creation)1415## Arguments1617- **No arguments**: Auto-discover docs and run full check18- **Path** (e.g., `/spec-audit-en docs/api-spec.md`): Check specific document(s)1920## Phase 1: Discovery2122If no path argument is given, auto-discover documents from the project root using `Glob`:23- `docs/`, `spec/` directories24- `README.md`, `ARCHITECTURE.md`, `CLAUDE.md`25- OpenAPI/Swagger definitions (`*.yaml`, `*.json`)26- Other `.md` files2728Show the discovered document list to the user and confirm the check targets.2930**Detection granularity is per function/endpoint**. Report specific items like "DELETE /users/:id is not implemented", not entire sections.3132Detection covers all of:331. **Spec vs Implementation**: Features defined in specs but not implemented342. **TODO/FIXME/HACK**: Incomplete markers in code353. **Skipped tests**: `skip`, `pending`, `xit`, `xdescribe`, etc.364. **API schema gaps**: OpenAPI/Swagger definitions vs actual handlers3738## Phase 2: Document Analysis39401. Read target documents determined in Phase 1412. Extract concrete claims and specifications:42 - Endpoint definitions, function signatures, CLI arguments43 - Data models, table definitions44 - Feature lists, behavior descriptions45 - Config items, environment variables463. Create tasks with `TaskCreate` to track check targets4748## Phase 3: Implementation Cross-check4950Refer to `references/check-criteria.md` for detection criteria.5152#### 3-1: Spec vs Implementation53541. Extract claims from documents (function names, paths, config values, behaviors) one by one552. Search for corresponding implementation using `Explore` agent or `Grep`/`Glob`563. Determine: matches / mismatches / not implemented574. Record document-side line numbers and implementation-side file:line for mismatches5859#### 3-2: TODO/FIXME/HACK60611. `Grep` for `TODO`, `FIXME`, `HACK`, `XXX`, `TEMP`622. Record each marker's content, file, and line number633. Link to spec if related6465#### 3-3: Skipped Tests66671. `Grep` for:68 - JS/TS: `it.skip`, `describe.skip`, `xit`, `xdescribe`, `test.skip`69 - Go: `t.Skip`70 - Python: `@pytest.mark.skip`, `@unittest.skip`, `self.skipTest`71 - Ruby: `skip`, `pending`72 - Others: adjust based on project language732. Record skip reason comments, file, and line number7475#### 3-4: API Schema Gaps76771. Read OpenAPI/Swagger definitions if present782. Search for handlers/routes corresponding to defined endpoints793. Record unimplemented endpoints8081## Phase 4: Report Generation and Output82831. Aggregate results by severity (see `references/check-criteria.md`)842. Generate report using `templates/report.md` format853. Ask user via `AskUserQuestion` for output destination:86 - **Create GitHub Issues** (Recommended)87 - **Save as local MD file**: Generate `spec-audit-report.md` at project root88 - **Console output**: Display report in conversation8990## Phase 5: Issue Creation9192When "Create GitHub Issues" is selected:93941. Show a summary list of all findings (title + severity)952. Ask via `AskUserQuestion` for Issue creation mode:96 - **Single Issue** (Recommended): Combine all findings into one Issue with a checklist97 - **Individual Issues**: Create one Issue per finding983. Duplicate check: `gh issue list --state open --search "<summary>"` for existing Issues. If duplicate found: ask to skip or create new994. Issue body follows `templates/issue.md`1005. `gh issue create` with labels: `spec-audit` + severity label (`severity:critical`, `severity:high`, `severity:medium`, `severity:low`)1016. Report created Issue URL(s) to user102103## Rules104105- Never report gaps based on speculation. **Verify against actual implementation code**106- Show **both** document-side and implementation-side locations for every gap107- Do not modify code. Deliverables are Issues and reports only108- **Always get user approval** before creating Issues109- Track progress with `TaskCreate`/`TaskUpdate`110- When many gaps are found, prioritize severity 🔴🟠; 🟡🟢 may be omitted