Use when comparing spec, blueprint, or requirements documents against actual implementation. Detects MISSING features (documented but not implemented), PARTIAL features (incomplete vs spec), EXTRA features (implemented but undocumented), and IMPLEMENTED features. Scores 0-100. Invoke when the user asks to "check spec vs code", "find implementation gaps", "spec drift", "blueprint review", or runs /blueprint-review. Also invoked as the 8th dimension by /audit when spec documents are found.
From solution-auditnpx claudepluginhub nsalvacao/nsalvacao-claude-code-plugins --plugin solution-auditThis skill uses the workspace's default tool permissions.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
Compare spec, blueprint, or requirements documents against actual implementation to detect drift between what was planned and what exists.
Before any analysis, locate spec documents in the project.
Search directories (in priority order):
specs/ — dedicated specifications directoryblueprints/ — blueprint documentsADRs/ or adr/ — Architecture Decision Recordsdocs/ — general documentation directoryFilename patterns to match:
*-spec.md, *-specification.md*-blueprint.md*-requirements.md, *-requirements.txt*-design.md, *-design-doc.mdADR-*.md, adr-*.mdSPEC.md, BLUEPRINT.md, REQUIREMENTS.mdContent signals (grep for these strings):
MUST, SHALL, SHOULD — RFC-style requirement languagerequirements:, acceptance criteria: — structured requirement blockscapabilities:, features: — feature list declarations## Features, ## Requirements, ## Capabilities — section headings1. The system shall...)If no spec documents found: Skip this dimension entirely. Log: "No spec documents found — skipping spec-gap-analysis". This is not an error — many projects do not maintain formal specs.
Parse each spec document and extract structured claims. Every checkable assertion about what the system does, supports, or provides is a claim.
Feature claims — statements about supported behaviors or capabilities:
"The system SHALL/MUST support X""Feature: X" headers or bullets1. Users can..., 2. The CLI supports...Given/When/Then patternsAPI contracts — precise interface definitions:
GET /api/v1/users, POST /uploadmycli init, mycli audit --flagBehavioral requirements — conditional behavior specifications:
"When X happens, Y shall occur""Shall return 404 if not found""After step A, the system moves to state B"Integration points — external dependencies declared in spec:
"integrates with GitHub", "connects to PostgreSQL""supports OAuth 2.0", "compatible with Docker"Configuration options — documented config keys and environment variables:
DATABASE_URL, config.timeout, --max-retries"accepts YAML config at .myapp.yml"Constraints — limits and non-functional requirements:
"SHALL respond in under 200ms""supports Python 3.9+""maximum 100 items per request"Output: A numbered list of claims with type labels. Example:
1. [Feature] CLI supports `audit` command with --dimensions flag
2. [API] GET /health endpoint returns 200 with status object
3. [Behavioral] Invalid config causes exit code 1 with error message
4. [Integration] Connects to GitHub API via token authentication
5. [Config] DATABASE_URL environment variable is required
6. [Constraint] Processes files up to 50MB
For each extracted claim, search for implementation evidence. A grep match alone is not sufficient — always verify context.
CLI commands:
argparse, click, commander.js, cobra, clap)--help output by running the CLI if possibleAPI endpoints:
app.get(, router.post(, @app.route(, router.add_api_route(, http.HandleFunc("/api/v1/users" or a parametric equivalentFeatures and functions:
authenticate, login, auth)Config keys and environment variables:
os.environ, process.env, config.get(, viper.Get()Integration points:
github, boto3, psycopg2)package.json, pyproject.toml, go.mod, Cargo.toml for the dependencyBehavioral requirements:
Evidence record: For each claim, note:
Classify each claim after verification:
IMPLEMENTED — 0 points deducted Claim is fully verified in code. Implementation matches the spec description in all key aspects. Evidence is concrete (file:line reference with context confirming behavior).
PARTIAL — 7 points deducted Implementation exists but is incomplete relative to the spec. Examples: endpoint exists but ignores documented query parameters; CLI command exists but undocumented flags are absent; feature works for the happy path but error handling described in spec is missing.
MISSING — 15 points deducted No implementation evidence found despite searching with multiple keyword variants. This is a "ghost feature" — documented but not built. Must have searched at least 3 keyword variants before classifying as MISSING.
EXTRA — 5 points deducted Significant capability found in code with no corresponding spec documentation. These are "invisible features" — implemented but undocumented. Only flag capabilities with user-visible impact (exported functions, CLI commands, API endpoints, config options). Do not flag internal helpers.
Scoring:
Grade thresholds:
Spec Gap Analysis: [spec file name]
Score: XX/100 [Grade]
Claims assessed: N
IMPLEMENTED: N
PARTIAL: N
MISSING: N (ghost features)
EXTRA: N (invisible features)
| # | Claim | Type | Status | Evidence / Gap |
|---|-------|------|--------|----------------|
| 1 | CLI supports `audit --dimensions` flag | Feature | IMPLEMENTED | src/cli.py:42 — argument registered, handler confirmed |
| 2 | GET /health returns status object | API | MISSING | Searched: "health", "/health", "healthcheck" in src/ — no route definitions found |
| 3 | DATABASE_URL env var required | Config | PARTIAL | src/config.py:18 reads DATABASE_URL but no validation or error on missing value |
| 4 | (undocumented) --verbose flag | Feature | EXTRA | src/cli.py:67 — verbose flag implemented, no mention in spec |
Top gaps (MISSING + PARTIAL):
1. [MISSING] GET /health endpoint — searched "health", "/health", "healthcheck" in src/, routes/, app/ — no matches
2. [PARTIAL] DATABASE_URL validation — found at src/config.py:18, key is read but missing-value error not implemented per spec
Invisible features (EXTRA — consider documenting):
1. --verbose flag — found at src/cli.py:67
When multiple spec files are present, output one block per file, then an aggregated summary:
Spec Gap Analysis: AGGREGATE
Files analyzed: N
Combined score: XX/100
| File | Score | Missing | Partial | Extra |
|------|-------|---------|---------|-------|
| specs/api-spec.md | 72 | 3 | 1 | 0 |
| blueprints/v2-blueprint.md | 88 | 1 | 0 | 2 |
As the 8th dimension in /audit:
learnability-workflow (7th dimension)In /blueprint-review:
Multiple spec files: