agentleFS
codecicadacodecicada/openspec-steward/skills/openspec-spec-drift/SKILL.md

openspec-spec-drift

Skill2 starsChanged 6 days agoMITView on GitHub

How an OpenSpec specification drifts from the code and what catches it. Use when writing or reviewing a delta, when a MODIFIED requirement is involved, when deciding where a marker goes, or when a capability claims to enumerate something derived from code.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Only a declared inventory is checked.

    line 64

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Specification drift

The failure a MODIFIED delta hides

A MODIFIED requirement replaces its live counterpart in full. A scenario omitted from the delta is therefore deleted — and nothing in the diff shows it. The delta looks complete on its own; the deletion only exists relative to a file the reviewer is not reading.

So when writing a MODIFIED delta, carry every scenario the live requirement has. check-specs enforces it, comparing by scenario name — rewording a body is a modification, not a removal.

A deliberate removal is stated, never inferred:

<!-- drops-scenario: <Requirement name> :: <Scenario name> -->

Marker placement — two rules, opposite directions

openspec archive copies a requirement's body into the main spec. That one fact decides both placements, read in opposite directions:

markerdescribesmust survive archive?placement
drops-scenarioone changenoabove the first ##
drops-inventoryone changenoabove the first ##
enumeratesthe capabilityyesinside the requirement

A drop marker is a note to a checker about one change. Copied into the main spec it would sit inside a behaviour contract forever, so it lives above the first ##, where archive cannot reach it.

An inventory declaration is a permanent property of the capability and must survive, so it lives where archive will carry it.

What generalises is not "markers go at the top." It is whether the marker describes the change or the capability. Getting that backwards fails silently in one direction and loudly in the other.

The asymmetry that lets a spec rot

Where a fact is enumerated in both a document and a specification, and only the document is mechanically compared against the code, the document stays right and the specification rots. Observed: a capability declaring "this list is the whole surface — a route that exists but is absent here is a spec defect", with a scenario asserting the comparison holds, missing five of twenty-three routes for six weeks. The prose documentation was correct throughout, because a docs checker compared it and nothing compared the spec.

A capability opts in to being held to its claim:

<!-- enumerates: routes -->

Only a declared inventory is checked. A capability mentioning a route in passing is not claiming completeness, and treating it as one would make every incidental mention a maintenance burden. An inventory nothing declares passes — deciding it deserves a capability is a judgement, not a defect.

The check reads what each unarchived change will make live. When a change adds an item — a new route, say — list it in the change's MODIFIED delta of the declaring requirement, marker included, and the check passes before archive. Do not archive early to satisfy it: the flow archives only after CI is green. A MODIFIED delta of a declaring requirement must carry the marker too: archive replaces the body in full, so leaving it out deletes the declaration and the claim stops being enforced. The check fails on that, naming the change, requirement and inventory. If the removal is deliberate, state it above the delta's first ##:

<!-- drops-inventory: <Requirement name> :: <inventory> -->

Any other delta requirement without the marker leaves the live list in force. Two unarchived changes replacing the same declaring requirement fail the check — fold them into one, or archive one and rebase the other's delta.

What no checker can tell you

None of these checks reads application code. They compare specifications against specifications, plus whatever a configured deriver extracts. So none can say whether a requirement is still true.

The worked example: a capability whose Purpose explained that squash-merge turns the PR title into the commit message, in a repository that had rebase-merged for seven weeks. Structurally perfect, every check green, the stated reason simply false. That class needs a reader — which is what a mandatory Docs task group in each change is for.

Two faults of that kind, found by reading and not by any tool:

  • a stated reason that stopped being true (the squash/rebase one)
  • something real that the capability never mentioned — a pre-push hook scanning for credentials, absent from the capability describing the hooks

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.