ワンクリックで
sdd-fidelity-review
// Review implementation fidelity against specifications by comparing actual code to spec requirements. Identifies deviations, assesses impact, and generates compliance reports for tasks, phases, or entire specs.
// Review implementation fidelity against specifications by comparing actual code to spec requirements. Identifies deviations, assesses impact, and generates compliance reports for tasks, phases, or entire specs.
Task preparation skill for spec-driven workflows. Reads specifications, identifies next actionable tasks, and creates detailed execution plans. Use when ready to implement a task from an existing spec - bridges the gap between planning and coding.
Validate SDD JSON specs, auto-fix common issues, generate detailed reports, and analyze dependencies.
Targeted query capabilities for machine-readable codebase documentation with cross-reference tracking, call graph analysis, and workflow automation. Enables fast lookups of classes, functions, dependencies, and function relationships without parsing source code.
LLM-powered documentation generation for narrative architecture docs, tutorials, and developer guides. Uses AI consultation to create contextual, human-readable documentation from code analysis and spec data.
Plan-first development methodology that creates detailed specifications before coding. Use when building features, refactoring code, or implementing complex changes. Creates structured plans with phases, file-level details, and verification steps to prevent drift and ensure production-ready code.
AI-powered PR creation after spec completion. Analyzes spec metadata, git diffs, commit history, and journal entries to generate comprehensive PR descriptions with user approval before creation.
| name | sdd-fidelity-review |
| description | Review implementation fidelity against specifications by comparing actual code to spec requirements. Identifies deviations, assesses impact, and generates compliance reports for tasks, phases, or entire specs. |
The sdd-fidelity-review skill compares actual implementation against SDD specification requirements to ensure fidelity between plan and code. It identifies deviations, assesses their impact, and generates detailed compliance reports.
This skill is part of the Spec-Driven Development quality assurance family:
Use this skill when you need to:
Do NOT use for:
This skill may run operations that take up to 5 minutes. Be patient and wait for completion.
Bash(command="...", timeout=300000)run_in_background=True for test suites, builds, or analysisPolling BashOutput repeatedly creates spam and degrades user experience. Long operations should run in foreground with appropriate timeout, not in background with frequent polling.
# Test suite that might take 5 minutes (timeout in milliseconds)
result = Bash(command="pytest src/", timeout=300000) # Wait up to 5 minutes
# The command will block here until completion - this is correct behavior
# Don't use background + polling
bash_id = Bash(command="pytest", run_in_background=True)
output = BashOutput(bash_id) # Creates spam!
Scope: Single phase within specification (typically 3-10 tasks) When to use: Phase completion checkpoints, before moving to next phase Output: Phase-specific fidelity report with per-task breakdown Best practice: Use at phase boundaries to catch drift before starting next phase
Scope: Individual task implementation (typically 1 file) When to use: Critical task validation, complex implementation verification Output: Task-specific compliance check with implementation comparison Best practice: Use for high-risk tasks (auth, data handling, API contracts)
Note: For full spec reviews, run phase-by-phase reviews for better manageability and quality.
This skill delegates ALL spec file access to the sdd fidelity-review CLI tool:
Read() tool on .json spec files - bypasses hooks and wastes context tokens (specs can be 50KB+)jq to query spec files via Bashcat, head, tail, grep)sdd --version && cat specs/active/spec.json)sdd fidelity-review CLI commands to access spec dataAll spec loading, task extraction, and requirement analysis happens inside the CLI tool.
Before running a fidelity review, you may need to gather context about the spec, phases, or tasks. Use these efficient CLI commands instead of creating bash loops:
# Get all tasks in a phase
sdd query-tasks <spec-id> --parent phase-1 --json
# Get tasks by status
sdd query-tasks <spec-id> --status completed --json
# Combine filters
sdd query-tasks <spec-id> --parent phase-2 --status pending --json
# Get all tasks (no limit)
sdd query-tasks <spec-id> --limit 0 --json
# Get detailed information about a specific task
sdd get-task <spec-id> task-1-3
# See all phases with progress information
sdd list-phases <spec-id>
# BAD: Bash loop calling sdd get-task repeatedly
for i in 1 2 3 4 5; do
sdd get-task spec-id "task-1-$i"
done
# BAD: Creating temp scripts
cat > /tmp/get_tasks.sh << 'EOF'
...
EOF
# BAD: Using grep to parse JSON
sdd get-task spec-id task-1 | grep -o '"status":"[^"]*"'
# GOOD: Single command gets all tasks in phase-1
sdd query-tasks spec-id --parent phase-1 --json
# GOOD: Parse JSON properly with jq if needed
sdd query-tasks spec-id --parent phase-1 --json | jq '.[] | select(.status=="completed")'
This skill delegates all fidelity review logic to the dedicated sdd fidelity-review CLI tool, which handles spec loading, implementation analysis, AI consultation, and report generation.
Ensure the user provides:
spec_id: The specification to reviewtask_id (for task-level review) or phase_id (for phase-level review)Build the appropriate sdd fidelity-review command based on review scope:
For task review:
sdd fidelity-review <spec-id> --task <task-id>
For phase review:
sdd fidelity-review <spec-id> --phase <phase-id>
Use the Bash tool to execute the constructed command:
sdd fidelity-review <spec-id> --task <task-id>
CRITICAL: The CLI tool handles ALL spec file operations. Do NOT:
/tmp/*.sh)for i in 1 2 3; do sdd get-task...)sdd get-task in a loop - use sdd query-tasks for batch retrievalWhen you need task/spec context before running fidelity review:
✅ Use sdd query-tasks <spec-id> --parent <phase-id> --json to get all tasks in a phase
✅ Use sdd query-tasks <spec-id> --status <status> --json to filter by status
✅ Use sdd get-task <spec-id> <task-id> to get a single task's details
✅ Use sdd list-phases <spec-id> to see all phases
Then execute the fidelity review with the appropriate scope.
Your job is to execute the CLI command and parse its JSON output.
The CLI tool handles:
The CLI returns JSON output with the structure:
{
"spec_id": "...",
"review_type": "task|phase",
"scope": {"id": "...", "title": "..."},
"summary": {
"tasks_reviewed": 0,
"files_analyzed": 0,
"deviations_found": 0,
"fidelity_score": 0
},
"findings": [
{
"task_id": "...",
"assessment": "exact_match|minor_deviation|major_deviation|missing",
"deviations": [...],
"impact": "low|medium|high",
"ai_consensus": "..."
}
],
"recommendations": [...]
}
Parse this JSON, surface the structured findings directly to the invoking workflow, and include a link or path to the saved JSON report. The agent’s responsibility is to faithfully relay the CLI’s assessed deviations, recommendations, consensus signals, and metadata—perform validation/formatting as needed, but do not introduce any new analysis beyond what the CLI returned. Do not open or read the saved artifact; simply point the caller to its location.
# Implementation Fidelity Review
**Spec:** {spec-title} ({spec-id})
**Scope:** {review-scope}
**Date:** {review-date}
## Summary
- **Tasks Reviewed:** {count}
- **Files Analyzed:** {count}
- **Overall Fidelity:** {percentage}%
- **Deviations Found:** {count}
## Fidelity Score
- ✅ Exact Matches: {count} tasks
- ⚠️ Minor Deviations: {count} tasks
- ❌ Major Deviations: {count} tasks
- 🚫 Missing Functionality: {count} items
## Detailed Findings
### Task: {task-id} - {task-title}
**Specified:**
- {requirement-1}
- {requirement-2}
**Implemented:**
- {actual-1}
- {actual-2}
**Assessment:** {exact-match|minor-deviation|major-deviation}
**Deviations:**
1. {deviation-description}
- **Impact:** {low|medium|high}
- **Recommendation:** {action}
## Recommendations
1. {recommendation-1}
2. {recommendation-2}
## Journal Analysis
**Documented Deviations:**
- {task-id}: {deviation-summary} (from journal on {date})
**Undocumented Deviations:**
- {task-id}: {deviation-summary} (should be journaled)
Fidelity reviews can be triggered at multiple points in the development workflow:
1. After task completion (Optional verification):
2. Phase completion (Recommended):
3. Spec completion (Pre-PR audit):
4. PR review (Automated compliance):
The sdd-fidelity-review skill hands its synthesized results—JSON findings plus the saved JSON report reference—directly back to the caller. The invoking workflow decides what to do next. Common follow-up actions the main agent may optionally consider include journaling deviations, planning remediation work, running regression tests, or proposing spec updates after stakeholder review. No automatic delegation occurs; the fidelity-review skill’s responsibility ends once it delivers the consensus results and report pointer.
Fidelity review generates a detailed report comparing implementation against specification:
Usage Pattern:
sdd fidelity-review CLI tool.fidelity-reviews/Implementation precisely matches specification requirements. No deviations detected.
Small differences from spec with no functional impact:
Significant differences affecting functionality or architecture:
Specified features not implemented:
✅ Validate that spec_id and task_id/phase_id are provided ✅ Present findings clearly with categorized deviations ✅ Highlight recommendations for remediation ✅ Note AI consensus from multiple tool perspectives ✅ Provide context from the fidelity assessment ✅ Surface the saved JSON report path so the caller can inspect the full consensus artifacts
❌ Attempt to manually implement review logic (CLI handles it)
❌ Read spec files directly with Read/Python/jq/Bash (CLI loads them)
❌ Create temporary bash scripts or use bash loops (e.g., for i in...; do sdd get-task...)
❌ Call sdd get-task in a loop - use sdd query-tasks for batch queries instead
❌ Use grep/sed/awk to parse JSON - all CLI commands return structured JSON
❌ Skip input validation
❌ Ignore the CLI tool's consensus analysis
❌ Make up review findings not from CLI output
❌ Perform additional analysis beyond the CLI's consensus results
❌ Open the persisted JSON report; reference its filepath instead
Phase review:
Task(
subagent_type: "sdd-toolkit:sdd-fidelity-review-subagent",
prompt: "Review phase phase-1 in spec user-auth-001. Compare all completed tasks in Phase 1 (User Model & Authentication) against specification requirements.",
description: "Phase 1 fidelity review"
)
Task-specific review:
Task(
subagent_type: "sdd-toolkit:sdd-fidelity-review-subagent",
prompt: "Review task task-2-3 in spec user-auth-001. Compare implementation in src/middleware/auth.ts against task requirements for JWT authentication middleware.",
description: "Review auth middleware task"
)
If invoked without required information, the skill returns a structured error indicating which fields are missing.
If the specified spec file doesn't exist, the skill reports which directories were searched and suggests verification steps.
If the specified files don't exist, the skill warns that the task appears incomplete or the file paths are incorrect.
A successful fidelity review:
specs/.fidelity-reviews/ directoryFor creating specifications, use Skill(sdd-toolkit:sdd-plan). For task progress updates, use sdd-update-subagent. For running tests, use run-tests-subagent.