From bug-workflow
After bug fix commit, extracts details from Git diff, updates Notion task tracker page with root cause analysis and changes, syncs summary to bug knowledge base. Triggers on keywords like 'bug-close'.
npx claudepluginhub mark22013333/crew --plugin bug-workflowThis skill uses the workspace's default tool permissions.
修復 Bug 並 commit 後,從 Git 自動擷取修改資訊,更新 Notion「任務追蹤工具」的 Bug 頁面,並在「Bug 知識庫」同步建立精簡條目。
Fixes GitHub issues by number. Fetches details via gh CLI, classifies type/severity/complexity, tracks state in SQLite DB, and implements fixes autonomously.
Automates bug fixes and small code changes autonomously from invocation to merged PR. No questions gate, spec generation, or planning—for quick, well-defined updates in 1-3 files.
Generates short Jira comments from git commits summarizing shipped features or bug fixes with root cause analysis. Fetches issue details via Atlassian MCP and saves as local markdown report.
Share bugs, ideas, or general feedback.
修復 Bug 並 commit 後,從 Git 自動擷取修改資訊,更新 Notion「任務追蹤工具」的 Bug 頁面,並在「Bug 知識庫」同步建立精簡條目。
執行前依序檢查以下路徑,讀取第一個找到的設定檔:
~/.claude-company/bug-workflow-config.md(公司環境)~/.claude/bug-workflow-config.md(個人環境)若都不存在,提示使用者先執行 /bug-setup。
/bug-start 建立 Bug 條目(Notion「任務追蹤工具」中有狀態為「進行中」的 🐞 錯誤條目)前置檢查:參照
references/prerequisites.md執行完整前置檢查(CLAUDE.md + 設定檔 + 專案註冊)。
依序執行以下指令:
# 當前分支
git branch --show-current
# 最近 10 筆 commit(供使用者選擇範圍)
git log --oneline -10
# 預設取最近 1 個 commit 的變更
git diff HEAD~1..HEAD --stat
# 完整 diff(用於摘要化)
git diff HEAD~1..HEAD
若使用者指定 commit 範圍(如 HEAD~3..HEAD),使用指定的範圍。
搜尋 Notion「任務追蹤工具」(Data Source ID 見設定檔)中符合條件的條目:
使用 notion-search 搜尋:
同時取得 Git Repo 識別碼(從 git remote get-url origin 解析),用於輔助篩選同一專案下的 Bug。
優先匹配邏輯:
/bug-start 建立詢問使用者(若未在初始輸入中提供):
邏輯錯誤 / 資料異常 / 設定問題 / 第三方API / 效能 / 權限 / 前端UI測試中(預設)或 已完成根據 git diff 自動產出以下內容:
修改檔案清單:從 --stat 擷取,格式化為列表
修改說明:根據 diff 內容,以分層架構摘要(如 Java 專案的 Controller / Service / DAO 層)
修改後程式碼:擷取關鍵的程式碼變更片段(不超過 50 行)
使用 notion-update-page 更新條目:
Properties 更新:
| 欄位 | 值 |
|---|---|
| 狀態 | 使用者選擇(預設「測試中」) |
| 根因分類 | 使用者選擇的分類 |
| 修復分支 | 當前 Git branch(若原本為空) |
Content 更新:
使用 update_content 指令,搜尋模板中的空白區塊並填入:
「根因分析」區塊:
「修復方案」區塊:
在「Bug 知識庫」資料庫建立一筆精簡條目(Data Source ID 見設定檔):
| 欄位 | 值 |
|---|---|
| Name | Bug 標題 |
| Tags | 根據 bug 內容自動推測相關標籤 |
| 難易度 | 根據修改檔案數和 diff 行數判斷:≤3 檔案且 ≤50 行 → 普通(2~4h),否則 → 困難(4~6h) |
| 專案資料庫 | 同一專案 |
| 參考連結 | 任務追蹤工具的頁面 URL |
頁面內容為精簡版:
**根因**:{根因說明}
**解法**:{修復摘要,2-3 句話}
**關鍵程式碼**:
(修改前後的關鍵差異)
若設定檔中「Bug 知識庫」ID 為空,則跳過此步驟。
向使用者回傳:
Bug 已結案!後續事項:
• 驗證完成後請在 Notion 頁面勾選驗證項目
• 若上線後問題復發,可使用 /bug-update reopen 重新開啟
update_content 的搜尋模式會匹配失敗。遇到這種情況,改用 replace_content 重寫整個頁面內容(先讀取現有內容合併)。git diff 遇到圖片、Excel 等二進位檔案會顯示 Binary files differ,不要把這些納入「修改後程式碼」區塊。只擷取文字類檔案的 diff。git log --oneline -10 中混有非修復用途的 commit,應先確認正確範圍再擷取 diff,不要盲目用 HEAD~1..HEAD。參考 examples/good-closure-report.md 了解理想的結案報告結構和品質。
/bug-setup 完成初始設定replace_content 而非 update_content,先保留原有內容再附加修復資訊