[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-78030":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":10,"languages":10,"totalLinesOfCode":10,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":12,"stars7d":16,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":18,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":21,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":28,"readmeContent":29,"aiSummary":30,"trendingCount":15,"starSnapshotCount":15,"syncStatus":31,"lastSyncTime":32,"discoverSource":33},78030,"goal-prompt-builder","win4r\u002Fgoal-prompt-builder","win4r","Build audit-friendly \u002Fgoal prompts for OpenAI Codex","https:\u002F\u002Fyoutu.be\u002FsAYM1xvDXw4",null,167,14,106,1,0,18,61,42,3.53,"MIT License",false,"main",true,[25,26,27],"codex","codex-cli","codex-skill","2026-06-12 02:03:45","# goal-prompt-builder\n\n> **A Claude Skill for writing high-quality `\u002Fgoal` prompts that don't go off the rails.**\n\n[简体中文](.\u002FREADME_CN.md) · English\n\n---\n\nOpenAI Codex CLI 0.128 introduced `\u002Fgoal` — 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**.\n\nBut it has one ugly failure mode: write the goal vaguely, and Codex will burn 100K tokens going in the wrong direction, then declare success.\n\nThis skill makes that failure mode hard to hit. It walks Claude (or you) through a **5-section golden template** (Objective \u002F Scope \u002F Constraints \u002F Done when \u002F Stop if), auto-detects your project type, reads your `AGENTS.md` \u002F `CLAUDE.md`, and predicts audit-friendliness *before* you run the command.\n\n---\n\n## TL;DR\n\n```bash\n# Install (one-time)\ncurl -L -o \u002Ftmp\u002Fgoal-prompt-builder.skill \\\n  https:\u002F\u002Fgithub.com\u002Fwin4r\u002Fgoal-prompt-builder\u002Fraw\u002Fmain\u002Fgoal-prompt-builder.skill\nmkdir -p ~\u002F.claude\u002Fskills && unzip -o \u002Ftmp\u002Fgoal-prompt-builder.skill -d ~\u002F.claude\u002Fskills\u002F\n\n# Use (in any Claude conversation)\nYou: help me write a \u002Fgoal for refactoring the auth module\nClaude: [skill triggers, walks you through 6 steps, outputs a paste-ready \u002Fgoal]\n```\n\n---\n\n## What you get\n\nA `.skill` bundle containing:\n\n| File | Lines | Purpose |\n|---|---|---|\n| `SKILL.md` | ~250 | Main routing logic + 6-step workflow |\n| `references\u002Fproject-types.md` | ~260 | Defaults for Node \u002F Python \u002F Swift \u002F Go \u002F Rust \u002F static |\n| `references\u002Fscenarios.md` | ~330 | Skeletons for 7 scenarios (refactor \u002F feature \u002F batch \u002F archaeology \u002F UI audit \u002F gatekeeper \u002F custom) |\n| `references\u002Fexamples.md` | ~260 | 5 worked input→output transformations |\n\nTotal ~1100 lines of carefully designed prompt engineering — distilled from Codex's actual `continuation.md` audit prompt, the `\u002Fgoal` PR stack (#18073-#18077), and the public issue tracker (#19910, #20656, #20792, #20536).\n\n---\n\n## Why this exists\n\n`\u002Fgoal` ships with a built-in audit prompt (`continuation.md`) that runs after every idle boundary. It tells the model:\n\n> 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.**\n\nThis 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.**\n\nMost users write goals like:\n```\n\u002Fgoal Fix all the flaky tests and clean up the codebase\n```\n\nThe 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.\n\nThis skill exists to make sure your goal text is **always** mappable to a real audit checklist.\n\n---\n\n## What the skill does\n\nWhen triggered, Claude walks 6 steps:\n\n1. **Pick interaction mode** — step-by-step, full-description, or hybrid (default)\n2. **Auto-detect project type** — by inspecting filesystem (`package.json`, `Cargo.toml`, `*.xcodeproj`, etc.) or fetching repo URL. Reads `AGENTS.md` \u002F `CLAUDE.md` if present.\n3. **Pick scenario template** — 7 templates (refactor \u002F SDD feature \u002F batch \u002F archaeology \u002F UI audit \u002F gatekeeper \u002F custom)\n4. **Gather 5 inputs** — Objective \u002F Scope \u002F Constraints \u002F Done when \u002F Stop if\n5. **Predict audit-friendliness** — internal scoring; refuses to render if too vague\n6. **Render** — copy-pasteable `\u002Fgoal` + brief design rationale\n\nOutput looks like:\n\n```\n\u002Fgoal \u003Cobjective>.\n\nFirst action: [if SDD-driven] read X, Y, Z and report counts. Wait for ack.\n\nScope: \u003Cfiles \u002F subsystem>.\n\nConstraints:\n  - \u003Cproject-type-specific defaults>\n  - \u003Crules from AGENTS.md \u002F CLAUDE.md>\n\nDone when:\n  1. \u003Cverifiable artifact 1 — cite file or command>\n  2. \u003Cverifiable artifact 2>\n  ...\n\nStop if:\n  - \u003Cmechanically detectable condition 1>\n  ...\n\nUse a token budget of \u003CN> tokens for this goal.\n```\n\n---\n\n## Installation\n\n### Option 1: One-line install (Claude Code \u002F Claude.ai with skill support)\n\n```bash\ncurl -L -o \u002Ftmp\u002Fgoal-prompt-builder.skill \\\n  https:\u002F\u002Fgithub.com\u002Fwin4r\u002Fgoal-prompt-builder\u002Fraw\u002Fmain\u002Fgoal-prompt-builder.skill\nmkdir -p ~\u002F.claude\u002Fskills\nunzip -o \u002Ftmp\u002Fgoal-prompt-builder.skill -d ~\u002F.claude\u002Fskills\u002F\nrm \u002Ftmp\u002Fgoal-prompt-builder.skill\n```\n\n### Option 2: Clone and link\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fwin4r\u002Fgoal-prompt-builder.git\nln -s \"$(pwd)\u002Fgoal-prompt-builder\u002Fgoal-prompt-builder\" ~\u002F.claude\u002Fskills\u002Fgoal-prompt-builder\n```\n\n### Option 3: Manual\n\nDownload `goal-prompt-builder.skill` from [the latest release](https:\u002F\u002Fgithub.com\u002Fwin4r\u002Fgoal-prompt-builder\u002Freleases) (or copy the `goal-prompt-builder\u002F` folder from this repo) into your Claude skills directory:\n\n- **Claude Code**: `~\u002F.claude\u002Fskills\u002F`\n- **Claude Desktop**: see [Anthropic's docs](https:\u002F\u002Fdocs.claude.com)\n- **Cursor \u002F other clients**: check the client's documentation for skill paths\n\n---\n\n## Usage\n\nOnce installed, the skill triggers automatically on phrases like:\n\n- \"help me write a \u002Fgoal for ...\"\n- \"design a goal for X\"\n- \"make a \u002Fgoal command for this repo\"\n- \"review my goal command\"\n- \"I want to use \u002Fgoal to ...\"\n- (any mention of long-running Codex tasks)\n\nYou don't need to type \"use the goal-prompt-builder skill\" — Claude will pick it up.\n\n### Example session\n\n```\nYou: I want to use \u002Fgoal to add Cohere rerank as a 5th provider to my retrieval pipeline.\n\nClaude (with skill loaded): I'll help you build that. First — interaction mode?\n  A. Step-by-step (safest)\n  B. Full description (fastest)\n  C. Hybrid (default, recommended)\n\nYou: C\n\nClaude: [auto-detects Node\u002FTS project from package.json, reads AGENTS.md]\n  Detected: Node\u002FTypeScript project. Found AGENTS.md with 3 iron rules.\n  This sounds like a \"feature implementation\" scenario. Do you have a SDD spec\n  already, or should we go with a freeform feature template?\n\nYou: I have an OpenSpec change at openspec\u002Fchanges\u002Fadd-cohere-rerank\u002F\n\nClaude: Perfect — that maps to scenario B (SDD-driven feature). A few questions:\n  1. Token budget? (suggest 120K based on scope)\n  2. Anything in AGENTS.md that I should pull into Constraints I might miss?\n  ...\n\n[after a few rounds]\n\nClaude: Audit-friendliness: 94\u002F100. Here's your \u002Fgoal:\n\n```\n\u002Fgoal Implement openspec\u002Fchanges\u002Fadd-cohere-rerank\u002F exactly as specified.\n\nFirst action: read the 4 spec files + AGENTS.md and report counts.\nWait for my acknowledgment before implementation.\n\nScope: design.md \"MUST NOT modify\" list strictly enforced.\n\nConstraints:\n  - AGENTS.md iron rules are non-negotiable\n  - No new npm dependencies\n  - Mirror the existing 4 rerank providers' code style\n\nDone when:\n  1. Each task in tasks.md checked off, cite file path + commit\n  2. Each SHALL has a passing test, cite test name\n  3. Each GIVEN\u002FWHEN\u002FTHEN scenario covered by integration test\n  4. `npx tsc --noEmit` exits 0\n  5. `npm test` exits 0; paste summary\n  6. README.md updated with new provider row\n  7. CHANGELOG.md has Unreleased entry\n\nStop if:\n  - A task requires modifying a MUST NOT file\n  - SHALLs conflict (escalate, don't decide)\n  - npm install needed for new dep\n  - Existing rerank provider tests fail\n  - jiti cache wasn't cleared before plugin tests\n\nUse a token budget of 120000 tokens.\n```\n\nKey design choices:\n- First action enforces read+report — sidesteps `@filename` ref uncertainty\n- Each AGENTS.md rule maps to both Constraint AND Stop-if (defense in depth)\n- jiti cache rule pulled from CLAUDE.md — easily missed false-completion source\n\nYou: [pastes into Codex CLI, walks away for 3 hours, comes back to a green PR]\n```\n\n---\n\n## Why three interaction modes?\n\n| Mode | When to use | Time to render |\n|---|---|---|\n| **A. Step-by-step** | First time using `\u002Fgoal`; high-stakes refactor | ~5 min |\n| **B. Full description** | You've thought through the task; want speed | ~1 min |\n| **C. Hybrid** | Daily use; balanced safety + speed | ~2-3 min |\n\nThe 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.\n\n---\n\n## Why auto-detect project type?\n\nBecause the **Stop if** section is where most goals fail — and Stop-if rules are heavily project-type-specific:\n\n- Swift project? Add \"do not modify `project.pbxproj`\" (PBXFileSystemSynchronizedRootGroup will pick up new files automatically)\n- Node project? Add \"no `npm install` for new deps\"\n- Python project? Add \"no new entries in `requirements.txt`\"\n- iOS project with iPhone simulators? Add \"halt if iPhone N simulator unavailable, run `xcrun simctl list` and let me decide\"\n\nWithout auto-detection, the user has to remember these. With auto-detection, the skill loads the right defaults silently.\n\nThe detection priority:\n1. Filesystem probe — `ls` for telltale files (`package.json`, `Cargo.toml`, etc.)\n2. URL fetch — if user gave a GitHub link, fetch the README\n3. Read `AGENTS.md` \u002F `CLAUDE.md` if present (these contain project-specific rules that override defaults)\n4. Fallback — ask the user\n\nIf detection succeeds, the skill **announces what it found** so you can correct it before proceeding.\n\n---\n\n## What the skill does NOT do\n\n- ❌ Does not run `\u002Fgoal` for you — only generates the prompt text\n- ❌ Does not validate your project state (no `git status` checks, no test runs)\n- ❌ Does not handle Codex versions older than 0.128 (`\u002Fgoal` doesn't exist there)\n- ❌ Does not generate prompts for `\u002Fplan`, `\u002Fcompact`, or other Codex slash commands\n\n---\n\n## Hard rules baked into the skill\n\nThese come from analyzing Codex's actual `continuation.md` audit prompt:\n\n1. **Reject vague verbs** — \"improve\", \"optimize\", \"clean up\", \"all\", \"everything\", \"全部\", \"彻底\" trigger pushback\n2. **Force token budgets** — missing budget = no soft stop = potential runaway\n3. **Force regression guards** — any goal touching tested code gets a \"do not edit tests to make them pass\" stop-if\n4. **Force read+report first** for SDD-driven goals — sidesteps `@filename` reference uncertainty\n5. **Force \"MUST NOT modify\" probing** for brownfield projects — #1 cause of scope creep\n6. **Refuse to render** if audit-friendliness score \u003C 70%\n\nThe full rule set is in `goal-prompt-builder\u002FSKILL.md` under \"Hard rules\".\n\n---\n\n## Compatibility\n\n- **Codex CLI**: 0.128.0+ (where `\u002Fgoal` exists)\n- **Claude**: any client that supports Claude Skills (Claude Code, Claude Desktop, Claude.ai with skill support)\n- **Project types tested**: Node, Python, Swift \u002F iOS, Go, Rust, static \u002F docs sites\n- **Languages**: skill is bilingual (English + Chinese); generates prompts in either based on user input\n\n---\n\n## Repository structure\n\n```\ngoal-prompt-builder\u002F\n├── README.md                       (this file)\n├── README_CN.md                    (中文版)\n├── LICENSE                         (MIT)\n├── goal-prompt-builder.skill       (packaged, ready to install)\n└── goal-prompt-builder\u002F            (source)\n    ├── SKILL.md                    (main skill — routing + 6-step workflow)\n    └── references\u002F\n        ├── project-types.md        (per-language defaults)\n        ├── scenarios.md            (7 scenario skeletons)\n        └── examples.md             (5 worked examples)\n```\n\n---\n\n## Updating\n\nThe `.skill` file is just a zip of the `goal-prompt-builder\u002F` folder. To rebuild after editing:\n\n```bash\ncd goal-prompt-builder\nzip -r goal-prompt-builder.skill goal-prompt-builder\u002F \\\n  -x \"*.DS_Store\" \"*__pycache__*\"\n```\n\nOr use Anthropic's official `package_skill.py` from the [skill-creator skill](https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fskills) for validation + packaging in one step.\n\n---\n\n## Background reading\n\nIf you want to understand *why* the skill is shaped the way it is:\n\n- **Codex 0.128 changelog** — official `\u002Fgoal` announcement\n- **PR #18073-#18077** — the 5-PR stack that built `\u002Fgoal`\n- **`continuation.md` template** — the audit prompt that runs every idle boundary ([commit `6014b66`](https:\u002F\u002Fgithub.com\u002Fopenai\u002Fcodex))\n- **Issue #20536** — `\u002Fgoal` documentation gap\n- **Issue #20656** — Plan-mode silently suppresses goal continuation\n- **Issue #20792** — `\u002Fgoal`-first sessions missing from `codex resume` lists\n- **Issue #19910** — mid-turn `\u002Fcompact` loses goal context\n- **Simon Willison's writeup** — the best public explainer (Apr 30, 2026)\n\n---\n\n## License\n\nMIT — see [LICENSE](.\u002FLICENSE). Use it however you want, including commercially.\n\n---\n\n## Contributing\n\nPRs welcome, especially:\n\n- New project type defaults (Elixir, Ruby, Java, Kotlin, etc.)\n- New scenario skeletons not covered by the current 7\n- Worked examples from your real production goals\n- Translation of `SKILL.md` into other languages (Japanese, Korean, etc.)\n\nFor bugs or proposed changes to the core 6-step workflow, please open an issue first to discuss.\n\n---\n\n## Related\n\n- **OpenAI Codex** — [github.com\u002Fopenai\u002Fcodex](https:\u002F\u002Fgithub.com\u002Fopenai\u002Fcodex)\n- **OpenSpec** — pairs beautifully with this skill ([openspec.dev](https:\u002F\u002Fopenspec.dev))\n- **GitHub Spec Kit** — alternative SDD tool ([github.com\u002Fgithub\u002Fspec-kit](https:\u002F\u002Fgithub.com\u002Fgithub\u002Fspec-kit))\n- **Anthropic Skill Creator** — the official skill that builds skills\n\n---\n\n*Built for developers who got tired of `\u002Fgoal` jobs running 4 hours and producing the wrong thing.*\n","该项目旨在为OpenAI Codex构建高质量且易于审计的\u002Fgoal提示，确保长时间运行的任务能够保持正确方向。其核心功能包括通过五部分黄金模板（目标\u002F范围\u002F约束\u002F完成条件\u002F停止条件）引导用户或Claude编写清晰的目标描述，并在执行前预测提示的审计友好性。项目适用于需要利用Codex进行长期自动化代码处理但又担心因目标定义模糊导致资源浪费的场景。此外，该技能包还提供了针对不同编程语言和任务类型的默认设置及示例，帮助开发者更高效地创建适合自身项目的\u002Fgoal指令。",2,"2026-06-11 03:56:21","CREATED_QUERY"]