skills/error-pattern/SKILL.md
錯誤模式知識庫管理工具。Use for: (1) 查詢既有錯誤經驗和防護措施 (query), (2) 記錄新發現的錯誤模式和教訓 (add), (3) Ticket 開始前查詢歷史問題避免再犯, (4) 系統化管理錯誤學習經驗。Use when: user mentions error pattern, 錯誤模式, 教訓, 經驗記錄, 學習經驗, 防護措施, 錯誤紀錄, or needs to avoid recurring issues.
npx skillsauth add tarrragon/claude error-patternInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
錯誤模式知識庫管理工具。查詢既有錯誤經驗,記錄新發現的錯誤模式。
/error-pattern query <關鍵字>查詢既有錯誤模式經驗。
使用時機:每個 Ticket 開始前
執行流程:
.claude/error-patterns/ 目錄下所有 .md 檔案輸出格式:
找到 N 個相關錯誤模式:
1. [編號] 錯誤名稱
- 症狀:簡短描述
- 解決方案:簡短描述
- 相關 Ticket:TICKET-XXX
(無匹配時)
未找到相關錯誤模式。這可能是新發現的問題,請使用 /error-pattern add 記錄。
/error-pattern add互動式記錄新發現的錯誤模式。
使用時機:發現新問題時
執行流程:
選擇錯誤類別
輸入症狀描述
分析根因
記錄解決方案
提出預防措施
關聯 Ticket
自動分配來源前綴 ID(跨專案共享框架必用)
<CATEGORY>-<PROJ>-NNN:
import sys; sys.path.insert(0, ".claude/skills/error-pattern/lib")
from allocator import identify_project_code, allocate_pattern_id
proj = identify_project_code(
".claude/error-patterns/_project-registry.yaml",
"<git toplevel>", # git rev-parse --show-toplevel
)
pattern_id = allocate_pattern_id("<CATEGORY>", ".claude", proj)
<CATEGORY>-NNN(凍結 base 不再新增,見編號章節)。輸出:
<CATEGORY>-<PROJ>-NNN-<slug>.md 命名新增錯誤記錄/error-pattern list列出所有已記錄的錯誤模式。
輸出格式:
錯誤模式知識庫統計:
DI 註冊 (3)
├─ [DI-001] 服務未註冊到 ServiceLocator
├─ [DI-002] 依賴服務尚未初始化
└─ [DI-003] 循環依賴
Widget Finder (2)
├─ [WF-001] 多重匹配
└─ [WF-002] 找不到元素
...
| 類別目錄 | 前綴 | 凍結 base 範例 | |---------|------|---------------| | architecture | ARCH | ARCH-001 | | code-quality | CQ | CQ-001 | | documentation | DOC | DOC-001 | | implementation | IMP | IMP-001 | | process | PROC | PROC-001 | | process-compliance | PC | PC-001 | | test | TEST | TEST-001 |
本框架透過共享 repo 同步至多個專案。為防多專案併發分配同號碰撞,新增任何 category 的 error-pattern 一律使用來源前綴格式:
<CATEGORY>-<PROJ>-NNN 例:PC-V1-001、IMP-APP-003、ARCH-SCLK-002
<CATEGORY>-NNN 為凍結 canonical base,原樣保留、不再新增 flat 號。<PROJ> 取自 .claude/error-patterns/_project-registry.yaml(tooling 以 git
toplevel basename 對應 dir 欄自動取得)。.claude/methodologies/error-pattern-numbering-methodology.md。單一專案使用本框架時:無碰撞風險,可沿用 flat
<CATEGORY>-NNN。來源前綴僅在 多專案共享同步情境強制。
在 Ticket 中加入:
## 參考既有錯誤模式
<!-- 執行 /error-pattern query 後填寫 -->
- [ ] 已查詢既有模式
- 匹配模式:[編號] 或「無匹配 - 新發現模式」
在工作日誌中記錄:
## 錯誤模式學習
- 發現新模式:[編號] 錯誤名稱
- 參考既有模式:[編號] 錯誤名稱
| 檔案 | 用途 |
|------|------|
| .claude/error-patterns/README.md | 知識庫索引 |
| .claude/error-patterns/{category}/*.md | 各分類錯誤模式檔案 |
Last Updated: 2026-03-02 Version: 1.0.0
development
Use when the user wants to design, redesign, shape, critique, audit, polish, clarify, distill, harden, optimize, adapt, animate, colorize, extract, or otherwise improve a frontend interface. Covers websites, landing pages, dashboards, product UI, app shells, components, forms, settings, onboarding, and empty states. Handles UX review, visual hierarchy, information architecture, cognitive load, accessibility, performance, responsive behavior, theming, anti-patterns, typography, fonts, spacing, layout, alignment, color, motion, micro-interactions, UX copy, error states, edge cases, i18n, and reusable design systems or tokens. Also use for bland designs that need to become bolder or more delightful, loud designs that should become quieter, live browser iteration on UI elements, or ambitious visual effects that should feel technically extraordinary. Not for backend-only or non-UI tasks.
development
Claude Code release notes 框架影響評估工具。比對 last-reviewed 版本篩出新版本,逐項分類(對框架有幫助 / 需評估 / 無影響 / 不適用),對採用項引導建 ANA + WRAP + spawn 落地。Use when: 執行 /release-notes 看到新版本、定期檢查 CC 更新、評估新功能對專案框架的影響時。Triggers: release notes, release-notes, CC 更新, claude code 更新, 版本更新評估, 新功能評估, 框架影響評估。
development
Assertion design judgment framework for flaky and design-quality issues. Use when writing tests, reviewing assertions, diagnosing flaky tests, or deciding if a timing/float/cache assertion is appropriate. Do NOT use for API syntax or refactoring.
tools
Chrome Extension 實機測試與 debug 工作流,以 chrome-devtools-mcp 為核心工具。Use when: (1) 完成功能後實機驗證 / manual test / 試看看 / 跑看看 / verify feature, (2) extension debug / popup 不作動 / content script 不注入 / service worker 報錯 / background 出問題, (3) 安裝 unpacked extension / load unpacked / 載入未封裝, (4) 看 console / 看 network / 看 log / view console / inspect requests, (5) 功能更新後重新載入 extension / rebuild reload / reload extension。涵蓋 Manifest V3 service worker / content script / popup / options page 的 chrome-devtools-mcp 工具呼叫流程。不取代 Puppeteer / Playwright 自動化 E2E(CI 用),定位為開發期手動驗證與 LLM-assisted debug。