/dev-process:milestone-goal-promptfrom dev-process
Research a GitHub/GitLab milestone's open issues in order to PRINT a copy-paste autonomous-loop prompt that drives the milestone to completion — BDD scenarios, adversarial gap-checking, a per-iteration Definition-of-Done gate (build, tests, zero lint, /code-review, /security-review, /ponytail:ponytail all cleared), specialized-agent selection, model tier scaled to complexity, and a root-cause→hardening loop closed out each iteration by /claude-code-setup:claude-automation-recommender. Use whenever the user says "generate a goal prompt", "goal-driven prompt", "milestone loop prompt", "prompt to finish/complete the milestone", "clear-and-paste prompt for milestone N", "make me a prompt to drive /autoresearch", or wants a ready-to-paste block that completes a milestone's remaining issues. The deliverable is the prompt itself, not a summary. NOT for executing the work (it only GENERATES and PRINTS the prompt — the loop does it), NOT for summarizing or listing issues, and NOT for a one-off issue fix.
Ships in dev-process. 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.
Turn a milestone into a single, tight, copy-paste block that drives an autonomous loop
(/autoresearch:autoresearch … ultracode) through every remaining issue — behavior-first,
adversarially gap-checked, and gated so it can't advance on a half-finished issue.
The value here is that the user stops hand-writing these prompts. You do the research (resolve the milestone, read its issues, spot blockers, derive the repo's real build/test/lint and end-to-end commands, and name the milestone's exit behavior test) and synthesize a directive that already encodes the working method the user wants. The deliverable is text you print for the user to paste — you never run the loop yourself, and you never write it to a file.
Trigger on: "generate a goal prompt", "goal-driven prompt", "milestone loop prompt", "prompt to finish the milestone", "clear-and-paste prompt for milestone N", "drive /autoresearch to complete …". The user wants a prompt, not the work done — this skill produces the prompt and stops.
Do not use it to execute a milestone (that's what the emitted loop does), or for a single-issue change (just fix that directly).
--layer A|B (or similar phrase) to scope to a subset when the milestone is
explicitly layered — otherwise include all open issues, ordered, with blocked ones flagged.Work through these in order. Steps 1–6 are research; step 7 is synthesis; steps 8–9 print.
Resolve the milestone. gh api repos/{owner}/{repo}/milestones --jq '.[] | {number,title,open_issues,description}'
(derive owner/repo from gh repo view --json nameWithOwner). Pick the selector the user
gave, else the default above. Grab its description — milestones often name the design doc
and the layering there.
Fetch its open issues. gh issue list --milestone "<title>" --state open --json number,title,body,labels.
Keep them ordered by number unless the description implies a different sequence.
Parse each body for the signals that shape the directive:
needs #N, blocked by #N, (needs #28), depends on #N,overlaps #N,docs/design/*.md) — name it so the loop reads it first.Check blockers. For any dependency #N, check its state (gh issue view N --json state).
If #N is still open, mark the dependent issue skip-if-blocked and say so in the
directive — the loop should skip it and flag it, not fake its way past the dependency.
Derive the repo's REAL commands for four capabilities — build, test, lint, and
end-to-end. The loop's keep/discard signal must be honest, and the gate below is only as
real as the commands filling it. Detection order, first hit wins: Makefile/justfile targets
→ package.json scripts → the language manifest (Cargo.toml, pyproject.toml, go.mod,
pom.xml, …) → the CI workflow, which breaks ties because it is what actually has to pass.
Read CLAUDE.md too: it usually names the wrapper the repo expects (a command prefix, a task
runner, a container).
A runner that cannot fail is not an honest command. Reject any wrapper that invokes the
test binary without the flag or env that enables the behavior under test, or that swallows the
exit code — it returns 0 forever, so the loop can never discard. Prefer whatever actually
exercises the behavior.
These four commands fill the gate's capability rows. If a capability genuinely has no command
in this repo, the directive says so plainly ("this repo has no lint command") instead of
inventing one — and when the missing one is end-to-end, building that runner is the directive's
first act, ahead of step 6's test. Derived is not confirmed: these commands were read out of
build files, never executed, so step 7 has the directive dry-run each one before trusting it.
Identify the milestone's exit behavior test — the single end-to-end behavior this milestone unlocks, taken from the milestone description, the design doc's BDD/test plan, or the union of the issues' acceptance criteria. Name it concretely in the directive: the test file and case, and the command that runs just it. If no such test exists, writing it RED-first is the directive's first act after the runner from step 5 exists.
Synthesize the goal directive (must stay < 4000 characters). It embeds:
unknown primary, no such target, a missing binary) or that
reports success without executing anything is not a gate — this repo's own
scripts/validate.sh:284-305 calls GNU find -printf, which macOS find rejects, so the
check yields nothing and prints its OK message anyway. Order the three first acts:
dry-run, then build whatever runner step 5 reported absent, then write step 6's exit test
RED-first;CLAUDE.md, quoted as
that repo words them (see the Example for one project's set). Where it states none, the floor
is that every negative path has a test and no peer-supplied field is trusted over local
context;/claude-code-setup:claude-automation-recommender. It is a read-only repo profiler, not a
root-cause analyzer: it reads language, framework, and dependencies and proposes harness
automations (hooks, subagents, skills, MCP servers). Treat its output as candidate guards for
the root-cause loop above — adopt one only when it actually guards a root cause seen this
iteration, and record the rest as declined. Its profile input barely changes between iterations,
so expect mostly repeats after the first pass; the cross-check is the point. Never
auto-install anything that could stall an unattended loop (a confirmation-prompting
PreToolUse hook, an MCP server needing a restart) — propose those to the operator. Availability
is a property of the operator's harness, so gate on the session's available-skills listing,
not on any marketplace: if the skill is absent, say so loudly and continue — never silently skip
the close-out. Then write the iteration's durable learnings to memory — the facts and
project notes worth keeping, plus the recommendations declined and why. That declined list is
what makes the repeats cheap: the recommender re-proposes them every pass, and only a durable
record turns a re-evaluation into a recognition. Capture is filtered for durability (skip
the one-offs — anything that will not be true next iteration) and timeboxed: capture and
move on, never rabbit-hole mid-build. The emitted directive routes learnings to memory only,
since the recommender already covers the guards; for the fuller routing — memory for context,
skill-creator for a repeatable procedure, hookify / update-config for enforcement — see
the sibling iterative-build-loop skill, "Consolidation phase";general-purpose last resort, model tier scaled to complexity;CLAUDE.md (shell wrapper, container
runtime, review policy, anything it forbids), plus one branch + PR per issue, strict TDD,
AI review run locally rather than in CI, and local-only execution (never a cloud or dev
account).Definition-of-Done gate (per iteration — hard, layered on the issue's own acceptance criteria and the adversarial gap-check). Do NOT advance to the next issue until ALL are green:
iterative-build-loop already enforces under
"Every milestone exits on a real test". Inherited green tests say nothing about what this
milestone unlocked, so a milestone whose own behavior was never exercised is not done even
when every issue's test passes./code-review findings addressed./security-review findings addressed./ponytail:ponytail findings addressed (delete over-engineering; stdlib/native over new deps).The first three rows carry this repo's commands, never another project's toolchain; a capability with no command here is named as absent, never faked. The same gate re-runs across the whole milestone at the end, and for the complete goal at large, before anything is declared done. These are DEFAULT criteria on top of each issue's intent — never skipped to move faster.
Assemble the autoresearch line. Goal: = the directive; Scope: = the globs the milestone
actually touches, in this repo's own source layout; Metric: = a short honest label naming what
goes green; Verify: = the end-to-end command from step 5; Iterations: ≈ 30; append
ultracode so each iteration may fan out Workflows for the adversarial pass.
Print the three labeled blocks (see Output contract). Then stop — do not run anything.
Both this skill's own research subagents and the emitted directive (including any ultracode
Workflow fan-out the loop spawns) must dispatch the right specialized agent for each task and
scale the model to the task's complexity. Left to defaults, workflows reach for general-purpose
almost every time — that wastes the specialized agents the harness already provides. So make the
directive name agents explicitly, and treat general-purpose as a last resort only when nothing
below fits.
Map tasks to agents (these exist in the runtime harness — do not invent names, and note the stale
~/.claude/agents/ table does NOT exist):
| Task | Agent |
|---|---|
| Broad read-only search / locate code | Explore |
| Trace/understand a feature before changing it | feature-dev:code-explorer |
| Architecture / design decision | feature-dev:code-architect |
| Implementation planning | Plan |
| Code review | pr-review-toolkit:code-reviewer |
| Error-handling / silent-failure review | pr-review-toolkit:silent-failure-hunter |
| Test-coverage adequacy | pr-review-toolkit:pr-test-analyzer |
| Security review | code-review:security-reviewer |
| Simplify / dead-code (ponytail) | code-simplifier:code-simplifier |
| Minimal targeted fix for a finding | code-review:fix-agent |
| Verify a change matches intent | code-review:intent-verifier |
| Stuck / build won't resolve / 2nd opinion | codex:codex-rescue |
| Nothing above fits | general-purpose (last resort) |
Model tier scaled to complexity — spend reasoning where it pays:
The directive should say this in one compact clause (e.g. "dispatch specialized agents per the task→agent map, general-purpose only as last resort; scale model tier to complexity — cheap for mechanical, top-tier for architecture/security/adversarial-verify"). If it must be trimmed for the 4000-char budget, keep the "specialized-first, general-purpose last, tier-by-complexity" principle even if the full table is dropped.
The Procedure above is the inline path — follow it directly for a handful of issues. For a large
milestone, or when the user asks for ultracode / a fan-out, hand the whole thing to the bundled
Workflow engine instead:
Workflow({
scriptPath: "${CLAUDE_PLUGIN_ROOT}/skills/milestone-goal-prompt/workflows/goal-prompt.js",
args: { repo: "<owner/name or group/project>", milestone: "<number or title>" }
})
Optional args: platform ("github" | "gitlab"; auto-detected from the git remote when omitted)
and config ({maxRounds, maxIssues, charBudget}).
It runs the same method in four phases — Survey (issues, plus the repo's honest build/test/lint and end-to-end commands, in parallel), Analyze (one agent per issue, pipelined), Assemble (synthesize the directive), Verify (three distinct adversarial lenses — completeness, correctness, constraints — looping until two consecutive rounds surface nothing new, hard cap four rounds).
It returns {directive, charCount, verifyCommand, issues, blocked, rounds, findingsApplied, converged, overBudget}. You still own the Output contract below: print the three labeled blocks
yourself. If converged is false, say so — the directive is not adversarially clean. Reserve the
inline path for small milestones, since the workflow spends several agents per issue.
gh (issues, milestones, repo metadata), Bash/Grep for repo inspection (finding the real
verify command, reading CLAUDE.md and the design doc). For the skill's own research, prefer
Explore over general-purpose per the Agent & model policy. No writes, no network beyond gh.
Print inline to the user. Write nothing to disk. /clear wipes the input buffer the
instant it runs, so it cannot share a paste block with the command beneath it — emit three
labeled blocks the user pastes in sequence.
The middle one is /goal, and it is what makes the gate binding. /goal registers a condition
Claude must satisfy before it is allowed to stop, so the run keeps iterating while the condition is
unmet — the same stop-gate iterative-build-loop sets per milestone. Without it the gate's
milestone-exit-test row is a criterion with no enforcement, and an autonomous loop that can stop
early will. Keep the condition to one tight sentence naming the same exit test the directive names;
it is a stop-gate, not a restatement of the directive. Being its own block, it does not count
against the directive's 4000-character budget.
/goal is a harness built-in, and built-ins never appear in the session's available-skills
listing — the only listing it can read. So unlike the close-out's automation-recommender (a skill,
whose absence genuinely is checkable there) /goal's presence cannot be confirmed before you
print. Do not try. Always emit all three blocks, and say in the printed notes that /goal is a
built-in you could not confirm: if their session rejects it, they paste STEP 1 and STEP 3 only.
Paste time is the only point at which a built-in's availability is discoverable, which is why the
detection moves there — and /goal is what makes the milestone exit-test row binding rather than
advisory, so losing it silently turns the gate back into a wish.
If the directive would exceed 4000 characters, compress the prose — the loop can re-fetch issue
detail with gh in-context — but never drop the Definition-of-Done gate, the named milestone
exit test, the adversarial gap-check, the trust-boundary invariants, or the root-cause loop and its
close-out. Those are the point.
Use this exact shape:
Milestone <N>: "<title>" — <X> open issues<, blocked: #A (needs #B) if any>
Verify command: <the real one you derived>
Note: /goal is a harness built-in, so its presence could not be confirmed from any listing this
session can read. Paste STEP 2 anyway; if your session rejects it, paste STEP 1 and STEP 3 only —
do not drop the stop-gate without noticing.
STEP 1 — paste this, press enter:
/clear
STEP 2 — paste this, press enter:
/goal <one sentence: the milestone's named exit behavior test runs green AND every issue has cleared the Definition-of-Done gate>
STEP 3 — paste this:
/autoresearch:autoresearch Goal: <directive …> Scope: <globs> Metric: <label> Verify: <cmd> Iterations: 30 ultracode
/clear is always its own block, above the command./clear, then /goal, then the /autoresearch line.
Never pre-check whether /goal exists — a built-in's absence is not discoverable from any
listing the session can read. The printed note tells the user to fall back to two blocks if
their own session rejects /goal, so the stop-gate can never go missing unnoticed.Input: "generate a goal-driven prompt to finish milestone 1"
One worked example, from a Rust workspace that also ships a TypeScript plugin. Every command and invariant below was derived from that repo by steps 5–6 — they are that project's, not defaults to carry into another.
What you do: resolve milestone 1 ("Local end-to-end verification backbone"), list all its open
issues from live gh data (do not trust a remembered count — at last check it held
11: #22, #23, #25, #26, #46–#52), check each dependency's state and flag the blocked ones
skip-if-blocked (e.g. #23/#25/#26 need #24; #51 needs #28 — verify those are still open),
handle nuanced cases honestly
(#52 asserts the real AES-PSK behavior that exists now, adding MLS assertions only once #28 lands —
never a stub), note the design doc docs/design/2026-07-24-e2e-verification-milestone.md.
Derive that repo's four commands: build rtk cargo build --workspace (plus npm run build in
plugins/obsidian-ee when TS is touched), test rtk cargo test --workspace plus the --ignored
wire tests and npm test where relevant, lint rtk cargo lint (fmt-check + clippy -D warnings)
and tsc --noEmit + npm run lint for TS, end-to-end cargo xtask e2e — not the hollow
scripts/e2e-test.sh, which runs full_flow without --ignored, so its docker bring-up is
decorative and the script cannot fail. Take the milestone's exit behavior test from the design doc's
BDD plan (the full local wire round-trip) and name the command that runs just it. Carry that repo's
CLAUDE.md trust-boundary invariants (wrong key/doc/epoch REJECTED, AEAD bound to local docId,
watcher drain-until-quiet, byte-bounded collections, pub(crate)) and its operating constraints
(rtk-prefixed shell, Finch/Docker, local-only). Then synthesize a <4000-char directive with the
BDD + adversarial + DoD-gate + agent-policy + root-cause method, set Scope: to that repo's layout
(tests/e2e-tests/**,crates/**,plugins/**) and Metric: to "passing wire tests". Then print the
three blocks: /clear alone; then /goal not done until the local wire round-trip test runs green and every issue has cleared the Definition-of-Done gate; then the /autoresearch:autoresearch … ultracode line. Then stop.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub cajias/claude-skills --plugin dev-process8 skills in this plugin
/create-readmeCreate a README.md file for the project/design-phase-artifactsUse whenever the user asks to "do the design", "design this feature/change", produce design docs, write up an architecture, or plan a non-trivial change before implementation — this is the DESIGN phase of their AI-native SDLC. Trigger it even when they don't say "artifact" or name the documents. It produces a C4 architecture overview plus FIVE Notion design artifacts (Logical Design, Structural Design, Implementation Plan, Test & Verification Plan, Evaluation Plan), each grounded in the real code, and it encodes the content contract for each document plus the Notion publishing and orchestration gotchas. Prefer this over generic planning skills when the deliverable is a design that will be published to Notion./Other plugins' skills for the same job