Align spec files with implementation. Detects drift between spec and code, surfaces discrepancies, user decides whether to update spec or code. Use when both a spec file and its implementation are in context.
90
Quality
87%
Does it follow best practices?
Impact
92%
1.12xAverage score across 3 eval scenarios
Passed
No known issues
These apply whenever a spec file and its corresponding implementation are both in context:
When reading code, check if a spec exists and note divergences. When reading a spec, check if the implementation matches and note divergences. This awareness should be passive - flag drift in your responses without interrupting the user's primary task, unless the drift is directly relevant.
A spec file is required. Search for:
*.spec.md, *-spec.md, SPEC.mdspec/*.md, docs/*.spec.mdIf multiple specs exist, ask which to align. If none exist, stop - this workflow requires an existing spec.
Read the spec file completely.
For each spec section, identify the corresponding implementation:
| Spec Section | Source File(s) | Status |
|---|---|---|
## Types | src/types.ts:10-40 | aligned / drifted / missing-impl / missing-spec |
Read each mapped source file before assessing.
For each discrepancy:
### DRIFT-01: <short description>
**Spec says** (spec-file.md:L42):
> <quoted spec text>
**Code does** (src/module.ts:L87):
> <summarized code behavior>
**Impact**: <what breaks or is inconsistent>Number with stable IDs (DRIFT-NN). Batch related discrepancies that share a root cause.
For each discrepancy, ask:
Spec updates:
Code updates:
## Spec Alignment: <file>
**Discrepancies found**: N
**Resolved**: X (spec: A, code: B, skipped: C)
### Remaining
- DRIFT-04: <description> (skipped)5342bca
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.