harness-bootstrap
Install or sync the generic harness runway in any repo — greenfield or with code present. Scaffolds CLAUDE.md, AGENTS.md (foreign-executor contract), CODING_STANDARDS.md (headings-only), skeleton docs
SKILL.mdplugins/super-bootstrap/skills/harness-bootstrap/SKILL.md
GitHubSuper Bootstrap — Development Pipeline for Any Repo
Set up (or sync) the development pipeline in a project. Installs harness — workflow rules, doc-sync gate, skeleton docs, the core plugin pin — in one scaffold session. The doc-sync gate at every later commit grows the skeleton docs over time, so there's no deferred deep-scan stage.
Designed for a solo developer working across multiple Claude Code sessions and cloud Claude Code.
Phase 1: Quick Scan (lightweight, parallel reads)
Gather just enough to scaffold — skim manifests for stack/version, note structure shape, stop.
Check contributor count (git shortlog -sn --all | head -5). If >1 active contributor, surface as info — don't block:
"FYI: detected multiple contributors. The pipeline's workflow doctrine (
.claude/rules/harness.md) assumes solo dev (simple branching, no PRs for self-review). That file is plugin-owned — state your team's workflow inCLAUDE.mdafter bootstrap if it differs."
Sampling Discipline (applies to all source-file reads)
Throughout this skill — Phase 1 detection, anywhere Claude reads source files — paraphrase structure into committed docs; never paste raw file contents. Skip files whose names suggest secrets (e.g. .env*, *.key, *.pem, id_*, *credential*, *secret*, .npmrc, .netrc, *.p12 / *.pfx, *.keystore, kubeconfig — illustrative, judge by name).
When skipping, surface to user: ⊘ skipped <path> (likely secret).
Reason: reading alone isn't the breach — Claude's context isn't shared. The breach is quoting raw content into auto-committed docs (techstack.md, overview.md): a gitignored secret becomes permanent in git history. Defense lives in the write step. The illustrative list seeds pattern recognition for the skip step; new secret-bearing patterns are judged by name, not table lookup.
Manifest Detection
Detect language/runtime by manifest files at repo root (e.g. package.json, tsconfig.json, pyproject.toml / requirements.txt, Cargo.toml, go.mod, Gemfile, pom.xml / build.gradle, composer.json, pubspec.yaml, CMakeLists.txt / Makefile, *.csproj / *.sln — illustrative, not exhaustive). Don't read fully — skim each for runtime/version, top-level deps, scripts/build commands. Cover unlisted stacks (Bun, Deno, Zig, Elixir, Gleam, etc.) by analogy from the manifest's contents.
Code presence. A manifest, or any source file (e.g. .js / .ts / .py / .go / .rs / .sh — scripts included; illustrative, judge by analogy), sets code present. Neither → docs-only repo: CODING_STANDARDS.md is not applicable, the way monorepo-only sections are on a single-package repo (§ Pipeline-owned): the drift walk skips it and the receipt's covered omits it. It is the one artifact conditional on code presence — the Coding Principles line ships inside the plugin-owned doctrine file (assets/harness.md) on every repo. A re-run that finds code raises CODING_STANDARDS.md as ⊕ new (§ 2a). A CODING_STANDARDS.md an earlier bootstrap placed on a docs-only repo stays as the consumer left it — the walk carries no removal path.
Quick Structure
lsroot directory- Check for:
docs/,README.md,CLAUDE.md,.claude/, monorepo indicators - Note existing doc structure (don't read docs deeply yet)
Monorepo detection
Check the repo root for a workspace manifest — the marker that one root hosts multiple packages (e.g. pnpm-workspace.yaml, turbo.json, nx.json, lerna.json, a package.json carrying a "workspaces" field, Cargo.toml with a [workspace] table — illustrative, judge by analogy). Present → set monorepo tier.
On monorepo tier, enumerate packages from the workspace globs (apps/*, packages/*, etc. — read the actual globs from the manifest, don't assume the layout). Each resolved directory with its own manifest is a package; record { name, path, role, build command } per package for the Phase 2b techstack.md § Packages table rows (§ 2b) and the CLAUDE.md monorepo block.
Rule-signal detection (below) then fans out per package — one path-scoped rule carries the whole boundary, no nested CLAUDE.md needed.
No workspace manifest → single-package repo; skip, everything stays root-scoped.
Existing CLAUDE.md
Read the repo's state off the files present, never off a version. The owned headings are the ## lines of assets/harness.md, read at run time. If CLAUDE.md exists, read it and match its ## lines against them — a line matches when the whole line equals an owned heading, CR aside.
- fresh — no
.claude/rules/harness.md, andCLAUDE.mdis absent or holds fewer than two owned headings → Phase 2 places the doctrine file and seedsCLAUDE.mdwhen the repo has none (a hand-writtenCLAUDE.mdstays as it is). - split —
.claude/rules/harness.mdexists → Phase 2 runs the whole-file lane on it (current / stale / fork, perassets/hooks-ensure-infra.md). - legacy — no
.claude/rules/harness.md, andCLAUDE.mdholds two or more owned headings → leave Phase 1 here and run § Doctrine migration, which is the whole of this run: no later Phase 1 lane, no Phase 2, no Phase 3.
Fresh install / re-run. This state is the run's one signal for it: wherever a later step says fresh install (or fresh repo, first run) it means a run that read fresh here, and re-run means a run that read split. Git history sets neither.
On fresh and split, with a CLAUDE.md present, also note skeleton blocks in it — content that belongs in a path-scoped rule, a docs/techstack.md grown section or docs/decisions.md (Coding Standards code-block walls, framework-specific pattern lists, closed design rationale, large Project Structure trees) — these become migration candidates, routed by § 2b Skeleton-block migration.
Rule-signal detection
Phase 1 also flags which .claude/rules/*.md files Phase 2b should seed. Signals (illustrative — judge by analogy):
- Frontend component dir detected (e.g.
src/components/,src/pages/,app/,components/) + framework manifest (React / Vue / Svelte / Angular / Solid) → seedrules/<framework>.mdfromassets/rules-frontend-skeleton.md. - Chrome MV3 manifest (
manifest.jsonwith"manifest_version": 3+service_workerfield) ORsrc/background/dir → seedrules/mv3.mdfromassets/rules-mv3-skeleton.md. - Migrations dir (
migrations/,db/migrate/,prisma/migrations/) → flagrules/migrations.mdfor body-fill via doc-sync (machinery-only seed at scaffold). - Tests dir with non-trivial structure (
tests/,__tests__/,*.test.*patterns) → flagrules/tests.mdfor body-fill via doc-sync.
On monorepo tier (§ Monorepo detection), each signal is evaluated per package, not root-only, and a fired signal's seeded glob is package-scoped (apps/*/src/components/**) so one rule file spans every package that shares the pattern.
ECC-first seed source for language-scoped rules. Before scaffolding from local assets/rules-*-skeleton.md, check ECC (gh api repos/affaan-m/everything-claude-code/contents/rules) for a matching language/framework rule. If ECC ships one, propose seeding from ECC (with attribution comment + license note) — defer to specialists. Local skeletons are the fallback. Cross-cutting / project-specific rules (e.g. MV3, custom service-worker patterns) stay on local skeletons. Skeleton seeding only — a rule file § 2b's Skeleton-block migration writes carries the consumer's own content and takes no ECC check.
Adjacent stacks (Bun + Next, Deno + Fresh, Tauri + React, etc.) infer by analogy. Unknown stacks → skip rule-seeding for that signal; user can add later.
Output of Phase 1: A mental model of "what kind of project is this" — stack name, structure shape, maturity level, the state (fresh / split / legacy, § Existing CLAUDE.md), which rule files to seed in Phase 2b, which CLAUDE.md skeleton blocks need migration. NOT a deep analysis.
Greenfield (no seed docs)
The generic runway runs on greenfield. If Phase 1 detects a docs-only repo (§ Code presence — no manifests + no source files) whose docs/overview.md / docs/techstack.md are also missing, scaffold normally and write overview.md / techstack.md as empty skeletons in Phase 2b. The entry /super-bootstrap:setup seeds GAP cards against those empty skeletons and surfaces the gate.
When docs/overview.md + docs/techstack.md already carry substantive content, manifest facts and existing content feed the Phase 2b skeletons normally.
Rot signals (harnessed-but-stale)
Catches "harness installed but carries renamed-away literals" — re-run is the right entry, flag before Phase 2b churns through migrations.
Trigger, on a re-run only (a fresh install runs no rot scan, § 2b): any file in § 2b's rot-scan scope — every pipeline-owned file in scope (§ Pipeline-owned) and CLAUDE.md, minus the files that scan skips (.claude/rules/harness.md, any dimension: history file); one scope, so rot_hits[] agrees with what 2b re-scans — contains a literal listed as old in assets/rename-map.md. Detect it with § 2b's rot-scan.sh call over that scope; one hit line is enough. A run that fails (§ 2b's no rot scan causes) answers nothing here — it is not "no rot".
When the trigger fires, surface ONCE up front (single message, not a redirect — re-run is the correct entry point):
Renamed-away literals detected in the files the rot scan covers.
Phase 2b will propose migrations alongside the normal drift check.
Affected files: {list of files where rot was observed}.
Continue? (y / dry-run report only)
If user answers dry-run, walk Phases 1–2b without writing — render the sync report (per-section listing + rename-map migration rows) inline without persisting .claude/bootstrap-sync-report.md, then exit. Otherwise proceed normally; Phase 2b's rot scan (see § 2b) handles the actual migrations.
Output of Phase 1 (rot lane): record rot_hits[] — the affected-files list the trigger message renders. § 2b re-derives the full scan itself for its row-writing pass; the two agree by sharing one scope and one instrument (rot-scan.sh), not by passing hits between phases.
Fact-staleness signal (detected facts vs last run)
This lane asks whether the facts the receipt was written against still hold. The receipt records what the last sync saw: covered omits CODING_STANDARDS.md on a docs-only run (§ Code presence), so a covered list lacking it says the last sync ran against a repo with no code.
Set facts_stale when both hold:
- the receipt exists, its
coveredis present and non-empty, andcoveredlacksCODING_STANDARDS.md - this run's § Code presence reads code present
Every other state leaves it unset: no receipt (fresh install — the facts seed this run), a legacy version-only stamp with no covered (coverage unknown, nothing to compare against), a docs-only repo still docs-only, or a repo whose last run already saw code.
Bound. The receipt records no manifest identity, so this delta keys on the code-presence transition alone. A manifest that changed, moved, or was added beside an existing one on a repo the last run already read as code-present raises nothing here.
Detected here, materialized at § 2b: the flag rides the sync report, not context. When set, § 2b's enumeration appends one facts: row to .claude/bootstrap-sync-report.md — facts: stale — last sync docs-only, code present now · manifest {file, or "none"} · runtime {runtime + version, or "none"} · framework {framework, or "none"} — beside the rot rows, and Phase 3 prints its advisory from that row alone (§ Phase 3). The receipt shape and the § 2c set-difference are unchanged: the row is a print source, not a coverage claim.
Output of Phase 1 (facts lane): record facts_stale, and with it the facts this run detected — manifest file name, runtime, framework (§ Manifest Detection), each "none" where detection found nothing, as when code present rests on source files alone with no manifest — for § 2b to write as the facts: row.
The runway scaffolds with no product Q&A. Drift on existing files is resolved inline per-section at Phase 2b.
Doctrine migration (legacy state only)
Moves the plugin's workflow sections out of a legacy CLAUDE.md onto the placed doctrine file, as one commit. It writes no sync report and runs no other lane of this skill.
Sorting the old lines (step 2) is your judgment and differs run to run. The confirm (step 4) and the four checks (step 6) are the floor: report the migration done only on their output.
Stop and ask on a case these steps do not cover. Write nothing further and state three parts: what you observed, what this section expected, the options. Examples of such cases: CLAUDE.md pulls the workflow sections in through an @path import; the owned headings sit in a nested or second CLAUDE.md; a harness.md of the repo's own sits under another path; CLAUDE.md or a file step 3 names carries uncommitted changes; the repo has no commit.
Run every command below with the Bash tool from the repo root. $M is the scratch directory step 1 prints: shell variables do not carry between tool calls, so set M=<that path> at the head of each later command.
1. Baseline — before any write
M=$(mktemp -d) && echo "$M"
git status --porcelain -- CLAUDE.md
git show HEAD:CLAUDE.md > "$M/old.md"
bash "${CLAUDE_PLUGIN_ROOT}/skills/commit/assets/doc-links.sh" check > "$M/links.before" 2>/dev/null; true
Done when git status printed nothing and $M/old.md holds the committed CLAUDE.md. $M sits outside the worktree; the repo is still unwritten.
2. Sort every line of the old file
Read assets/harness.md (the shipped doctrine) and assets/claude-md-skeleton.md (the project sections). Walk $M/old.md whole — the lines above its first ## heading, then every ## section — and put each non-blank line, headings included, in exactly one class:
| Class | The line is | Outcome |
|---|---|---|
| shipped | equal to a line of assets/harness.md, leading and trailing whitespace and link targets aside |
arrives with the placed file |
| old plugin text | plugin wording the shipped file replaces: an earlier wording of a shipped line, or a line of a section or heading an earlier plugin version shipped and this one retired | the drop list |
| the repo's own | a rule this repo added inside a workflow section, or its deliberate fork of a shipped line | kept — moves to the additions section (step 5) |
| project | above the first ## heading, or in a section whose heading is in the skeleton's ## set, or in a section this repo authored under a heading of its own |
stays where it is, as written — also where the skeleton words the same line differently |
Between old plugin text and the repo's own, the content decides: a line stating a fact of this repo (its branches, release steps, tools, paths) is the repo's own; generic workflow wording on a subject a shipped line covers is old plugin text. git log -S'<line>' --oneline -- CLAUDE.md naming a bootstrap-shaped commit (§ 2b, every spelling) as the commit that introduced the line supports old plugin text; it does not settle it. A line you cannot place between those two classes is an open question in step 4.
Done when the four class counts plus the open questions sum to the output of grep -c '[^[:space:]]' "$M/old.md".
3. Find what leans on the moved sections
A moved section is a section of the old file that loses its heading in step 5. Run git grep -n -I -F 'CLAUDE.md' -- . ':!CLAUDE.md' and give every hit one outcome:
- Link into
CLAUDE.md#<anchor of a moved section>→ re-point at.claude/rules/harness.md#<anchor>, the path written relative to the linking file, and rewriteCLAUDE.mdin its display text to.claude/rules/harness.md([`CLAUDE.md` Doc Sync](../CLAUDE.md#doc-sync-non-negotiable)→[`.claude/rules/harness.md` Doc Sync](../.claude/rules/harness.md#doc-sync-non-negotiable)). Re-point it wherever it sits — a link left behind breaks. The shipped file has no heading for that anchor → open question. - Prose naming a moved section by heading (
CLAUDE.md § Doc Sync) in a doc, rule or hook → a proposed edit naming.claude/rules/harness.md. No edit where the regular sync or nobody owns the text: a part § Pipeline-owned lists (a listed section or preamble — the file's other sections take the edit), or a file whose frontmatter declaresdimension: history. - The receipt (
.claude/super-bootstrap-runway.json) → no change here; step 5 item 4 writes it. - Anything else → no change.
Then run git status --porcelain -- .claude/super-bootstrap-runway.json {each file holding a re-point or a proposed edit}. Any output is an uncommitted change step 6's restore would discard → stop and ask.
Done when every hit carries one of: re-point, proposed edit, open question, no change, and that git status printed nothing.
4. Confirm — one delta list, before any write
Save the drop list — every old-plugin-text line, verbatim, one per line (an empty list → an empty file):
cat > "$M/drop.txt" <<'DROP_LIST_END'
{old line}
DROP_LIST_END
Then print one message holding, in order:
- Kept as additions — each kept line, with the doctrine section and the line it adds to or takes over: the shipped line it extends or replaces, or the section alone when it stands beside no single line.
- Drop list — the content of
$M/drop.txtinside one fenced code block. It is the message's only fenced block; every other part is a plain list. An empty drop list printsDrop list: noneand no fence. - Re-pointed links —
file:line, old target → new target. - Other edits —
file:lineand the proposed text. - Open questions — the line, the two classes it sits between, and what a bare
ydoes with it: it is kept.
A part with nothing in it prints none. The message's final line is exactly:
Migrate CLAUDE.md onto .claude/rules/harness.md? (y / n)
y→ step 5, open questions kept as additions.n, or nobody can answer (an unattended run) → write nothing and end the run on that message.- An answer that moves a line between classes or changes an edit → rebuild
$M/drop.txtand the lists, print the message again, ask again.
Done when the fenced block and $M/drop.txt hold the same lines and the user answered y to that message.
5. Write the split
Place the doctrine file whole, no edit:
mkdir -p .claude/rules && cp "${CLAUDE_PLUGIN_ROOT}/skills/harness-bootstrap/assets/harness.md" .claude/rules/harness.md.Rewrite
CLAUDE.md. Remove every shipped, old-plugin-text and kept line, and each heading left with no line under it. Leave every project line as it is. Under the H1, add the skeleton'sWorkflow doctrine — …line (assets/claude-md-skeleton.md) when the file lacks it. When any line is kept, add this section below that line:## This repo's additions to the harness doctrine These lines bind in this repo together with `.claude/rules/harness.md`; where one takes over a doctrine line, it wins here. **§ {doctrine section heading}** — added to "{leading words of the doctrine line}": {kept line or lines} **§ {doctrine section heading}** — takes over "{leading words of the doctrine line}": {kept line or lines}A kept line that stands beside no single doctrine line takes the label
**§ {doctrine section heading}** — added:. Carry each kept line whole and unreworded under its label line — the line-coverage check looks for the old line itself.Apply step 4's re-pointed links and other edits.
Receipt — when
.claude/super-bootstrap-runway.jsonexists; an absent receipt stays absent, and the regular sync writes it. Where it holdscovered: remove eachCLAUDE.md § {heading}row whose heading the newCLAUDE.mdlacks (arot:row stays), remove thedeclinedentry of each removed row, add the bare string.claude/rules/harness.md(a whole-file row's identity is its path). In every receipt that exists — withcoveredor holding onlyversion— setplaced[".claude/rules/harness.md"]to the output hash oftr -d '\r' < .claude/rules/harness.md | sha256sum. Change no other key; keep the file LF-only (§ 2c Receipt write).
Done when each item that applies is written and you hold the list of every path this step wrote.
6. Check — four checks, each to its pass condition
A="${CLAUDE_PLUGIN_ROOT}/skills/harness-bootstrap/assets"
# 1 — the placed file equals the shipped one, CR aside. Pass: prints `same`.
cmp -s <(tr -d '\r' < .claude/rules/harness.md) <(tr -d '\r' < "$A/harness.md") && echo same
# 2 — CLAUDE.md holds no owned heading. Pass: prints nothing.
tr -d '\r' < "$A/harness.md" | grep '^## ' > "$M/owned"; tr -d '\r' < CLAUDE.md | grep -Fxf "$M/owned"
# 3 — no old line lost. Pass: exit 0 and a `line-coverage: N lines — …` line.
bash "$A/line-coverage.sh" "$M/old.md" CLAUDE.md .claude/rules/harness.md "$M/drop.txt"; echo "exit $?"
# 4 — no new broken link in the doc surface. Pass: the last command prints nothing.
bash "${CLAUDE_PLUGIN_ROOT}/skills/commit/assets/doc-links.sh" check > "$M/links.after" 2>/dev/null
for f in before after; do sed 's/^\([^:]*\):[0-9]*:/\1:/' "$M/links.$f" | sort -u > "$M/links.$f.s"; done
comm -13 "$M/links.before.s" "$M/links.after.s"
Check 4's script reads the doc surface (docs/, READMEs, declared globs), not CLAUDE.md and not files outside that surface. Read those links yourself: every markdown link in the new CLAUDE.md, and every link step 5 re-pointed in a file outside the doc surface. Each passes when its path exists relative to the linking file and its #anchor, where it has one, is a heading of the target. A link $M/old.md already carried with the same broken target is not this migration's: it passes here, and the closing message names it.
A failing check → repair the file it names and run all four again. A check you cannot make pass → restore, then stop and state the check's output, its pass condition, and the options:
git checkout HEAD -- {each tracked path step 5 wrote}
rm .claude/rules/harness.md
git status --porcelain -- CLAUDE.md .claude/rules/harness.md {each path step 5 wrote} # restored when this prints nothing
Done when the four commands and your own link read all pass on the same tree.
7. Commit, then end the run
Commit exactly the paths step 5 wrote through /super-bootstrap:commit, message refactor: migrate CLAUDE.md onto .claude/rules/harness.md. Nothing else rides in that commit, so one git revert undoes the migration and only the migration. Then print, with the commit's sha, and end the run:
CLAUDE.md migrated. The workflow doctrine now loads from
.claude/rules/harness.md(plugin-owned, re-placed whole on re-run);CLAUDE.mdholds this repo's own sections. Undo:git revert {sha}. This run wrote the migration only — run/super-bootstrap:harness-bootstrapagain for the regular sync.
Phase 2: Scaffold / Sync
Walk each pipeline artifact in order: folders → pipeline docs → sync report + commit. Same flow on fresh and re-run repos — fresh just sees "all new" at every step.
Per-artifact rule (applied uniformly in 2a / 2b):
- Missing → write from template / curate fresh
- Exists, matches template → skip (
✓ current) - Exists, drifted from template → show diff, get approval per change, then write
- Exists, pipeline-owned section absent →
⊕ new— show the template section, get approval, insert - Whole-file plugin-owned (
.claude/rules/harness.md) → placed and re-placed whole by § 2a-hooks, never diffed per section - Project-owned content → never touch, even on drift
Registration rule (2a / 2a-scale / 2b plantings, 2a-scale / 2b-adopt / 2b Retired artifacts deletions): a durable artifact this run places for the first time or deletes earns its own sync-report row — status ⊕ new for a planting, ⊘ removed for a deletion:
registration: {artifact} → {surfaces, or none}
{surfaces} names the consumer-authored surfaces that enumerate the artifact's class — a table or list carrying one entry per member (a glob that already covers the artifact needs no edit and is not a surface; a curated shortlist of a few files is not an enumeration). Grep each of five places for the artifact's path and for its parent directory string (docs/, .claude/skills/), and name every place whose hit is such a list:
.claude/rules/*.mdpaths:frontmatter entries that name paths literally- root
README.md— any table or list namingdocs/paths docs/**/README.mdanddocs/overview.md§ Module Index.claude/rules/*.mdbodies — any table or list namingdocs/paths (ownership / routing)CLAUDE.md§ Rules (one bullet per path-scoped rule file) and § Planning (one index line per doc) — project-owned registration surfaces, where the section exists. Planting → append the artifact's bullet / index line at the end of the section's list when the section holds none for it; move or deletion → re-point or drop that artifact's own line. The run touches only the line of the artifact the row names and rewrites no other line
The row resolves updated once every named surface is edited, before § 2c runs, in the same commit — or none, earned only when all five greps return nothing. An unresolved row halts § 2c like a drifted one. The 2a-hooks step sits outside this rule, scripts and .claude/rules/harness.md included: the .claude/settings.json and .gitignore entries that step already writes are its registration.
Pipeline-owned (subject to drift check):
.claude/rules/harness.md— the plugin's workflow doctrine, a whole file: placed and resolved current / stale / fork byassets/hooks-ensure-infra.md(§ 2a-hooks), never diffed per section; its report row is § 2a-hooks'sdocs/techstack.mdskeleton sections: Runtime, Framework, Key Dependencies, Build & Distribution (seed-once — mechanics at § 2b; stale facts route to the Phase 3 advisory, § Fact-staleness signal), Edit Discipline (fixed prose — body drift-checked against the template), Staged-Tree Verify (the § header + its note drift-checked against the template; the command block below the note is consumer-declared, project-owned, never diffed), Packages (monorepo tier only — the § header + column shape; table rows are consumer-grown, project-owned)docs/overview.mdskeleton sections: Problem, User, Current State (seed-once — the body is filled at GAP card pickup, mechanics at § 2b)docs/techstack.md,docs/overview.mdpreamble (the H1 + the blockquote under it, above the first##heading — drift-checked against the skeleton's, a link's display text included; report row{file}: preamble, identity{file} § preambleby § 2c's transcode rule, anchor the skeleton's rendered H1 + blockquote)docs/decisions.mdscope header (the blockquote +## Closed Forksheading)docs/terminology.mdscope header (the H1 + blockquote + example-entry comment, drift-checked againstassets/terminology-skeleton.md)CODING_STANDARDS.mdpreamble + section headings (code present only; drift checked againstassets/coding-standards-skeleton.md)docs/work/README.md,docs/work/TEMPLATE.md— whole files, drift-checked against their skeletons. A consumer's**ID high-water mark:**line (here, and in the scale module'sdocs/outward/README.md+docs/parked.md) is a retired counter — IDs come from/super-bootstrap:log's generator — so it drifts against the skeleton: the drift row replaces it with the skeleton's ID-shape text at the same spot (docs/work/README.md's**ID shape:**line; the outward README's## ID conventionparagraph;docs/parked.md's**ID convention:**line), never re-plants or resets the counter. Existing numeric IDs stay valid and are never renamed.claude/rules/index.md(rule-authoring guide).claude/rules/ssot-doc-link.md,.claude/rules/dimension-discipline.md(doc-authoring rules — always placed; drift-checked againstassets/rules-ssot-doc-link-skeleton.md/assets/rules-dimension-discipline-skeleton.mdon the whole shipped file minus itspaths:tail — the skeleton's ownpaths:entries, the rest of the frontmatter and the body;paths:entries after the skeleton's last one are consumer-owned, § Project-owned).claude/rules/<seeded>.mdskeleton bodies (drift checked againstassets/rules-*-skeleton.md).claude/settings.jsoncore plugin pin and language-server pins (enabledPlugins,extraKnownMarketplaces) — core pin drift-checked for presence alone (§ 2a); language-server pins resolve by § 2b Language-server pins.claude/super-bootstrap-runway.json(runway coverage receipt — not diffed section-by-section; read at Phase 1 § Fact-staleness signal, § 2a-hooks and § 2b Language-server pins, written at § 2c Receipt write; durable, no cleaner)- Scale module — checked only when installed (detected by
docs/parked.mdpresence):docs/parked.md+docs/test-queue.mdheader/shape sections,docs/outward/README.md+docs/outward/TEMPLATE.md(whole files, the waydocs/work/README.md/docs/work/TEMPLATE.mdare — a retired high-water line drifts to the skeleton's ID-shape text, above), thedocs/work/README.mdfact-fields marker block (<!-- scale-module: fact fields -->…<!-- /scale-module -->)
Project-owned (never touched):
CLAUDE.md— the whole file: seeded once fromassets/claude-md-skeleton.mdwhen the run finds none (§ 2b; placeholders per § 2b Placeholders), consumer-edited from then on, never drift-diffed. The run's only later writes are registration lines in § Rules / § Planning (§ Registration rule) and a placed doc rule's own § Rules bullet, rewritten on that bullet's approved row (§ 2b Per-doc handling); a legacy-state file is rewritten once, on the user's confirm, by § Doctrine migration.claude/rules/ssot-doc-link.md,.claude/rules/dimension-discipline.mdpaths:tail — the entries after the skeleton's lastpaths:entry (a consumer adds one to fire the rule on a folder its.claude/doc-surfacedeclares — Phase 3 § Doc-rule coverage)docs/techstack.mdgrown sections: Architecture Rules, Coding Patternsdocs/overview.mdgrown sections: Module Index, Data Flow, Key Boundariesdocs/decisions.md§ Closed Forks table rows (consumer-filled history)docs/terminology.mdentries (**Term**:+_Avoid_:lines below the header — consumer-registered)CODING_STANDARDS.mdsection content (consumer-authored by hand when a convention settles — the file sits outside the doc-sync surface).claude/rules/<rule>.mdgrown sections (additions the user/doc-sync added below the skeleton scaffold).claude/rules/<rule>.mdfiles the user authored without a matching skeleton (treat as fully project-owned)- Scale-module container content —
docs/parked.md## Entries+## Sweep logcontent,docs/test-queue.md## Pending/## Failed (re-queued for fix)rows, thedocs/outward/OUT-*.mdentry files (consumer-filled, like card content; only the skeleton headers/shape stay pipeline-owned) docs/extensions.md— the consumer's additions to skeleton-owned containers (card, parked-entry, outward-entry fields), which those containers' contracts point to; consumer-created, never seeded, never drift-checked- Other settings in
.claude/settings.jsonoutside the plugin-pin keys
2a: Folders & core plugin pin
Folders + the core plugin pin don't drift — only two states: missing or present.
Migrate before creating — docs/superpowers/ → docs/work/. Repos bootstrapped
before the rename hold their temporal specs and plans under docs/superpowers/. Creating
docs/work/ beside it would strand that work: every scan below — /super-bootstrap:needs-me,
/super-bootstrap:autorun — reads the new path only, so the old tree goes invisible
while still sitting in the repo. When docs/superpowers/ exists, git mv it to
docs/work/ first, then continue. If both exist, move the old tree's contents in
directory by directory and leave anything that would overwrite a file already at the
destination — report those paths rather than resolving them.
Always created (fixed macro):
docs/
decisions.md ← closed forks / rejected directions (history dimension — always scaffolded, starts empty)
terminology.md ← the project's term home: one canonical word per concept (always scaffolded, starts with no entries)
specs/ ← feature specs, one .md per feature, no index file (empty + .gitkeep; files land at the spec-seeding card's pickup — `/super-bootstrap:setup` seeds it on a code-present repo)
work/
README.md ← work-unit workspace header: contract, categories, ID shape
TEMPLATE.md ← copy-to-create card template
.claude/
rules/ ← path-scoped rules, full-body fires on file match
index.md ← rule-authoring guide (path-scoped — loads when editing rules)
ssot-doc-link.md ← link each concept to its SSOT home on the asserting line (fires on prose docs)
dimension-discipline.md ← classify a prose doc state vs history before editing (fires on prose docs)
For each: create if missing, skip if present. Add .gitkeep in empty folders. If docs/ or .claude/ already exists, nest alongside. Report status per directory.
Code present only (Phase 1 § Code presence — scaffold rule below):
CODING_STANDARDS.md ← repo binding conventions (headings-only scaffold; sections hand-recorded as conventions settle)
docs/decisions.md is always scaffolded — copy assets/decisions-skeleton.md to docs/decisions.md if missing (no substitutions). Starts empty (header + ## Closed Forks table).
docs/terminology.md is always scaffolded — copy assets/terminology-skeleton.md to docs/terminology.md if missing (no substitutions); a re-run on a repo that lacks it backfills it as ⊕ new. Starts with no entries (header + a commented example entry); the project registers terms as they settle.
Copy assets/work-readme-skeleton.md to docs/work/README.md if missing (no substitutions). Copy assets/work-template-skeleton.md to docs/work/TEMPLATE.md if missing (no substitutions).
CODING_STANDARDS.md is scaffolded when code is present (Phase 1 § Code presence) — copy assets/coding-standards-skeleton.md to the repo root if missing (no substitutions); a docs-only repo takes no file, and a later re-run that finds code raises it as ⊕ new. Starts headings-only; its preamble states the fill contract and the three-way routing (binding + ambient here, binding + path-scoped → .claude/rules/<scope>.md, descriptive → docs/techstack.md § Coding Patterns).
.claude/rules/ machinery is always scaffolded. index.md is seeded from assets/rules-index-skeleton.md. The two doc-authoring rules the doc-sync gate rests on are always placed — copy assets/rules-ssot-doc-link-skeleton.md to .claude/rules/ssot-doc-link.md and assets/rules-dimension-discipline-skeleton.md to .claude/rules/dimension-discipline.md if missing (no substitutions). Their paths: cover the built-in doc surface only; a repo's declared surface is the consumer's tail to add, checked at Phase 3 § Doc-rule coverage. Signal-seeded rule bodies fill in Phase 2b based on Phase 1 signal detection.
Core plugin pin. The doctrine file (.claude/rules/harness.md) routes every door through /super-bootstrap:* and the committed commit-channel.sh deny text routes workers to /super-bootstrap:commit, so the project pin declares that dependency to every clone. Declaring is not installing: on a machine that has not installed the plugin, the pin registers its marketplace once the workspace is trusted, and the plugin loads after claude plugin install super-bootstrap@super-bootstrap runs there (--scope project for that clone, --scope user for every project). A cloud session loads no repo-declared plugin. The pin lives outside the official marketplace, so its extraKnownMarketplaces entry is required.
Ensure .claude/settings.json contains:
{
"enabledPlugins": {
"super-bootstrap@super-bootstrap": true
},
"extraKnownMarketplaces": {
"super-bootstrap": {
"source": { "source": "github", "repo": "RockyHong/super-bootstrap" }
}
}
}
- File missing → create with this minimal shape.
- Key already present → skip (
✓ pinned), whatever its value. - Core-pin key absent → merge it in.
- Other
.claude/settings.jsoncontent → never touched.
2a-hooks: Harness hooks (default-on)
Three hook assets ship as frozen files and install unconditionally — no
opt-in confirm (rationale + full procedure:
assets/hooks-ensure-infra.md).
| # | Asset | Fires on | Effect |
|---|---|---|---|
| 1 | commit-channel (PreToolUse) |
Bash(git *) and PowerShell(git *) — one hook element per command tool, each a bare-command pre-filter; the script narrows to real git commit, git merge --continue and git rebase --continue |
Deny those three verbs from worker subagents — deny text routes the worker back to /super-bootstrap:commit; main session and separate-process workers pass |
| 2 | consult-check-sessionstart (SessionStart) |
startup|resume|clear|compact |
Derives the compact docs/** catalog into the gitignored .claude/.consult-catalog cache, once per session boundary |
| 3 | consult-check-check (UserPromptSubmit) |
every prompt | Injects the catalog + a forced relevance evaluation (judge which docs bear on the prompt, Read each that does; no stated verdict) — the read boundary's activation layer: the right project docs get read at the prompt moment (pure cache read; installs as a pair with #2) |
Execute the procedure in assets/hooks-ensure-infra.md; stage the placed files with the Phase 2c commit.
Doctrine file. The same procedure places assets/harness.md at .claude/rules/harness.md (its fourth whole-file asset — whole, no substitution) and resolves it by Phase 1's state: fresh → placed; split → current (no write), stale (silent re-copy) or fork (the overwrite / keep prompt naming the file).
Report rows. Each check writes one row to .claude/bootstrap-sync-report.md — ✓ current included — its verdict → resolution as the procedure words it; an absent snippet or .gitignore line takes ⊕ new → seeded, a replaced snippet ⚠ drifted → updated:
- one row per script, identity its destination path —
.claude/hooks/commit-channel.sh,.claude/hooks/consult-check-sessionstart.sh,.claude/hooks/consult-check-check.sh - one row for the doctrine file, identity
.claude/rules/harness.md - one combined row for the three settings snippets —
.claude/settings.json hook snippets, verdict the most-changed across them (⚠ driftedover⊕ newover✓ current) - one row for the
.gitignoreline —.gitignore consult-catalog line
§ 2c transcodes these rows into covered like whole-file rows. The doctrine-file row is in the § 2c gate's required coverage set (§ Pipeline-owned lists the file); the script, snippet and .gitignore rows sit outside it.
2a-scale: Scale module (opt-in, earn-gated)
The scale module adds work-substrate-adjacent runway — a parked-items artifact, a manual-verification queue, and an outward folder (one thread file per item the author or an outside party moves, the repo owning only the result tail) — for repos whose card set has outgrown simple scanning. Earn-gated: offer only when a signal shows the repo has grown into it, silent skip otherwise (no prompt spam on small repos).
Signals — any one arms the offer:
- Card files (
{BUG|DEBT|GAP}-*.md) indocs/work/≥ 10. - Autorun worktree infra installed (
.claude/worktrees/gitignore present). - User asked for it.
None hold → skip the offer silently, place nothing. Already installed (docs/parked.md present) → no offer either; § 2b's drift check owns the members, a missing one resolving Missing → write.
Split before placing — docs/outward.md → docs/outward/. Repos that took the scale module before the folder shape hold every outward item as an ### OUT-### chunk in one flat file. Placing docs/outward/ beside it strands those entries: /super-bootstrap:log's dedup and the mover gate read the folder, and the board only carries the flat file on a legacy branch that draws a # note: every render. When docs/outward.md exists — keyed on that file alone, whatever the signals or install state — run the split first, then continue with this step's placements:
python3 ${CLAUDE_PLUGIN_ROOT}/skills/harness-bootstrap/assets/scale/split-outward.py <repo root> ${CLAUDE_PLUGIN_ROOT}/skills/harness-bootstrap/assets/scale/outward-readme-skeleton.md
Deterministic, no per-item judgment (output shape: the script's docstring). It refuses (exit 2, nothing written) when any target file — docs/outward/README.md or an OUT-###.md it would create — already exists: the two shapes then coexist, so stop this sub-step — surface the flat file's entry list beside the folder's for the user to reconcile, write no split registration rows, and continue the sync; never treat exit 2 as a converted repo. A repo with no docs/outward.md is already on the folder shape and the placements below resolve ✓ current. The split writes docs/outward/README.md from template, so its row takes ⊕ new, resolution seeded, and neither the placement below nor § 2b's walk re-verdicts it this run. The split moves a durable artifact, so it earns two § Registration rule rows — registration: docs/outward.md → {surfaces} (⊘ removed) and registration: docs/outward/ → {surfaces} (⊕ new), folder-grain, not one per OUT-###.md — and every consumer surface naming the flat path re-points to docs/outward/README.md, CLAUDE.md § Planning's outward line included (a registration surface — § Registration rule).
When armed, ask once:
Install the scale module? —
docs/parked.md(deferred items with named triggers) +docs/test-queue.md(manual-verification queue) +docs/outward/(outward threads — next move + waiting-on party, one file per item) + card fact-field guidance. Install now? (y / skip)
On y, place the five assets/scale/ skeletons per Phase 2's per-artifact rule (all copy verbatim — no substitutions):
parked-skeleton.md→docs/parked.mdtest-queue-skeleton.md→docs/test-queue.mdoutward-readme-skeleton.md→docs/outward/README.mdoutward-template-skeleton.md→docs/outward/TEMPLATE.mdcard-fact-fields.md→ insert its marker-delimited block (<!-- scale-module: fact fields -->…<!-- /scale-module -->) intodocs/work/README.mddirectly above the## Thread contractheading. Markers already present → the block is placed; § 2b's drift check judges its content against the asset (§ Pipeline-owned), so a re-run updates a stale block there, on approval.
Stage the placed files with the Phase 2c commit. A placed .claude/rules/venue-map.md from an earlier module version is retired: propose its deletion as a ⊘ removed registration row, its CLAUDE.md § Rules bullet among that row's surfaces (§ Registration rule).
On skip: nothing placed; a re-run re-offers while a signal holds.
2b: Pipeline docs
Walk each pipeline doc and apply the per-artifact rule. Sources:
| Asset | Destination | Notes |
|---|---|---|
assets/claude-md-skeleton.md |
CLAUDE.md (project root) |
Seed-once — written only when absent; a present file takes registration lines and a placed doc rule's approved § Rules bullet rewrite alone (per-doc handling below) |
assets/techstack-skeleton.md |
docs/techstack.md |
Grown sections absorb migrated CLAUDE.md state-dimension content (Architecture Rules: still-binding decisions; Coding Patterns: examples) |
assets/overview-skeleton.md |
docs/overview.md |
Always |
assets/decisions-skeleton.md |
docs/decisions.md |
Always |
assets/terminology-skeleton.md |
docs/terminology.md |
Always — term home (entry shape, _Avoid_ alias list, admission) |
assets/work-readme-skeleton.md |
docs/work/README.md |
Always — categories, thread contract, ID shape |
assets/work-template-skeleton.md |
docs/work/TEMPLATE.md |
Always — copy-to-create card template |
assets/coding-standards-skeleton.md |
CODING_STANDARDS.md (project root) |
Code present only (Phase 1 § Code presence) |
assets/rules-index-skeleton.md |
.claude/rules/index.md |
Always — machinery |
assets/rules-ssot-doc-link-skeleton.md |
.claude/rules/ssot-doc-link.md |
Always — doc-authoring rule (SSOT-home links); paths: tail consumer-owned |
assets/rules-dimension-discipline-skeleton.md |
.claude/rules/dimension-discipline.md |
Always — doc-authoring rule (state vs history); paths: tail consumer-owned |
assets/rules-frontend-skeleton.md |
.claude/rules/<framework>.md |
Only if frontend signal fired in Phase 1 |
assets/rules-mv3-skeleton.md |
.claude/rules/mv3.md |
Only if MV3 signal fired in Phase 1 |
Per-doc handling:
- Missing → fill placeholders, write.
CLAUDE.md→ absent → fill placeholders (§ Placeholders), write. Present → no diff of the file: it stays as the consumer left it, apart from the § Rules / § Planning registration lines this run's plantings and deletions earn (§ Registration rule) and a placed doc rule's § Rules bullet that the bullet's own approved row rewrites (the § Rules bullet below).- Exists, drifted in pipeline-owned section → diff that section vs template — only the part § Pipeline-owned marks drift-checked (a section whose body is consumer-owned, such as
docs/techstack.md§ Staged-Tree Verify's command block or § Packages' rows, diffs its header and fixed note only; a placed doc rule —ssot-doc-link,dimension-discipline— diffs itspaths:list on the skeleton's entries only: entries after the skeleton's last one are its consumer tail, which leaves the file✓ currentand which no drift row removes or reverts, while an entry interleaved among the skeleton's entries is drift, and approving the row moves it into the tail; the rule'sCLAUDE.md§ Rules bullet takes its own row, never this one — next bullet) — present to user, get approval per section, write approved. - A placed doc rule's
CLAUDE.md§ Rules bullet (ssot-doc-link,dimension-discipline) → every re-run compares the bullet against the rule's current skeletonpaths:entries, whether the rule file drifted or not. Compare entry by entry, in order: a parenthetical gloss after an entry is ignored, and entries the bullet lists after the skeleton's entries are its consumer tail, never a mismatch. The row isCLAUDE.md: Rules: {rule file}. Match →✓ matches, shown as[§ Rules bullet] ✓ matchesin the rule file's Block 1. Mismatch →⚠ drifted, a row of its own whatever the rule file's verdict, and Block 2 shows the bullet's before and after lines. Approval rewrites only the bullet's skeleton entries to the skeleton's, and keeps its consumer-tail entries, its parenthetical, its other text and every other line; the row resolvesupdatedonce the bullet is written.n — {reason}resolvesdeclined ({reason}), and the decline carries until the skeleton'spaths:entries change (anchor: § 2cdeclined). No bullet for the rule in § Rules, or no § Rules section → no row: planting a bullet is the § Registration rule's. This row is the only lane that rewrites the bullet. - Exists, pipeline-owned section absent →
⊕ newrow: render the template section at Block 2, get approval, insert at the skeleton-defined position relative to the surviving sections. - Exists, seed-once section (
docs/techstack.md§ Runtime / Framework / Key Dependencies / Build & Distribution,docs/overview.md§ Problem / User / Current State — § Pipeline-owned) → compare shape only: heading present and in its skeleton position →✓ current, whatever facts the body carries. Heading missing →⊕ newper the bullet above, inserted with this run's detected facts filled in where code is present (the template's placeholder body on a docs-only repo — § Placeholders' docs-only rule, shared with CLAUDE.md § Tech Stack / § Commands; anoverview.mdsection always takes the placeholder body, § Placeholders) — that insertion is the section's first fill. The body is never diffed against the template here: a filled body and a still-unfilled placeholder both read✓ current. A techstack section's facts that went stale route to the Phase 3 stale-facts advisory (§ Phase 3), never to a write in this walk; anoverview.mdsection's body is product prose — never diffed, never advised. .claude/settings.jsoncore plugin pin → key present →✓ pinned; key absent →⊕ new, resolvinginsertedwith no prompt (§ 2a).- Exists, current → mark
✓ current. Still show the per-section comparison briefly (one-line per pipeline-owned section:[Runtime] ✓ matches,[Framework] ✓ matches, etc.; a placed doc rule adds[§ Rules bullet] ✓ matcheswhen its bullet matches) — asserting "current" without showing the comparison is a gap. - Project-owned content → never touched, even on drift.
- Legacy / unrecognized format — if existing doc structure doesn't align with template sections (different headings, merged sections, doc was written by an older version of this skill or by hand) → surface as legacy format detected, propose:
(a) rewrite to current skeleton format (preserves grown sections), (b) leave as-is and accept template drift, (c) show full template-vs-current diff. Do not silently skip drift detection because section names don't match — that hides real drift.
Language-server pins (techstack-derived). Run this once docs/techstack.md holds this run's content — after the per-doc handling above has written or checked it. Read its § Runtime and § Framework, and § Packages where the file has one. A language is named when its name in the table's first column appears there as a whole word, case-sensitive (Java does not match JavaScript, C does not match C#, go is not Go), or when § Runtime names a runtime its row lists; a framework name alone names no language. Each named language takes its pin in .claude/settings.json enabledPlugins, with a report row .claude/settings.json: enabledPlugins:{pin}. Read enabledPlugins in the user-scope ~/.claude/settings.json too (a missing or unparsable file, or a missing key, is no user choice), then resolve each pin by the first case that holds:
- Project key present → skip (
✓ pinned), whatever its value. - User scope sets the pin's key
false, or setstruea key other than the pin's own whose plugin name (the part before@) starts with the pin's plugin name, in any marketplace (typescript-lsp-win@localfortypescript-lsp) → write nothing (⊘ missing, resolvingskipped (user scope: {that key})). A projecttruewould override thefalse, because project scope outranks user scope, or enable a second plugin beside the variant. The pin's own key settrueat user scope is no skip — case 4 applies. - Project key absent and the prior receipt's
coveredholds the pin's identity (§ 2ccovered) → the user removed the key: insert nothing (⊘ removed, resolvingkept (removed)). - Otherwise → insert it as
true(⊕ new, resolvinginserted).
The run asks nothing for these pins, reads user scope without writing it, and removes no key; a language with no row takes no pin. A section still on its {…} placeholder names no language — a greenfield first run pins none, and the re-run after the techstack fills pins them. These plugins live in the official marketplace, so they add no extraKnownMarketplaces entry.
| Language the techstack names | Pin | Language-server binary |
|---|---|---|
| C, C++ | clangd-lsp@claude-plugins-official |
brew install llvm (macOS; then add /opt/homebrew/opt/llvm/bin to PATH; other platforms: the plugin's README) |
| C# | csharp-lsp@claude-plugins-official |
dotnet tool install --global csharp-ls |
| Go | gopls-lsp@claude-plugins-official |
go install golang.org/x/tools/gopls@latest |
| Java | jdtls-lsp@claude-plugins-official |
brew install jdtls (macOS; other platforms: the plugin's README) |
| Kotlin | kotlin-lsp@claude-plugins-official |
brew install JetBrains/utils/kotlin-lsp (macOS; other platforms: the plugin's README) |
| Lua | lua-lsp@claude-plugins-official |
brew install lua-language-server (macOS; other platforms: the plugin's README) |
| PHP | php-lsp@claude-plugins-official |
npm install -g intelephense |
| Python | pyright-lsp@claude-plugins-official |
npm install -g pyright |
| Ruby | ruby-lsp@claude-plugins-official |
gem install ruby-lsp |
| Rust | rust-analyzer-lsp@claude-plugins-official |
rustup component add rust-analyzer |
| Swift | swift-lsp@claude-plugins-official |
SourceKit-LSP ships with the Swift toolchain (Xcode on macOS, swift.org on Linux) — no separate install |
| TypeScript, JavaScript (Node.js, Deno, Bun) | typescript-lsp@claude-plugins-official |
npm install -g typescript-language-server typescript |
Each pin this run inserts or skips for a user-scope key takes its line in the Phase 3 output (§ Phase 3). The pin alone is inert: the plugin must be installed on the machine (claude plugin install {pin} where it is not), and the LSP tool answers no-server-configured until the binary is on PATH.
Skeleton-block migration (fresh or split state, CLAUDE.md present):
A CLAUDE.md can carry skeleton blocks — content that belongs in .claude/rules/ (path-scoped), docs/techstack.md grown sections (state reference), or docs/decisions.md (closed history). When Phase 1 flagged such blocks (§ Existing CLAUDE.md), propose per-block migration before the drift walk. This is content leaving CLAUDE.md for its owning doc; Phase 1's legacy state never reaches it.
Migration patterns (illustrative — judge by content shape, not heading exact-match):
| CLAUDE.md block content | Proposed destination | Reason |
|---|---|---|
| Enforcement rules with clear file-scope (component patterns, Tailwind tokens, async style, framework idioms) | .claude/rules/<scope>.md |
Path-scoped — full body fires when matching file is read. Cold-file alternative would silent-miss enforcement. |
| Closed history — rejected alternatives, roads-not-taken, closed design rationale | docs/decisions.md § Closed Forks |
History dimension — a state doc never holds it (same lane as § Rejected Alternatives retirement below). |
| Still-binding architecture decisions — module boundaries, data-flow direction, layering | docs/techstack.md § Architecture Rules (grown section) |
State — a live constraint, written present-tense, stripped of when/why-decided. |
| Live reference — deep examples, pattern walkthroughs for browsing | docs/techstack.md § Coding Patterns (grown section) |
On-demand reading, not enforcement. Safe to be cold. |
| Imperative coding convention with no clean file glob — binds every code touch (naming, error handling, testing posture) | CODING_STANDARDS.md § matching heading |
Ambient standard — the .claude/rules/harness.md § Coding Principles line is its guaranteed reader at every code touch. |
MV3 / service-worker rules path-bound to src/background/** |
.claude/rules/mv3.md |
Path-scoped |
## Project Structure directory tree |
drop | ls / tree covers it; not load-bearing for any decision |
| Cross-cutting items inside a path-scoped list (storage-key constants, type-centralization across UI ↔ background, message-contract types) | keep in CLAUDE.md (no clean glob — every layer touches them) | Genuinely ambient |
A block named like reference but written as imperatives is enforcement — route it by the table's two imperative rows; an arguable glob defaults to the rule file (§ Principles, Default-to-rules).
Surface the migration plan as a single proposal. Format below pins shape — one row per skeleton block, destination from the migration table above.
{path}: skeleton blocks detected — propose migrations:
[<block heading>: <area> (<role>, <scope>)]
→ <destination>
Reason: <one line tying content shape to destination choice>
... (one row per skeleton block)
Apply migrations? (y / n / select-per-section)
Concrete fill-in (one example, not a template — judge by analogy for the actual repo; here no Phase 1 signal seeded the component glob):
[Coding Standards: Components/Tailwind (enforcement, frontend-scoped)]
→ .claude/rules/components.md
Reason: imperatives — path-scoped fires on component reads, cold-file would silent-miss.
Per-migration handling:
- User approves → write content into destination with proper format conversion (rule files get
paths:frontmatter; techstack grown sections get conventional headings;docs/decisions.mdgets oneDomain | Rejected direction | Because | Refrow per closed fork — same conversion as § Rejected Alternatives retirement below). Remove from CLAUDE.md. Add summary bullet to CLAUDE.md § Rules for any rule-file destination. - Rule-file destination — content on a glob a Phase 1 signal seeded lands in that seeded
rules/<framework>.md(content matching a skeleton heading fills that slot; the rest goes below the scaffold as grown content); a newrules/<scope>.mdonly for a scope no signal seeded. The destination takes its class's report row, no migration-specific verb: a signal-seeded file new this run →⊕ new | seeded; an existing rule file → none for the grown content; a migration-only file (no matching skeleton — thecomponents.mdcase) is project-owned → no section row, not even⊕ new. A rule file this migration places for the first time earns its ownregistration:row (§ Registration rule — the § Rules bullet is one of its surfaces, not the whole row). - User rejects → leave the content in CLAUDE.md; no further migration proposal for that block.
- User selects per-section → walk one at a time.
Never destructive without confirmation. Show source → dest mapping, get explicit approval, only then move content.
The drift check is produce-then-judge — enumerate first, read the verdict off the rows. The per-section enumeration is the first output, written to the sync-report artifact .claude/bootstrap-sync-report.md before any "current / drifted" conclusion exists. Per pipeline-owned file in scope, append one row per applicable § Pipeline-owned section: section name, line range in the existing file, verdict (✓ matches / ⚠ drifted / ⊕ new / ⊘ missing), and — for drifted, ⊕ new, and ⊘ missing rows — the diff or template section, plus the resolution as it lands at Block 2 (updated / inserted / declined ({reason}) / declined (carried: {reason})); Phase 2c derives the coverage receipt from these rows. The verdict is a column filled while enumerating, never a headline asserted over the file: there is no "all current" to state until every row is written. For each artifact this run placed for the first time or deleted (§ Registration rule), append its registration: row before closing the enumeration. Overwrite any stale report from a prior run.
Block 1 (shown to the user, rendered from the report — one row per pipeline-owned section in the file):
{file path} sync — per-section comparison:
[{Section A}] ✓ matches template (lines N–M)
[{Section B}] ⚠ drifted (see diff below)
[{Section C}] ✓ matches template (lines P–Q)
Block 2 (for ⚠ drifted rows and for ⊕ new rows whose section is absent from an existing file — one expansion per section; a section in a file this run wrote from template takes ⊕ new, resolution seeded, no expansion):
{file path} sync — drift detected:
[{Section Name}] section drifted from current template:
───────────────────────────────────────────────
- {removed line}
+ {added line}
───────────────────────────────────────────────
previously declined: {reason}
Update? (y / n — {reason} / show full diff)
⊕ new expansion (section in the current skeleton, absent from the existing file):
{file path} sync — pipeline-owned section absent:
[{Section Name}] in the current skeleton, missing here:
───────────────────────────────────────────────
{template section body}
───────────────────────────────────────────────
previously declined: {reason}
Insert at the skeleton's position? (y / n — {reason})
A decline carries while its template is unchanged. When the prior receipt's declined holds the row's identity with an anchor equal to this run's anchor for that row (§ 2c declined), the row skips its Block 2 expansion: it still takes its full read-and-compare and its report row, and resolves declined (carried: {reason}) — no prompt, no bytes written. Any other prior decline — no anchor (a bare string, or an entry from an earlier receipt), or an anchor that differs because the template moved since the decline — takes its expansion with the previously declined: line: previously declined: {reason} from an object entry, previously declined, no reason recorded from a bare string. A row with no prior decline omits the line. n takes its reason on the same line — n — {reason}, one line — and the report row records it as declined ({reason}); a bare n re-prompts for the reason before the row resolves.
The report is the forcing function: Phase 2c refuses to commit unless it exists and carries a row for every pipeline-owned section in scope (§ 2c gate). A collapsed "skeleton sections match" with no rows fails that gate mechanically — there is no assertion to trust, so there is nothing to collapse into one. Drift approval (Block 2) protects against (a) legit template updates the user wants to review and (b) bad-actor template injection on a future re-run — you see what's about to change before it's overwritten.
Facts row (re-run, when Phase 1 set facts_stale). Append the facts: row § Fact-staleness signal specifies to the report in this same enumeration — Phase 3's only source for the stale-facts advisory: no row, no advisory.
Bootstrap-shaped commit — match every spelling. A bootstrap-shaped commit is one whose subject is a string this skill emits; § Doctrine migration reads it as provenance for a CLAUDE.md line, and no step reads it to tell a re-run from a fresh install (§ Existing CLAUDE.md). The emitted strings are §2c's; repos bootstrapped before the rename carry chore: scaffold superpowers pipeline / chore: sync superpowers pipeline, and chore: complete pipeline bootstrap counts too.
Rot scan (mandatory pre-step on re-run; none on a fresh install). A fresh install — Phase 1 read the state fresh (§ Existing CLAUDE.md) — runs no scan and writes no rot outcome line. On re-run, before Block 1 renders, run the bundled scanner over every pipeline-owned file in scope, and CLAUDE.md — printf '%s\n' <files> | bash "${CLAUDE_PLUGIN_ROOT}/skills/harness-bootstrap/assets/rot-scan.sh" "${CLAUDE_PLUGIN_ROOT}/skills/harness-bootstrap/assets/rename-map.md" — leaving out of that list .claude/rules/harness.md (re-placed whole by § 2a-hooks) and any file whose leading frontmatter declares dimension: history — frozen provenance preserves old literals by construction, so a hit there is undeclinable-once and re-fires every sync (the same predicate the commit door's doc-sync gate carries). The skip is this lane only: those files' pipeline-owned sections stay in the per-section drift check. Each file<TAB>line<TAB>old<TAB>new line the scanner prints is a candidate hit; a hit whose new reads (retired) forms no rot row — § Retired artifacts below reads it. One rot row covers one old literal in one file, listing every candidate line that assets/rename-map.md § Scan guidance judged migratable, and is appended to bootstrap-sync-report.md and surfaced to the user. State the swept set beside the row count — literals N and files M, copied from the scanner's last line. A clean needs that line: the scanner exiting nonzero, a run with no summary line from it, or a summary reading literals 0 or files 0 is an instrument failure, recorded as no rot scan with its cause, never as a clean: zero rot rows is also what a healthy repo produces, so the report line cannot tell the two apart unless it carries the swept set the scanner printed. The row shape:
{file path} — stale literal `{old}` → propose `{new}`
Lines: {line}, {line}, …
Reason: {map entry reason}
previously declined: {reason}
The scan's own outcome line, beside the rows — one of these two forms, re-run only. {K} counts rot rows, not the scanner's hits:
rot scan: {N} literals read, {M} files swept, {K} rows
rot scan: no rot scan — {cause: the scanner's stderr line, "no summary line", "0 literals" or "0 files"}
One row, one answer, one identity. The row's identity is {file} § rot:{old} — the literal as a bare token, no backticks — and the row takes a single answer covering all its lines, so that identity can never carry two outcomes at once. Grouping is safe — § Scan guidance already resolves the referent per line before a row exists. A second old form in the same file is its own row with its own identity: that section's "surface each independently" is about forms, not lines.
The line list is display only — the identity omits it (§ 2c covered); a prior decline then carries or re-prompts on the same rule Block 2 states, read against this row's identity in place of a section and against the rename-map entry's anchor in place of a template section's. A carried rot row still takes its read and its report row, and resolves declined (carried: {reason}) with no answer asked.
Acceptance takes skeleton-block migration's three-way shape — y / n — {reason} / per-row — and Block 2's reason-capture rule, which skeleton-block migration has none of — same mechanic, read against this row. A rot row resolves migrated, declined ({reason}) or declined (carried: {reason}) — § 2c gates and records it like every other row. Keep the two reasons apart: the row's Reason: is the rename-map entry's reason for the entry; the declined ({reason}) reason is this consumer's reason for leaving this literal alone in this file.
The rot scan runs even when every per-section diff is ✓ current — a stale slash command literal inside a current-shaped doc is invisible to per-section diff (template hasn't drifted; only the literal inside it has).
Retired artifacts (re-run; none on a fresh install). assets/rename-map.md § Retired files lists what an earlier plugin version placed and this one no longer ships, one row per artifact with its kind. After the rot scan, walk every row:
- A file (
AGENTS.md) — absent → no row. Present → read it whole. It holds the plugin's foreign-executor contract — an earlier skeleton's text, in any of its wordings — and nothing consumer-authored (no section, rule, command, path or fact this repo added) → propose its deletion. It holds consumer-authored content → keep the file, write no row, and name it in the Phase 3 sync line. - A marker block (
<!-- harness-metaindocs/overview.md) — read the file for the marker; absent → no row. Present → propose removing the block, from its marker line through its closing-->, every other line untouched. Its one reader is gone, so any value it holds is dead config. .claude/rules/venue-map.md— § 2a-scale's retire line removes it; this walk adds no second row.
A proposed removal is a ⊘ removed row — identity: the file's path, or {file} § {marker} for a block; it enters covered under that identity — rendered at Block 2 with the text it deletes and asked y / n — {reason}: y deletes and resolves updated; n keeps it and resolves declined ({reason}); a prior decline carries on Block 2's rule, its anchor the § Retired files entry line. A deleted file also takes its registration: row (§ Registration rule); a block inside a doc takes none. The scanner's (retired) hits on a removed file — lines naming it — are listed under its row: one in a registration surface changes with the registration: row, every other one stays as written.
Special case — docs/techstack.md § Rejected Alternatives retirement (re-run). Older skeletons grew a § Rejected Alternatives section inside techstack.md — state/history dimension pollution, and tech-scoped. It is retired in favor of docs/decisions.md (cross-domain history dimension). On re-run, if techstack.md carries a § Rejected Alternatives section with content, propose migrating it:
docs/techstack.md § Rejected Alternatives detected — retired section (dimension pollution).
Propose: move its entries to docs/decisions.md § Closed Forks (domain: tech), remove the section.
Migrate? (y / n / show entries)
On y: append each entry as a tech-domain row in docs/decisions.md (preserve the claim verbatim, add a commit-pointer Ref where one is obvious), then delete the section from techstack.md. On n: leave it, mark project-owned (no further drift attempts).
Legacy plan migration — .claude/bootstrap.md (re-run). Pending pipeline work is carried by docs/work/ cards. A legacy checkbox plan — .claude/bootstrap.md, or docs/work/bootstrap.md at its pre-relocation path — converts to cards when either exists (both present → the .claude/ copy's boxes decide; report the other path):
- Task 1 (Seed feature specs) / Task 2 (Seed cards) still holding an unchecked box → seed the matching card from
../setup/assets/seed-cards.md(Task 1 →spec-seeding, Task 2 →marker-sweep) by the hand-copy of/super-bootstrap:setup§ Greenfield branch, skipping a card that guard checks 1–2 of § Code-present seed hit. A task with every box checked seeds nothing — the plan's checkboxes are its record. - Task 3 (Cleanup) carries no card; any other task still holding an unchecked box is named to the user for
/super-bootstrap:log, not converted. - Delete every legacy plan copy present (git keeps the prior text) and stage the deletion with the new cards.
- Row — identity
.claude/bootstrap.md(whole-file),⊘ removed, resolutionupdated; it enterscoveredand takes noregistration:row (the plan is no durable artifact). No plan present → no row.
Placeholders (CLAUDE.md's — Tech Stack one-liner, Commands, the Monorepo block, the § Rules / § Planning bracketed lines — fill at its seed only):
{Project Name}— repo name{date}— today's date- Manifest detection facts (Runtime / Framework / Key Dependencies / Build & Distribution) → fill into CLAUDE.md Tech Stack one-liner AND
techstack.mdskeleton sections; detected scripts / Makefile / Cargo commands → fill CLAUDE.md § Commands - Docs-only repo (Phase 1 § Code presence) — no facts to fill:
techstack.md's seed-once sections, CLAUDE.md's § Tech Stack one-liner ({detected one-line summary…}), and its § Commands block body ({detected from scripts/Makefile/Cargo…}) all keep the skeleton placeholder body verbatim — one rule for both docs - Problem / User / Current State (
overview.mdskeleton sections) → keep the skeleton placeholder body verbatim at install, on every repo — the docs-only rule above, unconditioned; filled at GAP card pickup, not by the runway - Bracketed conditional lines (
{- docs/parked.md — ...},{- docs/test-queue.md — ...},{- docs/outward/ — ...}) — keep only if the corresponding adaptive doc is scaffolded for this repo (scale module per its 2a install gate); drop the whole line otherwise - Monorepo tier (Phase 1 § Monorepo detection) — fill CLAUDE.md's conditional monorepo block (workspace tool + the workspace-aware filtered build command) and
techstack.md§ Packages table rows (package | path | role | build command) from the Phase 1 package enumeration. Single-package repo → drop the CLAUDE.md monorepo block and the § Packages section entirely - Code presence (Phase 1 § Code presence) — gates
CODING_STANDARDS.mdalone (§ 2a); noCLAUDE.mdplaceholder keys on it - CLAUDE.md § Rules summary bullets — the
ssot-doc-link.mdanddimension-discipline.mdbullets are unbracketed shipped prose and stay as written. Fill one bullet per signal-seeded.claude/rules/*.mdfile (glob + 2-4 one-line key points). The{example scaffolding — …}label and the bracketed example bullets under it go together: replaced by the signal-seeded rules' bullets, or dropped when no signal-seeded rule file landed (index.mdis always-placed machinery and takes no bullet) — leaving the explanatory paragraph, the two shipped bullets and the unbracketed read-the-rule-file sentence. - Rule skeleton placeholders (
{component path glob},{Framework}, body bullets inassets/rules-*-skeleton.md) → fill from Phase 1 detection. Lines that don't apply get dropped during scaffold.
2b-adopt: Superseded-fork adoption (migration, silent-skip)
Migration machinery for repos that forked the harness before this plugin existed — they carry their own copies of skills/agents the plugin now ships as root artifacts (a local commit / merge / log / needs-me / autorun skill + agent that the installed plugin supersedes). On re-run, offer to delete the superseded forks so the single root copy takes over.
Superseded-artifact map — derived at runtime, never hardcoded. Enumerate the plugin's own shipped skills and agents from the install: the plugin's skills/<name>/ directory names + agents/<name>.md basenames, read at the plugin root two directory levels above this skill's base dir (same anchor as § 2c's version read). That listing IS the map.
Collision detection. In the consumer repo, scan .claude/skills/<name>/ directories and .claude/agents/<name>.md files. A consumer artifact whose name matches a shipped skill/agent name is a superseded-fork candidate — the installed root copy supersedes it. Name-non-colliding consumer skills/agents are project delta — never touched, never listed, never surfaced. None collide → silent skip: place nothing, surface nothing.
When candidates exist, surface the full list with a per-deletion confirm — each row maps the consumer path to the root artifact that supersedes it:
Superseded harness forks detected — the installed plugin now ships these:
.claude/skills/commit/ → superseded by the plugin's `commit` skill (/super-bootstrap:commit)
.claude/agents/triage.md → superseded by the plugin's `triage` agent
... (one row per collision: consumer path → superseding root artifact)
Delete the forked copies? (y = all / n = none / per-item)
per-item walks one candidate at a time (y / n each). Never auto-delete — every deletion is an explicit confirm.
Per-candidate handling:
- Approve → remove the consumer copy (
git rm -rthe skill dir /git rmthe agent file; plain delete + stage where the path is untracked). Stage the deletion with the Phase 2c commit. - Reject → leave it in place; a later re-run re-offers.
2c: Sync report + commit
Gate — the sync report must exist and cover every pipeline-owned section, plus every artifact the § Registration rule covers, before commit. Read .claude/bootstrap-sync-report.md and cross-check its rows against § Pipeline-owned: every pipeline-owned section that applies to a file in scope must have a row, .claude/rules/harness.md must have its one whole-file row (written at § 2a-hooks — CLAUDE.md is project-owned and contributes no section row), on a re-run every placed doc rule whose bullet CLAUDE.md § Rules holds must have its CLAUDE.md: Rules: {rule file} row (§ 2b Per-doc handling), and every durable artifact the § Registration rule covers must have a registration: row. Missing file, or any uncovered section or artifact → halt, return to 2b, produce the missing rows. A ⚠ drifted, ⊕ new, ⊘ missing, or ⊘ removed row must also carry its resolution (updated / inserted / seeded / declined ({reason}) / declined (carried: {reason})), a rot row its own (migrated / declined ({reason}) / declined (carried: {reason})), a registration: row its own (updated / none), a language-server pin row also skipped (user scope: {key}) / kept (removed) (§ 2b Language-server pins), a § 2a-hooks row also kept (fork) — a fork kept at the overwrite/keep prompt, which stays out of declined (updated (stale) / updated (fork, overwritten) count as updated) — an unresolved row, or a declined row carrying no reason, halts the same way. A rot outcome line present and reading no rot scan halts too — the scanner failed or swept nothing, so its zero rows are not a clean; return to 2b, clear the cause the line names, and re-run rot-scan.sh. A fresh install carries no rot line, and the gate reads none. This is a Read + set-difference check, not a self-attestation — a skipped drift check leaves no rows to find, so it cannot pass the gate.
Sync report — rendered from the artifact (the file is canonical; this table is its commit-time view). Always shown once the gate above passes, before the commit. A re-run renders the table below — drift fixes and current items. A fresh install renders one coverage line in the table's place — {N} sections placed, all ⊕ new — while the report file keeps its per-row verdicts (⊕ new | seeded); the table stays the re-run surface.
| Artifact | Status | Action |
|-------------------------------------|--------------|---------------------|
| .claude/rules/harness.md | ✓ current | — |
| docs/techstack.md: Staged-Tree Verify | ⚠ drifted | updated (approved) |
| docs/techstack.md: Edit Discipline | ⚠ drifted | declined (keeps the repo's own banned-terms wording) |
| .claude/rules/mv3.md | ⊕ new | seeded (signal: MV3 manifest) |
| registration: docs/outward/ → README.md docs list (illustrative — name what the greps hit) | ⊕ new | updated |
| registration: .claude/skills/commit/ → none | ⊘ removed | none |
Receipt for that report — its four section and whole-file rows transcoded to row identities, its two registration: rows report-only, no rot row in this one to carry:
{
"version": "{current plugin version}",
"covered": [
".claude/rules/harness.md",
"docs/techstack.md § Staged-Tree Verify",
"docs/techstack.md § Edit Discipline",
".claude/rules/mv3.md"
],
"declined": [
{ "section": "docs/techstack.md § Edit Discipline", "reason": "keeps the repo's own banned-terms wording", "anchor": "<sha256 of the template section as rendered this run>" }
],
"placed": {
".claude/hooks/commit-channel.sh": "<sha256 of the file as placed>",
".claude/rules/harness.md": "<sha256 of the file as placed, CR removed>"
}
}
Receipt write. Once the sync completes, write .claude/super-bootstrap-runway.json = { "version": "{current plugin version}", "covered": [...], "declined": [...], "placed": { ... } } — fresh install writes it new, re-run overwrites whole. Take version from the plugin's .claude-plugin/plugin.json, at the plugin root two directory levels above this skill's base directory (skills/harness-bootstrap/ → skills/ → plugin root); it is written as a record, and no step of this skill compares it. This runs even when every row is ✓ current — the receipt records "synced at this version, these sections compared," independent of whether content changed. Write the receipt with LF line endings only — on Windows jq, Python text mode and PowerShell Set-Content emit CRLF, so a write through a shell tool pipes its output through tr -d '\r' before it lands — then confirm with the Bash tool that tr -cd '\r' < .claude/super-bootstrap-runway.json | wc -c reports a count of zero; non-zero → strip the file in place with tr -d '\r' and count again.
covered is an array of bare row-identity strings — one string per sync-report row across all three row classes: its per-section rows, its whole-file artifact rows (the § 2a-hooks rows included — the hook scripts and .claude/rules/harness.md among them — identity as that step names it), and its rot rows. Each identity is transcoded from its report row rather than copied verbatim: the report renders a section row {file}: {Section} and the identity is {file} § {Section}; a whole-file artifact is its repo-relative path alone; a rot row is {file} § rot:{old} — keyed by the stale literal, never the line, since line numbers shift between runs; a placed doc rule's § Rules bullet row is CLAUDE.md § Rules: {rule file}. registration: rows stay report-only, and so does a pin row resolved skipped (user scope: …) — it never inserted the key, so a later run that finds the key absent has no removal to carry.
declined is the rows resolved declined — a drift kept or an insert declined at Block 2, a rot row left alone at the § 2b rot scan — each written { "section": "<row identity>", "reason": "<the row's declined reason>", "anchor": "<sha256>" }, carrying the row's own covered identity string and the parenthetical of declined ({reason}) as the reason — so declined stays a subset of covered, and marks divergence accepted, not pending. A carried row is a declined row: it writes its entry again with the same reason — the original {reason}, the carried: marker stripped. The anchor is the sha256 of what the decline answers: for a section or whole-file row, this run's rendered template text for that row (placeholders filled, conditional lines resolved — the text the drift check compared against); for a § Rules bullet row, the rule skeleton's paths: entry lines; for a rot row, the rename-map entry line (`old` → `new` — reason); for a § 2b Retired artifacts row, its § Retired files entry line. Block 2 reads it back on the next re-run to carry the decline or re-prompt.
placed is the ensure-infra procedures' own record — { "<destination path>": "<sha256 of the file as placed>" } — which 2a-hooks writes into the receipt file directly as each file it places — the three hook scripts and .claude/rules/harness.md — resolves current — copied, or already sha-equal (mechanism: assets/hooks-ensure-infra.md § Idempotency). /super-bootstrap:autorun writes its worktree template entry the same way on its own install (../autorun/assets/ensure-infra.md § Idempotency). Read the receipt back from disk here, after 2a-hooks ran, and carry its placed map forward whole, autorun's entry included — never from the Phase 1 snapshot, which predates this run's copies.
The commit is decided by effect, not by the verdict column. If this run changed no bytes in any path of the stage list below — the receipt included, compared against its prior content — report no changes and skip the commit. A change that predates this run is not this run's effect: a consumer's uncommitted hand edit this run declined leaves the sync a no-op.
Otherwise use /super-bootstrap:commit to stage:
.claude/rules/harness.md(placed, or re-placed at 2a-hooks — a stale re-copy or an approved fork overwrite)CLAUDE.md(when this run created it, added, re-pointed or dropped a § Rules / § Planning registration line, rewrote a placed doc rule's § Rules bullet on that bullet's approved row, or moved a block out at Skeleton-block migration)CODING_STANDARDS.md(new, or approved preamble / heading drift fix)docs/techstack.md(new, skeleton-section or preamble drift or insert, or post-migration absorbed content)docs/overview.md(new, skeleton-section or preamble drift or insert, or a retiredharness-metablock removed)docs/decisions.md(new, scope-header drift, post-retirement migration from techstack, or closed-history rows from Skeleton-block migration)docs/terminology.md(new, or scope-header drift).claude/settings.json(core pin seeded at 2a; language-server pins at 2b; harness hooks merged at 2a-hooks).claude/hooks/commit-channel.sh,.claude/hooks/consult-check-{sessionstart,check}.sh(frozen hook scripts seeded at 2a-hooks — always, default-on).gitignore(when 2a-hooks appended its.claude/.consult-catalogline; skip if the line was already present).claude/rules/index.md(always — at minimum machinery seed).claude/rules/ssot-doc-link.md,.claude/rules/dimension-discipline.md(if newly written, or approved drift fix).claude/rules/<seeded>.md(any rule files newly seeded or migrated to)docs/work/README.md(if newly written, its retired high-water line replaced by the ID-shape line, or fact-fields block inserted this run at 2a-scale)docs/work/TEMPLATE.md(if newly written)- Retired artifacts (§ 2b) — a deleted
AGENTS.md - Legacy plan migration (§ 2b) — the deleted
.claude/bootstrap.md/docs/work/bootstrap.mdand thedocs/work/GAP-*.mdcards it seeded docs/specs/.gitkeepdocs/parked.md,docs/test-queue.md,docs/outward/README.md,docs/outward/TEMPLATE.md(scale-module targets — only if installed this run at 2a-scale)docs/outward/OUT-###.mdentry files plus the removeddocs/outward.md(only when 2a-scale ran the split).claude/super-bootstrap-runway.json(runway coverage receipt — written every sync; staged when its content changed)- Superseded-fork deletions (adopt mode, § 2b-adopt) — staged removals of approved consumer
.claude/skills/<name>/dirs /.claude/agents/<name>.mdfiles that root artifacts now supersede - Consumer surfaces edited to register a placed or deleted artifact (§ Registration rule — skip when every registration row resolved
none) - Any other adaptive files / folders created
Commit message: chore: scaffold harness pipeline on fresh repos, chore: sync harness pipeline when only drift fixes shipped, refactor: migrate CLAUDE.md to rules layer + sync pipeline when the run moved a block at Skeleton-block migration (§ 2b). These strings double as the bootstrap-shaped-commit match (§ 2b).
Clean the run artifact. bootstrap-sync-report.md is a transient diagnostic — never staged. After the commit lands (or after reporting no-changes) and the Phase 3 handoff block has rendered, delete it: its consumer is this phase, so this phase is its cleaner. A report orphaned by a session that broke between 2b and here is overwritten by the next run's § 2b enumeration.
Phase 3: Handoff
After committing (or reporting no changes needed), present results based on repo state:
First-run (just scaffolded) — render the block verbatim, no additions, before § 2c deletes the sync report; each {If …} line resolves to its quoted text or drops; the command literals stay untranslated:
**Generic runway installed.** The workflow doctrine loads from `.claude/rules/harness.md` (plugin-owned, re-placed whole on re-run — the repo's own additions go in `CLAUDE.md`). Skeleton `docs/techstack.md` and `docs/overview.md` carry detected facts (empty on greenfield) — grown sections fill via doc-sync as features land. The core plugin pin (super-bootstrap) sits in `.claude/settings.json`; a clone on another machine installs the plugin once with `claude plugin install super-bootstrap@super-bootstrap`, and a cloud session loads no repo-declared plugin, so install it there from the cloud environment's Setup script: https://github.com/RockyHong/super-bootstrap#cloud-sessions. Everything this run installed is in the scaffold commit — `git show --stat HEAD`.
{If product skeletons are empty (greenfield): "`docs/overview.md` / `docs/techstack.md` are empty skeletons — `/super-bootstrap:setup` seeds GAP cards for them and surfaces the resolve gate."}
{If any rule files were seeded: "Path-scoped rules seeded in `.claude/rules/` ({list seeded rules}). They auto-load on file match — full ammo at the decision moment, summary mirrored in CLAUDE.md § Rules. Add more rule files when path-scoped patterns emerge."}
{If this run inserted language-server pins, one line per pin: "`{pin}` pinned — install its language server: `{command}`."}
{If this run skipped language-server pins for a user-scope key, one line per pin: "`{pin}` not pinned — `~/.claude/settings.json` sets `{key}`; a clone on another machine gets no pin for this language."}
Re-run / sync pass — assembled per run from the fragments below, not rendered verbatim:
Pipeline synced. {N items updated, M already current.}{If a commit landed: " Its full file list:
git show --stat HEAD."}{If Skeleton-block migration moved a block: " Migrated {blocks moved} from CLAUDE.md to {destinations} —CLAUDE.mdnow {old line count} → {new line count} lines."}{If rule files added: " Rules: +K seeded, summary updated in CLAUDE.md § Rules."}{If language-server pins inserted, per pin: "{pin}pinned — install its language server:{command}."}{If language-server pins skipped for a user-scope key, per pin: "{pin}not pinned —~/.claude/settings.jsonsets{key}; a clone on another machine gets no pin for this language."}{If § 2b Retired artifacts kept a file for its consumer content, per file: "{file}kept — it holds content of this repo beside the retired plugin contract; the runway no longer ships or reads it."}
Stale detected facts (re-run, when .claude/bootstrap-sync-report.md carries a facts: row — written at § 2b from § Fact-staleness signal):
Read the row back and print this block once, directly under the sync line, its facts taken from the row:
Detected stack facts are stale. This repo carried no code at the last runway sync and carries code now. The runway seeds stack facts once, at first fill, and never rewrites them — five sections still read their docs-only values:
CLAUDE.md§ Tech Stack — the one-line summary. Hand-edited: it is § Project-owned, and doc-sync's write boundary excludesCLAUDE.md, so no other door refreshes it.docs/techstack.md§ Runtime · § Framework · § Key Dependencies · § Build & DistributionDetected this run: manifest
{manifest file, or "none"}· runtime{runtime + version, or "none"}· framework{framework, or "none"}.Edit those five sections by hand from those facts and from the repo itself, and commit them; a fact shown as "none" was not detected, so fill it by reading the repo's source and build files. This run changed nothing in them.
The advisory step completes when that block has printed with all five section names and the row's facts substituted in. It has no approval prompt and no on-disk effect — the runway writes none of the five.
Doc-rule coverage (fresh install and re-run, when .claude/doc-surface exists). Once the first-run block or the sync line has printed, run bash ${CLAUDE_PLUGIN_ROOT}/skills/harness-bootstrap/assets/rule-paths-coverage.sh check from the repo root. Each line it prints names a placed doc rule, a glob .claude/doc-surface declares that the rule's paths: does not cover, and the entry to add; the script translates the glob, because a declaration's * crosses / and a paths: * does not (kinds/*.md → kinds/**/*.md). Print them as a separate paragraph after that output, never inside the first-run block, verbatim under the lead **Doc rules miss part of the declared doc surface** — add each entry below to that rule's paths: list, after its last entry:. The consumer adds the entries by hand; the runway writes nothing to either rule. No .claude/doc-surface, or no line printed → print nothing.
Principles
- Layer by decision-moment — every rule has a moment-of-need: ambient, every turn —
.claude/rules/harness.mdfor the plugin's workflow doctrine,CLAUDE.mdfor the project's own always-true facts; path-scoped (.claude/rules/, fires on file match) for full-body precision when relevant; on-demand (docs/techstack.md,docs/specs/) for reference Claude reads when intent surfaces. Skills are for thinking modes / structured processes — not a rule-storage layer. - Precision per always-on byte — every line of the two ambient files (
.claude/rules/harness.md,CLAUDE.md) answers "what decision does this sharpen, at what moment?" Length is downstream of that: a line-count target is a smoke alarm on bloat, not a cap. Every always-on line competes with the task's own reads for attention, so the orchestrator brief stays lean enough that opening file reads + workflow + the task itself stay high-signal. - Default-to-rules when ambiguous — enforcement-shaped content (imperatives: must / never / always) goes to
.claude/rules/<scope>.mdeven when the heading sounds like reference. Silent-miss in a cold file costs more than slight over-attach. - Subagent dispatch protects orchestrator focus — verbose work (10+ file reads, noisy test runs, parallel-safe chunks, fresh-eye review) belongs in a subagent's clean window. Orchestrator's attention budget is too valuable to spend on tool churn.
- Mandatory checks ride a forcing function, not prose — a step the model is merely told to "always run" collapses into a confident assertion on re-runs where the surface looks done. Encode it produce-then-judge: enumerate to a file first, then gate the downstream phase on that file's coverage (a Read + set-difference, not a self-attestation). This skill applies it at the drift check (2b → 2c); new mandatory steps take the same shape.