From rpw-building
Naming conventions, dispatch patterns, and guardrails for spawning Build Workers and other subagents
npx claudepluginhub randypitcherii/rpw-agent-marketplace --plugin rpw-buildingThis skill uses the workspace's default tool permissions.
This skill governs dispatch during `/build` sessions. For ad-hoc dispatch outside `/build` (research, debugging, minion tasks), see the `auto-dispatch` skill.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Guides MCP server integration in Claude Code plugins via .mcp.json or plugin.json configs for stdio, SSE, HTTP types, enabling external services as tools.
This skill governs dispatch during /build sessions. For ad-hoc dispatch outside /build (research, debugging, minion tasks), see the auto-dispatch skill.
| Role | Model | ID Pattern | Worktree | Bead Level | Typical Task | Context to Include in Prompt |
|---|---|---|---|---|---|---|
| Build Lead | Opus | build-{feature} | build worktree | Feature (creates and owns the feature bead) | Decompose feature into beads, coordinate Build Workers, merge results | Feature spec, bead plan, file ownership map |
| Build Worker | Opus/Sonnet | bw-{task} | task worktree (required) | Task (executes a single task bead) | Implement a single bead: write tests, implement, commit | Bead ID, task description, file scope, acceptance criteria |
| PR Security Guard | Opus | guard-{feature} | none | — | Review diff for secrets, vulnerabilities, scope violations | Full diff, security checklist |
| Simplifier | Opus | simplify-{feature} | none | — | Reduce complexity, remove dead code, improve readability | Full diff or file set, complexity goals |
| Research Lead | Opus | research-{topic} | none | — | Plan research, dispatch Research Workers, synthesize findings | Research question, desired output format |
| Research Worker | Sonnet | rw-{topic}-{n} | none | — | Fetch, read, and summarize a specific source or subtopic | Subtopic, source URLs, summary template |
| Debug Lead | Opus | debug-{issue} | none | — | Diagnose bugs, dispatch Research Workers, recommend fixes | Problem description, error output, relevant files |
| Minion | Haiku | minion-{action} | none | — (used for bead creation, not ownership) | Bead creation, simple lookups, metadata updates, file renaming | Exact action, input data, expected output format |
Use this exact Agent tool call pattern when dispatching a Build Worker:
Agent(
name: "bw-{task-slug}",
description: "{3-5 word summary}",
model: "sonnet", // default; use "opus" for complex tasks
isolation: "worktree",
run_in_background: true,
mode: "bypassPermissions",
prompt: "... (MUST include absolute worktree path — see Prompt Template)"
)
Use this template when constructing the prompt field for a Build Worker dispatch:
You are a Build Worker implementing task bead {bead-id}.
## Task
{task-description-from-bead}
## File Scope
You are authorized to modify ONLY these files:
{list-of-files-or-directories}
## Working Directory
Your worktree is at: {absolute-worktree-path}
All file paths must be relative to this directory. Use absolute paths when calling tools.
## Acceptance Criteria
{bullet-list-of-acceptance-criteria}
## Test Requirements
Write tests FIRST (TDD), then implement. Run `make verify` (if Makefile exists) before committing. All tests must pass.
## Commit Instruction
Commit with message: '{type}: {description}'
## Constraints
- Do not modify files outside your scope.
- Do not ask questions — make reasonable assumptions and document them in your result.
- Do not push to any remote — the Build Lead controls all merges and pushes.
- Return a brief result summary: success/failure, files changed, assumptions made.
| Model | Use When |
|---|---|
| Sonnet (default) | Standard implementation tasks, file modifications, test writing, straightforward bead work |
| Opus | Architectural decisions, complex refactoring, multi-file coordination, prompt engineering, Build Lead role |
| Haiku | Minion tasks only — bead creation, simple lookups, metadata updates, renaming |
package.json, lock files, config files) must be assigned to ONE worker or sequencedrun_in_background: true for Build Workersisolation: "worktree" for Build Workers.claude/worktrees/ paths without explicit CWD contextWhen using mode: "bypassPermissions", workers can bypass interactive permission prompts. To prevent accidental exposure:
.env files, .env.*, or any dotenv variants~/.aws credentials, ~/.ssh keys, or ~/.config auth tokens.env, credentials.json, *.pem, *.keygit diff --cached for secret patterns before committingWhen a Build Worker fails or returns an incomplete result:
After a Build Worker completes:
git merge --no-ff <task-branch>
Use --no-ff to preserve a merge commit so git branch -d <task-branch> works cleanly afterward. Do NOT use --squash — squash merges create new SHAs that make git think the branch is "not fully merged", causing git branch -d to fail.git worktree remove <path> && git branch -D <branch>make verify after each mergeThe Build Lead manages the beads hierarchy during /build:
bd create --type=feature).bd create --type=task) linked as a child (bd dep add <task> <feature> --type=parent-child).bd dep add <feature> <epic> --type=parent-child).See docs/beads-hierarchy-standard.md for the full hierarchy standard.