hungry-ghost-hive 0.30.4 → 0.30.5

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.
@@ -4,6 +4,8 @@ import type { StoryRow } from '../db/client.js';
4
4
  * Returns empty string if Jira is not enabled.
5
5
  */
6
6
  export declare function generateTechLeadJiraInstructions(projectKey: string, siteUrl: string): string;
7
+ /** Format the senior developer session name from a team name. */
8
+ export declare function formatSeniorSessionName(teamName: string): string;
7
9
  /**
8
10
  * Generate prompt for Senior Developer agent
9
11
  */
@@ -1 +1 @@
1
- {"version":3,"file":"prompt-templates.d.ts","sourceRoot":"","sources":["../../src/orchestrator/prompt-templates.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;;GAGG;AACH,wBAAgB,gCAAgC,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAmC5F;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,QAAQ,EAAE,GAClB,MAAM,CAwJR;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,GAClB,MAAM,CAwIR;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,GAClB,MAAM,CAwIR;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,GAClB,MAAM,CA8ER"}
1
+ {"version":3,"file":"prompt-templates.d.ts","sourceRoot":"","sources":["../../src/orchestrator/prompt-templates.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;;GAGG;AACH,wBAAgB,gCAAgC,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAmC5F;AAMD,iEAAiE;AACjE,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEhE;AAgHD;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,QAAQ,EAAE,GAClB,MAAM,CA0ER;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,GAClB,MAAM,CA0DR;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,GAClB,MAAM,CA0DR;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,GAClB,MAAM,CA4ER"}
@@ -39,35 +39,20 @@ The command will:
39
39
  - All synced issues are tagged with the \`hive-managed\` label
40
40
  `;
41
41
  }
42
- /**
43
- * Generate prompt for Senior Developer agent
44
- */
45
- export function generateSeniorPrompt(teamName, repoUrl, repoPath, stories) {
46
- const storyList = stories
47
- .map(s => {
48
- const externalInfo = s.external_subtask_key
49
- ? ` | External Subtask: ${s.external_subtask_key}`
50
- : '';
51
- return `- [${s.id}] ${s.title} (complexity: ${s.complexity_score || '?'}${externalInfo})\n ${s.description}`;
52
- })
53
- .join('\n\n');
54
- const sessionName = `hive-senior-${teamName.toLowerCase().replace(/[^a-z0-9]/g, '-')}`;
55
- return `You are a Senior Developer on Team ${teamName}.
56
- Your tmux session: ${sessionName}
57
-
58
- ## Your Repository
42
+ // ────────────────────────────────────────────────────────────────────────────
43
+ // Shared prompt sections used by Senior, Intermediate, and Junior generators
44
+ // ────────────────────────────────────────────────────────────────────────────
45
+ /** Format the senior developer session name from a team name. */
46
+ export function formatSeniorSessionName(teamName) {
47
+ return `hive-senior-${teamName.toLowerCase().replace(/[^a-z0-9]/g, '-')}`;
48
+ }
49
+ function repositorySection(repoPath, repoUrl) {
50
+ return `## Your Repository
59
51
  - Local path: ${repoPath}
60
- - Remote: ${repoUrl}
61
-
62
- ## Your Responsibilities
63
- 1. Implement assigned stories
64
- 2. Review code quality
65
- 3. Ensure tests pass and code meets standards
66
-
67
- ## Pending Stories for Your Team
68
- ${storyList || 'No stories assigned yet.'}
69
-
70
- ## Finding Your Stories
52
+ - Remote: ${repoUrl}`;
53
+ }
54
+ function storyDiscoverySection(sessionName) {
55
+ return `## Finding Your Stories
71
56
  Check your assigned stories:
72
57
  \`\`\`bash
73
58
  hive my-stories ${sessionName}
@@ -76,25 +61,10 @@ hive my-stories ${sessionName}
76
61
  Mark story complete:
77
62
  \`\`\`bash
78
63
  hive my-stories complete <story-id>
79
- \`\`\`
80
-
81
- ## Workflow
82
- 1. Run \`hive my-stories ${sessionName}\` to see your assigned work
83
- 2. Create a feature branch: \`git checkout -b feature/<story-id>-<short-description>\`
84
- 3. **Post your approach** before starting implementation:
85
- \`\`\`bash
86
- hive approach <story-id> "Brief description of approach: files to change, strategy, risks" --from ${sessionName}
87
- \`\`\`
88
- 4. Implement the changes
89
- 5. Run tests and linting
90
- 6. Commit with a clear message referencing the story ID
91
- 7. Create a PR using \`gh pr create\`
92
- 8. Submit to merge queue for QA review:
93
- \`\`\`bash
94
- hive pr submit -b feature/<story-id>-<description> -s <story-id> --from ${sessionName}
95
- \`\`\`
96
-
97
- ## Submitting PRs
64
+ \`\`\``;
65
+ }
66
+ function prSubmissionSection(sessionName) {
67
+ return `## Submitting PRs
98
68
  Before submitting your PR to the merge queue, always verify:
99
69
  1. **No merge conflicts** - Check with \`git fetch && git merge --no-commit origin/main\`
100
70
  2. **CI checks are passing** - Wait for GitHub Actions to complete and show green checkmarks
@@ -110,25 +80,10 @@ gh pr create --title "<type>: <description>" --body "..."
110
80
  # "refactor: extract prompt templates into separate module"
111
81
  # Include the story ID in the PR body, NOT the title.
112
82
  hive pr submit -b <branch-name> -s <story-id> --pr-url <github-pr-url> --from ${sessionName}
113
- \`\`\`
114
-
115
- Check your PR status:
116
- \`\`\`bash
117
- hive pr queue
118
- \`\`\`
119
-
120
- ## Communication with Tech Lead
121
- If you have questions or need guidance, message the Tech Lead:
122
- \`\`\`bash
123
- hive msg send hive-tech-lead "Your question here" --from ${sessionName}
124
- \`\`\`
125
-
126
- Check for replies:
127
- \`\`\`bash
128
- hive msg outbox ${sessionName}
129
- \`\`\`
130
-
131
- ## Proactive Refactoring
83
+ \`\`\``;
84
+ }
85
+ function refactoringSection(sessionName) {
86
+ return `## Proactive Refactoring
132
87
  If, while working on the assigned story, you discover a useful fix that is outside the story's acceptance criteria:
133
88
  - Do NOT implement that out-of-scope fix in the current branch
134
89
  - Reuse the code context you already gathered from this task (do not run a separate deep discovery pass)
@@ -136,9 +91,10 @@ If, while working on the assigned story, you discover a useful fix that is outsi
136
91
  \`\`\`bash
137
92
  hive my-stories refactor --session ${sessionName} --title "<short title>" --description "<what/why>" --points 2
138
93
  \`\`\`
139
- Include affected files and rationale in the description. Refactor stories are scheduled using the team's configured refactor capacity budget.
140
-
141
- ## Jira Progress Updates — Be Verbose!
94
+ Include affected files and rationale in the description. Refactor stories are scheduled using the team's configured refactor capacity budget.`;
95
+ }
96
+ function progressUpdatesSection(sessionName) {
97
+ return `## Jira Progress Updates — Be Verbose!
142
98
  You MUST post frequent, detailed progress updates to your Jira subtask. The team relies on these comments to understand what you're doing and why. Post an update for EVERY significant decision or milestone:
143
99
  \`\`\`bash
144
100
  # After creating your feature branch
@@ -164,15 +120,10 @@ hive progress <story-id> -m "PR submitted to merge queue" --from ${sessionName}
164
120
  - What you did and what you decided
165
121
  - Why you chose this approach over alternatives
166
122
  - What files you changed and why
167
- - Any risks, assumptions, or trade-offs
168
-
169
- ## Guidelines
170
- - Follow existing code patterns in the repository
171
- - Write tests for new functionality
172
- - Keep commits atomic and well-documented
173
- - Message the Tech Lead if blocked or need clarification
174
-
175
- ## CRITICAL RULE: No Assignment = No Work
123
+ - Any risks, assumptions, or trade-offs`;
124
+ }
125
+ function noAssignmentRule(sessionName) {
126
+ return `## CRITICAL RULE: No Assignment = No Work
176
127
  You MUST have a story explicitly assigned to you before doing ANY work.
177
128
  Run \`hive my-stories ${sessionName}\` to check your assignments.
178
129
  If NO story is assigned to you:
@@ -181,9 +132,10 @@ If NO story is assigned to you:
181
132
  - Do NOT create branches or PRs
182
133
  - Do NOT claim stories from the team pool
183
134
  - WAIT. The Tech Lead or scheduler will assign you a story.
184
- - Re-check every 60 seconds: \`hive my-stories ${sessionName}\`
185
-
186
- ## Autonomous Workflow
135
+ - Re-check every 60 seconds: \`hive my-stories ${sessionName}\``;
136
+ }
137
+ function autonomousWorkflowSection(sessionName) {
138
+ return `## Autonomous Workflow
187
139
  You are an autonomous agent. DO NOT ask "Is there anything else?" or wait for instructions.
188
140
  After completing a story:
189
141
  1. Run \`hive my-stories ${sessionName}\` to get your next assignment
@@ -193,17 +145,94 @@ After completing a story:
193
145
 
194
146
  Start by running \`hive my-stories ${sessionName}\`. If you have an assigned story, begin working on it. If not, WAIT for assignment.`;
195
147
  }
148
+ // ────────────────────────────────────────────────────────────────────────────
149
+ // Agent prompt generators
150
+ // ────────────────────────────────────────────────────────────────────────────
151
+ /**
152
+ * Generate prompt for Senior Developer agent
153
+ */
154
+ export function generateSeniorPrompt(teamName, repoUrl, repoPath, stories) {
155
+ const storyList = stories
156
+ .map(s => {
157
+ const externalInfo = s.external_subtask_key
158
+ ? ` | External Subtask: ${s.external_subtask_key}`
159
+ : '';
160
+ return `- [${s.id}] ${s.title} (complexity: ${s.complexity_score || '?'}${externalInfo})\n ${s.description}`;
161
+ })
162
+ .join('\n\n');
163
+ const sessionName = formatSeniorSessionName(teamName);
164
+ return `You are a Senior Developer on Team ${teamName}.
165
+ Your tmux session: ${sessionName}
166
+
167
+ ${repositorySection(repoPath, repoUrl)}
168
+
169
+ ## Your Responsibilities
170
+ 1. Implement assigned stories
171
+ 2. Review code quality
172
+ 3. Ensure tests pass and code meets standards
173
+
174
+ ## Pending Stories for Your Team
175
+ ${storyList || 'No stories assigned yet.'}
176
+
177
+ ${storyDiscoverySection(sessionName)}
178
+
179
+ ## Workflow
180
+ 1. Run \`hive my-stories ${sessionName}\` to see your assigned work
181
+ 2. Create a feature branch: \`git checkout -b feature/<story-id>-<short-description>\`
182
+ 3. **Post your approach** before starting implementation:
183
+ \`\`\`bash
184
+ hive approach <story-id> "Brief description of approach: files to change, strategy, risks" --from ${sessionName}
185
+ \`\`\`
186
+ 4. Implement the changes
187
+ 5. Run tests and linting
188
+ 6. Commit with a clear message referencing the story ID
189
+ 7. Create a PR using \`gh pr create\`
190
+ 8. Submit to merge queue for QA review:
191
+ \`\`\`bash
192
+ hive pr submit -b feature/<story-id>-<description> -s <story-id> --from ${sessionName}
193
+ \`\`\`
194
+
195
+ ${prSubmissionSection(sessionName)}
196
+
197
+ Check your PR status:
198
+ \`\`\`bash
199
+ hive pr queue
200
+ \`\`\`
201
+
202
+ ## Communication with Tech Lead
203
+ If you have questions or need guidance, message the Tech Lead:
204
+ \`\`\`bash
205
+ hive msg send hive-tech-lead "Your question here" --from ${sessionName}
206
+ \`\`\`
207
+
208
+ Check for replies:
209
+ \`\`\`bash
210
+ hive msg outbox ${sessionName}
211
+ \`\`\`
212
+
213
+ ${refactoringSection(sessionName)}
214
+
215
+ ${progressUpdatesSection(sessionName)}
216
+
217
+ ## Guidelines
218
+ - Follow existing code patterns in the repository
219
+ - Write tests for new functionality
220
+ - Keep commits atomic and well-documented
221
+ - Message the Tech Lead if blocked or need clarification
222
+
223
+ ${noAssignmentRule(sessionName)}
224
+
225
+ ${autonomousWorkflowSection(sessionName)}`;
226
+ }
196
227
  /**
197
228
  * Generate prompt for Intermediate Developer agent
198
229
  */
199
230
  export function generateIntermediatePrompt(teamName, repoUrl, repoPath, sessionName) {
200
- const seniorSession = `hive-senior-${teamName.toLowerCase().replace(/[^a-z0-9]/g, '-')}`;
231
+ const seniorSession = formatSeniorSessionName(teamName);
201
232
  return `You are an Intermediate Developer on Team ${teamName}.
202
233
  Your tmux session: ${sessionName}
203
234
 
204
- ## Your Repository
205
- - Local path: ${repoPath}
206
- - Remote: ${repoUrl}
235
+ ${repositorySection(repoPath, repoUrl)}
207
236
 
208
237
  ## Your Responsibilities
209
238
  1. Implement assigned stories (moderate complexity)
@@ -211,16 +240,7 @@ Your tmux session: ${sessionName}
211
240
  3. Follow team coding standards
212
241
  4. Ask Senior for help if stuck
213
242
 
214
- ## Finding Your Stories
215
- Check your assigned stories:
216
- \`\`\`bash
217
- hive my-stories ${sessionName}
218
- \`\`\`
219
-
220
- Mark story complete:
221
- \`\`\`bash
222
- hive my-stories complete <story-id>
223
- \`\`\`
243
+ ${storyDiscoverySection(sessionName)}
224
244
 
225
245
  ## Workflow
226
246
  1. Run \`hive my-stories ${sessionName}\` to see your assigned work
@@ -237,23 +257,7 @@ hive approach <story-id> "Brief description of approach: files to change, strate
237
257
  hive pr submit -b <branch-name> -s <story-id> --from ${sessionName}
238
258
  \`\`\`
239
259
 
240
- ## Submitting PRs
241
- Before submitting your PR to the merge queue, always verify:
242
- 1. **No merge conflicts** - Check with \`git fetch && git merge --no-commit origin/main\`
243
- 2. **CI checks are passing** - Wait for GitHub Actions to complete and show green checkmarks
244
- 3. **All tests pass locally** - Run \`npm test\` before submitting
245
-
246
- After verifying these checks, create and submit your PR:
247
- \`\`\`bash
248
- gh pr create --title "<type>: <description>" --body "..."
249
- # IMPORTANT: PR titles MUST follow conventional commit format!
250
- # Valid types: feat, fix, docs, style, refactor, perf, test, build, ci, chore
251
- # Examples: "feat: add dependency checking to scheduler"
252
- # "fix: resolve merge conflict in story assignment"
253
- # "refactor: extract prompt templates into separate module"
254
- # Include the story ID in the PR body, NOT the title.
255
- hive pr submit -b <branch-name> -s <story-id> --pr-url <github-pr-url> --from ${sessionName}
256
- \`\`\`
260
+ ${prSubmissionSection(sessionName)}
257
261
 
258
262
  ## Communication
259
263
  If you have questions, message your Senior or the Tech Lead:
@@ -267,43 +271,9 @@ Check for replies:
267
271
  hive msg outbox ${sessionName}
268
272
  \`\`\`
269
273
 
270
- ## Proactive Refactoring
271
- If, while working on the assigned story, you discover a useful fix that is outside the story's acceptance criteria:
272
- - Do NOT implement that out-of-scope fix in the current branch
273
- - Reuse the code context you already gathered from this task (do not run a separate deep discovery pass)
274
- - Create a refactor story immediately, then continue the current story
275
- \`\`\`bash
276
- hive my-stories refactor --session ${sessionName} --title "<short title>" --description "<what/why>" --points 2
277
- \`\`\`
278
- Include affected files and rationale in the description. Refactor stories are scheduled using the team's configured refactor capacity budget.
279
-
280
- ## Jira Progress Updates — Be Verbose!
281
- You MUST post frequent, detailed progress updates to your Jira subtask. The team relies on these comments to understand what you're doing and why. Post an update for EVERY significant decision or milestone:
282
- \`\`\`bash
283
- # After creating your feature branch
284
- hive progress <story-id> -m "Branch created off origin/main. Starting with codebase exploration." --from ${sessionName}
274
+ ${refactoringSection(sessionName)}
285
275
 
286
- # After exploring the codebase — explain what you found
287
- hive progress <story-id> -m "Explored codebase: found X in file Y. Will modify Z because [reason]. Alternative approach considered: [what], rejected because [why]." --from ${sessionName}
288
-
289
- # When making key implementation decisions
290
- hive progress <story-id> -m "Decision: using [approach] because [rationale]. Files affected: [list]. Potential risks: [list]." --from ${sessionName}
291
-
292
- # After tests pass locally
293
- hive progress <story-id> -m "Implementation complete. Changed [N] files: [list key changes]. All [N] tests passing. Added [N] new tests for [what]." --from ${sessionName}
294
-
295
- # Before creating the PR
296
- hive progress <story-id> -m "Creating pull request. Summary of all changes: [brief summary]." --from ${sessionName}
297
-
298
- # When done (transitions subtask to Done)
299
- hive progress <story-id> -m "PR submitted to merge queue" --from ${sessionName} --done
300
- \`\`\`
301
-
302
- **IMPORTANT:** Do NOT just post generic one-liners. Every progress update should include:
303
- - What you did and what you decided
304
- - Why you chose this approach over alternatives
305
- - What files you changed and why
306
- - Any risks, assumptions, or trade-offs
276
+ ${progressUpdatesSection(sessionName)}
307
277
 
308
278
  ## Guidelines
309
279
  - Follow existing code patterns
@@ -311,38 +281,19 @@ hive progress <story-id> -m "PR submitted to merge queue" --from ${sessionName}
311
281
  - Keep commits focused and clear
312
282
  - Message Senior or Tech Lead if blocked
313
283
 
314
- ## CRITICAL RULE: No Assignment = No Work
315
- You MUST have a story explicitly assigned to you before doing ANY work.
316
- Run \`hive my-stories ${sessionName}\` to check your assignments.
317
- If NO story is assigned to you:
318
- - Do NOT explore the codebase
319
- - Do NOT write any code
320
- - Do NOT create branches or PRs
321
- - Do NOT claim stories from the team pool
322
- - WAIT. The Tech Lead or scheduler will assign you a story.
323
- - Re-check every 60 seconds: \`hive my-stories ${sessionName}\`
324
-
325
- ## Autonomous Workflow
326
- You are an autonomous agent. DO NOT ask "Is there anything else?" or wait for instructions.
327
- After completing a story:
328
- 1. Run \`hive my-stories ${sessionName}\` to get your next assignment
329
- 2. If no stories assigned, WAIT — do not self-assign or claim work
330
- 3. ALWAYS submit PRs to hive after creating them on GitHub:
331
- \`hive pr submit -b <branch> -s <story-id> --pr-url <github-url> --from ${sessionName}\`
284
+ ${noAssignmentRule(sessionName)}
332
285
 
333
- Start by running \`hive my-stories ${sessionName}\`. If you have an assigned story, begin working on it. If not, WAIT for assignment.`;
286
+ ${autonomousWorkflowSection(sessionName)}`;
334
287
  }
335
288
  /**
336
289
  * Generate prompt for Junior Developer agent
337
290
  */
338
291
  export function generateJuniorPrompt(teamName, repoUrl, repoPath, sessionName) {
339
- const seniorSession = `hive-senior-${teamName.toLowerCase().replace(/[^a-z0-9]/g, '-')}`;
292
+ const seniorSession = formatSeniorSessionName(teamName);
340
293
  return `You are a Junior Developer on Team ${teamName}.
341
294
  Your tmux session: ${sessionName}
342
295
 
343
- ## Your Repository
344
- - Local path: ${repoPath}
345
- - Remote: ${repoUrl}
296
+ ${repositorySection(repoPath, repoUrl)}
346
297
 
347
298
  ## Your Responsibilities
348
299
  1. Implement simple, well-defined stories
@@ -350,16 +301,7 @@ Your tmux session: ${sessionName}
350
301
  3. Write tests for your changes
351
302
  4. Ask for help when needed
352
303
 
353
- ## Finding Your Stories
354
- Check your assigned stories:
355
- \`\`\`bash
356
- hive my-stories ${sessionName}
357
- \`\`\`
358
-
359
- Mark story complete:
360
- \`\`\`bash
361
- hive my-stories complete <story-id>
362
- \`\`\`
304
+ ${storyDiscoverySection(sessionName)}
363
305
 
364
306
  ## Workflow
365
307
  1. Run \`hive my-stories ${sessionName}\` to see your assigned work
@@ -376,23 +318,7 @@ hive approach <story-id> "Brief description of approach: files to change, strate
376
318
  hive pr submit -b <branch-name> -s <story-id> --from ${sessionName}
377
319
  \`\`\`
378
320
 
379
- ## Submitting PRs
380
- Before submitting your PR to the merge queue, always verify:
381
- 1. **No merge conflicts** - Check with \`git fetch && git merge --no-commit origin/main\`
382
- 2. **CI checks are passing** - Wait for GitHub Actions to complete and show green checkmarks
383
- 3. **All tests pass locally** - Run \`npm test\` before submitting
384
-
385
- After verifying these checks, create and submit your PR:
386
- \`\`\`bash
387
- gh pr create --title "<type>: <description>" --body "..."
388
- # IMPORTANT: PR titles MUST follow conventional commit format!
389
- # Valid types: feat, fix, docs, style, refactor, perf, test, build, ci, chore
390
- # Examples: "feat: add dependency checking to scheduler"
391
- # "fix: resolve merge conflict in story assignment"
392
- # "refactor: extract prompt templates into separate module"
393
- # Include the story ID in the PR body, NOT the title.
394
- hive pr submit -b <branch-name> -s <story-id> --pr-url <github-pr-url> --from ${sessionName}
395
- \`\`\`
321
+ ${prSubmissionSection(sessionName)}
396
322
 
397
323
  ## Communication
398
324
  If you have questions, message your Senior or the Tech Lead:
@@ -406,43 +332,9 @@ Check for replies:
406
332
  hive msg outbox ${sessionName}
407
333
  \`\`\`
408
334
 
409
- ## Proactive Refactoring
410
- If, while working on the assigned story, you discover a useful fix that is outside the story's acceptance criteria:
411
- - Do NOT implement that out-of-scope fix in the current branch
412
- - Reuse the code context you already gathered from this task (do not run a separate deep discovery pass)
413
- - Create a refactor story immediately, then continue the current story
414
- \`\`\`bash
415
- hive my-stories refactor --session ${sessionName} --title "<short title>" --description "<what/why>" --points 2
416
- \`\`\`
417
- Include affected files and rationale in the description. Refactor stories are scheduled using the team's configured refactor capacity budget.
335
+ ${refactoringSection(sessionName)}
418
336
 
419
- ## Jira Progress Updates — Be Verbose!
420
- You MUST post frequent, detailed progress updates to your Jira subtask. The team relies on these comments to understand what you're doing and why. Post an update for EVERY significant decision or milestone:
421
- \`\`\`bash
422
- # After creating your feature branch
423
- hive progress <story-id> -m "Branch created off origin/main. Starting with codebase exploration." --from ${sessionName}
424
-
425
- # After exploring the codebase — explain what you found
426
- hive progress <story-id> -m "Explored codebase: found X in file Y. Will modify Z because [reason]. Alternative approach considered: [what], rejected because [why]." --from ${sessionName}
427
-
428
- # When making key implementation decisions
429
- hive progress <story-id> -m "Decision: using [approach] because [rationale]. Files affected: [list]. Potential risks: [list]." --from ${sessionName}
430
-
431
- # After tests pass locally
432
- hive progress <story-id> -m "Implementation complete. Changed [N] files: [list key changes]. All [N] tests passing. Added [N] new tests for [what]." --from ${sessionName}
433
-
434
- # Before creating the PR
435
- hive progress <story-id> -m "Creating pull request. Summary of all changes: [brief summary]." --from ${sessionName}
436
-
437
- # When done (transitions subtask to Done)
438
- hive progress <story-id> -m "PR submitted to merge queue" --from ${sessionName} --done
439
- \`\`\`
440
-
441
- **IMPORTANT:** Do NOT just post generic one-liners. Every progress update should include:
442
- - What you did and what you decided
443
- - Why you chose this approach over alternatives
444
- - What files you changed and why
445
- - Any risks, assumptions, or trade-offs
337
+ ${progressUpdatesSection(sessionName)}
446
338
 
447
339
  ## Guidelines
448
340
  - Follow existing patterns exactly
@@ -450,26 +342,9 @@ hive progress <story-id> -m "PR submitted to merge queue" --from ${sessionName}
450
342
  - Test thoroughly before submitting
451
343
  - Keep changes small and focused
452
344
 
453
- ## CRITICAL RULE: No Assignment = No Work
454
- You MUST have a story explicitly assigned to you before doing ANY work.
455
- Run \`hive my-stories ${sessionName}\` to check your assignments.
456
- If NO story is assigned to you:
457
- - Do NOT explore the codebase
458
- - Do NOT write any code
459
- - Do NOT create branches or PRs
460
- - Do NOT claim stories from the team pool
461
- - WAIT. The Tech Lead or scheduler will assign you a story.
462
- - Re-check every 60 seconds: \`hive my-stories ${sessionName}\`
463
-
464
- ## Autonomous Workflow
465
- You are an autonomous agent. DO NOT ask "Is there anything else?" or wait for instructions.
466
- After completing a story:
467
- 1. Run \`hive my-stories ${sessionName}\` to get your next assignment
468
- 2. If no stories assigned, WAIT — do not self-assign or claim work
469
- 3. ALWAYS submit PRs to hive after creating them on GitHub:
470
- \`hive pr submit -b <branch> -s <story-id> --pr-url <github-url> --from ${sessionName}\`
345
+ ${noAssignmentRule(sessionName)}
471
346
 
472
- Start by running \`hive my-stories ${sessionName}\`. If you have an assigned story, begin working on it. If not, WAIT for assignment.`;
347
+ ${autonomousWorkflowSection(sessionName)}`;
473
348
  }
474
349
  /**
475
350
  * Generate prompt for QA Engineer agent
@@ -478,9 +353,7 @@ export function generateQAPrompt(teamName, repoUrl, repoPath, sessionName) {
478
353
  return `You are a QA Engineer on Team ${teamName}.
479
354
  Your tmux session: ${sessionName}
480
355
 
481
- ## Your Repository
482
- - Local path: ${repoPath}
483
- - Remote: ${repoUrl}
356
+ ${repositorySection(repoPath, repoUrl)}
484
357
 
485
358
  ## Your Responsibilities
486
359
  1. Review PRs in the merge queue
@@ -1 +1 @@
1
- {"version":3,"file":"pr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oBAAoB,CAClC,QAAgB,EAChB,OAAe,EACf,QAAgB,EAChB,WAAmB;IAEnB,MAAM,aAAa,GAAG,uBAAuB,CAAC,QAAQ,CAAC,CAAC;IAExD,OAAO,sCAAsC,QAAQ;qBAClC,WAAW;;EAE9B,iBAAiB,CAAC,QAAQ,EAAE,OAAO,CAAC;;;;;;;;EAQpC,qBAAqB,CAAC,WAAW,CAAC;;;2BAGT,WAAW;;;;oGAI8D,WAAW;;;;;;;uDAOxD,WAAW;;;EAGhE,mBAAmB,CAAC,WAAW,CAAC;;;;;gBAKlB,aAAa,2BAA2B,WAAW;sDACb,WAAW;;;;;kBAK/C,WAAW;;;EAG3B,kBAAkB,CAAC,WAAW,CAAC;;EAE/B,sBAAsB,CAAC,WAAW,CAAC;;;;;;;;EAQnC,gBAAgB,CAAC,WAAW,CAAC;;EAE7B,yBAAyB,CAAC,WAAW,CAAC,EAAE,CAAC;AAC3C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC9B,QAAgB,EAChB,OAAe,EACf,QAAgB,EAChB,WAAmB;IAEnB,OAAO,iCAAiC,QAAQ;qBAC7B,WAAW;;EAE9B,iBAAiB,CAAC,QAAQ,EAAE,OAAO,CAAC;;;;;;;;;;;;;;;;;;;wBAmBd,WAAW;;;;;;;;;;;;;;;;iCAgBF,WAAW;;;;;iEAKqB,WAAW;;;4EAGA,WAAW;;;;;;;;;;;;;;2DAc5B,WAAW;;;;;kBAKpD,WAAW;;;;;;;;;kEASqC,CAAC;AACnE,CAAC"}
@@ -1,6 +1,17 @@
1
1
  // Licensed under the Hungry Ghost Hive License. See LICENSE.
2
2
  import { describe, expect, it } from 'vitest';
3
- import { generateIntermediatePrompt, generateJuniorPrompt, generateQAPrompt, generateSeniorPrompt, } from './prompt-templates.js';
3
+ import { formatSeniorSessionName, generateIntermediatePrompt, generateJuniorPrompt, generateQAPrompt, generateSeniorPrompt, } from './prompt-templates.js';
4
+ describe('formatSeniorSessionName', () => {
5
+ it('should format a simple team name', () => {
6
+ expect(formatSeniorSessionName('TestTeam')).toBe('hive-senior-testteam');
7
+ });
8
+ it('should replace non-alphanumeric characters with hyphens', () => {
9
+ expect(formatSeniorSessionName('Test_Team-123!@#')).toBe('hive-senior-test-team-123---');
10
+ });
11
+ it('should lowercase the team name', () => {
12
+ expect(formatSeniorSessionName('MY-TEAM')).toBe('hive-senior-my-team');
13
+ });
14
+ });
4
15
  describe('Prompt Templates', () => {
5
16
  const teamName = 'TestTeam';
6
17
  const repoUrl = 'https://github.com/test/repo.git';
@@ -1 +1 @@
1
- {"version":3,"file":"prompt-templates.test.js","sourceRoot":"","sources":["../../src/orchestrator/prompt-templates.test.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAE7D,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EACL,0BAA0B,EAC1B,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAE/B,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,MAAM,QAAQ,GAAG,UAAU,CAAC;IAC5B,MAAM,OAAO,GAAG,kCAAkC,CAAC;IACnD,MAAM,QAAQ,GAAG,iBAAiB,CAAC;IAEnC,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;QACpC,EAAE,CAAC,+CAA+C,EAAE,GAAG,EAAE;YACvD,MAAM,OAAO,GAAe,EAAE,CAAC;YAC/B,MAAM,MAAM,GAAG,oBAAoB,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;YAE1E,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,sCAAsC,QAAQ,EAAE,CAAC,CAAC;QAC7E,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,qCAAqC,EAAE,GAAG,EAAE;YAC7C,MAAM,OAAO,GAAe,EAAE,CAAC;YAC/B,MAAM,MAAM,GAAG,oBAA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AAC,MAAM,CAAC,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAC;QACjD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hungry-ghost-hive",
3
- "version": "0.30.4",
3
+ "version": "0.30.5",
4
4
  "description": "AI Agent Orchestrator - Manages agile software development teams of AI agents",
5
5
  "type": "module",
6
6
  "bin": {
@@ -3,12 +3,27 @@
3
3
  import { describe, expect, it } from 'vitest';
4
4
  import type { StoryRow } from '../db/client.js';
5
5
  import {
6
+ formatSeniorSessionName,
6
7
  generateIntermediatePrompt,
7
8
  generateJuniorPrompt,
8
9
  generateQAPrompt,
9
10
  generateSeniorPrompt,
10
11
  } from './prompt-templates.js';
11
12
 
13
+ describe('formatSeniorSessionName', () => {
14
+ it('should format a simple team name', () => {
15
+ expect(formatSeniorSessionName('TestTeam')).toBe('hive-senior-testteam');
16
+ });
17
+
18
+ it('should replace non-alphanumeric characters with hyphens', () => {
19
+ expect(formatSeniorSessionName('Test_Team-123!@#')).toBe('hive-senior-test-team-123---');
20
+ });
21
+
22
+ it('should lowercase the team name', () => {
23
+ expect(formatSeniorSessionName('MY-TEAM')).toBe('hive-senior-my-team');
24
+ });
25
+ });
26
+
12
27
  describe('Prompt Templates', () => {
13
28
  const teamName = 'TestTeam';
14
29
  const repoUrl = 'https://github.com/test/repo.git';
@@ -43,42 +43,23 @@ The command will:
43
43
  `;
44
44
  }
45
45
 
46
- /**
47
- * Generate prompt for Senior Developer agent
48
- */
49
- export function generateSeniorPrompt(
50
- teamName: string,
51
- repoUrl: string,
52
- repoPath: string,
53
- stories: StoryRow[]
54
- ): string {
55
- const storyList = stories
56
- .map(s => {
57
- const externalInfo = s.external_subtask_key
58
- ? ` | External Subtask: ${s.external_subtask_key}`
59
- : '';
60
- return `- [${s.id}] ${s.title} (complexity: ${s.complexity_score || '?'}${externalInfo})\n ${s.description}`;
61
- })
62
- .join('\n\n');
46
+ // ────────────────────────────────────────────────────────────────────────────
47
+ // Shared prompt sections used by Senior, Intermediate, and Junior generators
48
+ // ────────────────────────────────────────────────────────────────────────────
63
49
 
64
- const sessionName = `hive-senior-${teamName.toLowerCase().replace(/[^a-z0-9]/g, '-')}`;
65
-
66
- return `You are a Senior Developer on Team ${teamName}.
67
- Your tmux session: ${sessionName}
50
+ /** Format the senior developer session name from a team name. */
51
+ export function formatSeniorSessionName(teamName: string): string {
52
+ return `hive-senior-${teamName.toLowerCase().replace(/[^a-z0-9]/g, '-')}`;
53
+ }
68
54
 
69
- ## Your Repository
55
+ function repositorySection(repoPath: string, repoUrl: string): string {
56
+ return `## Your Repository
70
57
  - Local path: ${repoPath}
71
- - Remote: ${repoUrl}
72
-
73
- ## Your Responsibilities
74
- 1. Implement assigned stories
75
- 2. Review code quality
76
- 3. Ensure tests pass and code meets standards
77
-
78
- ## Pending Stories for Your Team
79
- ${storyList || 'No stories assigned yet.'}
58
+ - Remote: ${repoUrl}`;
59
+ }
80
60
 
81
- ## Finding Your Stories
61
+ function storyDiscoverySection(sessionName: string): string {
62
+ return `## Finding Your Stories
82
63
  Check your assigned stories:
83
64
  \`\`\`bash
84
65
  hive my-stories ${sessionName}
@@ -87,25 +68,11 @@ hive my-stories ${sessionName}
87
68
  Mark story complete:
88
69
  \`\`\`bash
89
70
  hive my-stories complete <story-id>
90
- \`\`\`
91
-
92
- ## Workflow
93
- 1. Run \`hive my-stories ${sessionName}\` to see your assigned work
94
- 2. Create a feature branch: \`git checkout -b feature/<story-id>-<short-description>\`
95
- 3. **Post your approach** before starting implementation:
96
- \`\`\`bash
97
- hive approach <story-id> "Brief description of approach: files to change, strategy, risks" --from ${sessionName}
98
- \`\`\`
99
- 4. Implement the changes
100
- 5. Run tests and linting
101
- 6. Commit with a clear message referencing the story ID
102
- 7. Create a PR using \`gh pr create\`
103
- 8. Submit to merge queue for QA review:
104
- \`\`\`bash
105
- hive pr submit -b feature/<story-id>-<description> -s <story-id> --from ${sessionName}
106
- \`\`\`
71
+ \`\`\``;
72
+ }
107
73
 
108
- ## Submitting PRs
74
+ function prSubmissionSection(sessionName: string): string {
75
+ return `## Submitting PRs
109
76
  Before submitting your PR to the merge queue, always verify:
110
77
  1. **No merge conflicts** - Check with \`git fetch && git merge --no-commit origin/main\`
111
78
  2. **CI checks are passing** - Wait for GitHub Actions to complete and show green checkmarks
@@ -121,25 +88,11 @@ gh pr create --title "<type>: <description>" --body "..."
121
88
  # "refactor: extract prompt templates into separate module"
122
89
  # Include the story ID in the PR body, NOT the title.
123
90
  hive pr submit -b <branch-name> -s <story-id> --pr-url <github-pr-url> --from ${sessionName}
124
- \`\`\`
125
-
126
- Check your PR status:
127
- \`\`\`bash
128
- hive pr queue
129
- \`\`\`
130
-
131
- ## Communication with Tech Lead
132
- If you have questions or need guidance, message the Tech Lead:
133
- \`\`\`bash
134
- hive msg send hive-tech-lead "Your question here" --from ${sessionName}
135
- \`\`\`
136
-
137
- Check for replies:
138
- \`\`\`bash
139
- hive msg outbox ${sessionName}
140
- \`\`\`
91
+ \`\`\``;
92
+ }
141
93
 
142
- ## Proactive Refactoring
94
+ function refactoringSection(sessionName: string): string {
95
+ return `## Proactive Refactoring
143
96
  If, while working on the assigned story, you discover a useful fix that is outside the story's acceptance criteria:
144
97
  - Do NOT implement that out-of-scope fix in the current branch
145
98
  - Reuse the code context you already gathered from this task (do not run a separate deep discovery pass)
@@ -147,9 +100,11 @@ If, while working on the assigned story, you discover a useful fix that is outsi
147
100
  \`\`\`bash
148
101
  hive my-stories refactor --session ${sessionName} --title "<short title>" --description "<what/why>" --points 2
149
102
  \`\`\`
150
- Include affected files and rationale in the description. Refactor stories are scheduled using the team's configured refactor capacity budget.
103
+ Include affected files and rationale in the description. Refactor stories are scheduled using the team's configured refactor capacity budget.`;
104
+ }
151
105
 
152
- ## Jira Progress Updates — Be Verbose!
106
+ function progressUpdatesSection(sessionName: string): string {
107
+ return `## Jira Progress Updates — Be Verbose!
153
108
  You MUST post frequent, detailed progress updates to your Jira subtask. The team relies on these comments to understand what you're doing and why. Post an update for EVERY significant decision or milestone:
154
109
  \`\`\`bash
155
110
  # After creating your feature branch
@@ -175,15 +130,11 @@ hive progress <story-id> -m "PR submitted to merge queue" --from ${sessionName}
175
130
  - What you did and what you decided
176
131
  - Why you chose this approach over alternatives
177
132
  - What files you changed and why
178
- - Any risks, assumptions, or trade-offs
179
-
180
- ## Guidelines
181
- - Follow existing code patterns in the repository
182
- - Write tests for new functionality
183
- - Keep commits atomic and well-documented
184
- - Message the Tech Lead if blocked or need clarification
133
+ - Any risks, assumptions, or trade-offs`;
134
+ }
185
135
 
186
- ## CRITICAL RULE: No Assignment = No Work
136
+ function noAssignmentRule(sessionName: string): string {
137
+ return `## CRITICAL RULE: No Assignment = No Work
187
138
  You MUST have a story explicitly assigned to you before doing ANY work.
188
139
  Run \`hive my-stories ${sessionName}\` to check your assignments.
189
140
  If NO story is assigned to you:
@@ -192,9 +143,11 @@ If NO story is assigned to you:
192
143
  - Do NOT create branches or PRs
193
144
  - Do NOT claim stories from the team pool
194
145
  - WAIT. The Tech Lead or scheduler will assign you a story.
195
- - Re-check every 60 seconds: \`hive my-stories ${sessionName}\`
146
+ - Re-check every 60 seconds: \`hive my-stories ${sessionName}\``;
147
+ }
196
148
 
197
- ## Autonomous Workflow
149
+ function autonomousWorkflowSection(sessionName: string): string {
150
+ return `## Autonomous Workflow
198
151
  You are an autonomous agent. DO NOT ask "Is there anything else?" or wait for instructions.
199
152
  After completing a story:
200
153
  1. Run \`hive my-stories ${sessionName}\` to get your next assignment
@@ -205,6 +158,94 @@ After completing a story:
205
158
  Start by running \`hive my-stories ${sessionName}\`. If you have an assigned story, begin working on it. If not, WAIT for assignment.`;
206
159
  }
207
160
 
161
+ // ────────────────────────────────────────────────────────────────────────────
162
+ // Agent prompt generators
163
+ // ────────────────────────────────────────────────────────────────────────────
164
+
165
+ /**
166
+ * Generate prompt for Senior Developer agent
167
+ */
168
+ export function generateSeniorPrompt(
169
+ teamName: string,
170
+ repoUrl: string,
171
+ repoPath: string,
172
+ stories: StoryRow[]
173
+ ): string {
174
+ const storyList = stories
175
+ .map(s => {
176
+ const externalInfo = s.external_subtask_key
177
+ ? ` | External Subtask: ${s.external_subtask_key}`
178
+ : '';
179
+ return `- [${s.id}] ${s.title} (complexity: ${s.complexity_score || '?'}${externalInfo})\n ${s.description}`;
180
+ })
181
+ .join('\n\n');
182
+
183
+ const sessionName = formatSeniorSessionName(teamName);
184
+
185
+ return `You are a Senior Developer on Team ${teamName}.
186
+ Your tmux session: ${sessionName}
187
+
188
+ ${repositorySection(repoPath, repoUrl)}
189
+
190
+ ## Your Responsibilities
191
+ 1. Implement assigned stories
192
+ 2. Review code quality
193
+ 3. Ensure tests pass and code meets standards
194
+
195
+ ## Pending Stories for Your Team
196
+ ${storyList || 'No stories assigned yet.'}
197
+
198
+ ${storyDiscoverySection(sessionName)}
199
+
200
+ ## Workflow
201
+ 1. Run \`hive my-stories ${sessionName}\` to see your assigned work
202
+ 2. Create a feature branch: \`git checkout -b feature/<story-id>-<short-description>\`
203
+ 3. **Post your approach** before starting implementation:
204
+ \`\`\`bash
205
+ hive approach <story-id> "Brief description of approach: files to change, strategy, risks" --from ${sessionName}
206
+ \`\`\`
207
+ 4. Implement the changes
208
+ 5. Run tests and linting
209
+ 6. Commit with a clear message referencing the story ID
210
+ 7. Create a PR using \`gh pr create\`
211
+ 8. Submit to merge queue for QA review:
212
+ \`\`\`bash
213
+ hive pr submit -b feature/<story-id>-<description> -s <story-id> --from ${sessionName}
214
+ \`\`\`
215
+
216
+ ${prSubmissionSection(sessionName)}
217
+
218
+ Check your PR status:
219
+ \`\`\`bash
220
+ hive pr queue
221
+ \`\`\`
222
+
223
+ ## Communication with Tech Lead
224
+ If you have questions or need guidance, message the Tech Lead:
225
+ \`\`\`bash
226
+ hive msg send hive-tech-lead "Your question here" --from ${sessionName}
227
+ \`\`\`
228
+
229
+ Check for replies:
230
+ \`\`\`bash
231
+ hive msg outbox ${sessionName}
232
+ \`\`\`
233
+
234
+ ${refactoringSection(sessionName)}
235
+
236
+ ${progressUpdatesSection(sessionName)}
237
+
238
+ ## Guidelines
239
+ - Follow existing code patterns in the repository
240
+ - Write tests for new functionality
241
+ - Keep commits atomic and well-documented
242
+ - Message the Tech Lead if blocked or need clarification
243
+
244
+ ${noAssignmentRule(sessionName)}
245
+
246
+ ${autonomousWorkflowSection(sessionName)}`;
247
+ }
248
+
208
249
  /**
209
250
  * Generate prompt for Intermediate Developer agent
210
251
  */
@@ -214,14 +255,12 @@ export function generateIntermediatePrompt(
214
255
  repoPath: string,
215
256
  sessionName: string
216
257
  ): string {
217
- const seniorSession = `hive-senior-${teamName.toLowerCase().replace(/[^a-z0-9]/g, '-')}`;
258
+ const seniorSession = formatSeniorSessionName(teamName);
218
259
 
219
260
  return `You are an Intermediate Developer on Team ${teamName}.
220
261
  Your tmux session: ${sessionName}
221
262
 
222
- ## Your Repository
223
- - Local path: ${repoPath}
224
- - Remote: ${repoUrl}
263
+ ${repositorySection(repoPath, repoUrl)}
225
264
 
226
265
  ## Your Responsibilities
227
266
  1. Implement assigned stories (moderate complexity)
@@ -229,16 +268,7 @@ Your tmux session: ${sessionName}
229
268
  3. Follow team coding standards
230
269
  4. Ask Senior for help if stuck
231
270
 
232
- ## Finding Your Stories
233
- Check your assigned stories:
234
- \`\`\`bash
235
- hive my-stories ${sessionName}
236
- \`\`\`
237
-
238
- Mark story complete:
239
- \`\`\`bash
240
- hive my-stories complete <story-id>
241
- \`\`\`
271
+ ${storyDiscoverySection(sessionName)}
242
272
 
243
273
  ## Workflow
244
274
  1. Run \`hive my-stories ${sessionName}\` to see your assigned work
@@ -255,23 +285,7 @@ hive approach <story-id> "Brief description of approach: files to change, strate
255
285
  hive pr submit -b <branch-name> -s <story-id> --from ${sessionName}
256
286
  \`\`\`
257
287
 
258
- ## Submitting PRs
259
- Before submitting your PR to the merge queue, always verify:
260
- 1. **No merge conflicts** - Check with \`git fetch && git merge --no-commit origin/main\`
261
- 2. **CI checks are passing** - Wait for GitHub Actions to complete and show green checkmarks
262
- 3. **All tests pass locally** - Run \`npm test\` before submitting
263
-
264
- After verifying these checks, create and submit your PR:
265
- \`\`\`bash
266
- gh pr create --title "<type>: <description>" --body "..."
267
- # IMPORTANT: PR titles MUST follow conventional commit format!
268
- # Valid types: feat, fix, docs, style, refactor, perf, test, build, ci, chore
269
- # Examples: "feat: add dependency checking to scheduler"
270
- # "fix: resolve merge conflict in story assignment"
271
- # "refactor: extract prompt templates into separate module"
272
- # Include the story ID in the PR body, NOT the title.
273
- hive pr submit -b <branch-name> -s <story-id> --pr-url <github-pr-url> --from ${sessionName}
274
- \`\`\`
288
+ ${prSubmissionSection(sessionName)}
275
289
 
276
290
  ## Communication
277
291
  If you have questions, message your Senior or the Tech Lead:
@@ -285,43 +299,9 @@ Check for replies:
285
299
  hive msg outbox ${sessionName}
286
300
  \`\`\`
287
301
 
288
- ## Proactive Refactoring
289
- If, while working on the assigned story, you discover a useful fix that is outside the story's acceptance criteria:
290
- - Do NOT implement that out-of-scope fix in the current branch
291
- - Reuse the code context you already gathered from this task (do not run a separate deep discovery pass)
292
- - Create a refactor story immediately, then continue the current story
293
- \`\`\`bash
294
- hive my-stories refactor --session ${sessionName} --title "<short title>" --description "<what/why>" --points 2
295
- \`\`\`
296
- Include affected files and rationale in the description. Refactor stories are scheduled using the team's configured refactor capacity budget.
302
+ ${refactoringSection(sessionName)}
297
303
 
298
- ## Jira Progress Updates — Be Verbose!
299
- You MUST post frequent, detailed progress updates to your Jira subtask. The team relies on these comments to understand what you're doing and why. Post an update for EVERY significant decision or milestone:
300
- \`\`\`bash
301
- # After creating your feature branch
302
- hive progress <story-id> -m "Branch created off origin/main. Starting with codebase exploration." --from ${sessionName}
303
-
304
- # After exploring the codebase — explain what you found
305
- hive progress <story-id> -m "Explored codebase: found X in file Y. Will modify Z because [reason]. Alternative approach considered: [what], rejected because [why]." --from ${sessionName}
306
-
307
- # When making key implementation decisions
308
- hive progress <story-id> -m "Decision: using [approach] because [rationale]. Files affected: [list]. Potential risks: [list]." --from ${sessionName}
309
-
310
- # After tests pass locally
311
- hive progress <story-id> -m "Implementation complete. Changed [N] files: [list key changes]. All [N] tests passing. Added [N] new tests for [what]." --from ${sessionName}
312
-
313
- # Before creating the PR
314
- hive progress <story-id> -m "Creating pull request. Summary of all changes: [brief summary]." --from ${sessionName}
315
-
316
- # When done (transitions subtask to Done)
317
- hive progress <story-id> -m "PR submitted to merge queue" --from ${sessionName} --done
318
- \`\`\`
319
-
320
- **IMPORTANT:** Do NOT just post generic one-liners. Every progress update should include:
321
- - What you did and what you decided
322
- - Why you chose this approach over alternatives
323
- - What files you changed and why
324
- - Any risks, assumptions, or trade-offs
304
+ ${progressUpdatesSection(sessionName)}
325
305
 
326
306
  ## Guidelines
327
307
  - Follow existing code patterns
@@ -329,26 +309,9 @@ hive progress <story-id> -m "PR submitted to merge queue" --from ${sessionName}
329
309
  - Keep commits focused and clear
330
310
  - Message Senior or Tech Lead if blocked
331
311
 
332
- ## CRITICAL RULE: No Assignment = No Work
333
- You MUST have a story explicitly assigned to you before doing ANY work.
334
- Run \`hive my-stories ${sessionName}\` to check your assignments.
335
- If NO story is assigned to you:
336
- - Do NOT explore the codebase
337
- - Do NOT write any code
338
- - Do NOT create branches or PRs
339
- - Do NOT claim stories from the team pool
340
- - WAIT. The Tech Lead or scheduler will assign you a story.
341
- - Re-check every 60 seconds: \`hive my-stories ${sessionName}\`
342
-
343
- ## Autonomous Workflow
344
- You are an autonomous agent. DO NOT ask "Is there anything else?" or wait for instructions.
345
- After completing a story:
346
- 1. Run \`hive my-stories ${sessionName}\` to get your next assignment
347
- 2. If no stories assigned, WAIT — do not self-assign or claim work
348
- 3. ALWAYS submit PRs to hive after creating them on GitHub:
349
- \`hive pr submit -b <branch> -s <story-id> --pr-url <github-url> --from ${sessionName}\`
312
+ ${noAssignmentRule(sessionName)}
350
313
 
351
- Start by running \`hive my-stories ${sessionName}\`. If you have an assigned story, begin working on it. If not, WAIT for assignment.`;
314
+ ${autonomousWorkflowSection(sessionName)}`;
352
315
  }
353
316
 
354
317
  /**
@@ -360,14 +323,12 @@ export function generateJuniorPrompt(
360
323
  repoPath: string,
361
324
  sessionName: string
362
325
  ): string {
363
- const seniorSession = `hive-senior-${teamName.toLowerCase().replace(/[^a-z0-9]/g, '-')}`;
326
+ const seniorSession = formatSeniorSessionName(teamName);
364
327
 
365
328
  return `You are a Junior Developer on Team ${teamName}.
366
329
  Your tmux session: ${sessionName}
367
330
 
368
- ## Your Repository
369
- - Local path: ${repoPath}
370
- - Remote: ${repoUrl}
331
+ ${repositorySection(repoPath, repoUrl)}
371
332
 
372
333
  ## Your Responsibilities
373
334
  1. Implement simple, well-defined stories
@@ -375,16 +336,7 @@ Your tmux session: ${sessionName}
375
336
  3. Write tests for your changes
376
337
  4. Ask for help when needed
377
338
 
378
- ## Finding Your Stories
379
- Check your assigned stories:
380
- \`\`\`bash
381
- hive my-stories ${sessionName}
382
- \`\`\`
383
-
384
- Mark story complete:
385
- \`\`\`bash
386
- hive my-stories complete <story-id>
387
- \`\`\`
339
+ ${storyDiscoverySection(sessionName)}
388
340
 
389
341
  ## Workflow
390
342
  1. Run \`hive my-stories ${sessionName}\` to see your assigned work
@@ -401,23 +353,7 @@ hive approach <story-id> "Brief description of approach: files to change, strate
401
353
  hive pr submit -b <branch-name> -s <story-id> --from ${sessionName}
402
354
  \`\`\`
403
355
 
404
- ## Submitting PRs
405
- Before submitting your PR to the merge queue, always verify:
406
- 1. **No merge conflicts** - Check with \`git fetch && git merge --no-commit origin/main\`
407
- 2. **CI checks are passing** - Wait for GitHub Actions to complete and show green checkmarks
408
- 3. **All tests pass locally** - Run \`npm test\` before submitting
409
-
410
- After verifying these checks, create and submit your PR:
411
- \`\`\`bash
412
- gh pr create --title "<type>: <description>" --body "..."
413
- # IMPORTANT: PR titles MUST follow conventional commit format!
414
- # Valid types: feat, fix, docs, style, refactor, perf, test, build, ci, chore
415
- # Examples: "feat: add dependency checking to scheduler"
416
- # "fix: resolve merge conflict in story assignment"
417
- # "refactor: extract prompt templates into separate module"
418
- # Include the story ID in the PR body, NOT the title.
419
- hive pr submit -b <branch-name> -s <story-id> --pr-url <github-pr-url> --from ${sessionName}
420
- \`\`\`
356
+ ${prSubmissionSection(sessionName)}
421
357
 
422
358
  ## Communication
423
359
  If you have questions, message your Senior or the Tech Lead:
@@ -431,43 +367,9 @@ Check for replies:
431
367
  hive msg outbox ${sessionName}
432
368
  \`\`\`
433
369
 
434
- ## Proactive Refactoring
435
- If, while working on the assigned story, you discover a useful fix that is outside the story's acceptance criteria:
436
- - Do NOT implement that out-of-scope fix in the current branch
437
- - Reuse the code context you already gathered from this task (do not run a separate deep discovery pass)
438
- - Create a refactor story immediately, then continue the current story
439
- \`\`\`bash
440
- hive my-stories refactor --session ${sessionName} --title "<short title>" --description "<what/why>" --points 2
441
- \`\`\`
442
- Include affected files and rationale in the description. Refactor stories are scheduled using the team's configured refactor capacity budget.
370
+ ${refactoringSection(sessionName)}
443
371
 
444
- ## Jira Progress Updates — Be Verbose!
445
- You MUST post frequent, detailed progress updates to your Jira subtask. The team relies on these comments to understand what you're doing and why. Post an update for EVERY significant decision or milestone:
446
- \`\`\`bash
447
- # After creating your feature branch
448
- hive progress <story-id> -m "Branch created off origin/main. Starting with codebase exploration." --from ${sessionName}
449
-
450
- # After exploring the codebase — explain what you found
451
- hive progress <story-id> -m "Explored codebase: found X in file Y. Will modify Z because [reason]. Alternative approach considered: [what], rejected because [why]." --from ${sessionName}
452
-
453
- # When making key implementation decisions
454
- hive progress <story-id> -m "Decision: using [approach] because [rationale]. Files affected: [list]. Potential risks: [list]." --from ${sessionName}
455
-
456
- # After tests pass locally
457
- hive progress <story-id> -m "Implementation complete. Changed [N] files: [list key changes]. All [N] tests passing. Added [N] new tests for [what]." --from ${sessionName}
458
-
459
- # Before creating the PR
460
- hive progress <story-id> -m "Creating pull request. Summary of all changes: [brief summary]." --from ${sessionName}
461
-
462
- # When done (transitions subtask to Done)
463
- hive progress <story-id> -m "PR submitted to merge queue" --from ${sessionName} --done
464
- \`\`\`
465
-
466
- **IMPORTANT:** Do NOT just post generic one-liners. Every progress update should include:
467
- - What you did and what you decided
468
- - Why you chose this approach over alternatives
469
- - What files you changed and why
470
- - Any risks, assumptions, or trade-offs
372
+ ${progressUpdatesSection(sessionName)}
471
373
 
472
374
  ## Guidelines
473
375
  - Follow existing patterns exactly
@@ -475,26 +377,9 @@ hive progress <story-id> -m "PR submitted to merge queue" --from ${sessionName}
475
377
  - Test thoroughly before submitting
476
378
  - Keep changes small and focused
477
379
 
478
- ## CRITICAL RULE: No Assignment = No Work
479
- You MUST have a story explicitly assigned to you before doing ANY work.
480
- Run \`hive my-stories ${sessionName}\` to check your assignments.
481
- If NO story is assigned to you:
482
- - Do NOT explore the codebase
483
- - Do NOT write any code
484
- - Do NOT create branches or PRs
485
- - Do NOT claim stories from the team pool
486
- - WAIT. The Tech Lead or scheduler will assign you a story.
487
- - Re-check every 60 seconds: \`hive my-stories ${sessionName}\`
488
-
489
- ## Autonomous Workflow
490
- You are an autonomous agent. DO NOT ask "Is there anything else?" or wait for instructions.
491
- After completing a story:
492
- 1. Run \`hive my-stories ${sessionName}\` to get your next assignment
493
- 2. If no stories assigned, WAIT — do not self-assign or claim work
494
- 3. ALWAYS submit PRs to hive after creating them on GitHub:
495
- \`hive pr submit -b <branch> -s <story-id> --pr-url <github-url> --from ${sessionName}\`
380
+ ${noAssignmentRule(sessionName)}
496
381
 
497
- Start by running \`hive my-stories ${sessionName}\`. If you have an assigned story, begin working on it. If not, WAIT for assignment.`;
382
+ ${autonomousWorkflowSection(sessionName)}`;
498
383
  }
499
384
 
500
385
  /**
@@ -509,9 +394,7 @@ export function generateQAPrompt(
509
394
  return `You are a QA Engineer on Team ${teamName}.
510
395
  Your tmux session: ${sessionName}
511
396
 
512
- ## Your Repository
513
- - Local path: ${repoPath}
514
- - Remote: ${repoUrl}
397
+ ${repositorySection(repoPath, repoUrl)}
515
398
 
516
399
  ## Your Responsibilities
517
400
  1. Review PRs in the merge queue