Communitygithub.com

問題分類與修復規劃

針對回報的錯誤或問題,深入探索程式碼庫以找出根本原因,然後建立一個包含 TDD 修復計畫的 GitHub Issue。當使用者回報錯誤、想要提交 Issue、提到「triage」、或想要調查並規劃問題修復時使用。

問題分類與修復規劃 是什麼?

此技能旨在自動化錯誤問題的分類與修復規劃流程。當使用者回報一個問題時,它會先依循最小打擾原則,僅詢問一個簡短的問題來獲取問題描述。接著,它會使用探索子代理深入分析程式碼庫,定位錯誤發生的位置、追蹤相關的程式碼路徑、診斷根本原因,並評估現有測試覆蓋率。基於調查結果,它會設計一個具體、可執行的 TDD (測試驅動開發) 修復計畫,以「紅-綠」循環為單位,每個循環包含一個測試案例與讓它通過的最小程式碼變更。最後,它會自動使用 `gh issue create` 指令在 GitHub 上建立一個結構化的 Issue,其中包含問題描述、根本原因分析、以及完整的 TDD 修復計畫與驗收標準。此技能支援 GitHub 平台,特別適合與命令列工具整合的 AI Agent(如 Claude Code),能顯著提升開發團隊處理錯誤的效率與規範性。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/cdcoonce/Portfolio_Website/tree/HEAD/.claude/skills/triage-issue

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

問題分類

調查回報的問題,找出其根本原因,並建立一個包含 TDD 修復計畫的 GitHub Issue。這是一個盡量減少人工干預的工作流程 - 將對使用者的提問降到最低。

流程

1. 捕捉問題

從使用者那裡獲取問題的簡短描述。如果使用者尚未提供,請只問一個問題:「您遇到的問題是什麼?」

請勿再追問。立即開始調查。

2. 探索與診斷

使用子代理類型為 Explore 的 Agent 工具來深入探索程式碼庫。你的目標是找出:

  • 錯誤在哪裡表現出來(進入點、UI、API 回應)
  • 涉及了哪些程式碼路徑(追蹤流程)
  • 為什麼它會失敗(根本原因,而非症狀)
  • 有哪些相關的程式碼存在(相似模式、測試、相鄰模組)

查看:

  • 相關的原始檔案及其依賴項目
  • 現有的測試(測試了什麼、缺少什麼)
  • 受影響檔案最近的變更(在相關檔案上執行 git log)
  • 程式碼路徑中的錯誤處理
  • 程式碼庫中其他地方能正常運作的相似模式

3. 確定修復方法

根據你的調查結果,決定:

  • 修復根本原因所需的最小變更
  • 哪些模組/介面會受到影響
  • 哪些行為需要透過測試來驗證
  • 這個問題是回歸錯誤、缺少功能、還是設計缺陷

4. 設計 TDD 修復計畫

建立一個具體、有序的「紅-綠」循環列表。每個循環都是一個垂直切片:

  • RED:描述一個能捕捉到損壞/缺失行為的特定測試
  • GREEN:描述讓該測試通過所需的最小程式碼變更

規則:

  • 測試應透過公開介面驗證行為,而非實作細節
  • 一次只進行一個測試,採垂直切片方式(不要先寫所有測試,再寫所有程式碼)
  • 每個測試都應能承受內部的重構
  • 如有需要,在最後包含一個重構步驟
  • 穩定性:僅建議那些能夠承受劇烈程式碼庫變更的修復方案。描述行為與合約,而非內部結構。測試應斷言可觀察的結果(API 回應、UI 狀態、使用者可見的效果),而非內部狀態。好的建議讀起來像一份規格書;差的建議讀起來像一個差異比較。

5. 建立 GitHub Issue

使用 gh issue create 指令並搭配下方的範本建立 GitHub Issue。不要要求使用者先審閱再建立 - 直接建立並分享 URL。

問題

問題的清晰描述,包含:

  • 實際發生的狀況(實際行為)
  • 應該發生的狀況(預期行為)
  • 如何重現(如果適用)

根本原因分析

描述你在調查過程中的發現:

  • 涉及的程式碼路徑
  • 目前程式碼失敗的原因
  • 任何促成因素

請勿包含與目前程式碼佈局耦合的特定檔案路徑、行號或實作細節。請改為描述模組、行為與合約。即使經過重大重構,這個 Issue 仍應保持其適用性。

TDD 修復計畫

一個編號的「紅-綠」循環列表:

  1. RED:撰寫一個測試,用來[描述預期行為] GREEN:[讓測試通過的最小變更]

  2. RED:撰寫一個測試,用來[描述下一個行為] GREEN:[讓測試通過的最小變更]

...

REFACTOR:[所有測試都通過後所需的任何清理工作]

驗收標準

  • 標準 1
  • 標準 2
  • 所有新測試通過
  • 現有測試仍能通過

建立 Issue 後,請列印 Issue URL 與一行根本原因摘要。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

cdcoonce/Portfolio_Website

Git commit workflow with enforced conventional commit style. Use when Claude needs to stage and commit changes, craft commit messages, or the user asks to commit, make a commit, or save their work. Ensures consistent commit message format, proper scoping, and atomic commits across the project.

cdcoonce/Portfolio_Website

AI-powered code quality analysis for Python, Markdown, and Mermaid diagrams. Use this skill when: (1) reviewing code for quality issues, (2) checking Python files for PEP8 violations, unused code, missing type hints, docstring problems, complexity issues, or potential runtime errors, (3) validating Markdown documentation for broken links, heading structure, or formatting issues, (4) validating Mermaid diagram syntax, (5) the user asks for a "code review" or "quality check", (6) analyzing code snippets pasted in conversation, or (7) suggesting and applying fixes for code quality issues.

cdcoonce/Portfolio_Website

Deploy the portfolio chat agent Lambda function to AWS. Use when the user asks to deploy, redeploy, push to Lambda, update the chat agent, or after updating context files or lambda_function.py. Rebuilds the knowledge base, packages dependencies, and deploys to AWS Lambda.

cdcoonce/Portfolio_Website

Generate multiple radically different interface designs for a module using parallel sub-agents. Use when user wants to design an API, explore interface options, compare module shapes, or mentions "design it twice".

cdcoonce/Portfolio_Website

Orchestrate the full GitHub-issues-driven development lifecycle. 7-phase pipeline from brainstorm through PR with state tracking and cross-conversation resume. Use when user says "dev cycle", "development workflow", "full development pipeline", or invokes /dev-cycle.

cdcoonce/Portfolio_Website

Production Python coding standards with automatic version detection (3.10-3.13). Use when writing, reviewing, or refactoring Python to ensure adherence to modern type syntax, LBYL exception handling, pathlib operations, ABC-based interfaces, and production-tested patterns. Not Dagster-specific - applies to any Python project.

cdcoonce/Portfolio_Website

Set up Claude Code hooks to block dangerous git commands (push, reset --hard, clean, branch -D, etc.) before they execute. Use when user wants to prevent destructive git operations, add git safety hooks, or block git push/reset in Claude Code.

cdcoonce/Portfolio_Website

GitHub CLI (gh) integration for managing issues, pull requests, branches,

cdcoonce/Portfolio_Website

Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree. Use when user wants to stress-test a plan, get grilled on their design, or mentions "grill me".

cdcoonce/Portfolio_Website

Explore a codebase to find opportunities for architectural improvement, focusing on making the codebase more testable by deepening shallow modules. Use when user wants to improve architecture, find refactoring opportunities, consolidate tightly-coupled modules, or make a codebase more AI-navigable.

cdcoonce/Portfolio_Website

CEO/founder-mode plan review. Rethink the problem, find the 10-star product, challenge premises, expand scope when it creates a better product. Three modes: SCOPE EXPANSION (dream big), HOLD SCOPE (maximum rigor), SCOPE REDUCTION (strip to essentials). Use when the user asks for a plan review, CEO review, mega review, or wants a plan challenged/stress-tested before implementation.

cdcoonce/Portfolio_Website

Break a PRD into independently-grabbable GitHub issues using tracer-bullet vertical slices. Use when user wants to convert a PRD to issues, create implementation tickets, or break down a PRD into work items.

cdcoonce/Portfolio_Website

Turn a PRD into a multi-phase implementation plan using tracer-bullet vertical slices, saved as a local Markdown file in docs/plans/. Use when user wants to break down a PRD, create an implementation plan, plan phases from a PRD, or mentions "tracer bullets".

cdcoonce/Portfolio_Website

Generate or update the `.claude/docs/project.md` file that gives Claude project-specific context. Use this skill when the user asks to create, update, regenerate, or refresh project context, or says things like "update project.md", "generate project context", "this repo needs a project.md", or "Claude doesn't know about this project". Also trigger when onboarding Claude to a new repository for the first time.

cdcoonce/Portfolio_Website

Generate comprehensive, high-quality README.md files for code repositories. Use this skill whenever the user asks to create, write, generate, update, or improve a README for any project or repository. Also trigger when the user says things like "document this project", "write docs for this repo", "this repo needs a README", "help me onboard developers to this codebase", or asks for project documentation in markdown. Even if the user just says "README" or "readme" in the context of a codebase, use this skill.

cdcoonce/Portfolio_Website

Create a detailed refactor plan with tiny commits via user interview, then file it as a GitHub issue. Use when user wants to plan a refactor, create a refactoring RFC, or break a refactor into safe incremental steps.

cdcoonce/Portfolio_Website

Set up pre-commit hooks for the current repo. Use when user wants to add pre-commit hooks, configure commit-time linting, formatting, type checking, or testing. Triggers on "pre-commit", "git hooks", "linting hooks", or /setup-pre-commit.

cdcoonce/Portfolio_Website

Test-driven development with red-green-refactor loop. Use when user wants to build features or fix bugs using TDD, mentions "red-green-refactor", wants integration tests, or asks for test-first development.

cdcoonce/Portfolio_Website

Rewrites the prose sections of wiki pages in-place. Reads source files to understand current context, then updates only the content inside <!-- claude:prose --> ... <!-- claude:prose:end --> markers. Never touches <!-- generated:start --> ... <!-- generated:end --> blocks. Supports targeting a single page with /update-wiki {PageName}.

cdcoonce/Portfolio_Website

Create a PRD through user interview, codebase exploration, and module design, then submit as a GitHub issue. Use when user wants to write a PRD, create a product requirements document, or plan a new feature.

相關技能