Swarm Planner

am-will/codex-skills/skills/swarm-planner

作者 am-will9f954c3b63fda0d1875252009c196bf15072c1ca无许可证1K 个星标收录于 2026年10月9日更新于 2026年10月9日仓库2个月前更新

[EXPLICIT INVOCATION ONLY] Creates dependency-aware implementation plans optimized for parallel multi-agent execution.

AI 生成的概览

创建带显式任务依赖、面向并行多智能体执行的实现计划。

功能
该技能引导智能体产出一份实现计划文档,而不是编写代码。它会调研代码库、获取外部库的最新文档、提出澄清问题,并把任务组织为带有显式 depends_on 字段、验收标准和依赖关系图的结构。最终计划以 markdown 文件保存到工作目录,并在交付前由子智能体审阅。
适用场景
适用于在编写任何代码之前,需要为编码任务制定结构化、可并行执行的实现计划时。也适合多智能体或集群式执行场景,需要把工作拆分为原子化、可独立运行且顺序明确的任务单元。
运行要求
仅为指令,不含附带脚本。需要访问目标代码库进行调研,并通过 Context7 技能或 MCP 获取文档,不可用时可用网络搜索替代。可选使用 request_user_input 或 AskUserQuestion 工具,以及子智能体进行计划审阅。

Swarm-Ready Planner

Create implementation plans with explicit task dependencies optimized for parallel agent execution. This skill can be ran inside or outside of Plan Mode.

Core Principles

  1. Explore Codebase: Investigate architecture, patterns, existing implementations, dependencies, and frameworks in use.
  2. Fresh Documentation First: Use Context7 for ANY external library, framework, or API before planning tasks
  3. Ask Questions: Clarify ambiguities and seek clarification on scope, constraints, or priorities throughout the planning process. At any time.
  4. Explicit Dependencies: Every task declares what it depends on, enabling maximum parallelization
  5. Atomic Tasks: Each task is independently executable by a single agent
  6. Review Before Yield: A subagent reviews the plan for gaps before finalizing

Process

1. Research

Codebase investigation:

  • Architecture, patterns, existing implementations
  • Dependencies and frameworks in use

1a. Optional: Stop to Clarification Questions

  • If the architecture is unclear or missing STOP AND YIELD to the user, and request user input (AskUserQuestions) before moving on. Always offer recommendations for clarification questions.
  • If architecture is present, skip 1a and move onto next step.

2. Documentation

Documentation retrieval (REQUIRED for external dependencies):

Use Context7 skill or MCP to fetch current docs for any libraries/frameworks or APIs that are or will be used in project. If Context7 is not available, use web search.

This ensures version-accurate APIs, correct parameters, and current best practices.

3. STOP and Request User Input

When anything is unclear or could reasonably be done multiple ways:

  • Stop and ask clarifying questions immediately
  • Do not make assumptions about scope, constraints, or priorities
  • Questions should reduce risk and eliminate ambiguity
  • Always offer recommendations for clarification questions.
  • Use request_user_input or AskUserQuestion tool if available.

4. Create Dependency-Aware Plan

Structure the plan with explicit task dependencies using this format:

Task Dependency Format

Each task MUST include:

  • id: Unique identifier (e.g., T1, T2.1)
  • depends_on: Array of task IDs that must complete first (empty [] for root tasks)
  • description: What the task accomplishes
  • location: File paths involved
  • validation: acceptance criteria

Example:

T1: [depends_on: []] Create database schema migrationT2: [depends_on: []] Install required packagesT3: [depends_on: [T1]] Create repository layerT4: [depends_on: [T1]] Create service interfacesT5: [depends_on: [T3, T4]] Implement business logicT6: [depends_on: [T2, T5]] Add API endpointsT7: [depends_on: [T6]] Write integration tests

Tasks with empty/satisfied dependencies can run in parallel (T1, T2 above).

4. Save Plan

Save to <topic>-plan.md in the CWD.

5. Subagent Review

After saving, spawn a subagent to review the plan:

Review this implementation plan for:1. Missing dependencies between tasks2. Ordering issues that would cause failures3. Missing error handling or edge cases4. Gaps, holes, gotchas.
Provide specific, actionable feedback. Do not ask questions.
Plan location: [file path]Context: [brief context about the task]

If the subagent provides actionable feedback, revise the plan before yielding.

Plan Template

markdown
# Plan: [Task Name]
**Generated**: [Date]
## Overview[Summary of task and approach]
## Prerequisites- [Tools, libraries, access needed]
## Dependency Graph

[Visual representation of task dependencies] T1 ──┬── T3 ──┐ │ ├── T5 ── T6 ── T7 T2 ──┴── T4 ──┘


## Tasks
### T1: [Name]- **depends_on**: []- **location**: [file paths]- **description**: [what to do]- **validation**: [how to verify]- **status**: Not Completed- **log**: [leave empty, to be filled out later]- **files edited/created**: [leave empty, to be filled out later]
### T2: [Name]- **depends_on**: []- **location**: [file paths]- **description**: [what to do]- **validation**: [how to verify]- **status**: Not Completed- **log**: [leave empty, to be filled out later]- **files edited/created**: [leave empty, to be filled out later]
### T3: [Name]- **depends_on**: [T1]- **location**: [file paths]- **description**: [what to do]- **validation**: [how to verify]- **status**: Not Completed- **log**: [leave empty, to be filled out later]- **files edited/created**: [leave empty, to be filled out later]
[... continue for all tasks ...]
## Parallel Execution Groups
| Wave | Tasks | Can Start When ||------|-------|----------------|| 1 | T1, T2 | Immediately || 2 | T3, T4 | Wave 1 complete || 3 | T5 | T3, T4 complete || ... | ... | ... |
## Testing Strategy- [How to test]- [What to verify]
## Risks & Mitigations- [What could go wrong + how to handle]

Important

  • Every task must have explicit depends_on field
  • Root tasks (no dependencies) can be executed in parallel immediately
  • Do NOT implement - only create the plan
  • Always use Context7 for external dependencies before finalizing tasks
  • Always ask questions where ambiguity exists

来源与署名

来源:am-will/codex-skills位于skills/swarm-planner提交9f954c3

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架