diff --git a/.claude/commands/_close/distillation-agent.md b/.claude/commands/_close/distillation-agent.md index 483cfc2..8a7d0f7 100644 --- a/.claude/commands/_close/distillation-agent.md +++ b/.claude/commands/_close/distillation-agent.md @@ -99,9 +99,10 @@ This step exists to catch errors propagated from `_summary.md`. Do not skip it. 1. From `candidate.rationale` and your reading of the source, extract **3-5 key claims** that the note will make 2. For each key claim, run: ``` - Grep(pattern="{claim-keyword}", path="workspace/{workspace_id}/", glob="*.md", output_mode="files_with_matches") + Grep(pattern="{claim-keyword}", path="workspace/{workspace_id}/", glob="*.{md,html}", output_mode="files_with_matches") ``` -3. For each deliverable that matches (excluding the source you already read), `Read` up to **2 additional** deliverables + An `.html` match counts as a verification source only when it is **HTML-canonical** (no same-basename `.md` — check the deliverable MOC above, which lists them). Ignore matches from derived HTML: anything under `.view/`, and same-basename `.html` twins of an MD file (their MD side is already in scope) +3. For each deliverable that matches (excluding the source you already read), `Read` up to **2 additional** deliverables — HTML-canonical deliverables included (their HTML is their only record) 4. Classify what those deliverables say about your claim: - **Consistent** (supports or does not contradict) → OK, continue - **Not mentioned** → OK, continue diff --git a/.claude/commands/_close/handbook-agent.md b/.claude/commands/_close/handbook-agent.md new file mode 100644 index 0000000..76480a6 --- /dev/null +++ b/.claude/commands/_close/handbook-agent.md @@ -0,0 +1,89 @@ +# /close Handbook Sub-agent + +/close Phase 4 sub-agent prompt (spawned in parallel with the Distillation sub-agents). Authors the **aggregated workspace handbook** — the human-readable HTML view of the completed workspace — into `workspace/{workspace_id}/.view/`, implementing the "workspace completion" read moment defined in `rill-html-output.md` ("When HTML Is Generated"). + +**IMPORTANT**: This file is a template. The parent /close skill reads this file, fills in the placeholders (workspace id, summary path, deliverable MOC), and passes the result as the `prompt` parameter when spawning the sub-agent via the Agent tool. The sub-agent receives this as its initial context and has no visibility into the parent's conversation history. + +## Target + +- Workspace ID: `{workspace_id}` +- Workspace path: `workspace/{workspace_id}/` +- `_summary.md` path: `workspace/{workspace_id}/_summary.md` (already written by the Analysis sub-agent) +- All deliverables in this workspace (from the Analysis report): + +``` +{deliverable_moc} +``` + +- `output_language` (optional): ISO 639-1 language code for narrative output (e.g. `"ja"`, `"en"`); when omitted, default to English +- `style_guide` (optional): short vocabulary-boundary rules for narrative output; when omitted, write narrative text in plain English + +## Your job + +Author the workspace handbook: a navigable HTML view that lets a human absorb the whole completed workspace without opening each Markdown artifact. You: + +1. Read `.claude/commands/_view/design-language.md` **first** — it is the authoring procedure and pre-ship checklist this page must follow (message-driven, layer-not-delete, visualization routing, typography/layout, ship check) +2. Read `workspace/{workspace_id}/_summary.md` and every deliverable in full: all `NNN-*.md` files plus committed HTML-canonical artifacts (`NNN-*.html` etc. with no same-basename MD source — their HTML is the only record). Skip derived HTML regenerable from MD sources (`.view/` sidecars, same-basename `.html` twins) +3. Choose the document shape (single page vs multi-page — see below) +4. Write the handbook into `workspace/{workspace_id}/.view/` +5. Return a short structured report to the parent + +You MUST NOT: + +- Create or modify any file outside `workspace/{workspace_id}/.view/` +- Modify `_summary.md`, `_workspace.md`, or any deliverable +- Carry substantive information absent from the MD sources into the handbook (`rill-html-output.md` principle 4 — if a load-bearing explanation is missing, leave it out rather than inventing it; the parent run is completing the workspace and its sources are final) + +## Document shape — qualitative judgment + +Per the design language's "Two document shapes": + +- **Single page** → `workspace/{workspace_id}/.view/handbook.html`. Choose this when the workspace's material fits one navigable page — a handful of artifacts whose full re-expression still reads as one coherent document a reader can scroll. +- **Multi-page** → `workspace/{workspace_id}/.view/handbook/` (hub `index.html` + detail pages, relative links, one shared inline `