Communityライティング&編集github.com

trailofbits/goal-prompt

Claude Code と Codex の goal モード向けに、コピペですぐ使える /goal コマンドを下書きします。ユーザーが goal プロンプト、goal 条件、/goal コマンド、goal モードの目標、またはコピーして使える長時間実行タスクの目標を作成、記述、書き直し、改善、圧縮、整理、準備するよう依頼した場合に使用します。

goal-prompt とは?

このスキルは、AI エージェント(Claude Code や Codex)の goal モードで使用する `/goal` コマンドを、適切に構造化・整形して生成するための支援ツールです。エージェントが自律的に作業を完了するための終了条件を、コピー&ペースト可能な形式で提供します。 主な特徴として、終了条件を「アクティビティ」ではなく「確認可能な最終状態」として定義すること、最初に読むべきスコープを明示すること、検証コマンドとその観測可能な結果を含めること、不変条件(例:テストを弱めない)を追加すること、そして無限ループを防ぐための停止条件を必須とすることが挙げられます。 また、エージェントが不正な処理(テストの削除やスキップなど)を行わないようにするための「簡単な抜け道を塞ぐ」テクニックや、セキュリティ監査の goal を安全に設計するためのガイドラインも提供します。 出力は専用のフォーマットスクリプトによって 1 行(最大 4000 文字)に正規化され、不足している要素があれば `Missing:` リストとしてユーザーに通知します。

対応✓Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/trailofbits/skills/tree/main/plugins/goal-prompt/skills/goal-prompt

Installed? Explore more ライティング&編集 skills: steipete/notion, langchain-ai/langchain, bytedance/podcast-generation · View all 6 →

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

Goal Prompt

/goal は、完了条件が満たされるまでエージェントを動作させ続けます。Claude Code と Codex はどちらも 1 行、最大 4,000 文字として受け取ります。Claude Code では、各ターン後にトランスクリプトのみから小さなモデルが条件を再評価します — コマンドを実行することはできません。

終了可能な条件をドラフトし、それを整形します。goal は 1 ターンより大きな作業に適合し、確認可能なゴールラインを設定します。巨大な goal を 1 つ書くのではなく、小さな goal を連鎖させ、それらの間にレビューを挟みます。

ドラフト

AND で結合します — 「or」は決して使わないでください。ループは安い方の分岐を取ります:

  1. アクティビティではなく、終了状態 — 「auth コードを移行する」ではなく、「すべての legacyAuth() 呼び出し箇所が auth.verify() を使っている」。アクティビティは主張できますが、終了状態は真または偽です。
  2. 最初に読むスコープ — 行動する前に読むファイル、issue、ログ、または計画。
  3. 明示されたチェック — 正確なコマンドとその観測可能な結果(「npm test が 0 で終了する」)、さらにそれを実行して出力を表示する指示。トランスクリプトに決して現れない結果は、評価者にとって存在しません。
  4. 不変条件 — 変更してはならないもの(「vendor/ を変更せずに」)、常に「チェック自体を弱めたり、スキップしたり、編集したりしない」を含めます。
  5. 停止条件またはブロック句 — 「または 20 ターン後に停止」、「ブロックされた場合は停止してブロッカーを報告」。これがないと、誤った条件が無限ループを引き起こします。フォーマッタはこれが欠けている場合に警告します。(Claude Code はセッション再開時にターンカウンタをリセットするため、ターンバウンドは再開をまたいで暗黙的に延長されます。)

小さく保ってください。 すべての制約は、モデルが探索できる状態空間を狭めます。可能な場合は 1 つの終了条件にまとめ、スコープと定義は参照ファイルに移動し、非目標を削除します — 制約は、実際の簡単な抜け道を塞ぐ場合にのみその価値を発揮します。

長い goal の場合は、最終的な証拠(diff、レポート、アーティファクト)に名前を付け、進捗ログファイルを要求します — これは圧縮と再開にわたって持続する状態です。概要が 4,000 文字を超える場合は、詳細を GOAL.md に入れ、そのファイルを objective から参照します。

不足している要素を決して発明しないでください。 すべての要素をユーザーのリクエスト、会話、またはリポジトリに基づかせてください — 推測ではなく調査してください。利用可能な情報から要素を埋められない場合は、それでもユーザーが提供したものを最適化して整形し、その要素を省略し、不足としてフラグを立てます(フォーマットを参照)。発明された成功条件を持つ goal は、間違った契約で終了します。

簡単な抜け道を塞ぐ

整形する前に、ドラフトした条件を怠惰なモデルのように読み直してください:意図された作業を行わずにすべてのチェックを通過させる最も安い方法は何ですか?最も安い方法を塞ぎます — 制約を追加するよりも、既存のチェックをペアリングすることを優先し、考えられるすべての抜け道を非目標リストに列挙しないでください。繰り返し発生する抜け道:

  • 修正ではなく削除またはスタブ化 — 「検索で何も表示されない」は、呼び出し元が存在しない場合にも成立します。そのようなチェックは、機能がまだ動作していることを証明するチェックとペアにします。
  • サブセットで合格 — 1 つのテストファイルだけを実行する、検索パスを狭める、チェックからディレクトリを除外する。
  • ゲートをごまかす — テストをスキップ/xfail する、期待される出力をハードコードする、テスト入力を特殊ケース化する、チェックを編集する(不変条件ルール)。
  • 実行せずに主張 — トランスクリプトにチェック出力がないまま、完了またはブロックされたと宣言する(出力表示ルール)。

上記と同じ規律:利用可能な情報から塞げない抜け道は、警告として Missing: リストに入れます — 発明されたり馬鹿げた制約は、フラグが立てられたギャップよりも悪いです。

セキュリティ研究の goal

監査の goal は 1 つの終了条件にまとめます。例えば、参照される脅威モデルファイルの下で有効な 1 つの高深刻度の脆弱性を特定、トリガー、検証することです。そのファイル(goal ではありません)に、スコープ、攻撃者の能力、深刻度のベースライン、およびスキップする既知の調査結果を記述します。中立的な表現を使用し(「これが悪用可能であることを証明する」ではなく「トリガーして検証する」)、事前条件の実証を要求します — 想定された攻撃者アクセスは最も一般的な false positive です — そして未トリアージのレポートが積み重なるのを防ぐため、発見ごとに人間のレビューのために停止します。発見は、発見者単独ではなく、新しいエージェントによる 2 回目のパスで検証します。

フォーマット

ドラフト(ファイルまたは標準入力)に対して uv run --no-project {baseDir}/scripts/format_goal_prompt.py --fenced を実行します。これにより、空白が 1 行にまとめられ、/goal プレフィックス、引用符、フェンスが削除され、stop 句がない場合に警告し、4,000 文字を超える出力を拒否します — 短くするか、詳細をファイルに移動して再実行します。

正確に 1 つのフェンスで囲まれた text ブロックを 1 行で返します:

/goal <単一の正規化された objective>

その周りに散文を追加しないでください — ただし、チェックリストの要素が根拠付けられなかった場合を除きます:その場合は、ブロックの後に Missing: リストを、ギャップごとに 1 行、ユーザーが提供すべきものを伝えて続けます。

例

ドラフト:

/goal auth モジュールを移行する:
  - legacyAuth() を auth.verify() に置き換える
  - テストがまだ動作することを確認する

再ドラフトして整形:

/goal すべての legacyAuth() 呼び出し箇所が auth.verify() を使用:`rg "legacyAuth\(" -t ts` で何も表示されず AND `npm test` が 0 で終了する(両方を実行し、出力を表示)、vendor/ を変更したりテストを弱めたりしない。ブロックされた場合は、試行したパスとブロッカーを報告して停止する。または 20 ターン後に停止する。

ここで npm test はリポジトリの package.json から来たものであり — 推測ではありません — そしてそれをゼロマッチのチェックとペアにすることで、最も安い抜け道である「呼び出し箇所を移行するのではなく削除する」を塞いでいます。要素を根拠付けられるものがない場合、存在するものを整形し、ギャップにフラグを立てます:

ドラフト:チェックアウトを速くする、コンテキスト内にメトリックやベンチマークがない場合:

/goal チェックアウトを速くする

Missing:

  • 測定可能な終了状態 — どのメトリックとしきい値が「速い」と見なされるか
  • 検証 — それを証明するベンチマークまたはコマンド
  • 停止条件 — 例:「または 20 ターン後に停止」

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

trailofbits/address-sanitizer

AddressSanitizer detects memory errors during fuzzing. Use when fuzzing C/C++ code to find buffer overflows and use-after-free bugs.

trailofbits/aflpp

AFL++ is a fork of AFL with better fuzzing performance and advanced features. Use for multi-core fuzzing of C/C++ projects.

trailofbits/agentic-actions-auditor

Audits GitHub Actions workflows for security vulnerabilities in AI agent integrations including Claude Code Action, Gemini CLI, OpenAI Codex, and GitHub AI Inference. Detects attack vectors where attacker-controlled input reaches AI agents running in CI/CD pipelines, including env var intermediary patterns, direct expression injection, dangerous sandbox configurations, and wildcard user allowlists. Use when reviewing workflow files that invoke AI coding agents, auditing CI/CD pipeline security for prompt injection risks, or evaluating agentic action configurations.

trailofbits/algorand-vulnerability-scanner

Scans Algorand smart contracts for 11 common vulnerabilities including rekeying attacks, unchecked transaction fees, missing field validations, and access control issues. Use when auditing Algorand projects (TEAL/PyTeal).

trailofbits/ask-questions-if-underspecified

Clarify requirements before implementing. Use when serious doubts arise.

trailofbits/atheris

Atheris is a coverage-guided Python fuzzer based on libFuzzer. Use for fuzzing pure Python code and Python C extensions.

trailofbits/audit-augmentation

Augments Trailmark code graphs with external audit findings from SARIF static analysis results and weAudit annotation files. Maps findings to graph nodes by file and line overlap, creates severity-based subgraphs, and enables cross-referencing findings with pre-analysis data (blast radius, taint, etc.). Use when projecting SARIF results onto a code graph, overlaying weAudit annotations, cross-referencing Semgrep or CodeQL findings with call graph data, or visualizing audit findings in the context of code structure.

trailofbits/audit-context-building

Enables ultra-granular, line-by-line code analysis to build deep architectural context before vulnerability or bug finding.

trailofbits/audit-prep-assistant

Prepares codebases for security review using Trail of Bits' checklist. Helps set review goals, runs static analysis tools, increases test coverage, removes dead code, ensures accessibility, and generates documentation (flowcharts, user stories, inline comments).

trailofbits/burpsuite-project-parser

Searches and explores Burp Suite project files (.burp) from the command line. Use when searching response headers or bodies with regex patterns, extracting security audit findings, dumping proxy history or site map data, or analyzing HTTP traffic captured in a Burp project.

trailofbits/cairo-vulnerability-scanner

Scans Cairo/StarkNet smart contracts for 6 critical vulnerabilities including felt252 arithmetic overflow, L1-L2 messaging issues, address conversion problems, and signature replay. Use when auditing StarkNet projects.

trailofbits/cargo-fuzz

cargo-fuzz is the de facto fuzzing tool for Rust projects using Cargo. Use for fuzzing Rust code with libFuzzer backend.

trailofbits/chrome-mcp-troubleshooting

Diagnose and fix Claude in Chrome MCP extension connectivity issues. Use when mcp__claude-in-chrome__* tools fail, return "Browser extension is not connected", or behave erratically.

trailofbits/claude-in-chrome-troubleshooting

Diagnose and fix Claude in Chrome MCP extension connectivity issues. Use when mcp__claude-in-chrome__* tools fail, return "Browser extension is not connected", or behave erratically.

trailofbits/code-improver

Runs an autonomous review-and-fix improvement loop over any code target — a skill, plugin, module, or directory — using a reviewer the user names: any installed skill or agent. Keeps a cross-round findings ledger, escalates when fixes stop converging, and guards scope mechanically. Use when asked to 'improve this code until review passes', 'run an improvement loop with <reviewer>', or to iterate review-and-fix with a specific reviewer. For skills prefer the skill-improver entry; for a branch prefer pr-improver.

trailofbits/code-maturity-assessor

Systematic code maturity assessment using Trail of Bits' 9-category framework. Analyzes codebase for arithmetic safety, auditing practices, access controls, complexity, decentralization, documentation, MEV risks, low-level code, and testing. Produces professional scorecard with evidence-based ratings and actionable recommendations.

trailofbits/codeql

Scans a codebase for security vulnerabilities using CodeQL's interprocedural data flow and taint tracking analysis. Triggers on "run codeql", "codeql scan", "codeql analysis", "build codeql database", or "find vulnerabilities with codeql". Supports "run all" (security-and-quality + security-experimental suites) and "important only" (high-precision security findings) scan modes. Also handles creating data extension models and processing CodeQL SARIF output.

trailofbits/constant-time-analysis

Detects timing side-channel vulnerabilities in cryptographic code. Use when implementing or reviewing crypto code, encountering division on secrets, secret-dependent branches, or constant-time programming questions in C, C++, Go, Rust, Swift, Java, Kotlin, C#, PHP, JavaScript, TypeScript, Python, or Ruby.

trailofbits/constant-time-testing

Constant-time testing detects timing side channels in cryptographic code. Use when auditing crypto implementations for timing vulnerabilities.

trailofbits/cosmos-vulnerability-scanner

Scans Cosmos SDK blockchain modules and CosmWasm contracts for consensus-critical vulnerabilities — chain halts, fund loss, state divergence. 25 core + 16 IBC + 10 EVM + 3 CosmWasm patterns. Use when auditing custom x/ modules, reviewing IBC integrations, or assessing pre-launch chain security. Updated for SDK v0.53.x.

関連スキル