Intake — Bootstrap the Curated Context Baseline
Owns the brownfield bootstrap of the agent workflow (CONCEPT.md §3).
Produces the ONE curated docs baseline that every later phase injects
into implementers — as early as possible, while the codebase is small
and the interview is cheap. After the seal, P7 curation owns ALL
updates; this skill is re-run only as a deliberate drift audit, never
automatically.
The core principle: extraction and interview are two different
sources, and this skill needs both. Code tells what IS. Only the
developer tells what is INTENDED — product scope and non-goals, security
requirements, which of two inconsistent conventions is the rule going
forward. This is a collaborative session, not a batch job.
Output (the baseline — all eight files)
| File |
Content |
Cap |
docs/PRODUCT.md |
what the product is, for whom, non-goals |
½ page (≤30 non-blank lines) |
docs/ARCHITECTURE.md |
the load-bearing architecture truths; details → docs/architecture/ |
≤200 lines |
docs/GUIDELINES.md |
conventions that ARE the rule (incl. Known Debt notes for losing patterns) |
— |
docs/DESIGN-SYSTEM.md |
design rules extracted from code — tokens, scales, patterns, do/don't — or a pointer to frontend-design (1c) if none exist; never invented. No component inventory (that's components.md) |
≤80 lines |
docs/components.md |
component registry — generated by scripts/gen-component-registry.mjs from the doc block above each component export |
— |
docs/security-baseline.md |
auth model, secret handling, input validation floor |
— |
docs/test-conventions.md |
test runner, layout, naming, what must be tested |
— |
AGENTS.md (root) |
initial durable agent rules |
≤40 non-blank lines |
docs/DESIGN-SYSTEM.md and docs/components.md are only required to seal
when the repo has a component directory (src/components or
src/features/*/components); backend-only repos skip both (see
scripts/intake-seal-check.sh).
Existing AGENTS.md (or other curated docs) are baseline truth, never
overwritten. If a file already exists, the draft is a MERGE: every
existing rule/statement is kept unless an interview decision explicitly
retires it (recorded in decisions.md); new content is appended with
provenance markers like everything else. The drift-audit variant works
the same way — deltas, not rewrites.
Workflow
0. Precondition
- No curated baseline yet (
docs/PRODUCT.md missing), OR the user
explicitly asked for a drift audit of the existing baseline.
- Working space:
specs/intake/ (drafts + decision log). This is
pre-PROJ — there is NO state.json; state.json is born at CP1.
- Drift audit variant: draft the delta against the existing docs instead
of from scratch; everything else (interview, checkpoint, seal) is the
same path.
1. Scan & draft (automated, provenance-marked)
Run three read passes over the repo (spawn Explore agents where useful —
they locate, you judge):
- Arch Hat: entry points, module boundaries, data flow, persistence,
integrations → ARCHITECTURE draft (+
docs/architecture/ for detail).
- QA Hat: test setup, error-handling patterns, validation, auth →
test-conventions + security-baseline drafts.
- component-scout: run
node scripts/gen-component-registry.mjs, then
write the missing doc blocks into the components it reports as
undocumented (purpose + "not for" are interview material, not
extractable) and regenerate → components.md registry;
design tokens (tailwind config, CSS custom properties) →
DESIGN-SYSTEM draft. If no real tokens exist, write a pointer to the
frontend-design skill (1c) instead of inventing a design system.
Draft ALL eight files into specs/intake/ with a provenance marker on
EVERY statement:
[extracted: <file:line evidence>] — derived from code/README/git
history, with the evidence reference
[assumed] — plausible inference that needs developer confirmation
[gap: <question>] — cannot be derived from code; must be asked
While drafting, collect every detected inconsistency (e.g. "errors
via Result type in ~60% of modules, thrown exceptions in ~40%") into the
interview queue — never silently pick a winner.
Near-greenfield variant: almost no code → extraction is thin and sourced
from concept/PRDs; the interview carries the weight. Same files, same
markers, same path.
2. Developer interview (point by point)
Build ONE numbered queue: every [gap], every [assumed], every
detected inconsistency. Work through it point by point with
AskUserQuestion — grouped by topic, never as one wall of questions.
- Every answer becomes a GUIDELINES rule (or a PRODUCT/ARCHITECTURE
statement, wherever it belongs).
- For inconsistencies: the developer picks the rule going forward; the
LOSING pattern becomes a Known Debt note in GUIDELINES — recorded,
not silently rewritten.
[assumed] items the developer confirms lose their marker; corrected
ones are rewritten from the answer.
3. Reconcile via checkpoint (4a, Bootstrap Variant)
Route to the checkpoint skill's Bootstrap Variant: the generated
docs are HYPOTHESES, not truth. Same point-by-point pattern — every
review point ends in exactly one of adopt / change / reject / defer,
recorded in specs/intake/decisions.md (D-BOOTSTRAP-<NN> ids,
templates/decisions.md.tmpl frame) BEFORE the next point. Cascade
every decision into the affected draft(s).
4. Seal
- Move the reconciled drafts to their final locations (
docs/*, root
AGENTS.md) and STRIP all provenance markers — they are working
syntax, the sealed baseline never carries them.
bash scripts/intake-seal-check.sh (copy from
~/.claude/skills/0b_intake/scripts/ together with
curation-caps.sh if missing). It verifies: all eight files exist,
zero residual markers, specs/intake/decisions.md carries
D-BOOTSTRAP reconcile decisions (undiscussed drafts never seal),
file caps hold. Red → fix, re-run; NEVER seal past a red check.
- Commit:
docs: intake baseline — initial curated docs
(include specs/intake/decisions.md).
From here on, P7 curation owns every docs/ update.
→ NEXT ACTION: start the first PROJ through the chain (chain-guide
routes it); at P0 the setup skill compiles this baseline into the
context bundles.
Failure Behavior
- The interview cannot proceed (developer unavailable) → leave the
marked drafts in
specs/intake/, write one line to specs/intake/
README noting the open queue — the drafts are resumable; nothing is
half-sealed into docs/.
intake-seal-check.sh red → the baseline stays uncommitted; fix and
re-run. The check is idempotent.
1---2name: intake-23description: Bootstrap the curated context baseline for a brownfield (or near-greenfield) repo: scan the code and draft ALL curated docs with per-statement provenance markers, interview the developer through every gap/assumption/inconsistency, reconcile via the checkpoint loop, then seal as the initial curation baseline commit. Use when: (1) a repo has code but no curated docs/ baseline (docs/PRODUCT.md missing), (2) an explicit drift audit of the curated docs is requested, (3) a near-greenfield project needs its baseline before the first PROJ. Not for: per-PROJ documentation (use documentation), ongoing doc updates (P7 curation owns those), plan approval (use checkpoint).4---56# Intake — Bootstrap the Curated Context Baseline78Owns the brownfield bootstrap of the agent workflow (CONCEPT.md §3).9Produces the ONE curated docs baseline that every later phase injects10into implementers — as early as possible, while the codebase is small11and the interview is cheap. After the seal, P7 curation owns ALL12updates; this skill is re-run only as a deliberate drift audit, never13automatically.1415**The core principle: extraction and interview are two different16sources, and this skill needs both.** Code tells what IS. Only the17developer tells what is INTENDED — product scope and non-goals, security18requirements, which of two inconsistent conventions is the rule going19forward. This is a collaborative session, not a batch job.2021## Output (the baseline — all eight files)2223| File | Content | Cap |24|---|---|---|25| `docs/PRODUCT.md` | what the product is, for whom, non-goals | ½ page (≤30 non-blank lines) |26| `docs/ARCHITECTURE.md` | the load-bearing architecture truths; details → `docs/architecture/` | ≤200 lines |27| `docs/GUIDELINES.md` | conventions that ARE the rule (incl. Known Debt notes for losing patterns) | — |28| `docs/DESIGN-SYSTEM.md` | design **rules** extracted from code — tokens, scales, patterns, do/don't — or a pointer to **frontend-design** (1c) if none exist; never invented. No component inventory (that's `components.md`) | ≤80 lines |29| `docs/components.md` | component registry — **generated** by `scripts/gen-component-registry.mjs` from the doc block above each component export | — |30| `docs/security-baseline.md` | auth model, secret handling, input validation floor | — |31| `docs/test-conventions.md` | test runner, layout, naming, what must be tested | — |32| `AGENTS.md` (root) | initial durable agent rules | ≤40 non-blank lines |3334`docs/DESIGN-SYSTEM.md` and `docs/components.md` are only required to seal35when the repo has a component directory (`src/components` or36`src/features/*/components`); backend-only repos skip both (see37`scripts/intake-seal-check.sh`).3839**Existing AGENTS.md (or other curated docs) are baseline truth, never40overwritten.** If a file already exists, the draft is a MERGE: every41existing rule/statement is kept unless an interview decision explicitly42retires it (recorded in `decisions.md`); new content is appended with43provenance markers like everything else. The drift-audit variant works44the same way — deltas, not rewrites.4546## Workflow4748### 0. Precondition4950- No curated baseline yet (`docs/PRODUCT.md` missing), OR the user51 explicitly asked for a drift audit of the existing baseline.52- Working space: `specs/intake/` (drafts + decision log). This is53 pre-PROJ — there is **NO state.json**; state.json is born at CP1.54- Drift audit variant: draft the delta against the existing docs instead55 of from scratch; everything else (interview, checkpoint, seal) is the56 same path.5758### 1. Scan & draft (automated, provenance-marked)5960Run three read passes over the repo (spawn Explore agents where useful —61they locate, you judge):6263- **Arch Hat:** entry points, module boundaries, data flow, persistence,64 integrations → ARCHITECTURE draft (+ `docs/architecture/` for detail).65- **QA Hat:** test setup, error-handling patterns, validation, auth →66 test-conventions + security-baseline drafts.67- **component-scout:** run `node scripts/gen-component-registry.mjs`, then68 write the missing doc blocks into the components it reports as69 undocumented (purpose + "not for" are interview material, not70 extractable) and regenerate → components.md registry;71 design tokens (tailwind config, CSS custom properties) →72 DESIGN-SYSTEM draft. If no real tokens exist, write a pointer to the73 **frontend-design** skill (1c) instead of inventing a design system.7475Draft ALL eight files into `specs/intake/` with a provenance marker on76EVERY statement:7778- `[extracted: <file:line evidence>]` — derived from code/README/git79 history, with the evidence reference80- `[assumed]` — plausible inference that needs developer confirmation81- `[gap: <question>]` — cannot be derived from code; must be asked8283While drafting, collect every detected **inconsistency** (e.g. "errors84via Result type in ~60% of modules, thrown exceptions in ~40%") into the85interview queue — never silently pick a winner.8687Near-greenfield variant: almost no code → extraction is thin and sourced88from concept/PRDs; the interview carries the weight. Same files, same89markers, same path.9091### 2. Developer interview (point by point)9293Build ONE numbered queue: every `[gap]`, every `[assumed]`, every94detected inconsistency. Work through it point by point with95AskUserQuestion — grouped by topic, never as one wall of questions.9697- Every answer becomes a GUIDELINES rule (or a PRODUCT/ARCHITECTURE98 statement, wherever it belongs).99- For inconsistencies: the developer picks the rule going forward; the100 LOSING pattern becomes a **Known Debt** note in GUIDELINES — recorded,101 not silently rewritten.102- `[assumed]` items the developer confirms lose their marker; corrected103 ones are rewritten from the answer.104105### 3. Reconcile via checkpoint (4a, Bootstrap Variant)106107Route to the **checkpoint** skill's Bootstrap Variant: the generated108docs are HYPOTHESES, not truth. Same point-by-point pattern — every109review point ends in exactly one of adopt / change / reject / defer,110recorded in `specs/intake/decisions.md` (`D-BOOTSTRAP-<NN>` ids,111`templates/decisions.md.tmpl` frame) BEFORE the next point. Cascade112every decision into the affected draft(s).113114### 4. Seal1151161. Move the reconciled drafts to their final locations (`docs/*`, root117 `AGENTS.md`) and STRIP all provenance markers — they are working118 syntax, the sealed baseline never carries them.1192. `bash scripts/intake-seal-check.sh` (copy from120 `~/.claude/skills/0b_intake/scripts/` together with121 `curation-caps.sh` if missing). It verifies: all eight files exist,122 zero residual markers, `specs/intake/decisions.md` carries123 `D-BOOTSTRAP` reconcile decisions (undiscussed drafts never seal),124 file caps hold. Red → fix, re-run; NEVER seal past a red check.1253. Commit: `docs: intake baseline — initial curated docs`126 (include `specs/intake/decisions.md`).127128From here on, P7 curation owns every docs/ update.129130→ NEXT ACTION: start the first PROJ through the chain (**chain-guide**131routes it); at P0 the setup skill compiles this baseline into the132context bundles.133134## Failure Behavior135136- The interview cannot proceed (developer unavailable) → leave the137 marked drafts in `specs/intake/`, write one line to `specs/intake/`138 README noting the open queue — the drafts are resumable; nothing is139 half-sealed into `docs/`.140- `intake-seal-check.sh` red → the baseline stays uncommitted; fix and141 re-run. The check is idempotent.