Agent skill

Goal Prompt Builder

by win4r in win4r/goal-prompt-builder

Build high-quality /goal commands for OpenAI Codex CLI 0.128+ that maximize audit-friendliness and minimize false-completion.

MITAuto-check passedAgent Workflows

Install Goal Prompt Builder

skills CLI
$ npx skills add win4r/goal-prompt-builder --skill goal-prompt-builder -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install win4r/goal-prompt-builder goal-prompt-builder --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/win4r/goal-prompt-builder.git skills-src && mkdir -p .claude/skills && cp -r skills-src/goal-prompt-builder .claude/skills/goal-prompt-builder && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
goal-prompt-builder
GitHub stars
229
Token cost
~3.1k tokens
SKILL.md length
1,550 words
Files
4 (incl. references)
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

Build high-quality /goal commands for OpenAI Codex CLI 0.128+ that maximize audit-friendliness and minimize false-completion.

  • Works in 6 steps: Pick interaction mode → Detect (don't ask) the project type → Pick a scenario template → …
  • The user wants to write
  • SKILL.md covers Why this skill exists, The golden template (5…, Workflow and Project type loading, plus 6 more sections
  • Calls git

What it does

Goal Prompt Builder is an agent skill from win4r/goal-prompt-builder. Build high-quality /goal commands for OpenAI Codex CLI 0.128+ that maximize audit-friendliness and minimize false-completion. Use this skill whenever the user wants to write, draft, generate, improve, or refine a /goal prompt — even if they don't say "skill" — including phrases like "help me write a goal", "design a goal for X", "review my goal command", "make a goal for this repo", or any request involving long-running Codex tasks. Also trigger when the user mentions Ralph loop, persistent agent objectives, or…

Its SKILL.md is about 3.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including reference files (for example `references/examples.md`, `references/project-types.md` and `references/scenarios.md`).

It sits in Agent Workflows, covering Agent instruction files, Autonomous loops and iOS development. It works with Python and Rust. The repository describes itself as: Build audit-friendly /goal prompts for OpenAI Codex. The licence is MIT.

When your agent uses it

  • The user wants to write
  • Refine a /goal prompt — even if they dont say skill — including phrases like help me write a goal
  • Design a goal for X
  • Review my goal command

Example prompts

  • “t say”
  • “— including phrases like”
  • “design a goal for X”
  • “/goal-prompt-builder”

Requirements

  • Python 3
  • Node.js

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Pick interaction mode
  2. Detect (don't ask) the project type
  3. Pick a scenario template
  4. Gather the 5 inputs (in this order)
  5. Predict audit-friendliness
  6. Render and cite design choices

What it can do on your machine

Read from SKILL.md and the folder at commit 8547a60. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Goal Prompt Builder loads about 3.1k tokens when it runs, and up to ~12k if it reads all its reference files. Until then it costs about 243 tokens; SKILL.md has 1,550 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~243
When it runs · the whole SKILL.md, loaded when a task matches
~3.1k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~12k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from win4r/goal-prompt-builder at commit 8547a60, republished under its MIT licence (© win4r). 1,550 words, ~3,091 tokens.

Download SKILL.mdSave it as .claude/skills/goal-prompt-builder/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
goal-prompt-builder
description
Build high-quality /goal commands for OpenAI Codex CLI 0.128+ that maximize audit-friendliness and minimize false-completion. Use this skill whenever the user wants to write, draft, generate, improve, or refine a /goal prompt — even if they don't say "skill" — including phrases like "help me write a goal", "design a goal for X", "review my goal command", "make a goal for this repo", or any request involving long-running Codex tasks. Also trigger when the user mentions Ralph loop, persistent agent objectives, or asks Codex to "keep working until done". Produces a complete, copy-pasteable /goal command using the 5-section golden template (Objective/Scope/Constraints/Done when/Stop if), supports three interaction modes (step-by-step, full-description, hybrid), auto-detects project type (Node/Python/Swift/Go/Rust/static) by inspecting filesystem or repo URL, reads AGENTS.md/CLAUDE.md if present, and predicts audit-friendliness before output.

/goal Prompt Builder

This skill turns a fuzzy task description ("我想让 Codex 帮我重构鉴权") into a complete, audit-friendly /goal command that's ready to paste into Codex CLI 0.128+.

Why this skill exists

Codex 0.128 added /goal as a persistent objective with a runtime-injected audit prompt (continuation.md). The audit prompt forces the model to build a "prompt-to-artifact checklist" — but only if the user's goal text can be mapped to one. Vague goals produce vague checklists, which produce false completions. This skill exists to make sure every /goal you generate has the structure that lets the audit mechanism actually work.

The golden template (5 sections, in this order)

Every /goal Claude generates with this skill follows this structure exactly:

/goal <objective>.

[Optional: First action: read X, Y, Z and report counts. Wait for ack.]

Scope: <files / subsystem / feature area>.

Constraints:
  - <what not to change>
  - <compatibility / permission boundaries>
  - <project-specific 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>
  - <mechanically detectable condition 2>
  ...

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

Why this order: matches continuation.md's expected reading flow — objective first, then scope to bound the search, then constraints to prune options, then acceptance to define success, then stop-if as runtime guards.

Workflow

When this skill triggers, walk the user through these 6 steps. Step 0 (interaction mode) and Step 1 (project detection) happen automatically — Step 0 needs one user choice, Step 1 needs zero if filesystem is accessible. Don't skip steps unless the user explicitly says "I'll fill it in myself, just give me the template".

Step 0: Pick interaction mode

This skill supports three interaction modes. Ask once at the start:

你希望用哪种方式生成 /goal?

  • A. 询问式 — 我一段一段问你(最稳,适合第一次写 /goal)
  • B. 全描述式 — 你一句话描述需求,我拆解后只问你确认不确定的地方(最快,适合熟手)
  • C. 混合式(默认) — 先选场景模板,再问 3-5 个关键问题(推荐)

Once chosen, follow the matching flow:

  • A. 询问式 → Step 1 → Step 2 → Step 3a → 3b → 3c → 3d → 3e → Step 4 → Step 5 (each input gathered separately)
  • B. 全描述式 → Step 1 → ask "用一段话描述你想做什么 / scope / 验收 / 不希望发生什么" → parse into 5 sections → Step 4 → ask user to confirm only the gaps → Step 5
  • C. 混合式 → Step 1 → Step 2 → Step 3 (batched: ask all missing fields at once) → Step 4 → Step 5

Mode B is most powerful when the user has thought about the task. Mode A is safest when they haven't. Mode C is the default sweet spot.

If the user doesn't answer this question explicitly, default to mode C and proceed.

Step 1: Detect (don't ask) the project type

Auto-detection comes first. Only fall back to asking if detection fails.

Run this detection sequence:

  1. Check the conversation context. Has the user already provided a repo URL, file path, or code snippet? Read those for hints first.

  2. Probe the filesystem (if you have file tools and the user is in a project directory):

    • package.json exists → Node / TypeScript
    • pyproject.toml or requirements.txt or setup.py → Python
    • *.xcodeproj/ or Package.swift → Swift / iOS
    • Cargo.toml → Rust
    • go.mod → Go
    • astro.config.* / next.config.* / _config.yml / mkdocs.yml → Static / docs project
  3. Fetch the repo if the user gave a URL (only if web tools available):

    • GitHub URL → fetch the README + try to identify config files
    • Read CLAUDE.md and AGENTS.md if they exist (these are gold for Constraints)
  4. Fall back to asking only if all auto-detection failed:

    我没法自动判断项目类型——这是 Node / Python / Swift / Go / Rust / 静态 / 其他?

When detection succeeds, announce what you found in one sentence so the user can correct you:

检测到这是一个 Swift / iOS 项目(找到 lingolearn.xcodeproj + CLAUDE.md)。 我会按 Swift 项目默认约束适配。如果不对,告诉我。

Then load the matching reference from references/project-types.md. Also load any CLAUDE.md / AGENTS.md found — these contain project-specific rules that override defaults.

Step 2: Pick a scenario template

Ask: 这个 goal 属于哪种类型?

选项说明
A. 重构改一个文件 / 子系统
B. 新功能实现已有 SDD spec 的功能
C. 批量补测试 / 修 bug重复型任务,可枚举来源
D. 代码考古 / 研究只读不动手
E. UI / 行为 audit对照文档审实现
F. 守门员 review评估能否合并,不修改
G. 自定义让我描述

Each option maps to a different default skeleton — see references/scenarios.md for the full templates.

Step 3: Gather the 5 inputs (in this order)

Ask only what's still missing. Don't ask all 5 at once — ask incrementally so the user can think.

3a. Objective (一句话)

  • One sentence describing what changes by the end.
  • If the user gives a verb-less noun phrase ("Cohere rerank support"), turn it into a verb phrase ("Add Cohere rerank support to retrieval pipeline").
  • Reject vague verbs like "improve", "optimize", "clean up" — ask for the concrete change.

3b. Scope (改什么、不改什么)

  • Which files / directories / subsystems are in play
  • For brownfield projects: probe whether v1.x beta files or sensitive modules exist that should be off-limits

3c. Constraints (硬约束)

  • Pull from AGENTS.md / CLAUDE.md if available
  • Add project-type defaults from the loaded reference (e.g., for Swift: "do not modify project.pbxproj")
  • Ask if there's a "MUST NOT modify" list

3d. Done when (验收清单)

  • This is the most important section. Push back hard if items are vague.
  • Each item must cite a file, command, test name, or measurable artifact.
  • Replace "测试通过" → "<exact command> exits 0; paste summary"
  • Replace "做完" → enumerate the deliverables
  • Aim for 5-8 items; fewer than 3 is a red flag

3e. Stop if (停止条件)

  • Each must be mechanically detectable
  • Include project-type defaults (e.g., for Node: "needs npm install for new dep")
  • Include a regression guard: "existing tests start failing — do not fix by editing tests"
Step 4: Predict audit-friendliness

Before showing the final command, internally score it (don't show the math, just the verdict):

  • Acceptance count: 0 = bad, 1-2 = warn, 3-5 = good, 6-8 = excellent
  • Vague verbs detected: "improve", "optimize", "全部", "彻底", "all", "everything" → flag
  • Stop-if specificity: "if unclear" = bad, "if file X appears in git diff" = good
  • Token budget present: missing = warn
  • Mechanical verifiability: every Done-when item has a cite-able artifact = good

If score is below ~70%, don't ship the command yet. Instead, surface the weak spots and ask the user to refine. Be specific:

⚠ 我发现三处可以加强的地方:

  1. Done when 第 2 条"测试覆盖" → 改成"测试名称 + 退出码"会更准
  2. Stop if 缺少"现有测试 regression"兜底
  3. Token 预算未指定,建议 80K(基于 scope 大小)
Show full SKILL.md (632 more words)Show less
Step 5: Render and cite design choices

When all checks pass, render the final /goal in a code block (so it's copy-pasteable) and follow with a brief explanation of the key design choices — not a tutorial, just enough so the user knows why each choice was made.

Format:

/goal <full command here>

几个关键设计选择:

  • 为什么 Done when 第 N 条这么写
  • 为什么 Stop if 包含某条
  • 为什么预算定这个数

Keep this explanation under 8 short lines. The user is here for the command, not a lecture.

Project type loading

When the project type is known, read the corresponding reference:

  • Node / TypeScript → references/project-types.md (Node section)
  • Python → references/project-types.md (Python section)
  • Swift → references/project-types.md (Swift section)
  • Go → references/project-types.md (Go section)
  • Rust → references/project-types.md (Rust section)
  • Static / docs → references/project-types.md (Static section)

Each section provides:

  • Default test command with full flags
  • Default build / type-check command
  • Project-type-specific Stop-if bullets to include
  • Common false-completion traps to guard against

Scenario templates

For the chosen scenario, read the corresponding skeleton:

  • A. 重构 → references/scenarios.md § Refactor
  • B. 新功能实现 → references/scenarios.md § Feature
  • C. 批量补测试 / 修 bug → references/scenarios.md § Batch
  • D. 代码考古 → references/scenarios.md § Archaeology
  • E. UI / 行为 audit → references/scenarios.md § UI Audit
  • F. 守门员 review → references/scenarios.md § Gatekeeper
  • G. 自定义 → use bare 5-section template, no skeleton

Each scenario has its own emphasis — e.g., archaeology goals emphasize Constraints (禁区), feature goals emphasize "First action: read SPEC + report counts".

Worked examples

When the user's case is ambiguous about how to fill a section, consult references/examples.md. It contains 5 end-to-end transformations (vague request → final command) covering the most common patterns:

  • Refactor (Node/TS) — cleanest baseline
  • Feature with SDD spec (Swift) — most heavily constrained
  • Vague request → push back instead of rendering — when not to render
  • Archaeology (static / docs project) — read-only goals
  • "Just give me the template" — when to skip the interview

Especially read example 3 for guidance on when to refuse rendering. Don't ship a goal you can't defend — surface the weak spots and ask for refinement first.

Hard rules (always follow)

These are non-negotiable. They come from continuation.md's actual behavior.

  1. Never write Stop-if as "if unclear, stop" — that's not mechanically detectable. Ask the user to enumerate concrete conditions.
  2. Never let "all / everything / 全部 / 彻底" through — flag and ask for a number or enumerable source.
  3. Always include a token budget — missing budget = no soft stop = potential runaway.
  4. Always include a "no test-rewriting" stop-if for any goal that touches tested code: "Existing tests start failing — this is a regression, do not 'fix' by editing tests."
  5. For SDD-driven goals (scenario B), the first action is always "read X files and report counts" — bypasses @filename reference uncertainty and exposes loading failures early.
  6. For brownfield projects, always ask about MUST NOT modify list — the absence of one is the #1 cause of scope creep.

Common failure modes to coach the user through

  • "测试通过"做验收: too vague. Force into "exact command + exit code + paste summary".
  • 没有 Stop if: goal is a one-way door. Add at least 3 mechanically detectable conditions.
  • 预算 > 300K: too big to audit reliably. Suggest splitting into two goals.
  • Scope = "整个仓库": too wide. Push for a specific directory or subsystem.
  • "我之后再补 acceptance": this is the failure pattern. Refuse to render until at least 3 items exist.

What this skill does NOT do

  • Does not run the /goal for the user — it only generates the text
  • Does not validate the 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 commands

Output format reminder

Final output is always:

  1. A markdown code block containing the /goal command (so the user can copy)
  2. A short bullet list of the key design choices (no more than 8 short lines)
  3. Optional: a one-line "audit-friendliness verdict" (e.g., "审计友好度:优秀 · 7 项验收 · 0 风险标记")

That's it. No long lecture. The user is here for a command.

© win4r, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (references) in goal-prompt-builder of win4r/goal-prompt-builder.

  • SKILL.md
  • references/examples.md
  • references/project-types.md
  • references/scenarios.md

Open the folder on GitHubat commit 8547a60

Compare with similar skills

Goal Prompt Builder next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Goal Prompt Builder compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Goal Prompt Builder this skillwin4r/goal-prompt-builder229—~3.1kAutomated safety check: PassMIT
Project Healthjezweb/claude-skills1.1k—~3kAutomated safety check: PassMIT
Build Teaql Appteaql/teaql-agent-kit2.8k—~4.6kAutomated safety check: PassMIT
Fory Version Bumpapache/fory4.6k—~1.1kAutomated safety check: PassApache-2.0
Fory Performance Optimizationapache/fory4.6k—~2.2kAutomated safety check: PassApache-2.0
Dbgtheodo-group/debug-that158—~2.5kAutomated safety check: PassMIT

Similar skills

  • Project Health

    jezweb/claude-skills

    All-in-one project configuration and health management. An agent skill from jezweb/claude-skills.

    1.1k GitHub stars~3k tokensUpdated yesterday
    Agent WorkflowsAuto-check passed
  • Build Teaql App

    teaql/teaql-agent-kit

    Build or change a TeaQL application in Java, Rust, Go, Swift, Python, C/.NET, or TypeScript, including Kotlin/JVM applications that consume Java-generated libraries.

    2.8k GitHub stars~4.6k tokensUpdated 14 days ago
    MobileAuto-check passed
  • Bump Apache Fory release or post-release development versions across Java, Kotlin, Scala, Python, Rust, Go, C++, C, Dart, JavaScript, Swift, integration tests, examples, and source docs.

    4.6k GitHub stars~1.1k tokensUpdated yesterday
    MobileAuto-check passed
  • Run profile-driven bottleneck optimization across Apache Fory implementations (Java, C++, Python/Cython, Go, Rust, Swift, C, JavaScript/TypeScript, Dart, Kotlin, Scala).

    4.6k GitHub stars~2.2k tokensUpdated yesterday
    MobileAuto-check passed
  • Dbg

    theodo-group/debug-that

    Debug applications using the dbg CLI debugger. An agent skill from theodo-group/debug-that.

    158 GitHub stars~2.5k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Kkrpc Interop

    kunkunsh/kkrpc

    A skill your agent uses when implementing kkrpc clients or servers in non-TypeScript languages, speaking the stable compact protocol, transports, and reference implementations in Go, Python, Rust…

    174 GitHub stars~1.8k tokensUpdated 29 days ago
    Backend & APIsAuto-check passed

Works with

Categories

Questions about Goal Prompt Builder

What does Goal Prompt Builder do?

Build high-quality /goal commands for OpenAI Codex CLI 0.128+ that maximize audit-friendliness and minimize false-completion. Goal Prompt Builder is an agent skill from win4r/goal-prompt-builder.128+ that maximize audit-friendliness and minimize false-completion.

When should I use Goal Prompt Builder?

Goal Prompt Builder fits situations like: the user wants to write; refine a /goal prompt — even if they dont say skill — including phrases like help me write a goal; design a goal for X; review my goal command.

How do I install Goal Prompt Builder in Claude Code?

Run `npx skills add win4r/goal-prompt-builder --skill goal-prompt-builder -a claude-code`. Or copy the skill folder (goal-prompt-builder in win4r/goal-prompt-builder) into .claude/skills/goal-prompt-builder in your project. Claude Code loads it when a task matches its description.

How do I install Goal Prompt Builder in Codex?

Run `npx skills add win4r/goal-prompt-builder --skill goal-prompt-builder -a codex`. Or copy the skill folder (goal-prompt-builder in win4r/goal-prompt-builder) into .agents/skills/goal-prompt-builder in your project. Codex loads it when a task matches its description.

Can I use Goal Prompt Builder in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add win4r/goal-prompt-builder --skill goal-prompt-builder -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/goal-prompt-builder, .gemini/skills/goal-prompt-builder, .github/skills/goal-prompt-builder and .opencode/skills/goal-prompt-builder in your project.

What does Goal Prompt Builder need to run?

Going by SKILL.md and its folder, Goal Prompt Builder needs the command-line tools its instructions call (git). Our summary lists: Python 3; Node.js.

Does Goal Prompt Builder access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Goal Prompt Builder safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Goal Prompt Builder use?

Goal Prompt Builder is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Goal Prompt Builder use?

About 3.1k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 8.5k tokens, read only when the agent opens those files.

What are the alternatives to Goal Prompt Builder?

Skills that share tags, products or a category with Goal Prompt Builder: Project Health (jezweb/claude-skills, 1.1k stars), Build Teaql App (teaql/teaql-agent-kit, 2.8k stars), Fory Version Bump (apache/fory, 4.6k stars) and Fory Performance Optimization (apache/fory, 4.6k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Goal Prompt Builder?

win4r (a GitHub user) maintains it in win4r/goal-prompt-builder, which has 229 GitHub stars. The repository was last updated on May 5, 2026.

Source: win4r/goal-prompt-builder on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.