mcpField
T
triage

triage

github.com/everyinc测试与质量25.8k56 次安装今天更新
代码仓库

关于 triage

用于审查问题并决定哪些应加入 CLI 待办系统的分流技能。它逐项呈现内容供决策,并明确禁止在分流过程中编写代码。

主要功能

  1. 01逐项呈现问题
  2. 02标注严重性和类别
  3. 03批准、跳过或修改条目
  4. 04创建或更新待办文件
  5. 05汇总分流结果

适用场景

  1. 01整理代码审查问题
  2. 02处理安全审计结果
  3. 03审查性能分析

安装

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

$npx skills add https://github.com/everyinc/compound-engineering-plugin --skill triage

安装后在 Claude Code 中输入/triage确认已加载。

详细介绍

  • 首先将 /model 设置为 Haiku
  • 然后读取 todos/ 目录中的所有待处理待办事项

在此逐项列出所有发现、决定或问题,供分类处理。目标是逐一检查每个条目,并决定是否将其添加到 CLI 待办系统。

重要:分类处理期间不要编写任何代码!

此命令用于:

  • 对代码审查发现进行分类处理
  • 处理安全审计结果
  • 审查性能分析
  • 处理任何其他需要跟踪的分类发现

工作流

步骤 1:列出每项发现

对于每项发现,请使用以下格式:

---
Issue #X: [Brief Title]

Severity: 🔴 P1 (CRITICAL) / 🟡 P2 (IMPORTANT) / 🔵 P3 (NICE-TO-HAVE)

Category: [Security/Performance/Architecture/Bug/Feature/etc.]

Description:
[Detailed explanation of the issue or improvement]

Location: [file_path:line_number]

Problem Scenario:
[Step by step what's wrong or could happen]

Proposed Solution:
[How to fix it]

Estimated Effort: [Small (< 2 hours) / Medium (2-8 hours) / Large (> 8 hours)]

---
Do you want to add this to the todo list?
1. yes - create todo file
2. next - skip this item
3. custom - modify before creating
步骤 2:处理用户决定

用户回答“yes”时:

  1. 更新现有待办文件(如果存在),或创建新文件名:

    如果待办事项已存在(来自代码审查):

    • 将文件从 {id}-pending-{priority}-{desc}.md 重命名为 {id}-ready-{priority}-{desc}.md
    • 更新 YAML frontmatter:status: pending → status: ready
    • 保持 issue_id、priority 和 description 不变

    如果要创建新的待办事项:

    {next_id}-ready-{priority}-{brief-description}.md
    

    优先级映射:

    • 🔴 P1(严重)→ p1
    • 🟡 P2(重要)→ p2
    • 🔵 P3(锦上添花)→ p3

    示例:042-ready-p1-transaction-boundaries.md

  2. 更新 YAML frontmatter:

    ---
    status: ready # IMPORTANT: Change from "pending" to "ready"
    priority: p1 # or p2, p3 based on severity
    issue_id: "042"
    tags: [category, relevant-tags]
    dependencies: []
    ---
    
  3. 填写或更新文件:

    # [Issue Title]
    
    ## Problem Statement
    [Description from finding]
    
    ## Findings
    - [Key discoveries]
    - Location: [file_path:line_number]
    - [Scenario details]
    
    ## Proposed Solutions
    
    ### Option 1: [Primary solution]
    - **Pros**: [Benefits]
    - **Cons**: [Drawbacks if any]
    - **Effort**: [Small/Medium/Large]
    - **Risk**: [Low/Medium/High]
    
    ## Recommended Action
    [Filled during triage - specific action plan]
    
    ## Technical Details
    - **Affected Files**: [List files]
    - **Related Components**: [Components affected]
    - **Database Changes**: [Yes/No - describe if yes]
    
    ## Resources
    - Original finding: [Source of this issue]
    - Related issues: [If any]
    
    ## Acceptance Criteria
    - [ ] [Specific success criteria]
    - [ ] Tests pass
    - [ ] Code reviewed
    
    ## Work Log
    
    ### {date} - Approved for Work
    **By:** Claude Triage System
    **Actions:**
    - Issue approved during triage session
    - Status changed from pending → ready
    - Ready to be picked up and worked on
    
    **Learnings:**
    - [Context and insights]
    
    ## Notes
    Source: Triage session on {date}
    
  4. 确认批准:“✅ 已批准:{new_filename}(问题 #{issue_id})- 状态:ready → 可以开始处理”

用户回答“next”时:

  • 删除待办文件——从 todos/ 目录中移除,因为它不相关
  • 跳到下一项
  • 在摘要中记录跳过的项目

用户回答“custom”时:

  • 询问要修改的内容(优先级、描述、详情)
  • 更新信息
  • 展示修改后的版本
  • 再次询问:yes/next/custom
步骤 3:继续处理,直到全部完成
  • 逐项处理所有项目
  • 使用 TodoWrite 跟踪进度,以便查看
  • 不要在项目之间等待批准——继续处理
步骤 4:最终摘要

所有项目处理完毕后:

## Triage Complete

**Total Items:** [X] **Todos Approved (ready):** [Y] **Skipped:** [Z]

### Approved Todos (Ready for Work):

- `042-ready-p1-transaction-boundaries.md` - Transaction boundary issue
- `043-ready-p2-cache-optimization.md` - Cache performance improvement ...

### Skipped Items (Deleted):

- Item #5: [reason] - Removed from todos/
- Item #12: [reason] - Removed from todos/

### Summary of Changes Made:

During triage, the following status updates occurred:

- **Pending → Ready:** Filenames and frontmatter updated to reflect approved status
- **Deleted:** Todo files for skipped findings removed from todos/ directory
- Each approved file now has `status: ready` in YAML frontmatter

### Next Steps:

1. View approved todos ready for work:
   ```bash
   ls todos/*-ready-*.md
   ```
  1. 开始处理已批准的项目:

    /resolve-todo-parallel  # Work on multiple approved items efficiently
    
  2. 或选择单个项目进行处理

  3. 处理过程中更新待办状态:

    • Ready → In Progress(在处理过程中于本地上下文中更新)
    • In Progress → Complete(重命名文件:将 ready 改为 complete,并更新 frontmatter)

## Example Response Format


问题 #5:多步骤操作缺少事务边界

严重程度:🔴 P1(严重)

类别:数据完整性 / 安全

描述:GoogleOauthCallbacks concern 中的 google_oauth2_connected 回调执行了多项数据库操作,但没有事务保护。如果中途某个步骤失败,数据库将处于不一致状态。

位置:app/controllers/concerns/google_oauth_callbacks.rb:13-50

问题场景:

  1. User.update 成功(电子邮件已更改)
  2. Account.save! 失败(验证错误)
  3. 结果:User 的电子邮件已更改,但没有关联的 Account
  4. 下次登录尝试会完全失败

未使用事务的操作:

  • 用户确认(第 13 行)
  • 从候补名单中移除(第 14 行)
  • 更新用户资料(第 21-23 行)
  • 创建 Account(第 28-37 行)
  • 附加头像(第 39-45 行)
  • 创建 Journey(第 47 行)

建议的解决方案:将所有操作封装在 ApplicationRecord.transaction do ... end 块中

预估工作量:少量(30 分钟)


要将此项添加到待办列表吗?

  1. yes - 创建待办文件
  2. next - 跳过此项
  3. custom - 修改后再创建

## Important Implementation Details

### Status Transitions During Triage

**When "yes" is selected:**
1. Rename file: `{id}-pending-{priority}-{desc}.md` → `{id}-ready-{priority}-{desc}.md`
2. Update YAML frontmatter: `status: pending` → `status: ready`
3. Update Work Log with triage approval entry
4. Confirm: "✅ Approved: `{filename}` (Issue #{issue_id}) - Status: **ready**"

**When "next" is selected:**
1. Delete the todo file from todos/ directory
2. Skip to next item
3. No file remains in the system

### Progress Tracking

Every time you present a todo as a header, include:
- **Progress:** X/Y completed (e.g., "3/10 completed")
- **Estimated time remaining:** Based on how quickly you're progressing
- **Pacing:** Monitor time per finding and adjust estimate accordingly

Example:

进度:已完成 3/10 | 预计剩余时间:约 2 分钟


### Do Not Code During Triage

- ✅ Present findings
- ✅ Make yes/next/custom decisions
- ✅ Update todo files (rename, frontmatter, work log)
- ❌ Do NOT implement fixes or write code
- ❌ Do NOT add detailed implementation details
- ❌ That's for /resolve-todo-parallel phase

完成后提供以下选项

What would you like to do next?

1. run /resolve-todo-parallel to resolve the todos
2. commit the todos
3. nothing, go chill

评论

支持 Markdown