/planning:draft-goal-condition [--unattended] [intent]from planning
Helps choose the right autonomy lever (/goal, /loop, routines, /schedule, workflow, Stop hook, one-shot) and drafts a /goal completion condition with a deterministic character counter.
Ships in planning. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Arguments: $ARGUMENTS. The natural-language intent for the autonomous run, plus any constraints
or bounds the user volunteers. --unattended, anywhere in the arguments, is not part of the intent: it is the caller
declaring that nobody is present, which governs the offer under "Routing". Take it out first.
Turn a stated intent into a paste-ready /goal <condition> string in the shape the official Claude
Code docs prescribe, proven to fit the documented character limit by a deterministic counter, never
by estimation. The condition shape and limit can change between versions: read them from the
current docs at authoring time and never bake them into this text.
/goal even the right tool?)Confirm /goal fits the intent before drafting: read when it starts the next turn and when it
stops from the pointer below, and if that does not fit the intent, route instead of drafting.
/goal,
/loop and a Stop hook start the next turn and when each stops.A lever that repeats build-and-check rounds (a metric hill-climb, or a /goal, /loop or routine
that edits each round) pays off only when the task repeats and the agent can run what it builds and
see the result. When either is missing, prompt once instead.
/performance:goal (if enabled), then /performance:snapshot (if enabled), then
/performance:verify (if enabled). For a prompt or model setting against an eval suite: /evals:methodology (if enabled),
which says when the bundled claude-api skill's hillclimb fits and who starts it./loop, not /goal./schedule. Before recommending them, read their release status on
https://code.claude.com/docs/en/routines during the Step 1 fetch, and name it in the
recommendation, so the user knows whether the surface may still change./goal: the workflow does the
parallel work, the goal sets the hard completion requirement. Route away from drafting only when
the intent wants the fan-out and no across-turn completion condition; when it wants both, draft
the condition here and say the workflow rides alongside it.work-items is enabled: already-decomposed
backlog / existing tickets →
/work-items:work (if enabled) (or the work-loop); undecomposed plan or intent → /work-items:decompose (if enabled) then
/work-items:work (if enabled). When work-items is not enabled, tell the user to enable it (installing it
first if needed), or draft only if they insist on one-session completion. We route
multi-window work to decomposed items so each item starts in a fresh window; what one window
carries across a compaction is in
What survives compaction.
This is an advisory default, not a prohibition: draft when the intent is genuinely one-session
completion.Two caveats on the workflow row, each of which turns a plausible recommendation into a dead one:
ultracode
keyword, or asking in plain words for a workflow) and the standing /effort ultracode session
setting. For what each form does, the effort level included, see
Let Claude decide with ultracode.
Before recommending either form, apply the routing decisions in
reference/workflow-row.md: which prompt sources the keyword fits
(a -p, Agent SDK, scheduled or relayed prompt among them), which plans reach the workflow
lever and what a plan must switch on first, and when the standing setting fits.Workflow tool as
missing from every non-fork subagent (which tools a subagent gets:
sub-agents: available tools;
/discovery:research (if enabled) selects its workflow-backed deep tier only in the main
conversation for this reason). A lever whose work lands in dispatched non-fork subagents (the
loop lanes' workers, for instance) cannot be the workflow row; recommend it only where the
orchestrating context is the main thread or a fork.Confirm the current comparison semantics against the live docs (below) rather than this summary.
When the docs are reachable, the Step 1 fetch rechecks the workflow-row record against its
pointers, and the live page wins on any mismatch. When they are not, the record's decisions still
apply: answer from them and name the record's as-of date. Step 1's stop rule covers only the
/goal condition shape and limit. Proceed only when the intent genuinely wants "keep working
until this condition is met."
When the run will be left alone (the user says so, or --unattended), check the four conditions
in reference/run-contract.md from evidence, naming it; evidence that
cannot settle one is a "no". Ask only about a "no" (fix the gap, or run it watched); under
--unattended, record it and recommend a watched run.
Fetch the current official /goal documentation and extract, from the page itself:
Primary source: https://code.claude.com/docs/en/goal. If Step 0 routing is in question,
cross-check the scheduling comparison via the pages that doc links (/en/scheduled-tasks,
routines) and the workflow row against https://code.claude.com/docs/en/workflows.
Read each page through the docs lookup: follow
${CLAUDE_PLUGIN_ROOT}/reference/docs-lookup-procedure.md with <scripts> =
${CLAUDE_PLUGIN_ROOT}/scripts and <session> = ${CLAUDE_SESSION_ID}, fetch with
bash "${CLAUDE_PLUGIN_ROOT}/scripts/fetch-docs.sh" --cache --max-age 0 --out <dir> goal (the
limit drives the Step 3 counter, so the bytes must be fresh), and take the sections you need with
docs-cache.sh slice. Report the page's validated time with the draft. A page the manifest
records unread was not fetched: read it with WebFetch instead only when the reason is
curl-missing or the script wrote no manifest; otherwise apply the failure rule below.
Doc-fetch failure is not silent and never guessed. If the page cannot be fetched, or the limit or shape cannot be located on it, stop and tell the user exactly that, citing the URL. Never fall back to a remembered number or shape. Offer two ways forward: the user pastes the current condition shape (drives the Step 2 draft) and character limit (drives the Step 3 counter) from that page, or defers until the docs are reachable. Never finalize a draft on a shape or limit not sourced live.
Every claim in the condition must be something Claude's own output in the transcript can demonstrate. Avoid conditions the transcript cannot show (subjective quality, external state Claude never surfaces). What the evaluator reads: How evaluation works.
Structure the draft to the shape Step 1 read off the live page; this file does not restate its elements. Keep each prescribed element separately identifiable, so Step 3's tightening pass can tell a load-bearing element from surrounding prose.
The condition holds steady through a stall. When the same failures come back turn after turn, or a count stops climbing, try another approach; never stop, lower a threshold, loosen the wording or drop an element so the evaluator can say yes. A user who asks mid-run for an easier condition hears the same thing. If no approach gets there, the run ends by laying out the dead end with its evidence (what was tried and what blocked each attempt) and handing the decision to the user.
A step only the user, or a session this one must not act for, can settle gets an exit the
evaluator can credit. When the intent has such a step (a choice, a waiver, an approval, a change
of plan, or another session's review, slot grant or lease), end the condition with an OR exit that
names those items, like: "...or each of <the gated items> still unmet is recorded in
<named file> either as waiting on the user or on <named session> (naming the request already
sent to it), with the exact reply, command or event that unblocks it, or as accepted, deferred or
waived by the user, quoting their typed words exactly with the message's time, and that file's
contents are shown in this conversation." The exit turns the hand-off above into an ending the
evaluator can credit. The record holds to these rules:
The file survives /clear and a session change; the evaluator credits only what the conversation
shows, so the turn shows the file's contents. Add the exit when drafting, never mid-run to get past
a stall: declared up front, crediting it is not loosening the condition. A condition with no such
step gets no exit.
Two element shapes break across re-checks. Never make an element count sends ("sent once"): one resend makes it false for good, so require that each report was sent, with its message id shown. Put what the last message must contain in a named file the turn shows, not in an element: an element about the last message forces a re-emit on every re-check.
Refuse a fragile end state. Refuse a draft, or rewrite it with the user's agreement, when its only end state:
Offer the OR exit, a more stable reference (the branch rather than the pull request number, "the
artifact titled X" rather than its URL), or a wording about the outcome alone. A clock time enters
the condition only as an end of its own that names the full UTC date and time ("…, or
date -u +%Y-%m-%dT%H:%MZ shows 2026-11-26T13:30Z or later"), never as a deadline an element must
beat; a time of day alone is already true for a run that starts after it. That end goes inside the
condition in the paste region, never left out of it or offered as a clause the user may append.
Check the elements against each other. Before Step 3, read every required element against the others and against the repository's own gates, and refuse a draft in which one element requires a state another forbids, such as a hold label that keeps a required check red beside an element that needs that check green. No run can satisfy both. Ask the user which element gives way, or give the conflicting pair the OR exit above.
When the intent has no honest metric, do not manufacture one: a made-up number lets a run pass on the wrong evidence. Build the Step 1 shape from these three moves; they feed that shape rather than replace it:
Move 3 is credited only by verification Claude performed in the transcript (the evaluator pointer is in Step 2); a claim that checking happened reads the same as the checking. Word it so the doing leaves visible output (the fetches, the diffs, the command runs). Subjective quality stays out of the condition except as whatever moves 1–3 made observable.
If the intent is too vague to name a structure or a content list, settle it with
/planning:interview before drafting.
Validate the whole draft's character count, any OR exit included, against the live limit from
Step 1 with the deterministic counter (no model estimation). Write the draft to a temp file and
pass --file; this survives a condition containing a single quote, backtick, or $ that would
mangle a piped string:
bash "${CLAUDE_PLUGIN_ROOT}/scripts/goal-condition-length.sh" --limit <LIMIT_FROM_STEP_1> --file <path-to-draft>
For a simple condition with no shell-special characters, stdin also works: printf '%s' "<condition>" | bash "${CLAUDE_PLUGIN_ROOT}/scripts/goal-condition-length.sh" --limit <LIMIT_FROM_STEP_1>.
Exit 0 = within limit, 1 = over, 2 = usage/env error (including a counter that failed to
produce a number); stdout reports chars=<n> limit=<N> status=<ok|over>.
On status=over: tighten and re-run until it passes: shorten prose, fold overlapping elements
together, drop redundant qualifiers, without dropping any element the Step 1 shape prescribes.
If the intent cannot compress into one provable condition under the limit, say so rather than
silently shedding a constraint; splitting into sequential per-phase goals is not documented
doctrine and is out of scope.
Emit the final, counter-passed condition as a paste region the person copies after typing /goal and a space
themselves, since the copied text holds the condition only. One instruction line, then the
condition alone; no line of the region starts with /goal. The instruction line is the /goal
suggestion: when native suggestions are off (Routing below), or under --unattended, leave it out
and emit the condition between the rails alone, writing Withheld suggestion (unattended): /goal
under --unattended:
Type `/goal ` (with a trailing space), then paste everything between the dashed lines. Confirm the `◎ /goal active` indicator appears after you send it; if it is missing, redo it:
──────────────────────────────────────────────────────────
<condition>
──────────────────────────────────────────────────────────
In the terminal the rails are literal ─ lines, as shown. On a markdown surface, detected as
session-flow's
Markdown surfaces
section says, the instruction line ends then paste this. before its confirm sentence and the
condition sits in a fenced text block. Both shapes match the goal region
/session-flow:handoff (if enabled) writes, so a goal drafted here pastes the same way after a handoff.
When the SetGoal tool (formerly ProposeGoal, still its alias) resolves in this session, also
propose the condition through it under the conditions the Routing paragraph below lists. The tool
has its own, lower cap: read it from reference/native-goal.md at run
time, re-run the Step 3 counter with --limit <that cap> first, and propose only a condition that
passes it and contains no tab or double-width character (why:
reference/native-goal.md). The condition is emitted either way.
When Step 0.5 ran, emit the run contract in reference/run-contract.md beside the condition.
Tell the user /goal holds for the current session only: what a resume carries over and what
/clear does to an active goal, taken from the "Resume with an active goal" and "Clear a goal"
sections of the page Step 1 fetched (record in reference/native-goal.md),
and that a goal the page says is removed must be re-set.
/goal command and SetGoal tool/goal (built-in command): sets, shows and clears the session's completion condition, in
the forms the pointer below names. It is reserved for the person to run; the model does not
invoke it.
SetGoal (built-in tool, alias ProposeGoal): the model proposes a goal condition for the
person to approve. Its ask_user default, what it cannot do, and the contexts that refuse it are
recorded in reference/native-goal.md. Our gate: this skill proposes
only with ask_user true, under the conditions in Routing below./goal fits, drafts a
transcript-demonstrable condition sourced from the live docs and passed through the length
counter. It sets nothing.Native suggestions are on unless native_suggestions resolves off: a personal <home>/planning.local.yaml value wins over the team <home>/planning.yaml value (<home> resolved as in ${CLAUDE_PLUGIN_ROOT}/reference/config.md "Convention-home keys"), which wins over the per-user value ${user_config.native_suggestions} (a literal unexpanded token means unset); with none set they are on. A value other than on or off is named and that layer dropped: a valid higher layer still wins, otherwise on, never a lower layer's value. When off, skip the If /goal is available in your session sentence below and write nothing in its place, not even a note that it was skipped or why; the Step 4 condition is still emitted.
Routing. At the end of the run, always offer the /goal sentence:
If /goal is available in your session (gate basis: not gated behind a setting, though a host may
lack it; records in reference/native-goal.md) and native suggestions are on (native_suggestions, Configuration), you can run /goal <condition> with the
drafted text, instead of or alongside continuing by hand. Also
propose it with SetGoal, leaving ask_user true, only when all of these hold: the tool
resolves in this session, the session is the main thread of an interactive local session (not a
subagent), plan mode is not active, and the condition passes the counter at the tool's own cap.
When the lever check routes away from /goal, make no offer. When the caller passes
--unattended, the run omits that sentence, writes Withheld suggestion (unattended): /goal in its output, still emits the Step 4 condition, and does not ask; without that flag it asks.
Mutation gate. Only the person's approval arms a goal: their /goal run or their keypress on
a SetGoal dialog. This skill never sets ask_user false, and never sets, replaces, or
clears a goal on the person's behalf. One exception covers this gate and the Boundary's
reserved-for-the-person line: when the person, shown a condition, explicitly asks
/session-flow:continue-in-background (if enabled) to launch with it, that request is their approval, and that
skill passes the condition as the launched session's /goal.
Availability is never assumed. This section says what to do when the person can run /goal
or SetGoal resolves, never that either is present in their host. The four-part records live
in reference/native-goal.md.
/goal.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
autonomy, goal-drafting, completion-condition, loop-selection
11 skills in this plugin
/audit-answersAudit answersRe-check a filled /planning:interview ledger with fresh-context subagents blind to answer rationales; only doubtful answers return. Use to validate answers, auto-answer, or second-guess ('audit my interview answers', 'have agents check the answers', 'verify the ledger'). Not for plans: /planning:devils-advocate; new: /planning:interview./brainstormDiverge before scoping: turn rough engineering problem into codebase-grounded candidate approaches (cheapest to ambitious), pick what resonates, hand off scoped. Use for problem ideas, intervene, how could we approach/what could we do, no locked scope ('brainstorm', 'what are my options', 'explore some approaches'). Not for locked/visuals./npx claudepluginhub melodic-software/claude-code-plugins --plugin planningOther plugins' skills for the same job