plan-feature

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Feature Planning Workflow

功能规划工作流

Take a feature idea from concept to an approved implementation plan with lean scope, council consensus, and a documented decision record. This skill challenges assumptions, asks hard questions, and pushes back at every stage — before councils review, after councils vote, and before final approval. The goal is to arrive at the strongest possible plan, not to rubber-stamp the first idea.
[!CAUTION] Scope boundary: This skill produces a plan, a decision record, GitHub issue(s), and integrates them into the Product Roadmap project with correct phase assignments. It does NOT write application code, create components, modify database schemas, run tests, create branches for implementation, or perform any build work. If the user asks to start building after the plan is approved, direct them to run
/build-feature <issue-number>
— do not begin implementation yourself.
将功能想法从概念阶段推进至范围精简、经委员会共识通过且有书面决策记录的获批实施计划。本技能会在每个阶段质疑假设、提出尖锐问题并提出异议——包括委员会评审前、委员会投票后以及最终获批前。目标是制定出最完善的计划,而非草率通过第一个想法。
[!CAUTION] 范围边界: 本技能会生成计划、决策记录、GitHub议题,并将它们整合到产品路线图项目中,分配正确的阶段。它不会编写应用代码、创建组件、修改数据库架构、运行测试、创建用于实施的分支,或执行任何构建工作。如果用户在计划获批后要求开始构建,请引导他们运行
/build-feature <issue-number>
——不要自行开始实施。

Step 1: Gather Feature Context

步骤1:收集功能上下文

Ask the user to describe:
  • What the feature does (user-facing behavior)
  • Who it is for (target users)
  • Why it matters (business or product value)
  • Constraints (time, technical, budget, dependencies)
If the user provides a GitHub issue number, fetch the issue details:
bash
gh issue view <number> --json title,body,labels,state,number
Track the source issue number — if planning was initiated from a GitHub issue, store the issue number for later updates in Steps 3, 5, and 7.
请用户描述:
  • 功能内容(面向用户的行为)
  • 目标用户(该功能为谁设计)
  • 重要性(业务或产品价值)
  • 约束条件(时间、技术、预算、依赖项)
如果用户提供了GitHub议题编号,获取议题详情:
bash
gh issue view <number> --json title,body,labels,state,number
跟踪源议题编号——如果规划是从GitHub议题发起的,请在步骤3、5、7中保存该议题编号以便后续更新。

Already-Planned Check

已规划检查

If the issue has the
build-ready
label, it has already been through
/plan-feature
and was deemed sufficiently planned. Warn the user before proceeding:
[!WARNING] Issue #<number> already has the
build-ready
label, which means
/plan-feature
has been run on it before. Re-running will create a new decision record and may create duplicate implementation issues.
Ask the user whether to:
  • (a) Continue anyway (re-plan from scratch, e.g., if requirements changed significantly)
  • (b) Stop and use the existing plan (run
    /build-feature <number>
    instead)
Do not proceed past Step 1 without the user's explicit choice.
如果议题带有
build-ready
标签,说明它已经过
/plan-feature
流程,且被认为规划充分。在继续之前警告用户:
[!WARNING] 议题#<number>已带有
build-ready
标签,这意味着之前已对其运行过
/plan-feature
。重新运行将创建新的决策记录,并可能产生重复的实施议题。
询问用户选择:
  • (a) 仍继续(从头重新规划,例如需求发生重大变化时)
  • (b) 停止并使用现有计划(改为运行
    /build-feature <number>
在未得到用户明确选择前,不要推进到步骤1之后的环节。

Small-Scope Triage

小范围分类

After gathering context, assess whether the issue actually needs the full council workflow. Not every issue warrants a Product Council, Feature Council, decision record, and implementation issue. If all of the following are true, the issue is likely too small:
  • XS or S estimated size (1-2 days of work)
  • Touches 3 or fewer files with no architectural decisions
  • No frontend changes (or trivial frontend changes)
  • No database schema changes
  • No new API endpoints (modifications to existing startup/config code are fine)
  • Clear, unambiguous implementation — there is essentially one right way to do it
If the issue meets these criteria, recommend the small-scope bypass to the user:
[!TIP] This issue looks small enough to skip the full
/plan-feature
council workflow. The scope is clear, the implementation is straightforward, and running two councils plus a decision record would add more overhead than value.
Recommended action: Add the
build-ready
label directly and run
/build-feature <number>
or
/build-api <number>
to implement.
Ask the user whether to:
  • (a) Apply
    build-ready
    and stop (they'll run
    /build-feature
    or
    /build-api
    separately)
  • (b) Continue with the full
    /plan-feature
    workflow anyway (e.g., if they want council input for precedent or policy reasons)
If the user chooses (a):
  1. Add the
    build-ready
    label to the issue
  2. Add a brief implementation context comment documenting any decisions made during triage (e.g., which approach to use, accepted values, files to modify)
  3. Stop — do not proceed to Step 2 or beyond
If the user provides a brief description, that's sufficient — but do NOT simply accept it at face value. Proceed to Step 2.
收集上下文后,评估该议题是否真的需要完整的委员会工作流。并非所有议题都需要Product Council、Feature Council、决策记录和实施议题。如果全部满足以下条件,该议题可能范围过小:
  • 预估规模为XS或S(1-2天工作量)
  • 涉及3个或更少文件,且无架构决策
  • 无前端变更(或仅为微小前端变更)
  • 无数据库架构变更
  • 无新API端点(允许修改现有启动/配置代码)
  • 实施清晰明确——本质上只有一种正确的实现方式
如果议题符合这些标准,建议用户绕过完整工作流:
[!TIP] 该议题范围看起来足够小,可以跳过完整的
/plan-feature
委员会工作流。其范围清晰、实施简单,运行两个委员会并生成决策记录带来的开销将超过价值。
建议操作: 直接添加
build-ready
标签,然后运行
/build-feature <number>
/build-api <number>
进行实施。
询问用户选择:
  • (a) 应用
    build-ready
    标签并停止(他们将单独运行
    /build-feature
    /build-api
  • (b) 仍继续完整的
    /plan-feature
    工作流(例如,他们希望委员会提供参考意见或出于政策原因)
如果用户选择**(a)**:
  1. 为议题添加
    build-ready
    标签
  2. 添加简短的实施上下文评论,记录分类过程中做出的任何决策(例如,使用哪种方法、接受的值、要修改的文件)
  3. 停止——不要推进到步骤2或后续环节
如果用户提供了简短描述,这已足够——但不要仅凭表面内容就接受。推进到步骤2。

Step 2: Critical Analysis & Challenge

步骤2:批判性分析与质疑

Before sending the feature to council, act as a skeptical advisor. Your job is to stress-test the idea and help the user arrive at the strongest possible version of their feature.
在将功能提交委员会之前,扮演持怀疑态度的顾问角色。你的职责是对该想法进行压力测试,帮助用户完善出最优质的功能版本。

Challenge Assumptions

质疑假设

Identify and question the implicit assumptions in the feature request:
  • Problem validity: Is this solving the right problem? Could the user's stated problem be a symptom of a deeper issue?
  • Solution fit: Is this the best solution, or is the user anchored on the first idea that came to mind? Present 1-2 alternative approaches if viable.
  • Scope creep risk: Is the user asking for more than they need? What's the smallest thing that would validate the core hypothesis?
  • Timing: Is this the right thing to build now, given the current state of the project? Are there prerequisites or dependencies that should come first?
识别并质疑功能请求中的隐含假设:
  • 问题有效性: 这是否解决了真实的用户问题?是否符合市场需求?
  • 解决方案适配性: 这是最佳解决方案吗?还是用户局限于想到的第一个想法?如果可行,提出1-2种替代方案。
  • 范围蔓延风险: 用户的要求是否超出实际需求?验证核心假设的最小功能是什么?
  • 时机: 结合项目当前状态,现在是构建该功能的合适时机吗?是否有应优先处理的先决条件或依赖项?

Ask Clarifying Questions

提出澄清问题

Ask 2-4 pointed questions that expose gaps or weak spots in the proposal. Examples:
  • "What happens if [edge case]? Have you considered...?"
  • "You mentioned X — but how does that interact with the existing Y?"
  • "What's the user's current workaround? How painful is it really?"
  • "What would you cut if this had to ship in half the time?"
提出2-4个尖锐问题,暴露提案中的漏洞或薄弱环节。例如:
  • "如果出现[边缘情况]会怎样?你是否考虑过...?"
  • "你提到了X——但它如何与现有Y交互?"
  • "用户当前的解决方法是什么?这真的很麻烦吗?"
  • "如果必须在一半时间内交付,你会削减哪些内容?"

Make Recommendations

提出建议

Based on your analysis, present:
  • What's strong about the proposal (validate what works)
  • What concerns you (risks, blind spots, over-engineering)
  • What you'd change (concrete suggestions, not vague warnings)
  • Alternative framing (if the problem could be solved differently)
基于你的分析,呈现:
  • 提案的优势(验证可行的部分)
  • 你的担忧(风险、盲点、过度设计)
  • 你建议的修改(具体建议,而非模糊警告)
  • 替代框架(如果问题可以通过不同方式解决)

CHECKPOINT: Present your critical analysis and questions to the user. Wait for their responses and any scope adjustments before proceeding to the Product Council. Do NOT rubber-stamp — if the answers don't satisfy your concerns, push back again.

检查点:向用户呈现你的批判性分析和问题。在推进到Product Council之前,等待他们的回复和任何范围调整。不要草率通过——如果答案不能解决你的担忧,再次提出异议。

Step 3: Activate the Product Council

步骤3:启动Product Council

Read the Product Council template from
.claude/councils/product-council.md
and evaluate the feature from all 6 member perspectives.
Model Selection: See the Model Selection section in README.md for mapping agent model specs to Task tool parameters.
读取
.claude/councils/product-council.md
中的Product Council模板,从所有6位成员的角度评估该功能。
模型选择: 请参阅README.md中的模型选择部分,了解代理模型规格与Task工具参数的映射关系。

Product Strategist (Lead)

产品策略师(负责人)

  • User Value: Does this solve a real user problem? Market fit?
  • Priority: Is this the right thing to build now?
  • Recommendations: Strategic considerations, positioning
  • 用户价值: 这是否解决了真实的用户问题?是否符合市场需求?
  • 优先级: 现在是构建该功能的合适时机吗?
  • 建议: 战略考量、定位

Lean Delivery Lead

精益交付负责人

  • Lean Scope: What is the smallest version we can ship to get feedback?
  • Speed to Feedback: How quickly can we get this in front of users?
  • Feature Flag Strategy: Should this be prototyped behind a feature flag?
  • Recommendations: How to ship faster and learn faster
  • 精益范围: 我们可以交付的最小版本是什么,以获取反馈?
  • 反馈速度: 我们能多快将其推向用户?
  • 功能标志策略: 是否应在功能标志后进行原型开发?
  • 建议: 如何更快交付并更快学习

Design Lead — consult: ui-design

设计负责人 — 咨询: ui-design

  • Design Quality: Brand consistency? UX intuitiveness?
  • Accessibility: WCAG compliance requirements?
  • Recommendations: Design approach, component needs
  • 设计质量: 品牌一致性?UX直观性?
  • 可访问性: WCAG合规要求?
  • 建议: 设计方法、组件需求

Business Operations Lead

业务运营负责人

  • Cost Analysis: Budget required? Infrastructure costs?
  • ROI Potential: Expected return on investment?
  • Recommendations: Cost optimizations or budget concerns
  • 成本分析: 所需预算?基础设施成本?
  • ROI潜力: 预期投资回报率?
  • 建议: 成本优化或预算担忧

Principal Engineer — consult: full-stack-orchestration

首席工程师 — 咨询: full-stack-orchestration

  • Technical Feasibility: Can we build this? Complexity level?
  • Architectural Fit: Does this align with the current tech stack?
  • Recommendations: Technical constraints or alternative approaches
  • 技术可行性: 我们能否构建该功能?复杂程度如何?
  • 架构适配性: 它是否与当前技术栈一致?
  • 建议: 技术约束或替代方案

Frontend Specialist — consult: frontend-mobile-development

前端专家 — 咨询: frontend-mobile-development

  • Implementation Assessment: UX feasibility? Component complexity?
  • User Experience: Implementation challenges?
  • Recommendations: Frontend implementation approach
Present the full Product Council evaluation with all votes and recommendations.
  • 实施评估: UX可行性?组件复杂度?
  • 用户体验: 实施挑战?
  • 建议: 前端实施方法
呈现完整的Product Council评估结果,包括所有投票和建议。

Post-Council Synthesis

委员会后综合分析

After the council votes, do not simply pass their results through. Add your own analysis:
  • Where do you agree with the council? Reinforce the strongest points.
  • Where do you disagree? If a council member's assessment seems off, say so and explain why.
  • What did the council miss? Identify blind spots — topics no member raised that matter.
  • Groupthink check: If all members agree, play devil's advocate. What's the strongest argument against this feature?
  • Refined recommendation: Based on both the council input and your own critical analysis from Step 2, give your honest recommendation — build as proposed, modify scope, defer, or reconsider entirely.
委员会投票后,不要简单传递结果。添加你自己的分析:
  • 你同意委员会的哪些观点? 强化最有力的论点。
  • 你不同意哪些观点? 如果某位委员会成员的评估似乎有误,请指出并解释原因。
  • 委员会遗漏了什么? 识别盲点——没有成员提出但重要的议题。
  • 群体思维检查: 如果所有成员都同意,扮演唱反调的角色。反对该功能的最有力论据是什么?
  • 优化后的建议: 结合委员会意见和你在步骤2中的批判性分析,给出你的诚实建议——按提案构建、调整范围、推迟或重新考虑。

CHECKPOINT: Present the Product Council results AND your synthesis to the user. If you have concerns the council didn't surface, raise them now. Wait for approval of scope and priority before proceeding to technical planning.

检查点:向用户呈现Product Council结果以及你的综合分析。如果你有委员会未提出的担忧,现在提出。在推进到技术规划之前,等待范围和优先级的批准。

Step 4: Define Lean Scope

步骤4:定义精益范围

Based on Product Council feedback, clearly define:
  • MVP Scope: What ships in the first increment (1-2 weeks max). List specific user-facing capabilities.
  • Future Iterations: What comes after MVP validation. List deferred capabilities.
  • Feature Flag Strategy: Whether this should ship behind a flag, and the flag name.
  • Success Metrics: How will we know this feature works? Define 2-3 measurable outcomes.
基于Product Council的反馈,明确定义:
  • MVP范围: 第一个增量版本交付的内容(最多1-2周)。列出具体的面向用户的功能。
  • 未来迭代: MVP验证后交付的内容。列出推迟的功能。
  • 功能标志策略: 是否应在标志后交付,以及标志名称。
  • 成功指标: 我们如何知道该功能有效?定义2-3个可衡量的结果。

Step 5: Activate the Feature Council

步骤5:启动Feature Council

Read the Feature Council template from
.claude/councils/feature-council.md
and create the technical implementation plan.
Model Selection: See the Model Selection section in README.md for mapping agent model specs to Task tool parameters.
读取
.claude/councils/feature-council.md
中的Feature Council模板,创建技术实施计划。
模型选择: 请参阅README.md中的模型选择部分,了解代理模型规格与Task工具参数的映射关系。

Principal Engineer (Lead) — consult: full-stack-orchestration

首席工程师(负责人) — 咨询: full-stack-orchestration

  • Architecture Fit: Does this align with system design?
  • Complexity Assessment: Is this appropriately scoped?
  • Recommendations: Architectural considerations, patterns to follow
  • 架构适配性: 它是否与系统设计一致?
  • 复杂度评估: 范围是否合适?
  • 建议: 架构考量、应遵循的模式

Frontend Specialist — consult: frontend-mobile-development

前端专家 — 咨询: frontend-mobile-development

  • UI/UX Approach: Component structure, user interaction flow
  • Design Integration: Tailwind/shadcn components needed? New or existing?
  • Recommendations: Frontend implementation strategy
  • UI/UX方法: 组件结构、用户交互流程
  • 设计集成: 是否需要Tailwind/shadcn组件?新组件还是现有组件?
  • 建议: 前端实施策略

Backend Specialist — consult: backend-development

后端专家 — 咨询: backend-development

  • API Design: Endpoints, contracts, data flow
  • Database Changes: Schema modifications needed?
  • Recommendations: Backend implementation strategy
If the feature involves API work, invoke
/backend-development:api-design-principles
for detailed API design guidance.
  • API设计: 端点、契约、数据流
  • 数据库变更: 是否需要架构修改?
  • 建议: 后端实施策略
如果功能涉及API工作,调用
/backend-development:api-design-principles
获取详细的API设计指导。

QA Lead

QA负责人

  • Testing Strategy: Unit, integration, E2E approach
  • Edge Cases: Scenarios to test, boundary conditions
  • Recommendations: Quality gates and acceptance criteria
  • 测试策略: 单元测试、集成测试、E2E测试方法
  • 边缘情况: 要测试的场景、边界条件
  • 建议: 质量门和验收标准

Implementation Plan

实施计划

Based on council input, produce a structured task breakdown:
Frontend Tasks: Component development, routing, state management, styling Backend Tasks: API endpoints, services, business logic, validation Database Tasks: Schema changes, migrations, seed data Testing Tasks: Test creation, coverage goals, E2E scenarios Estimated Complexity: Small / Medium / Large
Size and Schedule Estimates: For each task/issue that will be created, the council must provide:
  • Size: XS (1 day), S (2 days), M (3 days), L (5 days), or XL (8 days) in business days
  • Dependencies: Which other issues must complete before this one can start
  • Milestone: Which phase (M1-M5) the issue belongs to
  • Schedule position: Where in the milestone's serial queue this issue falls, considering dependencies and existing scheduled items
基于委员会意见,生成结构化的任务分解:
前端任务: 组件开发、路由、状态管理、样式 后端任务: API端点、服务、业务逻辑、验证 数据库任务: 架构变更、迁移、种子数据 测试任务: 测试创建、覆盖率目标、E2E场景 预估复杂度: 小 / 中 / 大
规模和进度预估: 对于每个将创建的任务/议题,委员会必须提供:
  • 规模: XS(1天)、S(2天)、M(3天)、L(5天)或XL(8天)(工作日)
  • 依赖项: 哪些其他议题必须完成后,本议题才能开始
  • 里程碑: 议题属于哪个阶段(M1-M5)
  • 进度位置: 在里程碑的串行队列中的位置,考虑依赖项和已排定的现有任务

Post-Council Synthesis

委员会后综合分析

After the Feature Council votes, add your own technical analysis:
  • Implementation risks: What's the hardest part of this plan? Where are teams most likely to get stuck or underestimate effort?
  • Sequencing concerns: Is the task breakdown in the right order? Are there hidden dependencies between frontend and backend work?
  • Over-engineering check: Is the council proposing more infrastructure than this feature needs? Could we do less and still validate the hypothesis?
  • Under-engineering check: Is anything missing that will bite us later — error handling, migration rollback, accessibility, performance?
  • Honest assessment: Given everything discussed, rate your confidence that this plan will succeed as written (High / Medium / Low) and explain why.
Feature Council投票后,添加你自己的技术分析:
  • 实施风险: 该计划中最难的部分是什么?团队最可能在哪里遇到困难或低估工作量?
  • 顺序问题: 任务分解的顺序是否正确?前端和后端工作之间是否存在隐藏依赖?
  • 过度设计检查: 委员会提议的基础设施是否超出该功能的需求?我们能否用更少的投入仍验证假设?
  • 设计不足检查: 是否遗漏了日后会带来问题的内容——错误处理、迁移回滚、可访问性、性能?
  • 诚实评估: 结合所有讨论内容,评估你对该计划按书面内容成功实施的信心(高/中/低)并解释原因。

CHECKPOINT: Present the Feature Council implementation plan AND your technical synthesis to the user. Flag any concerns about sequencing, risk, or scope. Wait for approval of the task breakdown before proceeding.

检查点:向用户呈现Feature Council实施计划以及你的技术综合分析。标记任何关于顺序、风险或范围的担忧。在推进之前,等待任务分解的批准。

Step 6: Generate Decision Record

步骤6:生成决策记录

Determine the next decision number by reading existing files in
docs/decisions/
.
Using the template from
docs/decisions/001-example-architecture-decision.md
, create a decision record that includes:
  • Date: Today's date
  • Council: Product Council + Feature Council
  • Status: Approved (after user approval)
  • Question: The feature being evaluated
  • Context: Current situation, requirements, constraints
  • Council Votes: All votes from both Product and Feature councils
  • Decision: Approved scope (MVP + future)
  • Rationale Summary: Synthesized perspectives from all council members
  • Action Items: Task breakdown with clear owners (frontend, backend, testing)
  • Timeline: Target dates based on complexity
  • Follow-up: When to revisit, what to validate post-launch
  • References: Related issues, documentation, prior decisions
通过读取
docs/decisions/
中的现有文件,确定下一个决策编号。
使用
docs/decisions/001-example-architecture-decision.md
中的模板,创建包含以下内容的决策记录:
  • 日期: 今日日期
  • 委员会: Product Council + Feature Council
  • 状态: 已批准(用户批准后)
  • 问题: 正在评估的功能
  • 上下文: 当前情况、需求、约束条件
  • 委员会投票: Product和Feature委员会的所有投票
  • 决策: 获批范围(MVP + 未来迭代)
  • 理由摘要: 所有委员会成员观点的综合
  • 行动项: 明确负责人的任务分解(前端、后端、测试)
  • 时间线: 基于复杂度的目标日期
  • 跟进: 何时重新审视、发布后验证内容
  • 参考: 相关议题、文档、先前决策

GFM Formatting Requirements

GFM格式要求

Decision records render in GitHub Flavored Markdown. Follow the GFM rules in
.claude/CLAUDE.md
:
  • Metadata blocks must use bullet points (
    - **Key**: value
    ), never consecutive bold lines.
  • Use GitHub alerts (
    > [!NOTE]
    ,
    > [!TIP]
    ,
    > [!IMPORTANT]
    ,
    > [!WARNING]
    ,
    > [!CAUTION]
    ) for callouts instead of bold/italic emphasis.
  • Include a mermaid diagram when the decision involves multiple components, services, or data flows. Place it in the Context or Rationale Summary section to visualize the architecture.
  • Use collapsible
    <details>
    sections
    for lengthy council evaluations if the record would otherwise exceed ~150 lines of votes.
  • Use tables for structured comparisons (e.g., options considered with trade-offs).
Invoke
/documentation-generation:architecture-decision-records
for ADR formatting guidance if the decision involves architectural choices.
决策记录采用GitHub Flavored Markdown渲染。遵循
.claude/CLAUDE.md
中的GFM规则:
  • 元数据块必须使用项目符号(
    - **Key**: value
    ),绝不能使用连续的粗体行。
  • 使用GitHub提醒
    > [!NOTE]
    ,
    > [!TIP]
    ,
    > [!IMPORTANT]
    ,
    > [!WARNING]
    ,
    > [!CAUTION]
    )进行标注,而非粗体/斜体强调。
  • 当决策涉及多个组件、服务或数据流时,包含mermaid图表。将其放在上下文或理由摘要部分,以可视化架构。
  • 如果投票内容超过约150行,使用可折叠的
    <details>
    部分
    显示完整的委员会评估内容。
  • 使用表格进行结构化比较(例如,列出考虑的选项及其权衡)。
如果决策涉及架构选择,调用
/documentation-generation:architecture-decision-records
获取ADR格式指导。

CHECKPOINT: Present the decision record to the user for final review before saving.

检查点:在保存前,向用户呈现决策记录以供最终审核。

Step 7: Create Branch and Save Artifacts

步骤7:创建分支并保存工件

  1. Create a feature branch from the latest
    origin/main
    following CONTRIBUTING.md conventions:
    bash
    git fetch origin main
    git checkout -b feature/<feature-slug> origin/main
  2. Save the decision record:
    docs/decisions/NNN-<feature-slug>.md
  3. Update the decisions index:
    Regenerate the Decisions table in
    docs/decisions/INDEX.md
    by scanning all decision files in the directory. For each file (excluding
    INDEX.md
    and
    001-example-architecture-decision.md
    ):
    • Read the heading to extract the decision number and title
    • Read the metadata block to extract Date, Council, Status
    • Derive 2-5 Key Topics (lowercase, comma-separated) from the decision's Question and Context sections
    Rebuild the full table in reverse chronological order (newest first). Do not modify any other section of INDEX.md (the intro, How to Use, or Related Resources sections remain static).
  4. Update the master documentation index:
    If any new documents were created in
    docs/
    (including the decision record), verify that
    docs/INDEX.md
    reflects them. Decision records are covered by the
    decisions/INDEX.md
    entry already present, so no per-decision update is needed. However, if a new documentation file was added to
    docs/
    outside of
    decisions/
    (e.g., a new science document), add a row to the appropriate table in
    docs/INDEX.md
    .
  5. Commit with:
    docs(council): document feature plan for <feature-name>
  6. Run Prettier on all new/modified files before pushing:
    bash
    pnpm exec prettier --write <files>
    Stage and commit any formatting fixes separately:
    style: fix Prettier formatting in decision record and skill
  7. Push the branch and create a PR for the decision record:
    bash
    git push -u origin feature/<feature-slug>
    
    gh pr create \
      --title "docs(council): add Decision NNN — <feature-name>" \
      --body "## Summary\n\n- Adds Decision NNN documenting the council-approved plan for <feature-name>\n- Product Council (<tally>) and Feature Council (<tally>) both approved\n- Implementation issues: #N, #N, ...\n\n## Test plan\n\n- [ ] Decision record renders correctly in GitHub markdown\n- [ ] Mermaid diagrams render (if any)\n- [ ] All cross-references to existing issues and docs are valid links\n\n🤖 Generated with [Claude Code](https://claude.com/claude-code)"
  8. Watch CI until all checks pass:
    bash
    gh pr checks <pr-number> --watch
    If checks fail, read the failure logs, fix the issue, commit, push, and re-watch. Do not proceed to issue creation until CI is green.
    [!IMPORTANT] Every
    /plan-feature
    run that produces a decision record must submit a PR to get the record merged to main. The PR must pass CI before the planning step is considered complete. The decision record branch is also the feature branch that
    /build-feature
    will use for implementation.
  1. 按照CONTRIBUTING.md约定,从最新的
    origin/main
    创建功能分支:
    bash
    git fetch origin main
    git checkout -b feature/<feature-slug> origin/main
  2. 保存决策记录:
    docs/decisions/NNN-<feature-slug>.md
  3. 更新决策索引:
    扫描目录中的所有决策文件,重新生成
    docs/decisions/INDEX.md
    中的Decisions表格。对于每个文件(不包括
    INDEX.md
    001-example-architecture-decision.md
    ):
    • 读取标题以提取决策编号和标题
    • 读取元数据块以提取日期、委员会、状态
    • 从决策的问题和上下文部分衍生2-5个关键主题(小写,逗号分隔)
    按倒序时间顺序(最新在前)重建完整表格。不要修改INDEX.md的任何其他部分(简介、使用方法或相关资源部分保持不变)。
  4. 更新主文档索引:
    如果
    docs/
    中创建了任何新文档(包括决策记录),验证
    docs/INDEX.md
    是否已更新。决策记录已由
    decisions/INDEX.md
    中的条目覆盖,因此无需为每个决策单独更新。但是,如果在
    decisions/
    之外的
    docs/
    中添加了新文档(例如,新的技术文档),请在
    docs/INDEX.md
    的相应表格中添加一行。
  5. 提交信息:
    docs(council): document feature plan for <feature-name>
  6. 在推送前,对所有新/修改的文件运行Prettier:
    bash
    pnpm exec prettier --write <files>
    单独暂存并提交任何格式修复:
    style: fix Prettier formatting in decision record and skill
  7. 推送分支并为决策记录创建PR:
    bash
    git push -u origin feature/<feature-slug>
    
    gh pr create \
      --title "docs(council): add Decision NNN — <feature-name>" \
      --body "## Summary\n\n- Adds Decision NNN documenting the council-approved plan for <feature-name>\n- Product Council (<tally>) and Feature Council (<tally>) both approved\n- Implementation issues: #N, #N, ...\n\n## Test plan\n\n- [ ] Decision record renders correctly in GitHub markdown\n- [ ] Mermaid diagrams render (if any)\n- [ ] All cross-references to existing issues and docs are valid links\n\n🤖 Generated with [Claude Code](https://claude.com/claude-code)"
  8. 等待CI检查完成:
    bash
    gh pr checks <pr-number> --watch
    如果检查失败,读取失败日志,修复问题,提交、推送并重新等待。在CI通过前,不要推进到议题创建环节。
    [!IMPORTANT] 每次生成决策记录的
    /plan-feature
    运行都必须提交PR,以将记录合并到main分支。PR必须通过CI,规划步骤才算完成。决策记录分支也是
    /build-feature
    将用于实施的功能分支。

Update Source GitHub Issue

更新源GitHub议题

If planning was initiated from a GitHub issue (tracked in Step 1), update the source issue with the council findings. This keeps the issue as a living document that reflects the planning outcome.
Add a comment to the source issue summarizing the council results:
bash
gh issue comment <number> --body "$(cat <<'EOF'
如果规划是从GitHub议题发起的(步骤1中已跟踪),使用委员会结果更新源议题。这使议题成为反映规划结果的动态文档。
在源议题中添加评论,总结委员会结果:
bash
gh issue comment <number> --body "$(cat <<'EOF'

Council Planning Complete

委员会规划完成

Product Council — <Vote tally> (Approve-Concern-Block)

Product Council — <投票结果> (批准-关注-阻止)

<2-3 sentence summary of key Product Council decisions>
<2-3句话总结Product Council的关键决策>

Feature Council — <Vote tally> (Approve-Concern-Block)

Feature Council — <投票结果> (批准-关注-阻止)

<2-3 sentence summary of key technical decisions>
<2-3句话总结关键技术决策>

Key Decisions

关键决策

  • <Decision 1>
  • <Decision 2>
  • <Decision 3>
  • <决策1>
  • <决策2>
  • <决策3>

Artifacts

工件

  • Decision Record: Decision NNN (link becomes active after the planning PR merges to main)
  • Feature Branch:
    feature/<slug>
  • Implementation Issue: #<new-issue-number> (created in Step 9)
Planning completed via
/plan-feature
. EOF )"

Add the `build-ready` label to the source issue (it has now been fully planned):

```bash
gh label list | grep -q "build-ready" || gh label create "build-ready" --description "Planned by /plan-feature and ready for /build-feature" --color "0E8A16"
gh issue edit <number> --add-label "build-ready"
  • 决策记录: 决策NNN (规划PR合并到main后链接将生效)
  • 功能分支:
    feature/<slug>
  • 实施议题: #<新议题编号> (步骤9中创建)
通过
/plan-feature
完成规划。 EOF )"

为源议题添加`build-ready`标签(现在已完全规划):

```bash
gh label list | grep -q "build-ready" || gh label create "build-ready" --description "Planned by /plan-feature and ready for /build-feature" --color "0E8A16"
gh issue edit <number> --add-label "build-ready"

Ensure Source Issue is on Project Board

确保源议题已添加到项目看板

After labeling the source issue, verify it is tracked on the Product Roadmap project board. An issue with
build-ready
that is not on the board becomes an orphaned work item that
/build-feature
auto-pick cannot discover.
bash
undefined
添加标签后,验证源议题已跟踪到产品路线图项目看板。带有
build-ready
标签但未添加到看板的议题将成为孤立工作项,
/build-feature
自动选取功能无法发现。
bash
undefined

Check if the issue is already on the project board

检查议题是否已在项目看板上

--limit 200 covers the current board size; increase if the project grows beyond 200 items

--limit 200覆盖当前看板规模;如果项目超过200项,可增加该值

EXISTING=$(gh project item-list {PROJECT_NUMBER} --owner {OWNER} --format json --limit 200
| python3 -c " import json, sys data = json.load(sys.stdin) for item in data.get('items', []): # <number> must be an integer literal, e.g., == 42, not == '42' if item.get('content', {}).get('number') == <number>: print(item['id']) break ")
EXISTING=$(gh project item-list {PROJECT_NUMBER} --owner {OWNER} --format json --limit 200
| python3 -c " import json, sys data = json.load(sys.stdin) for item in data.get('items', []): # <number>必须为整数字面量,例如== 42,而非== '42' if item.get('content', {}).get('number') == <number>: print(item['id']) break ")

If not on the board, add it and set fields

如果不在看板上,添加并设置字段

if [ -z "$EXISTING" ]; then ITEM_ID=$(gh project item-add {PROJECT_NUMBER} --owner {OWNER} --url "https://github.com/{OWNER}/{REPO}/issues/<number>" --format json | python3 -c "import json,sys; print(json.load(sys.stdin)['id'])")

Set phase and milestone fields to match the implementation issues that will be created in the Issue Creation step

gh project item-edit --project-id {PROJECT_ID} --id "$ITEM_ID" --field-id {PHASE_FIELD_ID} --single-select-option-id <phase-option-id> echo "Added issue #<number> to the project board and set phase." fi

> [!NOTE]
> The source issue retains its original content as context. The comment provides a clear audit trail of what the councils decided and links to the detailed decision record. After the implementation issue is created in the Issue Creation step (Step 9), come back and edit this comment to include the implementation issue number.
if [ -z "$EXISTING" ]; then ITEM_ID=$(gh project item-add {PROJECT_NUMBER} --owner {OWNER} --url "https://github.com/{OWNER}/{REPO}/issues/<number>" --format json | python3 -c "import json,sys; print(json.load(sys.stdin)['id'])")

设置阶段和里程碑字段,与步骤9(议题创建)中将要创建的实施议题匹配

gh project item-edit --project-id {PROJECT_ID} --id "$ITEM_ID" --field-id {PHASE_FIELD_ID} --single-select-option-id <phase-option-id> echo "已将议题#<number>添加到项目看板并设置阶段。" fi

> [!NOTE]
> 源议题保留其原始内容作为上下文。评论提供了委员会决策的清晰审计跟踪,并链接到详细的决策记录。在步骤9(议题创建)中创建实施议题后,返回并编辑此评论以包含实施议题编号。

Step 8: Pre-Issue Validation

步骤8:议题前验证

Before creating GitHub issue(s), validate the planning artifacts:
  1. Decision record completeness: Verify the decision record file exists and contains all required sections (Question, Context, Council Votes, Decision, Rationale Summary, Action Items, Timeline). If any section is missing, stop and add it before proceeding.
  2. Council consensus: Scan both council vote sections for any "Block" votes. If a Block vote exists:
    [!WARNING] A council member voted to Block this feature. Creating an implementation issue with unresolved Block votes is unusual. Consider addressing the concern before proceeding.
    Ask the user whether to proceed or resolve the concern first.
  3. Task breakdown present: Verify the Action Items section contains at least one task (checkbox line). If empty, stop and ask the user to define the implementation tasks.
  4. Approval status: Verify the Decision section shows
    Status: Approved
    . If not approved, warn the user before proceeding.
  5. Duplicate issue detection: Search existing open issues for potential duplicates or substantially overlapping work:
    bash
    gh issue list --state open --limit 200 --json number,title,labels
    Compare the planned issue title(s) and scope against existing issues. If a potential duplicate is found:
    [!WARNING] Potential duplicate detected: issue #N has a similar title/scope. Review the existing issue before creating a new one.
    Present the potential duplicate(s) to the user and ask whether to:
    • (a) Update the existing issue instead (add the planning context as a comment)
    • (b) Create a new issue anyway (if scope is genuinely different — explain why)
    • (c) Adjust the plan to avoid overlap
    Do NOT create issues that substantially duplicate existing work items.
创建GitHub议题前,验证规划工件:
  1. 决策记录完整性: 验证决策记录文件存在且包含所有必填部分(问题、上下文、委员会投票、决策、理由摘要、行动项、时间线)。如果任何部分缺失,停止并补充后再推进。
  2. 委员会共识: 扫描两个委员会投票部分,查看是否有“阻止”投票。如果存在阻止投票:
    [!WARNING] 有委员会成员投票阻止该功能。在未解决阻止投票的情况下创建实施议题并不常见。考虑先解决相关问题再推进。
    询问用户是继续推进还是先解决问题。
  3. 任务分解存在: 验证行动项部分包含至少一个任务(复选框行)。如果为空,停止并要求用户定义实施任务。
  4. 批准状态: 验证决策部分显示
    状态: 已批准
    。如果未批准,在推进前警告用户。
  5. 重复议题检测: 搜索现有开放议题,查找潜在重复或大幅重叠的工作:
    bash
    gh issue list --state open --limit 200 --json number,title,labels
    将计划的议题标题和范围与现有议题进行比较。如果发现潜在重复:
    [!WARNING] 检测到潜在重复:议题#N具有相似的标题/范围。创建新议题前,请查看现有议题。
    向用户呈现潜在重复议题,并询问选择:
    • (a) 改为更新现有议题(将规划上下文作为评论添加)
    • (b) 仍创建新议题(如果范围确实不同——解释原因)
    • (c) 调整计划以避免重叠
    不要创建与现有工作项大幅重复的议题。

Step 9: Create GitHub Issue(s)

步骤9:创建GitHub议题

[!IMPORTANT] GitHub issues are actionable work items derived from the decision record — they do NOT replace it. The decision record (Step 6) remains the authoritative project-level record of council evaluations, rationale, and architectural context. Issues reference the decision record and provide a task-oriented view for
/build-feature
to consume.
Create GitHub issue(s) containing the full implementation plan so that
/build-feature
can be run from an issue at any time — immediately or days later.
[!IMPORTANT] GitHub议题是可执行的工作项,派生自决策记录——它们不能替代决策记录。决策记录(步骤6)仍然是委员会评估、理由和架构上下文的权威项目级记录。议题引用决策记录,并为
/build-feature
提供面向任务的视图。
创建包含完整实施计划的GitHub议题,以便
/build-feature
可以随时从议题运行——立即或数天后。

Ensure Label Exists

确保标签存在

bash
gh label list | grep -q "feature-implementation" || gh label create "feature-implementation" --description "Implementation plan from /plan-feature" --color "1D76DB"
gh label list | grep -q "security-audit" || gh label create "security-audit" --description "Phase security audit checkpoint" --color "D93F0B"
bash
gh label list | grep -q "feature-implementation" || gh label create "feature-implementation" --description "Implementation plan from /plan-feature" --color "1D76DB"
gh label list | grep -q "security-audit" || gh label create "security-audit" --description "Phase security audit checkpoint" --color "D93F0B"

Assemble Issue Body

组装议题正文

Build the issue body following the template at
.github/ISSUE_TEMPLATE/feature-implementation.yml
. Include these sections:
Problem Statement: From the decision record's Question and Context sections. Explain what is being solved and why.
Council Decisions: Summarize both councils:
  • Product Council vote tally and key decisions
  • Feature Council vote tally and architecture decisions
  • Any dissenting opinions or conditions
Use a collapsible
<details>
section for full council votes if they exceed ~30 lines.
Implementation Plan: The Action Items from the decision record, organized by layer (Frontend, Backend, Database, Testing) with checkboxes. This is the primary content that
/build-feature
will consume.
Success Metrics: The measurable outcomes from the lean scope definition (Step 4).
Technical Context: Key technical decisions — architecture patterns, API contracts, schema changes, component structure.
Decision Record Reference: Link to the decision record file:
[Decision NNN](docs/decisions/NNN-slug.md)
Feature Branch: The branch name created in Step 7.
Feature Flag: Flag name and strategy, if applicable.
Estimated Complexity: Small / Medium / Large from the Feature Council assessment.
按照
.github/ISSUE_TEMPLATE/feature-implementation.yml
中的模板构建议题正文。包含以下部分:
问题陈述: 来自决策记录的问题和上下文部分。解释要解决的问题及其原因。
委员会决策: 总结两个委员会的结果:
  • Product Council投票结果和关键决策
  • Feature Council投票结果和架构决策
  • 任何不同意见或条件
如果完整委员会投票超过约30行,使用可折叠的
<details>
部分显示。
实施计划: 来自决策记录的行动项,按层(前端、后端、数据库、测试)组织,带有复选框。这是
/build-feature
将使用的主要内容。
成功指标: 精益范围定义(步骤4)中的可衡量结果。
技术上下文: 关键技术决策——架构模式、API契约、架构变更、组件结构。
决策记录引用: 链接到决策记录文件:
[决策NNN](docs/decisions/NNN-slug.md)
功能分支: 步骤7中创建的分支名称。
功能标志: 标志名称和策略(如适用)。
预估复杂度: Feature Council评估的小/中/大。

Multi-Issue Option

多议题选项

If the implementation plan has multiple distinct phases, ask the user:
The implementation plan has N phases. Would you like:
  1. A single issue with all phases as task groups
  2. Separate issues per phase (cross-referenced)
If separate issues, create them in sequence with "Part X of N" and links to sibling issues. Each issue must be assigned to the correct project phase (see Phase & Project Mapping below).
When creating multiple phase issues, also create a parent issue and set up sub-issue relationships per the "Parent Issues and Sub-Issues" section in
AGENTS.md
:
  1. Create the parent issue first (high-level feature description, no implementation details)
  2. Create child issues for each phase
  3. Link children to parent via the sub-issues API:
    bash
    CHILD_ID=$(gh api repos/{OWNER}/{REPO}/issues/<child-number> --jq '.id')
    gh api repos/{OWNER}/{REPO}/issues/<parent-number>/sub_issues -X POST -F sub_issue_id=$CHILD_ID
  4. Set the parent issue's dates to span all children (earliest Start to latest Target)
  5. If children span multiple milestones: Remove the parent from any milestone (
    gh api repos/{OWNER}/{REPO}/issues/<number> -X PATCH -F milestone=null
    ) and clear its project phase field via GraphQL (
    clearProjectV2ItemFieldValue
    ). The parent is a tracking container; children carry milestone and phase assignments. If a source issue was used as the parent and already had a milestone, remove it.
如果实施计划包含多个不同阶段,询问用户:
实施计划包含N个阶段。你希望:
  1. 单个议题,所有阶段作为任务组
  2. 每个阶段单独创建议题(相互引用)
如果选择单独议题,按顺序创建并标记“第X部分,共N部分”,并链接到兄弟议题。每个议题必须分配到正确的项目阶段(请参阅下面的阶段与项目映射)。
创建多个阶段议题时,还需创建父议题,并按照
AGENTS.md
中“父议题和子议题”部分设置子议题关系:
  1. 首先创建父议题(高级功能描述,无实施细节)
  2. 为每个阶段创建子议题
  3. 通过子议题API将子议题链接到父议题:
    bash
    CHILD_ID=$(gh api repos/{OWNER}/{REPO}/issues/<child-number> --jq '.id')
    gh api repos/{OWNER}/{REPO}/issues/<parent-number>/sub_issues -X POST -F sub_issue_id=$CHILD_ID
  4. 将父议题的日期设置为覆盖所有子议题(最早开始日期到最晚目标日期)
  5. 如果子议题跨越多个里程碑: 从任何里程碑中移除父议题(
    gh api repos/{OWNER}/{REPO}/issues/<number> -X PATCH -F milestone=null
    ),并通过GraphQL清除其项目阶段字段(
    clearProjectV2ItemFieldValue
    )。父议题是跟踪容器;子议题带有里程碑和阶段分配。如果源议题被用作父议题且已带有里程碑,请移除该里程碑。

Phase & Project Mapping

阶段与项目映射

Before presenting issues for confirmation, determine the correct project phase and size for each issue:
  1. Review existing phases on the {PROJECT_BOARD_NAME}: <!-- TODO: Replace {PROJECT_BOARD_NAME} with your project board's display name -->
    bash
    gh project field-list 6 --owner {OWNER} --format json
  2. Map each issue to a phase based on the milestone breakdown in
    docs/PRODUCT.md
    and the nature of the work. Consider where the issue fits in the existing roadmap progression.
  3. Recommend new phases if the planned work doesn't fit any existing phase. New phase recommendations must include a rationale and where they sit relative to existing phases (e.g., "between M2 and M3").
在呈现议题供确认前,确定每个议题的正确项目阶段和规模:
  1. 查看现有阶段{PROJECT_BOARD_NAME}上:<!-- TODO: 将{PROJECT_BOARD_NAME}替换为你的项目看板显示名称 -->
    bash
    gh project field-list 6 --owner {OWNER} --format json
  2. 将每个议题映射到阶段基于
    docs/PRODUCT.md
    中的里程碑分解和工作性质。考虑议题在现有路线图进展中的位置。
  3. 建议新阶段如果计划的工作不适合任何现有阶段。新阶段建议必须包含理由及其相对于现有阶段的位置(例如,“在M2和M3之间”)。

CHECKPOINT: Present the full issue plan for user confirmation.

检查点:向用户呈现完整的议题计划以供确认。

Present a table summarizing all issues that will be created or modified, their project phase assignments, and any project changes:
Issues to create/update:
ActionIssueTitlePhaseSizeMilestoneStartTarget
CreateNEW
<title>
<phase>
<XS/S/M/L/XL>
<M1-M5>
YYYY-MM-DD
YYYY-MM-DD
Update#N
<title>
<phase>
<size>
<M1-M5>
YYYY-MM-DD
YYYY-MM-DD
If new phases are recommended:
New PhasePositionRationale
M_N_: <Name>
After
M_N_
Why this phase is needed
If GTM review issues or security audit issues need to be created or updated for affected phases (see GTM Review Gate and Security Audit Gate below), include them in the summary.
Wait for explicit user approval before creating any issues or modifying the project.
呈现表格,总结所有将创建或修改的议题、其项目阶段分配以及任何项目变更:
将创建/更新的议题:
操作议题标题阶段规模里程碑开始日期目标日期
创建NEW
<title>
<phase>
<XS/S/M/L/XL>
<M1-M5>
YYYY-MM-DD
YYYY-MM-DD
更新#N
<title>
<phase>
<size>
<M1-M5>
YYYY-MM-DD
YYYY-MM-DD
如果建议新阶段:
新阶段位置理由
M_N_: <Name>
M_N_
之后
为什么需要此阶段
如果受影响阶段需要创建或更新GTM评审议题或安全审计议题(请参阅下面的GTM评审门和安全审计门),将其包含在摘要中。
在创建任何议题或修改项目前,等待用户明确批准。

Issue Creation & Project Assignment

议题创建与项目分配

Ensure required labels exist:
bash
gh label list | grep -q "feature-implementation" || gh label create "feature-implementation" --description "Implementation plan from /plan-feature" --color "1D76DB"
gh label list | grep -q "build-ready" || gh label create "build-ready" --description "Planned by /plan-feature and ready for /build-feature" --color "0E8A16"
gh label list | grep -q "gtm-review" || gh label create "gtm-review" --description "Go to Market & Business Review checkpoint" --color "0E8A16"
gh label list | grep -q "security-audit" || gh label create "security-audit" --description "Phase security audit checkpoint" --color "D93F0B"
确保所需标签存在:
bash
gh label list | grep -q "feature-implementation" || gh label create "feature-implementation" --description "Implementation plan from /plan-feature" --color "1D76DB"
gh label list | grep -q "build-ready" || gh label create "build-ready" --description "Planned by /plan-feature and ready for /build-feature" --color "0E8A16"
gh label list | grep -q "gtm-review" || gh label create "gtm-review" --description "Go to Market & Business Review checkpoint" --color "0E8A16"
gh label list | grep -q "security-audit" || gh label create "security-audit" --description "Phase security audit checkpoint" --color "D93F0B"

Selective
build-ready
Labeling

选择性添加
build-ready
标签

For each issue being created, decide whether it is sufficiently planned to go straight to
/build-feature
:
  • Add
    build-ready
    if the issue has a concrete task breakdown, clear acceptance criteria, and no significant open questions. This is the common case for single-issue plans and for well-scoped child issues in multi-issue plans.
  • Do NOT add
    build-ready
    if the issue is broad, has open architectural questions, or would benefit from its own
    /plan-feature
    pass to refine scope and get council input. This is common for large child issues in multi-issue plans where only the high-level direction was established.
For each approved issue, create it and assign it to the project with the correct phase, size, milestone, and dates:
bash
undefined
对于每个将创建的议题,决定其是否规划充分,可以直接进入
/build-feature
  • **添加
    build-ready
    **如果议题有具体的任务分解、明确的验收标准且无重大未解决问题。这是单议题计划和多议题计划中范围明确的子议题的常见情况。
  • **不添加
    build-ready
    **如果议题范围宽泛、有未解决的架构问题,或受益于自身的
    /plan-feature
    流程以优化范围并获取委员会意见。这在多议题计划中的大型子议题中很常见,这些议题仅确定了高级方向。
对于每个获批议题,创建并将其分配到项目,设置正确的阶段、规模、里程碑和日期:
bash
undefined

Create the issue (add --label "build-ready" if the issue is fully planned)

创建议题(如果议题已完全规划,添加--label "build-ready")

ISSUE_URL=$(gh issue create
--title "<title>"
--body "<body>"
--label "enhancement"
--label "feature-implementation"
--milestone "<milestone-name>" | tail -1)
ISSUE_URL=$(gh issue create
--title "<title>"
--body "<body>"
--label "enhancement"
--label "feature-implementation"
--milestone "<milestone-name>" | tail -1)

Extract issue number from URL

从URL中提取议题编号

ISSUE_NUM=$(echo "$ISSUE_URL" | grep -o '[0-9]*$')
ISSUE_NUM=$(echo "$ISSUE_URL" | grep -o '[0-9]*$')

Add to project and set phase + size fields

添加到项目并设置阶段+规模字段

ITEM_ID=$(gh project item-add {PROJECT_NUMBER} --owner {OWNER} --url "$ISSUE_URL" --format json | python3 -c "import json,sys; print(json.load(sys.stdin)['id'])") gh project item-edit --project-id {PROJECT_ID} --id "$ITEM_ID" --field-id {PHASE_FIELD_ID} --single-select-option-id <phase-option-id> gh project item-edit --project-id {PROJECT_ID} --id "$ITEM_ID" --field-id {SIZE_FIELD_ID} --single-select-option-id <size-option-id>
ITEM_ID=$(gh project item-add {PROJECT_NUMBER} --owner {OWNER} --url "$ISSUE_URL" --format json | python3 -c "import json,sys; print(json.load(sys.stdin)['id'])") gh project item-edit --project-id {PROJECT_ID} --id "$ITEM_ID" --field-id {PHASE_FIELD_ID} --single-select-option-id <phase-option-id> gh project item-edit --project-id {PROJECT_ID} --id "$ITEM_ID" --field-id {SIZE_FIELD_ID} --single-select-option-id <size-option-id>

Set Start and Target dates (computed from size estimate and schedule position)

设置开始和目标日期(根据规模预估和进度位置计算)

gh project item-edit --project-id {PROJECT_ID} --id "$ITEM_ID" --field-id {START_FIELD_ID} --date <start-date> gh project item-edit --project-id {PROJECT_ID} --id "$ITEM_ID" --field-id {TARGET_FIELD_ID} --date <target-date>

> [!NOTE]
> **Project field IDs** — Refresh from `gh project field-list 6 --owner {OWNER} --format json` if the project structure changes.
>
> - **Phase field**: `{PHASE_FIELD_ID}` — Options: M0 (`5d1aaeb2`), M1 (`4cfa6c51`), M2 (`27c0efa8`), M3 (`ed327f33`), M4 (`df98aad8`), M5 (`0604582f`)
> - **Size field**: `{SIZE_FIELD_ID}` — Options: XS (`88044618`), S (`27e6800e`), M (`c4753411`), L (`cde643b6`), XL (`286a9b9c`)
> - **Milestone numbers**: M0=1, M1=2, M2=3, M3=4, M4=5, M5=6
> - **Start field**: `{START_FIELD_ID}`
> - **Target field**: `{TARGET_FIELD_ID}`
gh project item-edit --project-id {PROJECT_ID} --id "$ITEM_ID" --field-id {START_FIELD_ID} --date <start-date> gh project item-edit --project-id {PROJECT_ID} --id "$ITEM_ID" --field-id {TARGET_FIELD_ID} --date <target-date>

> [!NOTE]
> **项目字段ID**——如果项目结构变更,请从`gh project field-list 6 --owner {OWNER} --format json`刷新。
>
> - **阶段字段**: `{PHASE_FIELD_ID}` — 选项: M0 (`5d1aaeb2`), M1 (`4cfa6c51`), M2 (`27c0efa8`), M3 (`ed327f33`), M4 (`df98aad8`), M5 (`0604582f`)
> - **规模字段**: `{SIZE_FIELD_ID}` — 选项: XS (`88044618`), S (`27e6800e`), M (`c4753411`), L (`cde643b6`), XL (`286a9b9c`)
> - **里程碑编号**: M0=1, M1=2, M2=3, M3=4, M4=5, M5=6
> - **开始字段**: `{START_FIELD_ID}`
> - **目标字段**: `{TARGET_FIELD_ID}`

Schedule Date Computation

进度日期计算

When creating issues, compute Start and Target dates following the scheduling rules in
AGENTS.md
:
  1. Check the existing schedule in the target milestone:
    bash
    gh project item-list {PROJECT_NUMBER} --owner {OWNER} --format json --limit 200
    Find the latest Target date of any non-gate item in the milestone. Gate items are issues labeled
    gtm-review
    or
    security-audit
    — exclude them when determining the insertion point.
  2. Compute the new issue's dates using the size-to-days table (XS=1, S=2, M=3, L=5, XL=8 business days). The Start date is the next business day after the latest non-gate item's Target (or after the dependency's Target, whichever is later). Skip weekends.
  3. Cascade all subsequent items. After inserting the new issue, recompute the Start and Target dates of every issue that follows it in the milestone. Each subsequent issue's Start = next business day after the previous issue's Target. There must be no gaps or overlaps between consecutive issues — Start and Target dates determine the order of operations.
  4. Shift gate items forward. Every milestone must end with exactly two gate items in this fixed order: GTM review (second-to-last), then security audit (last). After all non-gate items are positioned, recompute the gate items' dates so the GTM review starts the next business day after the last non-gate item's Target, and the security audit starts the next business day after the GTM review's Target. Update both gate items' Start and Target dates on the project board.
  5. Update the milestone due date if the security audit's new Target extends it:
    bash
    gh api repos/{OWNER}/{REPO}/milestones/<number> -X PATCH -f due_on="<new-target>T00:00:00Z"
    [!IMPORTANT] No issue of any kind (feature, bug fix, chore, test, etc.) may ever be scheduled after the GTM review and security audit gate items. These two items are always the final items in every milestone, and their order (GTM → security audit) is an invariant that must be preserved on every project update.
  6. Update all affected items on the project board using the Start and Target field IDs. Only recompute the current milestone being developed. Later milestones will be adjusted when the current milestone ends.
If multiple issues were requested, create each in sequence and capture the issue numbers for cross-referencing.
Report the created issue number(s), URL(s), project phase assignment(s), milestone(s), and scheduled dates.
创建议题时,按照
AGENTS.md
中的进度规则计算开始和目标日期:
  1. 检查目标里程碑中的现有进度
    bash
    gh project item-list {PROJECT_NUMBER} --owner {OWNER} --format json --limit 200
    找到里程碑中任何非门控项的最晚目标日期。门控项是带有
    gtm-review
    security-audit
    标签的议题——确定插入点时排除这些项。
  2. 计算新议题的日期使用规模到天数的对照表(XS=1、S=2、M=3、L=5、XL=8个工作日)。开始日期是最晚非门控项目标日期后的下一个工作日(或依赖项目标日期后的下一个工作日,以较晚者为准)。跳过周末。
  3. 级联所有后续项。插入新议题后,重新计算里程碑中所有后续议题的开始和目标日期。每个后续议题的开始日期=前一个议题目标日期后的下一个工作日。连续议题之间必须无间隙或重叠——开始和目标日期决定操作顺序。
  4. 向前移动门控项。每个里程碑必须始终以两个固定顺序的门控项结束:GTM评审(倒数第二个),然后是安全审计(最后一个)。所有非门控项定位后,重新计算门控项的日期,使GTM评审在最后一个非门控项目标日期后的下一个工作日开始,安全审计在GTM评审目标日期后的下一个工作日开始。更新项目看板上两个门控项的开始和目标日期。
  5. 如果安全审计的新目标日期延长了里程碑截止日期,更新里程碑截止日期
    bash
    gh api repos/{OWNER}/{REPO}/milestones/<number> -X PATCH -f due_on="<new-target>T00:00:00Z"
    [!IMPORTANT] 任何类型的议题(功能、bug修复、杂务、测试等)都不得安排在GTM评审和安全审计门控项之后。这两个项始终是每个里程碑的最后两项,且它们的顺序(GTM → 安全审计)是每次项目更新都必须保留的不变规则。
  6. 使用开始和目标字段ID更新项目看板上所有受影响的项。仅重新计算当前正在开发的里程碑。后续里程碑将在当前里程碑结束时调整。
如果用户要求创建多个议题,按顺序创建每个议题并记录议题编号以供相互引用。
报告创建的议题编号、URL、项目阶段分配、里程碑和计划日期。

GTM Review Gate

GTM评审门

Every project phase must end with a comprehensive Go to Market & Business Review issue. After creating or assigning feature issues, verify GTM coverage for every affected phase:
  1. Check for existing GTM review issues in affected phases:
    bash
    gh issue list --state open --label "gtm-review" --json number,title
  2. For phases missing a GTM review issue, create one:
    bash
    gh issue create \
      --title "gtm: Go to Market & Business Review — <Phase Name>" \
      --body "<body>" \
      --label "enhancement" \
      --label "marketing" \
      --label "gtm-review"
    The GTM review issue body must include:
    • Phase Summary: Features and changes included in this phase
    • Marketing Page Audit: Checklist to verify landing pages, feature descriptions, screenshots, and CTAs reflect the phase's changes
    • Content Consistency: Blog posts, help docs, and in-app copy alignment with new capabilities
    • GTM Recommendations: Positioning, messaging, launch tactics, and channel strategy
    • Business Review: Revenue impact, pricing implications, competitive positioning updates
    • Success Metrics: How to measure GTM effectiveness for this phase
    [!IMPORTANT] All user-facing copy produced during GTM work (landing pages, blog posts, in-app text, marketing content) must follow the User-Facing Content Style rules in
    AGENTS.md
    . No em dashes, no AI-slop vocabulary, no promotional inflation.
    Add the GTM review issue to the project with the correct phase, size, milestone, and dates:
    bash
    GTM_URL=<created-issue-url>
    GTM_NUM=$(echo "$GTM_URL" | grep -o '[0-9]*$')
    
    # Add to project and set fields
    GTM_ITEM_ID=$(gh project item-add {PROJECT_NUMBER} --owner {OWNER} --url "$GTM_URL" --format json | python3 -c "import json,sys; print(json.load(sys.stdin)['id'])")
    gh project item-edit --project-id {PROJECT_ID} --id "$GTM_ITEM_ID" --field-id {PHASE_FIELD_ID} --single-select-option-id <phase-option-id>
    gh project item-edit --project-id {PROJECT_ID} --id "$GTM_ITEM_ID" --field-id {SIZE_FIELD_ID} --single-select-option-id <size-option-id>
    gh project item-edit --project-id {PROJECT_ID} --id "$GTM_ITEM_ID" --field-id {START_FIELD_ID} --date <start-date>
    gh project item-edit --project-id {PROJECT_ID} --id "$GTM_ITEM_ID" --field-id {TARGET_FIELD_ID} --date <target-date>
    The GTM issue is S (2 business days). Its Start date is the next business day after the last feature issue's Target in the phase. Compute dates using the same schedule logic as feature issues (see Schedule Date Computation above).
  3. For phases that already have a GTM review issue, check whether the newly planned work is covered. If the phase scope has expanded significantly, add a comment to the existing GTM issue noting the new items that need review.
[!IMPORTANT] GTM review issues ensure that every shippable phase includes a business review checkpoint. They are not optional — every phase must have one before the phase is considered complete. Exemption: Phases that are purely bug fixes or continuous delivery/maintenance (e.g., dependency upgrades, security patches, CI improvements) are exempt.
每个项目阶段必须以全面的上市与业务评审议题结束。创建或分配功能议题后,验证每个受影响阶段的GTM覆盖:
  1. 检查受影响阶段是否有现有GTM评审议题
    bash
    gh issue list --state open --label "gtm-review" --json number,title
  2. 对于缺少GTM评审议题的阶段,创建一个
    bash
    gh issue create \
      --title "gtm: Go to Market & Business Review — <阶段名称>" \
      --body "<body>" \
      --label "enhancement" \
      --label "marketing" \
      --label "gtm-review"
    GTM评审议题正文必须包含:
    • 阶段摘要: 该阶段包含的功能和变更
    • 营销页面审核: 检查清单,验证登录页面、功能描述、截图和CTA是否反映该阶段的变更
    • 内容一致性: 博客文章、帮助文档和应用内文案与新功能的对齐情况
    • GTM建议: 定位、消息传递、发布策略和渠道策略
    • 业务评审: 收入影响、定价影响、竞争定位更新
    • 成功指标: 如何衡量该阶段的GTM有效性
    [!IMPORTANT] GTM工作中生成的所有面向用户的文案(登录页面、博客文章、应用内文本、营销内容)必须遵循
    AGENTS.md
    中的面向用户的内容风格规则。不得使用破折号、AI腔词汇或夸大的宣传语。
    将GTM评审议题添加到项目,设置正确的阶段、规模、里程碑和日期
    bash
    GTM_URL=<创建的议题URL>
    GTM_NUM=$(echo "$GTM_URL" | grep -o '[0-9]*$')
    
    # 添加到项目并设置字段
    GTM_ITEM_ID=$(gh project item-add {PROJECT_NUMBER} --owner {OWNER} --url "$GTM_URL" --format json | python3 -c "import json,sys; print(json.load(sys.stdin)['id'])")
    gh project item-edit --project-id {PROJECT_ID} --id "$GTM_ITEM_ID" --field-id {PHASE_FIELD_ID} --single-select-option-id <phase-option-id>
    gh project item-edit --project-id {PROJECT_ID} --id "$GTM_ITEM_ID" --field-id {SIZE_FIELD_ID} --single-select-option-id <size-option-id>
    gh project item-edit --project-id {PROJECT_ID} --id "$GTM_ITEM_ID" --field-id {START_FIELD_ID} --date <start-date>
    gh project item-edit --project-id {PROJECT_ID} --id "$GTM_ITEM_ID" --field-id {TARGET_FIELD_ID} --date <target-date>
    GTM议题规模为S(2个工作日)。其开始日期是该阶段最后一个功能议题目标日期后的下一个工作日。使用与功能议题相同的进度逻辑计算日期(请参阅上面的进度日期计算)。
  3. 对于已有GTM评审议题的阶段,检查新规划的工作是否已覆盖。如果阶段范围大幅扩展,在现有GTM议题中添加评论,注明需要评审的新项。
[!IMPORTANT] GTM评审议题确保每个可交付阶段在完成前都包含业务评审检查点。它们是必需的——每个阶段在被视为完成前都必须有一个GTM评审议题。豁免: 纯bug修复或持续交付/维护阶段(例如,依赖项升级、安全补丁、CI改进)可豁免。

Security Audit Gate

安全审计门

Every project phase must end with a comprehensive Security Audit issue as its final work item — after the GTM review. This ensures that any code changes introduced during the GTM review are also covered by the audit. After verifying GTM coverage, verify security audit coverage for every affected phase:
  1. Check for existing security audit issues in affected phases:
    bash
    gh issue list --state open --label "security-audit" --json number,title
  2. For phases missing a security audit issue, create one:
    bash
    gh issue create \
      --title "security: Comprehensive Security Audit — <Phase Name>" \
      --body "<body>" \
      --label "enhancement" \
      --label "security-audit"
    The security audit issue body must include:
    • Phase Summary: Features, services, and changes included in this phase that require security review
    • Audit Scope: Which areas of the codebase are affected (API endpoints, authentication flows, data models, third-party integrations, etc.)
    • SAST Scanning: Run automated static analysis on all code changes in the phase
    • STRIDE Threat Modeling: Apply STRIDE methodology to new or modified features
    • Attack Tree Analysis: Build attack trees for the top 3 risks identified in threat modeling
    • Dependency Audit: Review new or updated dependencies for known vulnerabilities
    • Remediation Plan: Prioritized list of findings with severity ratings and fix recommendations
    Add the security audit issue to the project with the correct phase, size, milestone, and dates:
    bash
    SEC_URL=<created-issue-url>
    SEC_NUM=$(echo "$SEC_URL" | grep -o '[0-9]*$')
    
    # Add to project and set fields
    SEC_ITEM_ID=$(gh project item-add {PROJECT_NUMBER} --owner {OWNER} --url "$SEC_URL" --format json | python3 -c "import json,sys; print(json.load(sys.stdin)['id'])")
    gh project item-edit --project-id {PROJECT_ID} --id "$SEC_ITEM_ID" --field-id {PHASE_FIELD_ID} --single-select-option-id <phase-option-id>
    gh project item-edit --project-id {PROJECT_ID} --id "$SEC_ITEM_ID" --field-id {SIZE_FIELD_ID} --single-select-option-id <size-option-id>
    gh project item-edit --project-id {PROJECT_ID} --id "$SEC_ITEM_ID" --field-id {START_FIELD_ID} --date <start-date>
    gh project item-edit --project-id {PROJECT_ID} --id "$SEC_ITEM_ID" --field-id {TARGET_FIELD_ID} --date <target-date>
    The security audit issue is M (3 business days). Its Start date is the next business day after the GTM issue's Target in the same phase. The security audit is always the last issue in a phase. Compute dates using the same schedule logic as feature issues (see Schedule Date Computation above).
  3. For phases that already have a security audit issue, check whether the newly planned work is covered. If the phase scope has expanded significantly, add a comment to the existing security audit issue noting the new items that need review.
[!IMPORTANT] Security audit issues ensure that every shippable phase includes a security checkpoint before release. They are not optional — every phase must have one before the phase is considered complete. The security audit is always the last issue in a phase, running after the GTM review. Run it using
/security-audit
. Exemption: Phases that are purely bug fixes or continuous delivery/maintenance (e.g., dependency upgrades, security patches, CI improvements) are exempt — same as the GTM review exemption.
每个项目阶段必须以全面的安全审计议题作为最后一个工作项——在GTM评审之后。这确保GTM评审期间引入的任何代码变更也能被审计覆盖。验证GTM覆盖后,验证每个受影响阶段的安全审计覆盖:
  1. 检查受影响阶段是否有现有安全审计议题
    bash
    gh issue list --state open --label "security-audit" --json number,title
  2. 对于缺少安全审计议题的阶段,创建一个
    bash
    gh issue create \
      --title "security: Comprehensive Security Audit — <阶段名称>" \
      --body "<body>" \
      --label "enhancement" \
      --label "security-audit"
    安全审计议题正文必须包含:
    • 阶段摘要: 该阶段中需要安全评审的功能、服务和变更
    • 审计范围: 代码库中受影响的区域(API端点、认证流程、数据模型、第三方集成等)
    • SAST扫描: 对该阶段的所有代码变更运行自动化静态分析
    • STRIDE威胁建模: 对新功能或修改后的功能应用STRIDE方法
    • 攻击树分析: 为威胁建模中识别的前3大风险构建攻击树
    • 依赖项审计: 审查新的或更新的依赖项是否存在已知漏洞
    • 修复计划: 按优先级排列的发现结果,包含严重性评级和修复建议
    将安全审计议题添加到项目,设置正确的阶段、规模、里程碑和日期
    bash
    SEC_URL=<创建的议题URL>
    SEC_NUM=$(echo "$SEC_URL" | grep -o '[0-9]*$')
    
    # 添加到项目并设置字段
    SEC_ITEM_ID=$(gh project item-add {PROJECT_NUMBER} --owner {OWNER} --url "$SEC_URL" --format json | python3 -c "import json,sys; print(json.load(sys.stdin)['id'])")
    gh project item-edit --project-id {PROJECT_ID} --id "$SEC_ITEM_ID" --field-id {PHASE_FIELD_ID} --single-select-option-id <phase-option-id>
    gh project item-edit --project-id {PROJECT_ID} --id "$SEC_ITEM_ID" --field-id {SIZE_FIELD_ID} --single-select-option-id <size-option-id>
    gh project item-edit --project-id {PROJECT_ID} --id "$SEC_ITEM_ID" --field-id {START_FIELD_ID} --date <start-date>
    gh project item-edit --project-id {PROJECT_ID} --id "$SEC_ITEM_ID" --field-id {TARGET_FIELD_ID} --date <target-date>
    安全审计议题规模为M(3个工作日)。其开始日期是同一阶段GTM议题目标日期后的下一个工作日。安全审计始终是阶段的最后一个议题。使用与功能议题相同的进度逻辑计算日期(请参阅上面的进度日期计算)。
  3. 对于已有安全审计议题的阶段,检查新规划的工作是否已覆盖。如果阶段范围大幅扩展,在现有安全审计议题中添加评论,注明需要评审的新项。
[!IMPORTANT] 安全审计议题确保每个可交付阶段在发布前都包含安全检查点。它们是必需的——每个阶段在被视为完成前都必须有一个安全审计议题。安全审计始终是阶段的最后一个议题,在GTM评审之后运行。使用
/security-audit
运行。豁免: 纯bug修复或持续交付/维护阶段(例如,依赖项升级、安全补丁、CI改进)可豁免——与GTM评审豁免规则相同。

Step 10: Output Summary

步骤10:输出摘要

Present a clear summary:
  • Approved Scope: MVP capabilities and deferred items
  • Task Breakdown: Frontend, backend, database, and testing tasks
  • Feature Flag: Name and strategy (if applicable)
  • Success Metrics: How we'll measure outcomes
  • Branch: Feature branch name ready for implementation
  • Decision Record: File path for reference
  • GitHub Issue(s): Issue number(s) and URL(s) for the implementation plan
  • Project Phase(s): Which phase(s) on the Product Roadmap each issue is assigned to
  • GTM Coverage: GTM review issue(s) for affected phase(s) — created, updated, or verified
  • Security Audit Coverage: Security audit issue(s) for affected phase(s) — created, updated, or verified
Next step: Run
/build-feature <issue-number>
for full-stack implementation, or
/build-api
for backend-only work.
呈现清晰的摘要:
  • 获批范围: MVP功能和推迟项
  • 任务分解: 前端、后端、数据库和测试任务
  • 功能标志: 名称和策略(如适用)
  • 成功指标: 我们如何衡量结果
  • 分支: 准备好实施的功能分支名称
  • 决策记录: 参考文件路径
  • GitHub议题: 实施计划的议题编号和URL
  • 项目阶段: 每个议题在产品路线图上分配的阶段
  • GTM覆盖: 受影响阶段的GTM评审议题——已创建、更新或验证
  • 安全审计覆盖: 受影响阶段的安全审计议题——已创建、更新或验证
下一步: 运行
/build-feature <issue-number>
进行全栈实施,或运行
/build-api
仅进行后端工作。