plan

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

/plan

/plan

Create PLAN.md with phase-based breakdown for tasks, spikes, and bugs.
创建用于任务、研究任务(Spike)和Bug的基于阶段划分的PLAN.md文件。

Usage

使用方法

bash
/plan 001                    # Create plan for issue 001 (auto-detect project)
/plan 001 --project coordinatr  # Explicit project
/plan SPIKE-003              # Plan for a spike (creates exploration plans)
/plan 003 --second-opinion   # Get peer review from Gemini CLI before finalizing
bash
/plan 001                    # 为问题001创建计划(自动识别项目)
/plan 001 --project coordinatr  # 指定项目
/plan SPIKE-003              # 为研究任务创建计划(生成探索性计划)
/plan 003 --second-opinion   # 在最终确定前获取Gemini CLI的同行评审意见

Issue Type Detection

问题类型检测

Issue TypePlan StructureFile Created
Task (TASK.md)Sequential phases with checkpointsPLAN.md
Bug (BUG.md)Investigation → Fix phasesPLAN.md
Spike (SPIKE.md)Exploration phases per approachPLAN-1.md, PLAN-2.md, ...
问题类型计划结构生成的文件
任务(TASK.md)带检查点的连续阶段PLAN.md
Bug(BUG.md)调查 → 修复阶段PLAN.md
研究任务(SPIKE.md)每种方案对应探索阶段PLAN-1.md, PLAN-2.md, ...

Execution Flow

执行流程

For Task/Bug

任务/Bug场景

  1. Load Context:
    bash
    Read: ideas/[project]/issues/###-*/TASK.md (or BUG.md)
    Read: spaces/[project]/docs/specs/*.md (if implements: field exists)
    Glob: spaces/[project]/docs/adrs/ADR-*.md
    Glob: resources/research/*.md
    If the issue has an
    implements:
    field, load that specific spec section:
    bash
    Read: spaces/[project]/docs/specs/required-features.md  # Extract relevant section
  2. Cross-Project Pattern Search:
    bash
    # Search other projects for similar implementations
    Grep: spaces/*/src/ for relevant patterns
    Include relevant references in plan:
    markdown
    ## Related Implementations
    
    Found similar patterns in other projects:
    - `spaces/yourbench/src/auth/clerk.ts` - Clerk auth setup
    - `spaces/coordinatr/src/lib/session.ts` - Session handling
  3. Library Documentation (automatic for integrations):
    MANDATORY when task involves:
    • Installing/configuring external libraries or SDKs
    • Framework integrations (auth providers, databases, APIs)
    • Third-party services (Clerk, Stripe, AWS services, etc.)
    Process:
    bash
    # 1. Resolve library ID
    mcp__context7__resolve-library-id: {libraryName}
    
    # 2. Fetch current documentation
    mcp__context7__query-docs: {context7CompatibleLibraryID}
    
    # 3. Search for recent patterns/best practices
    WebSearch: "{library} {framework} integration 2026"
    Document findings:
    markdown
    ## Library Documentation Validation
    
    **{Library Name}** (validated YYYY-MM-DD):
    - Current version: X.Y.Z
    - Key integration patterns: [summary]
    - Recommended approach: [based on current docs]
  4. Generate Plan:
    • Break work into logical phases
    • Each phase has clear deliverables
    • Include checkpoints between phases
    • Add "Done When" criteria
  5. Write PLAN.md:
    • Present phases, estimated effort, dependencies
    • Include "Library Documentation Validation" section (if applicable)
    • Include "Second Opinion Analysis" section (if requested)
  6. Commit Suggestion:
    • Ask: "Commit PLAN.md to ideas repo? (yes/no)"
  1. 加载上下文:
    bash
    读取: ideas/[project]/issues/###-*/TASK.md (或 BUG.md)
    读取: spaces/[project]/docs/specs/*.md (若存在implements字段)
    匹配: spaces/[project]/docs/adrs/ADR-*.md
    匹配: resources/research/*.md
    如果问题包含
    implements:
    字段,加载对应的规范章节:
    bash
    读取: spaces/[project]/docs/specs/required-features.md  # 提取相关章节
  2. 跨项目模式搜索:
    bash
    # 搜索其他项目中的类似实现
    匹配: spaces/*/src/ 中的相关模式
    在计划中包含相关参考:
    markdown
    ## 相关实现
    
    在其他项目中找到类似模式:
    - `spaces/yourbench/src/auth/clerk.ts` - Clerk认证配置
    - `spaces/coordinatr/src/lib/session.ts` - 会话处理
  3. 库文档验证(集成场景自动触发):
    当任务涉及以下内容时必须执行:
    • 安装/配置外部库或SDK
    • 框架集成(认证提供者、数据库、API)
    • 第三方服务(Clerk、Stripe、AWS服务等)
    流程:
    bash
    # 1. 解析库ID
    mcp__context7__resolve-library-id: {libraryName}
    
    # 2. 获取当前文档
    mcp__context7__query-docs: {context7CompatibleLibraryID}
    
    # 3. 搜索最新模式/最佳实践
    WebSearch: "{library} {framework} integration 2026"
    记录结果:
    markdown
    ## 库文档验证
    
    **{Library Name}**(验证时间:YYYY-MM-DD):
    - 当前版本: X.Y.Z
    - 核心集成模式: [摘要]
    - 推荐方案: [基于当前文档]
  4. 生成计划:
    • 将工作拆分为逻辑阶段
    • 每个阶段有明确的交付物
    • 阶段之间包含检查点
    • 添加“完成标准”
  5. 写入PLAN.md:
    • 展示阶段、预估工作量、依赖关系
    • 包含“库文档验证”章节(如适用)
    • 包含“同行评审分析”章节(如请求)
  6. 提交建议:
    • 询问: "是否将PLAN.md提交到ideas仓库?(是/否)"

For Spike (Exploration)

研究任务(探索)场景

  1. Load Context: Read SPIKE.md (questions, success criteria, time box)
  2. Gather Approaches:
    • Ask: "How many approaches to explore?" → N
    • For each: "Describe approach N?"
  3. Generate: Create PLAN-N.md for each approach
  4. Commit Suggestion: Ask to commit all plan files
  1. 加载上下文: 读取SPIKE.md(问题、成功标准、时间限制)
  2. 收集探索方案:
    • 询问: "需要探索多少种方案?" → N
    • 针对每个方案: "描述方案N?"
  3. 生成计划: 为每个方案创建PLAN-N.md文件
  4. 提交建议: 询问是否提交所有计划文件

Task Plan Example

任务计划示例

markdown
undefined
markdown
undefined

Implementation Plan: 001 Research Auth Patterns

实施计划: 001 研究认证模式

Overview

概述

Research authentication patterns for Coordinatr's multi-tenant architecture.
为Coordinatr的多租户架构研究认证模式。

Phase 1: Survey Existing Solutions

阶段1: 调研现有解决方案

1.1 - Research Auth Libraries

1.1 - 研究认证库

  • Review Better Auth documentation
  • Compare with Auth.js and Lucia
  • Document trade-offs
  • 查阅Better Auth文档
  • 与Auth.js和Lucia进行对比
  • 记录权衡点

1.2 - Multi-Tenant Patterns

1.2 - 多租户模式

  • Research team-based auth patterns
  • Review how Slack, Linear handle it
  • [CHECKPOINT] Summary document complete
  • 研究基于团队的认证模式
  • 调研Slack、Linear的实现方式
  • [检查点] 完成总结文档

Phase 2: Architecture Proposal

阶段2: 架构提案

2.1 - Draft Architecture

2.1 - 起草架构

  • Create architecture diagram
  • Document token strategy
  • Define permission model
  • 创建架构图
  • 记录令牌策略
  • 定义权限模型

2.2 - Review

2.2 - 评审

  • Self-critique against requirements
  • [CHECKPOINT] Architecture doc complete
  • 根据需求进行自我评审
  • [检查点] 完成架构文档

Done When

完成标准

  • Auth library recommendation documented
  • Architecture proposal in ideas/coordinatr/docs/
  • Trade-offs and risks identified
undefined
  • 记录认证库推荐方案
  • 在ideas/coordinatr/docs/中提交架构提案
  • 识别权衡点和风险
undefined

Second Opinion Feature

同行评审功能

What: Optional peer review from Gemini CLI before finalizing plans.
Usage: Pass
--second-opinion
flag to trigger Gemini review with Context7 validation.
Process:
  1. Send plan to Gemini CLI for review
  2. Validate each recommendation against Context7 docs
  3. Claude makes final decision on each:
    • ACCEPT: Recommendation validated AND improves plan
    • ⚠️ MODIFY: Good idea but needs adjustment
    • REJECT: Invalid or not applicable
  4. Document all decisions in "Second Opinion Analysis" section
Requirements:
  • Gemini CLI installed and functional
  • --second-opinion
    flag explicitly passed
Graceful degradation: If Gemini unavailable, proceeds with Claude-only plan.
功能说明: 在最终确定计划前,可选择通过Gemini CLI获取同行评审意见。
使用方式: 传递
--second-opinion
标志触发Gemini评审及Context7验证。
流程:
  1. 将计划发送给Gemini CLI进行评审
  2. 根据Context7文档验证每个建议
  3. Claude对每个建议做出最终决策:
    • 接受: 建议已验证且能优化计划
    • ⚠️ 修改: 想法可行但需要调整
    • 拒绝: 无效或不适用
  4. 在“同行评审分析”章节记录所有决策
要求:
  • Gemini CLI已安装并可正常使用
  • 显式传递
    --second-opinion
    标志
降级处理: 若Gemini不可用,则仅使用Claude生成计划。

Workflow

工作流

/spec → /issue → /plan {ID} → (work phases) → /complete {ID}
          Load spec section from implements: field
Creates:
  • Task/Bug:
    ideas/{project}/issues/###-*/PLAN.md
  • Spike:
    ideas/{project}/issues/###-*/PLAN-1.md
    ,
    PLAN-2.md
    , etc.
/spec → /issue → /plan {ID} → (工作阶段) → /complete {ID}
          从implements:字段加载规范章节
生成的文件:
  • 任务/Bug:
    ideas/{project}/issues/###-*/PLAN.md
  • 研究任务:
    ideas/{project}/issues/###-*/PLAN-1.md
    ,
    PLAN-2.md