Skip to content
Development
Skill

/goal-plan-clean

From plugin
lets-workflow
1725 skills15 agents26 commands

Claude Code

$ npx -y skills add restarter/lets-workflow --skill goal-plan-clean --agent claude-code

SKILL.md

goal-plan-clean.SKILL.md
name: goal-plan-clean
description: Compose a /goal that drives a plan-review-fix loop autonomously. Use when the user says "clean my plan", "goal-plan-clean", "iterate plan review", "auto-review plan", "ган­яй ревью плану", "почисти план", "loop until plan is clean", or wants the model to iterate /lets:review --plan (or /lets:check --plan) with fixes until verdict APPROVED. Composes a paste-ready /goal block — does NOT invoke /goal (UI command). Local test skill, not part of the lets plugin payload.

goal-plan-clean

Compose a `/goal` that drives the plan review-fix loop: 1. Run `/lets:review --plan` (or `/lets:check --plan`) 2. Read findings from `.lets/reviews/<latest>` 3. Edit the plan file to address each BLOCKER and SUGGESTION 4. Re-run review/check 5. Repeat ≤3 iterations until verdict APPROVED

The skill **never invokes `/goal` itself** — Claude Code's `/goal` is a UI command (verified empirically: `Skill(skill: "goal")` returns "goal is a UI command, not a skill. Ask the user to run /goal themselves"). It composes well-structured text and presents for the user to paste.

> **IMPORTANT:** If the spec below invokes any deferred tool (e.g. `AskUserQuestion`), you MUST load and call it as specified. Never skip the call, never substitute a default answer of your own — the tool invocation is part of the contract. This is critical.

Step 1: Resolve plan file

LETS_PROJECT_ROOT=$(git rev-parse --show-toplevel)
BRANCH=$(git branch --show-current)
SLUG=${BRANCH#feature/}
PLAN_PATH="$LETS_PROJECT_ROOT/.lets/plans/${SLUG}.md"
test -f "$PLAN_PATH" && echo "found: $PLAN_PATH" || echo "NOT_FOUND"

If `NOT_FOUND`:

ls -1 "$LETS_PROJECT_ROOT/.lets/plans/"*.md 2>/dev/null

Then AskUserQuestion to pick from existing plans, or exit if none.

**Validation** (prevent path traversal): SLUG must match `^[a-zA-Z0-9._-]+$`. If not, fail with "Invalid branch name for plan derivation."

Step 2: Resolve review tool

Parse `args` parameter:

  • `args` = `"review"` or empty → use `/lets:review --plan` (deep, multi-agent, slower)
  • `args` = `"check"` → use `/lets:check --plan` (inline 6-lens, faster, no agents)

If `args` is empty AND user context unclear, AskUserQuestion:

AskUserQuestion(
  questions=[{
    question: "Which tool for the iteration loop?",
    header: "Tool",
    options: [
      { label: "review (Recommended)", description: "/lets:review --plan — deep multi-agent review, slower, catches more" },
      { label: "check", description: "/lets:check --plan — inline 6-lens, faster, lighter" }
    ],
    multiSelect: false
  }]
)

No `/lets:*` in labels — Rule 7 does not fire.

Set `REVIEW_CMD` accordingly.

Step 3: Compose /goal

Substitute slots (orchestrator substitutes literal values into the composed text below — Surface form 3):

  • `<PLAN_PATH>` — absolute path from Step 1
  • `<REVIEW_CMD>` — from Step 2 (e.g. `/lets:review --plan` or `/lets:check --plan`)
  • `<MAX_ITER>` — literal `3`
  • `<LATEST_REVIEW_LOOKUP>` — depends on tool:
  • **review mode:** `LATEST=$(ls -t .lets/reviews/*-plan-review.md 2>/dev/null | head -1) && cat "$LATEST"`
  • **check mode:** "the inline output of the previous `/lets:check --plan` is in your scrollback above — re-read it"

**Anti-gaming note** (why no timestamp / edit-proof clause): the evaluator-LLM reads transcript only and does not run bash to compare file mtimes. Real anti-gaming protection comes from two LITERAL clauses in Hard constraints below: (a) "must NOT be satisfied by deleting/skipping/downgrading [BLOCKER] findings" — prevents review-tool gaming, (b) workflow step 3b "Quote the finding text in your assistant response" — forces evaluator to see the per-iteration fix evidence.

Template:

/goal The plan file <PLAN_PATH> passes <REVIEW_CMD> with verdict APPROVED.

Verifiable (evaluator reads transcript):
- The most recent assistant turn quotes the literal <REVIEW_CMD> output containing the line "Verdict: APPROVED" (NOT "NEEDS REVISION")

Iteration workflow:
1. Run <REVIEW_CMD>
2. If verdict is APPROVED → goal achieved (stop)
3. If verdict is NEEDS REVISION:
   a. Locate findings source: <LATEST_REVIEW_LOOKUP>
   b. For each [BLOCKER] finding: edit <PLAN_PATH> to address it. Quote the finding text in your assistant response so the evaluator can verify the fix targets the right issue.
   c. For each [SUGGESTION] finding: apply if it's a clear text fix; defer if it requires architectural change
   d. [NIT] findings are optional
4. Re-run <REVIEW_CMD>
5. Repeat up to <MAX_ITER> total iterations

Hard constraints (these are LITERAL gates the evaluator must enforce):
- Goal must NOT be satisfied by a turn that ran `git push`, `git commit`, `git tag`, or `git reset --hard` without explicit user approval in the same transcript
- Goal must NOT be satisfied by a turn that ran `bd close`, `bd update --status`, `bd dolt push`, or any other bd state-mutation without explicit user approval
- Goal must NOT be satisfied by editing any file other than <PLAN_PATH>
- Goal must NOT be satisfied by deleting, skipping, or downgrading [BLOCKER] findings to make verdict pass (the review must produce APPROVED on its merits, not by review-tool gaming)
- Each iteration must paste the literal verdict line (or full review summary) into the assistant text — evaluator needs direct evidence, not "I ran the review and it passed" claims
- If <REVIEW_CMD> itself fails (non-zero exit, agent timeout, no output, no review file produced when review mode expected one):
  - STOP and surface error to user via assistant text "REVIEW_CMD failed: <verbatim error>. Cannot iterate without working review tool. Investigate and re-run."
  - Do NOT retry blind — a broken review tool means we can't verify ANY fix
  - Bucket as `tool-failure`
- If <MAX_ITER> iterations pass without APPROVED:
  - Append remaining findings as a "## Known Limitations" section at the end of <PLAN_PATH>
  - Stop and surface to user via assistant text "Reached <MAX_ITER> itera
Read more
@restarter
Ships withlets-workflow

A development workflow plugin for Claude Code Stop babysitting your AI. Start shipping with it.

1725 skills15 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
17
Star history of restarter/lets-workflow on GitHub, a chart by star-history.com

Other skills on lets-workflow.

goal-test

goal-test

Local sandbox for experimenting with Claude Code's /goal command (stop-hook condition + LLM-evaluator driving autonomous work…

loop-bb-pr

loop-bb-pr

Compose a /loop that monitors a Bitbucket PR for activity (new comments, review state changes, merge, decline) via the bb-api…

loop-gh-pr

loop-gh-pr

Compose a /loop that watches all open GitHub PRs for activity (new PRs, new commits, new comments) and auto-prepares a READ-ONLY…

loop-test

loop-test

Local sandbox for experimenting with Claude Code's /loop command (interval + dynamic/self-paced scheduling) applied to LETS…

agent-report

agent-report

Internal skill for commands. The file transport for agent reports - hand every Task-dispatched agent a REPORT_FILE, then collect…

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills2w309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc2w293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react4d252k
@facebook@facebookInstall Skill

Questions about goal-plan-clean.

Which coding agents can use goal-plan-clean?
goal-plan-clean installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.