/docflow:bootstrapfrom docflow
Scaffolds or retrofits documentation-led conventions (AGENTS.md, CLAUDE.md, CONVENTIONS.md, ADR catalogue, plan/queue, _agent/coordination) into a repo. Works on fresh and existing repos, merging rather than overwriting. Offers express/guided/full depth setup.
Ships in docflow. 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.
You are installing (or retrofitting) a documentation-led convention set in the current repo. The end state is a repo that can be driven by both humans and coding agents off a small set of canonical files. Carry over the mechanism described here — nothing about any other project.
Inspect the repo before asking anything. Reuse explicit answers and sign-off already supplied in this session; never replace them with profile defaults or ask for them again. Before writing, summarise the resolved artefact root, depth, queue, gate and coordination/integration modes against those answers. If a host mirrors a selected folder into a sandbox, identify the actual target path and how verified outputs reach the selected folder; never call an untouched target complete merely because a scratch mirror passed.
Fresh repo (no source, no docs): you are scaffolding from zero.
Existing repo: you are retrofitting.
README.md, CONTRIBUTING.md, AGENTS.md,
CLAUDE.md, docs/, adr/, .github/ before proposing changes.Already a docflow repo (carries AGENTS.md + CONVENTIONS.md + an
ADR catalogue): you are adding to an existing setup, not scaffolding.
Do not re-scaffold the core or re-ask settled questions — read the
recorded choices from CONVENTIONS.md/AGENTS.md (ADR shape, status
lifecycle, artefact root, multi-agent mode, and which optional layers
already exist). Then offer to enable any opted-out optional layer
still absent — plan/, _agent/, GLOSSARY.md, domains/, or the
second ADR shape (the technology template) — and write only the chosen
ones, by merge, under the recorded artefact root, leaving everything else
untouched. Ask only the questions the new layers need (e.g. the
coordination question when enabling _agent/ — where a single writer
without both a recorded verify gate and a plan queue correctly ends up
with no _agent/ at all, and the layer is simply not needed). This is the entry point for
adding a layer you deferred at first bootstrap. A repo still carrying
coordination files an earlier scaffold wrote keeps them: leave them in
place here and let the audit skill report the layout.
Enabling GLOSSARY.md writes the canonical shell, never a rewrite.
When the layer is chosen and the file is absent, write it from
templates/GLOSSARY.md — the optional heading and prose, then the one
Term | Definition table recorded in the generated CONVENTIONS.md
§Glossary. If the file already exists, leave it untouched: enabling the
layer adds nothing, and add-convention extends the existing file in the
canonical shape or audit offers a consented migration.
Enabling the second ADR shape is a scheme switch, not a file copy.
It is the one deferred layer that changes a choice already recorded, so
write all of it in one pass or none of it: replace §ADR Shapes in
CONVENTIONS.md with the two-shape text, add the technology
section-order and shape bullets to AGENTS.md, write
adr/0000-template-technology.md, and regenerate INDEX.md with the
Shape column. Existing ADRs keep their numbers and stay capability —
an absent shape: field already means capability, so no ADR is
rewritten and nothing is renumbered. Half of the switch strands the
repo in the state the Step 4.5 cross-check calls a contradiction: a
technology template that a single-shape scheme will never select.
A repo already on the legacy range encoding gets the migration
offer instead. Some two-shape repos were scaffolded before the shape
became a declared field and encode it in the number: §ADR Shapes
records a cutoff (capability below it, technology at or above), and
adr/ holds a template numbered other than 0000 (e.g.
adr/0100-template.md). Either signal alone identifies it. Such a repo
is not missing a layer — it has both shapes already — so do not offer
the scheme switch above, which would strand it with two rival
encodings. Offer the migration onto the declared field, on the same
terms the audit skill uses:
depends-on,
supersedes / superseded-by, relative adr/NNNN-*.md links,
INDEX.md, domain README.md listings, plan/todo/ owning-ADR
lines) and what is left as history (plan/done/ footers, commit
messages, tags).shape: on every ADR,
rewrite every in-catalogue reference, replace the boundary template
with adr/0000-template-technology.md, rewrite §ADR Shapes to the
declared field and drop any seed-ADR exception clause, regenerate
INDEX.md with the Shape column — and land it as one commit whose
message lists every old-to-new pair. That procedure is the single
source of truth; do not paraphrase a second variant of it here.plan/, _agent/, GLOSSARY.md, domains/).State which situation applies in one line before asking the assessment questions.
<repo>/
AGENTS.md # hard rules for coding agents — entry point
CLAUDE.md # one-liner: @AGENTS.md
README.md # human-facing project summary (preserve if exists)
CONVENTIONS.md # authoring rules: ADRs, naming, status, audit, git
INDEX.md # generated table of all ADRs
GLOSSARY.md # shared terms (optional — see Q7)
adr/
0000-template.md # capability-ADR template (always)
0000-template-technology.md # technology-ADR template (only if two shapes — see Q2)
NNNN-<kebab-slug>.md # one ADR per decision, contiguous numbering
domains/<slug>/README.md # optional (see Q7)
plan/
README.md
todo/NNNN-<slug>.md
done/<YYYY-MM-DD>-<slug>.md
_agent/ # the agent operating contract (see Q5) — optional
ROLES.md # who writes what (several writers only)
LOCKS.md # the file-claim mutex (shared checkout only)
prompts/autonomous.md # how an unattended run behaves (only with a
# verify gate — Q8 — AND a plan queue — Q4a)
federation.md # multi-repo only (Q11): this repo's back-pointer
federation-index.md # multi-repo only (Q11): member index — home repo only
Placement. The tree above shows the root option. AGENTS.md and
CLAUDE.md always sit at the repository root; adr/, plan/, _agent/,
INDEX.md, and CONVENTIONS.md go under the artefact root chosen in
Q12 (default .docflow/, e.g. .docflow/adr/, .docflow/plan/).
Discovery. Tools locate the artefact root without reading
CONVENTIONS.md first: a .docflow/ directory at the repository
root is the root; for any other root, bootstrap writes a .docflow
file at the repository root — a one-line pointer, root: <path>
(e.g. root: docs/, root: .). Neither present means a pre-contract
repo (tools probe docs/, then the repository root, for a
CONVENTIONS.md naming an artefact root) or not a docflow repo.
_agent/ is the agent operating contract — who writes what, the one
real mutex, and how an unattended run behaves. It holds nothing git
already records: no duplicate shipped record, no dashboard of what is in
flight, no snapshot of the current state, no hand-off. Which of the
three files above exist follows entirely from Q5, Q8 and Q4a, and a repo
with no _agent/ directory at all is a valid outcome.
Core vs optional layers. Only the core is always written:
AGENTS.md, CLAUDE.md, CONVENTIONS.md, adr/0000-template.md, and
INDEX.md. A repo with just these is a valid, lightweight docflow repo — a
classic ADR catalogue with conventions. Everything else is an opt-in
layer: the plan/ queue (Q4a), the _agent/ contract (Q5 + Q8 + Q4a —
a single writer without both a verify gate and a plan queue gets none of
it), GLOSSARY.md and
domains/ (Q7). Omitting any optional layer is a valid state, not an
error; a lifecycle skill that needs an absent layer refuses cleanly and
names what is missing.
For a multi-repo product (one product spread across several repos —
see Q11), two extra files appear: federation.md, a small back-pointer
every member repo carries, and federation-index.md, the authoritative
member list that lives only in the home/establishing repo. All federation
artefacts — federation.md, federation-index.md, and the derived
roll-up ROLLUP.md — are placed under the configured artefact root.
A standalone repo has none of them.
shape:
metadata field (capability or technology; an absent field means
capability) — never in a number range. Every ADR takes the next
contiguous number whatever its shape, and each shape has its own
template, both numbered 0000.
Proposed → Accepted → Implemented → (Superseded | Deprecated). Terminal states reachable from any prior
state. Status drives plan-folder placement: Accepted →
plan/todo/, Implemented → plan/done/.adr/NNNN-kebab-slug.md, zero-padded 4 digits,
contiguous, no reserved gaps. Cross-references use relative paths.editorial in the commit message. Approvals
table populates when an ADR is Accepted and updates on each later
substantive revision.plan/ is the work queue. When work ships, git mv plan/todo/X plan/done/<date>-X, any plan-item Status removal, owning
ADR status advance, and INDEX.md regeneration are grouped in the
completion commit. Under direct-to-main integration that commit is
pushed to the integration branch and the moved file's footer names
the HEAD SHA (and deploy artefact id if applicable). Under
pull-request integration those changes are the last commit on the
pull-request branch before it is marked ready, the footer names the
pull request, and the merge is the completion event._agent/ holds only what
git cannot tell you, and each mode (Q5) prescribes exactly its own
files — nothing else is written there. In a shared checkout, an
agent appends a row to _agent/LOCKS.md
(<agent-id> | <path> | <ISO-8601 timestamp>) before editing and
removes it on commit; that ledger is the one real mutex, and a queue
item is claimed on the item itself. In separate worktrees a queue
item is claimed by pushing claim/<item-key> — the queue file name
without its extension — plus a draft pull request from it where
integration is pull-request based; the push is what excludes the
second writer, and no ledger is kept. Under a single writer
there is nothing to serialise and nothing to claim. No mode keeps duplicate shipped state,
a dashboard of what is in flight, or a snapshot of the current state:
git history and plan/done/ are the record, and the live branches
and pull requests are what is in flight.Rationale:
footer on commits touching an ADR. Signed commits unless the user
opts out. No Co-Authored-By trailer for agent work unless the user
asks for one.@AGENTS.md for compatible agents that read it.// see adr/0042-foo.md), commit
messages, PR descriptions, internal docs, AGENTS.md,
CONVENTIONS.md, INDEX.md, and the plan/ queue. When in
doubt, ask whether a non-builder would ever see this string — if
yes, the ADR reference comes out.Reuse supplied answers first. Summarise applicable choices already supplied in the request or session, including depth and sign-off. Defaults never replace explicit choices. If every material choice is supplied, proceed after the cross-check. Ask only about a material missing or conflicting choice.
For unresolved choices when depth is not supplied, open with one single-select question: how deep should this assessment go?
If the repo's CONVENTIONS.md already records an Assessment depth:
(a retrofit or re-run), pre-select that depth as the recommended
option instead when asking. A recorded depth steers the recommendation and
is never applied silently; it is not a current answer or execution grant.
Mid-flight switching. At any question the operator may answer "defaults from here" (remaining choices take their recommended defaults, as in express) or "go deeper" (escalate express → guided → full for the remaining questions). Honour the switch immediately.
Express profile. An express bootstrap scaffolds the conservative fixed profile for unanswered choices — preserve explicit choices, summarise the result and use applicable supplied sign-off or obtain missing sign-off before writing:
AGENTS.md, CLAUDE.md, CONVENTIONS.md,
adr/0000-template.md, INDEX.md, plus the seed ADR 0001
(Step 5 item 5b). All optional layers off: no plan/, no
_agent/, no GLOSSARY.md, no domains/, no technology template..docflow/); single ADR shape; full status
lifecycle.Rationale: footer ON,
signed commits ON, ADR-revision tags OFF, Co-Authored-By OFF._agent/ directory at all.On an existing repo, express preserves and merges exactly as a full run does — depth changes how many questions are asked, never how destructive the run is.
Guided defaults. Beyond its three questions, guided takes: single
shape, full lifecycle, the recommended git contract, optional
artefacts deferred, no hard rules, default artefact root, standalone,
and the express language rule. Q5 is one of the three it asks, and its
recommended answer is single writer — so a guided run that takes
the recommendation records single writer, and writes an _agent/
directory only when Q8 records a verify gate and Q4a kept the plan
queue. Run the Step 4.5 cross-check on the answers before the sign-off
summary.
Federation guard. Express and guided runs are always standalone: Q11 is never asked and no federation file is written. Establishing or joining a multi-repo product is available at full depth only — it is an outward-facing commitment no default may make.
Record the choice. Write the chosen depth into the scaffolded
CONVENTIONS.md (Assessment depth: line in §Project — see Step 5
item 1). Later assessments read it and pre-select it as the
recommendation.
Ask the questions one at a time, not in a batch. For each question, state a recommended option (label it "Recommended") with one short sentence on why; the user picks it, picks an alternative, or types a custom answer. Wait for the answer before moving to the next question.
If the host CLI exposes a structured single-select question tool, use it and mark the recommended option with the literal "(Recommended)" suffix in its label. Otherwise ask in plain text, listing options as A/B/C and naming the recommended one.
After the answers are in, summarise the resulting plan in 5–10
lines and ask for sign-off before writing any files. Note in the summary
that a seed ADR 0001 recording the adopted method is created by
default (the operator may decline it — see Step 5 item 5b).
Project identity. Name, one-line description, doc language (en-GB / en-US / other), and — if existing repo — what current files (README, CONTRIBUTING, docs/, adr/, etc.) must be preserved or merged. No recommendation — project-specific.
ADR shape. A single shape, or two shapes declared by field —
capability and technology, each ADR naming its own in a shape:
metadata field? Recommended: single shape — start simple, add
the second shape later if long-lived product requirements clearly
outlive their implementations. Ask for no number boundary: shape is
metadata, so two-shape repos keep one contiguous sequence and get a
second 0000 template rather than a cutoff.
Status lifecycle. Full Proposed → Accepted → Implemented → (Superseded | Deprecated), or shorter (drop Implemented)?
Recommended: full lifecycle — the Implemented rung is cheap
and gives a clear "what's shipped" signal.
Plan folder + integration model. Two sub-answers. Ask Q5 before Q4b — the integration recommendation depends on the multi-agent mode chosen in Q5. When asking sequentially, the order is: Q1 → Q2 → Q3 → Q4a → Q5 → Q4b → Q6 → Q7 → Q8 → Q9 → Q10.
Q4a — Plan folder. Use plan/todo/ + plan/done/, or skip it
because work is tracked elsewhere?
Recommended: use it — the queue is what makes the convention
set actionable for agents.
Q4b — Integration model. Skip if Q4a = skip. Two options:
git merge --ff-only. Trunk-based development; no PRs.Coordination — by number of writers. Pick by how many people/agents
write to this repo and how they integrate — writers (integration
concurrency), not how many agents you run. A team of several developers
is multi-writer even with one agent each, and wants the worktree/PR
shape. Three answers, each prescribing exactly its own _agent/
files and nothing else:
_agent/prompts/autonomous.md,
and only if the repo is eligible for the run prompt — Q8
records a real verify gate and Q4a keeps the plan queue the
prompt walks. Fail either and there is no _agent/ directory at
all, the lightest footprint. Right for small projects and the
"one human + one agent" case._agent/ROLES.md. _agent/LOCKS.md ON as a filesystem mutex — in
one working tree it is the only thing preventing simultaneous
writes to the same file. Plus the run prompt where the repo is
eligible for it (gate + plan queue)._agent/ROLES.md, plus the run prompt where the repo is
eligible for it (gate + plan queue). No lock ledger: the pushed
claim/<item-key> branch and its draft pull
request are the claim, worktrees cannot collide on the filesystem,
and an advisory ledger nobody can rely on is noise.No answer writes a duplicate shipped-state file, a dashboard, a live
snapshot, or a hand-off, and none adds a .gitattributes or
.gitignore entry for coordination files: what happened is git
history and plan/done/, what is in flight is the live branches and
pull requests.
Note: shared checkout → separate worktrees is not a free upgrade later; it retires the lock ledger the shared-checkout repo relies on and moves the claim onto branches and pull requests. Choose deliberately.
Git contract. Confirm or override each — Conventional Commits;
mandatory Rationale: footer on ADR-touching commits; signed
commits; ADR-revision tags adr-NNNN-rN; whether agent commits
carry a Co-Authored-By trailer. Recommended: Conventional
Commits ON, Rationale: footer ON, signed commits ON, ADR-revision
tags OFF, Co-Authored-By trailer OFF.
Optional artefacts. Which now vs. defer:
domains/<slug>/README.md grouping — per-area indexes over the
flat catalogue (navigation by area, not numbering). Enable when
the project has distinct areas (e.g. auth, billing, search) or you
expect the catalogue to grow past ~20 ADRs; defer for a small,
single-area repo. Cheap to add later.GLOSSARY.md — shared term definitions, in the canonical
structure recorded in the generated CONVENTIONS.md §Glossary (an
optional heading and prose, then one Term | Definition table).
Defer; add on terminology drift. The layer is opt-in and its
absence stays valid.adr/0000-template-technology.md, the
second ADR shape) — defer unless technology decisions split from
product decisions. Enabling it is the same choice as Q2's second
shape; the cross-check in Step 4.5 keeps the two answers in step.Verify gate. What command(s) decide a change is shippable
(npm test, CI workflow, deploy + smoke, manual)? No
recommendation — project-specific. The run prompt needs both a
real gate and the plan/todo/ queue it walks: if the user has no
real gate, or Q4a skipped the plan folder, the skill refuses to
write _agent/prompts/autonomous.md.
Existing-content conflicts (existing repos only). Any conventions already in place (commit format, branch policy, ADR style, status names) the new layout must defer to or merge with? No recommendation — project-specific. Skip this question on a fresh repo.
Domain-specific hard rules to bake in. Any project-specific
constraints to enforce in AGENTS.md / CONVENTIONS.md from day
one — e.g. vendor-naming restriction, regulated-evidence posture
(attribution, retention, e-signatures), language mandate,
mandatory user-story personas, separated audit streams?
Recommended: none from day one — add later when a concrete
requirement appears; pre-emptive hard rules accumulate as cruft.
Multi-repo product (optional). Is this repo part of a product that spans several repos? Recommended: No — most repos are standalone; skip the federation setup entirely. If yes, two sub-answers:
Q11a — Establish or join? Are you establishing a new federation (this is the first repo) or joining an existing one?
Q11b — Topology (establish only). Where do product-wide decisions live?
Q11c — Identity scheme (establish only). How are ADRs identified
across the federation? (Recommended) repo-prefixed slug
<repo-id>/NNNN-slug — each repo keeps local contiguous numbering
with no central coordinator; the slug is the cross-federation key.
The scheme is recorded in the federation config and applied by the
authoring skills.
Establish sets this repo's role from the chosen topology — central (A), coordinator (B), or home (C) — writes the member index here, and records the topology and identity scheme in the federation config. Join asks for the home pointer and the federation's topology + identity scheme — you supply them; the skill performs no cross-repo read and no host API call — then writes only this repo's back-pointer config, recording those values (it does not re-choose the topology). Joining never writes into any other repo; adding this repo to the member index is a deliberate edit in the home repo. A standalone repo (Q11 = No) writes none of these files and behaves exactly as a single-repo bootstrap.
Artefact placement. Where the non-entry artefacts live — adr/,
plan/, _agent/, INDEX.md, CONVENTIONS.md:
.docflow/ — a hidden root that keeps the repo
root clean and groups all docflow artefacts in one place
(.docflow/adr/, .docflow/plan/, …).docs/ — aligns with the common doc/adr / docs/ convention;
records visible alongside other docs.AGENTS.md and CLAUDE.md are always written to the repository
root (coding agents discover them there). The chosen root is recorded in
CONVENTIONS.md, and every lifecycle skill resolves adr/, plan/,
and INDEX.md against it. For an existing repo already laid out
differently, offer a documented migration (git mv into the chosen root
CONVENTIONS.md) — never force it.After all answers are in, scan for contradictions before writing the plan summary. Surface each, take the correction, then proceed. (An express run is internally consistent by construction and skips this check; guided and full runs, and any run that switched tiers mid-flight, get the full scan.)
plan/todo/; with no plan folder it has nothing to
drive. Do not write the autonomous prompt — a gate alone does not make
the repo eligible for it. Say so, and offer the plan queue if the user
wanted an unattended run. Under a single writer this leaves no
_agent/ directory at all; under several writers the mode's other
files are still written.shape: technology
field selects. (On a re-run that enables the second shape on an
existing single-shape repo, the two move together — see Step 1.)The sign-off includes final/persisted Status at a glance reporting at every depth. Offer the opt-out at full depth; if explicitly declined, omit the Reporting section, AGENTS pointer and prompt Report step together. Domain reporting rules extend the one numbered Reporting list.
For an existing legacy coordination layout, use audit's coordination migration procedure: show removals and content destinations, respect prior explicit migration approval or obtain it, preserve live owner/blocker content on queue items, then regenerate the prompt from recorded answers.
Templates live in this skill's templates/ directory. Read each
template, fill its placeholders from the assessment answers, then
write it into the repo.
Placement (Q12): write AGENTS.md and CLAUDE.md to the repository
root; write everything below under the chosen artefact root (default
.docflow/) — e.g. .docflow/adr/0000-template.md, .docflow/plan/,
.docflow/INDEX.md. Record the chosen root and the chosen assessment
depth in CONVENTIONS.md so every lifecycle skill resolves paths
against the root and later assessments pre-select the recorded depth,
and adjust the adr//plan/ cross-paths in the filled AGENTS.md (and
other templates) to the chosen root (e.g. .docflow/adr/).
Discovery pointer. If the chosen root is anything other than
.docflow/, also write a .docflow file at the repository root
containing the single line root: <path> (root: docs/, root: .) —
the marker external tools use to find the catalogue. Do not write
it when the root is .docflow/ (the directory itself is the marker).
Keep the pointer in sync if a later re-run migrates the root.
CONVENTIONS.md — from templates/CONVENTIONS.md. Spec other files
reference. Record the exact Q8 verify command(s), when supplied, in its
Git Contract; the phrase "verify gate" alone does not identify a command.
Include the §Concurrency Guardrails section only if Q5
is shared checkout or separate worktrees or Q4b is PR-based;
omit it for single-writer direct-to-main repos (no numbering race). Include the §Federation
(multi-repo) section only if Q11 = yes; fill <product> and state
the chosen identity scheme. Omit it for standalone repos.
AGENTS.md — from templates/AGENTS.md. Include the concurrency
guardrails hard-rule bullet (G2–G4) under the same condition as the
CONVENTIONS section above; omit otherwise. Generate the "Picking
up this repo" section from the answers rather than copying the
template list verbatim: keep one line per file this run actually
writes, in read order, with every path resolved against the chosen
artefact root (Q12) — drop the plan/ lines if Q4a skipped the
queue; when the queue exists, include the newest plan/done/
entries and a first-parent git log command as the shipped record;
drop _agent/ROLES.md unless Q5 chose several writers; drop
_agent/LOCKS.md unless Q5 chose a shared checkout; keep the derived
in-flight line — worktrees, remote claim branches, draft pull
requests — in separate-worktree mode and in any pull-request repo,
and drop it elsewhere; and renumber what remains. The section must never name a file this repo does not
have; it is the only read order, and no hand-off file is written.
CLAUDE.md — from templates/CLAUDE.md (single line @AGENTS.md).
adr/0000-template.md — from templates/adr-capability.md.
adr/0000-template-technology.md — from
templates/adr-technology.md, only if Q2 chose two shapes. It ships
with shape: technology pre-filled. Both templates are numbered
0000; no number boundary is chosen and none is recorded, and no
template is written under any other number.
5b. Seed ADR (default on; opt-out at sign-off). Write the seed
adr/0001-record-architecture-decisions.md from
templates/adr-0001-seed.md, filled from the assessment answers — it
records the decision to adopt the documentation-led, ADR-driven
method, status Implemented, and references CONVENTIONS.md for
the rules (it does not duplicate them). Keep it generic — no other
project's ADR numbers. Skip only if the operator opted out. In a
two-shape repo (Q2) the seed stays 0001 and carries
shape: technology. Uncomment that field and swap the body:
delete Capability statement and User stories / scenarios, and
uncomment the Decision / Rationale / Consequences block the seed
template already ships. Do not recast the capability sections —
they have no technology content — and do not leave the capability
headings in place after stamping the field; audit validates section
order from the declared shape, so a field-only uncomment fails the
section check. Adopting the method is a decision about how the repo
is built. Because the shape is declared in the metadata, the
scaffolded conventions need no exception clause for it. If plan/
exists, also write a matching plan/done/<date>-adopt-adr-method.md (the
seed's completion event is this bootstrap), so plan-coverage stays
satisfied. On a retrofit/backfill (Step 6), the seed is 0001, ahead
of the reconstructed decisions.
Seed completion evidence. Keep the complete scaffold atomic; do not split it into an incomplete intermediate tree to make a supplied gate pass. For a direct-integration seed created in that same commit, use this seed-only footer, replacing the path with the actual repository-relative adoption record and quoting it for the host:
Shipped by bootstrap introduction: `<repo-relative done path>`.
Resolve: `git log --follow --diff-filter=A --format=%H -- "<repo-relative done path>"`
After committing, resolve that exact path to one introducing commit. Require it to be reachable and to contain this adoption record, the Implemented seed, its INDEX row and the complete verified scaffold; verify its signature when signing is required. Report the resolved SHA. A generic description such as "the bootstrap commit" is insufficient. If later repairs changed the scaffold, cite the existing verified repair HEAD in a subsequent record commit instead. Never invent a future/self SHA. Ordinary shipped items still name their existing verified implementation tip. Under pull-request integration use the actual pull-request reference; a missing reference or unconfirmed merge remains explicitly unverified.
plan/README.md — from templates/plan-README.md. Create empty
plan/todo/.gitkeep and plan/done/.gitkeep.
6b. GLOSSARY.md — from templates/GLOSSARY.md, only if Q7 enabled the
shared-terms layer. Write the canonical shell (optional heading and
prose, then one Term | Definition table) and the matching §Glossary
section in CONVENTIONS.md. Never overwrite an existing GLOSSARY.md:
leave it for add-convention or audit to extend or offer a migration.
_agent/ — write exactly what Q5, Q8 and Q4a prescribe, and
nothing else. The run prompt is written only when the repo is
eligible for it: Q8 recorded a real verify gate and Q4a kept
the plan/todo/ queue the prompt walks. Fail either and no prompt is
written. The whole set is:
| Q5 answer | _agent/ contents |
|---|---|
| Single writer | prompts/autonomous.md iff eligible (gate + plan queue) — otherwise no _agent/ directory at all |
| Several writers, shared checkout | ROLES.md, LOCKS.md, and prompts/autonomous.md iff eligible |
| Several writers, separate worktrees | ROLES.md, and prompts/autonomous.md iff eligible |
Write no duplicate shipped-state file, no dashboard, no live snapshot
and no hand-off in any mode, and add no .gitattributes union entry
or .gitignore entry for coordination files. There is no template
for any of them: git history, plan/done/, and the live branches and
pull requests are that record.
_agent/ROLES.md — from templates/_agent-ROLES.md, skipped for a
single writer. One section per named writer, naming what each is
the single writer of, from the Q5 answer.
_agent/LOCKS.md — from templates/_agent-LOCKS.md, shared
checkout only. Not written for a single writer, and not in
separate-worktree mode (the pushed claim/<item-key> branch and its
pull request are the claim there).
_agent/prompts/autonomous.md — from its template, only when Q8
names a real gate and Q4a retains the queue. Resolve every artefact path
including _agent/ beneath Q12's root. Keep and uncomment exactly one
mode block: SEPARATE WORKTREES, SHARED CHECKOUT or SINGLE WRITER. Keep
PR START plus PR INTEGRATION only for PR mode; otherwise keep DIRECT
INTEGRATION. Drop the unused blocks and all generation comments.
Single-writer PRs create ordinary work branches; only separate
worktrees acquire claim branches. Shared PR waves require separate
worktrees, while ordinary shared PR work remains serialised. Keep the
item Status, Stop and final Report instructions in every eligible mode.
INDEX.md — header + the seed ADR's row (item 5b); an empty table only
if the seed was declined. Link each row's number or title to the actual
ADR file using a path relative to INDEX. Check that every link resolves
and the row's title, status and date match the file's metadata.
In a two-shape repo (Q2) the table
carries a Shape column, filled from each ADR's shape: field
(blank field → capability); a single-shape repo has no such column.
Neither 0000- template appears in the table — templates are not
decisions.
Federation files — only if Q11 = yes. Place both at the configured artefact root (repository root by default).
federation-index.md (the member index, a
Markdown table) from templates/federation-index.md into this
repo, seeded with this repo as the first member; and write
federation.md from templates/federation-config.md with the
chosen topology, the chosen identity scheme (default repo-prefixed
slug), and this repo's Role set from the topology:
central for A (this repo holds all product-wide ADRs),
coordinator for B (this repo holds only the member index —
product-wide decisions are distributed and the roll-up is the
product-wide view), or home for C (this repo holds
product-wide ADRs; members keep local ADRs alongside). Record the
identity scheme in both files so it is the same on every read.federation.md from
templates/federation-config.md with Role: member, the
confirmed home pointer, and the topology and identity scheme
for the federation, supplied by the operator at join (recorded
into this repo's federation.md; no cross-repo read). Then apply
the topology's member rule: for A, this
repo references the central repo and does not hold product-wide
ADRs locally (its adr/ is for local-implementation decisions
only); for B, this repo owns its own catalogue in full; for
C, this repo keeps local ADRs and references the home for
product-wide ones. Write nothing into any other repo, and do not
create a member index. Tell the user to add this repo to the
index-holding repo's federation-index.md — the home (C),
central (A), or coordinator (B) repo — a deliberate edit there.Commit each file (or logical group) with a Conventional Commit message;
no Co-Authored-By trailer unless Q6 asked for one.
For an existing repo, prefer Edit over Write where files exist, and call out every merge decision in the commit message.
Before claiming bootstrap complete, compare the actual output with the
confirmed answers: root pointer, assessment depth, ADR shape and metadata,
seed and INDEX row, plan queue, coordination files and mode-specific branch
instructions. Confirm the exact supplied gate command appears consistently
in CONVENTIONS.md, AGENTS.md and the autonomous prompt when written.
Run the recorded gate if present and retain its exact output
and exit code. A wrong root, missing requested queue/seed or failed gate is
an incomplete scaffold, not a host limitation. Correct it before reporting.
When the plan layer includes the seed adoption record, also verify its
completion reference as described above. Do not claim complete when the
reference is missing, ambiguous, unreachable or points to an earlier incomplete
scaffold. Preserve the failed observation and report the remaining repair.
Once the scaffolding commit has landed, offer to backfill the ADR
catalogue, the plan folder, and CONVENTIONS.md from the existing
code and git history. Skip this step entirely on a fresh repo.
Tier the offer by the assessment depth. At full, make the offer as phrased below. At guided, ask it as one brief yes/no ("Backfill decision records from the existing history? I'll propose drafts for approval."). At express, do not run it now — close with a one-line pointer instead: undocumented history can be captured later by re-running this skill.
Phrase the offer like this:
The scaffolding is in. Want me to backfill ADRs, plan/done entries, and CONVENTIONS additions from the existing code and commit history? I'll propose drafts; you approve in batches before anything lands.
If the user accepts, run the backfill in four passes. Each pass produces drafts the user reviews before they are committed.
Scan inputs (read-only).
git log --oneline --reverse main (or the default branch) — the
decision and shipped-work trail.README, docs/, design notes, RFCs) — prior
decision records, even informal ones.package.json / pyproject.toml / go.mod etc. — declared
dependencies often map to technology decisions.Propose ADRs. For each distinguishable decision or capability evident from the scan, draft an ADR using the appropriate template.
Implemented (the code already exists), Revision History row
citing the commit(s) that introduced the behaviour.Accepted or Implemented as appropriate,
Rationale section reconstructed from commit messages and code
comments — flag any speculative rationale clearly so the human
can correct it.0001, irrespective of shape. In a
two-shape repo, stamp each draft's shape: field to match the
template it was drafted from. Show the user the proposed list
(number + title + status + one-line scope) before writing files.Propose plan/done entries. For each ADR drafted as
Implemented, generate a corresponding plan/done/<date>-<slug>.md
file using the commit date of the implementing commit (or the
merge commit) as the date prefix. Body: short summary, owning ADR,
"Shipped at HEAD <sha>" footer. Group these into a single
approval prompt — they are mechanical once the ADRs are agreed.
Propose CONVENTIONS additions. Identify patterns in the existing
repo that should be promoted to written conventions: commit-message
style, branch naming, test layout, file-naming rules, language /
tooling choices that are de-facto standards. Draft additions to
CONVENTIONS.md (and corresponding bullets in AGENTS.md §Hard
rules if they should be enforced). Show the diff before applying.
After each pass, commit the approved drafts with a Conventional Commit
(docs(adr): backfill ADRs 0001-00NN from code and history,
docs(plan): backfill plan/done from shipped commits,
docs: backfill conventions from de-facto patterns). Regenerate
INDEX.md after the ADR pass.
Important guardrails.
Re-running to capture a development that bypassed the process. This
backfill is not adoption-only. When a substantial development later lands in
an already-docflow repo without an owning ADR or plan item — a large
feature built ahead of the process — run the same passes again, scoped to
that development: limit the scan (passes 1–3) to its commits and the area
it touched, reconstruct just the decision(s) it embodies as Implemented
ADR(s) (Revision History citing the implementing commits and noting they
were recorded after the fact), write the matching plan/done entries, and
regenerate INDEX.md. A large development is never outside the
catalogue — it is an ADR not yet written. The audit skill's coverage check
surfaces such gaps so they are captured, not silently kept.
Name the scaffold, preserved content, chosen profile/root and any incomplete setup.
An explicit host/tool permission denial stops the affected operation immediately, including receipt export and cleanup. Do not retry through another tool, shell, staging directory, move, archive, symlink or delegate, or probe writes to the denied destination. Report the denied action and destination, actual partial effects and missing permission as stopped/blocked. If recording Status or committing/exporting would cross that boundary, report in the current response and leave persistence pending. Resume only after explicit permission for that action. A gate environment failure is distinct and never overrides a denial.
End every run, including blocked, failed and stopped runs, with a section headed exactly Status at a glance, containing these three labels:
Routine progress messages need no block. Keep final results brief and distinguish work prepared on a PR from work confirmed shipped.
agents/openai.yaml (opens in a new tab)templates/AGENTS.md (opens in a new tab)templates/CLAUDE.md (opens in a new tab)templates/CONVENTIONS.md (opens in a new tab)templates/GLOSSARY.md (opens in a new tab)templates/_agent-LOCKS.md (opens in a new tab)templates/_agent-ROLES.md (opens in a new tab)templates/_agent-prompts-autonomous.md (opens in a new tab)templates/adr-0001-seed.md (opens in a new tab)templates/adr-capability.md (opens in a new tab)templates/adr-technology.md (opens in a new tab)templates/federation-config.md (opens in a new tab)templates/federation-index.md (opens in a new tab)templates/plan-README.md (opens in a new tab)templates/workspace-AGENTS.md (opens in a new tab)templates/workspace-CONVENTIONS.md (opens in a new tab)templates/workspace-INDEX.md (opens in a new tab)templates/workspace-README.md (opens in a new tab)templates/workspace-assets.json (opens in a new tab)templates/workspace-brief.json (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
14 skills in this plugin
/add-conventionAssess and add a CONVENTION (a reusable rule, practice, or naming/process standard) to a documentation-led repo — decides FIRST whether it is worth codifying at all, then routes it to the right home (AGENTS.md hard rule, CONVENTIONS.md guidance, GLOSSARY term, or to /new-adr if it is really a one-off decision). Pushes back on premature or duplicate conventions. Use when the user says "add a convention", "make this a rule", "document this practice", "we should always X", or invokes /add-convention. NOT for recording a single architectural/product decision (use /new-adr) and NOT for queueing work (use /new-plan)./agent-waveRun a bounded wave over the plan/todo queue in a documentation-led repo, using available parallel agents or sequential execution. Establishes width, budget and supervision; isolates work and collects verified outcomes. Use for "spawn a wave of agents", "run the queue in parallel", "fan out the work", or "agent wave", not for authoring a decision or queuing a new item./auditAudit a documentation-led repo against its own conventions — contiguous ADR numbering, INDEX sync, plan/ coverage, required sections, status validity, cross-reference resolution, language mandate, ADR-privacy leaks into user-visible code, cross-worktree collisions (duplicate numbers, duplicate plan ownership, same ADR edited on two branches), and — for a multi-repo product — cross-repo federation checks (bidirectional membership, identity collisions, dangling cross-repo references, roll-up drift, convention drift). Reports a punch list and offers to fix the mechanical issues. Use when the user says "audit the ADRs", "lint the conventions", "check repo consistency", or "are the ADRs in sync".npx claudepluginhub evolvehq/docflow --plugin docflowOther plugins' skills for the same job