一键导入
plan-with-subagents
Plan multi-step implementation tasks to minimize context usage and maximize parallelism. Automatically applies whenever plan mode is active.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Plan multi-step implementation tasks to minimize context usage and maximize parallelism. Automatically applies whenever plan mode is active.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | plan-with-subagents |
| description | Plan multi-step implementation tasks to minimize context usage and maximize parallelism. Automatically applies whenever plan mode is active. |
| user-invocable | true |
These guidelines apply automatically whenever plan mode is active. Plan mode implies complexity, so always design for parallelism and minimal context.
Sub-agents are cheap and effective. When in doubt, spawn an agent. Benefits:
Default to spawning agents for:
Explore agent)Plan agent)general-purpose agents in parallel)Bash agent)Group work by which files are touched. Phases that modify different files can run in parallel.
Phase A: modifies src/api/server.py, src/api/models.py
Phase B: modifies tests/test_api.py, tests/conftest.py
Phase C: modifies README.md, docs/API.md
→ All three can run in parallel
Some phases MUST run in order:
Each sub-agent should receive ONLY the context it needs:
Avoid passing full project history or unrelated requirements.
| Task Type | Agent | Why |
|---|---|---|
| Run shell commands (git, gh, npm) | Bash | Direct command execution |
| Find files/patterns in codebase | Explore | Optimized for search |
| Design implementation approach | Plan | Architectural thinking |
| Write/modify code | general-purpose | Full tool access |
| Research questions | general-purpose | Web + file access |
When spawning sub-agents, use this structure:
**Task:** [One sentence describing the goal]
**Files to modify:**
- path/to/file1.py - [what to change]
- path/to/file2.py - [what to change]
**Specific changes:**
1. [Concrete change 1]
2. [Concrete change 2]
**Commit when done:**
"[type]: [description]"
## Phase 0: Setup (sequential)
- Create directory structure
→ COMMIT: "chore: Add project scaffolding"
## Phase 1: Research (sequential)
- Explore codebase to understand patterns
- No commit (exploration only)
## Phases 2, 3, 4 (PARALLEL)
Agent A - Phase 2: Backend changes
- Modify src/api/*.py
→ COMMIT: "feat: Add new endpoint"
Agent B - Phase 3: Frontend changes
- Modify src/ui/*.tsx
→ COMMIT: "feat: Add UI component"
Agent C - Phase 4: Documentation
- Modify docs/*.md
→ COMMIT: "docs: Document new feature"
## Phase 5: Integration (sequential, after 2-4)
- Update tests that depend on all changes
→ COMMIT: "test: Add integration tests"
## Phase 6: Validation
- Run tests, linting, type checks
→ COMMIT only if fixes needed
Before marking phases as parallel, verify:
Don't: Create one giant phase with all changes Do: Split by logical units that can be tested independently
Don't: Pass entire CLAUDE.md to every sub-agent Do: Extract only relevant sections for each task
Don't: Have parallel phases commit to the same file Do: Sequence phases that touch shared files
Each phase should commit its own work immediately when done. This provides:
Use conventional commit prefixes:
feat: - New featurefix: - Bug fixchore: - Maintenancedocs: - Documentationtest: - Testsrefactor: - Code restructuring