pr-plan

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

PR Plan Skill

PR Plan 技能

Strategic planning for open source contributions.
开源贡献的战略规划工具。

Overview

概述

Create a contribution plan that bridges research and implementation. Takes
$pr-research
output and produces an actionable plan.
Output:
.agents/plans/YYYY-MM-DD-pr-plan-{repo-slug}.md
When to Use:
  • After completing
    $pr-research
  • Planning contribution strategy
  • Before starting implementation
When NOT to Use:
  • Haven't researched the repo yet
  • Trivial contributions (fix typos)
  • Internal project planning (use
    $plan
    )

创建连接研究与实施的贡献计划。接收
$pr-research
的输出内容,生成可执行的计划。
输出文件
.agents/plans/YYYY-MM-DD-pr-plan-{repo-slug}.md
适用场景
  • 完成
    $pr-research
    之后
  • 规划贡献策略时
  • 开始实施之前
不适用场景
  • 尚未对仓库进行研究
  • 微小贡献(如修复拼写错误)
  • 内部项目规划(请使用
    $plan

Workflow

工作流

0.  Input Discovery     -> Find/load pr-research artifact
1.  Scope Definition    -> What exactly to contribute
2.  Target Selection    -> Which issues/areas to address
3.  Criteria Definition -> Acceptance criteria from research
4.  Risk Assessment     -> What could go wrong
5.  Strategy Formation  -> Implementation approach
6.  Output              -> Write plan artifact

0.  输入发现     -> 查找/加载pr-research成果
1.  范围定义    -> 明确具体贡献内容
2.  目标选择    -> 确定要解决的问题/领域
3.  标准定义 -> 从研究成果中提取验收标准
4.  风险评估     -> 识别潜在问题
5.  策略制定  -> 确定实施方法
6.  输出              -> 写入计划文件

Phase 1: Scope Definition

阶段1:范围定义

Scope Questions

范围确认问题

QuestionWhy It Matters
What specific functionality?Clear deliverable
Which files/packages?Limits impact surface
What's explicitly out of scope?Prevents scope creep
Single PR or series?Sets expectations
问题重要性
具体要实现什么功能?明确交付成果
涉及哪些文件/包?限制影响范围
明确排除哪些内容?防止范围蔓延
单次PR提交还是分多次?设定预期

Scope Template

范围模板

markdown
undefined
markdown
undefined

Scope

范围

Contribution: [1-2 sentences describing the change]
Affected Areas:
  • path/to/file.go
    - [what changes]
Out of Scope:
  • [Related but excluded work]

---
贡献内容:[1-2句话描述变更内容]
影响范围
  • path/to/file.go
    - [变更内容]
排除范围
  • [相关但不包含的工作]

---

Phase 3: Acceptance Criteria

阶段3:验收标准

Define success from maintainer perspective:
markdown
undefined
从维护者的角度定义成功标准:
markdown
undefined

Acceptance Criteria

验收标准

Code Quality

代码质量

  • Follows project coding style
  • Passes existing tests
  • Adds tests for new functionality
  • No linting warnings
  • 遵循项目编码规范
  • 通过现有测试
  • 为新功能添加测试
  • 无代码检查警告

PR Requirements

PR要求

  • Title follows convention
  • Body uses project template
  • Size within acceptable range
  • Single logical change
  • 标题符合约定
  • 正文使用项目模板
  • 大小在可接受范围内
  • 单一逻辑变更

Project-Specific

项目特定要求

  • [Any project-specific requirements from research]

---
  • [研究中发现的项目特定要求]

---

Phase 4: Risk Assessment

阶段4:风险评估

RiskLikelihoodImpactMitigation
PR review takes > 2 weeksMediumMediumStart small, be responsive
Scope expands during reviewMediumHighDefine scope clearly upfront
Breaking change discoveredLowHighTest against multiple versions

风险发生概率影响程度缓解措施
PR审核耗时超过2周中等中等从小功能入手,及时响应
范围在审核过程中扩大中等提前明确范围边界
发现破坏性变更针对多个版本进行测试

Phase 5: Implementation Strategy

阶段5:实施策略

markdown
undefined
markdown
undefined

Implementation Strategy

实施策略

Approach

方法

  1. Setup: Fork repo, configure dev environment
  2. Understand: Read existing code in affected area
  3. Implement: Make changes following project patterns
  4. Test: Run existing tests + add new tests
  5. Document: Update any affected documentation
  6. Submit: Create PR following project conventions
  1. 准备工作:复刻仓库,配置开发环境
  2. 代码理解:阅读影响范围内的现有代码
  3. 开发实现:遵循项目模式进行变更
  4. 测试验证:运行现有测试并添加新测试
  5. 文档更新:更新所有受影响的文档
  6. 提交PR:遵循项目约定创建PR

Pre-Implementation Checklist

实施前检查清单

  • Fork created and up-to-date with upstream
  • Dev environment working
  • Issue claimed or comment posted
  • Recent repo activity reviewed

---
  • 已复刻仓库并与上游仓库保持同步
  • 开发环境正常运行
  • 已认领问题或发布评论
  • 已查看仓库近期活动

---

Output Template

输出模板

Write to
.agents/plans/YYYY-MM-DD-pr-plan-{repo-slug}.md
markdown
undefined
写入文件:
.agents/plans/YYYY-MM-DD-pr-plan-{repo-slug}.md
markdown
undefined

PR Plan: {repo-name}

PR 计划: {repo-name}

Executive Summary

执行摘要

{2-3 sentences: what you're contributing, why, expected outcome}
{2-3句话:贡献内容、原因、预期成果}

Scope

范围

Contribution: {description} Affected Areas: [list] Out of Scope: [list]
贡献内容:{描述} 影响范围:[列表] 排除范围:[列表]

Target

目标

Primary Issue: #{N} - {title}
核心问题:#{N} - {标题}

Acceptance Criteria

验收标准

[checklist]
[检查清单]

Risk Assessment

风险评估

[table]
[表格]

Implementation Strategy

实施策略

[numbered steps]
[编号步骤]

Next Steps

下一步行动

  1. Claim/comment on target issue
  2. Fork and set up development environment
  3. Implement following strategy
  4. Run
    $pr-prep
    when ready

---
  1. 认领/评论目标问题
  2. 复刻并搭建开发环境
  3. 按照策略实施
  4. 准备就绪后运行
    $pr-prep

---

Workflow Integration

工作流集成

$pr-research <repo> -> $pr-plan <research> -> implement -> $pr-prep
$pr-research <repo> -> $pr-plan <research> -> 开发实现 -> $pr-prep

Examples

示例

Plan a Focused External Contribution

规划聚焦的外部贡献

User says: "Create a contribution plan from my PR research artifact."
What happens:
  1. Extract accepted conventions and constraints.
  2. Define scope boundaries and acceptance criteria.
  3. Produce an implementation strategy with risks.
用户输入:"根据我的PR研究成果创建贡献计划。"
执行流程
  1. 提取已接受的约定和约束条件。
  2. 定义范围边界和验收标准。
  3. 生成包含风险的实施策略。

Tighten Scope Before Coding

编码前缩小范围

User says: "Check if this PR plan is too large for one submission."
What happens:
  1. Compare proposed changes to historical PR size patterns.
  2. Split oversized scope into phased contributions.
  3. Emit a revised plan and next-step checklist.
用户输入:"检查这个PR计划是否太大,不适合单次提交。"
执行流程
  1. 将提议的变更与历史PR大小模式进行对比。
  2. 将过大的范围拆分为分阶段的贡献。
  3. 输出修订后的计划和下一步行动清单。

Troubleshooting

故障排除

ProblemCauseSolution
Plan has vague acceptance criteriaCriteria not measurableConvert criteria to concrete behavioral checks
Scope too broadMultiple concerns mixedSplit by user-visible change or subsystem boundary
Risk section is weakMissing failure-mode analysisAdd integration, review, and rollback risks explicitly
Plan conflicts with repo normsResearch artifact incompleteRe-run
$pr-research
and refresh constraints
问题原因解决方案
计划的验收标准模糊标准不可衡量将标准转换为具体的行为检查项
范围过于宽泛混合了多个关注点按用户可见变更或子系统边界拆分
风险部分内容薄弱缺少故障模式分析明确添加集成、审核和回滚相关风险
计划与仓库规范冲突研究成果不完整重新运行
$pr-research
并更新约束条件