mcpField
R
review-skill-improver

review-skill-improver

github.com/existential-birdsAgent 工作流85120 次安装11 周前更新
代码仓库

关于 review-skill-improver

review-skill-improver 分析结构化代码审查反馈日志,识别误报规则与遗漏问题,并提出有证据支持的技能修改建议。它面向希望依据记录结果改进审查技能的团队,要求先验证输入并完成聚合分析。

主要功能

  1. 01验证反馈来源和数据结构
  2. 02按规则来源汇总判定结果
  3. 03识别拒绝率较高的规则
  4. 04按主题归类拒绝理由
  5. 05要求建议附带证据

适用场景

  1. 01调查经常被拒绝的审查规则
  2. 02发现审查规则遗漏的问题
  3. 03起草有证据支持的技能修改

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/existential-birds/beagle --skill review-skill-improver

安装后在 Claude Code 中输入/review-skill-improver确认已加载。

详细介绍

审查技能改进器

用途

分析结构化反馈日志,以便:

  1. 识别会产生误报的规则(高拒绝率)
  2. 识别缺失的规则(本应发现但未发现的问题)
  3. 提出具体的技能修改建议

输入

增强版架构格式的反馈日志(参见 review-feedback-schema 技能)。

硬性关卡

按顺序执行;在每个关卡都通过之前,不要输出最终的审查技能改进报告。

  1. 记录输入 — 日志从仓库中指定的路径加载,或来自附加的文件,而非凭记忆或转述。**通过条件:**报告标题或摘要注明该路径,或说明“附加的反馈数据块”并注明字节数或行数。
  2. 架构 / 结构 — 条目符合增强版架构(rule_source、verdict、rationale 等,详见 review-feedback-schema 技能)。**通过条件:**所有行均可解析,或者对跳过的格式错误行进行计数,并按行索引列出(不得静默丢弃)。
  3. 先聚合,再应用阈值 — 完成步骤 1(对完整解析集按 rule_source 统计总数、ACCEPT 与 REJECT 数、拒绝率和拒绝理由),然后才能将任何规则标记为“高拒绝率”或撰写建议。**通过条件:**摘要中的“触发的唯一规则数”与聚合表一致。
  4. 建议须有证据支撑 — 每条建议都必须在拟议修复之前包含至少一个具体证据指针(日志行,或文件:行 + 简短引述)。通过条件:每条建议的证据均不为空。

分析流程

步骤 1:按规则来源聚合
For each unique rule_source:
  - Count total issues flagged
  - Count ACCEPT vs REJECT
  - Calculate rejection rate
  - Extract rejection rationales
步骤 2:识别高拒绝率规则

拒绝率 >30% 的规则值得调查:

  • 阅读拒绝理由
  • 识别常见主题
  • 判断规则是否需要细化或增加例外
步骤 3:模式分析

按理由主题对拒绝进行分组:

  • “Linter 已经处理了此问题” -> 添加 Linter 验证步骤
  • “框架支持此模式” -> 为技能添加例外
  • “有意为之的设计决策” -> 添加代码库上下文检查
  • “假设了错误的代码路径” -> 添加代码追踪步骤
步骤 4:生成改进建议

针对发现的每个问题,生成:

## Recommendation: [SHORT_TITLE]

**Affected Skill:** `skill-name/SKILL.md` or `skill-name/references/file.md`

**Problem:** [What's causing false positives]

**Evidence:**
- [X] rejections with rationale "[common theme]"
- Example: [file:line] - [issue] - [rationale]

**Proposed Fix:**
```markdown
[Exact text to add/modify in the skill]

**预期影响:**将 [rule] 的误报率从 X% 降至 Y%


## Output Format

```markdown
# Review Skill Improvement Report

## Summary
- Feedback entries analyzed: [N]
- Unique rules triggered: [N]
- High-rejection rules identified: [N]
- Recommendations generated: [N]

## High-Rejection Rules

| Rule Source | Total | Rejected | Rate | Theme |
|-------------|-------|----------|------|-------|
| ... | ... | ... | ... | ... |

## Recommendations

[Numbered list of recommendations in format above]

## Rules Performing Well

[Rules with <10% rejection rate - preserve these]

用法

调用 review-skill-improver 技能来分析反馈并生成改进报告,也可以选择传入输出路径:

review-skill-improver --output improvement-report.md

分析示例

给定以下反馈数据:

rule_source,verdict,rationale
python-code-review:line-length,REJECT,ruff check passes
python-code-review:line-length,REJECT,no E501 violation
python-code-review:line-length,REJECT,linter config allows 120
python-code-review:line-length,ACCEPT,fixed long line
pydantic-ai-common-pitfalls:tool-decorator,REJECT,docs support raw functions
python-code-review:type-safety,ACCEPT,added type annotation
python-code-review:type-safety,ACCEPT,fixed Any usage

分析输出:

# Review Skill Improvement Report

## Summary
- Feedback entries analyzed: 7
- Unique rules triggered: 3
- High-rejection rules identified: 2
- Recommendations generated: 2

## High-Rejection Rules

| Rule Source | Total | Rejected | Rate | Theme |
|-------------|-------|----------|------|-------|
| python-code-review:line-length | 4 | 3 | 75% | linter handles this |
| pydantic-ai-common-pitfalls:tool-decorator | 1 | 1 | 100% | framework supports pattern |

## Recommendations

### 1. Add Linter Verification for Line Length

**Affected Skill:** `commands/review-python.md`

**Problem:** Flagging line length issues that linters confirm don't exist

**Evidence:**
- 3 rejections with rationale "linter passes/handles this"
- Example: amelia/drivers/api/openai.py:102 - Line too long - ruff check passes

**Proposed Fix:**
Add step to run `ruff check` before manual review. If linter passes for line length, do not flag manually.

**Expected Impact:** Reduce false positive rate for line-length from 75% to <10%

### 2. Add Raw Function Tool Registration Exception

**Affected Skill:** `skills/pydantic-ai-common-pitfalls/SKILL.md`

**Problem:** Flagging valid pydantic-ai pattern as error

**Evidence:**
- 1 rejection with rationale "docs support raw functions"

**Proposed Fix:**
Add "Valid Patterns" section documenting that passing functions with RunContext to Agent(tools=[...]) is valid.

**Expected Impact:** Eliminate false positives for this pattern

## Rules Performing Well

| Rule Source | Total | Accepted | Rate |
|-------------|-------|----------|------|
| python-code-review:type-safety | 2 | 2 | 100% |

未来:自动化技能更新

当置信度足够高时,此技能可以:

  1. 向 beagle 提交包含技能改进的 PR
  2. 跟踪改进效果的变化
  3. 对规则变体进行 A/B 测试

反馈循环

Review Code -> Log Outcomes -> Analyze Patterns -> Improve Skills -> Better Reviews
     ^                                                                    |
     +--------------------------------------------------------------------+

这样就能形成持续改进循环,让审查质量基于实证数据而非猜测不断提升。

评论

支持 Markdown