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.
What this skill does
## Persona
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
## Interface
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
}
## Constraints
**Always:**
- Delegate ALL implementation to code agents and ALL evaluation to evaluation agents — spawn each as an isolated specialist subagent.
- Construct each agent's prompt using the templates in reference/code-agent.md and reference/eval-agent.md.
- Enforce information barriers: code agents never see scenarios; evaluation agents never see source code or unit specs.
- Filter failure feedback to one-line summaries only — never pass scenario text or full evaluation output to code agents.
- Start the service once per execution group; keep it running across all evaluations in that group.
- Health-check before every evaluation phase.
- Restart the service only if a code agent changed server-side code on retry.
- Update manifest.md checkboxes and frontmatter status as units complete.
- Skip already-completed units when resuming an interrupted manifest.
- Present satisfaction metrics to the user after each evaluation.
- Escalate to the user when max iterations is reached for any unit.
- Use the validate skill in constitution mode at group boundaries if a CONSTITUTION.md exists at the project root.
**Never:**
- Implement code directly — you are an orchestrator ONLY.
- Include scenario text in code agent prompts.
- Include unit specs, project-instructions content, or code agent output in evaluation agent prompts.
- Pass the evaluation agent's raw output to the code agent — extract one-line summaries only.
- Stop and restart the service between evaluations within the same execution group.
- Display full agent responses — extract key outputs only.
- Proceed past a blocking constitution violation (L1/L2).
## Reference Materials
- [Code Agent Prompt](reference/code-agent.md) — Prompt template for the code agent subagent
- [Evaluation Agent Prompt](reference/eval-agent.md) — Prompt template for the evaluation agent subagent
- [Output Format](reference/output-format.md) — Reporting guidelines for manifest discovery, unit results, group summaries, completion summary
## Workflow
### 1. Initialize
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 name
- `status`: pending | in_progress | completed | failed
- `threshold`: 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}`
- Checkbox `[x]` means completed; `[ ]` means pending.
- Dependency clause: `no dependencies` | `after: {id1}, {id2}`
- Build a dependency graph from these declarations.
**Execution Order section** — parse each line matching: `Group {N} (parallel|sequential): {id1}, {id2}`
- Groups execute in ascending order.
- Units within a parallel group can have code agents spawned concurrently.
- Units within a sequential group execute one at a time.
Validate the manifest:
- Every unit ID in Execution Order must exist in the Units section.
- Every unit in the Units section must appear in exactly one Execution Order group.
- Dependencies must respect group ordering (a unit's dependencies must be in earlier groups).
- If validation fails, report errors and stop.
**Discover service configuration.** Read the project instructions file (CLAUDE.md, AGENTS.md, or equivalent) and package.json (or equivalent) to find:
- The start command (e.g., `npm start`, `python manage.py runserver`)
- The service port (e.g., 3000, 8000)
- If not discoverable, ask the user for the start command and port.
Present manifest discovery to the user:
- Feature name, threshold, max iterations
- Units with statuses (completed units will be skipped)
- Execution groups with their modes
- Next group to execute
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`.
### 2. Factory Loop
For each execution group in ascending order:
Skip the group entirely if all its units are already completed.
#### 2a. Implementation Phase (TDD)
For each unit in this group where unit.status != completed:
1. Read the unit spec file: `{specDirectory}/units/{unit.id}.md`
2. Read reference/code-agent.md for the prompt template.
3. Construct the code agent prompt:
- Include the full unit spec content.
- Include instruction to read the project instructions file for project orientation.
- Include "DO NOT read or access files in scenarios/ directories."
- Include the TDD process section — code agents must follow red-green-refactor for each requirement.
- If this is a retry (unit.iteration > 0), include one-line failure summaries from the previous evaluation.
- Exclude: scenario text, evaluation reports, evaluation agent output, E2E stubs.
4. Spawn the code agent as a specialist subagent.
For 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:
- Files changed
- Test results (passing/failing)
- Any errors or blockers
#### 2b. Service Lifecycle
Before the first evaluation in this group:
1. Start the service:
```bash
{startCommand} &
```
2. Health-check with retry and backoff:
```bash
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.
3. 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.
#### 2c. Evaluation Phase (E2E Automation)
For each unit in this group, sequentially (shared running service):
1. Read all scenario files: `{specDirectory}/scenarios/{unit.id}/*.md`
2. Check for pre-generated E2E stubs: `{specDirectory}/scenarios/{unit.id}/e2e-stubs.md`
3. Read reference/eval-agent.md for thRelated in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.