Install
openclaw skills install bug-pattern-diagnosis-enDiagnoses bugs by matching user-reported symptoms against a curated library of past bug cases under experience/, using prior cases as memory references (never as copy-paste answers). Accumulates new cases after each successful investigation. Use when the user reports "weird error / intermittent failure / only reproduces in specific environments / strange logs".
openclaw skills install bug-pattern-diagnosis-enThis skill works like a doctor diagnosing a patient:
experience/ folder as reference memoryBUGxx.md for future referenceCore value: Let past troubleshooting experience inspire the direction of new investigations — but never replace independent thinking. Similar symptoms do not guarantee the same root cause. Logs that look identical may hide completely different failures.
This is the single most important principle of this skill.
The BUGxx.md files under experience/ are an old doctor's case notebook, not a prescription template. When examining a new patient:
| Situation | Wrong approach | Right approach |
|---|---|---|
| Symptoms match closely | "This is BUG01, modify invokeRemoteDeviceOpt and add x-token-payload" | "Your description reminds me of BUG01 — one of its signatures was asymmetric logs across replicas. Before proceeding, can you verify: do the failing requests actually produce 'stack trace on one replica, one-liner on another'?" |
| Partial feature match | "Not exactly, but the BUG01 fix should still work" | "There's a diagnostic trick from BUG01 that might apply here — send 100 requests in a row and see if the success rate is ≈ 1/N. Let's validate that first." |
| Case contains specific code | Paste BUG01's fix and ask user to apply | "BUG01's fix idea was propagating headers, but for your project you need to first confirm: (1) What headers does your receiver actually depend on? (2) Is the serialization identical to the gateway's? We'll need these answers before writing any code." |
bug-pattern-diagnosis-en/
├── SKILL.md ← This file (purpose, flow, matching rules)
└── experience/ ← Case library
├── BUG01.md ← One document per case
├── BUG02.md
└── ...
Each BUGxx.md follows a fixed structure for fast lookup:
Prefer this skill when the user describes issues like:
Read the symptom / signature checklist section from all BUG*.md files under experience/ (the first 30-50 lines of each file typically suffice). Do not read full files upfront.
Extract key features from the user's description, covering at least these dimensions:
| Dimension | Examples |
|---|---|
| Error signal | NPE / 500 / 403 / timeout / data corruption / deadlock |
| Reproduction rate | 100% / 50% / sporadic / specific conditions |
| Environment delta | Doesn't repro locally? repros in test? in prod? |
| Multi-instance traits | Single replica / multiple? how many? |
| Log distribution | Concentrated on one instance / scattered / one has stack one doesn't |
| Triggering conditions | Specific user / specific params / specific time window |
| Recent changes | New release? config change? scale up/down? dependency upgrade? |
Compare the structured features against each case library entry for similarity, but never treat the result as a conclusion. No matter how high the similarity, a case is only a "prior experience worth consulting", not a "confirmed answer".
Similarity handling:
Do not assert "this is BUGxx". Use the tone of "past cases had similar traits, here are possible directions and ways to verify".
Recommended response structure:
❌ "Based on your symptoms, this is BUG01 (multi-replica intermittent NPE).
The root cause is that invokeRemoteDeviceOpt drops x-token-payload.
Apply this fix: [pastes BUG01's code directly]"
✅ "A few things in your description stand out:
1) Intermittent failure with success rate near 50%
2) The error looks token-related, but the client clearly sent a token
This reminds me of a past case (BUG01) where similar symptoms were
caused by 'multi-replica internal calls dropping an identity header'.
Your project isn't necessarily the same thing, so **let's validate
a couple of hypotheses first**:
Q1: How many replicas does your service have? Does the success rate
approximate 1/N?
Q2: Can you tail logs from all replicas simultaneously and see if
the failing request leaves traces on multiple replicas with
asymmetric detail levels?
Run those two checks, share the results, and we'll pick a path."
Proactively ask the user whether to capture this investigation as a new case when:
With user consent, create BUGxx.md (numbering = current max + 1) following the case document template below.
Investigate unknown bugs in this order:
1/N or (N-1)/N?javap -c -p the deployed jar's key classes and diff against local sourceIf you suspect context propagation issues:
getHeaderNames() at the receiver to verify what headers actually arrive# BUGxx: <One-line title emphasizing the most distinctive symptom>
## Case Summary
<One paragraph, under 200 words: phenomenon, reproduction conditions, root-cause type, blast radius>
## Symptom / Signature Checklist (for matching)
> If N+ of these hold simultaneously, high probability of this case
- [ ] Feature 1 (concrete, verifiable)
- [ ] Feature 2
- [ ] Feature 3
- [ ] ...
### Key Log Fingerprints
<Paste typical error log snippets so future investigations can grep-match them>
### Exclusion Criteria (Negative Signals)
- If <xxx> appears, this is NOT this case
## Detailed Explanation / Root Cause Chain
<The pathology. Use diagrams / tables / code references to show data flow, control flow, state transitions>
## Diagnostic Methodology
### Techniques Used
- <Technique 1, e.g. "cross-replica log comparison">
- <Technique 2, e.g. "javap bytecode diff">
- ...
### Diagnostic Steps (in order)
1. ...
2. ...
3. ...
## Remediation Plan
### Root-Cause Fix
<The core fix, with code reference, impact assessment>
### Safety Net / Defense in Depth
<Secondary defenses so a missed fix still doesn't crash>
### Hardening / Cleanup
<Long-term improvements, coding standards, sibling-code sweeps>
## Prevention Checklist
During development:
- [ ] ...
During deployment:
- [ ] ...
During review:
- [ ] ...
## Playbook for Similar Intermittent Bugs
When symptoms look similar, walk through:
1. Quantify reproduction (10 min)
2. Check topology (5 min)
3. Cross-replica log diff (30 min)
4. ...
## References
- Relevant file paths
- Relevant PRs / commits
- Relevant wiki
BUGxx.md is "how that project fixed it", not necessarily right for the current project