trellis-break-loop
它能做什么
该技能分析你刚修复的错误,记录其成因以及如何防止再次发生。适合不断修复同类错误的开发者。
适用场景
- ✓当你刚修复了一个错误,并希望阻止同类错误再次出现的时候。
- ✓当在找到正确的修复之前已经失败了几次的时候。
- ✓当你希望把错误中的经验保存到项目指南中的时候。
技能链接
https://github.com/mindfold-ai/Trellis/blob/main/.agents/skills/trellis-break-loop/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我们刚修复了时间戳错误。请分析它为何会发生,并保存一条经验,防止它再次出现。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会把错误归入一个类别,例如缺失的规格或隐含的假设,审阅先前修复为何失败,并提出预防步骤。然后它会把经验记录到项目的规格文件中。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Break the Loop - Deep Bug Analysis
When debug is complete, use this for deep analysis to break the "fix bug -> forget -> repeat" cycle.
Analysis Framework
Analyze the bug you just fixed from these 5 dimensions:
1. Root Cause Category
Which category does this bug belong to?
| Category | Characteristics | Example |
|---|---|---|
| A. Missing Spec | No documentation on how to do it | New feature without checklist |
| B. Cross-Layer Contract | Interface between layers unclear | API returns different format than expected |
| C. Change Propagation Failure | Changed one place, missed others | Changed function signature, missed call sites |
| D. Test Coverage Gap | Unit test passes, integration fails | Works alone, breaks when combined |
| E. Implicit Assumption | Code relies on undocumented assumption | Timestamp seconds vs milliseconds |
2. Why Fixes Failed (if applicable)
If you tried multiple fixes before succeeding, analyze each failure:
- Surface Fix: Fixed symptom, not root cause
- Incomplete Scope: Found root cause, didn't cover all cases
- Tool Limitation: grep missed it, type check wasn't strict
- Mental Model: Kept looking in same layer, didn't think cross-layer
3. Prevention Mechanisms
What mechanisms would prevent this from happening again?
| Type | Description | Example |
|---|---|---|
| Documentation | Write it down so people know | Update thinking guide |
| Architecture | Make the error impossible structurally | Type-safe wrappers |
| Compile-time | Strict type checking, no escape hatches | Signature change causes compile error |
| Runtime | Monitoring, alerts, scans | Detect orphan entities |
| Test Coverage | E2E tests, integration tests | Verify full flow |
| Code Review | Checklist, PR template | "Did you check X?" |
4. Systematic Expansion
What broader problems does this bug reveal?
- Similar Issues: Where else might this problem exist?
- Design Flaw: Is there a fundamental architecture issue?
- Process Flaw: Is there a development process improvement?
- Knowledge Gap: Is the team missing some understanding?
5. Knowledge Capture
Solidify insights into the system:
- Update
.trellis/spec/guides/thinking guides - Update relevant
.trellis/spec/docs - Create issue record (if applicable)
- Create feature ticket for root fix
- Update check guidelines if needed
Output Format
Please output analysis in this format:
## Bug Analysis: [Short Description]
### 1. Root Cause Category
- **Category**: [A/B/C/D/E] - [Category Name]
- **Specific Cause**: [Detailed description]
### 2. Why Fixes Failed (if applicable)
1. [First attempt]: [Why it failed]
2. [Second attempt]: [Why it failed]
...
### 3. Prevention Mechanisms
| Priority | Mechanism | Specific Action | Status |
|----------|-----------|-----------------|--------|
| P0 | ... | ... | TODO/DONE |
### 4. Systematic Expansion
- **Similar Issues**: [List places with similar problems]
- **Design Improvement**: [Architecture-level suggestions]
- **Process Improvement**: [Development process suggestions]
### 5. Knowledge Capture
- [ ] [Documents to update / tickets to create]
Core Philosophy
The value of debugging is not in fixing the bug, but in making this class of bugs never happen again.
Three levels of insight:
- Tactical: How to fix THIS bug
- Strategic: How to prevent THIS CLASS of bugs
- Philosophical: How to expand thinking patterns
30 minutes of analysis saves 30 hours of future debugging.
Thinking Framework: Bayesian Reasoning
When multiple root causes are plausible and evidence is incomplete, update your beliefs proportionally to new evidence rather than clinging to initial assumptions.
Step 1: Establish Priors
Before investigating, state what you believe and why:
| Hypothesis | Prior | Reasoning |
|---|---|---|
| H1: [cause A] | 40% | Most common for this pattern |
| H2: [cause B] | 30% | Plausible given environment |
| H3: [other] | 30% | Catch-all |
Priors must sum to 100%. If you can't assign probabilities, investigate first.
Step 2: Observe Evidence
Document what you found — be specific about reliability:
- What exactly did you observe?
- How reliable? (test output > log message > user report > hunch)
- Could multiple hypotheses explain this?
Step 3: Updat
常见问题
它把错误的成因分成哪些类型?
例如缺失的规格、各层之间不清楚的约定、某处遗漏的改动、测试缺口,或未明说的假设。
经验记录在哪里?
记录在相关的项目规格文件中,以便未来的会话使用。
为什么要审视先前修复为何失败?
只处理了表面症状的修复,说明真正的成因是在哪里被忽略的。
详情
作者的原始描述
Deep bug analysis to break the fix-forget-repeat cycle. Analyzes root cause category, why fixes failed, prevention mechanisms, and captures knowledge into specs. Use after fixing a bug to prevent the same class of bugs.
repo: mindfold-ai/Trellis
热度
- GitHub 星标
- 15k
- 排名
- #11026
- 许可证
- AGPL-3.0
- 更新时间
- 2026/9/29
评论
- …
同一仓库的更多技能
first-principles-thinking
15k帮你的智能体把计划或设计拆解为基本事实,再由此向上推理来检验它,而不是依赖习惯或惯例。
python-design
15k帮你的智能体编写和审阅 Python 命令行脚本,使其模块清晰、接口简单,并减少隐藏的复杂性。
trellis-before-dev
15k帮你的智能体在开始编写代码之前,阅读项目的编码指南和任务说明,使其遵循团队的惯例。
trellis-brainstorm
15k帮你的智能体每次提出一个有价值的问题、检查代码并就狭窄的范围达成一致,从而厘清新功能或不明确的任务。