IDD Spec Audit
scripts/audit-docs.mjs catches byte-level drift — sync-pair mismatches,
budgets, config-vs-instruction agreement — but not semantic drift: prose
that contradicts a sibling file, leaked session context, passages that
are not completable from a cold read, or wording that stalls an
autonomous step. This skill runs that check as N parallel LLM read
passes, adapted from mew-ton/soloscrum's define-pr-lifecycle audit
model.
Scope
- Audit targets (findings may cite these):
.github/instructions/**/*.md
(including lite/), the issue-authoring skill bundle at its
installed location, and every agent entry file present in this
installation (CLAUDE.md, AGENTS.md, GEMINI.md, and
.github/copilot-instructions.md). All but the first are
conditional on the adopter's own setup: onboarding creates each
entry file unless the operator explicitly opted out of it, the
issue-authoring companion is opt-in, and
.github/copilot-instructions.md is touched only if it already
existed — skip an audit target that does not exist in the current
installation rather than fail the run over it. Cover every present
entry file, not just CLAUDE.md: onboarding requires CLAUDE.md,
AGENTS.md, and GEMINI.md to agree on repository-specific
guidance, so a cross-file contradiction (R2) or a restatement-scope
drift (R5) can land in any of them. Audit every target that does
exist regardless of whether this installation happens to regenerate
it from an upstream source (for example, this source repository
regenerates .github/instructions/** from idd-template/ via
audit/sync-manifest.json) — this skill audits the corpus a worker
session actually reads, not any upstream source, so being a
regenerated target never exempts a file here.
- Reference-only inputs (read for R2/R4, never a finding target):
docs/idd-concept-ownership.md (R2's closed concept-index seed) and
docs/idd-autonomy-contract.md (R4's reversible/irreversible source
of truth), both at docs/ in an installed repository. Both are read
in full every pass.
- Out of scope as an audit target / finding source: this skill's
own bundle wherever it is installed (
skills/idd-spec-audit/** — the
skill necessarily reads its own bundle, this SKILL.md and
references/report-template.md, to run at all, but no finding ever
cites a file there); any generated mirror tree in this installation,
if one exists (for example, in this source repository, .claude/**,
since every file there mirrors a canonical source elsewhere); and
every other file under docs/** besides the two reference-only
inputs above (summary docs rely on the files they cite by design, so
they are not audited as if they were the primary spec).
Rule sets
Run all five rule sets on every pass; do not skip one to save time. A
finding names the rule set, the file, the line or section, and a short
quote of the offending text.
R1 — leaked session context
Flag prose that reads as belonging to one session's transcript rather
than a durable spec: time-relative phrasing without an absolute anchor
("recently", "the issue we just fixed"), first-person session voice
("I noticed", "we decided earlier"), narration of an edit instead of a
stated rule ("changed this to require X"), or a workaround described in
prose with no tracking link back to the issue that motivated it.
R2 — cross-file contradictions (closed v1 concept index)
Compare every in-scope file against every other in-scope file for a
direct contradiction over the same concept. Check only the concepts
below — this is a closed v1 index; do not add concepts to it while
auditing. Expanding the index is a spec change, not an in-audit
decision — file an issue instead of widening scope mid-run. The index
is finalized against IDD — Concept Ownership Matrix
(docs/idd-concept-ownership.md, #1593):
- claim-marker and activation-nonce semantics;
- advisory-convergence satisfaction;
- merge-gate order (F2/F2.5/F3);
- the "ready = absence of
status:* labels" definition;
- phase-digest rules;
- forced-handoff marker semantics;
- the suitability/effort footer contracts.
R3 — fresh-memory completability
Flag a passage that a worker session starting from a cold read (no
prior conversation, no memory of another file) could not complete:
an unresolved reference ("as described above" with no anchor), an
implied prerequisite never stated as a precondition, a missing exit
condition (a loop or wait with no stated end state), or a half-named
cross-reference (a phase or marker name used before it is defined).
R4 — automation blockers (autonomy cross-check)
Cross-check every instruction that asks an agent to pause, confirm, or
escalate against IDD Autonomy Contract (docs/idd-autonomy-contract.md,
#1592)'s reversible/irreversible classification, using that table as
a comparison baseline rather than re-deriving it from prose — but not
as unconditionally authoritative: the contract's own derivation
disclaimer states that on any disagreement with an instruction file,
the instruction file wins and the contract is the one that needs
correcting:
- an instruction to "confirm with the user" (or equivalent) attached to
a mutation the contract classifies Reversible is a finding only
once the instruction's own described undo path confirms the mutation
really is reversible — its named undo path means no confirmation
gate is needed there;
- the same phrase attached to a mutation the contract classifies
Irreversible is expected behavior and must never be flagged;
- when the table's classification looks wrong against the
instruction's actual described behavior, do not flag the
instruction as defective —
docs/idd-autonomy-contract.md is out of
scope as a finding target, so note the suspected contract drift
outside this skill's normal finding flow instead (preventive; no
observed incident yet — #2782).
A mutation with no row in the contract falls back to the contract's own
default (irreversible); that default governs the contract itself; do
not extend R4 to independently police no-row mutations beyond the two
cases above.
R5 — restatement discipline (closed v1 concept index)
Flag a passage that restates a rule defined canonically elsewhere in
the corpus when the restatement's scope does not match the canonical
rule's scope: broader than the canonical rule, narrower than it, or
phrased as unconditional where the canonical rule is conditional (has
stated exceptions, applies only under a named runtime profile, or only
within a bounded phase range).
Scope is the same closed v1 concept index R2 uses — reuse the
exact list in R2
above rather than introduce a second, open-ended index. A restatement
of a concept outside that index is out of R5's scope; do not flag it,
no matter how sloppily it is worded. This keeps R5 from treating every
emphatic sentence in the corpus as a finding — the rule exists to
catch a scope drift on the seven concepts already load-bearing enough
to have a closed index, not to police prose style generally.
Preferred remedy: cite the canonical section instead of restating
it inline. Prefer See [<section>](<path>#<anchor>) (or an equivalent
plain-text pointer to the file/section) over reproducing a
multi-clause rule's conditions in a second location — inline
restatement of a multi-clause rule is the exact failure mode this rule
set exists to catch, and the instruction bundles are already close to
their byte budgets, so citing is also the cheaper fix. Note the
preferred remedy in the finding so the reader does not have to
re-derive it.
Execution model
- Run N parallel, independent, read-only passes over the scope
above, skipping any Audit target absent from this installation (see
the Scope section's conditional-target note). Default
N = 3;
accept a --passes N-style argument to adjust it.
- Aggregate by union, deduplicating findings that describe the same
file/section/issue across passes. Annotate each surviving finding
with
Appeared in: K/N (how many of the N passes independently
raised it) as informational context only.
- Never apply a quorum filter. A finding raised by only one pass is
reported exactly like one raised by all N — sampling variance is not
evidence of invalidity, and dropping low-
K findings would silently
discard true positives that one pass framed differently from the
others.
- Read-only, always. This skill never edits an in-scope file and
never opens, closes, comments on, or labels a GitHub issue. Route
every finding back through the normal issue-authoring flow (see the
issue-authoring skill) for a human or a later session to act on;
when the issue-authoring companion is not installed (Scope's
conditional-target note), route findings through this
installation's normal manual issue-filing process instead.
- Write the aggregated result using
references/report-template.md.
See also
- references/report-template.md for
the report shape.
- IDD Autonomy Contract (
docs/idd-autonomy-contract.md) — R4's
closed source of truth.
- IDD — Concept Ownership Matrix (
docs/idd-concept-ownership.md) —
R2's concept-index seed.
1---2name: idd-spec-audit-23description: Semantic audit of the IDD instruction corpus for leaked session context, cross-file contradictions, fresh-memory completability gaps, automation blockers, and restatement-discipline drift. Use on request to audit .github/instructions, the issue-authoring skill bundle, and the installed agent entry files (CLAUDE.md, AGENTS.md, GEMINI.md, .github/copilot-instructions.md). Read-only — never edits files or mutates issues.4---56# IDD Spec Audit78<!-- cspell:words soloscrum -->910`scripts/audit-docs.mjs` catches byte-level drift — sync-pair mismatches,11budgets, config-vs-instruction agreement — but not semantic drift: prose12that contradicts a sibling file, leaked session context, passages that13are not completable from a cold read, or wording that stalls an14autonomous step. This skill runs that check as N parallel LLM read15passes, adapted from `mew-ton/soloscrum`'s `define-pr-lifecycle` audit16model.1718## Scope1920- **Audit targets** (findings may cite these): `.github/instructions/**/*.md`21 (including `lite/`), the issue-authoring skill bundle at its22 installed location, and every agent entry file present in this23 installation (`CLAUDE.md`, `AGENTS.md`, `GEMINI.md`, and24 `.github/copilot-instructions.md`). All but the first are25 conditional on the adopter's own setup: onboarding creates each26 entry file unless the operator explicitly opted out of it, the27 issue-authoring companion is opt-in, and28 `.github/copilot-instructions.md` is touched only if it already29 existed — skip an audit target that does not exist in the current30 installation rather than fail the run over it. Cover every present31 entry file, not just `CLAUDE.md`: onboarding requires `CLAUDE.md`,32 `AGENTS.md`, and `GEMINI.md` to agree on repository-specific33 guidance, so a cross-file contradiction (R2) or a restatement-scope34 drift (R5) can land in any of them. Audit every target that does35 exist regardless of whether this installation happens to regenerate36 it from an upstream source (for example, this source repository37 regenerates `.github/instructions/**` from `idd-template/` via38 `audit/sync-manifest.json`) — this skill audits the corpus a worker39 session actually reads, not any upstream source, so being a40 regenerated target never exempts a file here.41- **Reference-only inputs** (read for R2/R4, never a finding target):42 `docs/idd-concept-ownership.md` (R2's closed concept-index seed) and43 `docs/idd-autonomy-contract.md` (R4's reversible/irreversible source44 of truth), both at `docs/` in an installed repository. Both are read45 in full every pass.46- **Out of scope as an audit target / finding source**: this skill's47 own bundle wherever it is installed (`skills/idd-spec-audit/**` — the48 skill necessarily reads its own bundle, this `SKILL.md` and49 `references/report-template.md`, to run at all, but no finding ever50 cites a file there); any generated mirror tree in this installation,51 if one exists (for example, in this source repository, `.claude/**`,52 since every file there mirrors a canonical source elsewhere); and53 every other file under `docs/**` besides the two reference-only54 inputs above (summary docs rely on the files they cite by design, so55 they are not audited as if they were the primary spec).5657## Rule sets5859Run all five rule sets on every pass; do not skip one to save time. A60finding names the rule set, the file, the line or section, and a short61quote of the offending text.6263### R1 — leaked session context6465Flag prose that reads as belonging to one session's transcript rather66than a durable spec: time-relative phrasing without an absolute anchor67("recently", "the issue we just fixed"), first-person session voice68("I noticed", "we decided earlier"), narration of an edit instead of a69stated rule ("changed this to require X"), or a workaround described in70prose with no tracking link back to the issue that motivated it.7172### R2 — cross-file contradictions (closed v1 concept index)7374Compare every in-scope file against every other in-scope file for a75direct contradiction over the same concept. Check only the concepts76below — this is a **closed v1 index**; do not add concepts to it while77auditing. Expanding the index is a spec change, not an in-audit78decision — file an issue instead of widening scope mid-run. The index79is finalized against IDD — Concept Ownership Matrix80(`docs/idd-concept-ownership.md`, `#1593`):8182- claim-marker and activation-nonce semantics;83- advisory-convergence satisfaction;84- merge-gate order (F2/F2.5/F3);85- the "ready = absence of `status:*` labels" definition;86- phase-digest rules;87- forced-handoff marker semantics;88- the suitability/effort footer contracts.8990### R3 — fresh-memory completability9192Flag a passage that a worker session starting from a cold read (no93prior conversation, no memory of another file) could not complete:94an unresolved reference ("as described above" with no anchor), an95implied prerequisite never stated as a precondition, a missing exit96condition (a loop or wait with no stated end state), or a half-named97cross-reference (a phase or marker name used before it is defined).9899### R4 — automation blockers (autonomy cross-check)100101Cross-check every instruction that asks an agent to pause, confirm, or102escalate against IDD Autonomy Contract (`docs/idd-autonomy-contract.md`,103`#1592`)'s reversible/irreversible classification, using that table as104a comparison baseline rather than re-deriving it from prose — but not105as unconditionally authoritative: the contract's own derivation106disclaimer states that on any disagreement with an instruction file,107the instruction file wins and the contract is the one that needs108correcting:109110- an instruction to "confirm with the user" (or equivalent) attached to111 a mutation the contract classifies **Reversible** is a finding only112 once the instruction's own described undo path confirms the mutation113 really is reversible — its named undo path means no confirmation114 gate is needed there;115- the same phrase attached to a mutation the contract classifies116 **Irreversible** is expected behavior and must never be flagged;117- when the table's classification looks wrong against the118 instruction's actual described behavior, do not flag the119 instruction as defective — `docs/idd-autonomy-contract.md` is out of120 scope as a finding target, so note the suspected contract drift121 outside this skill's normal finding flow instead (preventive; no122 observed incident yet — #2782).123124A mutation with no row in the contract falls back to the contract's own125default (irreversible); that default governs the contract itself; do126not extend R4 to independently police no-row mutations beyond the two127cases above.128129### R5 — restatement discipline (closed v1 concept index)130131Flag a passage that restates a rule defined canonically elsewhere in132the corpus when the restatement's scope does not match the canonical133rule's scope: broader than the canonical rule, narrower than it, or134phrased as unconditional where the canonical rule is conditional (has135stated exceptions, applies only under a named runtime profile, or only136within a bounded phase range).137138**Scope is the same closed v1 concept index R2 uses** — reuse the139exact list in [R2](#r2--cross-file-contradictions-closed-v1-concept-index)140above rather than introduce a second, open-ended index. A restatement141of a concept outside that index is out of R5's scope; do not flag it,142no matter how sloppily it is worded. This keeps R5 from treating every143emphatic sentence in the corpus as a finding — the rule exists to144catch a scope drift on the seven concepts already load-bearing enough145to have a closed index, not to police prose style generally.146147**Preferred remedy**: cite the canonical section instead of restating148it inline. Prefer `See [<section>](<path>#<anchor>)` (or an equivalent149plain-text pointer to the file/section) over reproducing a150multi-clause rule's conditions in a second location — inline151restatement of a multi-clause rule is the exact failure mode this rule152set exists to catch, and the instruction bundles are already close to153their byte budgets, so citing is also the cheaper fix. Note the154preferred remedy in the finding so the reader does not have to155re-derive it.156157## Execution model158159- Run **N parallel, independent, read-only** passes over the scope160 above, skipping any Audit target absent from this installation (see161 the Scope section's conditional-target note). Default `N = 3`;162 accept a `--passes N`-style argument to adjust it.163- **Aggregate by union**, deduplicating findings that describe the same164 file/section/issue across passes. Annotate each surviving finding165 with `Appeared in: K/N` (how many of the N passes independently166 raised it) as **informational context only**.167- **Never apply a quorum filter.** A finding raised by only one pass is168 reported exactly like one raised by all N — sampling variance is not169 evidence of invalidity, and dropping low-`K` findings would silently170 discard true positives that one pass framed differently from the171 others.172- **Read-only, always.** This skill never edits an in-scope file and173 never opens, closes, comments on, or labels a GitHub issue. Route174 every finding back through the normal issue-authoring flow (see the175 `issue-authoring` skill) for a human or a later session to act on;176 when the issue-authoring companion is not installed (Scope's177 conditional-target note), route findings through this178 installation's normal manual issue-filing process instead.179- Write the aggregated result using180 [references/report-template.md](references/report-template.md).181182## See also183184- [references/report-template.md](references/report-template.md) for185 the report shape.186- IDD Autonomy Contract (`docs/idd-autonomy-contract.md`) — R4's187 closed source of truth.188- IDD — Concept Ownership Matrix (`docs/idd-concept-ownership.md`) —189 R2's concept-index seed.