spec-drift-detector

spec-drift-detector is a skill for Claude Code, Codex from XRenSiu/claude-code-forge. It costs 274 tokens per session (4,046 once invoked), scanned A, original, MIT.

A comparison tool that reports factual differences between a written specification and the code that is supposed to implement it.

In plain words
What is it for?
It helps extract checkable claims from specifications, documentation, comments, or READMEs, compare them with the code, classify the differences, and trace them to the introducing commit.
Why use it?
It exposes where documentation and actual behavior disagree without assuming that either one is correct.

Skill for Claude CodeCodex

Part of the done-when-pipeline plugin — 9 skills shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/xrensiu/claude-code-forge/spec-drift-detector
Any agent
npx skills add XRenSiu/claude-code-forge --skill spec-drift-detector
Clone the repo
git clone --depth 1 https://github.com/XRenSiu/claude-code-forge

Made for: Claude Code, Codex.

Or install done-when-pipeline, the plugin that ships this one along with the rest of its 9 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for spec-drift-detector

README.md
[![agentmods](https://agentmods.dev/badge/skills/xrensiu/claude-code-forge/spec-drift-detector.svg)](https://agentmods.dev/skills/xrensiu/claude-code-forge/spec-drift-detector)
Your own site
<a href="https://agentmods.dev/skills/xrensiu/claude-code-forge/spec-drift-detector"><img src="https://agentmods.dev/badge/skills/xrensiu/claude-code-forge/spec-drift-detector.svg" alt="Measured on agentmods" height="20"></a>
Per session 274 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,046 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00274 $0.04046
Opus 5 $0.00137 $0.02023
Sonnet 5 $0.00055 $0.00809
Haiku 4.5 $0.00027 $0.00405

Measured 5d ago against content hash a58cfda628e6, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

spec-drift-detector scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/done-when-pipeline/skills/spec-drift-detector/SKILL.md · 246 lines

How it starts

The opening of the file, as written. The whole thing — 246 lines — stays where its author put it; the contents beside it link to each section on GitHub.

spec-drift-detector — spec vs code, no judgment

You are invoked to detect factual disagreements between a spec (or doc / docstring / README / comment) and the code that ostensibly implements it. You do not decide which side is "correct" — both spec and code are evidence; you report the disagreement and let the human decide which to change.

Say once at the start, then start working:

"I'm using the spec-drift-detector skill. I'll extract testable claims from the spec, locate the code, find disagreements, classify them (timing/behavior/contract), and trace each drift to its introducing commit. I will NOT decide which side is right."

Do not narrate further — just walk the phases.


Iron rules (re-read before every run)

  1. Epistemological neutrality is the load-bearing constraint. This skill differs from /pm-reviewer in exactly this dimension. pm-reviewer treats the spec as ground truth and asks "does the code conform?". spec-drift-detector treats neither as ground truth: spec and code are two independent claims about what the system does, and disagreement between them is a signal that one of them rotted — without a third reference (real user behavior, tests, the original author), you cannot tell which. The output never says "the spec is wrong" or "the code is wrong"; it says "the spec says X, the code does Y, they diverged at commit ABC, the commit message suggests intent Z."
  2. Three divergence types must be explicit. Every drift signal is classified as exactly one of:
    • timing_mismatch — the behavior described happens, but at the wrong time (spec: "immediately"; code: "after 24h delay").
    • behavior_mismatch — the behavior itself differs (spec: "returns 5% discount"; code: "returns 3% discount").
    • contract_mismatch — the interface / signature / return shape / parameter list differs (spec: "returns Subscription object"; code: "returns SubscriptionDTO with subset of fields"). The taxonomy forces precision — a vague "spec and code disagree" is not a useful output.
  3. Always trace commit_introducing_drift. For each drift signal, use git log/blame/git show to identify when the divergence was introduced. The commit's date, author, and message are recorded. This is the actionable part: a 4-month-old drift introduced by a commit titled "refactor: simplify cancellation flow" is almost certainly intentional impl change that should propagate to spec; a 2-day-old drift introduced by "wip: try X" is almost certainly accidental and the code should revert.
  4. likely_intentional is a heuristic, not a verdict. Based on commit message, age, and whether the spec was touched in the same commit (or recently), the skill estimates likely_intentional: true | false | unclear. This feeds the recommendation: field, which is the only opinionated output — but recommendation: is explicitly framed as a suggestion, not a decision.
  5. Never emit a finding with no code_location AND no spec_location. A "drift" with neither anchor is a hallucination. If you cannot locate at least one side concretely, drop the signal.
  6. Do not propose code changes or spec rewrites. Those are downstream actions for the human. This skill produces signals, full stop. The temptation to write "the spec should say..." is the same temptation that makes pm-reviewer collapse into LLM-as-judge. Resist.
  7. Confidence reflects evidence strength, not the size of the divergence. A small disagreement supported by 3 specific lines of code + 1 git commit is confidence: high. A massive disagreement based on "the spec sort of implies X" with no concrete impl line is confidence: low. Most drift signals are high or medium; low is rare and usually means the signal should have been dropped.
  8. Non-functional spec claims often produce false positives. "The system should be fast" disagrees with literally any code that has a slow path — but that's vacuous. Filter non-functional drift to only signals where the code provably violates a measurable threshold (should respond in <200ms and the impl's measured p99 is >500ms with --qa-report=<path>). Without a measurement, downgrade to recommendation: needs_human and skip the git archaeology — there's no commit to point at.

Read the full file on GitHub · 246 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 246 lines · 274 tokens per session scan A a58cfda628e6

Subscribe to this mod's changes

spec-drift-detector is a skill published in the GitHub repository XRenSiu/claude-code-forge (2 stars, last pushed today), licensed MIT. It adds 274 tokens to every session and 4,046 once invoked, about $0.0014 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens

insight-error-page

Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…

vercel/next.js · 83 tokens