goal-prompt-builder

by win4rVerified

Build audit-friendly /goal prompts for OpenAI Codex

225
Stars
19
Forks
8/23/2026
Added
View on GitHubDownload ZIP

⚠️ Third-Party Software Notice

This skill is third-party open-source software developed and hosted independently on GitHub. SkillTip is an informational directory and does not control or maintain the underlying repository. Any security checks displayed are automated and limited in scope. Review the source code before installing.

Read the Terms of Service

Installation

Add to your Claude Code skills directory:

# Add to your Claude Code skills
git clone https://github.com/win4r/goal-prompt-builder

Getting Started

Guides for using skills like goal-prompt-builder.

Security Report

Verified

Last scanned: —

{
  "status": "PASSED",
  "issues": []
}

README.md

goal-prompt-builder

A Claude Skill for writing high-quality /goal prompts that don't go off the rails.

简体中文 · English


OpenAI Codex CLI 0.128 introduced /goal — a persistent agent objective with runtime audit, token budget, and a soft-stop state machine. It can drive a single task for 20+ hours unattended.

But it has one ugly failure mode: write the goal vaguely, and Codex will burn 100K tokens going in the wrong direction, then declare success.

This skill makes that failure mode hard to hit. It walks Claude (or you) through a 5-section golden template (Objective / Scope / Constraints / Done when / Stop if), auto-detects your project type, reads your AGENTS.md / CLAUDE.md, and predicts audit-friendliness before you run the command.


TL;DR

# Install (one-time)
curl -L -o /tmp/goal-prompt-builder.skill \
  https://github.com/win4r/goal-prompt-builder/raw/main/goal-prompt-builder.skill
mkdir -p ~/.claude/skills && unzip -o /tmp/goal-prompt-builder.skill -d ~/.claude/skills/

# Use (in any Claude conversation)
You: help me write a /goal for refactoring the auth module
Claude: [skill triggers, walks you through 6 steps, outputs a paste-ready /goal]

What you get

A .skill bundle containing:

FileLinesPurpose
SKILL.md~250Main routing logic + 6-step workflow
references/project-types.md~260Defaults for Node / Python / Swift / Go / Rust / static
references/scenarios.md~330Skeletons for 7 scenarios (refactor / feature / batch / archaeology / UI audit / gatekeeper / custom)
references/examples.md~2605 worked input→output transformations

Total ~1100 lines of carefully designed prompt engineering — distilled from Codex's actual continuation.md audit prompt, the /goal PR stack (#18073-#18077), and the public issue tracker (#19910, #20656, #20792, #20536).


Why this exists

/goal ships with a built-in audit prompt (continuation.md) that runs after every idle boundary. It tells the model:

Build a prompt-to-artifact checklist that maps every explicit requirement, numbered item, named file, command, test, gate, and deliverable to concrete evidence. Treat uncertainty as not achieved.

This is one of the strongest anti-sandbagging mechanisms ever shipped in an AI coding tool. But it only works if your goal text can be mapped to a checklist.

Most users write goals like:

/goal Fix all the flaky tests and clean up the codebase

The audit can't construct a checklist from "all" or "clean up" — so it falls back to proxy signals like "tests passed" (which can mean "I ran them once and they didn't crash"). Result: the model declares done, you wake up to broken code.

This skill exists to make sure your goal text is always mappable to a real audit checklist.


What the skill does

When triggered, Claude walks 6 steps:

  1. Pick interaction mode — step-by-step, full-description, or hybrid (default)
  2. Auto-detect project type — by inspecting filesystem (package.json, Cargo.toml, *.xcodeproj, etc.) or fetching repo URL. Reads AGENTS.md / CLAUDE.md if present.
  3. Pick scenario template — 7 templates (refactor / SDD feature / batch / archaeology / UI audit / gatekeeper / custom)
  4. Gather 5 inputs — Objective / Scope / Constraints / Done when / Stop if
  5. Predict audit-friendliness — internal scoring; refuses to render if too vague
  6. Render — copy-pasteable /goal + brief design rationale

Output looks like:

/goal <objective>.

First action: [if SDD-driven] read X, Y, Z and report counts. Wait for ack.

Scope: <files / subsystem>.

Constraints:
  - <project-type-specific defaults>
  - <rules from AGENTS.md / CLAUDE.md>

Done when:
  1. <verifiable artifact 1 — cite file or command>
  2. <verifiable artifact 2>
  ...

Stop if:
  - <mechanically detectable condition 1>
  ...

Use a token budget of <N> tokens for this goal.

Installation

Option 1: One-line install (Claude Code / Claude.ai with skill support)

curl -L -o /tmp/goal-prompt-builder.skill \
  https://github.com/win4r/goal-prompt-builder/raw/main/goal-prompt-builder.skill
mkdir -p ~/.claude/skills
unzip -o /tmp/goal-prompt-builder.skill -d ~/.claude/skills/
rm /tmp/goal-prompt-builder.skill

Option 2: Clone and link

git clone https://github.com/win4r/goal-prompt-builder.git
ln -s "$(pwd)/goal-prompt-builder/goal-prompt-builder" ~/.claude/skills/goal-prompt-builder

Option 3: Manual

Download goal-prompt-builder.skill from the latest release (or copy the goal-prompt-builder/ folder from this repo) into your Claude skills directory:

  • Claude Code: ~/.claude/skills/
  • Claude Desktop: see Anthropic's docs
  • Cursor / other clients: check the client's documentation for skill paths

Usage

Once installed, the skill triggers automatically on phrases like:

  • "help me write a /goal for ..."
  • "design a goal for X"
  • "make a /goal command for this repo"
  • "review my goal command"
  • "I want to use /goal to ..."
  • (any mention of long-running Codex tasks)

You don't need to type "use the goal-prompt-builder skill" — Claude will pick it up.

Example session

You: I want to use /goal to add Cohere rerank as a 5th provider to my retrieval pipeline.

Claude (with skill loaded): I'll help you build that. First — interaction mode?
  A. Step-by-step (safest)
  B. Full description (fastest)
  C. Hybrid (default, recommended)

You: C

Claude: [auto-detects Node/TS project from package.json, reads AGENTS.md]
  Detected: Node/TypeScript project. Found AGENTS.md with 3 iron rules.
  This sounds like a "feature implementation" scenario. Do you have a SDD spec
  already, or should we go with a freeform feature template?

You: I have an OpenSpec change at openspec/changes/add-cohere-rerank/

Claude: Perfect — that maps to scenario B (SDD-driven feature). A few questions:
  1. Token budget? (suggest 120K based on scope)
  2. Anything in AGENTS.md that I should pull into Constraints I might miss?
  ...

[after a few rounds]

Claude: Audit-friendliness: 94/100. Here's your /goal:

/goal Implement openspec/changes/add-cohere-rerank/ exactly as specified.

First action: read the 4 spec files + AGENTS.md and report counts. Wait for my acknowledgment before implementation.

Scope: design.md "MUST NOT modify" list strictly enforced.

Constraints:

  • AGENTS.md iron rules are non-negotiable
  • No new npm dependencies
  • Mirror the existing 4 rerank providers' code style

Done when:

  1. Each task in tasks.md checked off, cite file path + commit
  2. Each SHALL has a passing test, cite test name
  3. Each GIVEN/WHEN/THEN scenario covered by integration test
  4. npx tsc --noEmit exits 0
  5. npm test exits 0; paste summary
  6. README.md updated with new provider row
  7. CHANGELOG.md has Unreleased entry

Stop if:

  • A task requires modifying a MUST NOT file
  • SHALLs conflict (escalate, don't decide)
  • npm install needed for new dep
  • Existing rerank provider tests fail
  • jiti cache wasn't cleared before plugin tests

Use a token budget of 120000 tokens.


Key design choices:
- First action enforces read+report — sidesteps `@filename` ref uncertainty
- Each AGENTS.md rule maps to both Constraint AND Stop-if (defense in depth)
- jiti cache rule pulled from CLAUDE.md — easily missed false-completion source

You: [pastes into Codex CLI, walks away for 3 hours, comes back to a green PR]

Why three interaction modes?

ModeWhen to useTime to render
A. Step-by-stepFirst time using /goal; high-stakes refactor~5 min
B. Full descriptionYou've thought through the task; want speed~1 min
C. HybridDaily use; balanced safety + speed~2-3 min

The interaction mode affects how the skill collects your input, not the quality of the output. All three produce equally audit-friendly goals when you give them equal information.


Why auto-detect project type?

Because the Stop if section is where most goals fail — and Stop-if rules are heavily project-type-specific:

  • Swift project? Add "do not modify project.pbxproj" (PBXFileSystemSynchronizedRootGroup will pick up new files automatically)
  • Node project? Add "no npm install for new deps"
  • Python project? Add "no new entries in requirements.txt"
  • iOS project with iPhone simulators? Add "halt if iPhone N simulator unavailable, run xcrun simctl list and let me decide"

Without auto-detection, the user has to remember these. With auto-detection, the skill loads the right defaults silently.

The detection priority:

  1. Filesystem probe — ls for telltale files (package.json, Cargo.toml, etc.)
  2. URL fetch — if user gave a GitHub link, fetch the README
  3. Read AGENTS.md / CLAUDE.md if present (these contain project-specific rules that override defaults)
  4. Fallback — ask the user

If detection succeeds, the skill announces what it found so you can correct it before proceeding.


What the skill does NOT do

  • ❌ Does not run /goal for you — only generates the prompt text
  • ❌ Does not validate your project state (no git status checks, no test runs)
  • ❌ Does not handle Codex versions older than 0.128 (/goal doesn't exist there)
  • ❌ Does not generate prompts for /plan, /compact, or other Codex slash commands

Hard rules baked into the skill

These come from analyzing Codex's actual continuation.md audit prompt:

  1. Reject vague verbs — "improve", "optimize", "clean up", "all", "everything", "全部", "彻底" trigger pushback
  2. Force token budgets — missing budget = no soft stop = potential runaway
  3. Force regression guards — any goal touching tested code gets a "do not edit tests to make them pass" stop-if
  4. Force read+report first for SDD-driven goals — sidesteps @filename reference uncertainty
  5. Force "MUST NOT modify" probing for brownfield projects — #1 cause of scope creep
  6. Refuse to render if audit-friendliness score < 70%

The full rule set is in goal-prompt-builder/SKILL.md under "Hard rules".


Compatibility

  • Codex CLI: 0.128.0+ (where /goal exists)
  • Claude: any client that supports Claude Skills (Claude Code, Claude Desktop, Claude.ai with skill support)
  • Project types tested: Node, Python, Swift / iOS, Go, Rust, static / docs sites
  • Languages: skill is bilingual (English + Chinese); generates prompts in either based on user input

Repository structure

goal-prompt-builder/
├── README.md                       (this file)
├── README_CN.md                    (中文版)
├── LICENSE                         (MIT)
├── goal-prompt-builder.skill       (packaged, ready to install)
└── goal-prompt-builder/            (source)
    ├── SKILL.md                    (main skill — routing + 6-step workflow)
    └── references/
        ├── project-types.md        (per-language defaults)
        ├── scenarios.md            (7 scenario skeletons)
        └── examples.md             (5 worked examples)

Updating

The .skill file is just a zip of the goal-prompt-builder/ folder. To rebuild after editing:

cd goal-prompt-builder
zip -r goal-prompt-builder.skill goal-prompt-builder/ \
  -x "*.DS_Store" "*__pycache__*"

Or use Anthropic's official package_skill.py from the skill-creator skill for validation + packaging in one step.


Background reading

If you want to understand why the skill is shaped the way it is:

  • Codex 0.128 changelog — official /goal announcement
  • PR #18073-#18077 — the 5-PR stack that built /goal
  • continuation.md template — the audit prompt that runs every idle boundary (commit 6014b66)
  • Issue #20536/goal documentation gap
  • Issue #20656 — Plan-mode silently suppresses goal continuation
  • Issue #20792/goal-first sessions missing from codex resume lists
  • Issue #19910 — mid-turn /compact loses goal context
  • Simon Willison's writeup — the best public explainer (Apr 30, 2026)

License

MIT — see LICENSE. Use it however you want, including commercially.


Contributing

PRs welcome, especially:

  • New project type defaults (Elixir, Ruby, Java, Kotlin, etc.)
  • New scenario skeletons not covered by the current 7
  • Worked examples from your real production goals
  • Translation of SKILL.md into other languages (Japanese, Korean, etc.)

For bugs or proposed changes to the core 6-step workflow, please open an issue first to discuss.


Related


Built for developers who got tired of /goal jobs running 4 hours and producing the wrong thing.

Frequently Asked Questions

What is goal-prompt-builder?

goal-prompt-builder is an open-source cli tools skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by win4r. Build audit-friendly /goal prompts for OpenAI Codex. It has 225 GitHub stars.

Is goal-prompt-builder safe to use?

Yes. goal-prompt-builder passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.

How do I install goal-prompt-builder?

Clone the repository with "git clone https://github.com/win4r/goal-prompt-builder" and add it to your Claude Code skills directory (see the Installation section above).

Are there alternatives to goal-prompt-builder?

Yes. SkillsLLM lists many other CLI Tools skills you can browse and compare side by side. Open the CLI Tools category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh goal-prompt-builder against similar tools.

Comments (0)

No comments yet. Be the first to share your thoughts!

ui-ux-pro-max-skill

by nextlevelbuilder

12

An AI skill that provides design intelligence for building professional UI/UX across multiple platforms.

119,92012,870Python
CLI Toolsai-skillsantigravity
View details

happy

by slopus

Mobile and Web client for Codex and Claude Code, with realtime voice, encryption and fully featured

23,4501,980TypeScript
CLI Tools
View details

claudecodeui

by siteboon

Use Claude Code, OpenCode, Cursor CLI, and Codex on mobile and web with CloudCLI (aka Claude Code UI). CloudCLI is a free open source webui/GUI that helps you manage your Claude Code session and projects remotely.

13,3941,866TypeScript
CLI Tools
View details

CRS-自建Claude Code镜像,一站式开源中转服务,让 Claude、OpenAI、Gemini、Droid 订阅统一接入,支持拼车共享,更高效分摊成本,原生工具无缝使用。

12,5471,869JavaScript
CLI Tools
View details

ccstatusline

by sirmalloc

🚀 Beautiful highly customizable statusline for Claude Code CLI with powerline support, themes, and more.

12,508545TypeScript
CLI Tools
View details

Developers Also Liked

Based on votes and bookmarks from developers who liked this skill

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI Agentsai-agentsanthropicclaude-code
View details
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI Agentsai-agentsbrainstorming
View details

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP Serversapisai-tools
View details

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI Agentsai-agentsanthropicclaude-code
View details

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI Agentsclaude-codeai-tools
View details