From skills
Multi-project batch work router. maintenance (audit/fix), push-work (advance TODOs), push-beyond (discover features → ROI → prototypes).
How this skill is triggered — by the user, by Claude, or both
Slash command
/skills:batchworkThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
The phases and pipelines below are **defaults, not mandates**. Use judgment and adapt to the situation:
The phases and pipelines below are defaults, not mandates. Use judgment and adapt to the situation:
--resume.- [ ] items and enough description to act on works — especially user-authored plans.| Mode | Pipeline | Key Question |
|---|---|---|
| maintenance | Scan → Fix (Phases 1-5) | "What's broken?" |
| push-work | Scan → Fix (Phases 1-5) | "What's unfinished?" |
| push-beyond | Discover → Evaluate → Prototype (Stages 1-4) | "What should we build next?" |
| Flag | Default | Applies To | Description |
|---|---|---|---|
--scope P0/P0-P1/all | all | maintenance, push-work | Filter by priority |
--dry-run | false | all | Stop before execution |
--resume | false | all | Resume from existing output |
--top N | 3 | push-beyond | Max prototypes per project |
~/projects/{name}/--all → scan ~/projects/ for all .git/ directoriesAll output goes to {project}/.batchwork/{mode}/ (namespaced by mode to prevent conflicts):
RESEARCH.md, PLAN.mdRESEARCH.md, PLAN.mdIDEAS.md, PROPOSALS.md~/projects/.batchwork/{mode}/Prompt templates live in prompts/ — loaded on demand, not on every invocation:
Substitute {project}, {mode}, {file_list} etc. before passing to agents.
Use tasks for visibility across long-running operations:
On start: TaskCreate per project — "{mode}: {project}" status pending
Phase/Stage start: TaskUpdate → in_progress with activeForm
Phase/Stage end: TaskUpdate → completed with metadata (findings count, PR URLs, etc.)
Users can run TaskList anytime to check progress.
To run agents in parallel, make multiple Agent tool calls in a SINGLE message. Sequential messages = sequential agents.
WRONG: RIGHT:
Message 1: Agent(alpha) Message 1: Agent(alpha)
← wait Agent(pact)
Message 2: Agent(pact) Agent(smalltalk)
← wait ← all return together
Concurrency budget: Max ~10 agents per batch. If more needed, batch in waves:
Context exhaustion: If an agent fails due to context limits, retry once with half the file list.
Phase 1: Research + Plan → Parallel Explore agents → RESEARCH.md + PLAN.md
── USER GATE ──
Phase 2: Execute via /batch → Skill("batch") per project → worktrees → PRs
Phase 3: Cross-Project → Shared patterns from cross-project PLAN.md
Phase 4: Config Refresh → CLAUDE.md, .claude/, memory (propose changes only)
Phase 5: Verification → Tests, builds, final report
These are the full category lists. Scan only the categories relevant to the user's intent — if they ask about security, don't also scan Code Quality. When no focus is specified, use all.
maintenance (14): Security, Reliability, Financial Calculations, Race Conditions, Data Integrity, API Contracts, Environment & Config, Performance, Error Handling, Type Safety, Database, Auth & Authorization, Dependencies, Code Quality.
push-work (5):
TODO|FIXME|HACK|XXX, group by intentgh issue list --state open if gh CLI availableskip/xit/xtestRead and substitute maintenance-agent.md.
Scope assignment (prevents "Prompt is too long" errors). Scale agent count to the scope — a focused scan of one directory may only need 1 agent:
Rules:
app/, not /home/user/projects/foo/app/)Spawn agents in a single message for parallelism. If total agents across all projects > 10, batch in waves.
# Example: 3 projects, 2 agents each = 6 agents → 1 wave
Single message with 6 Agent tool calls:
Agent(subagent_type="Explore", prompt="...alpha group 1...")
Agent(subagent_type="Explore", prompt="...alpha group 2...")
Agent(subagent_type="Explore", prompt="...pact group 1...")
Agent(subagent_type="Explore", prompt="...pact group 2...")
Agent(subagent_type="Explore", prompt="...smalltalk group 1...")
Agent(subagent_type="Explore", prompt="...smalltalk group 2...")
Priority: P0 (data loss/security/crash) → P1 (likely bug) → P2 (code smell) → P3 (nice-to-have).
RESEARCH.md — findings with file:line, evidence, impact.
PLAN.md — checklist for /batch: - [ ] #001 [{Category}] {Title} with steps and dependencies. This format is recommended but not required — any - [ ] checklist with actionable descriptions works.
Group items by independence for parallelism. Flag Depends on: #001 where needed.
Skip the gate if the user's invocation already makes their intent clear (specific scope, specific project, clear direction). Otherwise:
AskUserQuestion: "Yes, all" / "P0 only" / "P0-P1 only" / "Stop here"--dry-run stops hereInvoke per project using the Skill tool:
Skill("batch", args="Execute the plan in {project}/.batchwork/{mode}/PLAN.md.
PLAN.md + RESEARCH.md are the source of truth. Do NOT re-research.
Priority order (P0 first). Scope: {scope}.
Mark items done: change '- [ ]' to '- [x]' after each item.
Commit after EACH completed item — do not batch commits.
If tests fail: revert, mark (REVERTED).
Each work item or group → one PR.")
Commit strategy (prevents uncommitted changes on context exhaustion):
Run /batch for all projects in parallel (one Skill call per project, all in single message).
Skip this phase if only one project is involved or there are no cross-project dependencies.
Address items from ~/projects/.batchwork/{mode}/PLAN.md.
Skip if changes were minor or only touched one area. For each touched project:
~/.claude/skills/batchwork/SKILL_IMPROVEMENTS.md. Do NOT edit SKILL.md directly.Completely separate pipeline. Asks "what NEW thing should we build?" not "what's broken?"
Start at whatever stage makes sense. If the user already has ideas, skip Stage 1. If they already have a ranked list, skip to Stage 3. If they hand you a specific feature to prototype, go straight there.
Stage 1: Discover → 1 general-purpose agent per project → IDEAS.md
Stage 2: Evaluate → Main orchestrator scores ROI → PROPOSALS.md
── USER GATE ──
Stage 3: Prototype → 1 builder agent per prototype (worktree) → branch + PR
Stage 4: Report → Final table + recommendations
Read and substitute discover-agent.md.
Spawn one general-purpose agent per project (not Explore — needs WebSearch + Bash for git). All agents in a single message for parallelism. Max 10 per wave.
| Dimension | Sources |
|---|---|
| Project Identity | README, CLAUDE.md, package.json |
| Momentum | git log --oneline -30, recent PRs |
| Author Intent | TODOs, roadmap files, GitHub issues |
| Competitive Landscape | Web search for 2-3 competitors |
| User Surface | UI pages, API endpoints, CLI commands |
Cross-mode awareness: If .batchwork/maintenance/PLAN.md exists, agents read it to avoid proposing features that conflict with unresolved P0 bugs.
# {Project} — Push-Beyond Ideas
Generated: {date}
## Project Summary
## Recent Momentum
## Competitor Landscape
## Ideas
### #01 {Title}
- **Category**: {New Capability | Integration | Automation | Data/Analytics | UX/UI | Monetization}
- **One-liner**: {description}
- **User value**: {why users want this}
- **Existing leverage**: {reusable code/data/infra}
- **Effort hints**: {what's missing, new deps needed}
- **Scope**: {Small | Medium | Large}
- **Competitor ref**: {who does this}
Main orchestrator (no agents). Read each IDEAS.md + skim project codebase to verify effort hints.
Impact (1-5): 5=core daily workflow/revenue, 4=significant weekly value, 3=nice-to-have, 2=niche, 1=internal-only.
Effort (1-5): 1=<50 LOC reuse existing, 2=50-200 LOC one new dep, 3=200-500 LOC new patterns, 4=500-1000 LOC new infra, 5=1000+ LOC major arch change.
ROI = Impact / Effort (higher is better).
--top N (default 3)# {Project} — Feature Proposals
Generated: {date} | Ideas: {count} | Prototyping: top {N}
## Rankings
| # | Feature | Impact | Effort | ROI | Category | Scope |
## Prototype Specs
### #1 — {Title} (ROI: {score})
- **What**: {description}
- **Why now**: {why feasible with current codebase}
- **Prototype scope**: {MVP — max 200 LOC}
- **Entry point**: {where to wire in}
- **Dependencies**: {new packages/APIs, if any}
- **Smoke test**: {how to verify}
- **Not in prototype**: {what production version adds}
AskUserQuestion: "Which to prototype?" → user picks, or "All top N" / "Stop here"--dry-run stops hereRead and substitute prototype-agent.md.
Spawn one general-purpose agent per prototype with isolation: "worktree". All prototypes in single message for parallelism. Max 10 per wave.
proto/{project}/{feature-slug}Each prototype gets an isolated git worktree (auto-created by isolation: "worktree").
git worktree list && git worktree remove <path>| Project | Feature | ROI | Proto | PR | Recommendation |
|-----------|------------------|-----|---------|--------|----------------|
| alpha | P&L dashboard | 2.5 | WORKS | PR #8 | Ship it |
| pact | Agent analytics | 3.0 | PARTIAL | PR #12 | Iterate |
| wellspring| Plugin system | 1.5 | STUCK | PR #18 | Drop |
| Proto Status | ROI >= 2.0 | ROI < 2.0 |
|---|---|---|
| WORKS (test passes) | Ship it | Consider |
| PARTIAL (builds, test fails) | Iterate | Drop |
| STUCK (couldn't build) | Revisit | Drop |
"Ship it" → run /batch to productionize. "Iterate" → refine manually. "Drop" → close PR.
When --resume:
PLAN.md in .batchwork/{mode}/, parse - [ ] vs - [x], resume Phase 2 on unchecked items. The PLAN.md can be batchwork-generated or user-authored — any - [ ] checklist works.git branch --list 'proto/{project}/*' → skip completed prototypes in Stage 3.| Scenario | Action |
|---|---|
| Invalid project path | Abort with error listing valid projects |
| Not a git repo | Warn and skip |
| Agent context exhaustion | Retry once with half the file list |
| Test fails after fix | Revert, mark (REVERTED), continue |
| Prototype agent stuck (30 tool calls) | Abandon, note why in PR |
| Web search fails | Continue without competitor data |
maintenance/push-work: 2-5 Explore agents/project (Phase 1) → /batch workers (Phase 2) → main (Phases 3-5).
push-beyond: 1 general-purpose agent/project (Stage 1) → main (Stage 2) → 1 agent/prototype in worktree (Stage 3) → main (Stage 4).
Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub yihan2099/skills --plugin skills