@adia-ai/adia-ui-forge 0.1.3 → 0.8.1
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 +4 -7
- package/CHANGELOG.md +35 -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 +28 -3
- package/skills/{adia-ui-release → adia-release}/scripts/dispatch-publish.mjs +10 -7
- 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 +38 -31
- package/skills/{adia-ui-release → adia-release}/scripts/tag-lockstep.mjs +7 -3
- 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,158 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
date: 2026-04-27
|
|
3
|
-
coverage: canonical
|
|
4
|
-
peers:
|
|
5
|
-
- ../audit-patterns/stale-content.md
|
|
6
|
-
- ../audit-patterns/staleness-tooling.md
|
|
7
|
-
- recommend-then-validate.md
|
|
8
|
-
- ../audit-patterns/audit-history-ledger.md
|
|
9
|
-
primary_sources:
|
|
10
|
-
- https://github.com/karpathy/autoresearch — autonomous propose-evaluate-iterate (spirit-source)
|
|
11
|
-
- https://github.com/lycheeverse/lychee — link checker (the *liveness* check this recipe complements)
|
|
12
|
-
status: research-verified
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
# External-reference verification (WebFetch-powered)
|
|
16
|
-
|
|
17
|
-
> _"You're not touching any of the Python files like you normally would as a researcher. Instead, you are programming the `program.md` Markdown files that provide context to the AI agents."_
|
|
18
|
-
> — Andrej Karpathy, [autoresearch](https://github.com/karpathy/autoresearch)
|
|
19
|
-
|
|
20
|
-
The premise: **`lychee` tells you a link is broken; it doesn't tell you the live link points to outdated content.** External-reference verification fetches the current state of cited URLs, library docs, and spec pages, compares to what the doc claims, and proposes specific corrections.
|
|
21
|
-
|
|
22
|
-
This recipe imports autoresearch's *spirit* (focused research question → fetch → evaluate → propose) into repo-fixer, scoped to the one place where its loop genuinely fits: external-reference verification.
|
|
23
|
-
|
|
24
|
-
## What it catches that other staleness tools miss
|
|
25
|
-
|
|
26
|
-
| Tool | Catches | Doesn't catch |
|
|
27
|
-
|---|---|---|
|
|
28
|
-
| `lychee` | Dead links (404s, timeouts) | Live links pointing to outdated content |
|
|
29
|
-
| Git-mtime heuristic | Old files | New files with stale facts |
|
|
30
|
-
| LLM-on-diff | Code-doc drift in *this* repo | External-world drift |
|
|
31
|
-
| **External-ref verification** | "AGENTS.md cites Promise.try as Stage 3; MDN now shows Stage 4 shipped" | (this — the gap the others leave) |
|
|
32
|
-
|
|
33
|
-
Examples of what it catches:
|
|
34
|
-
|
|
35
|
-
- "Use Node 18+" — Node 24 has been LTS for a year
|
|
36
|
-
- "ES2022 features" — should be ES2025 now
|
|
37
|
-
- "GitHub Copilot doesn't read AGENTS.md" — it does (since 2025-08-28)
|
|
38
|
-
- Cited library version that's three majors behind
|
|
39
|
-
- TC39 proposal Stage that's advanced
|
|
40
|
-
- WCAG / ARIA spec citation pointing at a superseded version
|
|
41
|
-
|
|
42
|
-
## The loop (autoresearch DNA)
|
|
43
|
-
|
|
44
|
-
```
|
|
45
|
-
1. SCAN
|
|
46
|
-
- Audit emits STALE-EXTERNAL-REF findings (per audit-patterns/stale-content.md)
|
|
47
|
-
- Each finding: { file, line, cited_url, current_claim }
|
|
48
|
-
|
|
49
|
-
2. FETCH ← the autoresearch step
|
|
50
|
-
- For each finding, WebFetch the cited URL or canonical doc
|
|
51
|
-
- Extract the current state (version, status, behavior)
|
|
52
|
-
- Cap fetches per audit run (default: 30) to bound cost
|
|
53
|
-
|
|
54
|
-
3. COMPARE
|
|
55
|
-
- ALIGNED: doc matches reality → no fix
|
|
56
|
-
- STALE: doc disagrees with reality → propose fix
|
|
57
|
-
- AMBIGUOUS: can't tell → flag for manual review
|
|
58
|
-
|
|
59
|
-
4. PROPOSE
|
|
60
|
-
- Build a specific edit including:
|
|
61
|
-
- File + line
|
|
62
|
-
- Original text
|
|
63
|
-
- Replacement text
|
|
64
|
-
- Source URL + fetch date
|
|
65
|
-
|
|
66
|
-
5. VALIDATE (per recommend-then-validate.md)
|
|
67
|
-
- Dry-run the edit against trip-wires
|
|
68
|
-
- Verify the source URL is not on a deny-list
|
|
69
|
-
|
|
70
|
-
6. PR
|
|
71
|
-
- Opens with verified corrections
|
|
72
|
-
- Each correction cites the source URL it was verified against
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
## Sample finding → fix output
|
|
76
|
-
|
|
77
|
-
```markdown
|
|
78
|
-
## STALE-EXTERNAL-REF (severity: medium)
|
|
79
|
-
|
|
80
|
-
**File:** docs/POLYFILLS.md:47
|
|
81
|
-
**Cited URL:** https://github.com/tc39/proposal-promise-try
|
|
82
|
-
**Current claim in doc:** "Promise.try is at Stage 3"
|
|
83
|
-
**Verified state (fetched 2026-04-27):** "Stage 4, shipping in Chrome 128 / Safari 18.2 / Firefox 134"
|
|
84
|
-
|
|
85
|
-
**Proposed correction:**
|
|
86
|
-
- Line 47: replace "Stage 3" with "Stage 4 (shipping Chrome 128 / Safari 18.2 /
|
|
87
|
-
Firefox 134, per [tc39/proposal-promise-try](https://github.com/tc39/proposal-promise-try)
|
|
88
|
-
accessed 2026-04-27)"
|
|
89
|
-
|
|
90
|
-
**Validator check:** PASS (no broken links introduced; no entry-file length impact)
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
## Configuration
|
|
94
|
-
|
|
95
|
-
`.brain/config.toml`:
|
|
96
|
-
|
|
97
|
-
```toml
|
|
98
|
-
[ops-repo.external-ref-verification]
|
|
99
|
-
enabled = false # default: opt-in
|
|
100
|
-
max_fetches_per_run = 30 # cost ceiling
|
|
101
|
-
fetch_timeout_seconds = 15
|
|
102
|
-
cache_days = 7 # share fetches across same-week audits
|
|
103
|
-
deny_list = ["pastebin.com", "*.s3.amazonaws.com/private-*"]
|
|
104
|
-
allow_list_only = false
|
|
105
|
-
allowed_domains = [] # used only when allow_list_only=true
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
Disabled by default — fetching costs money and time, and most repos don't need verification on every audit. Enable for repos with substantive external-reference surface (API integrations, browser-support tables, framework-version docs, language-spec citations).
|
|
109
|
-
|
|
110
|
-
## How autoresearch DNA maps in (and where it stops)
|
|
111
|
-
|
|
112
|
-
Autoresearch is **overnight hill-climbing on a single file with a single metric**, fully unattended. This recipe is **a focused research probe per finding**, bounded and reviewed:
|
|
113
|
-
|
|
114
|
-
| Autoresearch | This recipe |
|
|
115
|
-
|---|---|
|
|
116
|
-
| Iterates over `train.py` | Iterates over external-ref findings |
|
|
117
|
-
| Metric: `val_bpb` | Metric: cited claim matches fetched reality (yes/no/ambiguous) |
|
|
118
|
-
| Search through candidates | One probe per finding (no candidate search) |
|
|
119
|
-
| Overnight unattended | Single CI run, human-reviewed PR |
|
|
120
|
-
| Hill-climbing | Direct lookup |
|
|
121
|
-
|
|
122
|
-
We import the *spirit* — autonomous propose-evaluate within a budget, with WebFetch as the eval mechanism. We don't import the loop shape. Yegge-aligned shepherding stays intact.
|
|
123
|
-
|
|
124
|
-
## When to use it
|
|
125
|
-
|
|
126
|
-
- Docs that cite external APIs, frameworks, libraries, or specs (e.g., `ref-polyfills`-style reference repos)
|
|
127
|
-
- Quarterly cadence is enough for most teams (scheduled GitHub Action, not every PR)
|
|
128
|
-
- Useful for "stop external-world rot" — the audit history ledger then shows trend data on how often external refs go stale
|
|
129
|
-
|
|
130
|
-
## When NOT to use it
|
|
131
|
-
|
|
132
|
-
- **Internal-only repos** with no external citations
|
|
133
|
-
- **Cost-sensitive contexts** where 30 fetches per audit is a meaningful expense
|
|
134
|
-
- **Heavy-fetch repos** where the cap would miss most references — split into per-doc audits instead
|
|
135
|
-
- **Privacy-sensitive content** where fetching cited URLs leaks repo-internal information
|
|
136
|
-
|
|
137
|
-
## Privacy & cost considerations
|
|
138
|
-
|
|
139
|
-
- Don't fetch URLs from `.brain/postmortems/` (may contain incident-specific URLs that shouldn't leave the network)
|
|
140
|
-
- Don't fetch URLs matching common internal-hostname patterns
|
|
141
|
-
- Cap default at 30 fetches/run; tune via `max_fetches_per_run`
|
|
142
|
-
- Cache aggressively — same URL, same week, same result (the 15-minute WebFetch cache is too short for multi-doc audits; recipe layer adds a 7-day cache by default)
|
|
143
|
-
|
|
144
|
-
## Anti-patterns
|
|
145
|
-
|
|
146
|
-
- **Fetching URLs without rate limiting.** Respect retry-after headers and the deny list.
|
|
147
|
-
- **Trusting the fetch blindly.** Fetched pages can themselves be stale (caching, mirrors). Pair with frontmatter dates on the citation.
|
|
148
|
-
- **Including fetched content verbatim in the PR.** Cite + summarize; don't dump pages of HTML.
|
|
149
|
-
- **Running on every PR.** Quarterly or weekly is usually right; the audit history ledger surfaces the trend.
|
|
150
|
-
- **Verifying without recording the fetch date.** Without a date, the corrected claim is itself unverifiable a year from now.
|
|
151
|
-
|
|
152
|
-
## Cross-references
|
|
153
|
-
|
|
154
|
-
- Stale-content audit pattern (the input): `../audit-patterns/stale-content.md`
|
|
155
|
-
- Recommend-then-validate (consumer pattern): `recommend-then-validate.md`
|
|
156
|
-
- Staleness tooling (lychee, Vale, markdownlint): `../audit-patterns/staleness-tooling.md`
|
|
157
|
-
- Audit history ledger (where verified-fix metadata lands): `../audit-patterns/audit-history-ledger.md`
|
|
158
|
-
- Reliability dial (where the fetch budget gets tuned per strictness): `../guidance/reliability-dial.md`
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
date: 2026-04-29
|
|
3
|
-
coverage: canonical
|
|
4
|
-
peers:
|
|
5
|
-
- ../audit-patterns/audit-history-ledger.md
|
|
6
|
-
- continuous-learning-loop.md
|
|
7
|
-
- ../doc-types/postmortem-pattern.md
|
|
8
|
-
status: practice-verified
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# Findings index — closing the read side of the audit ledger
|
|
12
|
-
|
|
13
|
-
> **The premise.** The audit ledger (`.brain/audit-history/*.json`) is *write-rich, read-poor*. Audits accumulate findings with severity codes (F-W1, F-S4, etc.) but nothing surfaces them — there's no list view, no "open findings" surface, no way to ask "what's still on the action surface?" without `cat`-ing every JSON file.
|
|
14
|
-
>
|
|
15
|
-
> The read-side closure is a single generated Markdown file at `.brain/findings/INDEX.md` that folds every `findings[]` entry across the audit history into one sortable table. Plus a hand-curated `## Graduations` section that tracks finding-to-permanent-infrastructure pairs.
|
|
16
|
-
|
|
17
|
-
## What this delivers
|
|
18
|
-
|
|
19
|
-
A repo with a healthy audit-history ledger but no findings index has *capture without action*. Audits keep noting "F-S4 high — render-method drift in stepper.js" — and unless you happen to be reading that specific JSON, you'll never see it again. A future audit re-emits the same finding type from a different commit; the pattern doesn't surface; nothing graduates.
|
|
20
|
-
|
|
21
|
-
The findings-index closes that loop:
|
|
22
|
-
|
|
23
|
-
1. **Surface OPEN findings.** Anything `fix_applied: false` rises to the top of the index. The first thing a new agent in the repo can do is grep `OPEN` in `.brain/findings/INDEX.md` and pick from the action surface.
|
|
24
|
-
2. **Track graduations.** When a recurring finding-type prompts permanent infrastructure (a trip-wire, a generator, a convention), that pairing is recorded in the `## Graduations` section. The index becomes the institutional memory of *which findings became rules*.
|
|
25
|
-
3. **Auto-close findings.** When a later audit emits `F-X-resolved`, the original `F-X` auto-promotes from OPEN to CLOSED-LATER. The ledger stays append-only; the index reflects the latest truth.
|
|
26
|
-
4. **Refresh on the harvest cron.** Same cadence as the audit-history workflow. No new infrastructure, no second cron, just one extra script step.
|
|
27
|
-
|
|
28
|
-
## The minimum viable shape
|
|
29
|
-
|
|
30
|
-
```
|
|
31
|
-
.brain/
|
|
32
|
-
├── audit-history/ # write side (per audit JSON)
|
|
33
|
-
│ ├── 2026-04-27.json
|
|
34
|
-
│ ├── 2026-04-28.json
|
|
35
|
-
│ └── 2026-04-29-002.json
|
|
36
|
-
└── findings/
|
|
37
|
-
└── INDEX.md # read side (regenerated)
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
`INDEX.md` is a single file. It is **not** an index in the README sense (one row per audit) — it's an aggregate of all `findings[]` entries across all audits, sorted by status × severity × id.
|
|
41
|
-
|
|
42
|
-
## Status taxonomy
|
|
43
|
-
|
|
44
|
-
Each finding falls into one of six bins. Sort the table by this order — the action surface always sits at the top.
|
|
45
|
-
|
|
46
|
-
| Status | Rule | Read |
|
|
47
|
-
|---|---|---|
|
|
48
|
-
| `OPEN` | `fix_applied === false` | Action surface — pick from the top. |
|
|
49
|
-
| `DONE-WITH-FOLLOWUP` | `fix_applied === true && follow_up exists` | Fix landed; the audit flagged a follow-up that hasn't been addressed. |
|
|
50
|
-
| `DONE` | `fix_applied === true && no follow_up` | Fixed in the same session as the audit; no follow-up flagged. |
|
|
51
|
-
| `CLOSED-EARLIER` | `id` ends with `-resolved` | Re-check confirming an earlier OPEN has since been addressed. |
|
|
52
|
-
| `CLOSED-LATER` | original was OPEN/DONE-WITH-FOLLOWUP **and** a `<id>-resolved` exists in a later audit | Auto-promoted; original retains its position in the audit JSON, but the index reflects the latest state. |
|
|
53
|
-
| `INFO-ONLY` | `fix_applied === null` | Positive observations (trip-wires passing, healthy cadence, etc.). Recorded for ledger continuity. |
|
|
54
|
-
|
|
55
|
-
Within each status, sort by severity: `high > warn > drift-resolved > info > info-positive > nit`. Then by `id` alphabetical.
|
|
56
|
-
|
|
57
|
-
## The Graduations section
|
|
58
|
-
|
|
59
|
-
The hand-curated `## Graduations` table is the load-bearing innovation. It records, in plain text, the pairs:
|
|
60
|
-
|
|
61
|
-
```markdown
|
|
62
|
-
## Graduations
|
|
63
|
-
|
|
64
|
-
| Finding | Permanent fix |
|
|
65
|
-
|---|---|
|
|
66
|
-
| [F-N1](../audit-history/2026-04-29-003.json) | Pre-commit Check 3 — journal-date sanity (commit `342ba89c`) |
|
|
67
|
-
| [F-W1](../audit-history/2026-04-29-002.json) | `docs/journal/2026/04/INDEX.md` (commit `35146f9d`) |
|
|
68
|
-
| [F-A1](../audit-history/2026-04-29.json) | Daily build-log harvest cron firing |
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
This is the read-side answer to *"what do we do with findings beyond fixing them once?"* When the same finding-type recurs (today's F-S4 echoes last week's F-S2), the graduation table tells you: "we already know this class is recurring — it's earned a trip-wire."
|
|
72
|
-
|
|
73
|
-
**Pre-seed the table on first generation; preserve it across regenerations.** The table is the memory; the rest of the index is the rendering.
|
|
74
|
-
|
|
75
|
-
## The generator script (~280 lines)
|
|
76
|
-
|
|
77
|
-
The reference implementation is a Node script that:
|
|
78
|
-
|
|
79
|
-
1. Reads every `.brain/audit-history/*.json`.
|
|
80
|
-
2. Tracks `audit_id` separately from filename (mismatches happen — one repo had `2026-04-29.json` containing `audit_id: "2026-04-29-001"`).
|
|
81
|
-
3. Flattens all `findings[]` entries with their parent audit reference.
|
|
82
|
-
4. Auto-promotes OPEN/DONE-WITH-FOLLOWUP to CLOSED-LATER when a `<id>-resolved` exists in a later audit.
|
|
83
|
-
5. Sorts by status × severity × id.
|
|
84
|
-
6. Preserves the existing `## Graduations` section if it exists; pre-seeds a stub on first run.
|
|
85
|
-
7. Writes `.brain/findings/INDEX.md`.
|
|
86
|
-
|
|
87
|
-
The script is mechanical (no LLM calls). Cheap enough to run on every cron firing.
|
|
88
|
-
|
|
89
|
-
**Concrete reference**: [`scripts/build/findings-index.mjs`](https://github.com/adiahealth/gen-ui-kit/blob/main/scripts/build/findings-index.mjs) in the chat-ui repo (~280 lines). It's the canonical implementation that the chat-ui repo wires into its daily build-log workflow.
|
|
90
|
-
|
|
91
|
-
## Wiring into the harvest cron
|
|
92
|
-
|
|
93
|
-
Add one step to the daily harvest workflow, after the harvester:
|
|
94
|
-
|
|
95
|
-
```yaml
|
|
96
|
-
# After the harvester step:
|
|
97
|
-
- name: Refresh findings index
|
|
98
|
-
run: node scripts/build/findings-index.mjs
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
Cheap (just JSON reads + a markdown write); always runs so the index reflects whatever `.brain/audit-history/` currently holds, even on runs where the harvester itself skipped (no material delta).
|
|
102
|
-
|
|
103
|
-
The PR-creator step that already bundles audit-history changes will pick up `.brain/findings/INDEX.md` automatically.
|
|
104
|
-
|
|
105
|
-
## When a finding "graduates"
|
|
106
|
-
|
|
107
|
-
Three signals that a finding-type is ready to graduate from "fixed once" to "permanent infrastructure":
|
|
108
|
-
|
|
109
|
-
1. **Recurrence.** The same finding-type appears in 2+ audits across different commits. Today's F-S4 echoes a prior F-S2; the pattern is real, not a one-off.
|
|
110
|
-
2. **Mechanical verifiability.** The rule the finding implies can be checked by a script (link checker, grep, AST walk) — not "use good judgment."
|
|
111
|
-
3. **Clear failure mode.** The cost of *not* graduating is concrete (a future incident, a daily noise source, a recurring doc-drift class).
|
|
112
|
-
|
|
113
|
-
Graduations don't require ceremony. When you ship the trip-wire, edit the `## Graduations` table to record the pair: `<finding-id>` → `<permanent fix + commit SHA>`. That's the institutional record.
|
|
114
|
-
|
|
115
|
-
## Anti-patterns to avoid
|
|
116
|
-
|
|
117
|
-
1. **Don't make the index `cat`-able from individual audits.** The point is *aggregation*. If the index just lists audits with their findings nested, you've reproduced the read problem.
|
|
118
|
-
2. **Don't auto-curate Graduations.** The pairing of "this finding" → "this trip-wire" requires human judgment. Pre-seed and preserve; never overwrite.
|
|
119
|
-
3. **Don't drop INFO-ONLY findings.** Positive observations (trip-wires passing, healthy cadence) are the *evidence* that the system is working. Hiding them makes the index look like a problem list, when much of the value is the green count.
|
|
120
|
-
4. **Don't replace the audit JSONs.** The index is a *view*. The JSONs remain the source of truth — append-only, immutable, schema-validated.
|
|
121
|
-
|
|
122
|
-
## Related
|
|
123
|
-
|
|
124
|
-
- [`audit-patterns/audit-history-ledger.md`](../audit-patterns/audit-history-ledger.md) — the write-side ledger this recipe reads from.
|
|
125
|
-
- [`recipes/continuous-learning-loop.md`](continuous-learning-loop.md) — the broader Promise 5 pattern; this recipe is one specific closure.
|
|
126
|
-
- [`doc-types/postmortem-pattern.md`](../doc-types/postmortem-pattern.md) — postmortems are the *narrative* counterpart; the findings-index is the *structured* counterpart.
|
|
@@ -1,252 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
date: 2026-04-27
|
|
3
|
-
coverage: canonical
|
|
4
|
-
peers:
|
|
5
|
-
- audit-existing-repo.md
|
|
6
|
-
- adr-introduction.md
|
|
7
|
-
- memory-organization.md
|
|
8
|
-
- self-healing-hooks.md
|
|
9
|
-
- continuous-learning-loop.md
|
|
10
|
-
primary_sources:
|
|
11
|
-
- https://agents.md
|
|
12
|
-
- https://github.com/typicode/husky
|
|
13
|
-
- https://pre-commit.com/
|
|
14
|
-
- https://adr.github.io/madr/
|
|
15
|
-
- https://docs.github.com/en/communities/setting-up-your-project-for-healthy-contributions
|
|
16
|
-
- https://code.claude.com/docs/en/best-practices
|
|
17
|
-
status: research-verified
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
# Recipe: greenfield setup (delivers all 5 promises from day one)
|
|
21
|
-
|
|
22
|
-
> **The premise.** A new repo has no legacy debt — no fat CLAUDE.md, no orphan docs, no scattered decisions. This is the *only* moment the repo can ship with all five promises pre-installed. Skip this and you'll be doing `audit-existing-repo.md` in six months.
|
|
23
|
-
>
|
|
24
|
-
> **Not a new repo?** If your repo is older than ~3 months and has any documentation at all, use `cold-start-harvest.md` instead. That recipe handles the inventory + triage + supersede pattern this one skips.
|
|
25
|
-
>
|
|
26
|
-
> **Existing `docs/` layout?** If you already have `docs/adrs/`, `docs/postmortems/`, etc., the v1.5 `.brain/` layout is opt-in — both are recognized by the audit. The migration is one `git mv` documented in `audit-existing-repo.md` § Migration.
|
|
27
|
-
|
|
28
|
-
## What this recipe delivers
|
|
29
|
-
|
|
30
|
-
| Promise | Delivered by |
|
|
31
|
-
|---|---|
|
|
32
|
-
| 1. Less-wasteful | One canonical entry file, thin pointers, no duplicated commands |
|
|
33
|
-
| 2. Token-and-context-optimized | AGENTS.md ≤150 lines from day one; layered docs |
|
|
34
|
-
| 3. Less-prone-to-staleness | `_Last reviewed:_` lines, frontmatter dates, lychee CI |
|
|
35
|
-
| 4. Self-healing | Pre-commit hooks + PR-time CI + scheduled weekly audit |
|
|
36
|
-
| 5. Continuously-learning | ADR `0001` bootstrap, PR template architectural-impact checkbox, Memory primitives section |
|
|
37
|
-
|
|
38
|
-
## Step 1 — `AGENTS.md` skeleton (Promise 1, 2)
|
|
39
|
-
|
|
40
|
-
Use the recommended structure from `../standards/agents-md-spec.md`. Drop in the 8-section skeleton, customize what's true for the repo, target **80-120 lines**:
|
|
41
|
-
|
|
42
|
-
```markdown
|
|
43
|
-
# AGENTS.md
|
|
44
|
-
|
|
45
|
-
This file gives instructions to LLM coding agents (Codex, Devin, Cursor,
|
|
46
|
-
Windsurf, Copilot, Aider, Continue, Jules, Junie — and Claude Code via
|
|
47
|
-
symlink/pointer) working in this repo.
|
|
48
|
-
|
|
49
|
-
_Last reviewed: 2026-04-27_
|
|
50
|
-
|
|
51
|
-
## Project overview (one paragraph)
|
|
52
|
-
## Build / test / run (commands)
|
|
53
|
-
## Conventions (bullet list)
|
|
54
|
-
## Trust boundaries (DO NOT modify / DO modify)
|
|
55
|
-
## Where to find things (pointers to .brain/)
|
|
56
|
-
## Memory primitives (when to read ADRs / postmortems)
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
Verify with `wc -l AGENTS.md`. The pre-commit hook from Step 5 will fail it past 200.
|
|
60
|
-
|
|
61
|
-
## Step 2 — `CLAUDE.md` as symlink (Promise 1)
|
|
62
|
-
|
|
63
|
-
Claude Code does not read AGENTS.md natively as of April 2026 (issue [#31005](https://github.com/anthropics/claude-code/issues/31005)). Symlink is cleanest:
|
|
64
|
-
|
|
65
|
-
```bash
|
|
66
|
-
ln -s AGENTS.md CLAUDE.md
|
|
67
|
-
git add CLAUDE.md
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
Windows + WSL teams often hit symlink-in-git issues — fall back to the thin-pointer alternative from `../standards/claude-md-convention.md`. Either is fine; never have both files fat.
|
|
71
|
-
|
|
72
|
-
## Step 3 — `.brain/` directory tree + `.gitignore` (Promise 2, 5)
|
|
73
|
-
|
|
74
|
-
```bash
|
|
75
|
-
mkdir -p .brain/{adrs,postmortems,runbooks,archive,architecture}
|
|
76
|
-
touch .brain/{adrs,postmortems,runbooks,archive,architecture}/.gitkeep
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
Add an index `README.md` in each memory home (~10-20 lines each, `_Last reviewed:_` stamped). See `memory-organization.md` for the rationale on which folders go where and what each index file contains.
|
|
80
|
-
|
|
81
|
-
Then add transient-state homes to `.gitignore`. `.brain/cache/` is the WebFetch cache populated by external-reference verification. `.brain/cold-start/working/` is the harvest-session scratch space. The persistent state (`adrs/`, `postmortems/`, `runbooks/`, `archive/`, `architecture/`, `audit-history/`, `changesets/`, `config.toml`) gets committed.
|
|
82
|
-
|
|
83
|
-
```bash
|
|
84
|
-
cat >> .gitignore << 'EOF'
|
|
85
|
-
|
|
86
|
-
# ops-repo transient state
|
|
87
|
-
.brain/cache/
|
|
88
|
-
.brain/cold-start/working/
|
|
89
|
-
EOF
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
> **Want `.brain/` entirely local?** Set `mode = "local-only"` in `.brain/config.toml` and gitignore the whole `.brain/` directory (instead of just the cache/cold-start subdirs). See `../guidance/reliability-dial.md` § Git sync. Promise 5 then applies to your local clone only — multi-contributor recipes and the auto-archive PR workflow become moot.
|
|
93
|
-
|
|
94
|
-
## Step 4 — Bootstrap ADR `0001` (Promise 5)
|
|
95
|
-
|
|
96
|
-
The first ADR records the decision to use ADRs. Without it, the practice itself isn't decided. Use the Nygard format ([cognitect.com 2011](https://www.cognitect.com/blog/2011/11/15/documenting-architecture-decisions)); template in `../doc-types/adr-pattern.md`:
|
|
97
|
-
|
|
98
|
-
```markdown
|
|
99
|
-
# 1. Record architecture decisions
|
|
100
|
-
|
|
101
|
-
Date: 2026-04-27
|
|
102
|
-
|
|
103
|
-
## Status
|
|
104
|
-
Accepted
|
|
105
|
-
|
|
106
|
-
## Context
|
|
107
|
-
We need to record architectural decisions made on this project so future
|
|
108
|
-
contributors (human and LLM agent) can understand why the codebase looks
|
|
109
|
-
the way it does.
|
|
110
|
-
|
|
111
|
-
## Decision
|
|
112
|
-
We will use Architecture Decision Records as described by Michael Nygard.
|
|
113
|
-
ADRs live in `.brain/adrs/` as `NNNN-kebab-case-title.md` with a `Status:`
|
|
114
|
-
field. The collection is the decision log.
|
|
115
|
-
|
|
116
|
-
## Consequences
|
|
117
|
-
- Architectural decisions are captured at decision time, not retroactively.
|
|
118
|
-
- New contributors read `.brain/adrs/` newest-first to understand commitments.
|
|
119
|
-
- Decisions become harder to silently override — supersession requires a new ADR.
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
Save as `.brain/adrs/0001-record-architecture-decisions.md`. Update `.brain/adrs/README.md`.
|
|
123
|
-
|
|
124
|
-
## Step 5 — Pre-commit hooks + CI (Promise 3, 4)
|
|
125
|
-
|
|
126
|
-
Install the full stack from `self-healing-hooks.md`:
|
|
127
|
-
|
|
128
|
-
```bash
|
|
129
|
-
cp ~/.repo-brain-templates/.pre-commit-config.yaml .
|
|
130
|
-
mkdir -p scripts && cp ~/.repo-brain-templates/scripts/*.sh scripts/
|
|
131
|
-
chmod +x scripts/*.sh
|
|
132
|
-
|
|
133
|
-
pip install pre-commit && pre-commit install
|
|
134
|
-
|
|
135
|
-
mkdir -p .github/workflows
|
|
136
|
-
cp ~/.repo-brain-templates/.github/workflows/*.yml .github/workflows/
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
Five files land: `.pre-commit-config.yaml`, `scripts/check-agents-claude-drift.sh`, `scripts/check-doc-dates.sh`, `.github/workflows/repo-brain-pr.yml`, `.github/workflows/repo-brain-weekly.yml`. The verbatim contents are in `self-healing-hooks.md`.
|
|
140
|
-
|
|
141
|
-
Citations: [pre-commit.com](https://pre-commit.com/), [Husky](https://github.com/typicode/husky) (Node monocultures), [Lychee](https://github.com/lycheeverse/lychee-action).
|
|
142
|
-
|
|
143
|
-
## Step 6 — PR template (Promise 5)
|
|
144
|
-
|
|
145
|
-
The architectural-impact checkbox closes the continuous-learning loop. Drop in `.github/pull_request_template.md`:
|
|
146
|
-
|
|
147
|
-
```markdown
|
|
148
|
-
## What
|
|
149
|
-
[summary]
|
|
150
|
-
|
|
151
|
-
## Why
|
|
152
|
-
[motivation]
|
|
153
|
-
|
|
154
|
-
## Architectural impact
|
|
155
|
-
- [ ] No architectural change (no ADR needed)
|
|
156
|
-
- [ ] Architectural change — ADR added at: `.brain/adrs/NNNN-*.md`
|
|
157
|
-
- [ ] Architectural change — ADR exemption granted by: [name]
|
|
158
|
-
Reason: [why no ADR]
|
|
159
|
-
|
|
160
|
-
## Docs touched
|
|
161
|
-
- [ ] AGENTS.md updated if conventions / commands changed
|
|
162
|
-
- [ ] ADR added if architectural commitment made
|
|
163
|
-
- [ ] Runbook added if new ops procedure introduced
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
See `continuous-learning-loop.md` for the auto-detection workflow that warns when architectural files change without an accompanying ADR.
|
|
167
|
-
|
|
168
|
-
## Step 7 — `_Last reviewed:_` lines (Promise 3)
|
|
169
|
-
|
|
170
|
-
Every doc gets a date — YAML frontmatter `date:` or inline `_Last reviewed: YYYY-MM-DD_`. The greenfield seed:
|
|
171
|
-
|
|
172
|
-
```bash
|
|
173
|
-
TODAY=$(date +%F)
|
|
174
|
-
for f in AGENTS.md README.md CONTRIBUTING.md SECURITY.md .brain/**/*.md; do
|
|
175
|
-
[ -f "$f" ] || continue
|
|
176
|
-
grep -q "_Last reviewed:" "$f" || \
|
|
177
|
-
printf "\n_Last reviewed: %s_\n" "$TODAY" >> "$f"
|
|
178
|
-
done
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
The pre-commit hook from Step 5 enforces this on future edits.
|
|
182
|
-
|
|
183
|
-
## Step 8 — `.brain/config.toml` (optional: tune the strictness dial)
|
|
184
|
-
|
|
185
|
-
The hooks installed in Step 5 default to `strictness = "normal"`. To tune up or down, drop a `.brain/config.toml`:
|
|
186
|
-
|
|
187
|
-
```toml
|
|
188
|
-
[ops-repo]
|
|
189
|
-
strictness = "normal" # lax | normal | strict
|
|
190
|
-
version = "1.1"
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
- **`lax`** — side projects, prototypes (warnings, no blocking)
|
|
194
|
-
- **`normal`** — most production repos (default)
|
|
195
|
-
- **`strict`** — regulated codebases, monorepos (every trip-wire blocks; multi-agent review for apply-mode fixes)
|
|
196
|
-
|
|
197
|
-
See `../guidance/reliability-dial.md` for what each position changes per trip-wire. Skip this step entirely to use `normal` defaults — `.brain/config.toml` is an override, not a requirement.
|
|
198
|
-
|
|
199
|
-
## Step 9 — Verification checklist
|
|
200
|
-
|
|
201
|
-
- [ ] `AGENTS.md` exists, ≤150 lines, has all 8 sections
|
|
202
|
-
- [ ] `CLAUDE.md` is a symlink to `AGENTS.md` OR a ≤15-line pointer
|
|
203
|
-
- [ ] `.brain/{adrs,postmortems,runbooks,archive,architecture}/` exist with README index files
|
|
204
|
-
- [ ] `.brain/adrs/0001-record-architecture-decisions.md` is `Accepted`
|
|
205
|
-
- [ ] `.gitignore` excludes `.brain/cache/` and `.brain/cold-start/working/`
|
|
206
|
-
- [ ] `.pre-commit-config.yaml` present; `pre-commit install` ran
|
|
207
|
-
- [ ] `scripts/check-*.sh` present and executable
|
|
208
|
-
- [ ] `.github/workflows/repo-brain-{pr,weekly}.yml` present
|
|
209
|
-
- [ ] `.github/pull_request_template.md` has architectural-impact checkbox
|
|
210
|
-
- [ ] Every `.md` has `_Last reviewed:_` or YAML `date:`
|
|
211
|
-
- [ ] `README.md` references `AGENTS.md` once (no duplicated build commands; see `../standards/readme-conventions.md`)
|
|
212
|
-
- [ ] (Optional) `.brain/config.toml` present if non-default strictness desired
|
|
213
|
-
- [ ] `pre-commit run --all-files` passes
|
|
214
|
-
|
|
215
|
-
12 boxes ticked → all 5 promises ship from day one.
|
|
216
|
-
|
|
217
|
-
## First commit message
|
|
218
|
-
|
|
219
|
-
```
|
|
220
|
-
chore: bootstrap repo-brain-compliant doc surface
|
|
221
|
-
|
|
222
|
-
- AGENTS.md (canonical), CLAUDE.md → symlink
|
|
223
|
-
- .brain/{adrs,postmortems,runbooks,archive,architecture}/
|
|
224
|
-
- .gitignore for .brain/cache/, .brain/cold-start/working/
|
|
225
|
-
- ADR 0001 — Record architecture decisions
|
|
226
|
-
- pre-commit hooks (drift, length, doc-date)
|
|
227
|
-
- CI (PR-time link-check + weekly audit)
|
|
228
|
-
- PR template with architectural-impact checkbox
|
|
229
|
-
|
|
230
|
-
Delivers all 5 ops-repo promises from day one.
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
## Common greenfield mistakes
|
|
234
|
-
|
|
235
|
-
- **Setting up `CLAUDE.md` as canonical.** Works for Claude Code only; other agents (Codex, Cursor, Devin, Copilot) ignore it. Always make AGENTS.md canonical.
|
|
236
|
-
- **Skipping ADR 0001.** Without the bootstrap, the next contributor wonders if ADRs are required.
|
|
237
|
-
- **Pre-commit installed but not run.** `pre-commit install` writes `.git/hooks/pre-commit`; clones don't pick it up. Document the install in `CONTRIBUTING.md`.
|
|
238
|
-
- **Lychee with `fail: false` on PR.** Defeats the gate. `fail: true` on PR; `fail: false` only in scheduled audits.
|
|
239
|
-
- **Stamping `_Last reviewed:_` programmatically and never touching it again.** The date should be re-stamped on real edits, not just the seed.
|
|
240
|
-
- **Committing `.brain/cache/` or `.brain/cold-start/working/`.** Transient state belongs in `.gitignore`.
|
|
241
|
-
|
|
242
|
-
## Cross-references
|
|
243
|
-
|
|
244
|
-
- AGENTS.md spec (the skeleton's source): `../standards/agents-md-spec.md`
|
|
245
|
-
- CLAUDE.md convention: `../standards/claude-md-convention.md`
|
|
246
|
-
- README/CONTRIBUTING/SECURITY conventions: `../standards/readme-conventions.md`
|
|
247
|
-
- ADR pattern: `../doc-types/adr-pattern.md`
|
|
248
|
-
- Self-healing hooks (Step 5 detail): `self-healing-hooks.md`
|
|
249
|
-
- Continuous-learning loop (Step 6 detail): `continuous-learning-loop.md`
|
|
250
|
-
- Memory organization (folder layout rationale): `memory-organization.md`
|
|
251
|
-
- Token-budget rationale for length caps: `../guidance/context-budget.md`
|
|
252
|
-
- Migration recipe for existing `docs/` layouts: `audit-existing-repo.md` § Migration
|