.github/skills/spec-drift/SKILL.md
Detect drift between code implementations and specification documents
npx skillsauth add washingtonguilhardes/example.hr-module spec-driftInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Persona: Execute this task as the @architect subagent.
Load the persona characteristics from .rulesync/subagents/architect.md before proceeding.
Detect drift between code implementations and their specification documents. Identify misalignments, stale specs, and orphaned artifacts. Save report to docs/audits/{yyyy-mm-dd}-spec-drift.md.
Initiate: - Greet as Archer - Explain: "I'll analyze alignment between your code and specs to detect drift." - Ask: "Scope? (Entire codebase / Specific feature / Specific spec file)"
Discovery: - Locate spec documents in docs/specs/ (established convention from /spec skill) - Locate briefs in docs/briefs/ for cross-reference - Find code-to-spec references (look for @spec, Spec:, @implements comments per rules/spec-traceability.md) - Build mapping of specs ↔ implementation files - Note specs without code references and code without spec references
Drift Analysis: Detect three drift types:
Code-to-Spec Drift:
Spec Staleness:
Orphaned Artifacts:
implements frontmatterCategorize Findings: Use severity labels from rules/severity-labels.md:
[blocking]: Spec says X, code does Y (functional mismatch)[discuss]: Spec ambiguous, code made assumptions[advisory]: Minor documentation gaps, stale datesCoverage Confirmation: Include coverage section per rules/coverage-confirmation.md:
Generate Report:
# Spec Drift Report - {date}
## Summary
- Specs analyzed: {count}
- Code files mapped: {count}
- Drift instances found: {count}
- Verdict: {ALIGNED | MINOR_DRIFT | MAJOR_DRIFT}
## Findings
### [blocking] {title}
- **Spec:** `docs/specs/feature.md`
- **Code:** `src/services/feature.ts:45`
- **Issue:** {description}
- **Recommendation:** {action}
### [discuss] {title}
...
### [advisory] {title}
...
## Orphaned Artifacts
### Specs Without Implementation
- `docs/specs/planned-feature.md` (status: draft)
### Code Without Specs
- `src/services/complex-logic.ts` (recommendation: add spec)
## Coverage Confirmation
{include standard coverage section}
Save to docs/audits/{yyyy-mm-dd}-spec-drift.md
Summary: - Verdict: ALIGNED / MINOR_DRIFT / MAJOR_DRIFT - Top drift issues requiring attention - Recommended actions - Offer: "Create/update specs for drifted areas? (/spec)"
Create todos at task start:
spec-drift-initiate - "Greet and determine analysis scope"spec-drift-discovery - "Locate specs and build code-to-spec mapping"spec-drift-analysis - "Analyze for code-to-spec drift, staleness, orphans"spec-drift-categorize - "Categorize findings by severity"spec-drift-coverage - "Document coverage confirmation"spec-drift-report - "Generate drift report"spec-drift-summary - "Summarize findings and recommend actions"Update status: Mark in_progress when starting each, completed when done.
testing
Analyze distributed traces to find blocking queries, N+1 patterns, and missing tRPC encapsulation, then produce prioritized fixes
testing
required reading for all test/spec files or test related queries.
testing
Transform Product Brief into Technical Specification
development
Detect drift between code implementations and specification documents