Skip to content

refactor(aidd-dev): lean the implement skill for small models - #1126

Merged
blafourcade merged 1 commit into
nextfrom
refactor/lean-implement-skill
Oct 28, 2026
Merged

blafourcade merged 1 commit into
nextfrom
refactor/lean-implement-skill

Conversation

@blafourcade

@blafourcade blafourcade commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

🎯 What & why

Lean aidd-dev:02-implement the way brainstorm and plan were, so it runs on Mistral medium under opencode as well as on Claude models, and give it a script that keeps a run on track. The plan skill gets three small additions the implement side relies on.

🛠️ How it works

  • Router. One mermaid whose boxes carry the file paths, and four one-line rules (speak only to ask or answer, code only, push only when asked, do what a hook asks). The plan router now has the same shape: the architecture guard never required its action table.
  • Three linear actions. prepare (5 steps), execute (8 numbered steps, the last one goes back to step 1), finalize (6). Flat numbered steps because Medium skipped the late steps of nested lists (commit, status, run record).
  • A script that says what comes next. validate-implement.cjs checks plan and phase statuses and their dependencies, validates run.md, lists the files left uncommitted, and prints NEXT: take phase 2. Medium follows what a script prints far better than a rule it has to remember.
  • --baseline. Run once in prepare, it records the files the user had already modified; a later commit holding one of them is refused with the command to undo it. It records only while the plan is pending, so a later call cannot take the run's own work for the past.
  • run.md. One row per task (scenario, observed outcome), the head the run validated, and what was left. The script refuses a missing row, an unfilled template, or a head that is not a commit. This is what the review skill will read.
  • Commits. commits.md: one commit per validated task by default; AI should auto commit: never produces none. stop.md: blocked and replan needed, each a one-line row; "stop at once" so no other task or phase is taken first.
  • Plan side. A "Contributor checks" finding that becomes a task of the last phase, a "Runtime" check, validate-plan.cjs rewritten without loops (same output on the 73 plans of this repo), and the plan router without a table.
  • Removed because it did not work. Delegates to sub-agents (never used spontaneously, 5x the cost when forced), a closed vocabulary for results, a feasibility step before coding, negative git rules, a plugin for opencode, and handling of byte-order marks and quoted statuses (0 occurrences in 322 plan files).

🧪 How to verify

  • pnpm exec lefthook run pre-commit
  • node scripts/check-tests-leave-git-alone.js -- node --test 'scripts/__tests__/**/*.test.js' (694 tests)
  • Every rule of the two scripts has a mutation that turns its own test red: 36 for implement, 38 for plan. 14 tests of the first draft were dropped because no mutation needed them.
  • Previous skill against this one, same scenarios, one run per cell (/ separates previous / new):
Scenario Haiku Medium (mistral-medium-2604)
Full plan, 3 phases passes / passes passes / 1 of 3 runs clean (8 of 8 on the 2-phase plan)
never in project memory passes / passes 1 commit / 0 commits
A file the user modified before the start passes / passes the file is committed / left alone
Commit hook rejecting a message passes / passes not compared / passes, no bypass
Task that cannot hold in scope passes / passes (4 of 4) fails / fails
  • Sonnet and Opus pass the full plan with the new skill. Words: router and actions 548 against 665; everything the skill holds 790 against 732.

⚠️ Heads-up

  • Medium: the 8 runs on the 2-phase plan (4 dirty, 3 never, 1 rejected hook) all ended implemented with the script on OK. The 3 runs on the 3-phase plan, the longest, are the unstable ones: one clean, one implemented but ended on a script error (an invented head sha and a baseline re-run, both closed since without a new full run), one stopped mid-phase on a truncated reply. The previous skill was run once on that plan. So far the failures follow the length of the run, not the skill text.
  • Medium writes pass: not applicable on a criterion that cannot hold and marks the plan implemented, with both versions. mistral-small-2603 never reads an action, with both versions.
  • Medium commits once or per phase, not per task; the per-task commit is only reliable on Claude models.
  • An absent commit policy means "commit each validated task", not "never". This is a decision, see the closing note on the commit-policy issue.
  • Parallel phases are left to the orchestrator.
  • On plan, Medium skipped the last action in one of 3 runs without the table and in 0 of 3 with it. Too few runs to tell.
  • Not run here: Windows and Linux, which CI proves.

🔗 Linked issue

Closes #1076

Differs from its text on purpose: more words overall (790 against 732, though the part read on every run is 18% shorter), a commit per validated task by default, and no result on mistral-small-2603. Refs #927, #896, #928, #955.

✅ 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

https://claude.ai/code/session_01XeK3mFt8TGPAoKbzZAsaNf

Router with the paths in its boxes, three linear actions, and a script
that says what comes next, validates the run record and refuses a commit
holding a file the user had already modified. The plan skill gets a
contributor-checks finding, a runtime check, a rewritten validator and
the same router shape.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XeK3mFt8TGPAoKbzZAsaNf
@blafourcade
blafourcade requested a review from a team as a code owner October 28, 2026 11:16
@blafourcade
blafourcade merged commit 6ec74db into next Oct 28, 2026
4 checks passed
@blafourcade
blafourcade deleted the refactor/lean-implement-skill branch October 28, 2026 11:16
Comment on lines +271 to +273
fs
.readFileSync(RUN_TEMPLATE, "utf8")
.replace(/<!--[\s\S]*?-->\n*/g, "")
});

describe("validate-implement: files and folders as real machines write them", () => {
const withBom = (text) => "\uFEFF" + text;
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