goal-prompt

Drafts and formats copy-ready /goal commands for goal mode in Claude Code and Codex.

6.9k|598|Updated Jan 14, 2026
One-click install
npx skills add https://github.com/trailofbits/skills --skill goal-prompt
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: goal-prompt
Source: https://github.com/trailofbits/skills/tree/main/plugins/goal-prompt/skills/goal-prompt
Command: npx skills add https://github.com/trailofbits/skills --skill goal-prompt

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Writing a /goal command that actually terminates is hard: vague objectives loop forever, and lazy models exploit loopholes like deleting code instead of fixing it. This Skill turns a rough task description into a single-line, checkable goal objective with a verifiable end state, explicit checks, invariants, and a stop bound.

Core Features & Use Cases

  • Structured goal drafting: Builds objectives from five elements — end state, scope to read, a stated check with observable output, invariants, and a stop bound or blocked clause.
  • Loophole hardening: Reviews drafts for cheap outs such as deleting call sites, running only a subset of tests, gaming the gate, or claiming completion without running checks.
  • Deterministic formatting: A script normalizes whitespace, strips /goal prefixes and fences, warns on missing stop clauses, and rejects output over 4,000 characters.
  • Use Case: Given "migrate the auth module and keep tests passing", produce a one-line /goal command pairing a zero-matches search for legacyAuth() with npm test exiting 0, plus a 20-turn stop bound.

Quick Start

Ask the agent to turn your task description into a copy-ready /goal command using the goal-prompt skill.

Frequently Asked Questions about goal-prompt

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a /goal command that actually terminates?

State an end state rather than an activity, pair it with an exact check command and its observable result, and always add a stop bound such as "or stop after 20 turns" or a blocked clause. Without a stop bound, a mis-stated condition loops forever.

What makes a good goal prompt for Claude Code goal mode?

A good goal joins an end state, scope to read first, a stated check with shown output, invariants, and a stop bound with AND — never OR, since the loop takes the cheaper branch. Keep it under 4,000 characters and collapse to one terminating criterion when possible.

Why does my goal loop keep running without finishing?

The usual cause is a missing stop bound or blocked clause, or a condition phrased as an activity that can be claimed rather than a verifiable end state. The formatter script warns when no stop clause is detected in the objective.

Can a /goal command exceed 4,000 characters?

No, both Claude Code and Codex cap /goal at 4,000 characters, and the formatter rejects longer output. Move detail into a referenced GOAL.md file and keep the objective itself short.

How do I stop an AI agent from gaming the success checks in a goal?

Pair each check with one that closes the cheapest out — for example, pair a zero-matches search with a test run proving the feature still works, so deleting code cannot satisfy the goal. Always include the invariant not to weaken, skip, or edit the checks themselves.