/agent-skills:build-memoryfrom agent-skills
Owns the build-memory contract for multi-session builds: initializes, validates, migrates legacy scratch, and regenerates ADR index under docs/build/, docs/tickets/, docs/adr/.
Ships in agent-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
The owner of the build-memory layer that decompose-spec, orchestrate-build,
implement-spec, synthesize-spec and reconcile-build all read and write. It owns one
contract file, one set of templates, one validator and one migration tool, so build memory
is defined in exactly one place.
Precedent.
agent-docsowns the shared Doc Authoring Guidelines other skills cite;build-memoryowns the layout the same way. The contract islayout.md— the tree, the modes, the machine-state ledger, the manifest / ticket / marker / tail shapes, the deferrals / ADR / index / gate rules, who writes what, the validator, and the compatibility policy. Read it before any mode below; every other skill cites it and does not restate the tree.
Build memory is committed (the record of a multi-session build is audit-valuable and git
is the artifact store); only regenerable bulk (logs/) is gitignored. A repo opts in with
the marker <!-- build-memory: v2 --> in docs/build/README.md. A repo without it runs in
legacy scratch mode — byte-for-byte the pre-0.2.0 behaviour (see layout.md §
Compatibility and README.md).
// turbo
bash scripts/memory-root.sh --paths # prints: mode=<committed|scratch> root=<abs path> (+ project= docs= tickets= adr=)
Committed mode → the root is <worktree>/docs/build, resolved from the current worktree
(a sibling build worktree reads its own chain tip). Scratch mode → the legacy gitignored
dir (stated on stderr). $BUILD_MEMORY_ROOT overrides both: a relative value resolves against the
worktree toplevel, and a missing dir is an error, never a fallback.
Monorepo subproject (BM-ROOT-03). When the build memory lives under a subproject, set
BUILD_MEMORY_ROOT=<sub>/docs/build (relative) in the harness's persistent env. Then
<memory root> is that dir, tickets and ADRs are its siblings <sub>/docs/tickets and
<sub>/docs/adr (BUILD_MEMORY_TICKETS / BUILD_MEMORY_ADR override), and every docs/… path in
this skill and in layout.md means the same path under <sub>/ — with the variable
unset they are the literal paths, as before. Without the variable, memory-root.sh exits 3 naming
the subproject root rather than silently picking scratch; the validator run from the toplevel
exits 2 with the same hint.
check (default)Validate the layout. Read-only; exit-code gated; runnable in CI.
// turbo
bash scripts/check-build-memory.sh . # tree mode: 0 clean · 1 violations · 2 not a build-memory repo · 3 vacuous
bash scripts/check-build-memory.sh . --range BASE..HEAD # history mode (also --staged, --first-parent SHA); 5 = unknown
bash scripts/check-build-memory.sh . --planning docs/research-ledger.md # planning-ledger freshness (V14)
# monorepo subproject: the same commands with BUILD_MEMORY_ROOT=<sub>/docs/build exported (or --memory-root
# <sub>/docs/build, or the project dir as repo_root: check-build-memory.sh <sub>); docs/… paths then resolve under <sub>/
It checks everything the skills derive (layout allowlist + logs/.gitignore; ticket filename
grammar + unique sequence; manifest ↔ files both ways; backward Depends on; skeletons carry
no run line; markers referenced; DEFERRALS ids unique + valid statuses; no OPEN row past a
PASSED gate; ADR files ↔ generated index; every ADR has ## Revisit trigger; spec ADR
appendix == file set when present; LEDGER.md key set + order and nextTicket; PHASE-LOG
"done" ↔ BUILD_INDEX row + runs/<ID>.md; REQ→ticket coverage when the spec and
req_id_pattern resolve; size + secret scans; the ledger budget and shape, BM-LEDGER-08; the
kind of 7-column GATE DECISIONS rows and scoped pre-authorizations, BM-GATE-05/-09; the
CURRENT STATE vocabularies; stale orient text; record dates later than the clock; BUILD_INDEX
row shape; readout guard sentences; run-ledger Harness: lines; runs/<ID>.trace.jsonl lines,
BM-TRACE-01; living-pin? tests). The PHASE
LOG parser reports what it evaluated, and exits 3 rather than pass vacuously. The human summary
lists each violation and warning; the JSON report (build-memory-check/2: input identity, counts,
diagnostics) goes to --json PATH or a unique temp file named on the last line. A failure is
a real block — the caller does not proceed past it. Guarded rules warn unless
docs/build/README.md also carries <!-- build-memory-guards: 1 --> (BM-COMPAT-06), so legacy
content never fails on them.
History mode (--range, --staged, --first-parent; scripts/check-history.sh, BM-HIST-01)
judges only the lines a change adds or removes — append-only regions and their append position,
row-annotated DEFERRALS, frozen contracts and ADRs, *.jsonl prefixes, the living-archived
ledger head, and the record dates on added lines (R1–R6) — so legacy content never fails it. A
repo guard docs/build/tools/memory_guard.* takes over when present; repo policy lives in
docs/build/tools/record_policy/history.policy.
decompose-spec runs check after seeding, implement-spec before its close commit (tree,
then --staged), orchestrate-build at every boundary (tree, then --range).
initWrite the layout into a repo. Idempotent — never overwrites an existing file. For each
target, if the file is absent, create it from the matching template in templates/
(filling any placeholders); if present, leave it untouched.
memory-root.sh --paths --allow-missing before the root exists).
init implies committed mode: the target root is <repo>/docs/build, or $BUILD_MEMORY_ROOT
in a monorepo subproject — then every docs/… target below is under the subproject
(<sub>/docs/build/README.md, <sub>/docs/tickets/…, <sub>/docs/adr/…, <sub>/docs/README.md),
and the AGENTS.md section goes into the subproject's AGENTS.md when it has one.docs/build/README.md (from templates/build-README.md; must contain the marker).docs/build/LEDGER.md (from templates/LEDGER.md; the state-only shape — seed
projectStatus: NOT_STARTED, round: 1).docs/build/BUILD_INDEX.md (from templates/BUILD_INDEX.md; header row only).docs/build/logs/.gitignore containing * then !.gitignore (the one ignored subtree).docs/tickets/{00_MANIFEST.md,_TEMPLATE.md,DEFERRALS.md} (from templates/MANIFEST.md,
templates/ticket.md, templates/DEFERRALS.md).docs/build/readouts/_TEMPLATE.md (from templates/READOUT.md).docs/adr/{_TEMPLATE.md} (from templates/adr-TEMPLATE.md); then generate
docs/adr/README.md with adr-index (below).AGENTS.md "Build memory" section (from templates/AGENTS-build-memory.md) — appended
if AGENTS.md exists, else the section is offered to agent-docs.docs/README.md — if it exists, add the build-memory rows (build/, tickets/, adr/)
with their modes; else create it from templates/docs-README.md.check (with BUILD_MEMORY_ROOT set in a subproject) — a fresh init must be clean.decompose-spec calls init during seeding; the operator may call it directly to adopt the
layout in an existing repo.
adr-indexRegenerate docs/adr/README.md from the ADR files (numeric order; columns ADR · Title ·
Ticket · Status; carries the generated marker). Never hand-edit the index.
bash scripts/adr-index.sh docs/adr # writes docs/adr/README.md
bash scripts/adr-index.sh --check docs/adr # print to stdout only (what the validator diffs)
migrateMove a legacy gitignored scratch dir into the committed docs/build/ tree. Mutating with
apply=true; a dry-run plan otherwise. Move/rename only — the contents of every moved run
ledger / PR body / tool / fixture stay byte-identical; the machine ledger is the one file
edited, and only by appending manifest: / memoryRoot: / round: to CURRENT STATE.
bash scripts/migrate-legacy-scratch.sh --from .agents/scratch # dry-run plan
bash scripts/migrate-legacy-scratch.sh --from .agents/scratch --apply # perform it
Mapping (see the script header for the full list): implement-spec_*.md → runs/<ID>.md
(id from the filename, else the file's H1; unresolvable names keep their basename);
pr/*, tools/*, fixtures/*, planning/* → the same-named dirs; *build-ledger.md →
LEDGER.md (converted); *.log → dropped; the rename mapping is appended to
docs/build/README.md. After migrating, run check and review the diff before committing;
then remove the now-empty legacy dir and add docs/build/logs/ to .gitignore (leave the old
.agents/ line — it is harmless).
templates/ holds one self-describing template per artifact (each with a
header comment naming who fills it and when):
build-README.md, docs-README.md, AGENTS-build-memory.md.LEDGER.md, BUILD_INDEX.md.MANIFEST.md, ticket.md, ticket-skeleton.md, HUMAN.md,
GATE.md, READOUT.md, DEFERRALS.md, adr-TEMPLATE.md.research-ledger.md, research-CONVENTIONS.md,
spec-front-matter.md.COVERAGE_MATRIX.csv, BACKLOG.csv.templates/tail/ — the tail tickets decompose-spec instantiates:
CAP.1, CAP.2, CAP.3, GATE-ACCEPT, REC.1, REC.2, REC.3, DOC.1, DOC.2
(tail=full), and DOC (the default tail=minimal's single docs row).tests/ holds fixture repos (v2-clean, v2-violations, legacy-scratch,
v2-legacy-ledger, v2-guards-violations, v2-reqcov, v2-vacuous, v2-positional-status, and
v2-monorepo — build memory under sub/proj/, selected by BUILD_MEMORY_ROOT), history/build.sh (throw-away git repos committed
with GIT_COMMITTER_DATE in the shapes of real violations) and run-tests.sh, which exercises
all five scripts, asserts exit codes and expected files, and golden-checks the templates. Run it
from anywhere:// turbo
bash tests/run-tests.sh # one PASS line per fixture; exit 0 iff all pass
| Script | Role |
|---|---|
scripts/memory-root.sh | resolve mode + root (+ --paths) for the current worktree |
scripts/bm-paths.sh | sourced, not run: derives docs/tickets/adr from one memory root (BM-ROOT-03) |
scripts/check-build-memory.sh | the validator (BM-VALID-01): tree, history and planning modes |
scripts/check-history.sh | history mode (BM-HIST-01) — what a change adds or removes |
scripts/adr-index.sh | regenerate the ADR index (BM-ADR-02) |
scripts/build-trace.py | appends with record: one trace line per worker attempt to runs/<ID>.trace.jsonl, usage measured from the harness's own session store — Claude Code transcripts, Codex rollouts, the Devin session database (BM-TRACE-01); dispatch-usage / result give drive-build.sh one usage line and the final text per unit, for any harness (python3 stdlib) |
scripts/migrate-legacy-scratch.sh | mutating with --apply: legacy scratch → docs/build/ |
orchestrate-build sequences and
implement-spec implements.README.md (opens in a new tab)layout.md (opens in a new tab)scripts/adr-index.sh (opens in a new tab)scripts/bm-paths.sh (opens in a new tab)scripts/build-trace.py (opens in a new tab)scripts/check-build-memory.sh (opens in a new tab)scripts/check-history.sh (opens in a new tab)scripts/memory-root.sh (opens in a new tab)scripts/migrate-legacy-scratch.sh (opens in a new tab)templates/AGENTS-build-memory.md (opens in a new tab)templates/BACKLOG.csv (opens in a new tab)templates/BUILD_INDEX.md (opens in a new tab)templates/COVERAGE_MATRIX.csv (opens in a new tab)templates/DEFERRALS.md (opens in a new tab)templates/GATE.md (opens in a new tab)templates/HUMAN.md (opens in a new tab)templates/LEDGER.md (opens in a new tab)templates/MANIFEST.md (opens in a new tab)templates/READOUT.md (opens in a new tab)templates/adr-TEMPLATE.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Generated from the plugin's indexed repository (stevevitali/agent-skills) — no native marketplace selected
npx claudepluginhub p/stevevitali-agent-skills12 skills in this plugin
/address-pr-commentsWork through unresolved review comments on your PR as the author: triage every thread, implement fixes where the reviewer is right, push back with rationale where they aren't, answer questions, commit + push, and reply to every thread with what happened. Use when asked to address, respond to, or resolve PR review feedback./agent-docsCreate or converge agent documentation (AGENTS.md hierarchy) for a codebase — bootstrap mode generates docs from scratch, refresh mode detects and fixes drift/audit-buildIndependent, fresh-context critical re-review of tickets that have already landed in a multi-session build. It covers the last N tickets, every ticket since the previous audit, named tickets, or a git range. Each ticket's acceptance criteria are re-checked against the code, tests and evidence, and claims are compared with what is verified. Faked or weakened checks, cross-ticket duplication and sole-owner violations are hunted down. Every finding is verified before it is reported, and fixes are routed through the build's own repair mechanisms. It also has an evaluation mode: a pre-registered, blinded measurement study of an implementer's work, which estimates how much auditing is actually needed, where and why. Use it to keep cheaper implementation models in check with periodic review by a stronger model, and to decide on evidence how often that review should run. Read-only on the build; never fixes, merges or edits landed records./decompose-specTurn one large spec into an optimally-partitioned, dependency-ordered ticket plan — the fewest self-contained tickets that each fit one fresh-context implementation run — and seed a durable build ledger plus per-ticket contract files and a manifest runbook (relocatable into the repo tree via tickets_dir). The planning half of a multi-session build; pairs with orchestrate-build./implement-specSpec-driven, autonomous end-to-end: branch → plan + test matrix → implement (tests alongside) → self-review → gap-analysis vs spec → close gaps → rigorous downstream verification → PR + evidence report/orchestrate-buildDrive a decomposed spec to completion across fresh contexts: SETUP a dedicated worktree, run each ticket end-to-end through implement-spec in a fresh context, update the durable ledger, report progress, pause for intervention at ticket boundaries, and finish with a whole-build capstone verification. The execution half of a multi-session build; pairs with decompose-spec.Other plugins' skills for the same job