ワンクリックで
implement-factory
// Factory loop orchestrator for multi-feature or multi-component implementation manifests. Use for high-complexity work with parallel-eligible workstreams and holdout-scenario evaluation.
// Factory loop orchestrator for multi-feature or multi-component implementation manifests. Use for high-complexity work with parallel-eligible workstreams and holdout-scenario evaluation.
Lightweight implementation orchestrator for low-complexity work — fixes, refactors, doc changes, or single-AC features that do not warrant a phase plan or factory decomposition.
Linear phase-loop orchestrator for single-feature implementation plans. Use for medium-complexity work where transparent human-in-the-loop phase review is preferred over factory automation.
Implementation entry point. Use to execute a completed specification. Auto-detects the decomposition tier (Direct, Incremental, or Factory) from spec artifacts and dispatches to the matching execution sub-skill.
Decompose a single-feature specification into a linear, phase-by-phase implementation plan. Use this for medium-complexity work — single feature, one or two components — where transparent human-in-the-loop phase review is preferred over factory automation.
Scaffold, status-check, and manage specification directories. Use when creating a new spec, reading spec status, transitioning between phases, or logging decisions on a spec in .start/specs/.
Create a comprehensive specification from a brief description. Runs requirements gathering, solution design, and decomposition — routing decomposition to one of three tiers based on a complexity classifier: Direct (no plan), Incremental (linear phase plan), or Factory (parallel units with holdout scenarios).
| name | implement-factory |
| description | Factory loop orchestrator for multi-feature or multi-component implementation manifests. Use for high-complexity work with parallel-eligible workstreams and holdout-scenario evaluation. |
| user-invocable | false |
| argument-hint | spec ID to implement (e.g., 002), or file path |
Act as a factory loop orchestrator that implements specifications by spawning isolated subagents. You control information flow between code agents and evaluation agents. You never implement code directly.
Implementation Target: $ARGUMENTS
Unit { id: string // e.g., "ve1" title: string dependencies: string[] // unit IDs this unit depends on status: pending | in_progress | completed | failed iteration: number // current retry count (starts at 0) failureSummaries: string[] // one-line summaries from last evaluation }
ExecutionGroup { number: number mode: parallel | sequential unitIds: string[] }
EvaluationResult { unitId: string satisfaction: number // 0.0 - 1.0 passed: string[] // scenario names that passed failed: FailedScenario[] }
FailedScenario { name: string summary: string // one-line observable symptom failCount: string // e.g., "3/3 failures" }
Manifest { title: string status: pending | in_progress | completed | failed threshold: number // e.g., 0.90 maxIterations: number // e.g., 5 units: Unit[] executionGroups: ExecutionGroup[] }
State { target = $ARGUMENTS specDirectory: string // resolved .start/specs/NNN-name/ path manifest: Manifest servicePort: number // discovered from project instructions or package.json startCommand: string // discovered from project instructions or package.json serviceProcess: active | stopped }
Always:
Never:
Use the specify-meta skill to resolve the spec directory.
Read manifest.md from the spec directory. Parse it as follows:
Frontmatter (YAML between --- fences):
title: feature namestatus: pending | in_progress | completed | failedthreshold: minimum satisfaction ratio (default 0.90)max_iterations: retry limit per unit (default 5)Units section — parse each line matching: - [x/ ] {id}: {title} — {dependency_clause}
[x] means completed; [ ] means pending.no dependencies | after: {id1}, {id2}Execution Order section — parse each line matching: Group {N} (parallel|sequential): {id1}, {id2}
Validate the manifest:
Discover service configuration. Read the project instructions file (CLAUDE.md, AGENTS.md, or equivalent) and package.json (or equivalent) to find:
npm start, python manage.py runserver)Present manifest discovery to the user:
Offer optional git setup:
match (git repository) { exists => ask the user to choose between Create feature branch and Skip git integration none => proceed without version control }
If manifest status is pending, update it to in_progress.
For each execution group in ascending order:
Skip the group entirely if all its units are already completed.
For each unit in this group where unit.status != completed:
{specDirectory}/units/{unit.id}.mdFor parallel groups: spawn all pending units' code agents in a single response (concurrent fire-and-forget). For sequential groups: spawn one code agent, wait for completion, then proceed to the next.
Wait for ALL code agents in this group to complete before proceeding to evaluation.
Extract from each code agent's result:
Before the first evaluation in this group:
Start the service:
{startCommand} &
Health-check with retry and backoff:
for i in 1 2 3 4 5; do
curl -sf http://localhost:{servicePort}/health && break
sleep $((i * 2))
done
If the health endpoint is not /health, adapt based on the project instructions file or project conventions.
If health check fails after 5 retries, ask the user to choose between Provide manual start command, Retry, or Abort.
The service stays running for all evaluations in this group.
On retry iterations: restart the service only if the code agent modified server-side code. Otherwise, leave it running.
For each unit in this group, sequentially (shared running service):
{specDirectory}/scenarios/{unit.id}/*.md{specDirectory}/scenarios/{unit.id}/e2e-stubs.mdlocalhost:{servicePort} as the service URL.Parse the evaluation agent's satisfaction report for each unit:
Satisfaction: {passed}/{total} scenarios ({percentage}%)
Threshold: {threshold}%
Extract passed and failed scenario details.
Decision per unit:
match (evaluation result) {
satisfaction >= manifest.threshold => {
Mark unit complete:
Update manifest.md: - [ ] {id}: => - [x] {id}:
Report to user: unit passed with satisfaction percentage.
}
satisfaction < manifest.threshold AND unit.iteration < manifest.maxIterations => {
Extract one-line failure summaries (step 2e).
Increment unit.iteration.
Queue unit for retry in the next iteration of this group.
}
unit.iteration >= manifest.maxIterations => {
Mark unit failed.
Ask the user to choose between Retry with guidance (user provides hints), Skip unit, or Abort factory loop.
match (user choice) {
"Retry with guidance" => {
Append user guidance to failure summaries.
Reset iteration counter. Queue for retry.
}
"Skip unit" => mark unit as failed in manifest, continue to next unit.
"Abort" => stop the factory loop, report progress.
}
}
}
When a unit's evaluation is below threshold, extract one-line summaries from the evaluation report.
Filtering rules:
Failed: section of the evaluation report, extract each line.- and before the parenthetical failure count.Example extraction:
# From evaluation report:
Failed:
- SQL injection detection: endpoint returned 500 instead of 400 (3/3 failures)
- Empty input handling: no validation response (3/3 failures)
# Extracted for code agent:
- "SQL injection detection: endpoint returned 500 instead of 400"
- "Empty input handling: no validation response"
Store these in unit.failureSummaries for the next code agent iteration.
If any units in this group need retry:
After all units in this group are resolved (completed, failed, or skipped):
kill %1 # or equivalent process cleanup
After all execution groups are resolved:
status: completed (or failed if any units failed).match (git integration) { active => Commit + PR | Commit only | Skip none => Run tests | Manual review }