Agent skill
ralph-spawn
Spawn parallel agents in git worktrees for automated feature implementation. Creates isolated development environments for ready tasks from Linear.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/ralph-spawn
SKILL.md
/ralph.spawn [epic]
Create worktrees for all ready tasks in an epic and start parallel agent execution.
Prerequisites
CRITICAL: Run /ralph.preflight before spawning agents. If Linear MCP is not
authenticated, spawn will BLOCK with recovery instructions.
Process
-
Pre-Flight Check (REQUIRED)
Run
/ralph.preflightto verify:- Linear MCP is authenticated (REQUIRED)
- Git repository is valid (REQUIRED)
- Cognee is available (OPTIONAL - will buffer locally if not)
If pre-flight BLOCKS, fix the issue and resume with
/ralph.resume. -
Query Linear for ready tasks
mcp__plugin_linear_linear__list_issues({ "team": "floe", "project": "floe-{epic_number}-{slug}", "state": "backlog" }) -
Build dependency graph from blockedBy relations
-
Detect file overlaps to determine parallelization
- Tasks modifying different files → parallel
- Tasks modifying same files → sequential (waves)
-
Create worktrees for non-overlapping tasks
bashgit worktree add "../floe-agent-{epic}-{task_slug}" -b "feature/{epic}-{task}" main -
Enable direnv in each worktree (CRITICAL for environment setup)
bashcd "../floe-agent-{epic}-{task_slug}" && direnv allowWhy: Without
direnv allow, the worktree won't load .envrc and environment variables (like PYRIGHT_PYTHON_FORCE_VERSION) won't be set. This causes:- Type checking warnings/failures
- Missing environment variables
- Inconsistent development environment
-
Initialize agent state in each worktree
- Copy
.ralph/templates/plan.json→.agent/plan.json - Copy
.ralph/templates/activity.md→.agent/activity.md - Copy
.ralph/templates/PROMPT.md→.agent/PROMPT.md - Copy
.specify/memory/constitution.md→.agent/constitution.md
- Copy
-
Claim tasks in Linear
mcp__plugin_linear_linear__update_issue({ "id": task_id, "state": "started", "assignee": "me" }) -
Update manifest.json with active agents
Output
RALPH WIGGUM SPAWN - EP001
Created Worktrees: 4
Wave 1: [T001 (auth), T003 (catalog), T005 (tests)]
Wave 2: [T002 (models)] - depends on T001
Worktree Details:
- ../floe-agent-ep001-auth T001 FLO-33 feature/ep001-auth
- ../floe-agent-ep001-catalog T003 FLO-35 feature/ep001-catalog
- ../floe-agent-ep001-tests T005 FLO-37 feature/ep001-tests
Next: Run /ralph.status to monitor progress
Configuration
See .ralph/config.yaml:
max_parallel_agents: Maximum concurrent worktreesworktree_pattern: Naming convention for worktrees
Agent Loop (Per Worktree)
Each agent runs the Ralph Wiggum pattern:
- Read state -
.agent/plan.json,.agent/activity.md - Identify next subtask - First with
passes: false - Implement - Make atomic, focused changes
- Run quality gates - lint, type, test, security, constitution
- Update state - Mark subtask complete, commit, log
- Repeat until all subtasks pass or BLOCKED
Error Handling
- If worktree exists: Remove and recreate
- If branch exists: Delete and recreate
- If Linear unavailable: Signal error, don't start
- If no ready tasks: Report "No ready tasks for epic"
Related Commands
/ralph.status- Monitor agent progress/ralph.integrate- Prepare for PR after completion/ralph.cleanup- Remove worktrees after merge
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?