@hung319/opencode-hive 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +383 -0
- package/dist/agents/architect.d.ts +12 -0
- package/dist/agents/custom-agents.d.ts +18 -0
- package/dist/agents/forager.d.ts +12 -0
- package/dist/agents/hive.d.ts +12 -0
- package/dist/agents/hygienic.d.ts +12 -0
- package/dist/agents/index.d.ts +60 -0
- package/dist/agents/scout.d.ts +6 -0
- package/dist/agents/swarm.d.ts +12 -0
- package/dist/hooks/system-hook.d.ts +8 -0
- package/dist/hooks/variant-hook.d.ts +17 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +24654 -0
- package/dist/mcp/ast-grep.d.ts +2 -0
- package/dist/mcp/context7.d.ts +2 -0
- package/dist/mcp/grep-app.d.ts +2 -0
- package/dist/mcp/index.d.ts +2 -0
- package/dist/mcp/types.d.ts +12 -0
- package/dist/mcp/websearch.d.ts +2 -0
- package/dist/skills/builtin.d.ts +38 -0
- package/dist/skills/file-loader.d.ts +22 -0
- package/dist/skills/index.d.ts +8 -0
- package/dist/skills/registry.generated.d.ts +14 -0
- package/dist/skills/types.d.ts +29 -0
- package/dist/utils/compaction-prompt.d.ts +1 -0
- package/dist/utils/format.d.ts +16 -0
- package/dist/utils/prompt-budgeting.d.ts +112 -0
- package/dist/utils/prompt-file.d.ts +58 -0
- package/dist/utils/prompt-observability.d.ts +93 -0
- package/dist/utils/worker-prompt.d.ts +43 -0
- package/package.json +60 -0
- package/skills/agents-md-mastery/SKILL.md +252 -0
- package/skills/brainstorming/SKILL.md +53 -0
- package/skills/code-reviewer/SKILL.md +208 -0
- package/skills/dispatching-parallel-agents/SKILL.md +200 -0
- package/skills/docker-mastery/SKILL.md +346 -0
- package/skills/executing-plans/SKILL.md +92 -0
- package/skills/parallel-exploration/SKILL.md +240 -0
- package/skills/systematic-debugging/SKILL.md +296 -0
- package/skills/test-driven-development/SKILL.md +371 -0
- package/skills/verification-before-completion/SKILL.md +139 -0
- package/skills/writing-plans/SKILL.md +148 -0
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: parallel-exploration
|
|
3
|
+
description: Use when you need parallel, read-only exploration with task() (Scout fan-out)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Parallel Exploration (Scout Fan-Out)
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
When you need to answer "where/how does X work?" across multiple domains (codebase, tests, docs, OSS), investigating sequentially wastes time. Each investigation is independent and can happen in parallel.
|
|
11
|
+
|
|
12
|
+
**Core principle:** Decompose into independent sub-questions, spawn one task per sub-question, collect results asynchronously.
|
|
13
|
+
|
|
14
|
+
**Safe in Planning mode:** This is read-only exploration. It is OK to use during exploratory research even when there is no feature, no plan, and no approved tasks.
|
|
15
|
+
|
|
16
|
+
**This skill is for read-only research.** For parallel implementation work, use `hive_skill("dispatching-parallel-agents")` with `hive_worktree_start`.
|
|
17
|
+
|
|
18
|
+
## When to Use
|
|
19
|
+
|
|
20
|
+
**Default to this skill when:**
|
|
21
|
+
**Use when:**
|
|
22
|
+
- Investigation spans multiple domains (code + tests + docs)
|
|
23
|
+
- User asks **2+ questions across different domains** (e.g., code + tests, code + docs/OSS, code + config/runtime)
|
|
24
|
+
- Questions are independent (answer to A doesn't affect B)
|
|
25
|
+
- User asks **3+ independent questions** (often as a numbered list or separate bullets)
|
|
26
|
+
- No edits needed (read-only exploration)
|
|
27
|
+
- User asks for an exploration that likely spans multiple files/packages
|
|
28
|
+
- The work is read-only and the questions can be investigated independently
|
|
29
|
+
|
|
30
|
+
**Only skip this skill when:**
|
|
31
|
+
- Investigation requires shared state or context between questions
|
|
32
|
+
- It's a single focused question that is genuinely answerable with **one quick grep + one file read**
|
|
33
|
+
- Questions are dependent (answer A materially changes what to ask for B)
|
|
34
|
+
- Work involves file edits (use Hive tasks / Forager instead)
|
|
35
|
+
|
|
36
|
+
**Important:** Do not treat "this is exploratory" as a reason to avoid delegation. This skill is specifically for exploratory research when fan-out makes it faster and cleaner.
|
|
37
|
+
|
|
38
|
+
## The Pattern
|
|
39
|
+
|
|
40
|
+
### 1. Decompose Into Independent Questions
|
|
41
|
+
|
|
42
|
+
Split your investigation into 2-4 independent sub-questions. Good decomposition:
|
|
43
|
+
|
|
44
|
+
| Domain | Question Example |
|
|
45
|
+
|--------|------------------|
|
|
46
|
+
| Codebase | "Where is X implemented? What files define it?" |
|
|
47
|
+
| Tests | "How is X tested? What test patterns exist?" |
|
|
48
|
+
| Docs/OSS | "How do other projects implement X? What's the recommended pattern?" |
|
|
49
|
+
| Config | "How is X configured? What environment variables affect it?" |
|
|
50
|
+
|
|
51
|
+
**Bad decomposition (dependent questions):**
|
|
52
|
+
- "What is X?" then "How is X used?" (second depends on first)
|
|
53
|
+
- "Find the bug" then "Fix the bug" (not read-only)
|
|
54
|
+
|
|
55
|
+
### 2. Spawn Tasks (Fan-Out)
|
|
56
|
+
|
|
57
|
+
Launch all tasks before waiting for any results:
|
|
58
|
+
|
|
59
|
+
```typescript
|
|
60
|
+
// Parallelize by issuing multiple task() calls in the same assistant message.
|
|
61
|
+
task({
|
|
62
|
+
subagent_type: 'scout-researcher',
|
|
63
|
+
description: 'Find API route implementation',
|
|
64
|
+
prompt: `Where are API routes implemented and registered?
|
|
65
|
+
- Find the tool definition
|
|
66
|
+
- Find the plugin registration
|
|
67
|
+
- Return file paths with line numbers`,
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
task({
|
|
71
|
+
subagent_type: 'scout-researcher',
|
|
72
|
+
description: 'Analyze background task concurrency',
|
|
73
|
+
prompt: `How does background task concurrency/queueing work?
|
|
74
|
+
- Find the manager/scheduler code
|
|
75
|
+
- Document the concurrency model
|
|
76
|
+
- Return file paths with evidence`,
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
task({
|
|
80
|
+
subagent_type: 'scout-researcher',
|
|
81
|
+
description: 'Find parent notification mechanism',
|
|
82
|
+
prompt: `How does parent notification work for background tasks?
|
|
83
|
+
- Where is the notification built?
|
|
84
|
+
- How is it sent to the parent session?
|
|
85
|
+
- Return file paths with evidence`,
|
|
86
|
+
});
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
**Key points:**
|
|
90
|
+
- Use `subagent_type: 'scout-researcher'` for read-only exploration
|
|
91
|
+
- Give each task a clear, focused `description`
|
|
92
|
+
- Make prompts specific about what evidence to return
|
|
93
|
+
|
|
94
|
+
### 3. Continue Working (Optional)
|
|
95
|
+
|
|
96
|
+
While tasks run, you can:
|
|
97
|
+
- Work on other aspects of the problem
|
|
98
|
+
- Prepare synthesis structure
|
|
99
|
+
- Start drafting based on what you already know
|
|
100
|
+
|
|
101
|
+
You'll receive a `<system-reminder>` notification when each task completes.
|
|
102
|
+
|
|
103
|
+
### 4. Collect Results
|
|
104
|
+
|
|
105
|
+
When each task completes, its result is returned directly. Collect the outputs from each task and proceed to synthesis.
|
|
106
|
+
|
|
107
|
+
### 5. Synthesize Findings
|
|
108
|
+
|
|
109
|
+
Combine results from all tasks:
|
|
110
|
+
- Cross-reference findings (file X mentioned by tasks A and B)
|
|
111
|
+
- Identify gaps (task C found nothing, need different approach)
|
|
112
|
+
- Build coherent answer from parallel evidence
|
|
113
|
+
|
|
114
|
+
### 6. Cleanup (If Needed)
|
|
115
|
+
|
|
116
|
+
No manual cancellation is required in task mode.
|
|
117
|
+
|
|
118
|
+
## Prompt Templates
|
|
119
|
+
|
|
120
|
+
### Codebase Slice
|
|
121
|
+
|
|
122
|
+
```
|
|
123
|
+
Investigate [TOPIC] in the codebase:
|
|
124
|
+
- Where is [X] defined/implemented?
|
|
125
|
+
- What files contain [X]?
|
|
126
|
+
- How does [X] interact with [Y]?
|
|
127
|
+
|
|
128
|
+
Return:
|
|
129
|
+
- File paths with line numbers
|
|
130
|
+
- Brief code snippets as evidence
|
|
131
|
+
- Key patterns observed
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Tests Slice
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
Investigate how [TOPIC] is tested:
|
|
138
|
+
- What test files cover [X]?
|
|
139
|
+
- What testing patterns are used?
|
|
140
|
+
- What edge cases are tested?
|
|
141
|
+
|
|
142
|
+
Return:
|
|
143
|
+
- Test file paths
|
|
144
|
+
- Example test patterns
|
|
145
|
+
- Coverage gaps if obvious
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Docs/OSS Slice
|
|
149
|
+
|
|
150
|
+
```
|
|
151
|
+
Research [TOPIC] in external sources:
|
|
152
|
+
- How do other projects implement [X]?
|
|
153
|
+
- What does the official documentation say?
|
|
154
|
+
- What are common patterns/anti-patterns?
|
|
155
|
+
|
|
156
|
+
Return:
|
|
157
|
+
- Links to relevant docs/repos
|
|
158
|
+
- Key recommendations
|
|
159
|
+
- Patterns that apply to our codebase
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Real Example
|
|
163
|
+
|
|
164
|
+
**Investigation:** "How does the API routing system work?"
|
|
165
|
+
|
|
166
|
+
**Decomposition:**
|
|
167
|
+
1. Implementation: Where are API routes defined?
|
|
168
|
+
2. Routing: How does route registration work?
|
|
169
|
+
3. Notifications: How are errors surfaced to the caller?
|
|
170
|
+
|
|
171
|
+
**Fan-out:**
|
|
172
|
+
```typescript
|
|
173
|
+
// Parallelize by issuing multiple task() calls in the same assistant message.
|
|
174
|
+
task({
|
|
175
|
+
subagent_type: 'scout-researcher',
|
|
176
|
+
description: 'Find API route implementation',
|
|
177
|
+
prompt: 'Where are API routes implemented? Find tool definition and registration.',
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
task({
|
|
181
|
+
subagent_type: 'scout-researcher',
|
|
182
|
+
description: 'Analyze concurrency model',
|
|
183
|
+
prompt: 'How does background task concurrency work? Find the manager/scheduler.',
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
task({
|
|
187
|
+
subagent_type: 'scout-researcher',
|
|
188
|
+
description: 'Find notification mechanism',
|
|
189
|
+
prompt: 'How are parent sessions notified of task completion?',
|
|
190
|
+
});
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
**Results:**
|
|
194
|
+
- Task 1: Found `background-tools.ts` (tool definition), `index.ts` (registration)
|
|
195
|
+
- Task 2: Found `manager.ts` with concurrency=3 default, queue-based scheduling
|
|
196
|
+
- Task 3: Found `session.prompt()` call in manager for parent notification
|
|
197
|
+
|
|
198
|
+
**Synthesis:** Complete picture of background task lifecycle in ~1/3 the time of sequential investigation.
|
|
199
|
+
|
|
200
|
+
## Common Mistakes
|
|
201
|
+
|
|
202
|
+
**Spawning sequentially (defeats the purpose):**
|
|
203
|
+
```typescript
|
|
204
|
+
// BAD: Wait for each before spawning next
|
|
205
|
+
await task({ ... });
|
|
206
|
+
await task({ ... });
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
```typescript
|
|
210
|
+
// GOOD: Spawn all in the same assistant message
|
|
211
|
+
task({ ... });
|
|
212
|
+
task({ ... });
|
|
213
|
+
task({ ... });
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
**Too many tasks (diminishing returns):**
|
|
217
|
+
- 2-4 tasks: Good parallelization
|
|
218
|
+
- 5+ tasks: Overhead exceeds benefit, harder to synthesize
|
|
219
|
+
|
|
220
|
+
**Dependent questions:**
|
|
221
|
+
- Don't spawn task B if it needs task A's answer
|
|
222
|
+
- Either make them independent or run sequentially
|
|
223
|
+
|
|
224
|
+
**Using for edits:**
|
|
225
|
+
- Scout is read-only; use Forager for implementation
|
|
226
|
+
- This skill is for exploration, not execution
|
|
227
|
+
|
|
228
|
+
## Key Benefits
|
|
229
|
+
|
|
230
|
+
1. **Speed** - 3 investigations in time of 1
|
|
231
|
+
2. **Focus** - Each Scout has narrow scope
|
|
232
|
+
3. **Independence** - No interference between tasks
|
|
233
|
+
4. **Flexibility** - Cancel unneeded tasks, add new ones
|
|
234
|
+
|
|
235
|
+
## Verification
|
|
236
|
+
|
|
237
|
+
After using this pattern, verify:
|
|
238
|
+
- [ ] All tasks spawned before collecting any results (true fan-out)
|
|
239
|
+
- [ ] Verified `task()` fan-out pattern used for parallel exploration
|
|
240
|
+
- [ ] Synthesized findings into coherent answer
|
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: systematic-debugging
|
|
3
|
+
description: Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Systematic Debugging
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Random fixes waste time and create new bugs. Quick patches mask underlying issues.
|
|
11
|
+
|
|
12
|
+
**Core principle:** ALWAYS find root cause before attempting fixes. Symptom fixes are failure.
|
|
13
|
+
|
|
14
|
+
**Violating the letter of this process is violating the spirit of debugging.**
|
|
15
|
+
|
|
16
|
+
## The Iron Law
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
If you haven't completed Phase 1, you cannot propose fixes.
|
|
23
|
+
|
|
24
|
+
## When to Use
|
|
25
|
+
|
|
26
|
+
Use for ANY technical issue:
|
|
27
|
+
- Test failures
|
|
28
|
+
- Bugs in production
|
|
29
|
+
- Unexpected behavior
|
|
30
|
+
- Performance problems
|
|
31
|
+
- Build failures
|
|
32
|
+
- Integration issues
|
|
33
|
+
|
|
34
|
+
**Use this ESPECIALLY when:**
|
|
35
|
+
- Under time pressure (emergencies make guessing tempting)
|
|
36
|
+
- "Just one quick fix" seems obvious
|
|
37
|
+
- You've already tried multiple fixes
|
|
38
|
+
- Previous fix didn't work
|
|
39
|
+
- You don't fully understand the issue
|
|
40
|
+
|
|
41
|
+
**Don't skip when:**
|
|
42
|
+
- Issue seems simple (simple bugs have root causes too)
|
|
43
|
+
- You're in a hurry (rushing guarantees rework)
|
|
44
|
+
- Manager wants it fixed NOW (systematic is faster than thrashing)
|
|
45
|
+
|
|
46
|
+
## The Four Phases
|
|
47
|
+
|
|
48
|
+
You MUST complete each phase before proceeding to the next.
|
|
49
|
+
|
|
50
|
+
### Phase 1: Root Cause Investigation
|
|
51
|
+
|
|
52
|
+
**BEFORE attempting ANY fix:**
|
|
53
|
+
|
|
54
|
+
1. **Read Error Messages Carefully**
|
|
55
|
+
- Don't skip past errors or warnings
|
|
56
|
+
- They often contain the exact solution
|
|
57
|
+
- Read stack traces completely
|
|
58
|
+
- Note line numbers, file paths, error codes
|
|
59
|
+
|
|
60
|
+
2. **Reproduce Consistently**
|
|
61
|
+
- Can you trigger it reliably?
|
|
62
|
+
- What are the exact steps?
|
|
63
|
+
- Does it happen every time?
|
|
64
|
+
- If not reproducible → gather more data, don't guess
|
|
65
|
+
|
|
66
|
+
3. **Check Recent Changes**
|
|
67
|
+
- What changed that could cause this?
|
|
68
|
+
- Git diff, recent commits
|
|
69
|
+
- New dependencies, config changes
|
|
70
|
+
- Environmental differences
|
|
71
|
+
|
|
72
|
+
4. **Gather Evidence in Multi-Component Systems**
|
|
73
|
+
|
|
74
|
+
**WHEN system has multiple components (CI → build → signing, API → service → database):**
|
|
75
|
+
|
|
76
|
+
**BEFORE proposing fixes, add diagnostic instrumentation:**
|
|
77
|
+
```
|
|
78
|
+
For EACH component boundary:
|
|
79
|
+
- Log what data enters component
|
|
80
|
+
- Log what data exits component
|
|
81
|
+
- Verify environment/config propagation
|
|
82
|
+
- Check state at each layer
|
|
83
|
+
|
|
84
|
+
Run once to gather evidence showing WHERE it breaks
|
|
85
|
+
THEN analyze evidence to identify failing component
|
|
86
|
+
THEN investigate that specific component
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
**Example (multi-layer system):**
|
|
90
|
+
```bash
|
|
91
|
+
# Layer 1: Workflow
|
|
92
|
+
echo "=== Secrets available in workflow: ==="
|
|
93
|
+
echo "IDENTITY: ${IDENTITY:+SET}${IDENTITY:-UNSET}"
|
|
94
|
+
|
|
95
|
+
# Layer 2: Build script
|
|
96
|
+
echo "=== Env vars in build script: ==="
|
|
97
|
+
env | grep IDENTITY || echo "IDENTITY not in environment"
|
|
98
|
+
|
|
99
|
+
# Layer 3: Signing script
|
|
100
|
+
echo "=== Keychain state: ==="
|
|
101
|
+
security list-keychains
|
|
102
|
+
security find-identity -v
|
|
103
|
+
|
|
104
|
+
# Layer 4: Actual signing
|
|
105
|
+
codesign --sign "$IDENTITY" --verbose=4 "$APP"
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**This reveals:** Which layer fails (secrets → workflow ✓, workflow → build ✗)
|
|
109
|
+
|
|
110
|
+
5. **Trace Data Flow**
|
|
111
|
+
|
|
112
|
+
**WHEN error is deep in call stack:**
|
|
113
|
+
|
|
114
|
+
See `root-cause-tracing.md` in this directory for the complete backward tracing technique.
|
|
115
|
+
|
|
116
|
+
**Quick version:**
|
|
117
|
+
- Where does bad value originate?
|
|
118
|
+
- What called this with bad value?
|
|
119
|
+
- Keep tracing up until you find the source
|
|
120
|
+
- Fix at source, not at symptom
|
|
121
|
+
|
|
122
|
+
### Phase 2: Pattern Analysis
|
|
123
|
+
|
|
124
|
+
**Find the pattern before fixing:**
|
|
125
|
+
|
|
126
|
+
1. **Find Working Examples**
|
|
127
|
+
- Locate similar working code in same codebase
|
|
128
|
+
- What works that's similar to what's broken?
|
|
129
|
+
|
|
130
|
+
2. **Compare Against References**
|
|
131
|
+
- If implementing pattern, read reference implementation COMPLETELY
|
|
132
|
+
- Don't skim - read every line
|
|
133
|
+
- Understand the pattern fully before applying
|
|
134
|
+
|
|
135
|
+
3. **Identify Differences**
|
|
136
|
+
- What's different between working and broken?
|
|
137
|
+
- List every difference, however small
|
|
138
|
+
- Don't assume "that can't matter"
|
|
139
|
+
|
|
140
|
+
4. **Understand Dependencies**
|
|
141
|
+
- What other components does this need?
|
|
142
|
+
- What settings, config, environment?
|
|
143
|
+
- What assumptions does it make?
|
|
144
|
+
|
|
145
|
+
### Phase 3: Hypothesis and Testing
|
|
146
|
+
|
|
147
|
+
**Scientific method:**
|
|
148
|
+
|
|
149
|
+
1. **Form Single Hypothesis**
|
|
150
|
+
- State clearly: "I think X is the root cause because Y"
|
|
151
|
+
- Write it down
|
|
152
|
+
- Be specific, not vague
|
|
153
|
+
|
|
154
|
+
2. **Test Minimally**
|
|
155
|
+
- Make the SMALLEST possible change to test hypothesis
|
|
156
|
+
- One variable at a time
|
|
157
|
+
- Don't fix multiple things at once
|
|
158
|
+
|
|
159
|
+
3. **Verify Before Continuing**
|
|
160
|
+
- Did it work? Yes → Phase 4
|
|
161
|
+
- Didn't work? Form NEW hypothesis
|
|
162
|
+
- DON'T add more fixes on top
|
|
163
|
+
|
|
164
|
+
4. **When You Don't Know**
|
|
165
|
+
- Say "I don't understand X"
|
|
166
|
+
- Don't pretend to know
|
|
167
|
+
- Ask for help
|
|
168
|
+
- Research more
|
|
169
|
+
|
|
170
|
+
### Phase 4: Implementation
|
|
171
|
+
|
|
172
|
+
**Fix the root cause, not the symptom:**
|
|
173
|
+
|
|
174
|
+
1. **Create Failing Test Case**
|
|
175
|
+
- Simplest possible reproduction
|
|
176
|
+
- Automated test if possible
|
|
177
|
+
- One-off test script if no framework
|
|
178
|
+
- MUST have before fixing
|
|
179
|
+
- Use the `hive_skill:test-driven-development` skill for writing proper failing tests
|
|
180
|
+
|
|
181
|
+
2. **Implement Single Fix**
|
|
182
|
+
- Address the root cause identified
|
|
183
|
+
- ONE change at a time
|
|
184
|
+
- No "while I'm here" improvements
|
|
185
|
+
- No bundled refactoring
|
|
186
|
+
|
|
187
|
+
3. **Verify Fix**
|
|
188
|
+
- Test passes now?
|
|
189
|
+
- No other tests broken?
|
|
190
|
+
- Issue actually resolved?
|
|
191
|
+
|
|
192
|
+
4. **If Fix Doesn't Work**
|
|
193
|
+
- STOP
|
|
194
|
+
- Count: How many fixes have you tried?
|
|
195
|
+
- If < 3: Return to Phase 1, re-analyze with new information
|
|
196
|
+
- **If ≥ 3: STOP and question the architecture (step 5 below)**
|
|
197
|
+
- DON'T attempt Fix #4 without architectural discussion
|
|
198
|
+
|
|
199
|
+
5. **If 3+ Fixes Failed: Question Architecture**
|
|
200
|
+
|
|
201
|
+
**Pattern indicating architectural problem:**
|
|
202
|
+
- Each fix reveals new shared state/coupling/problem in different place
|
|
203
|
+
- Fixes require "massive refactoring" to implement
|
|
204
|
+
- Each fix creates new symptoms elsewhere
|
|
205
|
+
|
|
206
|
+
**STOP and question fundamentals:**
|
|
207
|
+
- Is this pattern fundamentally sound?
|
|
208
|
+
- Are we "sticking with it through sheer inertia"?
|
|
209
|
+
- Should we refactor architecture vs. continue fixing symptoms?
|
|
210
|
+
|
|
211
|
+
**Discuss with your human partner before attempting more fixes**
|
|
212
|
+
|
|
213
|
+
This is NOT a failed hypothesis - this is a wrong architecture.
|
|
214
|
+
|
|
215
|
+
## Red Flags - STOP and Follow Process
|
|
216
|
+
|
|
217
|
+
If you catch yourself thinking:
|
|
218
|
+
- "Quick fix for now, investigate later"
|
|
219
|
+
- "Just try changing X and see if it works"
|
|
220
|
+
- "Add multiple changes, run tests"
|
|
221
|
+
- "Skip the test, I'll manually verify"
|
|
222
|
+
- "It's probably X, let me fix that"
|
|
223
|
+
- "I don't fully understand but this might work"
|
|
224
|
+
- "Pattern says X but I'll adapt it differently"
|
|
225
|
+
- "Here are the main problems: [lists fixes without investigation]"
|
|
226
|
+
- Proposing solutions before tracing data flow
|
|
227
|
+
- **"One more fix attempt" (when already tried 2+)**
|
|
228
|
+
- **Each fix reveals new problem in different place**
|
|
229
|
+
|
|
230
|
+
**ALL of these mean: STOP. Return to Phase 1.**
|
|
231
|
+
|
|
232
|
+
**If 3+ fixes failed:** Question the architecture (see Phase 4.5)
|
|
233
|
+
|
|
234
|
+
## your human partner's Signals You're Doing It Wrong
|
|
235
|
+
|
|
236
|
+
**Watch for these redirections:**
|
|
237
|
+
- "Is that not happening?" - You assumed without verifying
|
|
238
|
+
- "Will it show us...?" - You should have added evidence gathering
|
|
239
|
+
- "Stop guessing" - You're proposing fixes without understanding
|
|
240
|
+
- "Ultrathink this" - Question fundamentals, not just symptoms
|
|
241
|
+
- "We're stuck?" (frustrated) - Your approach isn't working
|
|
242
|
+
|
|
243
|
+
**When you see these:** STOP. Return to Phase 1.
|
|
244
|
+
|
|
245
|
+
## Common Rationalizations
|
|
246
|
+
|
|
247
|
+
| Excuse | Reality |
|
|
248
|
+
|--------|---------|
|
|
249
|
+
| "Issue is simple, don't need process" | Simple issues have root causes too. Process is fast for simple bugs. |
|
|
250
|
+
| "Emergency, no time for process" | Systematic debugging is FASTER than guess-and-check thrashing. |
|
|
251
|
+
| "Just try this first, then investigate" | First fix sets the pattern. Do it right from the start. |
|
|
252
|
+
| "I'll write test after confirming fix works" | Untested fixes don't stick. Test first proves it. |
|
|
253
|
+
| "Multiple fixes at once saves time" | Can't isolate what worked. Causes new bugs. |
|
|
254
|
+
| "Reference too long, I'll adapt the pattern" | Partial understanding guarantees bugs. Read it completely. |
|
|
255
|
+
| "I see the problem, let me fix it" | Seeing symptoms ≠ understanding root cause. |
|
|
256
|
+
| "One more fix attempt" (after 2+ failures) | 3+ failures = architectural problem. Question pattern, don't fix again. |
|
|
257
|
+
|
|
258
|
+
## Quick Reference
|
|
259
|
+
|
|
260
|
+
| Phase | Key Activities | Success Criteria |
|
|
261
|
+
|-------|---------------|------------------|
|
|
262
|
+
| **1. Root Cause** | Read errors, reproduce, check changes, gather evidence | Understand WHAT and WHY |
|
|
263
|
+
| **2. Pattern** | Find working examples, compare | Identify differences |
|
|
264
|
+
| **3. Hypothesis** | Form theory, test minimally | Confirmed or new hypothesis |
|
|
265
|
+
| **4. Implementation** | Create test, fix, verify | Bug resolved, tests pass |
|
|
266
|
+
|
|
267
|
+
## When Process Reveals "No Root Cause"
|
|
268
|
+
|
|
269
|
+
If systematic investigation reveals issue is truly environmental, timing-dependent, or external:
|
|
270
|
+
|
|
271
|
+
1. You've completed the process
|
|
272
|
+
2. Document what you investigated
|
|
273
|
+
3. Implement appropriate handling (retry, timeout, error message)
|
|
274
|
+
4. Add monitoring/logging for future investigation
|
|
275
|
+
|
|
276
|
+
**But:** 95% of "no root cause" cases are incomplete investigation.
|
|
277
|
+
|
|
278
|
+
## Supporting Techniques
|
|
279
|
+
|
|
280
|
+
These techniques are part of systematic debugging and available in this directory:
|
|
281
|
+
|
|
282
|
+
- **`root-cause-tracing.md`** - Trace bugs backward through call stack to find original trigger
|
|
283
|
+
- **`defense-in-depth.md`** - Add validation at multiple layers after finding root cause
|
|
284
|
+
- **`condition-based-waiting.md`** - Replace arbitrary timeouts with condition polling
|
|
285
|
+
|
|
286
|
+
**Related skills:**
|
|
287
|
+
- **hive_skill:test-driven-development** - For creating failing test case (Phase 4, Step 1)
|
|
288
|
+
- **hive_skill:verification-before-completion** - Verify fix worked before claiming success
|
|
289
|
+
|
|
290
|
+
## Real-World Impact
|
|
291
|
+
|
|
292
|
+
From debugging sessions:
|
|
293
|
+
- Systematic approach: 15-30 minutes to fix
|
|
294
|
+
- Random fixes approach: 2-3 hours of thrashing
|
|
295
|
+
- First-time fix rate: 95% vs 40%
|
|
296
|
+
- New bugs introduced: Near zero vs common
|