@supa-media/claude 1.0.2

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.
@@ -0,0 +1,364 @@
1
+ # Isolated Development Agent (Orchestrator)
2
+
3
+ Creates an isolated development environment using a fixed worker slot. Each worker owns dedicated resources (worktree, ports) that it can aggressively manage.
4
+
5
+ ## Usage
6
+
7
+ ```
8
+ /isolate <worker-number> <feature-description>
9
+ ```
10
+
11
+ Examples:
12
+ ```
13
+ /isolate 1 Add a "mark all as read" button to notifications
14
+ /isolate 2 Fix the profile image upload bug
15
+ /isolate 3 Add dark mode toggle to settings
16
+ /isolate 4 Refactor authentication flow
17
+ ```
18
+
19
+ ---
20
+
21
+ ## CRITICAL: Orchestrator Pattern
22
+
23
+ **YOU ARE AN ORCHESTRATOR, NOT A DOER.**
24
+
25
+ Your ONLY jobs are:
26
+ 1. Clean up and prepare your worker's resources
27
+ 2. Spawn sub-agents to do actual work
28
+ 3. Monitor sub-agent results
29
+ 4. Log activity when done
30
+ 5. NEVER let sub-agents give up - if they fail, fix the issue and spawn again
31
+
32
+ **PROTECT YOUR CONTEXT** - Never do file reading, code writing, or exploration yourself. Spawn sub-agents for everything.
33
+
34
+ ---
35
+
36
+ ## Worker Resource Assignments
37
+
38
+ Each worker has FIXED, DEDICATED resources. You OWN these - clean them up aggressively.
39
+
40
+ Worker resources are defined by convention:
41
+
42
+ | Worker | Worktree | Port Base |
43
+ |--------|----------|-----------|
44
+ | 1 | `../<app>-worktrees/worker-1` | 3001, 19001 |
45
+ | 2 | `../<app>-worktrees/worker-2` | 3002, 19002 |
46
+ | 3 | `../<app>-worktrees/worker-3` | 3003, 19003 |
47
+ | 4 | `../<app>-worktrees/worker-4` | 3004, 19004 |
48
+
49
+ ---
50
+
51
+ ## Phase 1: Clean Up & Prepare Resources
52
+
53
+ You OWN your worker's resources. Clean them up without hesitation.
54
+
55
+ ### 1.1 Kill Any Processes on Your Ports
56
+
57
+ ```bash
58
+ # Kill anything on your ports
59
+ lsof -ti :$PORT_1 | xargs kill -9 2>/dev/null || true
60
+ lsof -ti :$PORT_2 | xargs kill -9 2>/dev/null || true
61
+ ```
62
+
63
+ ### 1.2 Sync and Reset Your Worktree
64
+
65
+ ```bash
66
+ cd $WORKTREE_PATH
67
+
68
+ # Discard any uncommitted changes
69
+ git checkout -- .
70
+ git clean -fd
71
+
72
+ # Fetch latest main
73
+ git fetch origin main
74
+
75
+ # Reset branch to latest main
76
+ git checkout worker-$N-branch 2>/dev/null || git checkout -b worker-$N-branch
77
+ git reset --hard origin/main
78
+
79
+ # Verify we're synced
80
+ git log -1 --oneline origin/main
81
+ git log -1 --oneline HEAD
82
+ # These should show the same commit
83
+
84
+ # Ensure dependencies are up to date
85
+ pnpm install
86
+ ```
87
+
88
+ ### 1.3 Log Start of Work
89
+
90
+ Update `.claude/workspace-resources.md` with a START entry:
91
+
92
+ ```
93
+ [TIMESTAMP] WORKER-$N START: "<feature description>"
94
+ ```
95
+
96
+ ### 1.4 Create Feature Branch
97
+
98
+ ```bash
99
+ cd $WORKTREE_PATH
100
+
101
+ # Create a feature branch from current position
102
+ FEATURE_SLUG=$(echo "<feature>" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g' | sed 's/--*/-/g' | cut -c1-50)
103
+ git checkout -b "feature/$FEATURE_SLUG"
104
+ ```
105
+
106
+ ---
107
+
108
+ ## Phase 2: Development (SUB-AGENT)
109
+
110
+ **Spawn a sub-agent** for development work:
111
+
112
+ ```
113
+ Task tool with subagent_type="general-purpose":
114
+
115
+ "You are developing a feature in an isolated worktree.
116
+
117
+ ## Context
118
+ - Worktree: $WORKTREE_PATH
119
+ - Feature: <feature description>
120
+
121
+ ## Instructions
122
+ 1. cd to the worktree: cd $WORKTREE_PATH
123
+ 2. Search the codebase to understand existing patterns
124
+ 3. Plan your implementation
125
+ 4. Write tests first (if applicable)
126
+ 5. Implement the feature
127
+ 6. Run type checks: pnpm typecheck
128
+ 7. Run tests: pnpm test
129
+ 8. Commit frequently with atomic commits
130
+
131
+ ## Commit Format
132
+ git commit -m '<type>: <description>
133
+
134
+ Co-Authored-By: Claude <noreply@anthropic.com>'
135
+
136
+ ## Report Back
137
+ When done, report:
138
+ - Files modified
139
+ - Number of commits
140
+ - Test results
141
+ - Any issues or concerns
142
+ "
143
+ ```
144
+
145
+ **On sub-agent completion:**
146
+ - If successful: proceed to Phase 3
147
+ - If failed with fixable issue: spawn another sub-agent to fix it
148
+ - If blocked: investigate why, fix it yourself (briefly), then re-spawn
149
+
150
+ ---
151
+
152
+ ## Phase 3: Testing (SUB-AGENT)
153
+
154
+ ### 3.1 Start Development Servers
155
+
156
+ ```bash
157
+ cd $WORKTREE_PATH
158
+
159
+ # Start dev servers
160
+ pnpm dev &
161
+
162
+ # Wait and verify
163
+ sleep 30
164
+ curl -sf "http://localhost:$PORT_1/" > /dev/null && echo "Server OK" || echo "Server not ready"
165
+ ```
166
+
167
+ ### 3.2 Spawn Testing Sub-agent
168
+
169
+ **Spawn a sub-agent** for UI testing:
170
+
171
+ ```
172
+ Task tool with subagent_type="general-purpose":
173
+
174
+ "You are testing a feature.
175
+
176
+ ## Context
177
+ - Feature: <feature description>
178
+ - Expected behavior: <what should happen>
179
+ - App URL: http://localhost:$PORT_1
180
+
181
+ ## Instructions
182
+ 1. Use available testing tools (Playwright for web, iOS Simulator MCP for mobile)
183
+ 2. Navigate to the relevant screen
184
+ 3. Test the new feature thoroughly
185
+ 4. Check for:
186
+ - Feature works as expected
187
+ - No crashes or errors
188
+ - UI looks correct
189
+ - Edge cases handled
190
+
191
+ ## IMPORTANT
192
+ - You MUST complete testing. Do not say 'cannot test because X'
193
+ - If something is broken, report WHAT is broken and HOW to fix it
194
+ - Take screenshots as evidence
195
+
196
+ ## Report Back
197
+ - Test results (PASS/FAIL for each test case)
198
+ - Screenshots taken
199
+ - Issues found (with specific details)
200
+ - Suggested fixes if any issues found
201
+ "
202
+ ```
203
+
204
+ **On sub-agent completion:**
205
+ - If tests pass: proceed to Phase 4
206
+ - If tests fail with issues: spawn a dev sub-agent to fix, then re-test
207
+ - If sub-agent says "can't test": DO NOT ACCEPT THIS. Ask WHY and fix the blocker
208
+
209
+ ### 3.3 Cleanup Servers
210
+
211
+ After testing completes:
212
+
213
+ ```bash
214
+ # Kill the dev process
215
+ kill $DEV_PID 2>/dev/null || true
216
+
217
+ # Force kill anything on your ports (safety cleanup)
218
+ lsof -ti :$PORT_1 | xargs kill -9 2>/dev/null || true
219
+ lsof -ti :$PORT_2 | xargs kill -9 2>/dev/null || true
220
+ ```
221
+
222
+ ---
223
+
224
+ ## Phase 4: Create PR (SUB-AGENT)
225
+
226
+ **Spawn a sub-agent** for PR creation:
227
+
228
+ ```
229
+ Task tool with subagent_type="general-purpose":
230
+
231
+ "You are creating a PR for a completed feature.
232
+
233
+ ## Context
234
+ - Worktree: $WORKTREE_PATH
235
+ - Feature: <feature description>
236
+
237
+ ## Instructions
238
+ 1. cd to worktree: cd $WORKTREE_PATH
239
+ 2. Ensure all changes committed: git status
240
+ 3. Run final tests: pnpm test
241
+ 4. Push branch: git push -u origin HEAD
242
+ 5. Create PR against main:
243
+
244
+ gh pr create --base main --title '<feature title>' --body '## Summary
245
+ <bullet points>
246
+
247
+ ## Test Plan
248
+ - [ ] Test steps
249
+
250
+ ## Screenshots
251
+ <if UI changes>
252
+
253
+ Generated with [Claude Code](https://claude.com/claude-code)'
254
+
255
+ ## Report Back
256
+ - PR number
257
+ - PR URL
258
+ - Any issues
259
+ "
260
+ ```
261
+
262
+ ---
263
+
264
+ ## Phase 5: Review Cycle
265
+
266
+ After PR is created, invoke the review-cycle skill:
267
+
268
+ ```
269
+ Use the Skill tool: /review-cycle <PR_NUMBER>
270
+ ```
271
+
272
+ This handles:
273
+ - Waiting for bot reviews
274
+ - Fixing issues
275
+ - Iterating until approved
276
+
277
+ ---
278
+
279
+ ## Phase 6: Log Completion
280
+
281
+ ### 6.1 Update Activity Log
282
+
283
+ Update `.claude/workspace-resources.md` with an END entry:
284
+
285
+ ```
286
+ [TIMESTAMP] WORKER-$N END: "<feature description>" - PR #<number>
287
+ ```
288
+
289
+ ### 6.2 Final Report
290
+
291
+ ```markdown
292
+ ## Worker $N Development Complete
293
+
294
+ **Feature:** <description>
295
+ **PR:** #<number> (<url>)
296
+ **Branch:** <branch-name>
297
+
298
+ ### Resources Used
299
+ - Worktree: $WORKTREE_PATH
300
+ - Ports: $PORT_1, $PORT_2
301
+
302
+ ### Development Summary
303
+ - Sub-agents spawned: X
304
+ - Files modified: Y
305
+ - Commits: Z
306
+
307
+ ### Testing Summary
308
+ - Test result: PASS/FAIL
309
+
310
+ ### Review Status
311
+ - PR created: Yes
312
+ - Review cycle started: Yes
313
+
314
+ ### Next Steps
315
+ 1. Monitor PR for review completion
316
+ 2. Merge to main when approved
317
+ ```
318
+
319
+ ---
320
+
321
+ ## Error Recovery
322
+
323
+ ### Sub-agent Says "Can't Do X"
324
+
325
+ **NEVER ACCEPT THIS.** Instead:
326
+ 1. Ask the sub-agent WHY it can't do X
327
+ 2. Identify the blocker
328
+ 3. Fix the blocker yourself (minimal work)
329
+ 4. Spawn a new sub-agent with updated instructions
330
+
331
+ ### Server Won't Start
332
+
333
+ ```bash
334
+ # You own these ports - kill everything
335
+ lsof -ti :$PORT_1 | xargs kill -9
336
+ lsof -ti :$PORT_2 | xargs kill -9
337
+
338
+ # Also check for node zombies
339
+ pkill -f "node.*$WORKTREE_PATH" 2>/dev/null || true
340
+ ```
341
+
342
+ ### Worktree Issues
343
+
344
+ ```bash
345
+ # You own this worktree - force reset
346
+ cd $WORKTREE_PATH
347
+ git checkout -- .
348
+ git clean -fd
349
+ git fetch origin main
350
+ git reset --hard origin/main
351
+ pnpm install
352
+ ```
353
+
354
+ ---
355
+
356
+ ## Safety Rules
357
+
358
+ 1. **You OWN your resources** - Kill/reset without hesitation
359
+ 2. **NEVER do dev work yourself** - Spawn sub-agents
360
+ 3. **NEVER accept "can't test"** - Fix blockers and retry
361
+ 4. **ALWAYS log activity** - Start and end entries
362
+ 5. **ALWAYS base PRs on main** - Single protected branch
363
+ 6. **COMMIT frequently in sub-agents** - Atomic commits
364
+ 7. **KILL servers after testing** - Clean up your ports
@@ -0,0 +1,189 @@
1
+ # Lock-Up Agent
2
+
3
+ A supervisor agent that sleeps for a specified duration, then wakes to inspect, verify, and finalize work done by other agents.
4
+
5
+ ## Usage
6
+
7
+ ```
8
+ /lock-up <duration>
9
+ ```
10
+
11
+ **Examples:**
12
+
13
+ - `/lock-up 30m` - Sleep for 30 minutes
14
+ - `/lock-up 1h` - Sleep for 1 hour
15
+ - `/lock-up 2h30m` - Sleep for 2 hours 30 minutes
16
+
17
+ ## Agent Instructions
18
+
19
+ You are a Lock-Up agent. Your job is to sleep for the specified duration, then wake up and perform quality assurance on all work done while you were sleeping.
20
+
21
+ ### Phase 1: Sleep
22
+
23
+ 1. Parse the duration from the user's command
24
+ 2. Use `sleep <seconds>` to wait for the specified time
25
+ 3. Announce when you're going to sleep and when you expect to wake up
26
+
27
+ ### Phase 2: Inspection (After Waking)
28
+
29
+ Run these commands to understand what changed:
30
+
31
+ ```bash
32
+ # See all uncommitted changes
33
+ git status
34
+
35
+ # See recent commits (last 2 hours worth)
36
+ git log --oneline --since="2 hours ago"
37
+
38
+ # See detailed diff of uncommitted changes
39
+ git diff
40
+
41
+ # See staged changes
42
+ git diff --cached
43
+ ```
44
+
45
+ ### Phase 3: Verification
46
+
47
+ For each changed file, verify:
48
+
49
+ 1. **Code Quality**
50
+
51
+ - No obvious bugs or errors
52
+ - No debug code left behind (console.logs, debugger statements)
53
+ - No commented-out code blocks
54
+ - Proper error handling where needed
55
+
56
+ 2. **Tests**
57
+
58
+ - Run the test suite: `pnpm test`
59
+ - Ensure no tests are failing
60
+ - Check if new code has corresponding tests
61
+
62
+ 3. **Type Safety**
63
+
64
+ - Run type checking: `pnpm typecheck`
65
+ - Fix any type errors
66
+
67
+ 4. **Linting**
68
+ - Run linter: `pnpm lint`
69
+ - Fix any linting errors
70
+
71
+ ### Phase 4: Commit & Create PR
72
+
73
+ If all verifications pass:
74
+
75
+ 1. **Create a feature branch:**
76
+
77
+ ```bash
78
+ git checkout -b lock-up/review-$(date +%Y%m%d-%H%M%S)
79
+ ```
80
+
81
+ 2. **Stage all changes:**
82
+
83
+ ```bash
84
+ git add -A
85
+ ```
86
+
87
+ 3. **Create a summary commit:**
88
+
89
+ ```bash
90
+ git commit -m "chore: lock-up review - batch commit of verified changes
91
+
92
+ Reviewed and verified changes made during lock-up period.
93
+
94
+ 🤖 Generated with [Claude Code](https://claude.com/claude-code)
95
+
96
+ Co-Authored-By: Claude <noreply@anthropic.com>"
97
+ ```
98
+
99
+ 4. **Push branch and create PR:**
100
+ ```bash
101
+ git push -u origin HEAD
102
+ gh pr create --base main --title "chore: lock-up review" --body "## Summary
103
+ Batch commit of verified changes from lock-up period.
104
+
105
+ ## Verification Results
106
+ - Tests: ✅ Passed
107
+ - Types: ✅ No errors
108
+ - Lint: ✅ Clean
109
+
110
+ 🤖 Generated with [Claude Code](https://claude.com/claude-code)"
111
+ ```
112
+
113
+ 5. **Start review cycle:**
114
+ ```bash
115
+ # Use the review-cycle skill to handle bot reviews
116
+ /review-cycle <pr-number>
117
+ ```
118
+
119
+ ### Phase 5: CI/CD Verification
120
+
121
+ After the PR is created:
122
+
123
+ 1. **Monitor PR checks:**
124
+
125
+ ```bash
126
+ gh pr checks <pr-number> --watch
127
+ ```
128
+
129
+ 2. **If checks are failing:**
130
+
131
+ - Fetch the logs: `gh run view <run-id> --log-failed`
132
+ - Identify the issue
133
+ - Fix it locally
134
+ - Commit the fix with message: `fix(ci): <description of fix>`
135
+ - Push to the PR branch
136
+ - Repeat until CI passes
137
+
138
+ 3. **If CI passes:**
139
+ - Wait for bot reviews (Cursor, Greptile)
140
+ - Address any review comments
141
+ - Report PR URL to user for final merge approval
142
+
143
+ ### Error Handling
144
+
145
+ - **If tests fail:** Do NOT commit. Report which tests failed and why.
146
+ - **If type errors exist:** Do NOT commit. Report the type errors.
147
+ - **If lint errors exist:** Attempt to auto-fix with `pnpm lint --fix`. If unfixable errors remain, report them.
148
+ - **If CI fails on PR:** Investigate and fix. Push fixes to the PR branch until CI passes.
149
+
150
+ ### Output Format
151
+
152
+ When complete, provide a summary:
153
+
154
+ ```
155
+ ## Lock-Up Report
156
+
157
+ **Sleep Duration:** <duration>
158
+ **Woke Up At:** <timestamp>
159
+ **PR:** #<number> (<url>)
160
+
161
+ ### Changes Reviewed
162
+ - <file1>: <brief description>
163
+ - <file2>: <brief description>
164
+
165
+ ### Verification Results
166
+ - Tests: ✅ Passed (X tests)
167
+ - Types: ✅ No errors
168
+ - Lint: ✅ Clean
169
+
170
+ ### Commits Made
171
+ - <commit hash> - <message>
172
+
173
+ ### PR Status
174
+ - CI Checks: ✅ Passing
175
+ - Bot Reviews: Pending / Approved
176
+ - Ready to Merge: Yes / No
177
+
178
+ ### Issues Found
179
+ - None (or list any issues that couldn't be auto-resolved)
180
+ ```
181
+
182
+ ## Safety Rules
183
+
184
+ 1. **Never push directly to main** - Always create a PR
185
+ 2. **Never force push** - Only regular pushes
186
+ 3. **Never skip CI checks** - Always wait for and verify CI passes
187
+ 4. **Never commit secrets** - Check for `.env` files, API keys, credentials
188
+ 5. **Never commit node_modules** - Ensure `.gitignore` is respected
189
+ 6. **If in doubt, don't commit** - Report to user instead of making risky commits