pr-plan
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePR Plan Skill
PR Plan 技能
Strategic planning for open source contributions.
开源贡献的战略规划工具。
Overview
概述
Create a contribution plan that bridges research and implementation. Takes
output and produces an actionable plan.
$pr-researchOutput:
.agents/plans/YYYY-MM-DD-pr-plan-{repo-slug}.mdWhen 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 artifact0. 输入发现 -> 查找/加载pr-research成果
1. 范围定义 -> 明确具体贡献内容
2. 目标选择 -> 确定要解决的问题/领域
3. 标准定义 -> 从研究成果中提取验收标准
4. 风险评估 -> 识别潜在问题
5. 策略制定 -> 确定实施方法
6. 输出 -> 写入计划文件Phase 1: Scope Definition
阶段1:范围定义
Scope Questions
范围确认问题
| Question | Why 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
undefinedmarkdown
undefinedScope
范围
Contribution: [1-2 sentences describing the change]
Affected Areas:
- - [what changes]
path/to/file.go
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
undefinedAcceptance 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:风险评估
| Risk | Likelihood | Impact | Mitigation |
|---|---|---|---|
| PR review takes > 2 weeks | Medium | Medium | Start small, be responsive |
| Scope expands during review | Medium | High | Define scope clearly upfront |
| Breaking change discovered | Low | High | Test against multiple versions |
| 风险 | 发生概率 | 影响程度 | 缓解措施 |
|---|---|---|---|
| PR审核耗时超过2周 | 中等 | 中等 | 从小功能入手,及时响应 |
| 范围在审核过程中扩大 | 中等 | 高 | 提前明确范围边界 |
| 发现破坏性变更 | 低 | 高 | 针对多个版本进行测试 |
Phase 5: Implementation Strategy
阶段5:实施策略
markdown
undefinedmarkdown
undefinedImplementation Strategy
实施策略
Approach
方法
- Setup: Fork repo, configure dev environment
- Understand: Read existing code in affected area
- Implement: Make changes following project patterns
- Test: Run existing tests + add new tests
- Document: Update any affected documentation
- Submit: Create PR following project conventions
- 准备工作:复刻仓库,配置开发环境
- 代码理解:阅读影响范围内的现有代码
- 开发实现:遵循项目模式进行变更
- 测试验证:运行现有测试并添加新测试
- 文档更新:更新所有受影响的文档
- 提交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}.mdmarkdown
undefined写入文件:
.agents/plans/YYYY-MM-DD-pr-plan-{repo-slug}.mdmarkdown
undefinedPR 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
下一步行动
- Claim/comment on target issue
- Fork and set up development environment
- Implement following strategy
- Run when ready
$pr-prep
---- 认领/评论目标问题
- 复刻并搭建开发环境
- 按照策略实施
- 准备就绪后运行
$pr-prep
---Workflow Integration
工作流集成
$pr-research <repo> -> $pr-plan <research> -> implement -> $pr-prep$pr-research <repo> -> $pr-plan <research> -> 开发实现 -> $pr-prepExamples
示例
Plan a Focused External Contribution
规划聚焦的外部贡献
User says: "Create a contribution plan from my PR research artifact."
What happens:
- Extract accepted conventions and constraints.
- Define scope boundaries and acceptance criteria.
- Produce an implementation strategy with risks.
用户输入:"根据我的PR研究成果创建贡献计划。"
执行流程:
- 提取已接受的约定和约束条件。
- 定义范围边界和验收标准。
- 生成包含风险的实施策略。
Tighten Scope Before Coding
编码前缩小范围
User says: "Check if this PR plan is too large for one submission."
What happens:
- Compare proposed changes to historical PR size patterns.
- Split oversized scope into phased contributions.
- Emit a revised plan and next-step checklist.
用户输入:"检查这个PR计划是否太大,不适合单次提交。"
执行流程:
- 将提议的变更与历史PR大小模式进行对比。
- 将过大的范围拆分为分阶段的贡献。
- 输出修订后的计划和下一步行动清单。
Troubleshooting
故障排除
| Problem | Cause | Solution |
|---|---|---|
| Plan has vague acceptance criteria | Criteria not measurable | Convert criteria to concrete behavioral checks |
| Scope too broad | Multiple concerns mixed | Split by user-visible change or subsystem boundary |
| Risk section is weak | Missing failure-mode analysis | Add integration, review, and rollback risks explicitly |
| Plan conflicts with repo norms | Research artifact incomplete | Re-run |
| 问题 | 原因 | 解决方案 |
|---|---|---|
| 计划的验收标准模糊 | 标准不可衡量 | 将标准转换为具体的行为检查项 |
| 范围过于宽泛 | 混合了多个关注点 | 按用户可见变更或子系统边界拆分 |
| 风险部分内容薄弱 | 缺少故障模式分析 | 明确添加集成、审核和回滚相关风险 |
| 计划与仓库规范冲突 | 研究成果不完整 | 重新运行 |