Goal Prompt Builder logo

Goal Prompt Builder

Community
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 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.

Overview

Publisherwin4r
Repositorygoal-prompt-builder
Skill namegoal-prompt-builder
Stars
229
Forks
20
Bundled files
3
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 3 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by win4r on GitHub. Read the source before you install it.

Installation

Install the Goal Prompt Builder AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/win4r/goal-prompt-builder/tree/main/goal-prompt-builder
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/win4r/goal-prompt-builder.git /tmp/goal-prompt-builder
mkdir -p .claude/skills
cp -r /tmp/goal-prompt-builder/goal-prompt-builder .claude/skills/goal-prompt-builder
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Goal Prompt Builder in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Goal Prompt Builder on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Goal Prompt Builder is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

/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 大小)

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.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Goal Prompt Builder AI skill do?

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 /go...

Why use Goal Prompt Builder on TypingMind?

Because you install it once and use it with any model. Goal Prompt Builder is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Goal Prompt Builder in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/win4r/goal-prompt-builder/tree/main/goal-prompt-builder. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Goal Prompt Builder?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Goal Prompt Builder?

As many as you like. As long as a model supports skills, you can use Goal Prompt Builder with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Goal Prompt Builder AI skill free?

Yes. It is published on GitHub by win4r under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇