Validate SDD JSON specs, auto-fix common issues, generate detailed reports, and analyze dependencies.
Inherits all available tools
Additional assets for this skill
This skill inherits all available tools. When active, it can use any tool Claude has access to.
reference.mdThe Skill(foundry:sdd-validate) skill provides comprehensive validation for Spec-Driven Development (SDD) JSON specification files. It checks for structural consistency, auto-fixes common issues, generates detailed reports, and analyzes dependencies.
Key capabilities:
jsonschema is available; run pip install claude-skills[validation] to enable)Exit codes indicate the state of your spec, not command success/failure:
Important: Exit code 2 means "I found errors in your spec" not "I failed to validate". The validate command succeeded at detecting issues - your spec just needs work. This is the normal starting point for most specs.
Use Skill(foundry:sdd-validate) to:
foundry-mcp). Tools use the router+action pattern: mcp__plugin_foundry_foundry-mcp__<router> with action="<action>" (for example, mcp__plugin_foundry_foundry-mcp__spec action="validate", mcp__plugin_foundry_foundry-mcp__spec action="fix").mcp__plugin_foundry_foundry-mcp__spec action="validate" spec_id={spec-id} - Check for issuesmcp__plugin_foundry_foundry-mcp__spec action="fix" spec_id={spec-id} - Auto-fix common problems (creates backup)--verbose for details when plateau is reachedKey concept: Error count decreasing = keep fixing. Plateau (same count for 2+ passes) = switch to manual fixes.
Fixing issues often reveals new problems that were previously hidden. Always run mcp__plugin_foundry_foundry-mcp__spec action="validate" after mcp__plugin_foundry_foundry-mcp__spec action="fix" to see the current state.
Track how error count changes across passes:
--verboseSwitch to manual intervention when:
mcp__plugin_foundry_foundry-mcp__spec action="fix" reports "skipped issues requiring manual intervention"All validation commands accept both spec names and paths for maximum flexibility:
Spec name (recommended):
mcp__plugin_foundry_foundry-mcp__spec action="validate" spec_id="pomodoro-timer-2025-11-18-001"
Automatically searches in specs/pending/, specs/active/, specs/completed/, and specs/archived/.
Relative path:
mcp__plugin_foundry_foundry-mcp__spec action="validate" path="specs/pending/pomodoro-timer-2025-11-18-001.json"
mcp__plugin_foundry_foundry-mcp__spec action="validate" path="../other-project/specs/active/my-spec.json"
Absolute path:
mcp__plugin_foundry_foundry-mcp__spec action="validate" path="/full/path/to/my-spec.json"
Smart fallback: If you provide a path that doesn't exist, the command extracts the spec name and searches for it automatically.
Validate the JSON spec structure and print a summary.
mcp__plugin_foundry_foundry-mcp__spec action="validate" spec_id="{spec-id}"
Exit codes:
0 - Clean validation1 - Warnings only2 - Errors detected (expected when spec has issues)Example output:
❌ Validation found 12 errors
8 auto-fixable, 4 require manual intervention
Errors:
- 5 incorrect task count rollups
- 2 missing metadata blocks
- 1 orphaned node (task-5-3)
- 2 circular dependencies
- 2 parent/child mismatches
Run 'spec action="fix"' to auto-fix 8 issues
Auto-fix common validation issues with preview and backup support.
mcp__plugin_foundry_foundry-mcp__spec action="fix" spec_id="{spec-id}" dry_run=true
Parameters:
dry_run=true - Show what would be fixed without modifying filescreate_backup=false - Skip backup creation (use with caution)Auto-fixable issues:
Example:
# Preview fixes
mcp__plugin_foundry_foundry-mcp__spec action="fix" spec_id="my-spec" dry_run=true
📋 Would apply 8 fixes:
- Fix 5 task count rollups
- Add 2 metadata blocks
- Reconnect 1 orphaned node
⚠️ Would skip 4 issues requiring manual intervention:
- task-3-2: Circular dependency
- task-5-2: Dependency references non-existent task
# Apply fixes
mcp__plugin_foundry_foundry-mcp__spec action="fix" spec_id="my-spec"
✅ Applied 8 fixes
Created backup: my-spec.json.backup
# Re-validate
mcp__plugin_foundry_foundry-mcp__spec action="validate" spec_id="my-spec"
❌ Validation found 4 errors (manual intervention required)
Calculate and display comprehensive spec statistics.
mcp__plugin_foundry_foundry-mcp__spec action="stats" spec_id="{spec-id}"
Shows:
Analyze dependencies for cycles, orphans, deadlocks, and bottlenecks.
Note: This command analyzes spec-wide dependency issues. For checking individual task dependencies, use mcp__plugin_foundry_foundry-mcp__task action="prepare" from sdd-next which includes dependency details by default in context.dependencies.
mcp__plugin_foundry_foundry-mcp__spec action="analyze-deps" spec_id="{spec-id}" bottleneck_threshold=3
Analyzes:
Example:
⚠️ Dependency Analysis: 3 issues found
Cycles (2):
1. task-3-2 → task-3-5 → task-3-2
2. task-4-1 → task-4-3 → task-4-1
Orphaned dependencies (1):
task-5-2 references non-existent "task-2-9"
Recommendation: Fix circular dependencies first to unblock work
For detailed issue-to-fix mapping, see
reference.md#issue-to-fix-mapping
Most specs (2-3 passes):
Pass 1: 47 errors → fix → 8 errors
Pass 2: 8 errors → fix → 2 errors
Pass 3: 2 errors → fix → 0 errors ✅
Complex specs with circular deps (4-5 passes):
Pass 1: 88 errors → fix → 23 errors
Pass 2: 23 errors → fix → 4 errors
Pass 3: 4 errors → fix → 4 errors (plateau)
→ Manual: Remove circular dependencies
Pass 4: Validate → 0 errors ✅
For advanced troubleshooting and edge cases, see
reference.md#advanced-troubleshooting
This is normal. mcp__plugin_foundry_foundry-mcp__spec action="fix" reports success when it applies fixes successfully, not when all issues are resolved. Fixing one problem often reveals another (e.g., fixing parent-child mismatches may reveal orphaned nodes).
Solution: Re-validate to see remaining issues, then run fix again or address manually.
When error count stays the same for 2+ passes:
mcp__plugin_foundry_foundry-mcp__spec action="validate" spec_id="{spec-id}" to see detailed issue informationUnderstanding Spec Requirements:
mcp__plugin_foundry_foundry-mcp__spec action="schema-export" to see the complete spec structure, required fields, and valid valuesstatus, type, verification_type), and optional vs required fieldsCommon manual-only issues:
Rule: If error count decreases each pass, keep going. If it plateaus, switch to manual.
Available on all commands:
--quiet / -q - Suppress progress messages--verbose / -v - Show detailed informationFor comprehensive documentation including:
See reference.md