Skip to content

refactor(aidd-dev): lean the plan skill for small models - #1080

Merged
blafourcade merged 5 commits into
nextfrom
refactor/lean-plan-skill
Oct 23, 2026
Merged

blafourcade merged 5 commits into
nextfrom
refactor/lean-plan-skill

Conversation

@blafourcade

@blafourcade blafourcade commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

🎯 What & why

Lean aidd-dev:01-plan so it runs on Mistral medium under opencode as well as on Claude models, and writes the plan folder every time. Instructions drop from 968 to 478 words (-51%); everything a run reads, scripts excluded, from 1750 to 1322 (-24%).

🛠️ How it works

  • Three actions behind one mermaid router, SKILL.md: capture (read the source silently), explore (loop on the code until nothing blocks), conclude (phases, files, validation, check, approval). Same vocabulary as brainstorm.
  • Medium ends its turn on any text-only message, so the router carries what must hold on every turn: "Speak only to ask or to give the final reply" and "Plan only". The mermaid cites no file path: the router guard needs a table row per action.
  • The plan folder is checked by validate-plan.cjs, derived from the two templates (sections, order, headers, front matter, no comments or placeholders, phase rows match phase files, listed files to modify exist, acceptance rows map to tasks). A changed template changes the verdict with no edit to the script. Tests: validate-plan.test.js.
  • One read-only subagent checks the plan against plan-checks (Requirements, Reading, Evidence), once, and returns only its ✗ lines. No score.
  • The Phases table gains Depends on (earlier phase numbers, or none), validated as strictly lower numbers.
  • A phase that builds a screen layout draws a numbered wireframe with a legend, else omits the section. The validator rejects none, N/A, or a frame without region (1) and a legend.

🧪 How to verify

  • pnpm exec lefthook run pre-commit
  • node scripts/check-tests-leave-git-alone.js -- node --test scripts/__tests__/validate-plan.test.js (28 tests, mutation proofs for the wireframe and Depends-on rules)
  • Nine scripted scenarios (empty request, ticket, UI, regression, trivial, correction, explore more, file source, auto mode):
    • Claude haiku passes all nine with the judge called once. sonnet and opus write the plan on S2, S3, S5; plans checked against the code.
    • mistral-medium-2604: plan written in 17 of 18 runs of the final router, no source file modified in the last 7 S2/S9 runs.
    • Original skill, 4 scenarios on haiku: 9 bench failures (documentation impact missing on all four, comments left, a "Confidence Score").

⚠️ Heads-up

  • Costs more than the original: haiku 0.21 $ against 0.07 $ over S2 to S5; mistral-medium about 0.4 $ against 0.2 $ per run. The validator and the check add calls; the lean text does not pay for them.
  • Medium still stops without writing the plan about once in 18 runs (a text-only turn). No wording fixes it; a retry loop outside the skill would.
  • Medium plan content is weaker than Claude's: wrong version source (cli/package.json instead of the marketplace), invented external URLs, tests of the touched file not always cited. Running the check on a stronger model through the opencode config is the lever left.
  • Depends on follows the sub-agents work; how 02-implement consumes it is not touched here.
  • Single runs per cell: only large gaps are signal.

🔗 Linked issue

Closes #1075

✅ I certify

  • I DO CERTIFY I READ EACH LINE OF THE PULL REQUEST BECAUSE I AM A SOFTWARE ENGINEER, NOT A AI PUPPY.

🤖 Generated with Claude Code

Four actions become three (capture, explore, conclude) behind a mermaid
router. The plan folder is checked by a bundled validator built from the
templates, then by one independent read against plan-checks. Phases gain
a Depends on column.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
blafourcade and others added 2 commits October 23, 2026 08:56
…dator

path.relative returns an absolute path across Windows drives, which the
inside-the-skill check read as inside.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…alidator test

CodeQL flags the multi-character comment replace as incomplete
sanitization.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@blafourcade
blafourcade marked this pull request as ready for review October 23, 2026 07:23
@blafourcade
blafourcade requested a review from a team as a code owner October 23, 2026 07:23
blafourcade and others added 2 commits October 23, 2026 10:04
…n validator

A CRLF plan lost its front matter and table headers to the line-ending
sensitive patterns and was rejected.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The plain "Go to explore" let a small model stop after capture to ask
whether to continue. A markdown link makes the next action a file to read.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@blafourcade
blafourcade enabled auto-merge (squash) October 23, 2026 09:14
@blafourcade
blafourcade disabled auto-merge October 23, 2026 09:23
@blafourcade
blafourcade merged commit b7763ea into next Oct 23, 2026
32 checks passed
@blafourcade
blafourcade deleted the refactor/lean-plan-skill branch October 23, 2026 09:24
alexsoyes added a commit that referenced this pull request Oct 25, 2026
The plan skill rewrite (#1080) already covers this branch's plan changes: phase dependencies, the read-only plan check, no score. Take next's version.
@aidd-bot aidd-bot Bot mentioned this pull request Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants