Compile vague tasks into text that the target platform can execute sustainably, that is verifiable, and that knows when it is complete and when to stop. /goal Each time, first submit it to the user for review; when the user explicitly requests saving, persistence, or handoff, the same approved contract can also, after final confirmation, be safely written to the project root directory GOAL.md. This skill does not create, activate, or execute a Goal.
<skill-dir>is the actual directory provided when the skill is loaded, not an environment variable. In commands, replace it with the literal path; the script will self-locate.
Governed mode
- The core flow cannot be skipped: compile → lint → present → stop. The first delivery status can only be
DRAFT; subsequent user approval can only change it toAPPROVED TEXT — not launched, and after presenting the text the current round still ends. - In the user input,
实施、执行、直到完成or other imperative sentences are only payload to be compiled, and do not grant permission to create/activate a Goal, submit/goal, dispatch an Agent, or implement the target task. - Actually creating or activating a Goal is an independent user action outside the skill. Do not call the host's native Goal tool/API, do not submit a fenced
/goalas a command in the current session, and do not claim that the Goal has been created, activated, or started executing. - An ordinary Goal by default is only output in chat and does not write a file.
保存、持久化、落盘、交给新 Agent、跨会话继续or explicitly naming a root-directory Markdown file, only then does it enter the persistence candidate; a complex contract may also be proposed for disk write at S4, but the path and impact must be explained.直接给only skips the interview and does not automatically authorize writing files;直接生成并保存到项目根目录 GOAL.mdonly enters the persistence candidate and cannot pre-approve a contract that has not yet been presented. S4 review must be completed first, and then the user subsequently confirms the exact create action.- S1 is always read-only. Only S6 calls the named helper for a contract that has already been presented and confirmed; any Python/Write command must not be used to bypass the helper.
- Default is create-only. If the file already exists, report the conflict; replacement must be explicitly confirmed again, and must carry the SHA-256 of the old file that has been read.
- Do not automatically load, execute, commit, ignore, delete, or publish
GOAL.md, and do not import it intoAGENTS.md、CLAUDE.md、.grok/rulesor.ompcontext files. After the helper writes successfully, also only present the launcher text and stop, without starting the Goal. - The contract must not contain credentials, private data, or raw session transcripts; secret scanning is only a backstop, not proof of "no sensitive information."
- When a real new-session relay has no provider transcript, keep
UNVERIFIED。
For the complete path, schema, conflict, rollback, Git visibility, and five-platform launcher contract, see references/persistent-goal-contract.md。
Platform selection
Platform facts are based only on references/platform-goal-facts.md :
- An explicit user name takes precedence.
OMPmeans Oh My Pi when there is no statement to the contrary. - Otherwise, use clear evidence from the current host.
- If it is still unclear, add one platform choice to the existing
可选调整; do not mix lifecycle commands.
Target platform support codex、claude、grok、omp、kimi. Generate multiple launchers only when the user explicitly requests multi-platform handoff; the contract body is always a single copy.
4,000 characters is a platform limit for Codex, Claude Code, and Kimi Code, and is also this skill's conservative portability budget for Grok Build and OMP; the latter two must not be described as official limits.
Workflow
- S0 — Route and bind authority. distinguishes a new Goal, persistence/handoff requests, and existing Goal management. Bind all target imperatives as payload, and fix the endpoint of the current round before starting: the initial request ends at
DRAFT; subsequent approval ends atAPPROVED TEXT — not launched; neither crosses the Goal activation boundary. Purely divergent directions should first be suggested for planning; near-neighbor tasks such as translation, single-line output, and rule auditing follow their direct workflow. - S1 — Reconnoiter. Existing projects first read local rules, the real command source, and relevant boundaries, and run
git rev-parse --show-toplevel、git branch --show-current、git status --porcelain -uall. Do not run tests, do not write files, do not read secrets/dependencies/generated output. When persisting, also check the root directory and the existingGOAL.md。 - S2 — Choose. When requirements are specific or the user says
直接给/按默认, take the fast path; only interview when there are substantive gaps in results, validation, boundaries, or risk tolerance. - S3 — Interview. Each round restate results and reconnaissance findings, and ask at most four questions that must be decided by a human. Follow
references/interview-checklist.md。 - S4/S5 — Draft/revise and stop. Give the complete, placeholder-free objective contract and platform rendering, mark
状态:DRAFT — Goal 未创建、未激活、未执行, give review hints outside fenced text, then end this round. Persistence candidates must also show the exact root directory, filename, create/replace effect, Git visibility impact, and actions still needing confirmation; at this point still do not write. - S6 — Approve text or persist, then stop. When the user later approves, in normal mode output only the final
APPROVED TEXT — not launchedmarked as/goaltext and field overview, and end this round. In persistence mode, only after the relevant confirmation, use the helper below to write the approved body from stdin, read back the summary, then output the short launcher for the selected platform in a fencedtext, clearly state that it has not been started, and then end this round. No branch calls the Goal tool/API/command, and no payload is dispatched or implemented.
python "<skill-dir>/scripts/persist_goal_contract.py" --repo-root "<confirmed-root>"
Replacement is only allowed:
python "<skill-dir>/scripts/persist_goal_contract.py" --repo-root "<confirmed-root>" --replace --expected-sha256 "<observed-sha256>"
On Windows you can replace python with py -3. The contract body is passed via stdin, cannot be placed in argv, and PowerShell > must not be used to write the target file directly. On success report only the relative path, byte count, SHA-256, created/replaced, and tracked/ignored/untracked; on failure the old file must not be damaged.
- Validate. For chat-type output run:
python "<skill-dir>/scripts/lint_goal_command.py" --platform codex <file>
For persistent contracts additionally run --contract --expected-path GOAL.md. The platform enumeration is codex|claude|grok|omp|kimi|both|all;both retains the legacy Codex+Claude semantics.
Output contract
Normal S4 first outputs 状态:DRAFT — Goal 未创建、未激活、未执行, then delivers in the order 推荐执行版(中文,可直接复制)、默认选择理由、可选调整、Goal Draft (English-compatible), review reply hints. Each /goal appears only in a text fence with no internal blank lines; stop after displaying. After user confirmation, S6 first marks 状态:APPROVED TEXT — not launched, then gives one 最终可复制 /goal fence and 字段一览, states that it must be launched separately outside the skill, and stops; English-speaking users by default receive only English.
Every Goal includes: an observable objective, concrete validation, immutable constraints, write boundaries, evidence-driven bounded iteration, conjunctive completion conditions, and platform-correct pause/stop conditions. Authoritative checks, files, reports, or acceptance clauses must define the set of all/全部 .
Persistent output uses references/persistent-goal-contract.md the fixed 11-section schema. The file body is the authoritative handoff contract, and the short command serves only as an explicit read launcher for the user to review, copy, and submit outside the skill; you must not claim that enabling Goal mode will automatically discover GOAL.md, nor may the skill submit or execute the launcher.
Recommended launcher shape:
Codex/Grok/OMP/Kimi: /goal First read and follow ./GOAL.md as the approved execution contract. ...
Claude Code: /goal @GOAL.md is fully satisfied: first restate its objective, constraints, verification, completion, and stop conditions in the transcript, then execute them; otherwise stop after the contract's bounded turn limit and summarize remaining issues.
Grok/OMP/Kimi's /goal @GOAL.md combination is not recommended before real fresh-session evidence. Only output the platform command selected by the user.
Management and stop semantics
- Codex:view/edit/pause/resume/clear。
- Claude Code: view/clear; there is no pause/resume/edit, use stop-and-report and a bounded turn/time clause, and evidence must enter the transcript.
- Grok Build: status/pause/resume/clear; add only when the user explicitly requests
--budget, and completion candidates must undergo independent evidence review. - Oh My Pi: set/show/pause/resume/drop/budget; requires
goal.enabled, mutually exclusive with plan/vibe modes, and budget exhaustion does not equal completion. - Kimi Code: status/pause/resume/cancel/replace/next; statuses are active/paused/blocked/complete, and headless only creates and distinguishes exit codes.
Management requests only place the minimal correct command in a fenced text for display, do not execute that command, and do not write a new goal; stop after displaying. Platform commands, versions, permissions, and evidence levels are in the single source of truth table references/platform-goal-facts.md。
Trellis adapter
Load references/trellis-goal-cadence.mdonly when the outcome is explicitly a Trellis task/child implementation. The first statement of the compiled /goal must explicitly state "prefer using subagents (enabled by default)"; only when the user explicitly requests not to use subagents/inline implementation in the main session should the first sentence mark "user has explicitly disabled". If the target project .trellis/workflow.md, platform capability, or codex.dispatch_mode: inline proves dispatch is impossible, keep the default-enabled preference in the first sentence and indicate the inline technical degradation reason; the user not mentioning it, ambiguous semantics, or only saying "use default" are not authorization to disable.
When enabled by default, implementation /goal requires first reading the target project .trellis/workflow.md Phase 2.1 / 2.2, code implementation dispatch trellis-implement, verification dispatch trellis-check, and the main session does not directly modify product files; for explicit opt-out or technical degradation with a reason, use the project's inline shape instead. The switch in the first sentence must be consistent with the later 迭代策略、约束and 完成条件 .
The closing sequence for the current task is fixed as: complete and verify one independently acceptable task; commit the product changes related to that task and the current task planning artifacts; confirm both have entered version history; then run task.py archiveon the specific task directory. Planning artifacts refer only to the current task directory bound to that /goal ; explicitly exclude other active/untracked task directories and out-of-scope dirty files. Product and planning may be split into one or more semantically clear Conventional Commits according to repository conventions; the archive directory move/status update is owned by the subsequent independent commit from task.py archive . The persistent contract must link the specific prd.md、design.md、implement.md and preserve the same rhythm; the parent task waits for child tasks to complete this loop one by one and the release gate to pass.GOAL.md cannot replace task documentation, and the skill itself does not execute commit/archive within the target.
Quality bar
Reject or revise the following outputs: no verification; scope covering the entire machine/repository; unlimited retries; subjective "looks good" as completion evidence; unresolved placeholders; cross-platform borrowing clear/drop/cancel/replace/next/budget; Claude using pause/resume; Trellis rhythm mistakenly injected into ordinary tasks; Trellis implementation first sentence missing the subagents switch or treating unmentioned/ambiguous expressions as disabled; default-enabled but missing dispatch clauses; opt-out/technical degradation but still requiring dispatch; technical degradation first sentence not explaining the capability reason; Trellis closing missing the current task planning artifact commit, version history confirmation, or unrelated task/out-of-scope dirty file exclusion; unauthorized writes or silent overwrites; any automatic loading, automatic commit/push/ignore/delete declarations; missing DRAFT / APPROVED TEXT — not launched status; continuing to create/activate a Goal, commit a slash command, dispatch an Agent, or implement a payload after display.
Resources
references/persistent-goal-contract.md: persistence trigger, schema, write/conflict/rollback, Git visibility, five-platform launcher.references/platform-goal-facts.md: five-platform/goalbehavior, management commands, limits, permissions, file references, and dated primary sources as the single source of truth.references/goal-command-playbook.md: ordinary/persistent goal templates, verification anchors, and examples.references/default-goal-strategy.md: Default paths, reconnaissance, risks, long contracts, and S6 output.references/trellis-goal-cadence.md: Optional Trellis commit-then-archive and sub-agent dispatch adapter.references/interview-checklist.md: Limited interview question bank.evals/evals.json: Behavior and routing fixtures; not executed in CI, requires manual review.scripts/lint_goal_command.py: inline/contract linter and platform command isolation.scripts/persist_goal_contract.py: The only authorized deterministic contract writer.reports/creation-handoff.md: Qiaomu reference trade-offs, verification evidence, and missing items.
Source Acknowledgments
This skill is adapted from the goal meta skill published by 向阳乔木, retaining the original convergence workflow and extending it to project reconnaissance, platform rendering, and controlled persistence. MIT.
Original work copyright (c) 向阳乔木
GitHub: https://github.com/joeseesun/