Build os-adr plugin: ADR authoring, session hook, migration, retrieval
Implements OpenSpec change add-os-adr-plugin (archived as
2026-07-03-add-os-adr-plugin; delta specs synced to openspec/specs/).
- plugins/os-adr/: Ruby OO core (Record, Repository, Index, Template,
Detector, Migrator, MigrationReport, Finder) behind thin bin/ CLIs;
Python SessionStart hook via plugin-relative hooks.json; four skills
(create, init, migrate, find); invariants.md; 47 Ruby + 15 Python
model-free tests, all passing.
- Migration pilot passed (threshold 25%): viking 0%, delta-refinery 0%,
llf-schema 8.3%. Retrieval verified against the real llf-schema graph;
resolved that ADRs need no Graphify tag/edge convention (layer 3
expands query paths via node source_files).
- docs/adr-system/: requirements (04), PRD (05), eval sketches (06).
- ADR-020 recorded; CLAUDE.md Implemented Components updated with the
locked rollout order (pilot projects -> cc-os retrofit -> wider).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 18:24:19 +00:00
---
2026-07-04 18:49:15 +00:00
description: Retrieve the architecture decision records relevant to files, components, or a topic being worked on — callable at any point mid-task, not just at session start. Use unprompted WHEN you are about to make an architecture-level choice or change/replace an approach that already exists in the codebase (a persistence choice, a protocol, a library, a convention, an error-handling strategy) — a prior decision may already cover it. Invoked by `/os-adr:find` .
Build os-adr plugin: ADR authoring, session hook, migration, retrieval
Implements OpenSpec change add-os-adr-plugin (archived as
2026-07-03-add-os-adr-plugin; delta specs synced to openspec/specs/).
- plugins/os-adr/: Ruby OO core (Record, Repository, Index, Template,
Detector, Migrator, MigrationReport, Finder) behind thin bin/ CLIs;
Python SessionStart hook via plugin-relative hooks.json; four skills
(create, init, migrate, find); invariants.md; 47 Ruby + 15 Python
model-free tests, all passing.
- Migration pilot passed (threshold 25%): viking 0%, delta-refinery 0%,
llf-schema 8.3%. Retrieval verified against the real llf-schema graph;
resolved that ADRs need no Graphify tag/edge convention (layer 3
expands query paths via node source_files).
- docs/adr-system/: requirements (04), PRD (05), eval sketches (06).
- ADR-020 recorded; CLAUDE.md Implemented Components updated with the
locked rollout order (pilot projects -> cc-os retrofit -> wider).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 18:24:19 +00:00
---
Find the ADRs relevant to what is being worked on. Retrieval is deterministic-first: run the
CLI, then apply judgment ONLY to the candidates it returns — never read/rank the full ADR
corpus yourself.
## 1. Run the deterministic CLI
```bash
ruby ${CLAUDE_PLUGIN_ROOT}/bin/adr-find --root < project-root > \
--paths < comma-separated file / dir paths being edited > \
--components < comma-separated component names > # optional
```
The CLI layers: frontmatter path/component matching → Accepted-only status filter →
one-hop Graphify graph expansion of the query paths (automatic when `graphify-out/graph.json`
exists; silently skipped otherwise). Add `--all-statuses` only when history matters (e.g.
"why was X superseded?").
## 2. Judge the candidate set
Read the returned candidate files (they are few) and decide which actually bear on the task.
`matched_on` tells you why each surfaced (`path`, `graph` , `component` ). Prefer direct path
matches; treat `graph` matches as "nearby decisions worth a look".
## 3. Act on what you find
2026-07-04 18:49:15 +00:00
- If an Accepted ADR covers the approach the in-progress change is altering or replacing, you
are **reversing a recorded decision** — and a reversal is itself a decision that must be
recorded, not just implemented. Surface the specific ADR (ID + title + the constraint), and
make the recording offer **explicit and direct** in your reply — state plainly "this reverses
ADR-NNNN; I'll record a superseding ADR via `/os-adr:create` " (or create it outright). Do not
bury the ADR as a parenthetical inside an option list; every path you offer that changes the
decided behavior must carry the explicit superseding-ADR step.
Build os-adr plugin: ADR authoring, session hook, migration, retrieval
Implements OpenSpec change add-os-adr-plugin (archived as
2026-07-03-add-os-adr-plugin; delta specs synced to openspec/specs/).
- plugins/os-adr/: Ruby OO core (Record, Repository, Index, Template,
Detector, Migrator, MigrationReport, Finder) behind thin bin/ CLIs;
Python SessionStart hook via plugin-relative hooks.json; four skills
(create, init, migrate, find); invariants.md; 47 Ruby + 15 Python
model-free tests, all passing.
- Migration pilot passed (threshold 25%): viking 0%, delta-refinery 0%,
llf-schema 8.3%. Retrieval verified against the real llf-schema graph;
resolved that ADRs need no Graphify tag/edge convention (layer 3
expands query paths via node source_files).
- docs/adr-system/: requirements (04), PRD (05), eval sketches (06).
- ADR-020 recorded; CLAUDE.md Implemented Components updated with the
locked rollout order (pilot projects -> cc-os retrofit -> wider).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 18:24:19 +00:00
- If a candidate merely informs the work, cite it and continue.
- If the CLI returns nothing, say so — do not fall back to sweeping `docs/adr/` unless the user
asks; an empty result usually means no decision governs those paths (or `affected-paths`
frontmatter is missing on older ADRs — worth mentioning once).