acta:adopt
The backfill. Point it at a real project that's missing docs and it reverse-engineers a right-sized doc set
from the code, then builds the brain — without touching anything that already exists.
Shared: ${CLAUDE_PLUGIN_ROOT}/acta/ (doc-catalog.md, disciplines.md, templates/). Same catalog/templates as
acta:build, so adopted docs are consistent with built ones. The difference: source is the code, and the
overwrite policy is always SKIP.
Language
Generate content in the project's documentation language (registry language:, default English); talk to the user in the language they use. See ${CLAUDE_PLUGIN_ROOT}/acta/principles.md.
Flow
Scan the codebase (read-only). Detect:
- Stack:
package.json, pyproject.toml/requirements.txt, go.mod, Cargo.toml, pom.xml, etc.
- Structure: top-level folders, entry points, module boundaries.
- Routes/endpoints:
app/, pages/, routes/, controllers, OpenAPI files.
- Data: schemas, migrations, ORM models → for
db-design/erd.
- Ops signals: Dockerfile, CI config (
.github/workflows, etc.), .env.example → env-vars/ci-cd/deployment.
Read only the committed .env.example / .env.sample template — never a real .env/.env.local (secrets); record names, not values.
- Tests: presence/kind →
testing-strategy.
- Domain signals → project type + pack via
${CLAUDE_PLUGIN_ROOT}/acta/project-types.md: PyTorch/scikit/dataset → ml;
langchain/embeddings/vector store → llm; Solidity/Foundry/Hardhat → web3; Godot/Unity/Unreal → game;
firmware/Arduino/ESP32/RTOS → hardware; Airflow/dbt/Spark → data; scanner/detection/exploit tooling → security;
Terraform/k8s/Ansible → devops; ROS/actuator/SLAM → robotics; ARKit/Unity XR → xr; Stripe/payments/ledger → fintech;
simulation/HPC/numerical → scientific; ffmpeg/HLS/transcoding → media; GIS/GeoJSON/mapping → geospatial.
Report the detected profile (stack + type) in 3–5 lines before doing anything else.
Inventory existing docs. Check the filesystem and any .claude/acta.md registry for docs that already
exist (README, docs/**, CLAUDE.md, CHANGELOG, ADRs). Build two lists: present vs missing.
Recommend & confirm the doc set. From the detected profile, recommend core disciplines/depth (e.g. API routes
→ api; migrations → db-design, erd; CI file → ci-cd; tests → testing-strategy) plus the matching
domain pack for the detected type (e.g. Godot → game pack; langchain → llm pack). Confirm via multi-select
(default depth standard). Intersect with the missing list — you only ever generate missing docs.
Short product intake (optional). Code reveals how, not why. Ask ≤4 questions to capture product intent
(what/for whom/goals) so PRD/arch-overview aren't hollow. Skippable → those fields become TBD.
Generate ONLY missing docs from the code analysis, rendered via the catalog's templates. Unknown → TBD.
Document what actually exists — do not invent architecture the code doesn't show.
- Seed
docs/architecture/adr/0001-initial-architecture.md describing the as-is architecture/stack (only if no ADRs exist).
- Paths and filenames come straight from
doc-catalog.md exactly as listed (folders lowercase; root meta UPPERCASE, docs/ lowercase-kebab).
Write/refresh the brain — without clobbering.
CLAUDE.md: if absent, create with the index block. If present, inject the marker block; if it already has
other content, append the block once and leave existing content untouched (never rewrite the user's CLAUDE.md prose).
.claude/acta.md: registry with a row per doc — generated docs active; pre-existing docs recorded with
status external so future acta:track knows they exist but weren't authored here.
docs/README.md: if absent, generate it; if present, skip (report it).
Backfill the skill-owned layers (detect → offer, don't force). The catalog disciplines above don't cover
docs/design/, docs/business/, docs/legal/ — those are owned by their own skills. Scan for their signals and,
if found and the layer is missing, offer to run the skill (each reads the same code, so nothing is re-derived):
- design — a styling system in the code (Tailwind config, CSS variables/tokens, a component library, theme
files) → suggest
/acta:design to reverse-engineer tokens.md + components.md + the design-system from it.
- business — pricing/plans/billing in code or config (a Stripe catalog, a
plans table) → suggest /acta:business.
- legal — data collection, cookies/analytics, third-party vendors/sub-processors → suggest
/acta:legal.
Offer only; adopt itself never writes these layers (they're conversational and skill-owned).
Summary. Two clear lists:
- Created (missing docs now generated).
- Left untouched (pre-existing docs — path each), explicitly: "already present, not modified."
- Suggested layers (any skill-owned layer detected but not generated — name the skill to run).
Rules (the defining guarantee)
- NEVER overwrite an existing doc. Existing → always skip + report. No merge, no prompt-to-overwrite — adopt
is safe-by-default on a real project.
- Never fabricate. Reverse-engineer only what the code supports; everything else is
TBD or an intake question.
- Idempotent: re-running only fills newly-missing gaps; already-present docs stay untouched; brain/registry regenerate in place.
- Content in the project's documentation language (default English). Solo right-sizing applies. After adopt, ongoing updates are
/acta:track's job.
1---2name: adopt3description: Existing codebase with few docs — reverse-engineer only the missing ones from the code; never overwrite. Trigger on /acta:adopt, "document this codebase", "backfill docs".4---56# acta:adopt78The **backfill**. Point it at a real project that's missing docs and it reverse-engineers a right-sized doc set9from the code, then builds the brain — **without touching anything that already exists**.1011Shared: `${CLAUDE_PLUGIN_ROOT}/acta/` (`doc-catalog.md`, `disciplines.md`, `templates/`). Same catalog/templates as12`acta:build`, so adopted docs are consistent with built ones. The difference: **source is the code, and the13overwrite policy is always SKIP.**1415## Language16Generate content in the project's documentation language (registry `language:`, default English); talk to the user in the language they use. See `${CLAUDE_PLUGIN_ROOT}/acta/principles.md`.1718## Flow19201. **Scan the codebase (read-only).** Detect:21 - Stack: `package.json`, `pyproject.toml`/`requirements.txt`, `go.mod`, `Cargo.toml`, `pom.xml`, etc.22 - Structure: top-level folders, entry points, module boundaries.23 - Routes/endpoints: `app/`, `pages/`, `routes/`, controllers, OpenAPI files.24 - Data: schemas, migrations, ORM models → for `db-design`/`erd`.25 - Ops signals: Dockerfile, CI config (`.github/workflows`, etc.), `.env.example` → `env-vars`/`ci-cd`/`deployment`.26 **Read only the committed `.env.example` / `.env.sample` template — never a real `.env`/`.env.local` (secrets); record names, not values.**27 - Tests: presence/kind → `testing-strategy`.28 - Domain signals → project **type + pack** via `${CLAUDE_PLUGIN_ROOT}/acta/project-types.md`: PyTorch/scikit/dataset → `ml`;29 langchain/embeddings/vector store → `llm`; Solidity/Foundry/Hardhat → `web3`; Godot/Unity/Unreal → `game`;30 firmware/Arduino/ESP32/RTOS → `hardware`; Airflow/dbt/Spark → `data`; scanner/detection/exploit tooling → `security`;31 Terraform/k8s/Ansible → `devops`; ROS/actuator/SLAM → `robotics`; ARKit/Unity XR → `xr`; Stripe/payments/ledger → `fintech`;32 simulation/HPC/numerical → `scientific`; ffmpeg/HLS/transcoding → `media`; GIS/GeoJSON/mapping → `geospatial`.33 Report the detected profile (stack + type) in 3–5 lines before doing anything else.34352. **Inventory existing docs.** Check the filesystem and any `.claude/acta.md` registry for docs that already36 exist (README, `docs/**`, CLAUDE.md, CHANGELOG, ADRs). Build two lists: **present** vs **missing**.37383. **Recommend & confirm the doc set.** From the detected profile, recommend core disciplines/depth (e.g. API routes39 → `api`; migrations → `db-design`, `erd`; CI file → `ci-cd`; tests → `testing-strategy`) **plus the matching40 domain pack** for the detected type (e.g. Godot → game pack; langchain → llm pack). Confirm via multi-select41 (default depth `standard`). Intersect with the **missing** list — you only ever generate missing docs.42434. **Short product intake (optional).** Code reveals *how*, not *why*. Ask ≤4 questions to capture product intent44 (what/for whom/goals) so `PRD`/`arch-overview` aren't hollow. Skippable → those fields become `TBD`.45465. **Generate ONLY missing docs** from the code analysis, rendered via the catalog's templates. Unknown → `TBD`.47 Document *what actually exists* — do not invent architecture the code doesn't show.48 - Seed `docs/architecture/adr/0001-initial-architecture.md` describing the **as-is** architecture/stack (only if no ADRs exist).49 - Paths and filenames come straight from `doc-catalog.md` exactly as listed (folders lowercase; root meta UPPERCASE, docs/ lowercase-kebab).50516. **Write/refresh the brain — without clobbering.**52 - `CLAUDE.md`: if absent, create with the index block. If present, inject the marker block; if it already has53 other content, **append** the block once and leave existing content untouched (never rewrite the user's CLAUDE.md prose).54 - `.claude/acta.md`: registry with a row per doc — generated docs `active`; pre-existing docs recorded with55 status `external` so future `acta:track` knows they exist but weren't authored here.56 - `docs/README.md`: if absent, generate it; if present, **skip** (report it).57587. **Backfill the skill-owned layers (detect → offer, don't force).** The catalog disciplines above don't cover59 `docs/design/`, `docs/business/`, `docs/legal/` — those are owned by their own skills. Scan for their signals and,60 if found and the layer is missing, **offer to run the skill** (each reads the same code, so nothing is re-derived):61 - **design** — a styling system in the code (Tailwind config, CSS variables/tokens, a component library, theme62 files) → suggest `/acta:design` to reverse-engineer `tokens.md` + `components.md` + the design-system from it.63 - **business** — pricing/plans/billing in code or config (a Stripe catalog, a `plans` table) → suggest `/acta:business`.64 - **legal** — data collection, cookies/analytics, third-party vendors/sub-processors → suggest `/acta:legal`.65 Offer only; adopt itself never writes these layers (they're conversational and skill-owned).66678. **Summary.** Two clear lists:68 - **Created** (missing docs now generated).69 - **Left untouched** (pre-existing docs — path each), explicitly: *"already present, not modified."*70 - **Suggested layers** (any skill-owned layer detected but not generated — name the skill to run).7172## Rules (the defining guarantee)7374- **NEVER overwrite an existing doc.** Existing → always skip + report. No merge, no prompt-to-overwrite — adopt75 is safe-by-default on a real project.76- Never fabricate. Reverse-engineer only what the code supports; everything else is `TBD` or an intake question.77- Idempotent: re-running only fills newly-missing gaps; already-present docs stay untouched; brain/registry regenerate in place.78- Content in the project's documentation language (default English). Solo right-sizing applies. After adopt, ongoing updates are `/acta:track`'s job.