triage について
調査結果を確認し、CLI の todo に追加する項目を決めるトリアージ用スキルです。項目ごとに判断を促し、作業中のコーディングを明確に禁止します。
主な機能
- 01調査結果を順に提示
- 02深刻度とカテゴリを付与
- 03項目の承認・スキップ・修正
- 04todo ファイルの作成・更新
- 05トリアージ結果の要約
活用シーン
- 01コードレビュー指摘の整理
- 02セキュリティ監査結果の処理
- 03パフォーマンス分析の確認
インストール
コマンドをコピーしてターミナルで実行します。
npx skills add https:/ / github.com/ everyinc/ compound-engineering-plugin --skill triageインストール後、Claude Code で/triageを入力して読み込まれたか確認します。
詳細
- まず /model を Haiku に設定します
- 次に、todos/ ディレクトリ内の保留中の todo をすべて読み込みます
ここで、トリアージのために調査結果、判断事項、問題点を1つずつ提示してください。各項目を確認し、CLI の todo システムに追加するかどうかを判断することが目的です。
重要:トリアージ中はコードを一切書かないでください!
このコマンドは、次の用途に使用します。
- コードレビューの指摘事項のトリアージ
- セキュリティ監査結果の処理
- パフォーマンス分析のレビュー
- 追跡が必要な、その他の分類済み調査結果への対応
ワークフロー
ステップ 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」と答えた場合:
-
既存の todo ファイルを更新するか、新しいファイル名を作成します。
todo がすでに存在する場合(コードレビュー由来):
- ファイル名を
{id}-pending-{priority}-{desc}.mdから{id}-ready-{priority}-{desc}.mdに変更します - YAML フロントマターを更新します:
status: pending→status: ready - issue_id、priority、description は変更しません
新しい todo を作成する場合:
{next_id}-ready-{priority}-{brief-description}.md優先度の対応関係:
- 🔴 P1(重大)→
p1 - 🟡 P2(重要)→
p2 - 🔵 P3(あると便利)→
p3
例:
042-ready-p1-transaction-boundaries.md - ファイル名を
-
YAML フロントマターを更新します:
--- status: ready # IMPORTANT: Change from "pending" to "ready" priority: p1 # or p2, p3 based on severity issue_id: "042" tags: [category, relevant-tags] dependencies: [] --- -
ファイルの内容を記入または更新します:
# [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} -
承認を確認します: 「✅ 承認済み:
{new_filename}(Issue #{issue_id})- ステータス:ready → 作業開始準備完了」
ユーザーが「next」と答えた場合:
- todo ファイルを削除します。該当項目は無関係なため、todos/ ディレクトリから削除します
- 次の項目に進みます
- スキップした項目を記録し、最終サマリーに含めます
ユーザーが「custom」と答えた場合:
- 何を変更するか(優先度、説明、詳細)を尋ねます
- 情報を更新します
- 修正版を提示します
- もう一度、yes/next/custom のいずれかを尋ねます
ステップ 3:すべての処理が完了するまで続ける
- すべての項目を1つずつ処理します
- 進捗を確認できるよう、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
```
-
承認された項目の作業を開始します:
/resolve-todo-parallel # Work on multiple approved items efficiently -
または、個別の項目を選んで作業します
-
作業中に todo のステータスを更新します:
- Ready → In Progress(作業中はローカルコンテキスト内で更新)
- In Progress → Complete(ファイル名の ready を complete に変更し、フロントマターを更新)
## Example Response Format
Issue #5:複数ステップの処理にトランザクション境界がない
重大度:🔴 P1(重大)
カテゴリ:データ整合性 / セキュリティ
説明:GoogleOauthCallbacks concern の google_oauth2_connected コールバックでは、複数のデータベース操作がトランザクションで保護されていません。途中でいずれかのステップが失敗すると、データベースが不整合な状態になります。
場所:app/controllers/concerns/google_oauth_callbacks.rb:13-50
問題の発生例:
- User.update が成功する(メールアドレスが変更される)
- Account.save! が失敗する(バリデーションエラー)
- 結果:User のメールアドレスは変更されているが、関連付けられた Account がない
- 次回のログイン試行が完全に失敗する
トランザクションで保護されていない操作:
- User の確認(13行目)
- 待機リストからの削除(14行目)
- ユーザープロフィールの更新(21~23行目)
- Account の作成(28~37行目)
- アバターの添付(39~45行目)
- Journey の作成(47行目)
提案する解決策:すべての操作を ApplicationRecord.transaction do ... end ブロックで囲みます
推定作業時間:少(30分)
これを todo リストに追加しますか?
- yes - todo ファイルを作成する
- next - この項目をスキップする
- 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