/actual:adr-bootstrapfrom Actual.AI Plugin
Bootstraps a repository's Architecture Decision Records (ADRs) using the actual CLI. Converts existing ADRs, walks through remaining decisions, and drafts ADRs for uncovered areas by surveying code and session history.
Ships in Actual.AI Plugin. 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.
Bring a repository's ADRs under the checks in three steps:
docs/adr/ or another ADR tool's folder, that actual adr normalize converts with nothing left to ask.Signed out, a converted or created ADR is an accepted file in docs/adr/ with its rule file in .actual/rules/, which plan-check and impl-check enforce at once. Signed in, a created one is a decision in Actual AI, accepted or a draft as the person picks. If the repository isn't in Actual AI yet, the CLI adds it by itself on the first create and says how to undo it, so don't ask the person to connect anything first. Nothing is moved, converted or created before the person answers.
actual adr refresh recommends normalize when no decision governs the repository and files under docs/adr/ aren't normalized (--json reports recommendation as normalize), and this skill when every file there is normalized or there are none. When either recommendation, not the person, brought you here, don't start any step. Tell the person what the refresh found (ADRs in a format no check reads yet, or no decisions at all), offer this skill's steps in one question, and go on only on a yes. After a no, don't offer it again in the session.
Signed in, the same refresh can also list files under docs/adr/ that aren't in Actual AI yet and say actual adr create --all sends them. Don't run it on your own: it sends the person's docs/adr/ files to Actual AI, so it waits on their yes, as adr-draft's "Files in docs/adr/ that Actual AI doesn't have" section describes.
command -v actual && actual --version
Creating needs actual 0.17.0 or later. Offer to install or upgrade it as the adr-draft skill does, and without it, draft and show the ADRs but create none.
This skill drafts to adr-draft's rules and creates through its steps. Load the adr-draft skill now (in Claude Code through the Skill tool, in Codex with $adr-draft) and keep its instructions for the steps below, without starting its own flow. When it isn't installed, say so and that the plugin, or npx skills add actual-software/actual-plugin, brings it, and stop before creating anything.
No argument, or the whole repository. The default: the code, the files under docs/adr/, the rules under .claude/rules/ and, once the person agrees, this checkout's coding-agent sessions.
A number N, or "the last N commits". Only what those commits changed:
git log -N --stat # replace N with the argument
git diff HEAD~N..HEAD
With fewer than N commits, use as many as exist.
"This session". Only what changed in this session: the files edited and the decisions behind them. git status and git diff help.
The two narrower windows read no past sessions. Steps 1 and 2 cover the repository's ADRs whatever the scope; it narrows only step 3's survey.
actual whoami # exit 0: signed in; exit 2: not signed in
actual adr list --json --limit 200
ls docs/adr/ .actual/rules/ 2>/dev/null
Signed out, list reads the decision files under docs/adr/ that carry an ADR header and leaves the rest out. Signed in, it reads this repository's decisions in Actual AI; page on with --offset and the next_offset it returns. Read every file under docs/adr/, headed or not, and open the related decisions with actual adr show <id> --json. Don't propose a decision that list shows.
A file under docs/adr/ with no ADR header, or one actual adr discover lists as written elsewhere, records a decision in another format, which no check reads yet, and so does an ADR in another tool's folder (step 1 lists them). Don't draft a new ADR for it: that leaves two copies of one decision. Convert it, as steps 1 and 2 describe, unless the person chooses a foundation set for many generated files there. A file under docs/adr/drafts/ isn't converted (normalize leaves that folder alone), so count each as an intent and draft its decision to adr-draft's rules, naming the file it came from; whether to keep that file once the new ADR exists is the person's call.
A review file an earlier run left in docs/adr/drafts/ (it has the line <!-- adr-bootstrap review -->, as "Review in a file" writes it) is a review that wasn't finished. It and the draft files it lists are this skill's, not intents, so don't count or draft them. Before step 1, ask once whether to finish that review now, going on from step 4 of "Review in a file", or remove it with the files it lists, then go on to step 1. When the person would rather leave it for later, leave those files alone.
Signed in, a file under docs/adr/, outside docs/adr/drafts/, with an ADR header that list doesn't show is a decision Actual AI doesn't have yet, such as one a signed-out create wrote. Don't propose it again. Sending such files is actual adr create --all, which sends the person's docs/adr/ files to Actual AI, so never run it on your own: the report asks about them.
Keep the answer actual whoami gave: it decides where each pick is created.
Run this before anything else, in every scope:
actual adr discover --json
It sorts the files under docs/adr/, the only folder the CLI reads. Other ADR tools keep theirs elsewhere, so also look for ADRs in these folders:
doc/adr/, or the folder .adr-dir names.docs/decisions/.adrFolder in .log4brains.yml, and its packages' folders in a monorepo.backstage.io/adr-location annotation in a catalog-info.yaml names.docs/adrs/, docs/architecture/decisions/, architecture/decisions/, adr/ and decisions/.An ADR there is a Markdown file named like 0001-use-postgres.md, or one with Status, Context, Decision and Consequences headings or MADR's front matter. Indexes and templates (README.md, index.md, template.md) aren't ADRs.
When discover lists nothing to normalize and no such folder holds an ADR, go to step 3. Otherwise preview the files under docs/adr/, writing nothing and running no model:
actual adr normalize --all --dry-run --no-model --json
Each file's outcome sorts it:
would-write or would-reindex: the CLI converts it as it stands.needs-input with only a policies question: a decision written as prose. On a yes, the CLI's own model writes its policies, when a runner is set up.needs-input with any other question, such as a status the file doesn't state: step 2 asks the person.skipped: not converted, for the reason it gives.The CLI can't read the files in other folders until they're in docs/adr/, so count those by folder.
Then ask one interactive question (AskUserQuestion in Claude Code; without one, ask in your reply and end your turn on it). Say what a yes does: how many files convert as they stand; how many are prose decisions whose policies the CLI's model writes, with nobody reading them first, when a runner is set up (step 2 takes them otherwise); which folders' ADRs move into docs/adr/ first; and how many have questions for step 2. The answers are Convert them (recommended) and Leave them as they are.
On a yes:
docs/adr/ with git mv, keeping its file name, so each decision has one copy. When a name is already taken there, move that folder's ADRs into a subfolder named for it instead (docs/adr/doc-adr/ for doc/adr/). Leave indexes and templates where they are, and point the tool's own setting at the new place (.adr-dir, log4brains' adrFolder, the Backstage annotation) so its next ADR lands there too.actual adr normalize --all --json. It converts every file it can with no question, the moved and the prose ones included, and reports the rest as needs-input without writing them. Never pass --yes: it writes every undecided decision as a draft, which doesn't govern.--push saves the converted decisions to Actual AI. It publishes them to the person's organization, so it runs only on a yes of its own.Then tell the person what moved and which rule files were written, and name each decision whose policies a model wrote (its follow_ups say so), so they can review the wording in the doc; adr-draft's update fixes one that reads wrong. When the report's model says no model ran, the prose files are still needs-input, and step 2 extracts them.
On a no, move and convert nothing, skip step 2 and go to step 3. Don't draft ADRs for the decisions those files record either: they're the person's, and a second copy would compete with them. Name them in the report as not converted.
Converting is right for a handful of files, each a decision someone wrote. When step 1 finds more than about twenty, look at a sample before asking: files that share one template, one commit or one generator's wording (hundreds of near-identical files a tool wrote) record few decisions many times over, and converting each one leaves hundreds of rule files that say much the same thing. Then the one question offers a third answer:
docs/adr/ (to docs/adr-archive/, say, where no check, discover or refresh reads them) so they don't sit beside the new ADRs as unconverted decisions; move them only on a yes, with git mv, and leave them otherwise.Step 2 takes the files step 1's run left as needs-input. Follow the actual skill's references/adr-discovery.md from its Extract step: extract each prose decision no model read into --extracted, with --no-model; put each open question to the person, grouped as that reference and "Let the person choose" below describe, so a question many files share is asked once for all of them or once per group; pass the answers with --answers; and run discover again to confirm. Report any file still not converted, with its reason.
Whatever steps 1 and 2 did, ask one question next: whether to survey the repository for the decisions its ADRs don't cover yet and draft ADRs for them. Skip it only when the person's own request already asked for new ADRs, as a scope of the last N commits or of this session does. After a no, report what steps 1 and 2 did and stop.
The ADRs steps 1 and 2 converted, and the files the person chose to leave as they are, are the repository's existing decisions here: read each one (or, for many generated files, each group), and propose nothing they already decide. The foundation-set answer is the one exception: there the new ADRs are drafted from those files, to replace them.
On a yes, the sections from here through "Create the picks" are step 3.
.claude/rules/Claude Code reads every file under .claude/rules/ into each session in this repository, so a rule there is often a decision someone wrote down for the agent and never as an ADR. Those files aren't ADRs, and steps 1 and 2 leave them alone; here they're one more source for the survey, beside the code, its history and the sessions. Read every file there, subfolders included, in the whole-repository survey, and in the narrower windows only the ones those commits or this session changed.
actual adr discover --json names in a legacy entry's legacy_files. Each repeats an ADR actual adr-bot wrote under docs/adr/, which the repository already has.Past coding-agent sessions in this checkout often hold decisions the code doesn't show yet: a rule the person stated, a correction they made more than once, a trade-off they settled. So in the whole-repository survey, ask whether you may read them before you draft anything, saying what you'll read and that reading them puts their text in your context, which reaches your model provider, though no ADR will quote them. Ask in an interactive question where you have the tool (AskUserQuestion in Claude Code), and otherwise in your reply, ending your turn on it. Read none until they agree, and survey without them when they decline. The narrower windows skip this step.
Read only the sessions recorded for this checkout, the folder git rev-parse --show-toplevel prints, and never another folder's, repository's or worktree's:
Claude Code keeps them in ~/.claude/projects/ ($CLAUDE_CONFIG_DIR/projects/ when that's set), in a folder named for the checkout's absolute path with each character other than a letter or digit turned into -, such as -home-me-src-shop for /home/me/src/shop. Each <session id>.jsonl file there is one session, one JSON object per line. Skip the folders beside them, which hold tool output. Two checkouts can share that folder, since /home/me/src-shop gets the same name, so read a file only when the first line that records a cwd names the checkout. The people's messages and the agent's replies are the text of the user and assistant lines:
ROOT=$(git rev-parse --show-toplevel)
ls -t "${CLAUDE_CONFIG_DIR:-$HOME/.claude}/projects/$(printf '%s' "$ROOT" | sed 's/[^A-Za-z0-9]/-/g')"/*.jsonl | while IFS= read -r f; do
jq -n -e --arg root "$ROOT" 'first(inputs | .cwd? // empty) == $root' "$f" >/dev/null && echo "$f"
done
jq -r 'select((.type == "user" or .type == "assistant") and .isMeta != true and .isSidechain != true)
| .message.content | if type == "string" then . else (.[] | select(.type == "text") | .text) end' <session file>
Codex keeps them in ~/.codex/sessions/ ($CODEX_HOME/sessions/ when that's set), in dated folders of rollout-*.jsonl files. Read only the files whose first line, a session_meta entry, names the checkout in payload.cwd. Their messages are the response_item lines whose payload is a message from the user or the assistant:
ROOT=$(git rev-parse --show-toplevel)
for f in "${CODEX_HOME:-$HOME/.codex}"/sessions/*/*/*/rollout-*.jsonl; do
head -1 "$f" | jq -e --arg root "$ROOT" '.payload.cwd == $root' >/dev/null && echo "$f"
done
jq -r 'select(.type == "response_item" and .payload.type == "message" and (.payload.role == "user" or .payload.role == "assistant"))
| .payload.content[]? | select(.type == "input_text" or .type == "output_text") | .text' <session file>
Without jq, read the same fields with any JSON reader. Start with the newest sessions and stop once new ones add nothing.
What you read from the sessions is in your context, which reaches your model provider. Use them to find decisions and for nothing else: no draft, question or report quotes a transcript, says who said what or when, or repeats a credential, a name or any other personal detail found there. An ADR states its decision in its own words, and its policies rest on the code or on what the person confirms.
Sort each finding into one of three kinds, and note where it shows: the files and commits, or for a session only that one exists.
.claude/rules/, a choice settled in a session.An ADR is warranted only for an architectural or cross-cutting decision, a convention, constraint or policy future code should follow, that no existing ADR covers, including the files under docs/adr/ you converted or the person chose to keep as they are. Before you show the drafts, compare each with those files' titles and policies, and drop or fold in any that repeats one. Fold findings that point at one decision into one draft. When findings disagree, such as a stated rule the code breaks, draft the decision they point toward and name the conflict when you show it.
Rank the decisions by how much of the code each one governs and what breaking it would cost, and propose every one that warrants an ADR, most significant first. There's no cap on the count: the bar above decides what's in the set, and "Let the person choose" keeps a large set quick to answer. Don't pad the set to make it bigger, either. A pattern the code follows only in part warrants an ADR only when the findings show which way it's going; otherwise name it in the report as undecided rather than drafting it. If nothing in scope warrants an ADR, say so briefly and stop. Don't invent one.
Draft each in the shape and to the rules of adr-draft's "Draft the ADR" section, grounded in the files you read.
Most people take the set as proposed, so lead with that, and show each draft's full text only to someone who asks to review it. How you ask depends on how many drafts there are, whether the survey proposed them or they're the questions converting many files with normalize raises, which the actual skill's references/adr-discovery.md asks this way.
Before asking, summarize every draft in one line, numbered in ranked order: its title, how many MUST and SHOULD policies it has, and its scope (whole repository, or its globs), followed by what it rests on. For example: 3. Services reach the database through the repository layer: 2 MUST, 1 SHOULD; services/**. Rests on: imports in services/*/db.ts.
Ask one interactive question (AskUserQuestion in Claude Code):
multiSelect: true), one option per draft labelled with its title, two to four options per question, split as evenly as you can (ten drafts as four, three and three).A single draft gets one question: create it, review it in full first, or not.
Group the drafts by the area of code or the topic they govern (services/**, testing, the API layer), about ten groups at most, each named with its draft count. Ask one question first: Accept all N (recommended), decide group by group, or review them in a file (below). Group by group, ask per group, up to four groups per question call: Accept the group, Skip it, or Review it, which goes through that group's drafts as "Review one by one" does. So 100 drafts come to about ten answers.
For 100 drafts or more, or whenever the person would rather choose in their editor, offer a review file instead of questions. It only adds files to docs/adr/drafts/, and removes only the ones it lists:
03-services-use-the-repository-layer.md), and name the review file REVIEW.md. When a name is taken in docs/adr/drafts/, use the next free one (-2, -3 before .md), so no file there is ever overwritten.<!-- actual:ignore --> and <!-- adr-bootstrap review -->, then says that the person sets keep to no for a draft to skip, may edit any draft file below its first line, and tells you when they're done. Below that, one table row per draft with a keep column set to yes, then its number, a link to its file, its policy counts and its scope, grouped under a heading per area.<!-- actual:ignore -->. discover and normalize pass over a file with that line, and refresh leaves the folder out, so no draft is converted or governs before the person picks it.Only the review file and the files it lists are yours to clean up. Nothing else under docs/adr/drafts/ is, even a file whose name matches a draft's.
Ask once, in the same call as the first question: Accepted (recommended), the decision is settled as written and governs once it's saved; or Draft, it's still open and governs once someone publishes it. One answer covers every ADR created, and the person can set them one by one under Other. For a large set they'd rather review in Actual AI than in the terminal, Accept all as drafts saves every one there, and they review and publish them on the web app's decisions page.
Signed out there's no status to pick: the ADRs written to docs/adr/ are accepted, and a person who wants drafts signs in first, as adr-draft describes.
Only when no such tool exists, show the one-line summaries and ask in your reply whether to accept all, review one by one or choose some, with a literal checkbox list, one - [ ] per draft (or per group, past about 15), and the status in the same message when signed in. End your turn on it.
Don't create anything until the person answers, or when they pick none.
Hand the picked drafts to adr-draft in ranked order, as its "Drafts handed over by adr-bootstrap" section describes. It creates each with the content the person saw and, signed in, the status they chose, then checks and reports them. Where adr-draft needs the person's answer, such as for a likely duplicate, ask it and carry on.
A rule under .claude/rules/ that a created ADR was drafted from still reaches every Claude Code session, and it won't change when the ADR does. So once the picks are created, ask one more question: name each file whose rules an accepted ADR now carries, and offer to remove those rules (the whole file, or only those rules when it holds others too). A rule whose ADR was saved as a draft, or wasn't created, stays where it is, since nothing else enforces it yet; say which stay and why. Remove only on a yes, with git rm for a whole file git tracks. First say when a file has uncommitted edits, which removing it would lose, or when git doesn't track it, which leaves no way to bring it back.
Start with what steps 1 and 2 did: the ADRs moved and converted, the decisions whose policies a model wrote, and the files still not converted, with why. Then add to adr-draft's report what the survey left: the drafts the person didn't pick, and anything it found that didn't warrant an ADR on its own, one line each. Name any .claude/rules/ file or rule you removed, and the ones the person kept. adr-draft can update or delete any of the new ADRs later.
Signed in, when the survey found files under docs/adr/ that Actual AI doesn't have, name them and ask whether to send them to Actual AI with actual adr create --all. Run it only after a yes and report its result, both as adr-draft's "Files in docs/adr/ that Actual AI doesn't have" section describes.
The skill is done once steps 1 and 2 are settled and, in step 3, nothing warranted an ADR and you said so, the person declined, or every picked ADR is created through adr-draft and reported.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
3 skills in this plugin
/actualCompanion for the actual CLI's architecture governance. Runs and troubleshoots plan-check and impl-check against ADR rules in .actual/rules/ (the Claude Code plugin checks every plan and turn), the commands that find rules for a file or plan (rules ls, select, brief and index), check-override, the human-only way to clear a denied rule, signing in with login, whoami and logout, and the actual adr commands for ADR files and decisions in Actual AI. Use when checking a plan or changes against the repository's architecture rules, finding the rules for a file, explaining a denial or how to override it, signing in to Actual AI, installing or upgrading the CLI, configuring runners or models, troubleshooting the CLI and its hooks, or finding and normalizing ADRs in docs/adr/ written outside Actual (adr discover, adr normalize). Runs actual adr-bot (CLAUDE.md, AGENTS.md and Cursor rules written from ADRs) and the advisor (org-scoped architecture Q&A) only when the user asks for them./adr-draftCreate, update or delete one Architecture Decision Record (ADR) with the actual CLI, from an intent the user states or an observation the user or the agent makes about the code. Drafts the ADR or the change, shows it, and runs actual adr create, update or delete only once the user agrees. Signed out, an ADR is an accepted decision doc in docs/adr/ with the rule file in .actual/rules/ that plan-check and impl-check read; after actual login, it's a decision in Actual AI, accepted or a draft as the user picks. Use when asked to draft, write, capture or record an ADR or an architecture decision, to change or remove one, or when a decision settled in the session warrants one. To find several decisions across a repository, its recent commits or this session, use adr-bootstrap, which creates the ones the user picks through this skill. Don't use it to list, publish, archive, accept or reject decisions (the actual skill covers those commands), or to review code.npx claudepluginhub actual-software/actual-plugin --plugin actualOther plugins' skills for the same job