Specification quality checker for spec-generator documents. Validates requirement.md, design.md, tasks.md for consistency, completeness, and quality. Detects requirement ID mismatches, missing sections, contradictions, and ambiguous expressions. English triggers: "inspect specs", "check specification quality", "validate requirements" 日本語トリガー: 「仕様書を検査」「品質チェック」「仕様を検証」「spec-inspect実行」
Automatically validates spec-generator output (requirement.md, design.md, tasks.md) and reports quality issues.
Identify the .specs/{project-name}/ path from user input or current context.
Validation:
.specs/{project-name}/requirement.md exists.specs/{project-name}/design.md exists.specs/{project-name}/tasks.md existsIf any file is missing, display an error message and exit.
Read all three specification files:
requirement_content = Read(".specs/{project-name}/requirement.md")
design_content = Read(".specs/{project-name}/design.md")
tasks_content = Read(".specs/{project-name}/tasks.md")
# Optional: acceptance test plan (only present for full-workflow / pipeline specs).
# Absence is expected for legacy three-document specs — do NOT treat as an error.
test_content = Read(".specs/{project-name}/test.md") or None
# Optional: load coding rules if available
coding_rules = Read("docs/coding-rules.md") or None
# Also check CLAUDE.md / AGENTS.md for alternative path
Detect the specification language, resolve spec-writing by name from the currently available skills, and read its complete SKILL.md plus the matching references/abstract-verbs.md or references/abstract-verbs.ja.md once as the primary vocabulary source. Read the matching abstract-process-check.md and projection-consistency-check.md references (*.ja.md for Japanese), and run both checks in Step 3. If the skill, vocabulary, required columns, or IDs cannot be read, follow the abstract-process reference's vocabulary-error procedure without inferring a pattern list; all other checks must continue.
Execute the following checks sequentially. Add detected issues to an issues list.
Purpose: Verify that requirement IDs defined in requirement.md are correctly referenced in design.md, tasks.md, and test.md when present.
Procedure:
\[(REQ|NFR|CON|ASM|T)-\d{3,}\])Detection patterns:
[CRITICAL] ID referenced in design.md, tasks.md, or test.md but not defined in requirement.md
ID: CRITICAL-{seq}
Title: "Requirement ID {req_id} does not exist"
File: design.md, tasks.md, or test.md
Line: {line_number}
Description: "{req_id} is referenced in {file} but not defined in requirement.md"
Suggestion: "Add {req_id} to requirement.md or fix the reference"
[INFO] ID defined in requirement.md but never referenced
ID: INFO-{seq}
Title: "Requirement ID {req_id} is unreferenced"
File: requirement.md
Line: {line_number}
Description: "{req_id} is not linked to any design or task"
Suggestion: "Is this requirement still needed? Consider removing if unnecessary"
[WARNING] Insufficient requirement coverage (calculate design.md reference rate for all IDs including [NFR-XXX]; warn if below 100%)
ID: WARNING-{seq}
Title: "Requirement coverage: {covered}/{total} ({percentage}%)"
Description: "The following requirements are not mentioned in design.md: {uncovered_list}"
Suggestion: "Add coverage for each requirement in design.md"
Purpose: Confirm each spec has the expected sections, a non-empty scope boundary, and testable requirements.
Procedure:
references/requirement-boundary-check.md / .ja.md against requirement.md.Output: One WARNING-{seq} per missing required section, empty selected out-of-scope section, or REQ / NFR block without a non-empty acceptance-criteria list.
Purpose: Detect contradictory statements across specification documents.
Detection examples:
Procedure:
Detection pattern:
ID: WARNING-{seq}
Title: "Contradiction: {concept}"
File: requirement.md, design.md
Line: {line_number}
Description: "requirement.md states {value1}, but design.md states {value2}"
Suggestion: "Unify to one value"
Purpose: Detect vague expressions that lack the specificity needed for implementation.
Detection keywords (English):
Detection keywords (Japanese):
Procedure:
Detection pattern:
ID: INFO-{seq}
Title: "Ambiguous expression: '{keyword}'"
File: {filename}
Line: {line_number}
Description: "The expression '{context}' may be interpreted differently by implementors"
Suggestion: "Specify concrete numbers or criteria"
Purpose: Ensure consistent terminology usage across all specifications.
Detection patterns:
Procedure:
Output: WARNING-{seq} "Terminology inconsistency: '{term1}' vs '{term2}'" + recommendation to unify
Purpose: Verify that design.md components have corresponding implementation tasks in tasks.md.
Detection patterns:
Procedure:
Output: WARNING-{seq} "Design element '{component}' has no corresponding task"
Purpose: Verify that task dependencies are logically correct.
Detection patterns:
Procedure:
Output: WARNING-{seq} "Circular dependency: {taskA} ⇄ {taskB}" or "Illogical dependency order"
Purpose: Detect technically difficult or contradictory requirements.
Detection patterns:
Output: WARNING-{seq} "Potentially infeasible: {requirement}" + alternative suggestion
Purpose: Detect clearly necessary but undocumented requirements.
Detection patterns:
Procedure:
Output: WARNING-{seq} "Possible missing requirement: {requirement_type} for {feature} is undefined"
Purpose: Verify consistent naming conventions across specifications.
Detection patterns:
user_id vs userId vs userID)Procedure:
Output: INFO-{seq} "Naming convention inconsistency: {pattern1} ({count1} occurrences) vs {pattern2} ({count2} occurrences)"
Purpose: Verify consistent directory structure and placement rules.
Detection patterns:
src/features/A/ vs src/components/B/)tests/ vs __tests__/)Output: INFO-{seq} "Directory structure inconsistency: {pattern description}"
Purpose: Detect custom implementations of functionality already available in declared libraries.
Detection patterns:
Procedure:
Output: INFO-{seq} "Possible reinvention: {task} could be handled by {library_name}"
Purpose: Check that specifications comply with project-specific rules defined in CLAUDE.md / AGENTS.md and coding-rules.md.
Procedure:
CLAUDE.md, AGENTS.md, and .claude/ from the project rootdocs/coding-rules.md if it exists (or path from CLAUDE.md/AGENTS.md)[MUST] rules from coding-rules.mdDetection examples:
coding-rules.md specific checks:
[MUST] kebab-case vs design: UserProfile.service.ts)[MUST] 80%+ coverage vs tasks.md has no test tasks)[MUST] Use Prisma vs design: direct SQL)Output: WARNING-{seq} "Project rule violation: {rule} conflicts with {violation_location}"
Before starting Check 14, read
references/extended-quality-checks.md
completely (.ja.md for Japanese). Execute its Checks 14 through 19 in order
and use each check's severity and output contract without modification.
Aggregate detected issues by severity:
Write a Markdown report to .specs/{project-name}/inspection-report.md.
Template: # spec-inspect Report — {project_name} → Inspection summary (date, targets, counts) → Severity sections (CRITICAL / WARNING / INFO). Each issue: ### [{issue.id}] {issue.title} + file:line, details, suggestion. Display "None" for sections with 0 issues.
Save with Write tool to .specs/{project-name}/inspection-report.md.
Display a user-friendly summary:
spec-inspect complete
Results:
CRITICAL: {count}
WARNING: {count}
INFO: {count}
{if critical_count > 0}
Critical issues found. Fix before implementation.
{if critical_count == 0}
No critical issues found.
Report: .specs/{project-name}/inspection-report.md
Use AskUserQuestion to suggest the next action based on results (header: "Next action" / "次のアクション", multiSelect: false):
| Result | Question | Options | |--------|----------|---------| | Critical issues | "{count} critical issue(s) found. Action needed." / "Critical問題が{count}件。修正が必要です" | "Fix and re-run" / "修正して再実行", "Skip to Issue registration" / "スキップしてIssue登録", "Cancel" / "キャンセル" | | Warning/Info only | "{count} warning(s) found. Proceed to Issue registration?" / "Warningが{count}件。Issue登録しますか?" | "Register Issue" / "Issue登録する", "Fix and re-run" / "修正して再実行", "Cancel" / "キャンセル" | | No issues | "Quality check passed. Register Issues?" / "品質チェック完了。Issue登録しますか?" | "Register Issue" / "Issue登録する", "Cancel" / "キャンセル" |
Handling user selection:
Save inspection results as a temporary file for the next skill:
{
"project_path": ".specs/{project-name}",
"project_name": "{project-name}",
"critical_count": 0,
"warning_count": 0,
"info_count": 0,
"report_path": ".specs/{project-name}/inspection-report.md",
"timestamp": "{ISO 8601}"
}
Save with Write tool:
Write(".specs/{project-name}/.inspection_result.json", json_content)
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer