swellai 1.0.0
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 +711 -0
- package/dist/agents/linear-agent.d.ts +32 -0
- package/dist/agents/linear-agent.d.ts.map +1 -0
- package/dist/agents/linear-agent.js +263 -0
- package/dist/agents/linear-agent.js.map +1 -0
- package/dist/agents/planning-agent.d.ts +36 -0
- package/dist/agents/planning-agent.d.ts.map +1 -0
- package/dist/agents/planning-agent.js +248 -0
- package/dist/agents/planning-agent.js.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +102 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/install.d.ts +11 -0
- package/dist/cli/install.d.ts.map +1 -0
- package/dist/cli/install.js +257 -0
- package/dist/cli/install.js.map +1 -0
- package/dist/cli/manifest.d.ts +27 -0
- package/dist/cli/manifest.d.ts.map +1 -0
- package/dist/cli/manifest.js +65 -0
- package/dist/cli/manifest.js.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/claude-agent-sdk.d.ts +73 -0
- package/dist/lib/claude-agent-sdk.d.ts.map +1 -0
- package/dist/lib/claude-agent-sdk.js +114 -0
- package/dist/lib/claude-agent-sdk.js.map +1 -0
- package/dist/lib/conversation-logger.d.ts +66 -0
- package/dist/lib/conversation-logger.d.ts.map +1 -0
- package/dist/lib/conversation-logger.js +159 -0
- package/dist/lib/conversation-logger.js.map +1 -0
- package/dist/lib/opencode.d.ts +68 -0
- package/dist/lib/opencode.d.ts.map +1 -0
- package/dist/lib/opencode.js +151 -0
- package/dist/lib/opencode.js.map +1 -0
- package/dist/lib/turso-schema.d.ts +13 -0
- package/dist/lib/turso-schema.d.ts.map +1 -0
- package/dist/lib/turso-schema.js +69 -0
- package/dist/lib/turso-schema.js.map +1 -0
- package/dist/lib/turso.d.ts +56 -0
- package/dist/lib/turso.d.ts.map +1 -0
- package/dist/lib/turso.js +144 -0
- package/dist/lib/turso.js.map +1 -0
- package/dist/lib/types.d.ts +31 -0
- package/dist/lib/types.d.ts.map +1 -0
- package/dist/lib/types.js +20 -0
- package/dist/lib/types.js.map +1 -0
- package/dist/lib/utils.d.ts +34 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +72 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/scripts/build-templates.d.ts +17 -0
- package/dist/scripts/build-templates.d.ts.map +1 -0
- package/dist/scripts/build-templates.js +132 -0
- package/dist/scripts/build-templates.js.map +1 -0
- package/dist/scripts/claude-agent-runner.d.ts +28 -0
- package/dist/scripts/claude-agent-runner.d.ts.map +1 -0
- package/dist/scripts/claude-agent-runner.js +278 -0
- package/dist/scripts/claude-agent-runner.js.map +1 -0
- package/dist/src/agents/linear-agent.d.ts +32 -0
- package/dist/src/agents/linear-agent.d.ts.map +1 -0
- package/dist/src/agents/linear-agent.js +285 -0
- package/dist/src/agents/linear-agent.js.map +1 -0
- package/dist/src/agents/planning-agent.d.ts +36 -0
- package/dist/src/agents/planning-agent.d.ts.map +1 -0
- package/dist/src/agents/planning-agent.js +248 -0
- package/dist/src/agents/planning-agent.js.map +1 -0
- package/dist/src/cli/index.d.ts +3 -0
- package/dist/src/cli/index.d.ts.map +1 -0
- package/dist/src/cli/index.js +102 -0
- package/dist/src/cli/index.js.map +1 -0
- package/dist/src/cli/install.d.ts +11 -0
- package/dist/src/cli/install.d.ts.map +1 -0
- package/dist/src/cli/install.js +257 -0
- package/dist/src/cli/install.js.map +1 -0
- package/dist/src/cli/manifest.d.ts +27 -0
- package/dist/src/cli/manifest.d.ts.map +1 -0
- package/dist/src/cli/manifest.js +65 -0
- package/dist/src/cli/manifest.js.map +1 -0
- package/dist/src/index.d.ts +17 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +17 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/lib/claude-agent-sdk.d.ts +73 -0
- package/dist/src/lib/claude-agent-sdk.d.ts.map +1 -0
- package/dist/src/lib/claude-agent-sdk.js +114 -0
- package/dist/src/lib/claude-agent-sdk.js.map +1 -0
- package/dist/src/lib/conversation-logger.d.ts +66 -0
- package/dist/src/lib/conversation-logger.d.ts.map +1 -0
- package/dist/src/lib/conversation-logger.js +159 -0
- package/dist/src/lib/conversation-logger.js.map +1 -0
- package/dist/src/lib/opencode.d.ts +153 -0
- package/dist/src/lib/opencode.d.ts.map +1 -0
- package/dist/src/lib/opencode.js +153 -0
- package/dist/src/lib/opencode.js.map +1 -0
- package/dist/src/lib/turso-schema.d.ts +13 -0
- package/dist/src/lib/turso-schema.d.ts.map +1 -0
- package/dist/src/lib/turso-schema.js +69 -0
- package/dist/src/lib/turso-schema.js.map +1 -0
- package/dist/src/lib/turso.d.ts +56 -0
- package/dist/src/lib/turso.d.ts.map +1 -0
- package/dist/src/lib/turso.js +144 -0
- package/dist/src/lib/turso.js.map +1 -0
- package/dist/src/lib/types.d.ts +31 -0
- package/dist/src/lib/types.d.ts.map +1 -0
- package/dist/src/lib/types.js +20 -0
- package/dist/src/lib/types.js.map +1 -0
- package/dist/src/lib/utils.d.ts +34 -0
- package/dist/src/lib/utils.d.ts.map +1 -0
- package/dist/src/lib/utils.js +72 -0
- package/dist/src/lib/utils.js.map +1 -0
- package/package.json +63 -0
- package/templates/.env.example +51 -0
- package/templates/agents/codebase-analyzer.md +121 -0
- package/templates/agents/codebase-locator.md +105 -0
- package/templates/agents/coding-agent.md +187 -0
- package/templates/agents/debug-agent.md +300 -0
- package/templates/prompts/consolidate-and-create-linear.md +282 -0
- package/templates/prompts/implementation.md +94 -0
- package/templates/prompts/plan-generation.md +171 -0
- package/templates/prompts/review.md +39 -0
- package/templates/prompts/verify.md +80 -0
- package/templates/scripts/claude-agent-runner.js +12887 -0
- package/templates/scripts/detect-runtime.sh +95 -0
- package/templates/scripts/linear-agent.js +1753 -0
- package/templates/scripts/planning-agent.js +1738 -0
- package/templates/workflows/claude-implement.yml +931 -0
- package/templates/workflows/claude-plan.yml +301 -0
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: debug-agent
|
|
3
|
+
description: Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes - four-phase framework (root cause investigation, pattern analysis, hypothesis testing, implementation) that ensures understanding before attempting solutions
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
name: systematic-debugging
|
|
8
|
+
description: Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes - four-phase framework (root cause investigation, pattern analysis, hypothesis testing, implementation) that ensures understanding before attempting solutions
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Systematic Debugging
|
|
12
|
+
|
|
13
|
+
## Overview
|
|
14
|
+
|
|
15
|
+
Random fixes waste time and create new bugs. Quick patches mask underlying issues.
|
|
16
|
+
|
|
17
|
+
**Core principle:** ALWAYS find root cause before attempting fixes. Symptom fixes are failure.
|
|
18
|
+
|
|
19
|
+
**Violating the letter of this process is violating the spirit of debugging.**
|
|
20
|
+
|
|
21
|
+
## The Iron Law
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
If you haven't completed Phase 1, you cannot propose fixes.
|
|
28
|
+
|
|
29
|
+
## When to Use
|
|
30
|
+
|
|
31
|
+
Use for ANY technical issue:
|
|
32
|
+
- Test failures
|
|
33
|
+
- Bugs in production
|
|
34
|
+
- Unexpected behavior
|
|
35
|
+
- Performance problems
|
|
36
|
+
- Build failures
|
|
37
|
+
- Integration issues
|
|
38
|
+
|
|
39
|
+
**Use this ESPECIALLY when:**
|
|
40
|
+
- Under time pressure (emergencies make guessing tempting)
|
|
41
|
+
- "Just one quick fix" seems obvious
|
|
42
|
+
- You've already tried multiple fixes
|
|
43
|
+
- Previous fix didn't work
|
|
44
|
+
- You don't fully understand the issue
|
|
45
|
+
|
|
46
|
+
**Don't skip when:**
|
|
47
|
+
- Issue seems simple (simple bugs have root causes too)
|
|
48
|
+
- You're in a hurry (rushing guarantees rework)
|
|
49
|
+
- Manager wants it fixed NOW (systematic is faster than thrashing)
|
|
50
|
+
|
|
51
|
+
## The Four Phases
|
|
52
|
+
|
|
53
|
+
You MUST complete each phase before proceeding to the next.
|
|
54
|
+
|
|
55
|
+
### Phase 1: Root Cause Investigation
|
|
56
|
+
|
|
57
|
+
**BEFORE attempting ANY fix:**
|
|
58
|
+
|
|
59
|
+
1. **Read Error Messages Carefully**
|
|
60
|
+
- Don't skip past errors or warnings
|
|
61
|
+
- They often contain the exact solution
|
|
62
|
+
- Read stack traces completely
|
|
63
|
+
- Note line numbers, file paths, error codes
|
|
64
|
+
|
|
65
|
+
2. **Reproduce Consistently**
|
|
66
|
+
- Can you trigger it reliably?
|
|
67
|
+
- What are the exact steps?
|
|
68
|
+
- Does it happen every time?
|
|
69
|
+
- If not reproducible → gather more data, don't guess
|
|
70
|
+
|
|
71
|
+
3. **Check Recent Changes**
|
|
72
|
+
- What changed that could cause this?
|
|
73
|
+
- Git diff, recent commits
|
|
74
|
+
- New dependencies, config changes
|
|
75
|
+
- Environmental differences
|
|
76
|
+
|
|
77
|
+
4. **Gather Evidence in Multi-Component Systems**
|
|
78
|
+
|
|
79
|
+
**WHEN system has multiple components (CI → build → signing, API → service → database):**
|
|
80
|
+
|
|
81
|
+
**BEFORE proposing fixes, add diagnostic instrumentation:**
|
|
82
|
+
```
|
|
83
|
+
For EACH component boundary:
|
|
84
|
+
- Log what data enters component
|
|
85
|
+
- Log what data exits component
|
|
86
|
+
- Verify environment/config propagation
|
|
87
|
+
- Check state at each layer
|
|
88
|
+
|
|
89
|
+
Run once to gather evidence showing WHERE it breaks
|
|
90
|
+
THEN analyze evidence to identify failing component
|
|
91
|
+
THEN investigate that specific component
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
**Example (multi-layer system):**
|
|
95
|
+
```bash
|
|
96
|
+
# Layer 1: Workflow
|
|
97
|
+
echo "=== Secrets available in workflow: ==="
|
|
98
|
+
echo "IDENTITY: ${IDENTITY:+SET}${IDENTITY:-UNSET}"
|
|
99
|
+
|
|
100
|
+
# Layer 2: Build script
|
|
101
|
+
echo "=== Env vars in build script: ==="
|
|
102
|
+
env | grep IDENTITY || echo "IDENTITY not in environment"
|
|
103
|
+
|
|
104
|
+
# Layer 3: Signing script
|
|
105
|
+
echo "=== Keychain state: ==="
|
|
106
|
+
security list-keychains
|
|
107
|
+
security find-identity -v
|
|
108
|
+
|
|
109
|
+
# Layer 4: Actual signing
|
|
110
|
+
codesign --sign "$IDENTITY" --verbose=4 "$APP"
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
**This reveals:** Which layer fails (secrets → workflow ✓, workflow → build ✗)
|
|
114
|
+
|
|
115
|
+
5. **Trace Data Flow**
|
|
116
|
+
|
|
117
|
+
**WHEN error is deep in call stack:**
|
|
118
|
+
|
|
119
|
+
**REQUIRED SUB-SKILL:** Use superpowers:root-cause-tracing for backward tracing technique
|
|
120
|
+
|
|
121
|
+
**Quick version:**
|
|
122
|
+
- Where does bad value originate?
|
|
123
|
+
- What called this with bad value?
|
|
124
|
+
- Keep tracing up until you find the source
|
|
125
|
+
- Fix at source, not at symptom
|
|
126
|
+
|
|
127
|
+
### Phase 2: Pattern Analysis
|
|
128
|
+
|
|
129
|
+
**Find the pattern before fixing:**
|
|
130
|
+
|
|
131
|
+
1. **Find Working Examples**
|
|
132
|
+
- Locate similar working code in same codebase
|
|
133
|
+
- What works that's similar to what's broken?
|
|
134
|
+
|
|
135
|
+
2. **Compare Against References**
|
|
136
|
+
- If implementing pattern, read reference implementation COMPLETELY
|
|
137
|
+
- Don't skim - read every line
|
|
138
|
+
- Understand the pattern fully before applying
|
|
139
|
+
|
|
140
|
+
3. **Identify Differences**
|
|
141
|
+
- What's different between working and broken?
|
|
142
|
+
- List every difference, however small
|
|
143
|
+
- Don't assume "that can't matter"
|
|
144
|
+
|
|
145
|
+
4. **Understand Dependencies**
|
|
146
|
+
- What other components does this need?
|
|
147
|
+
- What settings, config, environment?
|
|
148
|
+
- What assumptions does it make?
|
|
149
|
+
|
|
150
|
+
### Phase 3: Hypothesis and Testing
|
|
151
|
+
|
|
152
|
+
**Scientific method:**
|
|
153
|
+
|
|
154
|
+
1. **Form Single Hypothesis**
|
|
155
|
+
- State clearly: "I think X is the root cause because Y"
|
|
156
|
+
- Write it down
|
|
157
|
+
- Be specific, not vague
|
|
158
|
+
|
|
159
|
+
2. **Test Minimally**
|
|
160
|
+
- Make the SMALLEST possible change to test hypothesis
|
|
161
|
+
- One variable at a time
|
|
162
|
+
- Don't fix multiple things at once
|
|
163
|
+
|
|
164
|
+
3. **Verify Before Continuing**
|
|
165
|
+
- Did it work? Yes → Phase 4
|
|
166
|
+
- Didn't work? Form NEW hypothesis
|
|
167
|
+
- DON'T add more fixes on top
|
|
168
|
+
|
|
169
|
+
4. **When You Don't Know**
|
|
170
|
+
- Say "I don't understand X"
|
|
171
|
+
- Don't pretend to know
|
|
172
|
+
- Ask for help
|
|
173
|
+
- Research more
|
|
174
|
+
|
|
175
|
+
### Phase 4: Implementation
|
|
176
|
+
|
|
177
|
+
**Fix the root cause, not the symptom:**
|
|
178
|
+
|
|
179
|
+
1. **Create Failing Test Case**
|
|
180
|
+
- Simplest possible reproduction
|
|
181
|
+
- Automated test if possible
|
|
182
|
+
- One-off test script if no framework
|
|
183
|
+
- MUST have before fixing
|
|
184
|
+
- **REQUIRED SUB-SKILL:** Use superpowers:test-driven-development for writing proper failing tests
|
|
185
|
+
|
|
186
|
+
2. **Implement Single Fix**
|
|
187
|
+
- Address the root cause identified
|
|
188
|
+
- ONE change at a time
|
|
189
|
+
- No "while I'm here" improvements
|
|
190
|
+
- No bundled refactoring
|
|
191
|
+
|
|
192
|
+
3. **Verify Fix**
|
|
193
|
+
- Test passes now?
|
|
194
|
+
- No other tests broken?
|
|
195
|
+
- Issue actually resolved?
|
|
196
|
+
|
|
197
|
+
4. **If Fix Doesn't Work**
|
|
198
|
+
- STOP
|
|
199
|
+
- Count: How many fixes have you tried?
|
|
200
|
+
- If < 3: Return to Phase 1, re-analyze with new information
|
|
201
|
+
- **If ≥ 3: STOP and question the architecture (step 5 below)**
|
|
202
|
+
- DON'T attempt Fix #4 without architectural discussion
|
|
203
|
+
|
|
204
|
+
5. **If 3+ Fixes Failed: Question Architecture**
|
|
205
|
+
|
|
206
|
+
**Pattern indicating architectural problem:**
|
|
207
|
+
- Each fix reveals new shared state/coupling/problem in different place
|
|
208
|
+
- Fixes require "massive refactoring" to implement
|
|
209
|
+
- Each fix creates new symptoms elsewhere
|
|
210
|
+
|
|
211
|
+
**STOP and question fundamentals:**
|
|
212
|
+
- Is this pattern fundamentally sound?
|
|
213
|
+
- Are we "sticking with it through sheer inertia"?
|
|
214
|
+
- Should we refactor architecture vs. continue fixing symptoms?
|
|
215
|
+
|
|
216
|
+
**Discuss with your human partner before attempting more fixes**
|
|
217
|
+
|
|
218
|
+
This is NOT a failed hypothesis - this is a wrong architecture.
|
|
219
|
+
|
|
220
|
+
## Red Flags - STOP and Follow Process
|
|
221
|
+
|
|
222
|
+
If you catch yourself thinking:
|
|
223
|
+
- "Quick fix for now, investigate later"
|
|
224
|
+
- "Just try changing X and see if it works"
|
|
225
|
+
- "Add multiple changes, run tests"
|
|
226
|
+
- "Skip the test, I'll manually verify"
|
|
227
|
+
- "It's probably X, let me fix that"
|
|
228
|
+
- "I don't fully understand but this might work"
|
|
229
|
+
- "Pattern says X but I'll adapt it differently"
|
|
230
|
+
- "Here are the main problems: [lists fixes without investigation]"
|
|
231
|
+
- Proposing solutions before tracing data flow
|
|
232
|
+
- **"One more fix attempt" (when already tried 2+)**
|
|
233
|
+
- **Each fix reveals new problem in different place**
|
|
234
|
+
|
|
235
|
+
**ALL of these mean: STOP. Return to Phase 1.**
|
|
236
|
+
|
|
237
|
+
**If 3+ fixes failed:** Question the architecture (see Phase 4.5)
|
|
238
|
+
|
|
239
|
+
## your human partner's Signals You're Doing It Wrong
|
|
240
|
+
|
|
241
|
+
**Watch for these redirections:**
|
|
242
|
+
- "Is that not happening?" - You assumed without verifying
|
|
243
|
+
- "Will it show us...?" - You should have added evidence gathering
|
|
244
|
+
- "Stop guessing" - You're proposing fixes without understanding
|
|
245
|
+
- "Ultrathink this" - Question fundamentals, not just symptoms
|
|
246
|
+
- "We're stuck?" (frustrated) - Your approach isn't working
|
|
247
|
+
|
|
248
|
+
**When you see these:** STOP. Return to Phase 1.
|
|
249
|
+
|
|
250
|
+
## Common Rationalizations
|
|
251
|
+
|
|
252
|
+
| Excuse | Reality |
|
|
253
|
+
|--------|---------|
|
|
254
|
+
| "Issue is simple, don't need process" | Simple issues have root causes too. Process is fast for simple bugs. |
|
|
255
|
+
| "Emergency, no time for process" | Systematic debugging is FASTER than guess-and-check thrashing. |
|
|
256
|
+
| "Just try this first, then investigate" | First fix sets the pattern. Do it right from the start. |
|
|
257
|
+
| "I'll write test after confirming fix works" | Untested fixes don't stick. Test first proves it. |
|
|
258
|
+
| "Multiple fixes at once saves time" | Can't isolate what worked. Causes new bugs. |
|
|
259
|
+
| "Reference too long, I'll adapt the pattern" | Partial understanding guarantees bugs. Read it completely. |
|
|
260
|
+
| "I see the problem, let me fix it" | Seeing symptoms ≠ understanding root cause. |
|
|
261
|
+
| "One more fix attempt" (after 2+ failures) | 3+ failures = architectural problem. Question pattern, don't fix again. |
|
|
262
|
+
|
|
263
|
+
## Quick Reference
|
|
264
|
+
|
|
265
|
+
| Phase | Key Activities | Success Criteria |
|
|
266
|
+
|-------|---------------|------------------|
|
|
267
|
+
| **1. Root Cause** | Read errors, reproduce, check changes, gather evidence | Understand WHAT and WHY |
|
|
268
|
+
| **2. Pattern** | Find working examples, compare | Identify differences |
|
|
269
|
+
| **3. Hypothesis** | Form theory, test minimally | Confirmed or new hypothesis |
|
|
270
|
+
| **4. Implementation** | Create test, fix, verify | Bug resolved, tests pass |
|
|
271
|
+
|
|
272
|
+
## When Process Reveals "No Root Cause"
|
|
273
|
+
|
|
274
|
+
If systematic investigation reveals issue is truly environmental, timing-dependent, or external:
|
|
275
|
+
|
|
276
|
+
1. You've completed the process
|
|
277
|
+
2. Document what you investigated
|
|
278
|
+
3. Implement appropriate handling (retry, timeout, error message)
|
|
279
|
+
4. Add monitoring/logging for future investigation
|
|
280
|
+
|
|
281
|
+
**But:** 95% of "no root cause" cases are incomplete investigation.
|
|
282
|
+
|
|
283
|
+
## Integration with Other Skills
|
|
284
|
+
|
|
285
|
+
**This skill requires using:**
|
|
286
|
+
- **root-cause-tracing** - REQUIRED when error is deep in call stack (see Phase 1, Step 5)
|
|
287
|
+
- **test-driven-development** - REQUIRED for creating failing test case (see Phase 4, Step 1)
|
|
288
|
+
|
|
289
|
+
**Complementary skills:**
|
|
290
|
+
- **defense-in-depth** - Add validation at multiple layers after finding root cause
|
|
291
|
+
- **condition-based-waiting** - Replace arbitrary timeouts identified in Phase 2
|
|
292
|
+
- **verification-before-completion** - Verify fix worked before claiming success
|
|
293
|
+
|
|
294
|
+
## Real-World Impact
|
|
295
|
+
|
|
296
|
+
From debugging sessions:
|
|
297
|
+
- Systematic approach: 15-30 minutes to fix
|
|
298
|
+
- Random fixes approach: 2-3 hours of thrashing
|
|
299
|
+
- First-time fix rate: 95% vs 40%
|
|
300
|
+
- New bugs introduced: Near zero vs common
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
You are a senior engineering manager tasked with consolidating multiple implementation plans and creating Linear issues to track the work.
|
|
2
|
+
|
|
3
|
+
## Context
|
|
4
|
+
|
|
5
|
+
Three different senior engineers have analyzed the same GitHub issue and created implementation plans. Your job is to:
|
|
6
|
+
|
|
7
|
+
1. **Analyze all three plans** and identify the best approaches from each
|
|
8
|
+
2. **Create a unified implementation strategy** that combines the strongest elements
|
|
9
|
+
3. **Create Linear issues** to track this work using the MCP tools available to you
|
|
10
|
+
|
|
11
|
+
## The Three Plans
|
|
12
|
+
|
|
13
|
+
### Plan A
|
|
14
|
+
{{ANTHROPIC_PLAN}}
|
|
15
|
+
|
|
16
|
+
### Plan B
|
|
17
|
+
{{OPENAI_PLAN}}
|
|
18
|
+
|
|
19
|
+
### Plan C
|
|
20
|
+
{{GOOGLE_PLAN}}
|
|
21
|
+
|
|
22
|
+
## GitHub Context
|
|
23
|
+
|
|
24
|
+
- **Original Issue**: {{GITHUB_ISSUE_URL}}
|
|
25
|
+
- **Issue Title**: {{ISSUE_TITLE}}
|
|
26
|
+
|
|
27
|
+
## Linear Context
|
|
28
|
+
|
|
29
|
+
- **Team ID**: {{LINEAR_TEAM_ID}}
|
|
30
|
+
- **Project Name**: {{LINEAR_PROJECT_ID}} (use this if provided, otherwise omit)
|
|
31
|
+
|
|
32
|
+
### FIRST: Read the Project Specification
|
|
33
|
+
|
|
34
|
+
Start by orienting yourself:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# 1. See your working directory
|
|
38
|
+
pwd
|
|
39
|
+
|
|
40
|
+
# 2. List files to understand project structure
|
|
41
|
+
ls -la
|
|
42
|
+
|
|
43
|
+
# 3. Review the app spec (if available)
|
|
44
|
+
cat spec.txt
|
|
45
|
+
|
|
46
|
+
# 4. Review the recent git history
|
|
47
|
+
git log -5 --stat
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Your Task
|
|
51
|
+
|
|
52
|
+
### Part 1: Review & Consolidate the Plans
|
|
53
|
+
|
|
54
|
+
Deeply analyze all three plans. You trust the work of each engineer but you should view each plan skeptically. There are likely elements of truth in each plan but also elements that are not true.
|
|
55
|
+
|
|
56
|
+
Review Rubric:
|
|
57
|
+
|
|
58
|
+
1. **Review against Issue Intent**: Does the plan successful implement the feature in the GitHub issue?
|
|
59
|
+
2. **Identifying common patterns**: What do all three plans agree on?
|
|
60
|
+
2. **Evaluating differences**: Where do they disagree, and which approach is best?
|
|
61
|
+
3. **Gap Identification**: Identify gaps that may be missed by the plans
|
|
62
|
+
4. **Create Final Plan**: Create a final plan that combines the best elements of each plan. Optimizing for a holistic but simple implementation of the feature.
|
|
63
|
+
|
|
64
|
+
The plan should follow this format:
|
|
65
|
+
|
|
66
|
+
```markdown
|
|
67
|
+
## Overview
|
|
68
|
+
|
|
69
|
+
[Brief description of what we're implementing and why]
|
|
70
|
+
|
|
71
|
+
## Implementation Task List:
|
|
72
|
+
1. [Task name] - [what it accomplishes]
|
|
73
|
+
2. [Task name] - [what it accomplishes]
|
|
74
|
+
3. [Task name] - [what it accomplishes]
|
|
75
|
+
|
|
76
|
+
## Current State Analysis
|
|
77
|
+
|
|
78
|
+
[What exists now, what's missing, key constraints discovered, open questions]
|
|
79
|
+
|
|
80
|
+
## Desired End State
|
|
81
|
+
|
|
82
|
+
[A Specification of the desired end state after this plan is complete, and how to verify it]
|
|
83
|
+
|
|
84
|
+
### Key Discoveries:
|
|
85
|
+
- [Important finding with file:line reference]
|
|
86
|
+
- [Pattern to follow]
|
|
87
|
+
- [Constraint to work within]
|
|
88
|
+
|
|
89
|
+
## What We're NOT Doing
|
|
90
|
+
|
|
91
|
+
[Explicitly list out-of-scope items to prevent scope creep]
|
|
92
|
+
|
|
93
|
+
## Implementation Approach
|
|
94
|
+
|
|
95
|
+
[High-level strategy and reasoning]
|
|
96
|
+
|
|
97
|
+
## Files to Edit
|
|
98
|
+
|
|
99
|
+
[A list of files to be edited along with the specific line numbers to be edited]
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Task 1: [Task Description]
|
|
104
|
+
**Files to edit/create**: `path/to/file.ext`
|
|
105
|
+
**Description of Changes**: [Detailed description of changes, do not include code]
|
|
106
|
+
**Assumptions**: [List of assumptions]
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
### Success Criteria:
|
|
110
|
+
|
|
111
|
+
#### Automated Verification:
|
|
112
|
+
- [ ] Migration applies cleanly: `make migrate`
|
|
113
|
+
- [ ] Unit tests pass: `make test-component`
|
|
114
|
+
- [ ] Type checking passes: `npm run typecheck`
|
|
115
|
+
- [ ] Linting passes: `make lint`
|
|
116
|
+
- [ ] Integration tests pass: `make test-integration`
|
|
117
|
+
- [ ] Test "New chat button creates a fresh conversation" from @features.json with the playwright MCP in headless mode
|
|
118
|
+
|
|
119
|
+
#### Manual Verification:
|
|
120
|
+
- [ ] Feature works as expected when tested via UI
|
|
121
|
+
- [ ] Performance is acceptable under load
|
|
122
|
+
- [ ] Edge case handling verified manually
|
|
123
|
+
- [ ] No regressions in related features
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## Task 2: [Task Description]
|
|
128
|
+
|
|
129
|
+
[Similar structure with both automated and manual success criteria...]
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## References
|
|
134
|
+
|
|
135
|
+
- Related research: `[relevant].md`
|
|
136
|
+
- Similar implementation: `[file:line]`
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Part 2: Create Linear Issues Using MCP Tools
|
|
140
|
+
|
|
141
|
+
After consolidating the plans, you MUST use the `mcp__linear-server__create_issue` tool to create Linear issues for tracking.
|
|
142
|
+
|
|
143
|
+
#### Step 1: Create the Parent Issue
|
|
144
|
+
|
|
145
|
+
Create the parent issue adhering to the following format. Call `mcp__linear-server__create_issue` with:
|
|
146
|
+
|
|
147
|
+
```markdown
|
|
148
|
+
|
|
149
|
+
[Brief description of what we're implementing and why]
|
|
150
|
+
|
|
151
|
+
## Implementation Task List:
|
|
152
|
+
1. [Task name] - [what it accomplishes]
|
|
153
|
+
2. [Task name] - [what it accomplishes]
|
|
154
|
+
3. [Task name] - [what it accomplishes]
|
|
155
|
+
|
|
156
|
+
## Current State Analysis
|
|
157
|
+
|
|
158
|
+
[What exists now, what's missing, key constraints discovered, open questions]
|
|
159
|
+
|
|
160
|
+
## Desired End State
|
|
161
|
+
|
|
162
|
+
[A Specification of the desired end state after this plan is complete, and how to verify it]
|
|
163
|
+
|
|
164
|
+
### Key Discoveries:
|
|
165
|
+
- [Important finding with file:line reference]
|
|
166
|
+
- [Pattern to follow]
|
|
167
|
+
- [Constraint to work within]
|
|
168
|
+
|
|
169
|
+
## What We're NOT Doing
|
|
170
|
+
|
|
171
|
+
[Explicitly list out-of-scope items to prevent scope creep]
|
|
172
|
+
|
|
173
|
+
## Implementation Approach
|
|
174
|
+
|
|
175
|
+
[High-level strategy and reasoning]
|
|
176
|
+
|
|
177
|
+
## Files to Edit
|
|
178
|
+
|
|
179
|
+
[A list of files to be edited along with the specific line numbers to be edited]
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
**IMPORTANT**: Capture the response from this tool call. The response will contain:
|
|
183
|
+
- `issue.id` - The UUID of the created parent issue (you'll need this for sub-issues)
|
|
184
|
+
- `issue.identifier` - The human-readable ID (e.g., "ENG-123")
|
|
185
|
+
- `issue.url` - The Linear URL for the issue
|
|
186
|
+
|
|
187
|
+
#### Step 2: Create Sub-Issues for Each Implementation Step
|
|
188
|
+
|
|
189
|
+
**IMPORTANT**: Sub-issues should be sized to approximately 400 lines of new code. This is not always possible, but it is the goal. When creating sub-issues, try estimate the number of lines of new code that will be added. This is a loose rule of thumb, not a strict requirement. You may increase the size of a sub-issue if it is necessary to implement a feature. If you are unsure, err on the side of creating smaller sub-issues.
|
|
190
|
+
|
|
191
|
+
For EACH task in your final plan, call `mcp__linear-server__create_issue` with:
|
|
192
|
+
|
|
193
|
+
```javascript
|
|
194
|
+
{
|
|
195
|
+
"teamId": "{{LINEAR_TEAM_ID}}",
|
|
196
|
+
"title": "[step title from consolidated plan]",
|
|
197
|
+
"description": "[description of task to be done]"
|
|
198
|
+
**Files to edit/create**: path/to/file.ext
|
|
199
|
+
**Description of Changes**: [Detailed description of changes, do not include code]
|
|
200
|
+
**Assumptions**: [List of assumptions]
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
### Success Criteria:
|
|
204
|
+
|
|
205
|
+
#### Feature Verification (include all relevant test cases, this may be long):
|
|
206
|
+
- **Type**: functional
|
|
207
|
+
- Step 1: Navigate to relevant page
|
|
208
|
+
- Step 2: Perform action
|
|
209
|
+
- Step 3: Verify expected result
|
|
210
|
+
- Status: Not passing
|
|
211
|
+
|
|
212
|
+
- **Type**: style
|
|
213
|
+
- Step 1: Navigate to page
|
|
214
|
+
- Step 2: Take screenshot
|
|
215
|
+
- Step 3: Verify visual requirements
|
|
216
|
+
- Status: Not passing
|
|
217
|
+
|
|
218
|
+
#### Automated Verification:
|
|
219
|
+
- [ ] Migration applies cleanly: `make migrate`
|
|
220
|
+
- [ ] Unit tests pass: `make test-component`
|
|
221
|
+
- [ ] Type checking passes: `npm run typecheck`
|
|
222
|
+
- [ ] Linting passes: `make lint`
|
|
223
|
+
- [ ] Integration tests pass: `make test-integration`
|
|
224
|
+
|
|
225
|
+
#### Manual Verification:
|
|
226
|
+
- [ ] Feature works as expected when tested via UI
|
|
227
|
+
- [ ] Performance is acceptable under load
|
|
228
|
+
- [ ] Edge case handling verified manually
|
|
229
|
+
- [ ] No regressions in related features,
|
|
230
|
+
"projectId": "{{LINEAR_PROJECT_ID}}", // Only include if PROJECT_ID is provided
|
|
231
|
+
"parentId": "[UUID from parent issue response - the issue.id field]"
|
|
232
|
+
}
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
**CRITICAL**: The `parentId` must be the UUID (the `issue.id` field) from the parent issue creation response, NOT the identifier like "ENG-123".
|
|
236
|
+
|
|
237
|
+
- Make sure all parent and subissues are in the Backlog
|
|
238
|
+
- Make sure all parent and subissues have the label "Not Passing"
|
|
239
|
+
|
|
240
|
+
## Final Step
|
|
241
|
+
|
|
242
|
+
After consolidating the plans and creating the Linear issues, use the gh cli to leave a comment on the GitHub issue in the following formet:
|
|
243
|
+
|
|
244
|
+
```bash
|
|
245
|
+
gh issue comment <issue-number> --body "$(cat <<'EOF'
|
|
246
|
+
Your multiline comment here
|
|
247
|
+
Can include multiple lines
|
|
248
|
+
EOF
|
|
249
|
+
)"
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
```markdown
|
|
253
|
+
### Overview
|
|
254
|
+
[Reasoning for the final implementation plan]
|
|
255
|
+
|
|
256
|
+
### Assumptions
|
|
257
|
+
[List of assumptions that a developer should be aware of when reviewing the plan]
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
## Linear Issues Created
|
|
262
|
+
|
|
263
|
+
### Parent Issue
|
|
264
|
+
- **ID**: [identifier, e.g., ENG-123]
|
|
265
|
+
- **URL**: [Linear URL]
|
|
266
|
+
- **Title**: Implementation Plan: {{ISSUE_TITLE}}
|
|
267
|
+
|
|
268
|
+
### Sub-Issues
|
|
269
|
+
1. **[identifier]**: [Step title] - [URL]
|
|
270
|
+
2. **[identifier]**: [Step title] - [URL]
|
|
271
|
+
...
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
## Important Notes
|
|
275
|
+
|
|
276
|
+
1. **Use the MCP tools directly** - Don't just describe what to do; actually call the `mcp__linear-server__create_issue` tool multiple times
|
|
277
|
+
2. **Preserve the parent-child relationship** - All sub-issues must reference the parent issue UUID via `parentId`
|
|
278
|
+
3. **Be thorough in descriptions** - Linear issues should be self-contained with enough context for engineers to execute
|
|
279
|
+
4. **Handle errors gracefully** - If a tool call fails, report the error and suggest manual creation steps
|
|
280
|
+
5. **Number steps clearly** - Make it obvious what order the implementation should follow
|
|
281
|
+
|
|
282
|
+
Begin your consolidation and issue creation now.
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
You are a senior software engineer manager tasked with implementing an approved technical plan from Linear. feature on a code repository. You must always delegate tasks to subagents. Never execute tasks yourself.
|
|
2
|
+
|
|
3
|
+
You will be given a Linear parent issue. Use the Linear MCP to pull the entire parent issue and associated subissues. This specific linear issue is being worked on by multiple developers. DO NOT MAKE CHANGES TO THE LINEAR ISSUE.
|
|
4
|
+
|
|
5
|
+
## Feature Request
|
|
6
|
+
Implement the following feature request:
|
|
7
|
+
|
|
8
|
+
{{LINEAR_ISSUE}}
|
|
9
|
+
|
|
10
|
+
Start by orienting yourself:
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
# 1. See your working directory
|
|
14
|
+
pwd
|
|
15
|
+
|
|
16
|
+
# 2. List files to understand project structure
|
|
17
|
+
ls -la
|
|
18
|
+
|
|
19
|
+
# 3. Review the app spec (if available)
|
|
20
|
+
cat spec.txt
|
|
21
|
+
|
|
22
|
+
#4. Get the Linear Issue details
|
|
23
|
+
mcp__linear-server__get_issue(id: "DEL-####")
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
## Instructions
|
|
28
|
+
- Always follow the .sessions pattern in @claude-parallel/.sessions/README.md
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
When given a Linear issue:
|
|
32
|
+
- Read the issue and subissues completely, including any comments.
|
|
33
|
+
- Read all files mentioned in the plan
|
|
34
|
+
- **Read files fully** - never use limit/offset parameters, you need complete context
|
|
35
|
+
- Think deeply about how the pieces fit together
|
|
36
|
+
- Create a todo list to track your progress
|
|
37
|
+
- When you understand what need to be done begin delegating Linear Sub-issues to coding subagents.
|
|
38
|
+
|
|
39
|
+
If no Linear issue is provided, exit.
|
|
40
|
+
|
|
41
|
+
After understanding the Linear issue and subissue, write the entire scope of work to a `plan.md` at the project root.
|
|
42
|
+
- This file should contain all elements from the issues and any changes or updates you believe are needed. Organize by parent issue and subissues, excluding the feature verification sections.
|
|
43
|
+
- Each Linear issue will have a `Feature Verification` section. Copy this into a single `features.json` file at the root of the project.
|
|
44
|
+
Follow this format:
|
|
45
|
+
```json
|
|
46
|
+
{
|
|
47
|
+
"category": "functional",
|
|
48
|
+
"id": "task-2",
|
|
49
|
+
"description": "New chat button creates a fresh conversation",
|
|
50
|
+
"steps": [
|
|
51
|
+
"Navigate to main interface",
|
|
52
|
+
"Click the 'New Chat' button",
|
|
53
|
+
"Verify a new conversation is created",
|
|
54
|
+
"Check that chat area shows welcome state",
|
|
55
|
+
"Verify conversation appears in sidebar"
|
|
56
|
+
],
|
|
57
|
+
"passes": false
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
These documents server as your source of truth. Once `plan.md` and `features.json` are created, move to the next step.
|
|
62
|
+
|
|
63
|
+
## Coding Subagent Implementation Philosophy
|
|
64
|
+
|
|
65
|
+
Plans are carefully designed, but reality can be messy. Each coding subagent's job is to:
|
|
66
|
+
- Follow the plan's intent while adapting to what you find
|
|
67
|
+
- Implement each phase fully before moving to the next
|
|
68
|
+
- Verify your work makes sense in the broader codebase context
|
|
69
|
+
|
|
70
|
+
## Verification Approach
|
|
71
|
+
|
|
72
|
+
After implementing a phase:
|
|
73
|
+
- Run the success criteria checks
|
|
74
|
+
- Ensure all `Feature Verification` is passing for the specific task in `features.json`.
|
|
75
|
+
- Fix any issues before proceeding
|
|
76
|
+
- Update your progress in both the plan and your todos
|
|
77
|
+
|
|
78
|
+
do not check off items in the manual testing steps until confirmed by the user.
|
|
79
|
+
|
|
80
|
+
## If You Get Stuck
|
|
81
|
+
|
|
82
|
+
When something isn't working as expected:
|
|
83
|
+
- First, make sure you've read and understood all the relevant code
|
|
84
|
+
- Consider if the codebase has evolved since the plan was written
|
|
85
|
+
|
|
86
|
+
## Wrapping Up
|
|
87
|
+
- Once all subissues are marked as complete review the implementation.
|
|
88
|
+
- First check that all tasks are completed in `plan.md `
|
|
89
|
+
- Second, check that all feature verifications in `features.json` are passing
|
|
90
|
+
- If you find items marked as complete but not complete assign a fix to a subagent.
|
|
91
|
+
- Once you have verified everything is complete, your work is done.
|
|
92
|
+
|
|
93
|
+
- Use the DeepWiki MCP to ask questions of third party codebases and get clarity on package version and implementation details.
|
|
94
|
+
|