/microfactory:implement-nextfrom microfactory
Runs one implementation iteration of the microfactory: claims the next eligible issue, reads its plan and refinement thread, implements, tests, verifies, reviews, pushes, and updates the issue. Designed for /loop usage.
Ships in microfactory. 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.
None: SKILL.md is the whole skill.
One implementation iteration: claim → settle the plan → implement → test → verify → review → push → update the issue → record what you learned.
Read .microfactory/config.yaml in the project root. If it does not exist, tell the user to run /microfactory:init-factory and stop.
Load the tasks skill for all task operations below; each is one of its subcommands.
Pull the latest default branch.
Then load the overrides skill for implement-next — and for plan-next, whose analysis, plan-writing and thread-reading steps this skill borrows — and follow what it returns. It comes after the pull so that a change to the override files that was just merged applies to this iteration.
tasks skill's claim implementation. If there is no eligible issue, say "No implementation work available." and end the iteration — the loop cadence handles waiting.claim implementation <key> — view that issue, assign it to yourself, and transition it to In Progress (best effort) instead of searching.Read the complete issue the claim returned, as plan-next step 3 describes: acceptance criteria and other content fields are requirements, and the attachments that bear on the change are downloaded outside the checkout and looked at. A plan does not replace this — it may have been written before a field or an attachment changed.
Then read the issue's comments with the tasks skill's comments. Refinement happens in the thread, not in the issue body — refine-story posts questions there and the product owner answers beneath them, so the thread is part of the specification. Load plan-next and follow its Reading a refinement thread section to resolve it. Do this even when a plan already exists: the plan may predate the answers, and where the two disagree the thread is newer — follow it and correct the plan file.
If the story already has a feature branch or PR, it was sent back from review: load the revise-story skill and follow it instead of the steps below.
Otherwise, use a feature branch when feature_branches: true in config or the issue has a needs-branch label; a skip-branch label overrides both and forces direct-to-default. When branching, create feature/<KEY> from the latest default branch.
Three cases, in this order:
plans/<KEY>.md exists — it is the approved plan, use it as written. An existing plan is followed whatever the setting below says.auto_plan: true — write one now: load the plan-next skill and follow its analysis and plan-writing steps (its steps 4 and 5) to produce plans/<KEY>.md. Treat that plan as approved and carry straight on to the implementation — do not stop for review and do not transition the issue to Awaiting Plan Review.auto_plan off — implement without a plan file. The complete issue and its resolved refinement thread are the specification. Still do plan-next's analysis (its step 4) and carry the conclusions into the implementation: what is dropped here is the document and its self-approval, never the thinking.A missing auto_plan key means false — planning happens in the planner loop unless a project asks for it here. Note that this is the opposite of deep_review, where an absent key means true; the two booleans sit next to each other in config and do not default the same way.
This setting never lets an issue skip planning that was meant to have one: a needs-plan issue is not implementation-eligible until its plan is approved, whatever auto_plan says. Eligibility is the tasks skill's rule and this does not touch it.
Do not commit yet — the two steps below are part of the same change, and one iteration produces one commit.
Confirm what you built actually works, beyond the unit tests.
Anything wider stays out: improvements to screens this issue did not touch, or e2e failures that predate it, get filed as a task with the tasks skill's create rather than fixed here.
The whole diff this iteration produced — the implementation and the fixes from step 7 together — gets reviewed before it is committed, so nothing reaches the commit unreviewed.
Who reviews depends on configuration. A cold review — handing the diff to a fresh agent — is the default; deep_review: false in config turns it off for the project. Labels override the config per issue: needs-review forces the cold review on, skip-review forces it off, and skip-review wins if an issue somehow carries both. A missing deep_review key means true — the cold review is what an unconfigured factory does.
This setting chooses who reviews, never whether. When the cold review is off, review the diff yourself against the same list of concerns below, and say in your report that the cold review was skipped and which setting or label skipped it — so a later reader can tell a deliberate skip from a missed step.
When it is on, hand the review to a fresh agent, not to yourself. You know why every line is there, so you read the diff as you intended it rather than as it is written; an agent seeing it cold does not. Give it only what a reviewer would legitimately have:
plans/<KEY>.md,CLAUDE.md/AGENTS.md, or whatever conventions the repo documents.Do not give it your reasoning for the choices you made — that is the part being tested. Ask it for findings only: correctness, security problems in the code this iteration added, drift from the project's conventions, and simplicity, decoupling and clarity where the project states no rule. If the environment cannot run a separate agent, review the diff yourself against the same list and say so — that is a capability the environment lacks, not a configuration choice, and the two are worth telling apart in the report.
Wait for the findings. The review is worth having only if it lands before the commit does, so nothing in step 9 begins while a review is outstanding — a reviewer still reading while the push goes out has produced a post-mortem, not a review. Where delegated agents run detached unless told otherwise, ask for the form that hands you the findings before you continue. If you use more than one reviewer, launch them together and await all of them; the rule is that findings precede the commit, not that reviewers run one at a time.
The requirement outlives this step: what has to be true before the commit is that no finding is still outstanding. Step 9.1 re-runs the tests when the review changed something, so a finding arriving after that run invalidates it — act on the finding and run the tests again before committing.
Then decide what to act on. The reviewer is working without your context and will sometimes be wrong — a finding that misreads the code is not a defect, and neither is a suggestion that contradicts the plan or the refinement thread. Fix the real ones, and say in your report which findings you rejected and why. Update any documentation the change invalidates.
Pre-existing problems elsewhere are out of scope: file them as a task with tasks create, not fixed here.
Feature-branch mode:
[<KEY>] <summary>, body referencing the issue.In Review.Direct mode:
Done. The commit is the record; nothing is commented on the issue.Issue updates after the code is pushed are best effort: if the PR comment or the transition fails, warn and finish — the pushed code is the important artifact.
If you cannot complete the implementation (e.g. tests cannot be made to pass), do not transition the issue to Done: push nothing broken, comment on the issue describing what blocked you, and leave it In Progress for a human. That comment is about this issue's state, which is the backlog's business; step 10 still applies separately to anything durable you learned on the way.
An iteration that went as predicted records nothing — finish and stop. But when it diverged from what the issue, the thread or the plan led you to expect, that divergence exists nowhere but in your context right now, and the next iteration starts cold. Write it where it will be read again.
Nothing goes on the issue. The backlog is a progress indicator, not a filing cabinet; a comment there is read once, by nobody. Route what you learned by its shape:
| What you learned | Where it goes |
|---|---|
| A durable fact about this project, short and relevant to any future change | CLAUDE.md — or AGENTS.md, whichever the project uses |
| A procedure — how something is done here, in steps | a new skill, whose description names when to use it |
| Reference material too bulky for either | docs/LESSONS-<subject>.md, pointed at from whichever file above names the trigger |
| A judgement about what ought to change | docs/LESSONS.md |
Four rules make this safe to do unattended:
LESSONS.md. A fact is something a future agent could verify in the repo — this build needs that step, that module contradicts the convention it documents. A judgement is what should be true. You have seen one iteration, which is not enough to set policy, so write what you found and leave what to do about it to a human.## Lessons heading, no dated entries, no issue keys — git already records when and why. If it cannot be said that briefly inside prose that already exists, it is not a fact yet; it is a judgement.When a LESSONS-*.md file is the destination, the pointer to it must name the situation, not the topic: "when changing a config key, read docs/LESSONS-config.md first" gets followed; "see docs/LESSONS.md" does not, because nothing tells a reader when it applies.
A one-off — this plan was wrong, this story did not fit — is usually not durable and is recorded nowhere. It becomes a judgement worth writing down only once you can say it as a pattern: plans here are consistently wrong about X.
Commit what you wrote with the same change, so the lesson and the work that produced it arrive together.
Handle one issue per iteration.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub jaksa76/microfactory --plugin microfactory17 skills in this plugin
/breakdown-featureTurn a feature description or requirements document into a sequenced set of implementable stories and create the approved ones in the task backend — lean vertical slices, each sized to a single implementation iteration, with open questions marked for refinement. Use when the user has a spec, PRD, feature brief, or requirements doc to break down into backlog items./customizeAdd, change, list, explain, extract and remove the project's microfactory override files (.microfactory/overrides/general.md and <skill>.md) from a plain-language request such as "always run make e2e-smoke after implementing". Interactive — shows the exact change and asks before writing; checks each override against the factory's invariants and the real step titles. Use when the user wants to add extra instructions for a microfactory skill, or asks what an existing override does or why one applies or is being ignored. Not run by loops; not for config.yaml settings (that is init-factory) or for general questions about how the factory works./find-design-improvementsAnalyze the project and report candidate software design improvements — refactorings, architectural fixes, misplaced responsibilities, missing abstractions, pattern inconsistencies. Read-only: it proposes, it does not change code or create tasks. Use when the user asks what could be improved in the project's design, structure, or architecture./find-improvementsSweep the project for improvements and turn the chosen ones into backlog tasks — runs the design, testing, library, and UI finders, merges and ranks their findings, then creates the ones the user approves in the configured task backend. Use when the user wants to generate a backlog, find work for the factory, or top up the task list./find-library-improvementsAnalyze the project's dependencies and report candidate library improvements — vulnerable or unmaintained packages, worthwhile upgrades, redundant or oversized dependencies to drop, and gaps a library would genuinely fill. Read-only: it proposes, it does not touch manifests or create tasks. Use when the user asks about dependencies, upgrades, or library choices./find-testing-improvementsAnalyze the project's tests and report candidate testing improvements — missing coverage of important behaviors, missing or inverted pyramid layers, flaky and slow tests, tests that cannot run. Read-only: it proposes, it does not write tests or create tasks. Use when the user asks how the project's testing could be improved.Other plugins' skills for the same job