agentleFS
ShiningPlagueShiningPlague/shiningplague-studio/skills/consistency-check/SKILL.md

consistency-check

Skill0 starsChanged 4 months agoMITView on GitHub

Scan the project's docs / GDDs / registry against each other to detect cross-document inconsistencies — a doc promising a file that is not there, a registry entry pointing at a deleted path, an ADR referenced but never written, a system the registry calls built that implementation-status has never heard of, a spec marked archived that never moved. Runner-first: `python tools/consistency_check.py` runs 12 mechanical checks (exit 0 on PASS, non-zero on FAIL); the skill adds the judgement calls a script cannot make — same entity with different stats, same formula with different variables, stale wording. ShiningPlague-adopted: adapts to the studio doc stack (system_registry.json + active.md + implementation-status.md + ADRs + specs).

13 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

15 rules. 2 are common, 7 are distinctive, and 6 are very specific to this project.

  • 2

    Common

    Most of the 11 edited versions we read keep these.

  • 7

    Distinctive

    This author's own choices. Worth a look.

  • 6

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before opening a fresh chat (end-of-session readiness check)

    line 48
  2. Distinctive:

    After a feature ships end-to-end

    line 49
  3. Very specific:

    Before /architecture-review or /review-all-gdds

    line 50
  4. Common:

    After writing each new GDD (before moving to the next system)

    line 51
  5. Very specific:

    Before /create-architecture (inconsistencies poison downstream ADRs)

    line 52
  6. Distinctive:

    Do these by hand, grep-first — target only the names in scope, no full reads unless a conflict needs investigating.

    line 118
  7. Very specific:

    No argument / full — every registered entry against every doc

    line 122
  8. Very specific:

    Every resolved_in_commit hash in flagged_for_designer_review resolves in git log

    line 148
  9. Distinctive:

    Only on confirmation, in this order:

    line 184
  10. Common:

    If stale registry entries were found, ask:

    line 197
  11. Very specific:

    If 🔴 CONFLICTS were found AND docs/consistency-failures.md already exists, append a dated entry:

    line 213
  12. Distinctive:

    If the file does not exist, skip silently — do not create it from this skill.

    line 225
  13. Distinctive:

    Run this after each new GDD, not at architecture time — early is cheap.

    line 234
  14. Very specific:

    Create docs/consistency-failures.md if it does not exist

    line 244
  15. Distinctive:

    Delete registry entries — deprecate, never delete

    line 245

“Common” is measured: kept by at least 6 in 10 of the 11 edited versions of this file we could read. “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

Consistency Check

🌱 ShiningPlague-adopted. Originally Donchitos; battle-tested on a shipped game project. The upstream skill read a standalone entity registry; this version reads the studio doc stack instead ({{REGISTRY}} = data/_schemas/system_registry.json, {{SESSION_STATE}} = production/session-state/active.md, docs/implementation-status.md, docs/devlog.md, docs/adr/, docs/specs/). Spirit preserved (cross-doc consistency, grep-first); paths and cross-checks adapted.

Core principle: scan the doc stack for claims that disagree — file paths that don't resolve, ADR numbers nothing carries, statuses two docs state differently, stale wording that contradicts the current state. The registry is the built-state source of truth; cross-check everything against it.

This skill is the write-time safety net. It catches what /design-system's per-section checks may have missed and what /review-all-gdds's holistic review catches too late.


If an artifact named here is absent: say so plainly in one line, skip that step, and continue. Never invent the file to satisfy a checklist, and never fail a close because an optional artifact was never created.

When to fire

  • User says "run a consistency check" / "verify the docs" / "audit the doc stack" / "check everything for drift" → PROPOSE first, fire on confirm
  • Before opening a fresh chat (end-of-session readiness check)
  • After a feature ships end-to-end
  • Before /architecture-review or /review-all-gdds
  • After writing each new GDD (before moving to the next system)
  • Before /create-architecture (inconsistencies poison downstream ADRs)
  • On demand for one entity: /consistency-check entity:<name>

Fired automatically as a gate by /session-close, /update, /red-flag-scan and /verification-before-completion.


Phase 1: Run the runner

Always start here. The runner is mechanical, fast, and does not hallucinate.

python tools/consistency_check.py
FlagEffect
(none)full report; on a run with no FAILs, bumps last_full_audit in the registry to today
--quietfindings + verdict only — good for a gate inside another skill
--no-bumpnever writes to the registry (read-only spot check, pre-push hook)
--fix-safecreates absent empty directories the doc stack promises (with a .gitkeep). Never edits prose or data.
--stale-days Nhow many days of commits active.md may lag before check 11 warns (default 7)
--root DIRcheck a different project directory

Exit codes: 0 = no FAIL findings (WARNs may be present) · 1 = at least one FAIL, each named in the report · 2 = not run from a project root.

Severity contract: FAIL fails the run — something a session would trip over. WARN never fails it — drift worth knowing about. SKIP means the project has not grown that artifact yet; a brand-new install is mostly SKIPs and exits 0, and that is the correct day-one state.

The 12 checks

#CheckFails on
1registry parses and carries the keys the skills readunparseable JSON, a key holding the wrong type
2registry entry shapemissing id/name/status, a status outside the vocabulary, a duplicate id, an entry that says nothing about where it lives
3registry references resolvea files[]/path/dir/gdd that is not on disk, a depends_on id nothing defines
4registry coverage(WARN only) a populated data/<dir>/, an autoload, an addon or a project tool with no registry entry
5doc stacka path CLAUDE.md's reading map promises that does not exist
6doc ledgeran active_docs / spec_index / adr_index path the registry claims and disk denies
7spec + plan lifecyclea spec state=archived with no archive_path; (WARN) a doc marked ARCHIVED still sitting in docs/specs/, a spec absent from the index
8ADR hygieneone number used by two files, an ADR with no Status line, an ADR-NNN referenced in prose that no file carries; (WARN) numbering gaps
9cross-doc drift(WARN only) registry says built + implementation-status.md never mentions it, or the reverse; stage.txt and the registry's phase disagreeing
10doc linksa relative markdown link pointing at a file that does not exist
11session-state freshness(WARN only) active.md lagging the newest commit by more than --stale-days
12hook + skill integritya hook wired in .claude/settings.json that is not on disk, a SKILL.md with no parseable frontmatter (name + description)

Two deliberate blind spots, so they are visible rather than silent:

  • Archived trees are not link-scanned. Any directory whose name is or contains z-old, old, archive(d), backup(s), snapshot(s) is history; a link that rotted after retirement is expected, not a defect.
  • Illustrative rows are not drift. A table row naming your-system, example-thing, sample-*, my-* is template documentation, so check 9 skips it. Real systems must not be named that way.

If the runner is missing (an old install), say so plainly and continue with Phase 2 by hand — do not silently skip the gate.


Phase 2: The judgement calls the runner cannot make

The runner proves paths, numbers, shapes and statuses. It cannot read meaning. Do these by hand, grep-first — target only the names in scope, no full reads unless a conflict needs investigating.

Modes:

  • No argument / full — every registered entry against every doc
  • since-last-review — only docs modified since the last review report
  • entity:<name> / item:<name> — one thing, across all docs

2a. Cross-doc value agreement

  • The same number stated in two docs must match
  • The same date stated in two docs must match
  • The same formula must use the same variables in every doc that states it

2b. Entity / item / formula consistency (upstream Donchitos pattern)

For each entity, item, formula or constant in scope:

  • Grep every in-scope GDD ({{GDD_PATH}} + docs/gdd/*.md) for the name
  • Extract attribute values mentioned near the name
  • Compare against the registry entry and against the data file that owns the number
  • 🔴 CONFLICT — same name, different values in two docs
  • ⚠️ STALE REGISTRY — the source GDD moved on, the registry is behind
  • ℹ️ UNVERIFIABLE — the name appears with no comparable attribute

2c. Stale wording sweep

Grep the live tree (docs/*.md, data/_schemas/*.json, production/*.md, source, tools/) for terms a prior cleanup was supposed to delete. Classify each hit: ⚠️ stale claim (live text contradicting the current state) vs ℹ️ historical context (devlog narration, a RESOLUTION note, anything under an archive directory) — historical is not a finding.

2d. Commit traceability

  • Every resolved_in_commit hash in flagged_for_designer_review resolves in git log
  • The branch is not silently ahead/behind its remote (git status -sb)

Phase 3: Output report

=== CONSISTENCY CHECK — {{PROJECT_NAME}} ===
Date: [today]
Runner: [N] checks — [N] PASS, [N] WARN, [N] FAIL, [N] not applicable
Judgement pass: [in-scope docs]

Findings:
  🔴 CONFLICT  [detail]
  ⚠️ STALE     [detail]
  🟡 MISSING   [detail]

VERDICT: PASS | WARN — [N] items to review | FAIL — [N] blocking

Classify every finding:

  • 🔴 CONFLICT — the same claim with different values in two docs; one is wrong
  • ⚠️ STALE — wording in a live doc contradicts the current state
  • 🟡 MISSING — a path or commit hash claimed but not resolving
  • ℹ️ HISTORICAL — intentional narration of a past state; not a finding

For each non-historical finding, propose a fix: which doc is authoritative (default: the source GDD for design intent, the registry for built state, the data file for numbers), what changes in the contradicting doc, and whether a commit is needed.


Phase 4: Optional — fix the drift

Only on confirmation, in this order:

  1. Stale wording in live docs
  2. Missing files — either restore the file OR fix the claim that names it
  3. Conflicting values — update the non-authoritative copy to match the source

--fix-safe handles exactly one class on its own: an absent empty directory that the doc stack promises. Everything else is a human-reviewed edit. Bundle the fixes into one docs(consistency) commit and re-run the runner to confirm.


Phase 5: Registry corrections

If stale registry entries were found, ask:

"May I update data/_schemas/system_registry.json to fix the [N] stale entries?"

For each: update the value, set last_updated to today, add a note to the entry's history if it has one.

Never delete registry entries. Set status: deprecated when a system is gone — a deleted entry takes its own history with it.

Verdict: COMPLETE when the re-run is clean; BLOCKED when conflicts need a human decision.


Phase 6: Reflexion log

If 🔴 CONFLICTS were found AND docs/consistency-failures.md already exists, append a dated entry:

### YYYY-MM-DD — /consistency-check — [VERDICT]
**Domain**: [systems involved]
**Documents involved**: [source vs contradicting doc]
**What happened**: [entity, attribute, the two differing values]
**Resolution**: [how it was fixed, or "Unresolved — manual action needed"]
**Pattern**: [the generalised lesson — what kind of drift was missed]

If the file does not exist, skip silently — do not create it from this skill.


Next steps (chain-propose)

  • PASS → /review-all-gdds for the design-theory pass, or /create-architecture if the MVP GDDs are done.
  • CONFLICTS → fix the flagged docs, re-run the runner to confirm.
  • STALE REGISTRY → Phase 5, then re-run.
  • Run this after each new GDD, not at architecture time — early is cheap.

What this skill does NOT do

  • Re-implement by hand what the runner already proves (path existence, JSON shape, ADR numbering) — run it and read the report
  • Fix anything without confirmation (Phase 4 is opt-in; --fix-safe creates empty directories and nothing else)
  • Create docs/consistency-failures.md if it does not exist
  • Delete registry entries — deprecate, never delete

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.