write-goal について
write-goalは、ユーザーの依頼を簡潔で検証可能なCodex Goalに整えるスキルです。複数段階の作業向けに成果、証拠、制約、範囲、反復方針を定め、依頼がない限りGoalを開始しません。
主な機能
- 01Goalが適切なタスクかを判定
- 02検証可能なCodex Goalの作成
- 03証拠要件と範囲の制約を明記
- 04レビューと中断時の指針を提示
活用シーン
- 01複数段階のコーディング作業に完了基準を設定
- 02デバッグ作業の検証方法を定義
- 03調査や監査の範囲を限定
- 04曖昧な依頼を境界のある目標に整理
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ petekp/ claude-code-setup --skill write-goalインストール後、Claude Code で/write-goalを入力して読み込まれたか確認します。
同梱ファイルagents/openai.yaml
詳細
目標の作成
概要
ユーザーのリクエストを、完了を示す証拠が得られるまで継続作業を導ける、簡潔な Codex Goal にまとめます。Goal を作成しますが、ユーザーから開始または設定を明示的に求められない限り、有効化しないでください。
ワークフロー
- このスキルを呼び出したプロンプトから、実際のタスクを抽出します。スキルへの言及自体は無視してください。
- Goal が適切かどうかを判断します。監査可能な完了条件を備えた、継続的で複数ステップにわたる作業には Goal を使用します。1 行の編集、簡単な説明、または検証可能な完了状態がない漠然とした改善依頼には、通常のプロンプトのほうが適していることを伝え、内容を絞り込んだ最適なプロンプトを提示してください。
- 以下を含む Goal を 1 つ作成します。
- 成果:完了時に満たされているべき状態
- 検証対象:それを証明するテスト、コマンド、成果物、ログ、ベンチマーク、ソースの根拠、またはレビュー結果
- 制約:維持すべき動作、スコープ、公開 API、ファイル、スタイル、予算、安全上の制限
- 境界:許可されるリポジトリ、ファイル、ツール、データ、リソース
- 反復方針:各結果を受けて Codex が次のアクションを選ぶ方法
- ブロック時の停止条件:いつ停止するか、および報告に含める証拠、試した手段、阻害要因、必要な入力
- 証拠要件を満たす範囲で、できるだけ短くまとめます。文中ですでに示されている場合は、すべての要素を列挙しないでください。簡潔な 1 段落を優先します。
- ユーザーが明示的に除外しない限り、デフォルトの敵対的レビューの反復を含めます。
- 必要な詳細が不足している場合は、慎重な仮定を文中に含めます。不足情報によって Goal が安全に実行できない、または検証不可能になる場合に限り、質問してください。
タスクへの適合
- コーディングまたはリファクタリング:必要な動作またはコードの状態、関連するテストやビルドコマンド、スコープの境界、および防ぐべきリグレッションを明記します。
- デバッグまたは不安定なテスト:再現の証拠、対象を絞った検証、リグレッションチェック、および証拠不足がブロッカーとなる時点を含めます。
- 調査または監査:主張の一覧、根拠との対応付け、確信度ラベル、および確認済み・裏付けあり・ブロック中・不確実な主張を分けた最終報告を求めます。
- ドキュメントまたはコンテンツ:成果物、読者が得る結果、情報源の確認、ビルドまたはリンクチェック、用語上の制約を明記します。
- 漠然とした依頼:検証可能な根拠が見込める場合は、明示的な仮定を置いてタスクを絞り込みます。根拠が見込めない場合は、Goal ではなく、内容を絞り込んだ通常のプロンプトを提示します。
- 単発のタスク:無理に Goal にしないでください。通常のプロンプトのほうが適していると伝え、そのプロンプトを提示します。
レビューループ
ユーザーが除外しない限り、以下をデフォルトで使用します。
Before completion, adversarially review the result against this Goal and classify findings by severity. Block completion only on critical and high findings, and resolve all of those. Run at most two review rounds: one to surface issues, one to verify the fixes. Complete when the load-bearing conclusion survives a round unchanged, even if detail-level findings remain. Batch any medium findings into a single final pass with no re-run, and report the rest as residuals rather than looping. Do not restart the round count on a fresh medium in supporting detail.
深刻度は Goal への影響に基づいて判断します。
- 重大または高:目的が達成されていない、証拠が誤っているか不足している、スコープが安全でない、または明記された制約に違反するリグレッションが発生する可能性が高い。
- 中:表面的には合格しても、証拠、スコープ、保守性、またはユーザー向け品質に意味のある不足が残る可能性がある。中程度の指摘は最終パスでまとめて解決します。これだけを理由に完了を妨げたり、レビューラウンドを再開したりはしません。
- 低:完了を妨げない、表現上の仕上げや任意の改善。
Goal の形式
以下の形式を優先します。
/goal <desired end state>, verified by <specific evidence>, while preserving <constraints>. Use <allowed inputs, tools, files, and boundaries>. Between iterations, <how to inspect results and choose the next best action>. Before completion, adversarially review the result against this Goal and resolve all critical and high findings; run at most two review rounds and complete once the core conclusion survives a round unchanged, reporting remaining medium and low findings as residuals rather than looping. If blocked or no defensible path remains, stop with the attempted paths, evidence gathered, unresolved findings, blocker, and next input needed.
監査できる範囲に絞りつつ、Codex が次のアクションを選べる程度の広さを保ってください。ユーザーがすでに指定していない限り、実装手順をすべて細かく指定しないでください。
出力
以下を返します。
Recommended Goal:そのまま使える/goal ...ブロックを 1 つ。Assumptions:重要な不足情報を補った場合に限ります。Why This Works:有用な場合、または要求された場合に限ります。根拠の対象とレビューループを示す短い箇条書きを 1~2 個記載します。
Goal が適切でない場合は、以下を返します。
Better As A Prompt:簡潔な通常のプロンプト。Why Not A Goal:継続的な目標または検証可能な根拠が不足している理由を 1 文で説明します。
回答は簡潔にしてください。ユーザーが求めているのは Goal であり、Goal に関する長い説明ではありません。
例
ユーザープロンプト:
Use $write-goal to turn this into a Goal: keep working on this flaky checkout test until it is fixed or we know exactly why it cannot be fixed.
出力:
推奨される目標:
/goal Make the flaky checkout test pass reliably on the current branch, verified by reproducing the failure when possible and then passing the focused checkout test repeatedly plus the relevant correctness suite, while preserving public checkout behavior and existing test coverage. Use the checkout code, related fixtures, test logs, and local test commands. Between iterations, inspect the latest failure evidence, make the smallest defensible change, rerun focused verification, and update the hypothesis. Before completion, adversarially review the result against this Goal and resolve all critical and high findings; run at most two review rounds and complete once the fix is stable, reporting remaining medium and low findings as residuals rather than looping. If the failure cannot be reproduced or no valid path remains, stop with attempted reproductions, evidence gathered, unresolved findings, blocker, and the next input needed.
ユーザープロンプト:
Use $write-goal: improve the docs for Goals.
出力:
推奨される目標:
/goal Produce a clearer Goals documentation page that explains when to use Goals, the command lifecycle, and two realistic examples, verified by the local docs build and by checking that every referenced command matches current Codex behavior, while preserving existing terminology and avoiding unrelated documentation churn. Use the existing docs, current CLI behavior, and related tests or build commands. Between iterations, compare the page against the intended reader workflow, patch the highest-impact gap, and rerun relevant verification. Before completion, adversarially review the result against this Goal and resolve all critical and high findings; run at most two review rounds and complete once the core conclusion survives a round unchanged, reporting remaining medium and low findings as residuals rather than looping. If verification cannot run or command behavior cannot be confirmed, stop with attempted checks, evidence gathered, unresolved findings, blocker, and the next input needed.
ユーザープロンプト:
Use $write-goal: explain this error message.
出力:
プロンプトとして適切:
Explain this error message in plain English, identify the likely cause, and suggest the next command or file to inspect.
目標に適さない理由:継続的な作業を必要とする永続的な目的がない、一度限りの説明依頼だからです。
コメント
Markdown 対応