@orchestrator-claude/definitions 3.30.2 → 3.31.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/agents/adversarial-reviewer.md +217 -0
- package/agents/azure-devops-engineer.md +805 -0
- package/agents/methodology-researcher.md +190 -0
- package/agents/operational-artifact-builder.md +173 -0
- package/agents/presentation-engineer.md +605 -0
- package/agents/reviewer.md +3 -1
- package/dist/scripts/generate-manifest.js +3 -3
- package/dist/scripts/generate-manifest.js.map +1 -1
- package/hooks/mailbox-listener.ts +246 -0
- package/hooks/pre-agent-dispatch.ts +57 -0
- package/hooks/sprint-registry.ts +85 -0
- package/hooks/verification-before-completion.ts +97 -0
- package/manifest.json +278 -5
- package/package.json +1 -1
- package/skills/artifact-generator/SKILL.md +385 -0
- package/skills/brainstorm-formalize/SKILL.md +272 -0
- package/skills/brainstorming/SKILL.md +167 -0
- package/skills/brainstorming/scripts/frame-template.html +214 -0
- package/skills/brainstorming/scripts/helper.js +88 -0
- package/skills/brainstorming/scripts/server.cjs +354 -0
- package/skills/brainstorming/scripts/start-server.sh +148 -0
- package/skills/brainstorming/scripts/stop-server.sh +56 -0
- package/skills/brainstorming/visual-companion.md +139 -0
- package/skills/compositional-intelligence/SKILL.md +93 -0
- package/skills/design-system-validated-loop/SKILL.md +366 -0
- package/skills/finishing-branch/SKILL.md +184 -0
- package/skills/orchestrator/SKILL.md +158 -0
- package/skills/persona-library/SKILL.md +365 -0
- package/skills/project-management-enterprise/SKILL.md +304 -0
- package/skills/receiving-code-review/SKILL.md +186 -0
- package/skills/release/SKILL.md +41 -0
- package/skills/sprint-launch/SKILL.md +176 -0
- package/skills/sprint-teammate/sprint-teammate.md +107 -0
- package/skills/systematic-debugging/SKILL.md +262 -0
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sprint-launch
|
|
3
|
+
description: >
|
|
4
|
+
Launch parallel Claude sessions in tmux for sprint execution.
|
|
5
|
+
Use when starting a sprint with independent tasks that benefit from parallel panes.
|
|
6
|
+
Supports duo, duo-doc, squad, squad-review, platoon, and platoon-full presets
|
|
7
|
+
covering 2 to 5+ pane configurations.
|
|
8
|
+
argument-hint: <preset> [workflow-id]
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Sprint Launcher — RFC-025 v2
|
|
12
|
+
|
|
13
|
+
Launch parallel Claude sessions in tmux panes, each isolated in a git worktree, to execute sprint tasks concurrently.
|
|
14
|
+
|
|
15
|
+
## When to Use
|
|
16
|
+
|
|
17
|
+
- Starting a sprint with 1-5 independent task tracks
|
|
18
|
+
- You want parallel agent sessions with worktree isolation
|
|
19
|
+
- RFC-021 Sprints, ADR-017 phases, or any feature work with clear task separation
|
|
20
|
+
|
|
21
|
+
## Prerequisites
|
|
22
|
+
|
|
23
|
+
Before launching, verify:
|
|
24
|
+
1. **tmux** is installed and on PATH (`tmux -V`)
|
|
25
|
+
2. **claude** CLI is on PATH (`claude --version`)
|
|
26
|
+
3. **git** repo is clean (no uncommitted changes that could conflict with worktrees)
|
|
27
|
+
4. An active workflow exists (or you have a workflowId)
|
|
28
|
+
|
|
29
|
+
## Presets
|
|
30
|
+
|
|
31
|
+
| Preset | Panes | Composition | Use When |
|
|
32
|
+
|--------|-------|-------------|----------|
|
|
33
|
+
| `duo` | 1 | 1 implementer | Simple sprint, 1 task track |
|
|
34
|
+
| `duo-doc` | 2 | 1 implementer + 1 doc-sidecar | Documentation-heavy work |
|
|
35
|
+
| `squad` | 3 | 2 implementers + 1 debug-sidecar | 2 parallel tracks with review |
|
|
36
|
+
| `squad-review` | 3 | 1 implementer + 1 debug-sidecar + 1 doc-sidecar | Quality-critical single track |
|
|
37
|
+
| `platoon` | 5 | 3 implementers + 1 reviewer + 1 debug-sidecar | 3 parallel tracks with review |
|
|
38
|
+
| `platoon-full` | 7 | 2 implementers + 2 doc-sidecars + 1 debug-sidecar + 1 test-sidecar + 1 reviewer | Complex sprint with full observability |
|
|
39
|
+
|
|
40
|
+
## Protocol
|
|
41
|
+
|
|
42
|
+
**IMPORTANT: Always confirm with the user before launching.**
|
|
43
|
+
|
|
44
|
+
### Step 1: Gather Parameters
|
|
45
|
+
|
|
46
|
+
Parse from user input or active workflow context:
|
|
47
|
+
- **preset**: one of the 6 presets above (required)
|
|
48
|
+
- **workflowId**: from active workflow or user input (optional — script generates one if missing)
|
|
49
|
+
|
|
50
|
+
### Step 2: Confirm via AskUserQuestion
|
|
51
|
+
|
|
52
|
+
Before executing anything, present the launch plan:
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
AskUserQuestion({
|
|
56
|
+
question: "Sprint Launch: {preset} preset\n\nSession: sprint-{wfId:0:8}\nPanes: {pane descriptions}\nWorktrees: ../wt-sprint-{wfId:0:8}-{0,1,...}\n\nProceed?",
|
|
57
|
+
options: ["Launch", "Change preset", "Cancel"]
|
|
58
|
+
})
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Step 3: Execute
|
|
62
|
+
|
|
63
|
+
On user approval, run via TypeScript launcher:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
npx tsx scripts/sprint-launch.ts {preset} {workflowId}
|
|
67
|
+
|
|
68
|
+
# With task distribution (--task is repeatable, round-robin to implementer panes):
|
|
69
|
+
npx tsx scripts/sprint-launch.ts {preset} {workflowId} --mailbox \
|
|
70
|
+
--task "TASK-001: Implement auth endpoint" \
|
|
71
|
+
--task "TASK-002: Write integration tests"
|
|
72
|
+
|
|
73
|
+
# With tasks fetched from REST API (graceful fallback if API unavailable):
|
|
74
|
+
npx tsx scripts/sprint-launch.ts {preset} {workflowId} --mailbox --fetch-tasks
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Step 4: Auto-attach
|
|
78
|
+
|
|
79
|
+
The script automatically attaches after launching panes and injecting startup prompts:
|
|
80
|
+
|
|
81
|
+
- **Inside tmux**: opens a horizontal split pointing at the new session — zero user action required
|
|
82
|
+
- **Outside tmux**: prints the attach command to console, e.g. `tmux attach -t sprint-{prefix}`
|
|
83
|
+
|
|
84
|
+
Startup prompts are injected into each pane automatically. If a pane fails to receive its prompt, auto-attach still proceeds.
|
|
85
|
+
|
|
86
|
+
## Task Distribution
|
|
87
|
+
|
|
88
|
+
When launching with tasks, the launcher distributes them **round-robin to implementer panes only**.
|
|
89
|
+
Sidecar agents (doc-sidecar, debug-sidecar, test-sidecar) react to implementer progress via mailbox
|
|
90
|
+
and do not receive direct task_assignment messages from the launcher.
|
|
91
|
+
|
|
92
|
+
### --task flag (repeatable)
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
--task "TASK-001: Title"
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
- Parses `TASK-001` as `taskId` and `Title` as `title`
|
|
99
|
+
- Produces a `task_assignment` mailbox message with `description: ''` and `acceptanceCriteria: []`
|
|
100
|
+
- Tasks are distributed round-robin: task[0] → implementer[0], task[1] → implementer[1], task[2] → implementer[0], etc.
|
|
101
|
+
- The task title is also injected into the pane's CLAUDE.md as a hint (via WorktreeIsolator)
|
|
102
|
+
|
|
103
|
+
### --fetch-tasks flag
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
--fetch-tasks
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
- Calls `GET /api/workflows/{workflowId}/tasks` on the configured REST API (`ORCHESTRATOR_API_URL` env var, default `http://localhost:3000`)
|
|
110
|
+
- Appends fetched tasks to any `--task` CLI tasks
|
|
111
|
+
- Graceful fallback: if the API is unreachable or returns an error, prints a warning and continues with CLI tasks only
|
|
112
|
+
|
|
113
|
+
### Agent Protocol
|
|
114
|
+
|
|
115
|
+
Agents receive tasks via the sprint-teammate skill. See `.claude/skills/sprint-teammate/sprint-teammate.md`.
|
|
116
|
+
|
|
117
|
+
## Critical Rules
|
|
118
|
+
|
|
119
|
+
1. **NEVER use `--bare` for implementer panes** — `--bare` suppresses hooks, skills, and MCP tools. Implementers MUST have access to these. The script uses `claude -p` (without `--bare`).
|
|
120
|
+
2. **Always confirm before launching** — never auto-launch panes.
|
|
121
|
+
3. **Worktrees are cleaned up on exit** — the script traps EXIT/SIGINT/SIGTERM and removes worktrees if interrupted.
|
|
122
|
+
4. **ANTHROPIC_API_KEY warning** — if unset, script warns but continues (Max OAuth mode assumed).
|
|
123
|
+
|
|
124
|
+
## Monitoring
|
|
125
|
+
|
|
126
|
+
After launch, check pane health:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
# Single check
|
|
130
|
+
./scripts/sprint-status.sh sprint-{prefix} --once
|
|
131
|
+
|
|
132
|
+
# Continuous monitoring (10s interval)
|
|
133
|
+
./scripts/sprint-status.sh sprint-{prefix}
|
|
134
|
+
|
|
135
|
+
# Custom interval
|
|
136
|
+
POLL_INTERVAL=5 ./scripts/sprint-status.sh sprint-{prefix}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Output shows ALIVE (green) or DEAD (red) per pane.
|
|
140
|
+
|
|
141
|
+
## Cleanup
|
|
142
|
+
|
|
143
|
+
Worktrees are auto-cleaned on script exit. If a crash leaves orphans:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
git worktree prune
|
|
147
|
+
git worktree list # verify no wt-sprint-* remain
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
To kill a running sprint session:
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
tmux kill-session -t sprint-{prefix}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## Examples
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
# Simple sprint with 1 implementer (auto-attaches)
|
|
160
|
+
/sprint-launch duo
|
|
161
|
+
|
|
162
|
+
# Documentation-heavy sprint
|
|
163
|
+
/sprint-launch duo-doc adaaa9a4-ef49-4e26-af14-2b239f62b40c
|
|
164
|
+
|
|
165
|
+
# 2 parallel tracks
|
|
166
|
+
/sprint-launch squad
|
|
167
|
+
|
|
168
|
+
# 2 tracks with reviewer sidecar
|
|
169
|
+
/sprint-launch squad-review adaaa9a4-ef49-4e26-af14-2b239f62b40c
|
|
170
|
+
|
|
171
|
+
# 3 parallel tracks
|
|
172
|
+
/sprint-launch platoon
|
|
173
|
+
|
|
174
|
+
# 3 tracks with reviewer sidecar
|
|
175
|
+
/sprint-launch platoon-full adaaa9a4-ef49-4e26-af14-2b239f62b40c
|
|
176
|
+
```
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# Sprint Teammate Protocol
|
|
2
|
+
|
|
3
|
+
You are a focused sprint agent. This protocol is **MANDATORY and non-negotiable**.
|
|
4
|
+
|
|
5
|
+
## Identity
|
|
6
|
+
|
|
7
|
+
Check `process.env.SPRINT_ID`. If set, you are in a sprint session.
|
|
8
|
+
Your role is `process.env.PANE_ROLE`. Your inbox is:
|
|
9
|
+
`/tmp/{SPRINT_ID}/mailbox/{PANE_ROLE}/inbox/`
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## MANDATORY Protocol (non-negotiable)
|
|
14
|
+
|
|
15
|
+
1. **EXECUTE IMMEDIATELY** — When you receive `task_assignment` via mailbox, start implementation NOW. DO NOT wait for additional instruction. DO NOT ask questions. The envelope IS the instruction.
|
|
16
|
+
|
|
17
|
+
2. **NEVER end session without sending `task_complete` or `error_report`** — Every session MUST produce a completion signal. Silent stalls are forbidden.
|
|
18
|
+
|
|
19
|
+
3. **MUST respond to `fix_request` with a new implementation** — When you receive review findings, fix them immediately. DO NOT reject, negotiate, or defer. Implement the fix, then send `task_complete`.
|
|
20
|
+
|
|
21
|
+
4. **MUST send `task_complete` BEFORE anything else when done** — Write the envelope to orchestrator inbox before any summary, cleanup, or follow-up.
|
|
22
|
+
|
|
23
|
+
5. **MUST send `error_report` if blocked** — If you cannot proceed, report immediately with `errorCode: "BLOCKER"`. DO NOT wait to be asked.
|
|
24
|
+
|
|
25
|
+
6. **MUST NOT greet users, ask questions, or invoke workflow MCP tools** — You are NOT the orchestrator. You execute tasks.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Message Types
|
|
30
|
+
|
|
31
|
+
### Receiving: task_assignment
|
|
32
|
+
```json
|
|
33
|
+
{
|
|
34
|
+
"type": "task_assignment",
|
|
35
|
+
"taskId": "TASK-001",
|
|
36
|
+
"title": "Short title",
|
|
37
|
+
"description": "Full description",
|
|
38
|
+
"acceptanceCriteria": ["criterion 1", "criterion 2"]
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
**Action:** EXECUTE IMMEDIATELY. No acknowledgement needed.
|
|
42
|
+
|
|
43
|
+
### Receiving: fix_request
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"type": "fix_request",
|
|
47
|
+
"originalTaskId": "TASK-001",
|
|
48
|
+
"iteration": 1,
|
|
49
|
+
"findings": ["Finding 1: description", "Finding 2: description"],
|
|
50
|
+
"instructions": "Optional specific instructions"
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
**Action:** Fix ALL findings. Send `task_complete` when done. Max 3 iterations — if iteration=3, this is your LAST chance.
|
|
54
|
+
|
|
55
|
+
### Sending: task_complete
|
|
56
|
+
```json
|
|
57
|
+
{
|
|
58
|
+
"type": "task_complete",
|
|
59
|
+
"taskId": "TASK-001",
|
|
60
|
+
"summary": "What was done and where"
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
Write to: `/tmp/{SPRINT_ID}/mailbox/orchestrator-0/inbox/{uuid}.json`
|
|
64
|
+
|
|
65
|
+
### Sending: status_update
|
|
66
|
+
```json
|
|
67
|
+
{
|
|
68
|
+
"type": "status_update",
|
|
69
|
+
"taskId": "TASK-001",
|
|
70
|
+
"progress": 50,
|
|
71
|
+
"message": "Tests written, implementing..."
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Sending: error_report
|
|
76
|
+
```json
|
|
77
|
+
{
|
|
78
|
+
"type": "error_report",
|
|
79
|
+
"errorCode": "BLOCKER",
|
|
80
|
+
"message": "Cannot proceed because...",
|
|
81
|
+
"taskId": "TASK-001"
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Mailbox Paths
|
|
88
|
+
|
|
89
|
+
| Direction | Path |
|
|
90
|
+
|-----------|------|
|
|
91
|
+
| Your inbox | `/tmp/{SPRINT_ID}/mailbox/{PANE_ROLE}/inbox/` |
|
|
92
|
+
| Orchestrator | `/tmp/{SPRINT_ID}/mailbox/orchestrator-0/inbox/` |
|
|
93
|
+
| Other pane | `/tmp/{SPRINT_ID}/mailbox/{role}-{index}/inbox/` |
|
|
94
|
+
|
|
95
|
+
Envelope format: `{ "id": "<uuid>", "from": {"role": "...", "index": N}, "to": {"role": "...", "index": N}, "timestamp": "<ISO>", "body": {...} }`
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Self-Guarding Rules
|
|
100
|
+
|
|
101
|
+
- MUST NOT greet users or ask "What would you like to do?"
|
|
102
|
+
- MUST NOT invoke workflow MCP tools (advancePhase, completeWorkflow)
|
|
103
|
+
- MUST NOT spawn sub-agents
|
|
104
|
+
- MUST execute task_assignment IMMEDIATELY upon receipt
|
|
105
|
+
- MUST execute fix_request IMMEDIATELY upon receipt
|
|
106
|
+
- MUST send task_complete when done — BEFORE any other action
|
|
107
|
+
- MUST send error_report if blocked — DO NOT silently stall
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: systematic-debugging
|
|
3
|
+
description: "Use when encountering any bug, test failure, or unexpected behavior — requires root cause investigation before proposing any fix."
|
|
4
|
+
triggers:
|
|
5
|
+
- "When a test fails"
|
|
6
|
+
- "When encountering unexpected runtime behavior"
|
|
7
|
+
- "When a build breaks"
|
|
8
|
+
- "When production has a bug"
|
|
9
|
+
- "Before proposing any fix to a technical problem"
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Systematic Debugging
|
|
13
|
+
|
|
14
|
+
## Overview
|
|
15
|
+
|
|
16
|
+
Random fixes waste time and create new bugs. Quick patches mask underlying issues.
|
|
17
|
+
|
|
18
|
+
**Core principle:** ALWAYS find root cause before attempting fixes. Symptom fixes are failure.
|
|
19
|
+
|
|
20
|
+
**Violating the letter of this process is violating the spirit of debugging.**
|
|
21
|
+
|
|
22
|
+
## The Iron Law
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
If you haven't completed Phase 1, you cannot propose fixes.
|
|
29
|
+
|
|
30
|
+
## When to Use
|
|
31
|
+
|
|
32
|
+
Use for ANY technical issue:
|
|
33
|
+
- Test failures
|
|
34
|
+
- Bugs in production
|
|
35
|
+
- Unexpected behavior
|
|
36
|
+
- Performance problems
|
|
37
|
+
- Build failures
|
|
38
|
+
- Integration issues
|
|
39
|
+
|
|
40
|
+
**Use this ESPECIALLY when:**
|
|
41
|
+
- Under time pressure (emergencies make guessing tempting)
|
|
42
|
+
- "Just one quick fix" seems obvious
|
|
43
|
+
- You've already tried multiple fixes
|
|
44
|
+
- Previous fix didn't work
|
|
45
|
+
- You don't fully understand the issue
|
|
46
|
+
|
|
47
|
+
**Don't skip when:**
|
|
48
|
+
- Issue seems simple (simple bugs have root causes too)
|
|
49
|
+
- You're in a hurry (rushing guarantees rework)
|
|
50
|
+
- A fix seems obvious (verify the assumption)
|
|
51
|
+
|
|
52
|
+
## The Four Phases
|
|
53
|
+
|
|
54
|
+
You MUST complete each phase before proceeding to the next.
|
|
55
|
+
|
|
56
|
+
### Phase 1: Root Cause Investigation
|
|
57
|
+
|
|
58
|
+
**BEFORE attempting ANY fix:**
|
|
59
|
+
|
|
60
|
+
1. **Read Error Messages Carefully**
|
|
61
|
+
- Don't skip past errors or warnings
|
|
62
|
+
- They often contain the exact solution
|
|
63
|
+
- Read stack traces completely
|
|
64
|
+
- Note line numbers, file paths, error codes
|
|
65
|
+
|
|
66
|
+
2. **Reproduce Consistently**
|
|
67
|
+
- Can you trigger it reliably?
|
|
68
|
+
- What are the exact steps?
|
|
69
|
+
- Does it happen every time?
|
|
70
|
+
- If not reproducible — gather more data, don't guess
|
|
71
|
+
|
|
72
|
+
3. **Check Recent Changes**
|
|
73
|
+
- What changed that could cause this?
|
|
74
|
+
- Git diff, recent commits
|
|
75
|
+
- New dependencies, config changes
|
|
76
|
+
- Environmental differences
|
|
77
|
+
|
|
78
|
+
4. **Gather Evidence in Multi-Component Systems**
|
|
79
|
+
|
|
80
|
+
**WHEN system has multiple components (CI → build → signing, API → service → database):**
|
|
81
|
+
|
|
82
|
+
**BEFORE proposing fixes, add diagnostic instrumentation:**
|
|
83
|
+
```
|
|
84
|
+
For EACH component boundary:
|
|
85
|
+
- Log what data enters component
|
|
86
|
+
- Log what data exits component
|
|
87
|
+
- Verify environment/config propagation
|
|
88
|
+
- Check state at each layer
|
|
89
|
+
|
|
90
|
+
Run once to gather evidence showing WHERE it breaks
|
|
91
|
+
THEN analyze evidence to identify failing component
|
|
92
|
+
THEN investigate that specific component
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
5. **Trace Data Flow**
|
|
96
|
+
|
|
97
|
+
**WHEN error is deep in call stack:**
|
|
98
|
+
- Where does bad value originate?
|
|
99
|
+
- What called this with bad value?
|
|
100
|
+
- Keep tracing up until you find the source
|
|
101
|
+
- Fix at source, not at symptom
|
|
102
|
+
|
|
103
|
+
### Phase 2: Pattern Analysis
|
|
104
|
+
|
|
105
|
+
**Find the pattern before fixing:**
|
|
106
|
+
|
|
107
|
+
1. **Find Working Examples**
|
|
108
|
+
- Locate similar working code in same codebase
|
|
109
|
+
- What works that's similar to what's broken?
|
|
110
|
+
|
|
111
|
+
2. **Compare Against References**
|
|
112
|
+
- If implementing pattern, read reference implementation COMPLETELY
|
|
113
|
+
- Don't skim — read every line
|
|
114
|
+
- Understand the pattern fully before applying
|
|
115
|
+
|
|
116
|
+
3. **Identify Differences**
|
|
117
|
+
- What's different between working and broken?
|
|
118
|
+
- List every difference, however small
|
|
119
|
+
- Don't assume "that can't matter"
|
|
120
|
+
|
|
121
|
+
4. **Understand Dependencies**
|
|
122
|
+
- What other components does this need?
|
|
123
|
+
- What settings, config, environment?
|
|
124
|
+
- What assumptions does it make?
|
|
125
|
+
|
|
126
|
+
### Phase 3: Hypothesis and Testing
|
|
127
|
+
|
|
128
|
+
**Scientific method:**
|
|
129
|
+
|
|
130
|
+
1. **Form Single Hypothesis**
|
|
131
|
+
- State clearly: "I think X is the root cause because Y"
|
|
132
|
+
- Write it down
|
|
133
|
+
- Be specific, not vague
|
|
134
|
+
|
|
135
|
+
2. **Test Minimally**
|
|
136
|
+
- Make the SMALLEST possible change to test hypothesis
|
|
137
|
+
- One variable at a time
|
|
138
|
+
- Don't fix multiple things at once
|
|
139
|
+
|
|
140
|
+
3. **Verify Before Continuing**
|
|
141
|
+
- Did it work? Yes — Phase 4
|
|
142
|
+
- Didn't work? Form NEW hypothesis
|
|
143
|
+
- DON'T add more fixes on top
|
|
144
|
+
|
|
145
|
+
4. **When You Don't Know**
|
|
146
|
+
- Say "I don't understand X"
|
|
147
|
+
- Don't pretend to know
|
|
148
|
+
- Ask the user
|
|
149
|
+
- Research more
|
|
150
|
+
|
|
151
|
+
### Phase 4: Implementation
|
|
152
|
+
|
|
153
|
+
**Fix the root cause, not the symptom:**
|
|
154
|
+
|
|
155
|
+
1. **Create Failing Test Case**
|
|
156
|
+
- Simplest possible reproduction
|
|
157
|
+
- Automated test if possible
|
|
158
|
+
- MUST have before fixing
|
|
159
|
+
|
|
160
|
+
2. **Implement Single Fix**
|
|
161
|
+
- Address the root cause identified
|
|
162
|
+
- ONE change at a time
|
|
163
|
+
- No "while I'm here" improvements
|
|
164
|
+
- No bundled refactoring
|
|
165
|
+
|
|
166
|
+
3. **Verify Fix**
|
|
167
|
+
- Test passes now?
|
|
168
|
+
- No other tests broken?
|
|
169
|
+
- Issue actually resolved?
|
|
170
|
+
|
|
171
|
+
4. **If Fix Doesn't Work**
|
|
172
|
+
- STOP
|
|
173
|
+
- Count: How many fixes have you tried?
|
|
174
|
+
- If < 3: Return to Phase 1, re-analyze with new information
|
|
175
|
+
- **If >= 3: STOP and question the architecture (step 5 below)**
|
|
176
|
+
- DON'T attempt Fix #4 without architectural discussion
|
|
177
|
+
|
|
178
|
+
5. **If 3+ Fixes Failed: Question Architecture**
|
|
179
|
+
|
|
180
|
+
**Pattern indicating architectural problem:**
|
|
181
|
+
- Each fix reveals new shared state/coupling/problem in different place
|
|
182
|
+
- Fixes require "massive refactoring" to implement
|
|
183
|
+
- Each fix creates new symptoms elsewhere
|
|
184
|
+
|
|
185
|
+
**STOP and question fundamentals:**
|
|
186
|
+
- Is this pattern fundamentally sound?
|
|
187
|
+
- Are we "sticking with it through sheer inertia"?
|
|
188
|
+
- Should we refactor architecture vs. continue fixing symptoms?
|
|
189
|
+
|
|
190
|
+
**Discuss with the user before attempting more fixes.**
|
|
191
|
+
|
|
192
|
+
This is NOT a failed hypothesis — this is a wrong architecture.
|
|
193
|
+
|
|
194
|
+
## Red Flags — STOP and Follow Process
|
|
195
|
+
|
|
196
|
+
If you catch yourself thinking:
|
|
197
|
+
- "Quick fix for now, investigate later"
|
|
198
|
+
- "Just try changing X and see if it works"
|
|
199
|
+
- "Add multiple changes, run tests"
|
|
200
|
+
- "Skip the test, I'll manually verify"
|
|
201
|
+
- "It's probably X, let me fix that"
|
|
202
|
+
- "I don't fully understand but this might work"
|
|
203
|
+
- "Pattern says X but I'll adapt it differently"
|
|
204
|
+
- "Here are the main problems: [lists fixes without investigation]"
|
|
205
|
+
- Proposing solutions before tracing data flow
|
|
206
|
+
- **"One more fix attempt" (when already tried 2+)**
|
|
207
|
+
- **Each fix reveals new problem in different place**
|
|
208
|
+
|
|
209
|
+
**ALL of these mean: STOP. Return to Phase 1.**
|
|
210
|
+
|
|
211
|
+
**If 3+ fixes failed:** Question the architecture (see Phase 4.5)
|
|
212
|
+
|
|
213
|
+
## Signals You're Doing It Wrong
|
|
214
|
+
|
|
215
|
+
**Watch for these redirections from the user:**
|
|
216
|
+
- "Is that not happening?" — You assumed without verifying
|
|
217
|
+
- "Will it show us...?" — You should have added evidence gathering
|
|
218
|
+
- "Stop guessing" — You're proposing fixes without understanding
|
|
219
|
+
- "We're stuck?" (frustrated) — Your approach isn't working
|
|
220
|
+
|
|
221
|
+
**When you see these:** STOP. Return to Phase 1.
|
|
222
|
+
|
|
223
|
+
## Common Rationalizations
|
|
224
|
+
|
|
225
|
+
| Excuse | Reality |
|
|
226
|
+
|--------|---------|
|
|
227
|
+
| "Issue is simple, don't need process" | Simple issues have root causes too. Process is fast for simple bugs. |
|
|
228
|
+
| "Emergency, no time for process" | Systematic debugging is FASTER than guess-and-check thrashing. |
|
|
229
|
+
| "Just try this first, then investigate" | First fix sets the pattern. Do it right from the start. |
|
|
230
|
+
| "I'll write test after confirming fix works" | Untested fixes don't stick. Test first proves it. |
|
|
231
|
+
| "Multiple fixes at once saves time" | Can't isolate what worked. Causes new bugs. |
|
|
232
|
+
| "Reference too long, I'll adapt the pattern" | Partial understanding guarantees bugs. Read it completely. |
|
|
233
|
+
| "I see the problem, let me fix it" | Seeing symptoms does not equal understanding root cause. |
|
|
234
|
+
| "One more fix attempt" (after 2+ failures) | 3+ failures = architectural problem. Question pattern, don't fix again. |
|
|
235
|
+
|
|
236
|
+
## Quick Reference
|
|
237
|
+
|
|
238
|
+
| Phase | Key Activities | Success Criteria |
|
|
239
|
+
|-------|---------------|------------------|
|
|
240
|
+
| **1. Root Cause** | Read errors, reproduce, check changes, gather evidence | Understand WHAT and WHY |
|
|
241
|
+
| **2. Pattern** | Find working examples, compare | Identify differences |
|
|
242
|
+
| **3. Hypothesis** | Form theory, test minimally | Confirmed or new hypothesis |
|
|
243
|
+
| **4. Implementation** | Create test, fix, verify | Bug resolved, tests pass |
|
|
244
|
+
|
|
245
|
+
## When Process Reveals "No Root Cause"
|
|
246
|
+
|
|
247
|
+
If systematic investigation reveals issue is truly environmental, timing-dependent, or external:
|
|
248
|
+
|
|
249
|
+
1. You've completed the process
|
|
250
|
+
2. Document what you investigated
|
|
251
|
+
3. Implement appropriate handling (retry, timeout, error message)
|
|
252
|
+
4. Add monitoring/logging for future investigation
|
|
253
|
+
|
|
254
|
+
**But:** 95% of "no root cause" cases are incomplete investigation.
|
|
255
|
+
|
|
256
|
+
## Real-World Impact
|
|
257
|
+
|
|
258
|
+
From debugging sessions:
|
|
259
|
+
- Systematic approach: 15-30 minutes to fix
|
|
260
|
+
- Random fixes approach: 2-3 hours of thrashing
|
|
261
|
+
- First-time fix rate: 95% vs 40%
|
|
262
|
+
- New bugs introduced: Near zero vs common
|