From system-spec-harness
Compiles collected spec-state.json and fetched-references.json into a multi-file specification document set with chapter Markdown files and index. Use when interview results need to be compiled into structured specifications.
How this skill is triggered — by the user, by Claude, or both
Slash command
/system-spec-harness:run-system-spec-compileThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
> 収集済み仕様 (spec-state.json) と取得済み最新ドキュメント (fetched-references.json)・設計知識参照を、**章立ての複数 Markdown ファイル + index.md** の仕様書ドキュメントセットへまとめる run skill。ヒアリング継続やドキュメント再取得はしない (入力を組み立てるのみ)。
fixtures/expected-00-requirements-definition.mdfixtures/expected-database.mdfixtures/expected-index.mdfixtures/expected-maintenance-ops.mdfixtures/expected-security.mdfixtures/fetched-references.jsonfixtures/spec-state.jsonprompts/R1-assemble.mdprompts/R2-render.mdprompts/R3-crosslink.mdreferences/chapter-template.mdreferences/resource-map.yamlscripts/compile-spec-doc.pytests/test_compile_spec_doc.py収集済み仕様 (spec-state.json) と取得済み最新ドキュメント (fetched-references.json)・設計知識参照を、章立ての複数 Markdown ファイル + index.md の仕様書ドキュメントセットへまとめる run skill。ヒアリング継続やドキュメント再取得はしない (入力を組み立てるのみ)。
入力 (境界・厳守):
spec-state.json — カテゴリ×プラットフォーム収集マトリクス (C01 run-system-spec-elicit の単一 writer が所有)。fetched-references.json — 取得済み最新公式ドキュメントの出典記録 (C02 が取得)。../ref-system-design-knowledge/references/*.md (C04)。出力: system-spec/ 配下の、先頭にU1-U9と意思決定表を持つ要件定義書 (00-requirements-definition.md) + 章別 Markdown 複数ファイル (<category>.md) + index.md。
完了条件: 要件定義書 + 全カテゴリ章 + index.md が生成され、IN1 (2 決定論ゲート exit0) と OUT1 (受入テスト) を満たす。
上位概念 anchor (要件 C9): spec-state.json の requirements_foundation (U1-U9) を 00-requirements-definition.md (要件定義書=憲法) として最初の章に生成し、各技術章 frontmatter の serves_goals (セル serves_goals の集約) で全章を上位概念へトレース (anchor) する。index.md は要件定義書を先頭に相互参照する。requirements_foundation 不在の spec-state でも空落ちさせず draft の要件定義書を出す。
やらないこと (boundary): ヒアリングの継続 (C01 の責務)、ドキュメントの再取得 (C02 の責務)、spec-state.json の書換え。本 skill は入力を章へ組み立てるだけで、収集状態そのものは変更しない。
各章 Markdown の frontmatter は次の確定マーカーを持つ。C11 hook (guard-confirmed-chapter-overwrite.py) はこのマーカーと spec-state.json のセル状態を判定ソースとして確定章の誤上書きを fail-closed で遮断する。
---
status: confirmed # 終端カテゴリ (集約=確定/対象外) は confirmed。進行中 (未着手/収集中) は draft
category: database # 章のカテゴリ id
aggregate: 確定 # 真理値表導出の集約状態 (未着手/収集中/確定/対象外)
spec_cells: [database.web, database.mobile, ...] # 対応する spec-state マトリクスセル id
serves_goals: [G1, G2] # 章が資する上位概念ゴール id (セル serves_goals の集約・要件 C9 anchor)
---
confirmed=章凍結 (集約が終端の 確定/対象外)、draft=進行中。集約は宣言値ではなくセル状態から真理値表で再導出する (決定論)。<category>.<platform> セル id 一覧 (canonical platform 順)。00-requirements-definition.md) の goals へトレースし、どのゴールにも資さない収集を drift として --require-foundation が検出する。system-spec/ への正本書込経路は C03 (本 skill) の scripts/compile-spec-doc.py に一本化する。確定済み章の確定状態 (spec-state 確定セル・対象外理由) は保全され、勝手な巻き戻しをしない。これは C01 (spec-state.json の単一 transition writer) と対をなす二輪の単一 writerであり、C11 hook はこの正本防御を二重化する fail-closed の補助防御にすぎない (正本防御は writer 側が担う)。spec-state 上でセルが R4-reopen 済み (再オープン) のときだけ、該当章を draft へ戻して再レンダリングできる。
prompts/R1-assemble.md): spec-state.json の requirements_foundation (上位概念) を先頭章に、収集済みカテゴリ×プラットフォーム結果を各技術章に組み立てる (カテゴリ順・canonical platform 順・集約状態を真理値表導出)。prompts/R2-render.md): 章立てに沿って章別 Markdown へレンダリングし、設計知識参照 (C04) と最新ドキュメント出典 (fetched-references) を各章へ、各技術章 frontmatter へ serves_goals (上位概念トレース) を反映する。prompts/R3-crosslink.md): 全章横断の index.md を生成し、要件定義書を先頭に、各章と収集マトリクス集約状態 (未着手/収集中/確定/対象外) を相互参照可能にする。決定論の組み立て・frontmatter 生成・index 相互参照は scripts/compile-spec-doc.py (Python 標準ライブラリのみ) が担い、責務プロンプトは判断・章構成の意味付けを担う (機械=再現性 / AI=自由度の二層分離)。
IN1/OUT1 の未達ゲートを起点に assemble/render/crosslink の該当責務だけを再実行する。各反復で決定論ゲートを先に通し、最大5周で未達なら成果物を確定せず呼出元へ blocker を返す。全ゲートPASS時だけ完了する。
../../scripts/validate-coverage-matrix.py --matrix <spec> と ../../scripts/validate-source-citation.py --targets <spec> --references <refs> が exit0。tests/test_compile_spec_doc.py が確認。references/resource-map.yaml を最初に読む。主要参照:
scripts/compile-spec-doc.py — 要件定義書 (00-requirements-definition.md) + 章別 Markdown + index.md の決定論コンパイラ (frontmatter 確定マーカー / serves_goals / 状態表 / 出典表 / 相互参照)references/chapter-template.md — 章 Markdown の構造テンプレートprompts/R1-assemble.md / prompts/R2-render.md / prompts/R3-crosslink.md — R1/R2/R3 責務別プロンプトspec-state.json (C01) / fetched-references.json (C02) / ../ref-system-design-knowledge/references/*.md (C04)../../scripts/validate-coverage-matrix.py (C12) / ../../scripts/validate-source-citation.py (C13)npx claudepluginhub p/daishiman-system-spec-harness-plugins-system-spec-harnessCreates or updates SPEC.md documents from requirements, notes, or interview output, structuring into sections for goals, design, edge cases, security, testing, and success criteria. Use for feature specs.
Evaluates generated specification document sets for completeness using 6 criteria: traceability, decision rationale, matrix coverage, design knowledge, doc freshness, prompt quality. Returns PASS/FAIL with deficiency list.
Distills unstructured intent input (brain dumps, PRDs, meeting transcripts) into a SPEC kernel with five canonical fields and companion files as machine-ready contract for downstream skills.