Generate /goal Command for Unattended Execution
Arguments: $ARGUMENTS
Emit the /goal that drives /ideation:autopilot to completion unattended. The goal
string has exactly one owner — buildGoal() in ${CLAUDE_PLUGIN_ROOT}/scripts/contract-gen.ts,
printed by --print-goal — so this skill only resolves the project, prints, and copies.
Never hand-author or template the /goal; a second copy of that string is drift.
(The layered model — goal wrapper → autopilot → engine → execute-spec — is owned by
ideation SKILL.md § 5.4.)
- Resolve
contract-data.jsonfirst — it is the source of truth;contract.mdis only a legacy fallback. Argument given: acontract-data.jsonpath is used directly; acontract.mdpath means its siblingcontract-data.json. No argument: glob./docs/ideation/*/contract-data.jsonand take the most recently modified. If the project has nocontract-data.json, stop and say so —--print-goalconsumes it, so the fix is re-running ideation, not hand-writing a goal. - Already complete? Run
node ${CLAUDE_PLUGIN_ROOT}/scripts/verify.mjs <contract-data.json>. Exit 0 → quote its finalVERIFY {slug}: …line, tell the user the project is complete, and stop. - Print the goal:
node ${CLAUDE_PLUGIN_ROOT}/scripts/contract-gen.ts --input <contract-data.json> --print-goal— an early exit that writes nothing (no lineage snapshot, no re-render). The output already carries the isolation-branch clause when the contract hasbranch, the background-workflow rule, and the verify.mjs-based done-when. - Copy and show: pipe the printed command to
pbcopy(Linux:xclip -selection clipboardorxsel --clipboard), then print it so the user sees what they are about to paste. - On a permission denial of any command above: print the exact command for the user
to run themselves (
! node …) and stop. There is no fallback template.
Then remind the user: enable auto mode (/auto) so tool calls don't block each turn, and
confirm the engine is available (Workflow tool in Claude Code; in pi the plugin bundles
its engine extension, so nothing further is needed). One caveat, not a gate — and honestly labeled: this detail was derived from
Claude Code binary strings and could not be verified from this repo — /goal appears to
require a trusted workspace and may refuse to run when hooks are restricted. If the paste
is rejected, that is the likely reason; it is a property of the CLI session, not of this
project.