Spec Kit extension for detecting and resolving drift between specs and implementation
25
stars
0
commits
Mar 2, 2026
updated
Your specs say one thing. Your code does another. Every time an AI reads your specs, it generates code that conflicts with reality. This extension fixes that.
You wrote beautiful specs. Then reality happened:
Now your specs are documentation fossils. New developers can't trust them. AI agents generate conflicting code. The "regenerate from spec" promise is broken.
/speckit.sync.analyze
📊 Drift Report
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Specs Analyzed: 12
Requirements: 276
✅ Aligned: 193 (70%)
⚠️ Drifted: 31 (11%)
❓ Unverifiable: 52 (19%)
Unspecced Code: 36 features
Conflicts: 2 (spec vs design doc)
Top Issues:
• spec-008 says 5 fields, code extracts 4-8 per type
• spec-011 says one row per doc, code splits receipts
• ReconcileCommand has no spec coverage
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# Install the extension
specify extension add --from https://github.com/bgervin/spec-kit-sync/archive/refs/heads/master.zip
# Analyze your project
/speckit.sync.analyze
# Fix drift
/speckit.sync.propose --interactive
/speckit.sync.apply
# Backfill missing specs
/speckit.sync.backfill <feature-name> --create
| Command | What it does |
|---|---|
speckit.sync.analyze | Detect drift between specs and code |
speckit.sync.propose | AI suggests fixes (update spec or fix code) |
speckit.sync.apply | Apply approved changes |
speckit.sync.conflicts | Find inter-spec contradictions |
speckit.sync.backfill | Generate spec from unspecced code |
Scans specs and code to find:
/speckit.sync.analyze --spec 011 # Check one spec
/speckit.sync.analyze --json # Machine-readable
AI analyzes each drift and suggests a resolution:
| Strategy | When | Action |
|---|---|---|
| Backfill | Code is right | Update spec to match code |
| Align | Spec is right | Task to fix code |
| Supersede | Newer doc wins | Mark old spec superseded |
| Human | Can't tell | Surface for review |
/speckit.sync.propose --interactive # Review one-by-one
/speckit.sync.propose --strategy backfill-all
Execute approved proposals with safety checks:
/speckit.sync.apply --dry-run # Preview changes
/speckit.sync.apply # Do it
/speckit.sync.apply --auto-commit # Commit after
Generate complete specs from existing code:
/speckit.sync.backfill reconciliation --create
Creates:
spec.md — Requirements extracted from codeplan.md — Architecture documentationquickstart.md — User guide (if CLI command)tasks.md — Review checklistKeep specs synced during autonomous coding:
# sync-config.yml
ralph:
post_iteration_check: true
on_drift: pause # backfill | warn | pause
The loop pauses when drift is detected, preventing compound errors.
This extension was built to fix fina, a personal finance CLI that drifted during development:
Before:
After:
/speckit.sync.analyze
/speckit.sync.backfill reconciliation --create
/speckit.sync.backfill hints --create
/speckit.sync.backfill type-aware-extraction --create
Result: 15 specs, documented architecture, AI agents aligned with reality.
# From URL
specify extension add --from https://github.com/bgervin/spec-kit-sync/archive/refs/heads/master.zip
# Development mode (local clone)
specify extension add --dev /path/to/spec-kit-sync
# From catalog (coming soon)
specify extension add sync
mkdir -p .specify/extensions/sync
cp sync-config.template.yml .specify/extensions/sync/sync-config.yml
See sync-config.template.yml for all options.
AI coding agents are only as good as their context. When specs lie:
spec-kit-sync keeps specs honest, so AI agents generate code that actually works.
Built for spec-kit | MIT License
Spec Kit extension for detecting and resolving drift between specs and implementation
25
stars
0
commits
Mar 2, 2026
updated
Your specs say one thing. Your code does another. Every time an AI reads your specs, it generates code that conflicts with reality. This extension fixes that.
You wrote beautiful specs. Then reality happened:
Now your specs are documentation fossils. New developers can't trust them. AI agents generate conflicting code. The "regenerate from spec" promise is broken.
/speckit.sync.analyze
📊 Drift Report
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Specs Analyzed: 12
Requirements: 276
✅ Aligned: 193 (70%)
⚠️ Drifted: 31 (11%)
❓ Unverifiable: 52 (19%)
Unspecced Code: 36 features
Conflicts: 2 (spec vs design doc)
Top Issues:
• spec-008 says 5 fields, code extracts 4-8 per type
• spec-011 says one row per doc, code splits receipts
• ReconcileCommand has no spec coverage
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# Install the extension
specify extension add --from https://github.com/bgervin/spec-kit-sync/archive/refs/heads/master.zip
# Analyze your project
/speckit.sync.analyze
# Fix drift
/speckit.sync.propose --interactive
/speckit.sync.apply
# Backfill missing specs
/speckit.sync.backfill <feature-name> --create
| Command | What it does |
|---|---|
speckit.sync.analyze | Detect drift between specs and code |
speckit.sync.propose | AI suggests fixes (update spec or fix code) |
speckit.sync.apply | Apply approved changes |
speckit.sync.conflicts | Find inter-spec contradictions |
speckit.sync.backfill | Generate spec from unspecced code |
Scans specs and code to find:
/speckit.sync.analyze --spec 011 # Check one spec
/speckit.sync.analyze --json # Machine-readable
AI analyzes each drift and suggests a resolution:
| Strategy | When | Action |
|---|---|---|
| Backfill | Code is right | Update spec to match code |
| Align | Spec is right | Task to fix code |
| Supersede | Newer doc wins | Mark old spec superseded |
| Human | Can't tell | Surface for review |
/speckit.sync.propose --interactive # Review one-by-one
/speckit.sync.propose --strategy backfill-all
Execute approved proposals with safety checks:
/speckit.sync.apply --dry-run # Preview changes
/speckit.sync.apply # Do it
/speckit.sync.apply --auto-commit # Commit after
Generate complete specs from existing code:
/speckit.sync.backfill reconciliation --create
Creates:
spec.md — Requirements extracted from codeplan.md — Architecture documentationquickstart.md — User guide (if CLI command)tasks.md — Review checklistKeep specs synced during autonomous coding:
# sync-config.yml
ralph:
post_iteration_check: true
on_drift: pause # backfill | warn | pause
The loop pauses when drift is detected, preventing compound errors.
This extension was built to fix fina, a personal finance CLI that drifted during development:
Before:
After:
/speckit.sync.analyze
/speckit.sync.backfill reconciliation --create
/speckit.sync.backfill hints --create
/speckit.sync.backfill type-aware-extraction --create
Result: 15 specs, documented architecture, AI agents aligned with reality.
# From URL
specify extension add --from https://github.com/bgervin/spec-kit-sync/archive/refs/heads/master.zip
# Development mode (local clone)
specify extension add --dev /path/to/spec-kit-sync
# From catalog (coming soon)
specify extension add sync
mkdir -p .specify/extensions/sync
cp sync-config.template.yml .specify/extensions/sync/sync-config.yml
See sync-config.template.yml for all options.
AI coding agents are only as good as their context. When specs lie:
spec-kit-sync keeps specs honest, so AI agents generate code that actually works.
Built for spec-kit | MIT License