npx skills add https://github.com/boshu2/agentops --skill pr-retro通过分析接受/拒绝模式,从 PR 结果中学习。
在 PR 被合并或拒绝后,分析哪些方面做得好,哪些方面做得不好,以改进未来的贡献。
输出: .agents/learnings/YYYY-MM-DD-pr-{repo}-{outcome}.md
使用时机:
# 如果提供了 PR 编号
gh pr view <number> --json state,reviews,comments,mergedAt,closedAt
# 查找你最近的 PR
gh pr list --state all --author @me --limit 10
# 查找特定仓库的 PR
gh pr list -R <owner/repo> --state all --author @me --limit 10
| 结果 |
|---|
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 含义 |
|---|
| 关注点 |
|---|
| 已合并 | 成功 | 哪些方面做得好? |
| 已关闭(未合并) | 被拒绝 | 为什么? |
| 开放(陈旧) | 被忽略/放弃 | 哪里出了问题? |
| 请求更改 | 需要修改 | 收到什么反馈? |
# 获取 PR 结果
gh pr view <number> --json state,mergedAt,closedAt,reviews
# 获取所有审查评论
gh pr view <number> --json reviews --jq '.reviews[] | "\(.author.login): \(.body)"'
# 获取所有评论
gh api repos/<owner>/<repo>/pulls/<number>/comments --jq '.[].body'
# 获取请求的更改
gh pr view <number> --json reviews --jq '.reviews[] | select(.state == "CHANGES_REQUESTED")'
| 类别 | 示例 |
|---|---|
| 风格 | 命名、格式、约定 |
| 技术 | 算法、架构、模式 |
| 范围 | 太大、范围蔓延、无关更改 |
| 测试 | 缺少测试、覆盖率、边界情况 |
| 文档 | 缺少文档、注释不清晰 |
| 流程 | 错误的分支、缺少签署 |
| 哪些方面做得好 | 证据 |
|---|---|
| PR 小而专注 | < 5 个文件 |
| 遵循约定 | 没有风格相关的评论 |
| 测试良好 | 没有"添加测试"的请求 |
| 描述清晰 | 快速获得批准 |
| 哪些方面失败 | 证据 |
|---|---|
| 太大 | "请拆分这个 PR" |
| 范围蔓延 | "这超出了范围" |
| 缺少测试 | "请添加测试" |
| 方法错误 | "考虑改用 X 代替" |
## 经验:[标题]
**背景**:[何时适用?]
**学习成果**:[我们学到了什么?]
**行动**:[应该采取哪些不同的做法?]
**证据**:
- PR #N:[引用或摘要]
| 经验 | 行动 |
|---|---|
| PR 太大 | 将 PR 拆分为小于 200 行 |
| 缺少背景信息 | 添加"## 背景"部分 |
| 风格不匹配 | 提交 PR 前运行 linter |
| 缺少测试 | 为新代码添加测试 |
| 审查缓慢 | 1 周后提醒 |
写入 .agents/learnings/YYYY-MM-DD-pr-{repo}-{outcome}.md
# PR 回顾:{repo} #{number}
**日期**:YYYY-MM-DD
**PR**:{url}
**结果**:已合并 / 被拒绝 / 陈旧
## 摘要
{PR 是关于什么的?发生了什么?}
## 时间线
| 日期 | 事件 |
|------|-------|
| {date} | PR 打开 |
| {date} | 首次审查 |
| {date} | {outcome} |
## 反馈分析
### 积极反馈
- {quote}
### 请求的更改
- {quote}
### 拒绝原因(如果适用)
- {quote}
## 经验教训
### 经验 1:{title}
**背景**:{when this applies}
**学习成果**:{what we learned}
**行动**:{what to do differently}
## 流程更新
{对 pr-prep、pr-plan 或其他技能所做的任何更改}
## 后续步骤
{基于此次回顾的未来行动}
| 不要 | 应该这样做 |
|---|---|
| 跳过对已合并 PR 的回顾 | 也要从成功中学习 |
| 指责维护者 | 专注于你可以改变的地方 |
| 经验教训过于笼统 | 具体、可操作的教训 |
| 跳过被拒绝的 PR | 这是最有价值的学习来源 |
用户说: "运行回顾,分析这个 PR 被拒绝的原因。"
会发生什么:
用户说: "从这个已合并的 PR 中提取做得好的方面。"
会发生什么:
| 问题 | 原因 | 解决方案 |
|---|---|---|
| 回顾过于笼统 | 反馈未与证据关联 | 引用具体的评论/决策和结果 |
| 未提取出清晰的教训 | 分析停留在描述性层面 | 将观察结果转化为行为改变 |
| 维护者信号混杂 | 矛盾的审查评论 | 将硬性阻碍与偏好反馈分开 |
| 流程更改未被采纳 | 经验教训未转化为操作 | 在准备/计划/验证工作流中添加明确的更新 |
每周安装量
173
仓库
GitHub 星标数
218
首次出现
2026年2月18日
安全审计
安装于
opencode173
gemini-cli168
github-copilot168
codex168
kimi-cli168
amp168
Learn from PR outcomes by analyzing accept/reject patterns.
After a PR is merged or rejected, analyze what worked and what didn't to improve future contributions.
Output: .agents/learnings/YYYY-MM-DD-pr-{repo}-{outcome}.md
When to Use :
1. PR Discovery -> Find the PR to analyze
2. Outcome Analysis -> Merged/rejected/changes requested
3. Feedback Extraction -> What did reviewers say?
4. Pattern Identification -> What worked/didn't
5. Lesson Extraction -> Reusable learnings
6. Output -> Write retro document
# If PR number provided
gh pr view <number> --json state,reviews,comments,mergedAt,closedAt
# Find recent PRs by you
gh pr list --state all --author @me --limit 10
# Find PRs to a specific repo
gh pr list -R <owner/repo> --state all --author @me --limit 10
| Outcome | Meaning | Focus |
|---|---|---|
| Merged | Success | What worked? |
| Closed (not merged) | Rejected | Why? |
| Open (stale) | Ignored/abandoned | What went wrong? |
| Changes requested | Needs work | What feedback? |
# Get PR outcome
gh pr view <number> --json state,mergedAt,closedAt,reviews
# Get all review comments
gh pr view <number> --json reviews --jq '.reviews[] | "\(.author.login): \(.body)"'
# Get all comments
gh api repos/<owner>/<repo>/pulls/<number>/comments --jq '.[].body'
# Get requested changes
gh pr view <number> --json reviews --jq '.reviews[] | select(.state == "CHANGES_REQUESTED")'
| Category | Examples |
|---|---|
| Style | Naming, formatting, conventions |
| Technical | Algorithm, architecture, patterns |
| Scope | Too big, scope creep, unrelated changes |
| Testing | Missing tests, coverage, edge cases |
| Documentation | Missing docs, unclear comments |
| Process | Wrong branch, missing sign-off |
| What Worked | Evidence |
|---|---|
| Small, focused PR | < 5 files |
| Followed conventions | No style comments |
| Good tests | No "add tests" requests |
| Clear description | Quick approval |
| What Failed | Evidence |
|---|---|
| Too large | "Please split this PR" |
| Scope creep | "This is out of scope" |
| Missing tests | "Please add tests" |
| Wrong approach | "Consider using X instead" |
## Lesson: [Title]
**Context**: [When does this apply?]
**Learning**: [What did we learn?]
**Action**: [What to do differently?]
**Evidence**:
- PR #N: [quote or summary]
| Lesson | Action |
|---|---|
| PR too large | Split PRs under 200 lines |
| Missing context | Add "## Context" section |
| Style mismatch | Run linter before PR |
| Missing tests | Add tests for new code |
| Slow review | Ping after 1 week |
Write to .agents/learnings/YYYY-MM-DD-pr-{repo}-{outcome}.md
# PR Retro: {repo} #{number}
**Date**: YYYY-MM-DD
**PR**: {url}
**Outcome**: Merged / Rejected / Stale
## Summary
{What was the PR about? What happened?}
## Timeline
| Date | Event |
|------|-------|
| {date} | PR opened |
| {date} | First review |
| {date} | {outcome} |
## Feedback Analysis
### Positive Feedback
- {quote}
### Requested Changes
- {quote}
### Rejection Reasons (if applicable)
- {quote}
## Lessons Learned
### Lesson 1: {title}
**Context**: {when this applies}
**Learning**: {what we learned}
**Action**: {what to do differently}
## Updates to Process
{Any changes to make to pr-prep, pr-plan, or other skills}
## Next Steps
{Future actions based on this retro}
| DON'T | DO INSTEAD |
|---|---|
| Skip retros on merged PRs | Learn from success too |
| Blame maintainers | Focus on what YOU can change |
| Generic lessons | Specific, actionable learnings |
| Skip rejected PRs | Most valuable learning source |
User says: "Run a retro on why this PR was rejected."
What happens:
User says: "Extract what worked from this merged PR."
What happens:
| Problem | Cause | Solution |
|---|---|---|
| Retro is generic | Feedback not tied to evidence | Cite specific comments/decisions and outcomes |
| No clear lesson extracted | Analysis stayed descriptive | Convert observations into behavior changes |
| Maintainer signal is mixed | Contradictory review comments | Separate hard blockers from preference feedback |
| Process changes not adopted | Lessons not operationalized | Add explicit updates to prep/plan/validate workflow |
Weekly Installs
173
Repository
GitHub Stars
218
First Seen
Feb 18, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
opencode173
gemini-cli168
github-copilot168
codex168
kimi-cli168
amp168
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
152,900 周安装