.claude/skills/spec-verification/SKILL.md
Verify generated specification documents for context preservation and quality issues. Automatically triggered after document generation. Checks that upstream requirements are preserved and identifies common specification problems.
npx skillsauth add benjaminshoemaker/ai_coding_project_base spec-verificationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Verify specification documents for context preservation (nothing important lost from upstream docs) and quality issues (vague language, missing rationale, untestable criteria, etc.).
This skill runs automatically after generating:
TECHNICAL_SPEC.md (verifies against PRODUCT_SPEC.md)EXECUTION_PLAN.md (verifies against TECHNICAL_SPEC.md)FEATURE_TECHNICAL_SPEC.md (verifies against FEATURE_SPEC.md)EXECUTION_PLAN.md (verifies against FEATURE_TECHNICAL_SPEC.md)Can also be invoked manually via /verify-spec <document-type>.
Copy this checklist and track progress:
Spec Verification Progress:
- [ ] Step 1: Detect document type
- [ ] Step 2: Context preservation check
- [ ] Step 3: Quality check
- [ ] Step 4: Present issues
- [ ] Step 5: Collect user choices
- [ ] Step 6: Apply fixes
- [ ] Step 7: Re-verify
1. Identify document type and locate upstream document(s)
2. Context Preservation Check: Extract key items from upstream, verify in current
3. Quality Check: Scan for common specification anti-patterns
4. Present issues inline with resolution options
5. Collect user choices for each CRITICAL issue
6. Apply fixes to document(s)
7. Re-verify (max 2 iterations, then escalate)
Determine what's being verified and its upstream dependencies:
| Document Being Verified | Upstream Document(s) | Generation Prompt |
|------------------------|---------------------|-------------------|
| TECHNICAL_SPEC.md | PRODUCT_SPEC.md | .claude/skills/technical-spec/PROMPT.md |
| EXECUTION_PLAN.md (greenfield) | TECHNICAL_SPEC.md, PRODUCT_SPEC.md | .claude/skills/generate-plan/PROMPT.md |
| FEATURE_TECHNICAL_SPEC.md | FEATURE_SPEC.md | .claude/skills/feature-technical-spec/PROMPT.md |
| EXECUTION_PLAN.md (feature) | FEATURE_TECHNICAL_SPEC.md, FEATURE_SPEC.md | .claude/skills/feature-plan/PROMPT.md |
| PRODUCT_SPEC.md | None (quality check only) | .claude/skills/product-spec/PROMPT.md |
| FEATURE_SPEC.md | None (quality check only) | .claude/skills/feature-spec/PROMPT.md |
Read the upstream document and extract:
From PRODUCT_SPEC.md / FEATURE_SPEC.md:
From TECHNICAL_SPEC.md / FEATURE_TECHNICAL_SPEC.md:
Create a checklist of extracted items with unique IDs (e.g., CTX-001, CTX-002).
Verify the upstream document was read successfully by confirming at least one key item was extracted. If zero items are extracted, re-read the file and check for formatting issues before proceeding.
For each extracted item, check if it appears in the downstream document:
| Status | Meaning | |--------|---------| | PRESENT | Item found with clear reference | | CONSOLIDATED | Item merged into broader item (acceptable) | | DEFERRED | Explicitly marked as future/out-of-scope (acceptable) | | MISSING | Not found, not deferred - FLAG AS CRITICAL |
CONTEXT PRESERVATION CHECK
==========================
Upstream: PRODUCT_SPEC.md
Downstream: TECHNICAL_SPEC.md
Extracted Items: 12
Present: 9
Consolidated: 2
Deferred: 0
Missing: 1 <- CRITICAL
MISSING ITEMS
-------------
[CTX-007] "Rate limiting for API endpoints"
- Source: PRODUCT_SPEC.md, Section "Security Requirements"
- Not found in TECHNICAL_SPEC.md
- Not marked as deferred
Scan the document for common anti-patterns. Be conservative - only flag obvious, clear problems.
| ID | Check | Pattern to Detect | Severity | |----|-------|-------------------|----------| | Q-001 | Vague/Unmeasurable Language | "fast", "user-friendly", "intuitive", "simple", "easy", "quickly", "responsive" without metrics | CRITICAL | | Q-002 | Subjective Terms | "better", "improved", "enhanced" without baseline | CRITICAL | | Q-003 | Missing Rationale | Architecture/tech decisions without "because" or "to enable" | MAJOR | | Q-004 | Scope Creep | Items in downstream not traceable to upstream | CRITICAL | | Q-005 | Implicit Assumptions | Decisions that assume unstated context | MAJOR | | Q-006 | Conflicting Requirements | Two statements that cannot both be true | CRITICAL |
See references/quality-check-patterns.md for the complete quality check pattern tables for PRODUCT_SPEC, FEATURE_SPEC, TECHNICAL_SPEC, and EXECUTION_PLAN documents.
QUALITY CHECK
=============
Document: TECHNICAL_SPEC.md
Issues Found: 3
[Q-001] CRITICAL: Vague Language
Location: Section "Performance Requirements"
Text: "API responses should be fast"
Problem: "fast" is unmeasurable
[Q-TS-003] CRITICAL: Undefined API Contract
Location: Section "API Endpoints", /api/users
Text: "POST /api/users - Creates a new user"
Problem: No request body or response shape defined
[Q-003] MAJOR: Missing Rationale
Location: Section "Architecture"
Text: "Use Redis for caching"
Problem: No explanation of why Redis vs alternatives
Present all CRITICAL issues inline. Do NOT present MAJOR issues unless there are no CRITICAL issues.
For each CRITICAL issue, present:
────────────────────────────────────────────────────────────
ISSUE 1 of N: [Issue ID] - [Issue Type]
────────────────────────────────────────────────────────────
Location: [Document], [Section/Line]
Problem: [Clear description]
Text: "[The problematic text]"
How would you like to resolve this?
Then use AskUserQuestion with appropriate options based on issue type.
Vague/Unmeasurable Language (Q-001, Q-EP-007):
Missing from Upstream / Scope Creep (CTX-*, Q-004):
Missing Rationale (Q-003):
Undefined Contract/Model (Q-TS-002, Q-TS-003):
Untestable Criteria (Q-EP-001):
Missing Verification Metadata (Q-EP-008):
Conflicting Requirements (Q-006):
Use AskUserQuestion to collect resolution for each CRITICAL issue.
Example:
questions:
- question: "API responses should be fast' is unmeasurable. How should we fix this?"
header: "Vague term"
options:
- label: "API responses return within 200ms p95 (Recommended)"
description: "Sets a specific, measurable latency target"
- label: "Specify custom target"
description: "You'll provide your own performance number"
- label: "Remove requirement"
description: "Delete this requirement entirely"
If user selects "Other" or a custom option, prompt for their input.
For each collected resolution:
old_string.When a fix requires editing an upstream document (e.g., adding a requirement to PRODUCT_SPEC.md):
This fix requires editing the upstream document.
Document: PRODUCT_SPEC.md
Change: Add "Rate limiting: 100 requests/minute per user" to Security Requirements section
Confirm this upstream change? (This expands project scope)
Only proceed with explicit confirmation. After editing an upstream document, re-read the modified section to confirm the change was applied correctly and did not corrupt surrounding content.
After applying fixes:
VERIFICATION INCOMPLETE
=======================
After 2 fix iterations, these issues remain:
[Q-001] Vague Language in Section X
- Attempted fixes: [list]
- Recommendation: Manual review needed
Proceeding with current state. Review flagged sections before execution.
SPECIFICATION VERIFICATION COMPLETE
===================================
Document: TECHNICAL_SPEC.md
Status: PASSED | PASSED WITH NOTES | NEEDS REVIEW
Context Preservation:
- Items checked: 12
- All present or explicitly deferred: Yes/No
Quality Check:
- Critical issues found: 2
- Critical issues resolved: 2
- Major issues noted: 1 (non-blocking)
Fixes Applied:
- TECHNICAL_SPEC.md: 2 edits
- PRODUCT_SPEC.md: 0 edits
Notes:
- [Q-003] Missing rationale for Redis - marked for future documentation
Ready to proceed: Yes/No
To avoid noisy reports:
| Severity | Meaning | Action | |----------|---------|--------| | CRITICAL | Will cause implementation problems or lost requirements | BLOCKS - must resolve | | MAJOR | Should be addressed but won't break implementation | Note for user, continue | | MINOR | Style/preference issue | Ignore unless no other issues |
The skill can be invoked manually:
/verify-spec technical-spec # Verify TECHNICAL_SPEC.md
/verify-spec execution-plan # Verify EXECUTION_PLAN.md
/verify-spec feature-technical # Verify FEATURE_TECHNICAL_SPEC.md
/verify-spec feature-plan # Verify feature EXECUTION_PLAN.md
/verify-spec product-spec # Quality check only (no upstream)
/verify-spec feature-spec # Quality check only (no upstream)
Input: Just generated TECHNICAL_SPEC.md from PRODUCT_SPEC.md
Step 1: Detect document type = TECHNICAL_SPEC, upstream = PRODUCT_SPEC
Step 2: Extract 8 key items from PRODUCT_SPEC:
Verify in TECHNICAL_SPEC:
Step 3: Quality check finds:
Step 4-5: Present 3 issues, collect resolutions:
Step 6: Apply 3 edits to TECHNICAL_SPEC.md
Step 7: Re-verify - all clear
Step 8: Report PASSED, ready to proceed
If issues persist after 2 fix iterations:
If upstream document is missing or unreadable:
If user declines to resolve CRITICAL issues:
| Situation | Action |
|-----------|--------|
| Upstream document not found at expected path | Skip context preservation check; proceed with quality checks only and note the limitation in the report |
| Document is not valid Markdown (cannot parse headings/sections) | Report "Unable to parse document structure" and provide manual verification steps as fallback |
| Edit tool fails to match old_string in the document | Re-read the document to get current content, then retry with corrected context |
| User declines to resolve all CRITICAL issues | Do NOT silently proceed; report unresolved count and warn about downstream impacts |
| Re-verification loop exceeds 2 iterations | Stop automatic fixes, list remaining issues, and escalate to user for manual resolution |
If document format prevents parsing:
testing
Audit project alignment with VISION.md, identify SDLC gaps, and generate feature proposals. Use when reviewing strategic direction or planning new features.
development
Run code-verification on a specific task. Use to verify a single task's acceptance criteria after implementation.
testing
Resolve Vercel preview deployment URL for the current git branch. Invoked by browser-verification when deployment.enabled is true, or directly to check deployment status. Use to check deployment status or when browser verification needs a URL.
tools
Discover and sync all toolkit-using projects with the latest skills. Use when skills are modified, after the post-commit hook reminds you, or to batch-sync multiple projects.