Goal prep

From KilimcininKorOglu/cli-tweaks · View interactive version

Goal prep is an AI agent skill from the GitHub repository KilimcininKorOglu/cli-tweaks. Converts a free-form task description into a verifiable Claude Code /goal completion condition — one measurable end state, a stated check, constraints, and an optional turn/time cap — asking clarifying questions via AskUser only when a required component is missing. Invoked explicitly as /goal-prep.

How to use this skill

Skill file

Goal Prep — free-form intent → verifiable /goal condition

Convert the user's free-form task description into a well-formed Claude Code /goal completion condition: one measurable end state, a stated check, the constraints that matter, and an optional turn/time cap. Ask focused questions only when a required component is genuinely missing.

The output is a single /goal <condition> command the user can run. This skill prepares the condition; it does not run the goal itself (slash commands are user-initiated).

The contract you are writing against

A /goal condition is judged after every turn by a small evaluator model (Haiku by default). This shapes every rewrite decision:

  1. The evaluator cannot run commands or read files. It only sees what Claude has surfaced in the conversation transcript. So the condition must require Claude to produce visible proof — command output, a printed count, a diff, a status line — not just "do the thing."
  2. The condition describes the desired END state, not the current state or the steps. "Make the auth tests pass" → the end state is "every test in test/auth reports pass in the transcript."
  3. Vague success words have no observable output and WILL fail. "production-ready", "clean", "robust", "optimized", "well-structured", "fixed", "works" — each must be replaced with a check whose output appears in the conversation.
  4. Limit is 4,000 characters. Conditions are usually one rich sentence or a short structured block, not an essay.

How it works

Phase 1 — Parse the intent

Read the user's text (the argument). Extract whatever is already present of the four components:

| Component | What it is | Example signal in user text |

|----------------------|-------------------------------------------------------------|----------------------------------------------|

| End state | The one measurable thing that means "done" | "all tests pass", "queue empty", "≤ 300 LOC" |

| Stated check | The command/output that proves the end state, in transcript | "npm test", "git status", "cargo build" |

| Constraints | What must NOT change on the way there | "don't touch the API", "no new deps" |

| Cap (optional) | Turn or time bound if the condition might not converge | "stop after 20 turns", "within ~1 hour" |

Also resolve scope: which files, directories, modules, or items are in play. Ambiguous scope is the most common cause of a meandering goal.

Phase 2 — Find the blocking gaps

A gap is blocking only if the condition cannot be made verifiable without it. Classify:

Do NOT ask about anything the user already gave or that is clearly inferable from the repo or the task. Asking for what was already said is the failure mode.

Phase 3 — Ask, only if blocking gaps remain

If and only if Phase 2 found blocking gaps, call AskUser — once, batched (up to ~4 questions), never drip-fed across turns. Each question targets exactly one gap, with 2–4 concrete options plus room for the user's own answer.

Question templates (use the user's language; keep commands verbatim):

If no blocking gaps remain, skip straight to Phase 4 — do not ask for permission to proceed.

Phase 4 — Compose the condition

Assemble the four components into one condition. Default template (single line is fine; the labels are for the evaluator, not decoration):

<objective, imperative, one clause>. Done when <measurable end state>, proven by <command(s) whose output is printed in the conversation>. Do not change <constraints>. Stop after <N> turns if not met.

Rules while composing:

Phase 5 — Emit

Output, in this order:

  1. A one-line summary of what changed from the raw intent (so the user can sanity-check the verifiability move).
  2. The ready-to-run command in its own block:

```

/goal <composed condition>

```

  1. If the work is meant to run unattended (overnight, CI, headless), also give the non-interactive form:

```bash

claude -p "/goal <composed condition>"

```

Do not run the goal yourself. End by telling the user to paste the command (running /goal starts a turn immediately).

Vague → verifiable (rewrite reference)

| Raw intent (fails) | Rewritten end state + check (works) |

|---------------------------------------------|-----------------------------------------------------------------------------------------------------|

| "make the app production-ready" | name the actual gates: "npm run build exits 0, npm test reports 0 failures, npm run lint prints no errors" |

| "fix the failing tests" | "every test in tests/ reports pass when pytest -q is run, output shown in the conversation" |

| "clean up the code" | "ruff check . prints All checks passed; no behavior change — pytest -q still 0 failures" |

| "migrate to the v2 API" | "no references to api/v1 remain (grep -rn 'api/v1' src/ prints nothing) and npm test passes" |

| "split this big file" | "no file in src/parser/ exceeds 300 lines (wc -l output shown) and the build still passes" |

| "clear the bug backlog" | "issues labeled bug in the local queue file reach 0; print the remaining count each turn" |

| "optimize the query" | "the benchmark script prints a p95 under 50ms; correctness check <cmd> still passes" |

Rules

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.