@adia-ai/adia-ui-forge 0.1.3 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +3 -6
- package/CHANGELOG.md +27 -34
- package/README.md +35 -40
- package/agents/a2ui-engineer.md +22 -53
- package/agents/component-author.md +29 -0
- package/agents/framework-verifier.md +26 -0
- package/agents/release-engineer.md +21 -81
- package/agents/routing-corpus.json +293 -64
- package/bin/demo-postwrite-pattern-gate +94 -0
- package/bin/forge-lint +17 -2
- package/bin/sidecar-prewrite-guard +104 -0
- package/commands/deploy.md +9 -0
- package/commands/dogfood.md +10 -0
- package/commands/gen-review.md +9 -0
- package/commands/release.md +10 -0
- package/hooks/hooks.json +15 -0
- package/package.json +3 -6
- package/references/contracts/a2ui-mcp-surface.md +35 -0
- package/references/contracts/migration-guide-format.md +34 -0
- package/references/shared/content-trust.md +19 -74
- package/skills/adia-a2ui/SKILL.md +99 -0
- package/skills/{adia-ui-a2ui → adia-a2ui}/evals/routing-corpus.json +10 -10
- package/skills/adia-a2ui/references/anti-patterns.md +27 -0
- package/skills/adia-a2ui/references/chunk-authoring.md +71 -0
- package/skills/adia-a2ui/references/corpus-discipline.md +68 -0
- package/skills/adia-a2ui/references/eval-diagnostics.md +86 -0
- package/skills/adia-a2ui/references/format-extension-decisions.md +66 -0
- package/skills/adia-a2ui/references/leverage-rules.md +52 -0
- package/skills/adia-a2ui/references/mcp-pipeline-ops.md +83 -0
- package/skills/adia-a2ui/references/mcp-tool-reference.md +59 -0
- package/skills/adia-a2ui/references/pipeline-overview.md +115 -0
- package/skills/adia-a2ui/references/semantic-fail-lifting.md +74 -0
- package/skills/adia-a2ui/references/strategy-engines.md +109 -0
- package/skills/adia-a2ui/references/zettel-calibration.md +104 -0
- package/skills/adia-author/SKILL.md +112 -0
- package/skills/adia-author/evals/routing-corpus.json +222 -0
- package/skills/{adia-ui-authoring → adia-author}/references/anti-patterns.md +33 -4
- package/skills/{adia-ui-authoring → adia-author}/references/authoring-cycle.md +9 -11
- package/skills/adia-author/references/canonical-pattern-index.md +243 -0
- package/skills/{adia-ui-authoring → adia-author}/references/code-style.md +19 -21
- package/skills/adia-author/references/common-gotchas.md +129 -0
- package/skills/adia-author/references/composite-demo-protocol.md +271 -0
- package/skills/{adia-ui-authoring → adia-author}/references/css-patterns.md +19 -6
- package/skills/{adia-ui-authoring → adia-author}/references/lifecycle-patterns.md +1 -0
- package/skills/{adia-ui-authoring → adia-author}/references/llm-bridge.md +3 -5
- package/skills/{adia-ui-authoring → adia-author}/references/module-promotion.md +20 -38
- package/skills/{adia-ui-authoring → adia-author}/references/primitive-audit.md +2 -4
- package/skills/{adia-ui-authoring → adia-author}/references/shell-patterns.md +12 -18
- package/skills/{adia-ui-authoring → adia-author}/references/token-contract.md +5 -7
- package/skills/{adia-ui-authoring → adia-author}/references/worked-example.md +3 -3
- package/skills/{adia-ui-authoring → adia-author}/references/yaml-contract.md +3 -3
- package/skills/{adia-ui-authoring → adia-author}/scripts/build-canonical-pattern-index.mjs +3 -3
- package/skills/adia-deploy/SKILL.md +128 -0
- package/skills/{adia-ui-ops → adia-deploy}/references/deploy-playbooks.md +47 -30
- package/skills/adia-dogfood/SKILL.md +124 -0
- package/skills/adia-dogfood/references/admin-shell-anatomy.md +77 -0
- package/skills/adia-dogfood/references/app-shell-pitfalls.md +66 -0
- package/skills/adia-dogfood/references/card-anatomy-sweep.md +66 -0
- package/skills/adia-dogfood/references/html-attr-sweep.md +63 -0
- package/skills/adia-dogfood/references/native-leak-annotations.md +73 -0
- package/skills/adia-dogfood/references/visual-probe-triage.md +80 -0
- package/skills/{adia-ui-dogfood → adia-dogfood}/scripts/analyze.mjs +30 -14
- package/skills/adia-gen-review/SKILL.md +127 -0
- package/skills/adia-gen-review/references/corpus-html-patterns.md +279 -0
- package/skills/adia-gen-review/references/loop-protocol.md +216 -0
- package/skills/adia-gen-review/references/rubric-cosmetic.md +100 -0
- package/skills/adia-gen-review/references/rubric-decompose.md +101 -0
- package/skills/adia-gen-review/references/rubric-score.md +214 -0
- package/skills/{adia-ui-gen-review → adia-gen-review}/references/scores.schema.json +2 -2
- package/skills/{adia-ui-gen-review → adia-gen-review}/scripts/gen-review-coverage-audit.mjs +4 -4
- package/skills/{adia-ui-gen-review → adia-gen-review}/scripts/gen-review-decompose.mjs +10 -6
- package/skills/{adia-ui-gen-review → adia-gen-review}/scripts/gen-review-status.mjs +5 -5
- package/skills/{adia-ui-gen-review → adia-gen-review}/scripts/validate-cycle-scores.mjs +5 -5
- package/skills/adia-llm-internals/SKILL.md +77 -0
- package/skills/{adia-ui-llm → adia-llm-internals}/references/adapter-contract.md +4 -2
- package/skills/{adia-ui-llm → adia-llm-internals}/references/add-a-provider.md +4 -5
- package/skills/{adia-ui-llm → adia-llm-internals}/references/bridge-facade.md +10 -3
- package/skills/{adia-ui-llm → adia-llm-internals}/references/browser-proxy-boundary.md +1 -1
- package/skills/{adia-ui-llm → adia-llm-internals}/references/model-registry.md +5 -3
- package/skills/{adia-ui-llm → adia-llm-internals}/references/streaming-sse.md +2 -2
- package/skills/adia-release/SKILL.md +72 -0
- package/skills/adia-release/references/changelog-discipline.md +119 -0
- package/skills/adia-release/references/cut-procedure.md +247 -0
- package/skills/adia-release/references/gates-catalog.md +222 -0
- package/skills/adia-release/references/independent-package-release.md +52 -0
- package/skills/adia-release/references/migration-guide-authoring.md +86 -0
- package/skills/adia-release/references/notes-authoring.md +90 -0
- package/skills/adia-release/references/recovery-paths.md +106 -0
- package/skills/{adia-ui-release → adia-release}/scripts/bump.mjs +27 -2
- package/skills/{adia-ui-release → adia-release}/scripts/dispatch-publish.mjs +4 -1
- package/skills/{adia-ui-release → adia-release}/scripts/insert-stub.mjs +1 -1
- package/skills/{adia-ui-release → adia-release}/scripts/package-paths.mjs +6 -0
- package/skills/{adia-ui-release → adia-release}/scripts/promote-unreleased.mjs +1 -1
- package/skills/{adia-ui-release → adia-release}/scripts/release-pack.mjs +13 -21
- package/skills/{adia-ui-release → adia-release}/scripts/tag-lockstep.mjs +5 -1
- package/skills/adia-site-docs/SKILL.md +68 -0
- package/skills/adia-site-docs/evals/audit-report.md +30 -0
- package/skills/adia-site-docs/evals/routing-corpus.json +176 -0
- package/skills/adia-site-docs/intent.md +72 -0
- package/agents/README.md +0 -209
- package/agents/author.md +0 -56
- package/agents/repo-steward.md +0 -56
- package/agents/spec-architect.md +0 -53
- package/agents/tech-lead.md +0 -57
- package/agents/verifier.md +0 -55
- package/bin/lib/audit-axes.mjs +0 -555
- package/bin/lib/dry-run-irreversible.mjs +0 -236
- package/bin/lib/run-skill-evals.mjs +0 -487
- package/bin/lib/teach-router.mjs +0 -250
- package/commands/adia-forge-a2ui.md +0 -10
- package/commands/adia-forge-author.md +0 -10
- package/commands/adia-forge-dogfood.md +0 -8
- package/commands/adia-forge-llm.md +0 -8
- package/commands/adia-forge-orient.md +0 -10
- package/commands/adia-forge-release.md +0 -8
- package/commands/adia-forge-review.md +0 -10
- package/references/shared/pev-rationale.md +0 -64
- package/references/shared/skill-conventions.md +0 -133
- package/skills/adia-ui-a2ui/CHANGELOG.md +0 -32
- package/skills/adia-ui-a2ui/SKILL.md +0 -243
- package/skills/adia-ui-a2ui/evals/adversarial-corpus.json +0 -75
- package/skills/adia-ui-a2ui/evals/teach-routing-cases.json +0 -100
- package/skills/adia-ui-a2ui/references/anti-patterns.md +0 -24
- package/skills/adia-ui-a2ui/references/chunk-authoring.md +0 -88
- package/skills/adia-ui-a2ui/references/corpus-discipline.md +0 -56
- package/skills/adia-ui-a2ui/references/eval-diagnostics.md +0 -127
- package/skills/adia-ui-a2ui/references/fragment-graph.md +0 -91
- package/skills/adia-ui-a2ui/references/mcp-pipeline-ops.md +0 -106
- package/skills/adia-ui-a2ui/references/mcp-tool-reference.md +0 -398
- package/skills/adia-ui-a2ui/references/pipeline-overview.md +0 -175
- package/skills/adia-ui-a2ui/references/semantic-fail-lifting.md +0 -120
- package/skills/adia-ui-a2ui/references/strategy-engines.md +0 -111
- package/skills/adia-ui-a2ui/references/teach-protocol.md +0 -220
- package/skills/adia-ui-a2ui/references/zettel-calibration.md +0 -93
- package/skills/adia-ui-a2ui/scripts/audit-a2ui-roster.mjs +0 -96
- package/skills/adia-ui-a2ui/scripts/teach-route.mjs +0 -157
- package/skills/adia-ui-a2ui/skill.json +0 -38
- package/skills/adia-ui-authoring/CHANGELOG.md +0 -32
- package/skills/adia-ui-authoring/SKILL.md +0 -256
- package/skills/adia-ui-authoring/assets/case-studies/admin-shell-decomposition.md +0 -101
- package/skills/adia-ui-authoring/assets/case-studies/maxtokens-32768-discovery.md +0 -109
- package/skills/adia-ui-authoring/assets/case-studies/theme-panel-promotion.md +0 -113
- package/skills/adia-ui-authoring/evals/adversarial-design-plan-gates.json +0 -138
- package/skills/adia-ui-authoring/evals/routing-corpus.json +0 -245
- package/skills/adia-ui-authoring/references/canonical-pattern-index.md +0 -179
- package/skills/adia-ui-authoring/references/common-gotchas.md +0 -93
- package/skills/adia-ui-authoring/references/composite-demo-protocol.md +0 -1084
- package/skills/adia-ui-authoring/references/teach-protocol.md +0 -428
- package/skills/adia-ui-authoring/scripts/audit-authoring-roster.mjs +0 -148
- package/skills/adia-ui-authoring/skill.json +0 -45
- package/skills/adia-ui-dogfood/CHANGELOG.md +0 -17
- package/skills/adia-ui-dogfood/README.md +0 -62
- package/skills/adia-ui-dogfood/SKILL.md +0 -866
- package/skills/adia-ui-dogfood/skill.json +0 -40
- package/skills/adia-ui-forge/SKILL.md +0 -88
- package/skills/adia-ui-forge/evals/routing-corpus.json +0 -30
- package/skills/adia-ui-gen-review/CHANGELOG.md +0 -108
- package/skills/adia-ui-gen-review/SKILL.md +0 -266
- package/skills/adia-ui-gen-review/references/loop-protocol.md +0 -712
- package/skills/adia-ui-gen-review/references/rubric-cosmetic.md +0 -144
- package/skills/adia-ui-gen-review/references/rubric-decompose.md +0 -117
- package/skills/adia-ui-gen-review/references/rubric-score.md +0 -249
- package/skills/adia-ui-gen-review/references/teach-protocol.md +0 -214
- package/skills/adia-ui-gen-review/skill.json +0 -23
- package/skills/adia-ui-llm/CHANGELOG.md +0 -25
- package/skills/adia-ui-llm/SKILL.md +0 -165
- package/skills/adia-ui-llm/evals/adversarial-corpus.json +0 -75
- package/skills/adia-ui-llm/evals/routing-corpus.json +0 -30
- package/skills/adia-ui-llm/evals/teach-routing-cases.json +0 -73
- package/skills/adia-ui-llm/references/teach-protocol.md +0 -78
- package/skills/adia-ui-llm/scripts/audit-llm-roster.mjs +0 -93
- package/skills/adia-ui-llm/scripts/teach-route.mjs +0 -119
- package/skills/adia-ui-llm/skill.json +0 -33
- package/skills/adia-ui-ops/CHANGELOG.md +0 -291
- package/skills/adia-ui-ops/SKILL.md +0 -401
- package/skills/adia-ui-ops/references/INDEX.md +0 -158
- package/skills/adia-ui-ops/references/audit-cadence.md +0 -263
- package/skills/adia-ui-ops/references/audit-patterns/archive-link-sweep.md +0 -96
- package/skills/adia-ui-ops/references/audit-patterns/audit-history-ledger.md +0 -162
- package/skills/adia-ui-ops/references/audit-patterns/browser-bundle-node-imports.md +0 -154
- package/skills/adia-ui-ops/references/audit-patterns/changelog-unreleased-bloat.md +0 -75
- package/skills/adia-ui-ops/references/audit-patterns/coverage-gaps.md +0 -187
- package/skills/adia-ui-ops/references/audit-patterns/entry-file-coverage.md +0 -122
- package/skills/adia-ui-ops/references/audit-patterns/format-hygiene.md +0 -217
- package/skills/adia-ui-ops/references/audit-patterns/lockstep-versioning.md +0 -113
- package/skills/adia-ui-ops/references/audit-patterns/memory-fragmentation.md +0 -180
- package/skills/adia-ui-ops/references/audit-patterns/orphan-detection.md +0 -202
- package/skills/adia-ui-ops/references/audit-patterns/pointer-validation.md +0 -180
- package/skills/adia-ui-ops/references/audit-patterns/redundancy-detection.md +0 -210
- package/skills/adia-ui-ops/references/audit-patterns/spec-dating-sweep.md +0 -91
- package/skills/adia-ui-ops/references/audit-patterns/stale-content.md +0 -182
- package/skills/adia-ui-ops/references/audit-patterns/staleness-tooling.md +0 -156
- package/skills/adia-ui-ops/references/audit-patterns/token-waste-detection.md +0 -196
- package/skills/adia-ui-ops/references/doc-types/adr-pattern.md +0 -210
- package/skills/adia-ui-ops/references/doc-types/architecture-md.md +0 -190
- package/skills/adia-ui-ops/references/doc-types/changelog.md +0 -183
- package/skills/adia-ui-ops/references/doc-types/decisions-log.md +0 -146
- package/skills/adia-ui-ops/references/doc-types/plan-roadmap.md +0 -182
- package/skills/adia-ui-ops/references/doc-types/postmortem-pattern.md +0 -206
- package/skills/adia-ui-ops/references/genres/prose-and-writing.md +0 -149
- package/skills/adia-ui-ops/references/guidance/context-budget.md +0 -137
- package/skills/adia-ui-ops/references/guidance/llm-doc-writing.md +0 -116
- package/skills/adia-ui-ops/references/guidance/reliability-dial.md +0 -186
- package/skills/adia-ui-ops/references/recipes/adr-introduction.md +0 -211
- package/skills/adia-ui-ops/references/recipes/audit-existing-repo.md +0 -234
- package/skills/adia-ui-ops/references/recipes/cold-start-harvest.md +0 -263
- package/skills/adia-ui-ops/references/recipes/concurrent-learnings-merge.md +0 -158
- package/skills/adia-ui-ops/references/recipes/continuous-learning-loop.md +0 -169
- package/skills/adia-ui-ops/references/recipes/external-reference-verification.md +0 -158
- package/skills/adia-ui-ops/references/recipes/findings-index-readout.md +0 -126
- package/skills/adia-ui-ops/references/recipes/greenfield-setup.md +0 -252
- package/skills/adia-ui-ops/references/recipes/harvest-repo-brain.md +0 -169
- package/skills/adia-ui-ops/references/recipes/import-repo-brain-harvest.md +0 -153
- package/skills/adia-ui-ops/references/recipes/memory-organization.md +0 -182
- package/skills/adia-ui-ops/references/recipes/recommend-then-validate.md +0 -199
- package/skills/adia-ui-ops/references/recipes/self-healing-hooks.md +0 -366
- package/skills/adia-ui-ops/references/recipes/skill-stewardship-loop.md +0 -113
- package/skills/adia-ui-ops/references/standards/agents-md-spec.md +0 -138
- package/skills/adia-ui-ops/references/standards/claude-md-convention.md +0 -123
- package/skills/adia-ui-ops/references/standards/cross-tool-matrix.md +0 -85
- package/skills/adia-ui-ops/references/standards/readme-conventions.md +0 -232
- package/skills/adia-ui-ops/references/teach-protocol.md +0 -215
- package/skills/adia-ui-ops/scripts/audit-ops-roster.mjs +0 -104
- package/skills/adia-ui-ops/skill.json +0 -65
- package/skills/adia-ui-release/CHANGELOG.md +0 -66
- package/skills/adia-ui-release/SKILL.md +0 -323
- package/skills/adia-ui-release/assets/case-studies/2026-05-20-batch-push-v0.6.14-v0.6.15.md +0 -144
- package/skills/adia-ui-release/assets/case-studies/2026-05-20-corpus-drift-remediation-v0.6.15.md +0 -155
- package/skills/adia-ui-release/assets/case-studies/2026-05-20-version-skip-correction-v0.6.12.md +0 -114
- package/skills/adia-ui-release/assets/case-studies/2026-05-21-author-from-scratch-v0.6.18.md +0 -139
- package/skills/adia-ui-release/assets/case-studies/2026-05-21-feedback37-retraction-v0.6.21.md +0 -124
- package/skills/adia-ui-release/assets/case-studies/2026-05-21-fn1-enrichment-pass-v0.6.19.md +0 -125
- package/skills/adia-ui-release/assets/case-studies/2026-05-21-stale-test-detection-v0.6.20.md +0 -142
- package/skills/adia-ui-release/assets/case-studies/2026-05-23-freshness-gate-recovery-v0.6.32.md +0 -97
- package/skills/adia-ui-release/assets/case-studies/2026-05-26-catalog-drift-recurring-v0.6.40.md +0 -147
- package/skills/adia-ui-release/assets/templates/stub-changelog.template.md +0 -22
- package/skills/adia-ui-release/evals/evals.json +0 -164
- package/skills/adia-ui-release/references/changelog-discipline.md +0 -250
- package/skills/adia-ui-release/references/cycle-happy-path.md +0 -520
- package/skills/adia-ui-release/references/exe-deploy.md +0 -149
- package/skills/adia-ui-release/references/gates-catalog.md +0 -778
- package/skills/adia-ui-release/references/independent-package-release.md +0 -129
- package/skills/adia-ui-release/references/ledger-discipline.md +0 -232
- package/skills/adia-ui-release/references/migration-guide-authoring.md +0 -174
- package/skills/adia-ui-release/references/multi-agent-baseline.md +0 -207
- package/skills/adia-ui-release/references/notes-authoring.md +0 -212
- package/skills/adia-ui-release/references/recovery-paths.md +0 -262
- package/skills/adia-ui-release/references/rollup-notes.md +0 -208
- package/skills/adia-ui-release/references/teach-protocol.md +0 -468
- package/skills/adia-ui-release/scripts/audit-gate-roster.mjs +0 -196
- package/skills/adia-ui-release/scripts/make-ledger.mjs +0 -200
- package/skills/adia-ui-release/skill.json +0 -77
- package/skills/dogfood-sweep/CHANGELOG.md +0 -37
- package/skills/dogfood-sweep/README.md +0 -105
- package/skills/dogfood-sweep/SKILL.md +0 -1000
- package/skills/dogfood-sweep/analyze.mjs +0 -600
- package/skills/dogfood-sweep/skill.json +0 -31
- /package/skills/{adia-ui-authoring → adia-author}/references/api-contract.md +0 -0
- /package/skills/{adia-ui-release → adia-release}/scripts/assert-monorepo-root.mjs +0 -0
|
@@ -1,263 +0,0 @@
|
|
|
1
|
-
# Audit cadence — the 3-phase invocation contract
|
|
2
|
-
|
|
3
|
-
> **Owner: `adia-ui-ops` mode 5** (cold-start triage entry).
|
|
4
|
-
> Absorbed verbatim from the retired standalone `ops-repo` skill (v1.8.0,
|
|
5
|
-
> 2026-05-22) — `§Invocation`, `§The five promises`, `§Verification`,
|
|
6
|
-
> `§Audit categories`, `§What this skill (does NOT) produces`, `§The
|
|
7
|
-
> opinionated stance`, `§Quick reference`, `§Invariants`. Only the framing
|
|
8
|
-
> wrapper changed; the content body is identical.
|
|
9
|
-
|
|
10
|
-
Turn any repo into a **brain** for LLM coding agents — a less-wasteful,
|
|
11
|
-
token-and-context-optimized, less-prone-to-staleness, self-healing,
|
|
12
|
-
continuously-learning **memory layer** for the agents that work in it.
|
|
13
|
-
|
|
14
|
-
> **What "brain" means here — and what it doesn't.** The repo doesn't
|
|
15
|
-
> think. **You + your agents + the structured artifacts** form a
|
|
16
|
-
> cognitive system; this audit layer is the *artifact layer* of that
|
|
17
|
-
> system, not the cognition. Agents stay deterministic. Humans curate.
|
|
18
|
-
> Trip-wires enforce structure. The artifacts compound. (Per Steve
|
|
19
|
-
> Yegge, ["Welcome to Gas City"](https://steve-yegge.medium.com/welcome-to-gas-city-57f564bb3607)
|
|
20
|
-
> — the v1.1 reframe.)
|
|
21
|
-
>
|
|
22
|
-
> Concretely: working memory = entry files (AGENTS.md / CLAUDE.md).
|
|
23
|
-
> Long-term memory = ADRs (episodic decisions) + post-mortems
|
|
24
|
-
> (procedural lessons) + CHANGELOG (autobiographical timeline).
|
|
25
|
-
> Autobiographical introspection = `.brain/audit-history/`. Autonomic
|
|
26
|
-
> functions = pre-commit hooks + scheduled CI. Habit formation = the
|
|
27
|
-
> Anthropic iterate pattern. The repo gets *richer* over time as humans
|
|
28
|
-
> deposit and curate; the agents read what's there.
|
|
29
|
-
|
|
30
|
-
## Invocation (the 3-phase contract)
|
|
31
|
-
|
|
32
|
-
### Step 1 — Ingest
|
|
33
|
-
|
|
34
|
-
| Surface prompt | Watch for | Likely actual question |
|
|
35
|
-
|---|---|---|
|
|
36
|
-
| "Audit my docs" | Code docs vs LLM-agent docs | "Are my agent-readable docs in good shape?" |
|
|
37
|
-
| "Stale README" | One file vs whole surface | "Is my doc surface coherent?" |
|
|
38
|
-
| "Set up AGENTS.md" | Greenfield vs migration | "Do I have agent-rules already, and how do I consolidate?" |
|
|
39
|
-
| "Add ADRs" | Pattern vs immediate need | "Where should ADRs live and what should AGENTS.md say?" |
|
|
40
|
-
| "Set up .brain folder" / "migrate to .brain" | Greenfield vs migration | "Initialize the v1.5 layout, or migrate from `docs/`?" |
|
|
41
|
-
|
|
42
|
-
### Step 2 — Decompose
|
|
43
|
-
|
|
44
|
-
Every audit decomposes into the same six sub-tasks:
|
|
45
|
-
|
|
46
|
-
1. **Discovery** — what entry files, `.brain/`, and `docs/` folders exist?
|
|
47
|
-
2. **Pointer trace** — what does each entry file reference; does that target exist?
|
|
48
|
-
3. **Orphan detection** — what files exist in `.brain/` or `docs/` that are never referenced?
|
|
49
|
-
4. **Staleness probe** — what content is dated and obviously stale?
|
|
50
|
-
5. **Memory check** — do ADRs, postmortems, runbooks have homes (`.brain/` or legacy `docs/`)?
|
|
51
|
-
6. **Synthesis** — severity-ranked gap report + proposed fixes.
|
|
52
|
-
|
|
53
|
-
### Step 3 — Route
|
|
54
|
-
|
|
55
|
-
| You're doing… | Go to |
|
|
56
|
-
|---|---|
|
|
57
|
-
| Verifying AGENTS.md format | `standards/agents-md-spec.md` |
|
|
58
|
-
| Setting up CLAUDE.md as pointer / symlink | `standards/claude-md-convention.md` |
|
|
59
|
-
| Cross-tool compatibility matrix | `standards/cross-tool-matrix.md` |
|
|
60
|
-
| README/CONTRIBUTING/SECURITY conventions | `standards/readme-conventions.md` |
|
|
61
|
-
| Writing AGENTS.md *content* well | `guidance/llm-doc-writing.md` |
|
|
62
|
-
| Authoring an ADR | `doc-types/adr-pattern.md` |
|
|
63
|
-
| Decision-log shape (collection of ADRs) | `doc-types/decisions-log.md` |
|
|
64
|
-
| `PLAN.md` / `ROADMAP.md` shape | `doc-types/plan-roadmap.md` |
|
|
65
|
-
| `CHANGELOG.md` best practices | `doc-types/changelog.md` |
|
|
66
|
-
| `ARCHITECTURE.md` template | `doc-types/architecture-md.md` |
|
|
67
|
-
| Postmortem template (Google SRE / Atlassian) | `doc-types/postmortem-pattern.md` |
|
|
68
|
-
| Running a full audit (incl. `.brain/` migration) | `recipes/audit-existing-repo.md` |
|
|
69
|
-
| Greenfield setup (`.brain/` defaults) | `recipes/greenfield-setup.md` |
|
|
70
|
-
| Adding ADRs to an established repo | `recipes/adr-introduction.md` |
|
|
71
|
-
| Organizing memory primitives | `recipes/memory-organization.md` |
|
|
72
|
-
| **Self-healing hooks** (Promise 4) | `recipes/self-healing-hooks.md` |
|
|
73
|
-
| **Continuously-learning loop** (Promise 5) | `recipes/continuous-learning-loop.md` |
|
|
74
|
-
| **Findings-index readout** — close the read side of the audit ledger (Promise 5) | `recipes/findings-index-readout.md` |
|
|
75
|
-
| **Skill stewardship loop** — procedural-memory analog of audit-and-iterate (Promise 5) | `recipes/skill-stewardship-loop.md` |
|
|
76
|
-
| **Harvest ops-repo** — lift findings into agent memory + portable bundle | `recipes/harvest-repo-brain.md` |
|
|
77
|
-
| **Import ops-repo harvest** — consume a portable bundle into this repo | `recipes/import-repo-brain-harvest.md` |
|
|
78
|
-
| **Lockstep versioning** — multi-package monorepos pre-1.0 caret-lock trap (Promises 4, 5) | `audit-patterns/lockstep-versioning.md` |
|
|
79
|
-
| **Archive-link sweep** — depth-aware path rewrites after cross-tree moves (Promises 1, 3) | `audit-patterns/archive-link-sweep.md` |
|
|
80
|
-
| **Changelog `[Unreleased]` bloat** — periodic clear after release (Promises 1, 3) | `audit-patterns/changelog-unreleased-bloat.md` |
|
|
81
|
-
| **Spec dating** — backfill missing `date:` / `_Last reviewed:_` (Promise 3) | `audit-patterns/spec-dating-sweep.md` |
|
|
82
|
-
| **Browser-bundle `node:*` imports** — top-level static `import 'node:*'` in browser-reachable modules (Promises 3, 4) | `audit-patterns/browser-bundle-node-imports.md` |
|
|
83
|
-
| **Context budget** (Promise 2) | `guidance/context-budget.md` |
|
|
84
|
-
| **Redundancy detection** (Promise 1) | `audit-patterns/redundancy-detection.md` |
|
|
85
|
-
| **Token-waste detection** (Promise 2) | `audit-patterns/token-waste-detection.md` |
|
|
86
|
-
| Tooling for staleness (lychee, Vale, markdownlint, LLM-on-diff) | `audit-patterns/staleness-tooling.md` |
|
|
87
|
-
| **Reliability dial** + git-sync — `.brain/config.toml` strictness AND `shared`/`local-only` mode | `guidance/reliability-dial.md` |
|
|
88
|
-
| **Recommend-then-validate** — two-agent fix pattern | `recipes/recommend-then-validate.md` |
|
|
89
|
-
| **Audit history ledger** — persistent queryable record | `audit-patterns/audit-history-ledger.md` |
|
|
90
|
-
| **External-reference verification** — WebFetch URL probe | `recipes/external-reference-verification.md` |
|
|
91
|
-
| **Concurrent learnings merge** — multi-contributor sync | `recipes/concurrent-learnings-merge.md` |
|
|
92
|
-
| **Cold-start harvest** — importing existing learnings | `recipes/cold-start-harvest.md` |
|
|
93
|
-
| **Prose / writing genre** — non-code domains | `genres/prose-and-writing.md` |
|
|
94
|
-
|
|
95
|
-
## The five promises (and how each is delivered)
|
|
96
|
-
|
|
97
|
-
The audit makes specific promises about the repo it leaves behind. Each
|
|
98
|
-
promise is delivered by a concrete audit, edit, hook, or workflow — not
|
|
99
|
-
by good intentions. If a promise isn't backed by a verifiable mechanism,
|
|
100
|
-
it's broken.
|
|
101
|
-
|
|
102
|
-
| # | Promise | What it means concretely | Delivery mechanism | Reference |
|
|
103
|
-
|---|---|---|---|---|
|
|
104
|
-
| 1 | **Less-wasteful** | No orphans. No drift between CLAUDE.md and AGENTS.md. No duplicate prose. Every doc has a reason to exist. | Orphan detection + redundancy detection + drift consolidation + archive-not-delete | `audit-patterns/orphan-detection.md`, `audit-patterns/redundancy-detection.md` |
|
|
105
|
-
| 2 | **Token-and-context-optimized** | Agents read the minimum needed. Entry files under ~200 lines (Anthropic). Detail lives in linked subfolders. Structure lets agents pull only the slice they need. | <200-line ceiling on entry files; pointer-based navigation; layered docs (entry → ARCHITECTURE → ADRs deep); token-waste detection | `guidance/context-budget.md`, `guidance/llm-doc-writing.md`, `audit-patterns/token-waste-detection.md` |
|
|
106
|
-
| 3 | **Less-prone-to-staleness** | Staleness is *visible* (frontmatter dates, "Last reviewed:" lines), *detectable* (lychee, git-mtime, LLM-on-diff), and *gated* (CI fails on broken links / stale content) | Dated frontmatter required; lychee link checks; git-mtime heuristic; LLM-on-diff PR gate | `audit-patterns/staleness-tooling.md`, `audit-patterns/stale-content.md` |
|
|
107
|
-
| 4 | **Self-healing** | The repo fixes itself in CI, not in occasional human-driven audits. Drift between CLAUDE.md and AGENTS.md fails pre-commit. Broken links fail PRs. Orphans get auto-archived after a grace period. | Pre-commit hooks; GitHub Actions (weekly audit + PR-time drift check); apply-fixes mode; auto-archive workflow | `recipes/self-healing-hooks.md` |
|
|
108
|
-
| 5 | **Continuously-learning indefinitely** | The *artifacts compound, not the agents.* Agents stay deterministic; humans curate; the trip-wires enforce structure. Both **declarative memory** (entry files, ADRs, postmortems, audit ledgers, findings index) and **procedural memory** (skills under `.claude/skills/`) compound — mistakes become AGENTS.md corrections, decisions become ADRs, incidents become post-mortems, recurring procedures become skills. | Anthropic iterate pattern; ADR-on-architectural-change flow; postmortem-on-incident flow; audit history ledger; findings-index readout; skill-stewardship loop with four scripts (check-skill-frontmatter, audit-skills, draft-skill, iterate-skill) | `recipes/continuous-learning-loop.md`, `recipes/findings-index-readout.md`, `recipes/skill-stewardship-loop.md`, `audit-patterns/audit-history-ledger.md` |
|
|
109
|
-
|
|
110
|
-
> **The check:** every audit pass produces a gap report mapped to these
|
|
111
|
-
> promises. If the repo can't pass *all five* promise-checks at the
|
|
112
|
-
> chosen severity threshold, the skill flags exactly which promises
|
|
113
|
-
> aren't being delivered and recommends the specific mechanism to install.
|
|
114
|
-
|
|
115
|
-
## Verification — how to confirm a promise is delivered
|
|
116
|
-
|
|
117
|
-
Each promise has a **trip-wire**: a concrete check that fails when the
|
|
118
|
-
promise breaks. Without trip-wires, "self-healing" is just a marketing
|
|
119
|
-
claim.
|
|
120
|
-
|
|
121
|
-
| Promise | Trip-wire (the check that catches breakage) | Where it runs |
|
|
122
|
-
|---|---|---|
|
|
123
|
-
| Less-wasteful | (a) `orphan-detection` finds zero unreferenced files in `.brain/` and `docs/` (archived ones live in `.brain/archive/`). (b) MD5(CLAUDE.md) ≠ MD5(AGENTS.md) only if symlink/thin-pointer. | Pre-commit hook + weekly CI |
|
|
124
|
-
| Token-optimized | `wc -l AGENTS.md CLAUDE.md` < 200 each (warn at 150). Token-waste detection across `.brain/` + `docs/` finds zero >500-line files that aren't ADRs/postmortems. | Pre-commit hook |
|
|
125
|
-
| Stale-resistant | `lychee` exits clean. Every file in `.brain/` and `docs/` has a `date:` frontmatter or `_Last reviewed:_` line within 365 days. | PR CI + scheduled CI |
|
|
126
|
-
| Self-healing | The hooks above are wired into `.husky/` or `.git/hooks/` AND `.github/workflows/`. Audit verifies their **presence**. A repo with no hooks is not self-healing — it just happens to be clean today. | Audit checks for hook existence |
|
|
127
|
-
| Continuously-learning | (a) `.brain/adrs/` and `.brain/postmortems/` (or legacy `docs/` equivalents) exist; both have ≥1 entry from the last 90 days OR an explicit "no architectural changes / no incidents in window" note. (b) `.agents/skills/` or `.claude/skills/` exists; `audit-skills` runs clean (no errors); skill frontmatter passes `check-skill-frontmatter`. | Quarterly review + skill audit |
|
|
128
|
-
|
|
129
|
-
> **The canonical model (background).** **`AGENTS.md`** is the standard
|
|
130
|
-
> entry file for LLM coding agents — emerged August 2025, stewarded by
|
|
131
|
-
> the **Agentic AI Foundation (AAIF) under the Linux Foundation** since
|
|
132
|
-
> December 2025, adopted by 60,000+ open-source projects. `CLAUDE.md`,
|
|
133
|
-
> `.cursor/rules/*.mdc`, `.windsurfrules`, `.github/copilot-instructions.md`
|
|
134
|
-
> should be **thin pointers to `AGENTS.md`**.
|
|
135
|
-
>
|
|
136
|
-
> **Important caveat.** As of April 2026 **Claude Code does not read
|
|
137
|
-
> `AGENTS.md` natively** ([issue #31005](https://github.com/anthropics/claude-code/issues/31005)).
|
|
138
|
-
> The two clean workarounds are: (a) symlink `ln -s AGENTS.md CLAUDE.md`,
|
|
139
|
-
> or (b) keep a thin `CLAUDE.md` that says "instructions live in AGENTS.md."
|
|
140
|
-
|
|
141
|
-
## What this audit produces
|
|
142
|
-
|
|
143
|
-
- A **gap report** (`stale-docs-audit.md`) with severity-ranked findings:
|
|
144
|
-
missing entry files, broken pointers, orphaned docs, missing memory
|
|
145
|
-
primitives, stale content.
|
|
146
|
-
- **Specific fixes**: edits to `AGENTS.md` / `CLAUDE.md` / other entry
|
|
147
|
-
files; new files to seed (`.brain/adrs/0001-*.md`, etc.); removals of
|
|
148
|
-
stale duplicates.
|
|
149
|
-
- An **opinion** on memory organization: where ADRs live, where decision
|
|
150
|
-
logs live, where traces live, and how the entry file points to each.
|
|
151
|
-
|
|
152
|
-
## What this audit does NOT do
|
|
153
|
-
|
|
154
|
-
- Does not write feature documentation. Looks at the *meta-shape* of the
|
|
155
|
-
docs surface.
|
|
156
|
-
- Does not enforce a content style guide. Match the project's voice.
|
|
157
|
-
- Does not run code or modify behavior. Doc-only.
|
|
158
|
-
|
|
159
|
-
## The opinionated stance
|
|
160
|
-
|
|
161
|
-
1. **AGENTS.md is canonical.** One file, top-level. Spec home:
|
|
162
|
-
[agents.md](https://agents.md). Format is **deliberately light** —
|
|
163
|
-
no required fields, "just standard Markdown."
|
|
164
|
-
2. **CLAUDE.md is a thin pointer or symlink.** A 3-5 line redirect, or
|
|
165
|
-
`ln -s AGENTS.md CLAUDE.md`. Same shape for `.cursor/rules/*.mdc`,
|
|
166
|
-
`.windsurfrules`, `.github/copilot-instructions.md`. Avoid maintaining
|
|
167
|
-
N divergent copies.
|
|
168
|
-
3. **Entry files explicitly point to subfolders.** A naked `AGENTS.md`
|
|
169
|
-
is incomplete — it must say "for architecture decisions, read
|
|
170
|
-
`.brain/adrs/`", "for the roadmap, read `PLAN.md`", "for change
|
|
171
|
-
history, read `CHANGELOG.md`."
|
|
172
|
-
4. **Memory primitives have homes.** ADRs in `.brain/adrs/` (numbered,
|
|
173
|
-
dated, status). **Postmortems in `.brain/postmortems/`** (Google SRE
|
|
174
|
-
blameless format). Runbooks in `.brain/runbooks/`. Each gets a
|
|
175
|
-
pointer from `AGENTS.md`. Greenfield repos default to `.brain/`
|
|
176
|
-
(since v1.5); existing repos with `docs/{adrs,postmortems,...}/` are
|
|
177
|
-
recognized by the audit and may migrate via
|
|
178
|
-
`recipes/audit-existing-repo.md` `Migration` section.
|
|
179
|
-
5. **Every doc is dated.** YAML frontmatter `date:` or
|
|
180
|
-
`_Last reviewed: YYYY-MM-DD_`. Staleness must be visible.
|
|
181
|
-
6. **Orphans are a smell.** Files in `.brain/` or `./docs/` that no
|
|
182
|
-
entry file references are either (a) missing from the index or (b)
|
|
183
|
-
abandoned and should be archived.
|
|
184
|
-
7. **Keep AGENTS.md / CLAUDE.md short.** Anthropic's guidance: "under
|
|
185
|
-
~200 lines"; instruction quality drops as count rises.
|
|
186
|
-
|
|
187
|
-
## Audit categories
|
|
188
|
-
|
|
189
|
-
| Category | What it checks | Reference |
|
|
190
|
-
|---|---|---|
|
|
191
|
-
| **Entry-file coverage** | Does `AGENTS.md` exist? Does `CLAUDE.md` point to it? Are other agent-rules files thin pointers? | `audit-patterns/entry-file-coverage.md` |
|
|
192
|
-
| **Pointer integrity** | Do entry files reference real subfolders? Are intra-repo links resolving? | `audit-patterns/pointer-validation.md` |
|
|
193
|
-
| **Orphan detection** | Files in `.brain/` or `./docs/` not referenced by any entry file | `audit-patterns/orphan-detection.md` |
|
|
194
|
-
| **Staleness** | Dates older than threshold; references to renamed/removed code; broken intra-repo links | `audit-patterns/stale-content.md` |
|
|
195
|
-
| **Memory fragmentation** | No `.brain/adrs/`; ADRs in random places; decisions mixed with code comments | `audit-patterns/memory-fragmentation.md` |
|
|
196
|
-
| **Coverage gaps** | Missing canonical files (`README.md`, `CHANGELOG.md`, `CONTRIBUTING.md`, `ARCHITECTURE.md`) | `audit-patterns/coverage-gaps.md` |
|
|
197
|
-
| **Format hygiene** | Undated docs, no frontmatter, no ownership, no version info | `audit-patterns/format-hygiene.md` |
|
|
198
|
-
| **Skill stewardship** | Skills (`.agents/skills/*` or `.claude/skills/*`) — frontmatter present, descriptions 60-1024 chars; six-signal audit (procedure recurrence, graduations without skills, memory citations, stale refs, churn divergence, description similarity); reference scripts: `audit-skills`, `check-skill-frontmatter`, `draft-skill`, `iterate-skill`. | `recipes/skill-stewardship-loop.md` |
|
|
199
|
-
| **Lockstep versioning** | Multi-package monorepos pre-1.0: caret-lock trap (`^0.0.x` resolves to exact version); coordinated bumps + CI gate | `audit-patterns/lockstep-versioning.md` |
|
|
200
|
-
| **Archive-link sweep** | After cross-tree doc moves (e.g. `docs/X.md` → `.brain/archive/Y.md`), every linker needs depth-aware path rewrite | `audit-patterns/archive-link-sweep.md` |
|
|
201
|
-
| **Changelog `[Unreleased]` bloat** | After a release cut, `[Unreleased]` blocks accumulate stale promoted-content; periodic clear | `audit-patterns/changelog-unreleased-bloat.md` |
|
|
202
|
-
| **Spec dating** | Specs without `date:` frontmatter or `_Last reviewed:_` line are invisible to staleness detection | `audit-patterns/spec-dating-sweep.md` |
|
|
203
|
-
| **Browser-bundle `node:*` imports** | Modules reachable from browser bundles must guard `node:*` imports (top-level static imports throw via Vite's externalization stub) | `audit-patterns/browser-bundle-node-imports.md` |
|
|
204
|
-
|
|
205
|
-
## Quick reference — the canonical doc surface (v1.5 layout)
|
|
206
|
-
|
|
207
|
-
| Path | Purpose | Entry-file should point to it? |
|
|
208
|
-
|---|---|---|
|
|
209
|
-
| `AGENTS.md` | THE entry file for LLM agents | n/a — itself the entry |
|
|
210
|
-
| `CLAUDE.md` | Thin pointer or `ln -s AGENTS.md` | n/a — derivative |
|
|
211
|
-
| `.cursor/rules/*.mdc` | Cursor's newer rules dir | n/a — Cursor reads AGENTS.md too |
|
|
212
|
-
| `.windsurfrules` | Windsurf (Cognition-owned). Reads AGENTS.md too | n/a — derivative |
|
|
213
|
-
| `.github/copilot-instructions.md` | GitHub Copilot. Also reads AGENTS.md/CLAUDE.md/GEMINI.md | n/a — derivative |
|
|
214
|
-
| `.aider.conf.yml` + `CONVENTIONS.md` | Aider | n/a |
|
|
215
|
-
| `.continue/` rules | Continue.dev | n/a |
|
|
216
|
-
| `README.md` | Human + LLM landing | YES |
|
|
217
|
-
| `PLAN.md` | Active work plan (repo root) | YES if exists |
|
|
218
|
-
| `ROADMAP.md` | Future-looking (repo root) | YES if exists |
|
|
219
|
-
| `CHANGELOG.md` | Released change history | YES |
|
|
220
|
-
| `ARCHITECTURE.md` | System overview (matklad pattern; repo root) | YES if exists |
|
|
221
|
-
| `CONTRIBUTING.md` | Contributor guide | YES if exists |
|
|
222
|
-
| `SECURITY.md` | Security disclosure | YES if exists |
|
|
223
|
-
| `.brain/adrs/` | Numbered ADRs (the *canonical* "Architecture Decision Log") | YES |
|
|
224
|
-
| `.brain/postmortems/` | Blameless incident write-ups (Google SRE / Atlassian) | YES if exists |
|
|
225
|
-
| `.brain/runbooks/` | Operational procedures | YES if exists |
|
|
226
|
-
| `.brain/archive/` | Superseded/abandoned docs (auto-archived after 30-day grace) | n/a |
|
|
227
|
-
| `.brain/architecture/` | Diagrams + extended docs (short overview is `ARCHITECTURE.md` at root) | YES if exists |
|
|
228
|
-
| `.brain/audit-history/` | JSON audit ledger (queryable, SOC2-friendly) | n/a |
|
|
229
|
-
| `.brain/changesets/` | AGENTS.md changesets staging (multi-contributor; consolidated at merge) | n/a |
|
|
230
|
-
| `.brain/cache/` | WebFetch cache for external-ref-verification (gitignored) | n/a |
|
|
231
|
-
| `.brain/cold-start/` | Harvest-session working state (gitignored) | n/a |
|
|
232
|
-
| `.brain/config.toml` | Repo-brain strictness configuration (lax/normal/strict) | n/a |
|
|
233
|
-
|
|
234
|
-
> **Legacy `docs/` layout supported.** Repos pre-dating v1.5 may have
|
|
235
|
-
> `docs/adrs/`, `docs/postmortems/`, `docs/runbooks/`, `docs/archive/`,
|
|
236
|
-
> `docs/architecture/`. The audit recognizes both. Migration to `.brain/`
|
|
237
|
-
> is opt-in via one `git mv` (recipe in `recipes/audit-existing-repo.md`
|
|
238
|
-
> `Migration` section).
|
|
239
|
-
|
|
240
|
-
## Invariants
|
|
241
|
-
|
|
242
|
-
1. **AGENTS.md is canonical.** All other entry files are thin pointers,
|
|
243
|
-
not divergent copies.
|
|
244
|
-
2. **Entry files explicitly point to subfolders.** A naked AGENTS.md is
|
|
245
|
-
incomplete.
|
|
246
|
-
3. **Every doc is dated.** Frontmatter `date:` or `_Last reviewed:_` line.
|
|
247
|
-
4. **Memory primitives have homes (v1.5 layout).** ADRs in `.brain/adrs/`,
|
|
248
|
-
postmortems in `.brain/postmortems/`, runbooks in `.brain/runbooks/`,
|
|
249
|
-
archive in `.brain/archive/`. Audit recognizes legacy
|
|
250
|
-
`docs/{adrs,postmortems,...}/` and nudges toward migration.
|
|
251
|
-
5. **Orphans are findings, not noise.** Every orphan gets a recommendation.
|
|
252
|
-
6. **No destructive deletion without confirmation.** The audit recommends;
|
|
253
|
-
the user decides.
|
|
254
|
-
7. **Cross-tool compatibility over single-tool optimization.**
|
|
255
|
-
8. **Procedural memory is co-equal with declarative.** Skills under
|
|
256
|
-
`.agents/skills/` (or `.claude/skills/` where `.agents/` is not
|
|
257
|
-
present) are part of the brain — audited, dated, frontmatter-checked.
|
|
258
|
-
`audit-skills` runs alongside the doc audit; `iterate-skill --update`
|
|
259
|
-
is the procedural analog of intra-repo link rewrites.
|
|
260
|
-
9. **Flow operations are conversational, not commands.** "Harvest
|
|
261
|
-
ops-repo" / "import ops-repo harvest" invoke the bridge recipes;
|
|
262
|
-
never become standalone skills (they compose primitives this skill
|
|
263
|
-
already owns).
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
# Archive-link sweep (per-file relative-path rewrites)
|
|
2
|
-
|
|
3
|
-
**Added:** 2026-05-02 after the lockstep cut's plan archival surfaced
|
|
4
|
-
5 broken intra-repo links — each with a different relative-path
|
|
5
|
-
depth.
|
|
6
|
-
|
|
7
|
-
## The drift class
|
|
8
|
-
|
|
9
|
-
When a doc moves via `git mv` from one tree location to another
|
|
10
|
-
(typically `docs/plans/X.md` → `.brain/archive/YYYY-Q/PLAN-X.md`),
|
|
11
|
-
intra-repo links from other files break. **Each linking file has a
|
|
12
|
-
*different* relative-path depth** — sed alone can't fix them in one
|
|
13
|
-
pass.
|
|
14
|
-
|
|
15
|
-
Example drift surface (from the 2026-05-02 plan archival):
|
|
16
|
-
|
|
17
|
-
| Linking file | Old → new |
|
|
18
|
-
|---|---|
|
|
19
|
-
| `CHANGELOG.md` (root) | `./docs/plans/X.md` → `./.brain/archive/YYYY-Q/PLAN-X.md` |
|
|
20
|
-
| `ROADMAP.md` (root) | same |
|
|
21
|
-
| `docs/conventions/Y.md` | `../plans/X.md` → `../../.brain/archive/YYYY-Q/PLAN-X.md` |
|
|
22
|
-
| `docs/journal/YYYY/MM/Z.md` | `../../../plans/X.md` → `../../../../.brain/archive/YYYY-Q/PLAN-X.md` |
|
|
23
|
-
| `packages/<pkg>/CHANGELOG.md` | `../../../docs/plans/X.md` → `../../../.brain/archive/YYYY-Q/PLAN-X.md` |
|
|
24
|
-
|
|
25
|
-
5 files, 4 different relative-path patterns. A `sed -i 's|docs/plans/X|.brain/archive/Y/PLAN-X|g'` doesn't work — the prefix segments differ.
|
|
26
|
-
|
|
27
|
-
## Detection
|
|
28
|
-
|
|
29
|
-
```bash
|
|
30
|
-
node scripts/check-links.mjs --all 2>&1 | head -20
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
Look for "resolves to: <path> (not found)" entries.
|
|
34
|
-
|
|
35
|
-
## Fix recipe (Python with explicit per-file tuples)
|
|
36
|
-
|
|
37
|
-
```python
|
|
38
|
-
import pathlib
|
|
39
|
-
|
|
40
|
-
ROOT = pathlib.Path("/path/to/repo")
|
|
41
|
-
|
|
42
|
-
# Each tuple: (linking_file, old_fragment, new_fragment)
|
|
43
|
-
EDITS = [
|
|
44
|
-
(ROOT / "CHANGELOG.md",
|
|
45
|
-
"./docs/plans/X.md",
|
|
46
|
-
"./.brain/archive/2026-Q2/PLAN-X.md"),
|
|
47
|
-
(ROOT / "ROADMAP.md",
|
|
48
|
-
"./docs/plans/X.md",
|
|
49
|
-
"./.brain/archive/2026-Q2/PLAN-X.md"),
|
|
50
|
-
(ROOT / "docs/conventions/Y.md",
|
|
51
|
-
"../plans/X.md",
|
|
52
|
-
"../../.brain/archive/2026-Q2/PLAN-X.md"),
|
|
53
|
-
(ROOT / "docs/journal/2026/05/Z.md",
|
|
54
|
-
"../../../plans/X.md",
|
|
55
|
-
"../../../../.brain/archive/2026-Q2/PLAN-X.md"),
|
|
56
|
-
(ROOT / "packages/foo/CHANGELOG.md",
|
|
57
|
-
"../../../docs/plans/X.md",
|
|
58
|
-
"../../../.brain/archive/2026-Q2/PLAN-X.md"),
|
|
59
|
-
]
|
|
60
|
-
|
|
61
|
-
for path, old, new in EDITS:
|
|
62
|
-
text = path.read_text()
|
|
63
|
-
if old in text:
|
|
64
|
-
path.write_text(text.replace(old, new))
|
|
65
|
-
print(f" ✓ {path.relative_to(ROOT)}")
|
|
66
|
-
else:
|
|
67
|
-
print(f" ✗ {path.relative_to(ROOT)} — old fragment not found")
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
After running, verify:
|
|
71
|
-
|
|
72
|
-
```bash
|
|
73
|
-
node scripts/check-links.mjs --all
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
Expected: zero broken intra-repo links.
|
|
77
|
-
|
|
78
|
-
## Prevention
|
|
79
|
-
|
|
80
|
-
This is mechanical drift — there's no preventing it without making
|
|
81
|
-
all references absolute. Two practical mitigations:
|
|
82
|
-
|
|
83
|
-
1. **Pre-commit hook** runs `check-links.mjs` on every staged
|
|
84
|
-
markdown change. The hook would catch the move + link rot in the
|
|
85
|
-
same commit.
|
|
86
|
-
2. **The `stale-audit` skill** includes this check as part of its
|
|
87
|
-
7-check post-release sweep.
|
|
88
|
-
|
|
89
|
-
## Related
|
|
90
|
-
|
|
91
|
-
- See [`feedback_relative_path_after_archive.md`](`~/.claude/projects/<repo>/memory/`) — the user-memory entry capturing the lesson.
|
|
92
|
-
- Sibling concern to `feedback_directory_rename_outbound_refs` (which
|
|
93
|
-
is about renames, not archive moves) and `feedback_git_mv_audit_imports`
|
|
94
|
-
(which is about code imports inside moved files, not links from
|
|
95
|
-
elsewhere TO the moved file).
|
|
96
|
-
- `stale-audit` skill check #4.
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
date: 2026-04-27
|
|
3
|
-
coverage: canonical
|
|
4
|
-
peers:
|
|
5
|
-
- ../recipes/self-healing-hooks.md
|
|
6
|
-
- ../recipes/continuous-learning-loop.md
|
|
7
|
-
- ../recipes/recommend-then-validate.md
|
|
8
|
-
- ../guidance/reliability-dial.md
|
|
9
|
-
primary_sources:
|
|
10
|
-
- Steve Yegge, "Welcome to Gas City" — versioned action ledger pattern
|
|
11
|
-
- https://www.dolthub.com/ — Dolt git-versioned database (Yegge's reference implementation)
|
|
12
|
-
status: research-verified
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
# Audit history ledger (the persistent record of every fix)
|
|
16
|
-
|
|
17
|
-
> _"Every agent action recorded in both a database and version history… Your SOC2 story, sitting right there in the database, already written."_
|
|
18
|
-
> — Steve Yegge, "Welcome to Gas City"
|
|
19
|
-
|
|
20
|
-
## What this delivers
|
|
21
|
-
|
|
22
|
-
Every audit run produces a queryable, versioned artifact. The repo *itself* becomes its own audit log of how it was fixed over time. This compounds **Promise 5 (continuously-learning)** — the artifacts that accumulate aren't just ADRs and post-mortems, but also a structured record of how the doc surface evolved.
|
|
23
|
-
|
|
24
|
-
Falls out as a free benefit: SOC2 / compliance / "show me what changed in the last quarter" queries become trivial.
|
|
25
|
-
|
|
26
|
-
## The ledger structure
|
|
27
|
-
|
|
28
|
-
```
|
|
29
|
-
.brain/
|
|
30
|
-
├── audit-history/
|
|
31
|
-
│ ├── 2026-04-27.json
|
|
32
|
-
│ ├── 2026-05-04.json
|
|
33
|
-
│ ├── 2026-05-11.json
|
|
34
|
-
│ └── ...
|
|
35
|
-
├── README.md # generated index, sorted newest-first
|
|
36
|
-
└── trends.md # quarterly summary (optional)
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
One file per audit run, named `YYYY-MM-DD.json` (or `YYYY-MM-DD-HHMM.json` if multiple per day). **Append-only — never modified after the run completes** (immutable, like ADRs and post-mortems).
|
|
40
|
-
|
|
41
|
-
## The schema
|
|
42
|
-
|
|
43
|
-
```json
|
|
44
|
-
{
|
|
45
|
-
"$schema": "https://ops-repo.dev/schemas/audit-history.v1.json",
|
|
46
|
-
"audit_id": "2026-04-27T13:42:00Z",
|
|
47
|
-
"repo": "github.com/example/example",
|
|
48
|
-
"commit": "abc123def456",
|
|
49
|
-
"strictness": "normal",
|
|
50
|
-
"skill_version": "1.1.0",
|
|
51
|
-
"promises_evaluated": [1, 2, 3, 4, 5],
|
|
52
|
-
"findings": [
|
|
53
|
-
{
|
|
54
|
-
"id": "DRIFT-CLAUDE-AGENTS",
|
|
55
|
-
"promise": 1,
|
|
56
|
-
"severity": "critical",
|
|
57
|
-
"category": "redundancy",
|
|
58
|
-
"file": "CLAUDE.md",
|
|
59
|
-
"message": "CLAUDE.md (240 lines) and AGENTS.md (180 lines) have substantively divergent content."
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
"id": "STALE-2026-04-15",
|
|
63
|
-
"promise": 3,
|
|
64
|
-
"severity": "medium",
|
|
65
|
-
"category": "staleness",
|
|
66
|
-
"file": "docs/old-plan.md",
|
|
67
|
-
"message": "Last modified 2024-09-12 (583 days ago); no '_Last reviewed:_' line."
|
|
68
|
-
}
|
|
69
|
-
],
|
|
70
|
-
"fixes_proposed": 12,
|
|
71
|
-
"fixes_applied": 8,
|
|
72
|
-
"fixes_vetoed": 4,
|
|
73
|
-
"veto_reasons": [
|
|
74
|
-
{"fix_id": "delete-orphan-1", "rule": "delete-always-vetoed"},
|
|
75
|
-
{"fix_id": "edit-agents-md", "rule": "would-exceed-200-lines"}
|
|
76
|
-
],
|
|
77
|
-
"trip_wires": {
|
|
78
|
-
"lychee": "pass",
|
|
79
|
-
"entry_file_length": "pass",
|
|
80
|
-
"agents_claude_drift": "fail",
|
|
81
|
-
"doc_dates": "pass",
|
|
82
|
-
"orphan_count": 4
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
The schema is intentionally simple — no nested objects beyond two levels, no free-text bodies. The whole file should fit in <2KB for a typical run.
|
|
88
|
-
|
|
89
|
-
## Why JSON, not Markdown
|
|
90
|
-
|
|
91
|
-
- **Queryable.** `jq '.findings[] | select(.severity=="critical")' audit-history/*.json` answers compliance questions in seconds.
|
|
92
|
-
- **Diff-friendly.** Git diff highlights actual content changes, not prose reflow.
|
|
93
|
-
- **Schema-validatable.** The `$schema` URL anchors the format; CI can reject malformed entries.
|
|
94
|
-
- **Token-cheap.** A structured record consumes a fraction of the tokens Markdown narration would.
|
|
95
|
-
|
|
96
|
-
For human readers, the generated `audit-history/README.md` summarizes:
|
|
97
|
-
|
|
98
|
-
```markdown
|
|
99
|
-
# Audit history
|
|
100
|
-
|
|
101
|
-
| Date | Strictness | Findings | Critical | Fixes applied |
|
|
102
|
-
|---|---|---|---|---|
|
|
103
|
-
| [2026-05-11](2026-05-11.json) | normal | 8 | 0 | 4 |
|
|
104
|
-
| [2026-05-04](2026-05-04.json) | normal | 11 | 1 | 6 |
|
|
105
|
-
| [2026-04-27](2026-04-27.json) | normal | 23 | 2 | 8 |
|
|
106
|
-
|
|
107
|
-
_Trend: critical findings down 100% over 14 days. Total findings down 65%._
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
Generated weekly by the scheduled CI workflow.
|
|
111
|
-
|
|
112
|
-
## How it integrates with the other promises
|
|
113
|
-
|
|
114
|
-
| Promise | What the ledger adds |
|
|
115
|
-
|---|---|
|
|
116
|
-
| 1. Less-wasteful | Trend data shows whether redundancy is increasing or decreasing |
|
|
117
|
-
| 2. Token-optimized | Tracks entry-file line counts over time |
|
|
118
|
-
| 3. Less-stale | Tracks % of docs with valid `date:` frontmatter over time |
|
|
119
|
-
| 4. Self-healing | Records which trip-wires fired and which hooks caught them |
|
|
120
|
-
| 5. Continuously-learning | The ledger *is* part of the institutional memory; not just curated artifacts but the operational record |
|
|
121
|
-
|
|
122
|
-
## Privacy considerations
|
|
123
|
-
|
|
124
|
-
Some teams will not want every audit run committed to a public repo:
|
|
125
|
-
|
|
126
|
-
- **Public repos:** Either commit the ledger (most useful) or `.gitignore` it (preserves history locally only).
|
|
127
|
-
- **Private repos:** Always commit; this is where compliance value compounds.
|
|
128
|
-
- **Sensitive findings:** Never put PII or secrets in audit messages. The schema's `message` field should describe categories, not content (✅ "broken link in marketing copy"; ❌ "broken link to https://internal.example.com/finance/q4-revenue.pdf").
|
|
129
|
-
|
|
130
|
-
The audit emits warnings if any finding message contains URL fragments matching common secret patterns (API keys, tokens, internal hostnames).
|
|
131
|
-
|
|
132
|
-
## Closing the read side — `.brain/findings/INDEX.md`
|
|
133
|
-
|
|
134
|
-
The ledger is *write-rich, read-poor*. Every audit emits structured findings, but nothing surfaces them — a future session would have to `cat` every JSON to know what's still open. The read-side closure is a generated `.brain/findings/INDEX.md` that folds every `findings[]` entry across the ledger into one sortable view, plus a hand-curated `## Graduations` table tracking finding-to-permanent-infrastructure pairs.
|
|
135
|
-
|
|
136
|
-
Recipe: [`../recipes/findings-index-readout.md`](../recipes/findings-index-readout.md). Wire it into the same harvest cron that writes the ledger; the index regenerates on every run, the ledger stays append-only.
|
|
137
|
-
|
|
138
|
-
This is the load-bearing closure for *capture-without-action* drift — an audit ledger that nobody reads might as well not exist.
|
|
139
|
-
|
|
140
|
-
## Compliance / SOC2 framing (the free benefit)
|
|
141
|
-
|
|
142
|
-
Auditors increasingly ask:
|
|
143
|
-
- "Show me changes to documented procedures."
|
|
144
|
-
- "Demonstrate the last review of [X]."
|
|
145
|
-
- "Provide a record of how doc-quality issues were detected and resolved."
|
|
146
|
-
|
|
147
|
-
The audit history ledger answers all three trivially. It's not a *replacement* for compliance docs, but it materially reduces the "gather evidence" cost.
|
|
148
|
-
|
|
149
|
-
## Anti-patterns
|
|
150
|
-
|
|
151
|
-
- **Manually editing past audit-history files.** Defeats the immutability invariant. Like editing accepted ADRs.
|
|
152
|
-
- **Letting the ledger grow without index/trend files.** A flat folder of 200 JSON files is unreadable. The README.md and trends.md surface what's worth seeing.
|
|
153
|
-
- **Storing findings *content* (the actual broken link, the actual stale text)** rather than findings *categories*. Privacy hazard.
|
|
154
|
-
- **Including the ledger in token budget calculations.** It's not loaded by agents in normal sessions; it's an out-of-band artifact.
|
|
155
|
-
- **Running the audit so often the ledger fills with noise** — once-weekly is the sweet spot for most repos. Daily is overkill outside high-velocity production.
|
|
156
|
-
|
|
157
|
-
## Cross-references
|
|
158
|
-
|
|
159
|
-
- Self-healing hooks (where the audit runs): `../recipes/self-healing-hooks.md`
|
|
160
|
-
- Continuously-learning loop (the broader context): `../recipes/continuous-learning-loop.md`
|
|
161
|
-
- Recommend-then-validate (which writes vetoes into the ledger): `../recipes/recommend-then-validate.md`
|
|
162
|
-
- Reliability dial (recorded with each audit run): `../guidance/reliability-dial.md`
|