spec-drift-audit
Skill0 starsChanged 3 months agoMITView on GitHub
Audits every spec under spec/<topic>/<slug>/ against the repository implementation (source code, config, workflows, docs) and produces a traceable audit artifact per spec/project/spec-drift-audit/. Invoke when the user asks to "run the quarterly spec-drift audit", "check spec versus implementation", "spec drift reconciliation", "audit all specs against the repo", "find spec vs code drift", "open the next quarterly audit", or when a spec changes and requires a matching partial audit. Also handles equivalent German-language requests. Do NOT use for continuous CI health checks (use workflow-health-triage), single-spec readiness review (use spec-readiness-reviewer agent), or feature-level code drift on new features (use feature-consistency-reviewer agent within feature-decompose scope). Supports resume on re-invocation per `spec/claude/resumable-work/`.
In this repository36 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- audience-identifySkill
- backlog-delivery-orchestrateSkill
- backstage-catalog-generateSkill
- blog-authorSkill
- blog-author-triggerSkill
- cicd-pipeline-designSkill
- continuous-improvement-triageSkill
- cookiecutter-template-manageSkill
- docs-audience-tracks-applySkill
- docs-dry-refactorSkill
- github-issue-templates-applySkill
- issue-backlog-partitionSkill
- issue-batch-orchestrateSkill
- issue-orchestrateSkill
- lektorat-applySkill
- lektorat-auto-reviseSkill
- mermaid-diagrams-applySkill
- mkdocs-structure-applySkill
- permission-allowlist-maintainSkill
- portfolio-auditSkill
- portfolio-inflight-triageSkill
- project-structure-applySkill
- pull-request-createSkill
- pull-request-mergeSkill
- pull-request-runner-sweepSkill
- readme-structure-applySkill
- release-notes-curateSkill
- release-publish-triggerSkill
- requirements-elicitSkill
- specSkill
- tech-stack-captureSkill
- vocab-drift-auditSkill
- workflow-health-triageSkill
- working-copy-startSkill
- yaml-json-schemaSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
20 rules. About 0 are common, 4 are distinctive, and 16 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
16
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 51
Before any operation, verify:
- Distinctive: line 63
Determine trigger and scope: Ask (or infer from the message): quarterly full-scope, or thematic partial triggered by a specific spec change …
- Very specific: line 64
Determine the Git revision: Run git rev-parse HEAD; record it as repo-revision.
- Very specific: line 68
Run project-structure-apply (audit mode only) to check .github/, Taskfile.yml, MkDocs, Renovate, and Probot alignment.
- Very specific: line 69
Run vocab-drift-audit to check Vale vocabulary against the pinned upstream release.
- Very specific: line 70
Run task lint and record the result.
- Very specific: line 78
Draft the artifact: Read templates/audit.template.md for the Markdown template.
- Very specific: line 82
Standalone: delete the ## Specialist coverage review section from this artifact and dispatch continuous-improvement-triage to write its own …
- Very specific: line 85
Read examples/01-quarterly-audit.md when running a full-scope quarterly audit to see a realistic walkthrough.
- Very specific: line 86
Read examples/02-spec-change-trigger.md when running a thematic partial audit triggered by a spec update.
- Distinctive: line 90
When the user reports decisions for one or more findings:
- Distinctive: line 97
Show the diff: Do not commit automatically.
- Very specific: line 99
Read examples/03-finding-resolution.md when working off findings via update and close operations.
- Very specific: line 111
Read examples/01-quarterly-audit.md for a full-scope quarterly audit with multiple findings and mixed decisions.
- Very specific: line 112
Read examples/02-spec-change-trigger.md for a thematic partial audit triggered by a specific spec update.
- Very specific: line 113
Read examples/03-finding-resolution.md for working off findings with the update and close operations.
- Very specific: line 120
Artifact location is repository-consistent: If .audits/spec-drift/ already contains prior artifacts, match the existing naming convention …
- Very specific: line 130
Record the Git revision: Every artifact must carry repo-revision so the audit can be reproduced.
- Very specific: line 131
No tool without a version: Every dispatched tool (skill, CLI, action) must appear in tools-used with its version or SHA.
- Very specific: line 132
No invented pass/fail: If a criterion can't be evaluated (tooling absent, access missing), mark blocked — never guess pass.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Spec Drift Audit
Operationalises spec/project/spec-drift-audit/<canonical_language>.md — reconciles every in-scope spec's Requirements and Acceptance Criteria against the actual repository state, persists the result as a dated artifact, and drives findings to a documented decision. The audit artifact is the deliverable; this skill is the procedure that creates, updates, and closes it.
Why this is a skill, not an agent
- Mid-flow interactivity — the user decides per finding: adjust the implementation, adjust the spec, or flag as an Open Question. An agent's fire-and-forget contract loses that deliberation loop.
- Persistent on-disk output — the audit artifact under
.audits/spec-drift/YYYY-Q<n>.md(or a GitHub issue) must survive past the current turn and be worked off incrementally; skills own persistent artifacts, agents return ephemeral reports. - Orchestration role — the audit dispatches
project-structure-applyandvocab-drift-auditas partial auditors in the same session; the skill-orchestrates-agent-executes pattern defaults the orchestrator to skill form. - Counter-dimension considered: context-window load from reading all specs plus their implementation surfaces could bias toward an agent, but the audit is inherently interactive and scoped per cycle — the user controls which specs are in scope and confirms each finding disposition. Inline execution in the skill form wins.
German trigger phrases
This skill also triggers on equivalent German-language requests, including:
- "führe den quartalsweisen Spec-Drift-Audit durch"
- "Spec gegen Implementierung prüfen"
- "Spec-Drift-Abstimmung"
- "alle Specs gegen das Repo auditieren"
- "nächsten Quartals-Audit öffnen"
- "Spec-Änderung erfordert Teil-Audit"
Preconditions
Before any operation, verify:
spec/.spec-config.ymlis present — read it to determinecanonical_language(fall back toen).spec/project/spec-drift-audit/<canonical_language>.mdis present — this is the governing spec; stop if missing..audits/spec-drift/exists or can be created (checkgit ls-files .audits/spec-drift/.gitkeep); create.audits/spec-drift/.gitkeepif the folder is absent.
Operations
1. audit — produce the audit artifact
Interactive. Confirm scope and trigger with the user before proceeding.
- Determine trigger and scope. Ask (or infer from the message): quarterly full-scope, or thematic partial triggered by a specific spec change or new skill/agent? Record the trigger. For thematic audits, confirm which spec topic is in scope.
- Determine the Git revision. Run
git rev-parse HEAD; record it asrepo-revision. The scope also includes the inheritance drift class ofspec/project/portfolio-inherited-spec-layer/§Drift detection: whenspec/.spec-config.ymlcarriesinherits:, run thespecskill's local-vs-inherited drift check; in the hub, which carries none, runscripts/check_spec_inheritance.pyfor itsPortfolio-Scope:header validation. Record each finding like any other. - Collect in-scope specs. Walk
spec/<topic>/<slug>/<canonical_language>.mdfor every file whose## Requirementsor## Acceptance Criteriasection is non-empty.Status: draftspecs are included. For a thematic audit, narrow to the declared topic area — record the narrowing. - Dispatch partial auditors. For the implementation surfaces covered by existing skills, delegate and capture their output:
- Run
project-structure-apply(audit mode only) to check.github/,Taskfile.yml, MkDocs, Renovate, and Probot alignment. - Run
vocab-drift-auditto check Vale vocabulary against the pinned upstream release. - Run
task lintand record the result. Record each tool's name and version (or git SHA) in the artifact'stools-usedlist.
- Run
- Per-criterion check. For each remaining spec criterion not covered by a dispatched tool, evaluate against the implementation: produce one of
pass,fail,blocked(tooling missing), ornot-applicable(with reason). Record the result. For eachfailorblockedfinding, the auditor MUST additionally record a Specialist disposition (mandatory field in the finding template perspec/project/continuous-improvement/<canonical_language>.mdAC "No in-scope finding from the most recentspec-drift-auditrun is recorded as 'no specialist considered'"): either (a) the dispatched specialist that will handle the remediation, naming both its display name and itssubagent_type(or matching skill name), or (b) the explicit noteno matching specialist exists — generalist handled. A finding recorded without one of these two values is incomplete and MUST NOT be written. 5b. Audience-surface drift check. Perspec/project/audience-identification/<canonical_language>.md(its AC "Thespec-drift-auditskill can flag a module whose documented audiences no longer match its actual interaction surface"), reconcile each in-scope bounded context's audience artifact against its real interaction surface:- Locate the audience artifact for each context:
AUDIENCES.mdat the context root, or the acceptable alternatives that spec permits (a README## Audiences/## Intended consumerssection, or an ADR). A context that ships an audience-claiming downstream artifact (README, mission, roadmap, docs tracks, release notes, SLAs) but has no audience artifact is itself afail. - For each documented audience, confirm its recorded
interaction surface(API, CLI, config, docs, dashboard, incident channel, …) still exists in the repository. A documented surface that no longer exists is drift (fail). - Scan for undocumented interaction surfaces — a new public CLI command, a new config schema, a new dashboard or API — that no audience entry accounts for. An interaction surface with no documented audience is drift (
fail). - Record each mismatch as a finding with the standard Specialist disposition; the natural remediation specialist is
audience-identify(re-run the audience methodology), so name it (or theno matching specialist exists — generalist handlednote).
- Locate the audience artifact for each context:
- Draft the artifact. Read
templates/audit.template.mdfor the Markdown template. Fill every frontmatter field. List all findings withfailorblockedstatus in## Findings. Leave## Decisionsempty at creation. - Write the artifact to
.audits/spec-drift/<YYYY>-Q<n>.md(or.audits/spec-drift/<YYYY>-Q<n>-<topic>.mdfor thematic audits). Confirm the path with the user. - Fold the specialist-coverage review (continuous-improvement integration). Per
spec/project/continuous-improvement/<canonical_language>.md§"Continuous loop and quarterly coverage review", the quarterly specialist-coverage review SHOULD be folded into thisspec-drift-auditrun by default. On a quarterly full-scope audit (and on any audit run in a quarter that has no coverage-review artifact yet), prompt the user: "Fold the quarterly specialist-coverage review into this artifact, or keep it standalone under.audits/continuous-improvement/<YYYY-QN>.md?" — default to folding.- Folded: keep the template's
## Specialist coverage reviewsection (it is the named landing spot mandated by the spec's "present it as a named, dedicated section" MUST), then dispatchcontinuous-improvement-triage(auditoperation) to produce the review content and populate that section. The section MUST stay full-portfolio in scope even on a thematic partial audit — partial-audit narrowing applies to drift, not to coverage, and a narrowed audit that suppresses it is itself a finding for the next cycle. - Standalone: delete the
## Specialist coverage reviewsection from this artifact and dispatchcontinuous-improvement-triageto write its own.audits/continuous-improvement/<YYYY-QN>.mdartifact for the same quarter.
- Folded: keep the template's
- Offer to stage and commit. Show the artifact path. Do not commit without explicit user confirmation.
Read examples/01-quarterly-audit.md when running a full-scope quarterly audit to see a realistic walkthrough.
Read examples/02-spec-change-trigger.md when running a thematic partial audit triggered by a spec update.
2. update — record decisions on findings
When the user reports decisions for one or more findings:
- Read the current audit artifact from
.audits/spec-drift/. - Verify each claimed closure: re-read the relevant spec criterion and the referenced implementation file. Do not accept "done" without spot-checking.
- Record the decision per finding:
adjust-impl,adjust-spec, oropen-question. Update the## Decisionssection. Carry the Specialist disposition forward from the finding into the decision entry: each## Decisionsblock MUST restate the dispatched specialist (display name +subagent_type/ skill name) or theno matching specialist exists — generalist handlednote recorded in step 5 ofaudit, so the remediation PR's Risk / rollout notes can name it perspec/project/continuous-improvement/<canonical_language>.md. - Append one log line to
## Processing logper decision:YYYY-MM-DD — <finding-id> — <decision> — verified: <method>. - Flip
statusin artifact frontmatter toin-progresson first decision. - Show the diff. Do not commit automatically.
Read examples/03-finding-resolution.md when working off findings via update and close operations.
3. close — seal the audit cycle
- Read the current audit artifact.
- Refuse if any
failfinding lacks a decision.blockedfindings may be closed with anopen-questiondecision plus a tracking issue URL. - Flip
statusin frontmatter toclosed. Record the closing date. - Compose the commit message:
chore(audit): close <YYYY>-Q<n> spec-drift audit — <F> findings, <D> decisionsin the subject; body lists open-question URLs andrepo-revision. - Run the commit only with explicit user confirmation. Show the message first.
Examples
- Read
examples/01-quarterly-audit.mdfor a full-scope quarterly audit with multiple findings and mixed decisions. - Read
examples/02-spec-change-trigger.mdfor a thematic partial audit triggered by a specific spec update. - Read
examples/03-finding-resolution.mdfor working off findings with theupdateandcloseoperations.
Gotchas
spec/.spec-config.ymlmust be read first. The canonical language for spec paths depends oncanonical_languagein that config. Defaulting toenwithout reading the config silently routes to the wrong language in repos with a different canonical.Status: draftspecs are in scope. The governing spec explicitly includes draft specs in the audit perimeter. Do not skip them.- Partial auditors only cover their slice.
project-structure-applyandvocab-drift-auditare delegated tools but each covers only one surface. Remaining spec criteria need direct per-criterion evaluation — never assume "dispatched means done". - Artifact location is repository-consistent. If
.audits/spec-drift/already contains prior artifacts, match the existing naming convention rather than inventing a new one. Check for prior artifacts before writing. - Calendar quarter, not rolling. Q1 = Jan–Mar, Q2 = Apr–Jun, Q3 = Jul–Sep, Q4 = Oct–Dec. A
2026-Q2audit covers the April–June window regardless of the actual date within the quarter.
Resumability
Per spec/claude/resumable-work/, this skill is resumable: true. State is persisted to .resume/spec-drift-audit/<run-id>.yml after every successful user-approval gate and after each named phase boundary. On re-invocation, scan that directory for files with status: in_progress whose inputs: snapshot matches the current invocation; if one matches, prompt the operator with Resume run <run_id> from phase <phase> (last checkpoint <last_checkpoint_at>)? [resume / start-new / discard]. The state-file envelope (schema_version, run_id, inputs, phase, decisions[], status, ...) and the fail-closed semantics on schema or YAML errors are load-bearing in the spec; don't duplicate those rules here.
Hard rules
- Every
failfinding needs a documented decision beforeclose. Silent deferrals violate the governing spec and the audit history requirement. - Record the Git revision. Every artifact must carry
repo-revisionso the audit can be reproduced.unknownis acceptable for detached HEADs; omission is not. - No tool without a version. Every dispatched tool (skill, CLI, action) must appear in
tools-usedwith its version or SHA. - No invented pass/fail. If a criterion can't be evaluated (tooling absent, access missing), mark
blocked— never guesspass. - One artifact per audit cycle. A re-run for the same quarter-scope supersedes; never merge two partial audits into a single file retroactively.
- English artifact structure, user language in prose. Section headings (
## Findings,## Decisions, etc.) stay in English for grepping and downstream tooling; finding prose follows the user's language.
Multi-model testing
Examples and operations in this skill are verified on Claude Sonnet as the default model; spot-checked on Haiku for lightweight partial audits; Opus is appropriate for full-scope audits requiring deeper cross-spec reasoning. The skill has no model-specific assumptions beyond standard tool-call semantics.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

