@rune-kit/rune 2.1.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.
Files changed (155) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +357 -0
  3. package/agents/.gitkeep +0 -0
  4. package/agents/architect.md +29 -0
  5. package/agents/asset-creator.md +11 -0
  6. package/agents/audit.md +11 -0
  7. package/agents/autopsy.md +11 -0
  8. package/agents/brainstorm.md +11 -0
  9. package/agents/browser-pilot.md +11 -0
  10. package/agents/coder.md +29 -0
  11. package/agents/completion-gate.md +11 -0
  12. package/agents/constraint-check.md +11 -0
  13. package/agents/context-engine.md +11 -0
  14. package/agents/cook.md +11 -0
  15. package/agents/db.md +11 -0
  16. package/agents/debug.md +11 -0
  17. package/agents/dependency-doctor.md +11 -0
  18. package/agents/deploy.md +11 -0
  19. package/agents/design.md +11 -0
  20. package/agents/docs-seeker.md +11 -0
  21. package/agents/fix.md +11 -0
  22. package/agents/hallucination-guard.md +11 -0
  23. package/agents/incident.md +11 -0
  24. package/agents/integrity-check.md +11 -0
  25. package/agents/journal.md +11 -0
  26. package/agents/launch.md +11 -0
  27. package/agents/logic-guardian.md +11 -0
  28. package/agents/marketing.md +11 -0
  29. package/agents/onboard.md +11 -0
  30. package/agents/perf.md +11 -0
  31. package/agents/plan.md +11 -0
  32. package/agents/preflight.md +11 -0
  33. package/agents/problem-solver.md +11 -0
  34. package/agents/rescue.md +11 -0
  35. package/agents/research.md +11 -0
  36. package/agents/researcher.md +29 -0
  37. package/agents/review-intake.md +11 -0
  38. package/agents/review.md +11 -0
  39. package/agents/reviewer.md +28 -0
  40. package/agents/safeguard.md +11 -0
  41. package/agents/sast.md +11 -0
  42. package/agents/scanner.md +28 -0
  43. package/agents/scope-guard.md +11 -0
  44. package/agents/scout.md +11 -0
  45. package/agents/sentinel.md +11 -0
  46. package/agents/sequential-thinking.md +11 -0
  47. package/agents/session-bridge.md +11 -0
  48. package/agents/skill-forge.md +11 -0
  49. package/agents/skill-router.md +11 -0
  50. package/agents/surgeon.md +11 -0
  51. package/agents/team.md +11 -0
  52. package/agents/test.md +11 -0
  53. package/agents/trend-scout.md +11 -0
  54. package/agents/verification.md +11 -0
  55. package/agents/video-creator.md +11 -0
  56. package/agents/watchdog.md +11 -0
  57. package/agents/worktree.md +11 -0
  58. package/commands/.gitkeep +0 -0
  59. package/commands/rune.md +168 -0
  60. package/compiler/__tests__/openclaw-adapter.test.js +140 -0
  61. package/compiler/__tests__/parser.test.js +55 -0
  62. package/compiler/adapters/antigravity.js +59 -0
  63. package/compiler/adapters/claude.js +37 -0
  64. package/compiler/adapters/cursor.js +67 -0
  65. package/compiler/adapters/generic.js +60 -0
  66. package/compiler/adapters/index.js +45 -0
  67. package/compiler/adapters/openclaw.js +150 -0
  68. package/compiler/adapters/windsurf.js +60 -0
  69. package/compiler/bin/rune.js +288 -0
  70. package/compiler/doctor.js +153 -0
  71. package/compiler/emitter.js +240 -0
  72. package/compiler/parser.js +208 -0
  73. package/compiler/transformer.js +69 -0
  74. package/compiler/transforms/branding.js +27 -0
  75. package/compiler/transforms/cross-references.js +29 -0
  76. package/compiler/transforms/frontmatter.js +38 -0
  77. package/compiler/transforms/hooks.js +68 -0
  78. package/compiler/transforms/subagents.js +36 -0
  79. package/compiler/transforms/tool-names.js +60 -0
  80. package/contexts/dev.md +34 -0
  81. package/contexts/research.md +43 -0
  82. package/contexts/review.md +55 -0
  83. package/extensions/ai-ml/PACK.md +517 -0
  84. package/extensions/analytics/PACK.md +557 -0
  85. package/extensions/backend/PACK.md +678 -0
  86. package/extensions/chrome-ext/PACK.md +995 -0
  87. package/extensions/content/PACK.md +381 -0
  88. package/extensions/devops/PACK.md +520 -0
  89. package/extensions/ecommerce/PACK.md +280 -0
  90. package/extensions/gamedev/PACK.md +393 -0
  91. package/extensions/mobile/PACK.md +273 -0
  92. package/extensions/saas/PACK.md +805 -0
  93. package/extensions/security/PACK.md +536 -0
  94. package/extensions/trading/PACK.md +597 -0
  95. package/extensions/ui/PACK.md +947 -0
  96. package/package.json +47 -0
  97. package/skills/.gitkeep +0 -0
  98. package/skills/adversary/SKILL.md +271 -0
  99. package/skills/asset-creator/SKILL.md +157 -0
  100. package/skills/audit/SKILL.md +466 -0
  101. package/skills/autopsy/SKILL.md +200 -0
  102. package/skills/ba/SKILL.md +279 -0
  103. package/skills/brainstorm/SKILL.md +266 -0
  104. package/skills/browser-pilot/SKILL.md +168 -0
  105. package/skills/completion-gate/SKILL.md +151 -0
  106. package/skills/constraint-check/SKILL.md +165 -0
  107. package/skills/context-engine/SKILL.md +176 -0
  108. package/skills/cook/SKILL.md +636 -0
  109. package/skills/db/SKILL.md +256 -0
  110. package/skills/debug/SKILL.md +240 -0
  111. package/skills/dependency-doctor/SKILL.md +235 -0
  112. package/skills/deploy/SKILL.md +174 -0
  113. package/skills/design/DESIGN-REFERENCE.md +365 -0
  114. package/skills/design/SKILL.md +462 -0
  115. package/skills/doc-processor/SKILL.md +254 -0
  116. package/skills/docs/SKILL.md +336 -0
  117. package/skills/docs-seeker/SKILL.md +166 -0
  118. package/skills/fix/SKILL.md +192 -0
  119. package/skills/git/SKILL.md +285 -0
  120. package/skills/hallucination-guard/SKILL.md +204 -0
  121. package/skills/incident/SKILL.md +241 -0
  122. package/skills/integrity-check/SKILL.md +169 -0
  123. package/skills/journal/SKILL.md +190 -0
  124. package/skills/launch/SKILL.md +330 -0
  125. package/skills/logic-guardian/SKILL.md +240 -0
  126. package/skills/marketing/SKILL.md +229 -0
  127. package/skills/mcp-builder/SKILL.md +311 -0
  128. package/skills/onboard/SKILL.md +298 -0
  129. package/skills/perf/SKILL.md +297 -0
  130. package/skills/plan/SKILL.md +520 -0
  131. package/skills/preflight/SKILL.md +231 -0
  132. package/skills/problem-solver/SKILL.md +284 -0
  133. package/skills/rescue/SKILL.md +434 -0
  134. package/skills/research/SKILL.md +122 -0
  135. package/skills/review/SKILL.md +354 -0
  136. package/skills/review-intake/SKILL.md +222 -0
  137. package/skills/safeguard/SKILL.md +188 -0
  138. package/skills/sast/SKILL.md +190 -0
  139. package/skills/scaffold/SKILL.md +276 -0
  140. package/skills/scope-guard/SKILL.md +150 -0
  141. package/skills/scout/SKILL.md +232 -0
  142. package/skills/sentinel/SKILL.md +320 -0
  143. package/skills/sentinel-env/SKILL.md +226 -0
  144. package/skills/sequential-thinking/SKILL.md +234 -0
  145. package/skills/session-bridge/SKILL.md +287 -0
  146. package/skills/skill-forge/SKILL.md +317 -0
  147. package/skills/skill-router/SKILL.md +267 -0
  148. package/skills/surgeon/SKILL.md +203 -0
  149. package/skills/team/SKILL.md +397 -0
  150. package/skills/test/SKILL.md +271 -0
  151. package/skills/trend-scout/SKILL.md +145 -0
  152. package/skills/verification/SKILL.md +201 -0
  153. package/skills/video-creator/SKILL.md +201 -0
  154. package/skills/watchdog/SKILL.md +166 -0
  155. package/skills/worktree/SKILL.md +140 -0
@@ -0,0 +1,201 @@
1
+ ---
2
+ name: video-creator
3
+ description: Video content planning. Writes narration scripts, storyboards, shot lists, and asset checklists. Saves plan to marketing/video-plan.md.
4
+ metadata:
5
+ author: runedev
6
+ version: "0.2.0"
7
+ layer: L3
8
+ model: sonnet
9
+ group: media
10
+ tools: "Read, Write, Edit, Glob, Grep"
11
+ ---
12
+
13
+ # video-creator
14
+
15
+ ## Purpose
16
+
17
+ Video content planning for product demos and marketing. Writes narration scripts with timing marks, creates scene-by-scene storyboards, defines shot lists, and lists required assets. Saves the complete production plan to a file. This skill creates PLANS for video production — not actual video files.
18
+
19
+ ## Called By (inbound)
20
+
21
+ - `marketing` (L2): demo/explainer video scripts
22
+ - `launch` (L1): product demo videos
23
+
24
+ ## Calls (outbound)
25
+
26
+ None — pure L3 utility.
27
+
28
+ ## Executable Instructions
29
+
30
+ ### Step 1: Receive Brief
31
+
32
+ Accept input from calling skill:
33
+ - `topic` — what the video is about (e.g. "Rune plugin demo", "Feature X walkthrough")
34
+ - `audience` — who will watch (e.g. "developers", "non-technical founders", "existing users")
35
+ - `duration` — target length in seconds (e.g. 60, 120, 300)
36
+ - `platform` — where it will be published: `youtube` | `twitter` | `tiktok` | `loom` | `internal`
37
+ - `output_path` — where to save the plan (default: `marketing/video-plan.md`)
38
+
39
+ Derive constraints from platform:
40
+ - YouTube: no strict length limit, chapters recommended for > 3min
41
+ - Twitter/X: max 140 seconds, hook in first 3 seconds
42
+ - TikTok: max 60 seconds, fast-paced cuts, captions required
43
+ - Loom: async-friendly, screen recording focus, no music needed
44
+
45
+ ### Step 2: Script
46
+
47
+ Write a narration script with timing marks:
48
+
49
+ Structure:
50
+ - **Hook** (0–5s): opening line that grabs attention — state the problem or the payoff
51
+ - **Setup** (5–15s): context — who this is for and what they will learn
52
+ - **Demo/Body** (15s–[duration-15s]): main content broken into scenes
53
+ - **CTA** (last 10s): call to action — what to do next (star repo, sign up, share)
54
+
55
+ Format each section:
56
+ ```
57
+ [00:00] HOOK
58
+ Narration: "..."
59
+ On screen: [what viewer sees]
60
+
61
+ [00:05] SETUP
62
+ Narration: "..."
63
+ On screen: [what viewer sees]
64
+ ```
65
+
66
+ ### Step 3: Storyboard
67
+
68
+ Create a scene-by-scene breakdown:
69
+
70
+ For each scene:
71
+ - Scene number and name
72
+ - Duration in seconds
73
+ - Visual description (what appears on screen)
74
+ - Narration text (from Step 2)
75
+ - Transition type: cut | fade | zoom | slide
76
+
77
+ Example:
78
+ ```
79
+ Scene 3: Live demo — install command
80
+ Duration: 12s
81
+ Visual: Terminal window, typed command "npm install -g @rune/cli", output scrolling
82
+ Narration: "Install in seconds with one command."
83
+ Transition: cut
84
+ ```
85
+
86
+ ### Step 4: Shot List
87
+
88
+ Define exactly what needs to be recorded or shown:
89
+
90
+ Categorize by type:
91
+ - **Screen recording**: list each screen state to capture (URL, app state, what to do)
92
+ - **Code snippet**: list each code block to display (file path + line range, or inline)
93
+ - **Diagram/slide**: list each static visual needed (title, key points)
94
+ - **Terminal**: list each command sequence to record
95
+
96
+ Format:
97
+ ```
98
+ Shot 1 — Screen recording
99
+ URL: https://myapp.com/dashboard
100
+ Action: Click "New Project" → fill form → click Create
101
+ Duration: ~8s
102
+
103
+ Shot 2 — Terminal
104
+ Command: npm install -g @rune/cli && rune init my-project
105
+ Expected output: [describe what should appear]
106
+ Duration: ~10s
107
+ ```
108
+
109
+ ### Step 5: Assets Needed
110
+
111
+ List every asset required before recording can begin:
112
+
113
+ - Screenshots (which pages/states)
114
+ - Code snippets (which files, which sections)
115
+ - Diagrams (topic, style: flowchart | architecture | comparison table)
116
+ - Slide backgrounds or title cards
117
+ - Thumbnail (dimensions based on platform: YouTube 1280x720, Twitter 1200x628)
118
+
119
+ ### Step 6: Report
120
+
121
+ Use `Write` to save the complete video plan to `marketing/video-plan.md` (or the specified `output_path`):
122
+
123
+ ```markdown
124
+ # Video Plan: [topic]
125
+
126
+ - **Platform**: [platform]
127
+ - **Target Duration**: [duration]s
128
+ - **Audience**: [audience]
129
+ - **Created**: [date]
130
+
131
+ ## Script
132
+ [full timestamped script from Step 2]
133
+
134
+ ## Storyboard
135
+ [scene-by-scene breakdown from Step 3]
136
+
137
+ ## Shot List
138
+ [all shots from Step 4]
139
+
140
+ ## Assets Needed
141
+ [checklist from Step 5]
142
+
143
+ ## Platform Notes
144
+ [constraints and tips for the target platform]
145
+ ```
146
+
147
+ Then output a summary to the calling skill:
148
+
149
+ ```
150
+ ## Video Plan Created
151
+
152
+ - File: [output_path]
153
+ - Scenes: [count]
154
+ - Shots: [count]
155
+ - Estimated recording time: [n] minutes
156
+ - Assets to prepare: [count] items
157
+
158
+ ### Next Steps
159
+ 1. Prepare assets listed in the plan
160
+ 2. Record shots in order from the shot list
161
+ 3. Edit using the storyboard as reference
162
+ ```
163
+
164
+ ## Note
165
+
166
+ This skill creates PLANS for video production. Actual recording and editing must be done by a human or a dedicated screen recording tool.
167
+
168
+ ## Output Format
169
+
170
+ Video Plan saved to `marketing/video-plan.md` with script, storyboard, shot list, assets checklist, and platform notes. Summary report with scene/shot counts and estimated recording time. See Step 6 Report above for full template.
171
+
172
+ ## Constraints
173
+
174
+ 1. MUST confirm video parameters (duration, resolution, format) before generating
175
+ 2. MUST NOT exceed reasonable file sizes without user confirmation
176
+ 3. MUST save to project assets directory
177
+
178
+ ## Sharp Edges
179
+
180
+ Known failure modes for this skill. Check these before declaring done.
181
+
182
+ | Failure Mode | Severity | Mitigation |
183
+ |---|---|---|
184
+ | Platform constraints not applied (e.g., Twitter max 140s exceeded) | HIGH | Step 1: derive constraints from platform immediately — they constrain everything downstream |
185
+ | Missing CTA section in script | MEDIUM | CTA (last 10s) is required in every script — no exceptions regardless of duration |
186
+ | Not saving to file (only verbal output) | HIGH | Constraint 3 + Step 6: Write to output_path is mandatory — verbal only = no persistence |
187
+ | Promising an actual deliverable video file | MEDIUM | Note explicitly: this skill creates a PLAN — actual recording is done by a human |
188
+
189
+ ## Done When
190
+
191
+ - Platform constraints identified and applied to duration/format
192
+ - Script written with timing marks (hook, setup, demo/body, CTA)
193
+ - Storyboard created scene-by-scene with transitions
194
+ - Shot list categorized by type (screen recording, terminal, code, diagram)
195
+ - Assets needed checklist generated
196
+ - video-plan.md written to output_path via Write tool
197
+ - Video Plan Created report emitted with scene count, shot count, and asset count
198
+
199
+ ## Cost Profile
200
+
201
+ ~500-1500 tokens input, ~500-1000 tokens output. Sonnet for script quality.
@@ -0,0 +1,166 @@
1
+ ---
2
+ name: watchdog
3
+ description: Post-deploy monitoring. Checks if deployed app is healthy — HTTP status, response times, error detection, and smoke test report.
4
+ metadata:
5
+ author: runedev
6
+ version: "0.2.0"
7
+ layer: L3
8
+ model: sonnet
9
+ group: monitoring
10
+ tools: "Read, Bash, Glob, Grep"
11
+ ---
12
+
13
+ # watchdog
14
+
15
+ ## Purpose
16
+
17
+ Post-deploy monitoring. Receives a deployed URL and list of expected endpoints, runs health checks, measures response times, detects errors, and returns a structured smoke test report.
18
+
19
+ ## Called By (inbound)
20
+
21
+ - `deploy` (L2): post-deploy monitoring setup
22
+ - `launch` (L1): monitoring as part of launch pipeline
23
+ - `incident` (L2): current system state check during incident triage
24
+
25
+ ## Calls (outbound)
26
+
27
+ None — pure L3 utility.
28
+
29
+ ## Executable Instructions
30
+
31
+ ### Step 1: Receive Target
32
+
33
+ Accept input from calling skill:
34
+ - `base_url` — deployed application URL (e.g. `https://myapp.com`)
35
+ - `endpoints` — list of paths to check (e.g. `["/", "/health", "/api/status"]`)
36
+
37
+ If no endpoints provided, default to: `["/", "/health", "/ready"]`
38
+
39
+ ### Step 2: Health Check
40
+
41
+ For each endpoint, run an HTTP status check using `Bash`:
42
+
43
+ ```bash
44
+ curl -s -o /dev/null -w "%{http_code}" https://myapp.com/health
45
+ ```
46
+
47
+ - 2xx → HEALTHY
48
+ - 3xx → REDIRECT (note final destination)
49
+ - 4xx → CLIENT_ERROR (flag as alert)
50
+ - 5xx → SERVER_ERROR (flag as critical alert)
51
+ - Connection refused / timeout → UNREACHABLE (flag as critical)
52
+
53
+ ### Step 3: Response Time
54
+
55
+ For each endpoint, measure latency using `Bash`:
56
+
57
+ ```bash
58
+ curl -s -o /dev/null -w "%{time_total}" https://myapp.com/health
59
+ ```
60
+
61
+ Thresholds:
62
+ - < 500ms → FAST
63
+ - 500ms–2000ms → ACCEPTABLE
64
+ - > 2000ms → SLOW (flag as alert)
65
+
66
+ ### Step 4: Performance Signal Analysis
67
+
68
+ After collecting response times from Step 3, analyze for patterns that indicate root causes:
69
+
70
+ - **Consistently 2x+ slower than baseline** (or > 2000ms with no apparent load): flag with `PERF_WARN — investigate N+1 query or missing DB index`
71
+ - **Endpoint cluster degradation**: if 3+ endpoints share a pattern (all auth endpoints slow, all /api/* slow): flag `PERF_WARN — connection pool saturation likely`
72
+ - **Spike after deploy**: compare with previous watchdog run if available — if an endpoint that was FAST is now SLOW, flag `PERF_REGRESSION — correlate with recent git diff`
73
+
74
+ If no previous baseline exists, skip spike detection and note `INFO: no baseline — first run`.
75
+
76
+ Output performance signals into a `perf_signals` list (separate from `alerts`).
77
+
78
+ ### Step 5: Error Detection
79
+
80
+ Scan responses for problems:
81
+ - 4xx/5xx HTTP codes → log endpoint + status code
82
+ - Response time > 2s → log endpoint + measured time
83
+ - Connection timeout (curl exits non-zero) → UNREACHABLE
84
+ - Empty response body on non-204 endpoints → flag as WARNING
85
+
86
+ Collect all flagged issues into an `alerts` list.
87
+
88
+ ### Step 6: Report
89
+
90
+ Output the following report structure:
91
+
92
+ ```
93
+ ## Watchdog Report: [base_url]
94
+
95
+ ### Smoke Test Results
96
+ - [endpoint] — [HTTP status] ([response_time]s) — [HEALTHY|REDIRECT|CLIENT_ERROR|SERVER_ERROR|UNREACHABLE]
97
+
98
+ ### Alert Rules Applied
99
+ - Response time > 2s → alert
100
+ - Any 4xx on non-auth endpoint → alert
101
+ - Any 5xx → critical alert
102
+ - Unreachable → critical alert
103
+
104
+ ### Alerts
105
+ - [CRITICAL|WARNING] [endpoint] — [reason]
106
+
107
+ ### Performance Signals
108
+ - [PERF_WARN|PERF_REGRESSION|INFO] [endpoint] — [diagnosis]
109
+
110
+ ### Summary
111
+ - Total endpoints checked: [n]
112
+ - Healthy: [n]
113
+ - Alerts: [n]
114
+ - Perf Signals: [n]
115
+ - Overall status: ALL_HEALTHY | DEGRADED | DOWN
116
+ ```
117
+
118
+ If no alerts and no perf signals: output `Overall status: ALL_HEALTHY`.
119
+
120
+ ## Output Format
121
+
122
+ ```
123
+ ## Watchdog Report: [base_url]
124
+ ### Smoke Test Results
125
+ - / — 200 (0.231s) — HEALTHY
126
+ - /health — 200 (0.089s) — HEALTHY
127
+ - /api/status — 500 (1.203s) — SERVER_ERROR
128
+
129
+ ### Alerts
130
+ - CRITICAL /api/status — HTTP 500
131
+
132
+ ### Summary
133
+ - Total: 3 | Healthy: 2 | Alerts: 1
134
+ - Overall status: DEGRADED
135
+ ```
136
+
137
+ ## Constraints
138
+
139
+ 1. MUST report with specific metrics — not vague "performance seems slow"
140
+ 2. MUST include baseline comparison when available
141
+ 3. MUST NOT generate false alarms — precision over recall
142
+ 4. MUST separate perf signals from error alerts — they are different severity channels
143
+ 5. MUST NOT call `perf` skill — watchdog is a detector, not a diagnoser
144
+
145
+ ## Sharp Edges
146
+
147
+ Known failure modes for this skill. Check these before declaring done.
148
+
149
+ | Failure Mode | Severity | Mitigation |
150
+ |---|---|---|
151
+ | curl timeout treated as slow (not unreachable) | HIGH | Non-zero curl exit code = UNREACHABLE, not a response time measurement |
152
+ | PERF_REGRESSION reported without baseline | MEDIUM | Only flag regression if a previous run exists — otherwise INFO: first run |
153
+ | All endpoints flagged SLOW because test env is slow | MEDIUM | Note environment context — add `ENV: non-production detected` if URL contains dev/staging/localhost |
154
+ | Perf signal without actionable diagnosis | LOW | Every PERF_WARN must include a hypothesis (N+1, pool saturation, etc.) |
155
+
156
+ ## Done When
157
+
158
+ - All specified endpoints checked (HTTP status + response time measured)
159
+ - All 4xx/5xx → `alerts` list, all SLOW → `alerts` list
160
+ - Performance patterns analyzed → `perf_signals` list (or INFO: first run)
161
+ - Structured Watchdog Report emitted with Alerts + Performance Signals + Summary
162
+ - Overall status is ALL_HEALTHY, DEGRADED, or DOWN (never ambiguous)
163
+
164
+ ## Cost Profile
165
+
166
+ ~500-1500 tokens input, ~300-800 tokens output. Sonnet for configuration quality.
@@ -0,0 +1,140 @@
1
+ ---
2
+ name: worktree
3
+ description: "Git worktree lifecycle management. Creates isolated workspaces for parallel development, manages branches, handles cleanup. Called by team and cook for parallel isolation."
4
+ user-invocable: false
5
+ metadata:
6
+ author: runedev
7
+ version: "1.1.0"
8
+ layer: L3
9
+ model: haiku
10
+ group: utility
11
+ tools: "Read, Bash, Glob, Grep"
12
+ ---
13
+
14
+ # worktree
15
+
16
+ ## Purpose
17
+
18
+ Reusable git worktree lifecycle management. Creates isolated workspaces for parallel agent development, manages branch naming, handles cleanup after merge or abort. Extracted from `team` to be usable by any skill that needs workspace isolation.
19
+
20
+ ## Triggers
21
+
22
+ - Called by `team` (L1) for parallel stream isolation
23
+ - Called by `cook` (L1) when user explicitly requests worktree isolation
24
+ - `/rune worktree create <name>` — manual creation
25
+ - `/rune worktree cleanup` — manual cleanup of stale worktrees
26
+
27
+ ## Calls (outbound)
28
+
29
+ None — pure git operations via Bash.
30
+
31
+ ## Called By (inbound)
32
+
33
+ - `team` (L1): Phase 2 ASSIGN — create worktrees for parallel streams
34
+ - `cook` (L1): optional isolation for complex features
35
+ - User: direct invocation for manual worktree management
36
+
37
+ ## Operations
38
+
39
+ ### Create Worktree
40
+
41
+ ```
42
+ Input: { name: string, base_branch?: string }
43
+ Default base: current HEAD
44
+
45
+ Steps:
46
+ 1. Bash: git worktree add .claude/worktrees/<name> -b rune/<name> [base_branch]
47
+ 2. Verify: Bash: git worktree list | grep <name>
48
+ 3. Return: { path: ".claude/worktrees/<name>", branch: "rune/<name>" }
49
+
50
+ Naming convention:
51
+ - Branch: rune/<name> (e.g., rune/stream-a, rune/auth-feature)
52
+ - Path: .claude/worktrees/<name>
53
+ - Max 3 active worktrees (enforced)
54
+ ```
55
+
56
+ ### List Worktrees
57
+
58
+ ```
59
+ Bash: git worktree list
60
+ → Parse output into: [{ path, branch, commit }]
61
+ → Filter: only rune/* branches (skip main worktree)
62
+ ```
63
+
64
+ ### Cleanup Worktree
65
+
66
+ ```
67
+ Input: { name: string, force?: boolean }
68
+
69
+ Steps:
70
+ 1. Check if branch is merged: Bash: git branch --merged main | grep rune/<name>
71
+ 2. If merged OR force:
72
+ Bash: git worktree remove .claude/worktrees/<name> --force
73
+ Bash: git branch -d rune/<name> (or -D if force)
74
+ 3. If NOT merged AND NOT force:
75
+ WARN: "Branch rune/<name> has unmerged changes. Use force=true to remove."
76
+ ```
77
+
78
+ ### Cleanup All Stale
79
+
80
+ ```
81
+ Bash: git worktree list --porcelain
82
+ → For each rune/* worktree:
83
+ → Check if branch exists: git branch --list rune/<name>
84
+ → If branch deleted: git worktree prune
85
+ → If branch merged: cleanup (see above)
86
+ → Report: removed [N] stale worktrees
87
+ ```
88
+
89
+ ## Safety Rules
90
+
91
+ ```
92
+ 1. NEVER delete a worktree with uncommitted changes without user confirmation
93
+ 2. NEVER force-delete an unmerged branch without user confirmation
94
+ 3. MAX 3 active rune/* worktrees — refuse creation if limit reached
95
+ 4. ALWAYS use .claude/worktrees/ directory — not project root
96
+ 5. ALWAYS prefix branches with rune/ — easy identification and cleanup
97
+ ```
98
+
99
+ ## Output Format
100
+
101
+ ```
102
+ ## Worktree Report
103
+ - **Action**: create | cleanup | list
104
+ - **Worktrees**: [count active]
105
+
106
+ ### Active Worktrees
107
+ | Name | Branch | Path | Status |
108
+ |------|--------|------|--------|
109
+ | stream-a | rune/stream-a | .claude/worktrees/stream-a | active |
110
+ | stream-b | rune/stream-b | .claude/worktrees/stream-b | merged |
111
+ ```
112
+
113
+ ## Constraints
114
+
115
+ 1. MUST use .claude/worktrees/ directory for all worktrees
116
+ 2. MUST prefix branches with rune/ namespace
117
+ 3. MUST NOT exceed 3 active worktrees
118
+ 4. MUST check for uncommitted changes before cleanup
119
+ 5. MUST NOT force-delete unmerged branches without explicit user confirmation
120
+
121
+ ## Sharp Edges
122
+
123
+ | Failure Mode | Severity | Mitigation |
124
+ |---|---|---|
125
+ | Worktree left behind after failed merge | MEDIUM | Cleanup All Stale operation + pre-team-merge tag for recovery |
126
+ | Branch name collision with existing branch | LOW | Check branch existence before creation, append timestamp if collision |
127
+ | Worktree path on Windows with long path | MEDIUM | Use short names, keep under .claude/worktrees/ to minimize path length |
128
+ | Deleting worktree with uncommitted agent work | HIGH | Safety Rule 1: always check for uncommitted changes first |
129
+
130
+ ## Done When
131
+
132
+ - Worktree created/listed/cleaned up as requested
133
+ - Branch naming follows rune/ convention
134
+ - Active worktree count ≤ 3
135
+ - No stale worktrees left behind
136
+ - Worktree Report emitted
137
+
138
+ ## Cost Profile
139
+
140
+ ~200-500 tokens. Haiku + Bash commands. Fast and cheap.