From c24f2e00e2552357d7c9c9d1058d3df479af17cc Mon Sep 17 00:00:00 2001 From: Jeffery Date: Wed, 20 May 2026 10:31:59 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=90=8C=E6=AD=A5=E6=89=80=E6=9C=89?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E7=9A=84=E6=8A=80=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .amazonq/rules/triage-findings.md | 1 - .claude/skills/triage-findings/SKILL.md | 42 +++++++++++++++------- .gemini/skills/triage-findings/SKILL.md | 42 +++++++++++++++------- .github/copilot-instructions.md | 2 +- .github/skills/triage-findings/SKILL.md | 47 +++++++++++++++++++------ CLAUDE.md | 2 +- 6 files changed, 97 insertions(+), 39 deletions(-) diff --git a/.amazonq/rules/triage-findings.md b/.amazonq/rules/triage-findings.md index 4b65ce1..b25f7ad 100644 --- a/.amazonq/rules/triage-findings.md +++ b/.amazonq/rules/triage-findings.md @@ -11,4 +11,3 @@ When the task is to triage review findings, follow this workflow: 7. Add or update tests when behavior changes. 8. Re-check the issue after each fix. -Use the repo-local `triage-findings` skill for the same workflow when running in Codex. diff --git a/.claude/skills/triage-findings/SKILL.md b/.claude/skills/triage-findings/SKILL.md index 2bfa16f..2422e52 100644 --- a/.claude/skills/triage-findings/SKILL.md +++ b/.claude/skills/triage-findings/SKILL.md @@ -1,30 +1,46 @@ --- name: triage-findings -description: Triage findings, fix real issues, and exclude false positives. +description: Merge code-review findings, sort and renumber them by severity, resolve real issues, and move false positives into exclusions. --- # Triage Findings -## Use +## When To Use -直接輸入:`triage-findings 問題原始檔(文字或截圖)` +Use this skill when you receive multiple review findings, screenshots, comments, or issue lists that need to become one final triaged list. +It is also used when some findings are false positives and should be moved into the exclusions list. ## Workflow -1. Merge all findings. -2. Sort by severity: +1. Collect all findings into one list. +2. Merge duplicates into a single finding when they describe the same issue. +3. Sort the final list by severity: - critical - warning - info -3. Renumber from 1. -4. Fix real issues. -5. Put false positives into `.gitea/ai-review/exclusions.json` as a top-level JSON array, preserving the original wording, language, and semantics as much as possible. Do not wrap the array in `exclusions` or `excluded_findings`. -6. Add tests when behavior changes. +4. Renumber the sorted list from 1 upward. +5. Rewrite each finding concisely so the final list reads cleanly and consistently. +6. If a finding is a false positive, do not keep it in the final list. +7. Add false positives to the exclusions list as a top-level JSON array in `.gitea/ai-review/exclusions.json`, and preserve the original finding wording as much as possible, including language and semantics. Do not wrap the array in `exclusions` or `excluded_findings`. + +## Resolution Flow + +After the list is merged and ordered, resolve the remaining findings one by one. + +1. Start from the highest severity item. +2. Identify the root cause in the relevant file or context. +3. Apply the smallest safe change that fixes the issue. +4. Add or update tests when behavior changes. +5. Re-check the issue after the change. +6. If the item is confirmed false positive, move it to exclusions instead of changing code. +7. Continue until the list is either fixed or explicitly excluded. ## Output Rules -- Keep the final list short. -- Keep numbering contiguous. -- Preserve file path, location, and fix. +- Keep the final findings list in severity order, then by any stable secondary order needed to make it readable. +- Keep numbering contiguous after filtering and merging. +- Preserve useful details like file path, location, and suggested fix. +- Keep exclusions entries minimal and consistent with the project schema. - When writing exclusions, always output a top-level JSON array. -- When writing exclusions, prefer the original issue text over paraphrased rewrites. +- When writing exclusions, prefer the original issue text and language; only paraphrase if needed to fit the schema. +- If the source already provides a severity or title, keep it unless it conflicts with the final ordering. diff --git a/.gemini/skills/triage-findings/SKILL.md b/.gemini/skills/triage-findings/SKILL.md index 2bfa16f..2422e52 100644 --- a/.gemini/skills/triage-findings/SKILL.md +++ b/.gemini/skills/triage-findings/SKILL.md @@ -1,30 +1,46 @@ --- name: triage-findings -description: Triage findings, fix real issues, and exclude false positives. +description: Merge code-review findings, sort and renumber them by severity, resolve real issues, and move false positives into exclusions. --- # Triage Findings -## Use +## When To Use -直接輸入:`triage-findings 問題原始檔(文字或截圖)` +Use this skill when you receive multiple review findings, screenshots, comments, or issue lists that need to become one final triaged list. +It is also used when some findings are false positives and should be moved into the exclusions list. ## Workflow -1. Merge all findings. -2. Sort by severity: +1. Collect all findings into one list. +2. Merge duplicates into a single finding when they describe the same issue. +3. Sort the final list by severity: - critical - warning - info -3. Renumber from 1. -4. Fix real issues. -5. Put false positives into `.gitea/ai-review/exclusions.json` as a top-level JSON array, preserving the original wording, language, and semantics as much as possible. Do not wrap the array in `exclusions` or `excluded_findings`. -6. Add tests when behavior changes. +4. Renumber the sorted list from 1 upward. +5. Rewrite each finding concisely so the final list reads cleanly and consistently. +6. If a finding is a false positive, do not keep it in the final list. +7. Add false positives to the exclusions list as a top-level JSON array in `.gitea/ai-review/exclusions.json`, and preserve the original finding wording as much as possible, including language and semantics. Do not wrap the array in `exclusions` or `excluded_findings`. + +## Resolution Flow + +After the list is merged and ordered, resolve the remaining findings one by one. + +1. Start from the highest severity item. +2. Identify the root cause in the relevant file or context. +3. Apply the smallest safe change that fixes the issue. +4. Add or update tests when behavior changes. +5. Re-check the issue after the change. +6. If the item is confirmed false positive, move it to exclusions instead of changing code. +7. Continue until the list is either fixed or explicitly excluded. ## Output Rules -- Keep the final list short. -- Keep numbering contiguous. -- Preserve file path, location, and fix. +- Keep the final findings list in severity order, then by any stable secondary order needed to make it readable. +- Keep numbering contiguous after filtering and merging. +- Preserve useful details like file path, location, and suggested fix. +- Keep exclusions entries minimal and consistent with the project schema. - When writing exclusions, always output a top-level JSON array. -- When writing exclusions, prefer the original issue text over paraphrased rewrites. +- When writing exclusions, prefer the original issue text and language; only paraphrase if needed to fit the schema. +- If the source already provides a severity or title, keep it unless it conflicts with the final ordering. diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index f1a77ef..ca2d3a9 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -11,4 +11,4 @@ Use the triage-finding workflow for review issue lists: 7. Add or update tests when behavior changes. 8. Re-check after each fix. -The full reusable skill lives in `.claude/skills/triage-findings/SKILL.md`. +The full reusable skill lives in `.github/skills/triage-findings/SKILL.md`. diff --git a/.github/skills/triage-findings/SKILL.md b/.github/skills/triage-findings/SKILL.md index 42932fc..d747008 100644 --- a/.github/skills/triage-findings/SKILL.md +++ b/.github/skills/triage-findings/SKILL.md @@ -1,14 +1,41 @@ # Triage Findings -Use the triage-finding workflow for review issue lists: +## When To Use -1. Merge findings into one list. -2. Remove duplicates. -3. Sort by severity: `critical` -> `warning` -> `info`. -4. Renumber from 1. -5. Fix real issues with the smallest safe change. -6. Put false positives into `.gitea/ai-review/exclusions.json` as a top-level JSON array, preserving the original wording, language, and semantics as much as possible. Do not wrap the array in `exclusions` or `excluded_findings`. -7. Add or update tests when behavior changes. -8. Re-check after each fix. +Use this skill when you receive multiple review findings, screenshots, comments, or issue lists that need to become one final triaged list. +It is also used when some findings are false positives and should be moved into the exclusions list. -The reusable skill lives in `.gemini/skills/triage-findings/SKILL.md`. +## Workflow + +1. Collect all findings into one list. +2. Merge duplicates into a single finding when they describe the same issue. +3. Sort the final list by severity: + - critical + - warning + - info +4. Renumber the sorted list from 1 upward. +5. Rewrite each finding concisely so the final list reads cleanly and consistently. +6. If a finding is a false positive, do not keep it in the final list. +7. Add false positives to the exclusions list as a top-level JSON array in `.gitea/ai-review/exclusions.json`, and preserve the original finding wording as much as possible, including language and semantics. Do not wrap the array in `exclusions` or `excluded_findings`. + +## Resolution Flow + +After the list is merged and ordered, resolve the remaining findings one by one. + +1. Start from the highest severity item. +2. Identify the root cause in the relevant file or context. +3. Apply the smallest safe change that fixes the issue. +4. Add or update tests when behavior changes. +5. Re-check the issue after the change. +6. If the item is confirmed false positive, move it to exclusions instead of changing code. +7. Continue until the list is either fixed or explicitly excluded. + +## Output Rules + +- Keep the final findings list in severity order, then by any stable secondary order needed to make it readable. +- Keep numbering contiguous after filtering and merging. +- Preserve useful details like file path, location, and suggested fix. +- Keep exclusions entries minimal and consistent with the project schema. +- When writing exclusions, always output a top-level JSON array. +- When writing exclusions, prefer the original issue text and language; only paraphrase if needed to fit the schema. +- If the source already provides a severity or title, keep it unless it conflicts with the final ordering. diff --git a/CLAUDE.md b/CLAUDE.md index fa2403d..e1c3938 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -11,6 +11,6 @@ When the task is to triage review findings, follow this workflow: 7. Add or update tests when behavior changes. 8. Re-check the issue after each fix. -Use the repo-local `triage-findings` skill for the same workflow when running in Codex. +Use the repo-local `triage-findings` skill for the same workflow when running in Claude. Trigger it with `/triage-findings`.