/abbd:abbd-setupfrom abbd
Set ABBD up on a repository. Writes the deterministic extraction script with pstack, supplements it with what pstack's readers find, stores and renders the topology, and adds the always-on block to the project's CLAUDE.md. Use for /abbd-setup, "set up abbd", or a repository with no .abbd directory.
Ships in abbd. 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.
None: SKILL.md is the whole skill.
<pstack> is ~/.claude/plugins/cache/cursor-plugins/pstack/0.15.36. Open files under it with the Read tool. If <pstack>/skills/swarm/SKILL.md does not exist, stop and tell the user to install pstack 0.15.36.
Setup never asks the human anything. The first state you commit is the baseline; the human reads it in the blueprint and the PR, and there is no alignment step.
List unit candidates from the layout, entry points, manifests and schemas. A unit is something a human would say "this change must not touch that" about: a responsibility (MOD), an external contract (IF, EVT, DATA, CFG), a user-facing feature (FEAT). Imports, calls and file placement are material for finding units, never units.
Then choose the levels the blueprint draws, before any script:
app/, components/, lib/ or src/, are not parts. The modules under them are. One root package that holds most of the system is several parts, its responsibilities.abbd lint holds every page to: its responsibilities, its subpackages, or one family of implementers of an interface it holds, such as every output format. A part is several files that change together, never one file per box. A module too small for two parts gets no page of its own. A top-level one is a leaf of the overview with no units inside. A nested one folds its files into the module around it.radix router or cart, taken from the code that defines it (a package comment, the main type, the route), never by its path.parent_evidence (step 4).Follow <pstack>/skills/swarm/SKILL.md, partitioned into slices of related candidates, at most five workers, each run locally without worktree isolation so it sees uncommitted code. Each worker reads its slice the way <pstack>/skills/how/references/explorer-prompt.md describes and reports in the extraction format below instead of PASS, ISSUES or BLOCKED. ABBD adds one thing to how's explorer: every unit the layout does not show comes with verbatim evidence, and every coupling it reads, whether the layout shows it or not, comes with via, a phrase that says what crosses it, and verbatim evidence, and a unit inside a module names that module as parent.
Build the lever, per <pstack>/skills/principle-build-the-lever/SKILL.md. Write .abbd/extractor/extract.<ext>, a script that prints the extraction JSON from the code alone: imports, routes, schemas, manifests, and each contract's signature and digest. It runs from the repository root, sorts its output, and uses no clock, network or model. Pick anchors mechanically and stably: every non-test file of a package plus its directory, or a file plus the symbol that defines a contract. Find modules and contracts from the code, never from a list the script keeps by hand. Walk the tree for manifests such as go.mod, package.json, Cargo.toml or pyproject.toml, and find routes, commands and environment reads by the calls that register or read them, so a module or contract added later is a unit at the next sync. Setup and sync name each manifest that no unit anchors code under as uncovered:. Have it fail when a unit has fewer than two anchors or an anchor names a symbol its file does not declare. Read configuration, such as the environment variables a CFG contract lists, only from the code that runs in production. Skip test, end-to-end and tooling config by its file, such as playwright.config.ts, a jest or vitest config or a CI workflow, the same way anchors skip test files. Never drop a variable by its name. NODE_ENV or CI can gate runtime behaviour, such as whether a login is refused or a cookie is secure, and then it is part of the contract. Diff its output against the swarm result until every difference is explained.
Write .abbd/extractor/supplement.json with what only reading tells:
purpose and responsibility for script units, repeating ref, kind, name and one anchor of the unit they describe, with no evidence. When that anchor is also held by the unit's module, such as the directory of an inside module, the innermost unit is matchedevidence instead of anchors and their module as parent, by the supplement's ref or the script's; the module need not be restated. A quote may sit on an anchor of that parent or of a module around it, as long as the parent holds some anchor the unit does not. A quote on an anchor of any other script unit of the same kind makes setup refuse the unit and name both. A contract the script reports no signature for keeps the one the supplement gives, as INFERREDvia, phrase and evidence. Name each end by the supplement's ref or the script's. An end the script reports needs no entry of its own in the supplementphrase for the couplings the script reads, starting with those between top-level modules, which the overview draws. Repeat the edge with via, phrase and evidence. The script's claim still holds the edge, and the phrase only labels its lineMOD whose evidence quotes the project naming or showing it (the README section, manifest, entry point or code), and give each member that part as parent with parent_evidence quoting the project placing it there. Add one when step 1's bounds need it, never for members that share no responsibility. Sync's fallback places a crowded level's units in the directories their code lives in, and never moves a unit a reader placedRun setup:
abbd setup --supplement .abbd/extractor/supplement.json -- <interpreter> .abbd/extractor/extract.<ext>
not deterministic: the script printed different output across three runs, one with a different PYTHONHASHSEED and PERL_HASH_SEED. Sort what it prints and remove the variation.fix the script, or cite the code: a supplement unit matches no script unit and cites no evidence. Teach the script the unit, add evidence, or drop it.would merge into it: a supplement unit with evidence shares an anchor with a script unit that is not its parent. Name that unit as parent if the unit sits inside it, quote code of its own, or drop the evidence if it describes that script unit.cites no evidence: a supplement coupling has no quote. Add one or drop it.is not a relation ABBD knows: a module or feature provides a contract, anything consumes a contract, and anything depends_on any unit.Once setup passes, run abbd lint. The level lines at the end of its report name each view drawn at the wrong level, too coarse, too fine or too dense, and say what to change in the units. Change the script or the supplement as it says and rerun setup, until no level line is left or you can say in the reply why one stays. Step 8 records that reason. Fix the levels before anything else: the hard breaches of a dense view come from its units, and most go once its level reads.
For each top-level module, follow <pstack>/skills/how/SKILL.md unchanged and store its Overview and Key Concepts with abbd understand <MOD-ID> <FILE>. A directory group that sync made counts as a top-level module, because the overview draws it like any other. Any module takes a text, so do the same for a module inside another when the project's own docs describe it on its own, or when its page is dense enough to list focus views, since a reader of a tangle leans on the text most. Write the texts in the order a reader meets the pages. The top-level modules come first, then the modules one level below them that take a text, then the deeper ones. A page without its text has no account of what the module does. Its text describes its own subtree, and its parent's text still describes all of it. Write the text as the code is now, in the present tense. Leave out dates, issue and PR numbers, and tags such as "migrated from X", because git keeps the history. Keep each section under 2,000 characters of prose, and split a longer one under ### headings or into shorter sections. abbd understand <MOD-ID> <FILE> and abbd status report each section over that length and each phrase that reads as history. Neither refuses the text or fails the check, because a version number or a name can read as history too.
Look at the drawings. Open .abbd/blueprint/index.html in a browser 1600px wide, take a screenshot of the overview and of the densest module page, and read the images. Revise the units and rerun setup when a view reads badly: a box an engineer of the project would not name, a tangle whose lines you cannot follow end to end, a page that repeats its module, a line between top-level modules with no phrase. Check too that each page reads the way the swarm described the code, and that no page one click from the overview still says its description is missing.
Run abbd lint --record to record the hard breaches that remain as the repository's routing debt, and name each in the reply. The first record refuses while a view with hard breaches has a level line. Go back to step 5 for it, or, for a level step 5 lets stay, rerun as abbd lint --record --keep-level <VIEW>=<REASON>, once per such view, which writes the reason into .abbd/lint-debt.yaml. A level line is never debt.
Run abbd install. It writes a short block between <!-- abbd:begin --> and <!-- abbd:end --> into CLAUDE.md at the project root, so any assistant asks abbd explain <QUERY>, abbd path <A> <B> and abbd impact <QUERIES> before it greps, and runs abbd sync and puts abbd diff in the PR after it changes code. A rerun replaces the block and keeps the rest of the file.
Add .abbd/state.yaml merge=union to .gitattributes, so a merge of two synced branches does not stop on the state. The abbd skill says how to resolve it.
Commit .abbd/, .gitattributes and CLAUDE.md with the code, and tell the human where the blueprint is. From here on the abbd skill reads and queries the blueprint.
{
"units": [
{"ref": "billing", "kind": "MOD", "name": "billing",
"anchors": [{"path": "billing"}, {"path": "billing/charge.go", "symbol": "Charge"}]},
{"ref": "api", "kind": "IF", "name": "http api", "signature": "GET /charges", "digest": "3f9a1c0d",
"anchors": [{"path": "api/http.go", "symbol": "Serve"}, {"path": "api/http.go", "symbol": "Routes"}]},
{"ref": "charges", "kind": "DATA", "name": "charges table", "parent": "billing",
"evidence": [{"path": "billing/charge.go", "lines": "41", "quote": "INSERT INTO charges"}]}
],
"relations": [
{"from": "billing", "to": "api", "kind": "provides"},
{"from": "ledger", "to": "charges", "kind": "consumes", "via": "data", "phrase": "SELECT amount",
"evidence": [{"path": "ledger/book.go", "lines": "12-13", "quote": "SELECT amount FROM charges"}]}
]
}
kind is one of MOD, IF, EVT, DATA, CFG, FEAT. Only contracts carry a signature.digest fingerprints the code a contract's meaning lives in, so abbd diff sees a change of meaning under the same signature.entries lists a contract's parts one by one when it has several a reader names on their own: routes, RPC methods, a command's flags, a table's columns. Each is {"name", "shape"}, spelled as the code registers it, such as {"name": "GET /charges/{id}", "shape": "-> Charge"}. Keep in signature only what every entry shares, such as a base path, and never join the entries into it, or a change to one reads as a change to all. abbd keys each entry by its name in lower-case letters, digits and hyphens, so GET /charges/{id} is get-charges-id. Two names that reduce to the same key are refused. Give one a "key" of its own. The script reports entries and the supplement does not. An entry's meaning is a reader's note, <ID>.entries.<KEY>, never text the script copies from comments.entries names the entries of its to contract it uses, by name, when the code spells them where it uses them: the route a page fetches, the flag a skill passes. Leave it out when the code does not say.{"name": "amount", "shape": "numeric(12,2)", "required": true}. Print shape as the type the code declares, from the schema, the struct or the type definition, never a type guessed from sample values. Set required only where the code says so, and leave it out otherwise: NOT NULL or a primary key in SQL, a field without omitempty or ?, a schema's required list, or proto2 required against optional. A nested field is named under its parent, as in items.id. The blueprint draws the fields as a table with their type, whether each is required, and who writes and reads it, and abbd diff reports a field's type change and a change to whether it is required as lines of their own.provides relation and its reader a consumes relation, each with the field in entries. Emit them where the code names the field: an INSERT or UPDATE column list, a keyed struct literal, an assignment to the field, a SELECT column or a read of the field. Leave a module that moves the whole record without naming a field, such as the code that serializes it, as a plain relation without entries.ref is the unit's name within the extraction, stable across runs. relations name units by ref; kind is depends_on, consumes or provides.via is import, trait, callback, macro, config, build-feature, data, convention or call.phrase says in at most 4 words and 24 characters what crosses a coupling: an endpoint, a message, a query, a file or a command. Examples are HTTP /api/v1, schema fetch, Cypher, NDJSON /ingest push, IsReady 조회 (health) and 샘플 조회 SQL. It never restates the via, in its own words or in others. An import edge is not model types, and a call edge is not function call. Name the thing itself, such as Unit, Evidence, Claim for the types one package takes from another or LoadUnits for the loader a page calls. Never give many edges one generic phrase such as shell command. If nothing more specific than the via crosses, leave phrase out. The blueprint draws it beside the line, marked as the supplement's words, INFERRED. Quote the code where the thing crosses, so the phrase goes when that code changes. Only the supplement gives a phrase, never the script.evidence is a list of {"path", "lines", "symbol", "quote"}; lines and symbol are optional. The quote is verbatim; whitespace does not matter, and it must sit within three lines of lines. A unit or coupling only a reader found lives while any of its quotes is in its file. A quote its file no longer holds drifts, and dies at a sync of a later revision unless abbd record evidence <TARGET> --evidence <PATH:LINES:QUOTE> refreshes it.parent names, by ref, the module that contains a unit. A unit with no parent is drawn on the overview; a unit with one is drawn inside its module. In the supplement, parent_evidence is the code that places a unit there; without it the unit's own evidence stands in. A parent from the supplement is INFERRED and is stored beside the script's. The script's parent outranks it, and a human's outranks both. abbd record parent ID PARENT --evidence ... places one unit later.purpose or responsibility. Unknown fields are rejected.Rerunning setup replaces every claim the last supplement made and finds its units again by ref, so keep each unit's ref stable. Older scripts and supplements spell it key, and abbd still reads that, but a path-like key with enough entropy trips gitleaks' generic-api-key rule, so write ref. What a reader stored through abbd record and what the human stated stay. A state from before writers existed is converted once with abbd migrate, which needs this supplement to tell its claims from a reader's.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub whyjp/abbd --plugin abbd2 skills in this plugin