From buehler
Use when ready to start implementation — spawns parallel implementer agents for issues that have no unresolved dependencies, targeting the feature branch and injecting mustread context into each agent
How this skill is triggered — by the user, by Claude, or both
Slash command
/buehler:dispatchThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
**Type:** Rigid. Follow this process exactly.
Type: Rigid. Follow this process exactly.
buehler:structureYou MUST create a task for each of these items and complete them in order:
Read .github/buehler.yaml from the project root. Extract or use defaults:
agents:
max_parallel: 3
model: opus
branches:
prefix: buehler
feature: "" # e.g. feature/auth-v1 — REQUIRED
worktrees:
directory: .worktrees
approval_gates:
before_dispatch: false
commands:
test: "" # auto-detect if empty
lint: ""
build: ""
wiki:
directory: .wiki
meta_page: "" # auto-derived from epic name if empty: {wiki_directory}/{Epic-Name}.md
prd: "" # auto-derived from epic name if empty: {wiki_directory}/PRD-{epic}-v{Major}.md
sizing:
token_ranges: {} # auto-derived from sizing.buckets if empty: { "size:xs": [1000, 10000], ... }
project:
board_number: # GitHub Project number
board_title: "" # GitHub Project title
review:
auto_request: false
reviewers: [] # GitHub usernames to request review from
Resolve repo_root: Read the repo_root value from preflight JSONL output (emitted by check-config.sh). All subsequent git worktree and git -C commands use this absolute path. Do not use git rev-parse --show-toplevel — it can resolve to .wiki/ if the session's CWD is inside the wiki clone.
Auto-detect build commands if not configured:
package.json exists -> npm test, npm run lint, npm run buildCargo.toml exists -> cargo test, cargo clippy, cargo buildpyproject.toml exists -> pytest, ruff check ., (no build)go.mod exists -> go test ./..., golangci-lint run, go build ./...Makefile exists -> make test, make lint, make buildUse GitHub MCP to fetch all open issues in the milestone:
mcp__github__list_issues with owner, repo, state: "OPEN"
Filter to issues belonging to the target milestone. Then:
meta:ignore — any issue with the meta:ignore label is excluded completely from all processing.meta:mustread issues separately — issues with the meta:mustread label are context documents, not work items. Read their full bodies; these will be injected into each agent's prompt context.<!-- buehler:blocked-by #N, #M --> from each issue body<!-- buehler:parent #NN --> from each issue bodyFor each work item issue, extract dependencies from <!-- buehler:blocked-by ... --> comments.
Parse <!-- buehler:parent #NN --> comments to understand story-to-task hierarchy. Walk parent-to-child relationships for task-level dependency resolution: if a parent story has a blocked-by, all its child tasks inherit that dependency.
Build a directed acyclic graph (DAG):
Verify the graph is acyclic. If cycles detected, report to user and stop.
An issue is ready if:
blocked-by issues are closed (or have status:done label)status:ready label (not status:in-progress, status:blocked, status:in-review)meta:ignore or meta:mustread labels (these are not work items)From the ready set, select up to max_parallel issues. Selection criteria:
priority:critical > priority:high > priority:medium > priority:low## Files Likely Affected section of each issue body (bulleted list of paths). If two ready issues list the same file path, only dispatch one per batch (to avoid merge conflicts)size:xs < size:s < size:m < size:l < size:xl) for faster feedbackIf approval_gates.before_dispatch is true, present the batch plan and wait for human approval:
## Dispatch Batch Plan
**Milestone:** {title}
**Feature Branch:** {feature_branch}
**Batch size:** {count} of {max_parallel} max
**Remaining issues:** {total_open - count}
| # | Title | Size | Priority | Branch |
|---|-------|------|----------|--------|
| {n} | {title} | {size} | {priority} | {branch_prefix}/{n}-{slug} from {feature_branch} |
**File overlap check:** {PASS or list conflicts}
Approve dispatch? (The agents will create branches off the feature branch, implement with TDD, and create PRs targeting the feature branch.)
If approval gate is off, announce the batch but proceed immediately.
Before dispatching, resolve board field IDs (once per dispatch invocation):
gh project view {board_number} --owner {owner} --format json --jq '.id'gh project field-list {board_number} --owner {owner} --format json --jq '.fields[] | select(.name == "Status") | .id'gh project field-list {board_number} --owner {owner} --format json --jq '.fields[] | select(.name == "Status") | .options[]' — extract IDs for "In Progress" and "In Review"These IDs are stable for the duration of a dispatch invocation.
If the user requested a dry run (/dispatch --dry-run or dry-run argument in the prompt), execute the full pipeline validation without spawning agents:
For each issue in the batch, create the worktree from repo_root (validates git plumbing):
git -C {repo_root} worktree add \
{repo_root}/{worktree_dir}/{branch_prefix}/{issue_number}-{slug} \
-b {branch_prefix}/{issue_number}-{slug} \
{feature_branch}
Record PASS/FAIL per issue. On failure, continue to the next issue (do not abort).
Fill the implementer prompt template for each issue (same as Step 6 items 5-9).
Print each filled prompt to output.
Remove all worktrees created during dry run:
git -C {repo_root} worktree remove {path}
Also delete the branches created by worktree add -b:
git -C {repo_root} branch -D {branch_prefix}/{issue_number}-{slug}
Report:
## Dry Run Complete
**Would dispatch:** {count} agents
**Worktree creation:** {PASS/FAIL for each}
**Bash permissions:** {PASS from preflight or FAIL}
| # | Title | Branch | Worktree Path | Prompt Length |
|---|-------|--------|---------------|--------------|
| {n} | {title} | {branch} | {path} | ~{tokens} |
Filled prompts printed above.
No agents were spawned. Run dispatch without --dry-run to execute.
Stop. Do not proceed to Step 6.
For each issue in the batch:
Generate branch name: {branch_prefix}/{issue_number}-{slug}
slug = issue title, lowercased, spaces -> hyphens, max 50 chars, alphanumeric + hyphens onlyGenerate worktree path: {worktree_dir}/{branch_prefix}/{issue_number}-{slug}
Create the worktree from repo_root — dispatch creates the worktree before spawning the agent. The agent receives a ready-to-use worktree and validates it (does not create it).
git -C {repo_root} worktree add \
{repo_root}/{worktree_dir}/{branch_prefix}/{issue_number}-{slug} \
-b {branch_prefix}/{issue_number}-{slug} \
{feature_branch}
The worktree path passed to the agent is always an absolute path.
Label the issue status:in-progress (remove status:ready)
4a. Update board status — query the issue's item ID on the board, then set Status to "In Progress":
bash # Get item ID gh project item-list {board_number} --owner {owner} --format json --jq '.items[] | select(.content.number == {issue_number}) | .id' # Set status gh project item-edit --id {item_id} --field-id {status_field_id} --project-id {project_node_id} --single-select-option-id {in_progress_option_id}
Read the implementer prompt template from skills/dispatch/implementer-prompt.md in this plugin
Read the PR body template from skills/structure/pr-body-template.md in this plugin
Read meta:mustread issue bodies collected in Step 2 and prepare them as a combined block for injection into the agent prompt under "Must-Read Context"
Read wiki context — fetch the wiki meta page and PRD (from config wiki.meta_page and wiki.prd) and prepare excerpts for injection under "Context Chain"
Fill the prompt template with:
sizing.token_rangesSpawn the agent using the Agent tool (no isolation: "worktree" — the worktree was already created in step 3):
Agent tool with subagent_type: "buehler:implementer"
prompt: {filled implementer prompt}
model: {from config, default opus}
Do NOT use isolation: "worktree" — this creates worktrees from the session's git context, which may be .wiki/ after buehler:structure. Dispatch owns worktree creation.
Spawn all agents in a single message (parallel tool calls) for maximum concurrency.
After all agents in the batch complete:
status: success -> issue already labeled status:in-review by agentstatus: error -> label status:blocked, post failure detailsstatus: blocked -> already labeled by agent## Dispatch Batch Complete
| # | Title | Status | PR | Tests |
|---|-------|--------|-----|-------|
| {n} | {title} | {status} | #{pr} | {pass/fail} |
**Succeeded:** {count}
**Failed/Blocked:** {count}
buehler:reviewtitle = "Add user authentication middleware"
slug = "add-user-authentication-middleware"
title = "Fix: Handle NULL values in CSV export (#42)"
slug = "fix-handle-null-values-in-csv-export"
Rules:
Worktrees are created by dispatch (Step 6 item 3) and need lifecycle management across dispatch, review, and integration.
Before spawning an agent for an issue, check if a worktree already exists at the target path:
git -C {repo_root} worktree list | grep "{worktree_path}"
| Condition | Action |
|---|---|
| No worktree exists | Normal path — dispatch creates it in Step 6 item 3 |
| Worktree exists, branch matches | Re-dispatch scenario (agent failed/blocked previously). Remove the stale worktree first: git -C {repo_root} worktree remove {path} --force, then dispatch normally |
| Worktree exists, branch differs | Conflict — another issue was assigned this path. Report error, skip this issue |
If an agent returns status: error or status: blocked:
buehler:integrate Step 14When buehler:review needs to address feedback on a task PR:
git worktree add {path} {branch_name})All worktrees for the milestone are cleaned up after merge:
git -C {repo_root} worktree remove {path} # for each completed worktree
git -C {repo_root} worktree prune
max_parallel agents — even if more issues are readyAgent with subagent_type: "buehler:implementer", NOT via bash. Do NOT use isolation: "worktree".meta:mustread issues as contextFetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
Applies a firm's KYC/AML rules grid to parsed onboarding records: assigns risk rating, checks required documents, outputs rule outcomes with citations, and routes for escalation.
Generates daily or weekly digests of activity from connected sources (chat, email, docs, tasks, CRM), highlighting action items, decisions, mentions, and project updates.
npx claudepluginhub corrigantj/buehler --plugin buehler