Pre-choice usable artifact execution
Purpose & Output Contractの最小の実成果物をmain contextで作成する。effect別のparse/open・secret・irreversible・corrupt guardだけを実行し、現物path・digest・開き方を提示してからaccept-as-is/light/standard/detailedを記録する。accept-as-isはその場でhandoff完了とし、後続sectionを実行しない。
Post-choice selected improvement execution
以下の既存workflow・goal-seek・評価・修正sectionはlight/standard/detailedが記録されてsemantic_evaluator_startedへ遷移した場合だけ実行する。release/exhaustiveは別の明示eventを必要とする。
run-skill-create
Runtime root contract
runtime_root_policy: host-skill-path の製品別root解決、cwd推測禁止、prompt継承は
ref-cross-platform-runtime の共有正本
をそのまま適用する。
Phase 2 移行後は plugins/harness-creator/skills/ が正本、.claude/skills/ は symlink/deploy target。plugin同梱schema/prompt/scriptは上記Runtime root contractで解決したabsolute PLUGIN_ROOT から参照し、repo-root cwdや plugins/harness-creator/... からplugin rootを推測しない。生成対象repoを操作するroot-level gateだけは、明示したproject root/cwdを別入力として使う。
Purpose & Output Contract
ユーザー要望 → skill-brief.json → Skill生成 → plugin/marketplace 登録判定 → P0 lint → 設計評価 → パラダイム評価 → governance 承認 をゲートあり自動連鎖で実行する端から端まで orchestrator。各 Step/Gate の機械可読定義は workflow-manifest.json、責務別プロンプトは prompts/*.md、データ契約は schemas/*.schema.json を参照。
入力: topic (任意), mode ∈ {create, update}, brief_path (任意・E2 直接消費), handoff (任意・brief_path 併給時の parity preflight)
出力:
plugins/harness-creator/skills/<skill_name>/ 一式 (SKILL.md + references/ + scripts/)
eval-log/skill-build-trace.json (schemas/build-trace.schema.json 準拠)
- 共通基盤の場合は
plugins/harness-creator/.claude-plugin/plugin.json 登録差分
eval-log/docs/<NN>-<timestamp>.json (評価結果、schemas/findings.schema.json 準拠)。deprecated: 27章 §3.1 の eval-log/<plugin>/<skill>/<gate>/<run-id>/ (repo root 基準) へ移行
eval-log/handoff-<step>.json (schemas/handoff.schema.json 準拠)
- 完了レポート (日本語本文、パラメーター名のみ英語)
完了条件: P0 lint pass + evaluator JSON pass (--fast 低リスク ref/wrap は evaluator: N/A 理由必須) + (solo_operator_mode 下) LLM-reviewer pass + 各遷移の明示的gate decision。
禁則: ゲート判定なしに次フェーズへ進まない。人間承認gateはユーザー承認を必須とし、solo自動承認はmanifestの全条件を機械評価して得た明示的gate decisionだけを許す。P0 lint 失敗の自動修正は禁止 (根本原因をユーザー提示)。evaluator/governance reviewer は同一 context 評価禁止 (必ず context:fork)。詳細は ## Key Rules。
起動モード
Key Rules
-
ゲート前で必ず判定する: 人間承認gateは AskUserQuestion (prompts/R2-gate-review.md) でユーザー承認を得る。solo自動承認はmanifestの全条件が機械的にtrueになった場合だけ明示的PASS decisionとして記録し、条件未充足なら停止する。
-
子スキルへの委譲: 各フェーズは独立 Skill を Skill tool で起動 (workflow-manifest.json の delegateSkill)。本スキルは制御のみ。
-
失敗時の停止: P0 lint fail または evaluator FAIL なら停止し findings 提示。
-
context:fork: evaluator/governance reviewer は必ず context:fork で起動 (Sycophancy 防止)。
-
handoff 保存: 各ゲート通過時に eval-log/handoff-<step>.json を schemas/handoff.schema.json 準拠で残す。PostCompact hook で復元。
-
plugin/marketplace 登録は確認後: legacy manifest.json は build-manifest-registration-plan.py の提案 → Gate 2.5 承認 → --apply の順。新形式 plugin.json plugin のルート marketplace.json / bundles.json 登録は scripts/validate-plugin-completeness.py --fix(append-only・冪等・書込後自己再検証)が担い、人間が PR diff で最終承認する(破壊的変更を含まない append-only ゆえ生成フロー内で自動実行可)。
Codex 面は run-codex-plugin-package に委譲する。Claude plugin envelopeを持つ全pluginを対象に、新規/既存を状態から判定する同一upsertが .codex-plugin/plugin.json と .agents/plugins/marketplace.json を同期し、手書きの二重管理はしない。Codex固有値は .codex-plugin-overrides.json へ明示する。
これに対し CL-4c の build-plugin-release.py は承認境界の外側 (=承認後) に置く。理由は validate-plugin-completeness.py --fix と性質が違うため: write_version() は plugin.json の version 行を原文 in-place 置換し、そこから公開 marketplace.json (sync_public_marketplace_version()) と .codex-plugin/plugin.json (sync_codex_manifest_version()) を追従させる 既存行の書き換えであり (さらに _run() が bumped 非空のとき regenerate_config_version_lock() で config-version-lock.json も再生成する)、append-only の安全性論拠がそのまま使えない。よって生成フロー内で自動実行してよいのは読み取りのみの --check に限る。version を実際に上げる実行は Gate 2.5 承認後に、--only <plugin> を必ず付けて行う — _run() は only = set(args.only) or None なので無指定は全 plugin 走査となり、本フローと無関係な変更済み plugin まで同じ実行で patch bump されるため、--only は範囲を宣言する必須引数として扱う。
-
resource-map 先読み: references/resource-map.yaml を最初に読み、必要ファイルのみ open。
-
日本語成果物ゲート: brief の output_language=ja と parameter_language_exception=true を既定とし、本文・レビュー・完了レポートを日本語に保つ (パラメーター名・JSON キー・CLI 引数は英語)。
-
prompt 形式: 新規 prompt は Markdown (.md) 既定。prompts/<R-id>-<slug>.md で plugins/prompt-creator/skills/run-prompt-creator-7layer/references/seven-layer-markdown-template.md を写経して生成。YAML は legacy のみ許容 (新規禁止、P0 lint で warn)。
End-to-End Flow
[Step 1 elicit] run-skill-elicit ─→ skill-brief.json ─[Gate 1]─▶
[Step 2 build] run-build-skill ─→ skill-build-trace.json
[Step 3 manifest-register] [Gate 2.5] [Step 3.5 bundle-register]
[Step 3.55 codex-platform-sync] run-codex-plugin-package (Codex manifest + repo marketplace upsert)
[Step 3.56 codex-platform-check] 同じ入力をcheck-onlyで再検査
[Step 3.6 local-marketplace-register] build-local-marketplace.py (非配布 plugin の install 経路)
[Step 3.7 plugin-release-record] build-plugin-release.py --only <plugin> (内容 hash 記録 / patch 採番。Gate 2.5 承認後・--only 必須。Key Rule 6)
[Step 4a p0-lint] (fail→Step 2、最大3周) ─[Gate 2 diff]─▶
[Step 4a.5 pkg-check] run-plugin-package-check (条件: kind==plugin-composition or 新規 plugin 横展開)
[Step 4b design-evaluate] (context:fork) ─→ findings
[Step 5 elegant-review] (条件: new or >30 行, context:fork) ─[Gate 3]─▶
[Step 6 governance] (solo_operator_mode 自動承認) ─[Gate 4]─▶
[Step 7 report]
依存・entryHook/exitHook・resourceIds・fatal_exit_codes は workflow-manifest.json 参照。
ゴールシーク実行
ゴール (Goal)
ユーザー要望から生成された <skill_name>/ 一式が、全 P0 lint pass・evaluator JSON pass・(solo_operator_mode 下) LLM-reviewer pass を満たし、4 ゲート全承認済みで、登録判定・handoff・完了レポートまで完結した状態になっている。
目的・背景 (Why)
新規/更新 Skill を「端から端まで」品質保証付きで送り出すための制御層。各フェーズは独立 Skill へ委譲し、本スキルはゲート制御とハンドオフ整合のみを担う。固定手順では入力 (topic/mode/--fast)・lint 失敗・FAIL 差し戻しなど実行時文脈に脆いため、未達ゲートを都度埋める。
完了チェックリスト (Checklist)
ゴールシークループ
正本 ../run-build-skill/references/goal-seek-paradigm.md の 6 ステップ (現状評価/手順生成/実行/検証/Anchor Step/反復) に従う。本スキル固有の差分:
- 未達評価の単位はゲート:
workflow-manifest.json の gate_order 順に「未承認」とみなして都度埋める (Gate 番号順の直書き禁止、順序正本は manifest)。人間承認gateは AskUserQuestion (prompts/R2-gate-review.md) で承認を取り、solo governanceだけは全 auto_approve_conditions の機械評価PASSを明示decisionとして記録する。
- 委譲先 (子 Skill):
run-skill-elicit / run-build-skill / assign-skill-design-evaluator / run-elegant-review / run-skill-rubric-governance。Notion 指定ありの非技術者 intake は skill-intake 完了証跡を先に検証する。本スキルは制御のみ、各子が自設計書を参照。
- context:fork 必須: evaluator / elegant-review / governance reviewer は必ず fork で起動 (Sycophancy 防止)。
- 差し戻し: P0 lint fail または evaluator/elegant FAIL なら
run-build-skill 再実行へ戻す (最大 3 周)。--fast 判定・elegant 起動判定は scripts/evaluate-create-gates.py で機械決定 (条件不一致は黙って通常フロー)。
- lint 自動修正禁止: 根本原因をユーザー提示し LLM 判断で勝手に直さない。
- 各フェーズ phase=id・entryHook/exitHook・dependsOn・fatal_exit_codes は
workflow-manifest.json 参照。プロンプト R1/R2/R3 は prompts/*.md。
Gotchas
- Gate skip 禁止: 「次へ」を自動推測しない。人間承認gateは明示確認、solo governanceは全自動承認条件の機械評価PASSが必須。
- 同一 context 評価禁止: evaluator/governance reviewer は必ず context:fork (Sycophancy 防止)。
- lint 失敗時の自動修正禁止: 根本原因をユーザー提示。LLM 判断で勝手に直さない。
- mode=update 時の改名:
run-skill-rename に委譲。本スキル対象外。
- context 予算: 31 章全部を読まない。本スキルは 05/06/07/13/23/25 章のみ参照。
- handoff 保存: 各ゲート通過時に
schemas/handoff.schema.json 準拠で必ず保存。
- manifest 二重管理禁止: 手書き追加後も
lint-manifest-contents.py を必ず通す。
品質ゲート: Elegant Review Protocol
新規/更新/プロンプト改善時は Elegant Review Protocol を適用する。本プロトコルの正本は plugins/harness-creator/skills/run-elegant-review/SKILL.md (Phase 1→2→3 で C1-C4 全 PASS を確認、大規模設計は必須、軽微修正は --fast と整合可)。結果は Step 5 findings に紐付け eval-log/ に残す。
Additional Resources
references/resource-map.yaml を最初に読む (machine-readable と人間向け資料を一覧化)。主要参照:
workflow-manifest.json — Step/Gate/Phase の機械可読定義 (entryHook/exitHook/dependsOn/delegateSkill)
schemas/skill-brief.schema.json — Step 1→2 渡し正本スキーマ
schemas/handoff.schema.json — Gate 通過時 handoff 共通形式
schemas/findings.schema.json — orchestrator handoff envelope (evaluator 集約結果の封筒)。Step 5 producer 出力の正本は ../run-elegant-review/schemas/findings.schema.json
schemas/build-trace.schema.json — Step 2 emit する章別 coverage 形式
schemas/rubric-merge.schema.json — L0/L1/L2 rubric deep-merge 物質化形式
prompts/R1-elicit.md / prompts/R2-gate-review.md / prompts/R3-governance-decide.md — R1/R2/R3 責務別プロンプト
references/gate-templates.md — Gate 確認質問テンプレ (人間向け詳細手順)
- 子スキル:
run-skill-elicit, run-build-skill, run-plugin-package-check, assign-skill-design-evaluator, run-elegant-review, run-skill-rubric-governance, run-skill-rename
- 設計書: 05/06/07/11/13/23/25 章