Docs Update
Use docs-ingest-phase to route docs-affecting work through the wiki contract into setup, capture, health, private ingest, or public docs
docs-ingest-phase is the docs router. It turns docs-affecting work into durable, routed wiki knowledge, or into an explicit no-op with a reason.
- Use this when: proven work changed behavior, architecture, setup, contracts, operator workflow, or routed docs structure; a spec needs durable domain capture; a user supplies a raw source to keep; a wiki needs setup, adoption, or a health check; or public docs need creation or a material update.
- It gives you: routed wiki pages that match implemented reality, with navigation, discovery entries, bookkeeping, and a
log.mdentry. - It ends with: one outcome per branch (
complete,partialwith each unfinished item, orno-opwith its reason), a contract gap report, or a stop at the public fragment checkpoint. Inside AFKdelivery-phase, no gate stops; see Inside AFK Delivery. - Wrapped skills:
$docs-ingest-phase; in the public branchwriting-fragments,writing-beats, andwriting-shape;$show-mefor complex flows;docs-onboardingas the follow-up after setup.
Trigger
delivery-phaseopens docs ingest after implementation and review for docs-affecting work.bug-resolution-phaseroutes atech-debtfinding to it, to write the canonical debt file<wiki-root>/content/docs/project/tech-debt/<domain>/<spec>/<debt-slug>.mdthat$resolve-debt-phasereads.- An operator invokes it after standalone work, to capture a raw source, to check wiki health, or to set up or adopt a wiki.
docs-ingest-phase is model-invoked, so a matching request can also start it.
Runtime Graph
Each branch ends with its own outcome. To run the next branch, re-enter the router.
Router
-
Scope. If the docs goal or source artifacts are unclear, ask one concrete question and stop. Inside AFK
delivery-phase, settle scope as an Autonomous Decision instead. -
Contract. Resolve the wiki contract from the wiki-root
AGENTS.md: wiki location, raw home, canonical article tree, discovery entrypoints, source owners, and validation commands. Done when you hold a resolved contract or a list of its gaps. -
Branch. Select the first branch whose trigger matches:
- Setup/adoption: the user asks to set up or adopt the wiki.
- Capture: the user supplies a raw source to keep.
- Health: the user asks for a wiki health check or maintenance.
- Private/internal: a spec, project or wiki page, legacy root
docs/tree, operator workflow, route metadata, or learning artifact needs ingest. - Public: reader-facing docs are requested or materially affected.
- No-op: no docs-affecting change exists. Report the evidence and stop.
Audience decides private against public. When it stays unclear, ask who the reader is; inside AFK
delivery-phase, decide it. -
Gap. When a contract gap covers a destination of the selected branch, run setup/adoption if the task holds setup authority. Otherwise write the gap report and stop. Inside AFK
delivery-phase, setup authority is an Autonomous Decision; see Inside AFK Delivery.
When several branches apply, capture comes before the ingest of that source, and private/internal comes before public.
Branches
Setup/adoption
Adopt writes the contract into an existing wiki tree and moves or deletes nothing. Set up creates the contract, the raw home, the article tree, and a root discovery index. Both report readiness for source storage, knowledge and navigation, and rendering. When the destination is usable, docs-onboarding can reconstruct initial wiki context from the existing code, docs, and backlog. It builds the Project Map, closes project-wide decisions through a direct targeted $requirements-grill, and initializes the backlog through $write-backlog. It then hands each accepted flow to $requirements-phase as an explicit human handoff, with a brief and the onboarding projection boundary, and stops; Requirements Phase compiles the architecture and spec pair.
Capture
Capture keeps one raw source unchanged in raw/<origin>/<slug>/<revision12>/ with its source.json and SHA-256. It reuses an existing record with the same hash, commits only that revision folder, and reads it back with verify-captured-source.mjs. The outcome is not captured, saved-uncommitted, unverified, or committed (a local commit, no push).
Health
Health records a structural result for each validation command and a semantic record of stale claims, contradictions, missing connections, and discovery gaps. It resumes from durable evidence and re-reads disk and Git before it writes over a concurrent change.
Private/internal
Read <wiki-root>/AGENTS.md first. Classify every target by audience. Then run these steps in order; each starts only after the previous one is done:
- Learning: scan and refresh the scoped learning artifacts. Each gets an outcome: keep, update, consolidate, replace, delete, or mark stale.
- Flows: write or merge one routed flow page per extracted flow. If a required flow write fails, skip concepts and go to Outcome; the outcome is partial.
- Concepts: write or merge each concept page, or record a knowledge no-op or an unfinished item.
- Discovery: for each changed article, list it in its owning
meta.json, add a discovery-map entry with an "Applies when" cue, and make every link resolve. - Operations: put implemented architecture, setup, contracts, decisions, runbooks, and non-obvious operator behavior on their owning page, usually under
project/reference/orproject/runbooks/, and list each new page in its section index. - Outcome: run the contract's validation commands, then record the outcome, its bookkeeping, and its
log.mdentry.
Spec ingest checks freshness by blob id (ingested_revision) and sources[].sha256. A legacy ingested: true field counts as stale. A complete run writes ingested_revision and last_ingested into SPEC.md and IMPLEMENTATION-NOTES.md frontmatter; a partial run writes only its log entry.
Legacy root docs/. A root docs/ tree is legacy input, never a write target. With setup authority, merge it with references/legacy-root-docs.md: list every leaf doc, map each to its owning page in the canonical article tree, merge the content, list new pages in their section meta.json and index, remove the root docs/ projection from the sync command, then delete the tree. Without setup authority, report the tree as "awaiting merge".
If public docs are also needed, leave a handoff with the public target, source links, and the writer artifact home, then re-enter the router.
Public
- Infer the public docs surface from existing pages, sidebars,
meta.json, and indexes. - For a small patch, edit directly and report why the writer chain was skipped.
- For substantial work, use one private writer artifact bundle for the target page, for example
apps/wiki/content/docs/project/public-docs/<slug>/. - Run
writing-fragmentsto create or refreshfragments.mdwhen it is missing or stale. - Fragment sufficiency checkpoint (mandatory): show the fragments and ask whether they are sufficient. Do not continue while the answer or the requested guidance is missing. Inside AFK
delivery-phase, the checkpoint is an Autonomous Decision instead. - Run
writing-beats(beats.md), thenwriting-shape(shape.md), then write or merge the final page. - Update routed metadata, sidebars, and indexes.
Inside AFK Delivery
Inside AFK delivery-phase, every docs-ingest gate settles as an Autonomous Decision, and the run continues. Each out-of-bounds decision is posted to the thread at once.
- Scope and audience: take the docs goal, source artifacts, and target reader from the delivery spec, diff, and review output. In-bounds.
- Setup authority: adopting an existing wiki tree is in-bounds. Setting up a new wiki at the destination that project guidance names is out-of-bounds. With no named destination, write the gap report, record it as docs follow-up debt, and return the outcome to delivery without a stop.
- Destination and spec folder: take the candidate that the delivery spec and project guidance name. In-bounds.
- Fragment sufficiency checkpoint: judge the fragments against the delivery spec and diff, revise
fragments.mdfrom that evidence, and continue to beats and shape. In-bounds. - Health conflicts: apply the change that the accepted spec supports. Out-of-bounds when it changes accepted product meaning.
Log Entry
Every writer of <wiki-root>/log.md appends one entry at the end of the file. The log is append-only and oldest-first:
## [YYYY-MM-DD] <capture | ingest | maintenance | grill | spec> | <subject>
- Source: <path> @ <revision or blob ID>
- Outcome: <outcome>
- Outputs: <pages written or changed, with counts>
- Unfinished: <each unfinished item, or none>Boundaries
- Keep one routed docs surface: no second article tree,
domains/owner layer, or backlog mirror. - Keep
surfaceandpermissionfrontmatter on routed pages. - Document implemented reality, not speculative future state. Keep agent task instructions out of human-facing pages.
- Treat Project Verifier Feature Maps as read-only. Docs ingest records observed coverage gaps for
implement-spec; it never edits Feature Maps.
Routing In This Repository
apps/wiki/content/docs is the only knowledge home. Use /docs/harness for the Harness model, /docs/cli for CLI mechanics, and /docs/project for specs, plans, implementation notes, decisions, runbooks, reference, research, reviews, and writer artifacts. Other repositories follow their own wiki contract instead of these route names.
No-Op Rule
A no-op names its evidence. A freshness no-op means every source is already fresh. A knowledge no-op means the stale evidence adds no reusable delta to the owning page. Good reasons name the unchanged surface: no behavior, workflow, setup, or contract change, and no routed page or navigation impact.
Terminal Outcome
Future humans and agents find the implemented reality through routed pages, meta.json, discovery-map entries, and source paths in frontmatter, and log.md records the run.
Validation
Run the contract's validation commands: bun run --cwd apps/wiki check:health (links, navigation, frontmatter, source.json integrity) and bun run --cwd apps/wiki check:content (projection drift).