orchestr8 2.5.0 → 2.6.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 (54) hide show
  1. package/.blueprint/agents/AGENT_BA_CASS.md +42 -19
  2. package/.blueprint/agents/AGENT_DEVELOPER_CODEY.md +42 -38
  3. package/.blueprint/agents/AGENT_SPECIFICATION_ALEX.md +45 -0
  4. package/.blueprint/agents/AGENT_TESTER_NIGEL.md +42 -21
  5. package/.blueprint/features/feature_adaptive-retry/FEATURE_SPEC.md +239 -0
  6. package/.blueprint/features/feature_adaptive-retry/IMPLEMENTATION_PLAN.md +48 -0
  7. package/.blueprint/features/feature_adaptive-retry/story-prompt-modification.md +85 -0
  8. package/.blueprint/features/feature_adaptive-retry/story-retry-config.md +89 -0
  9. package/.blueprint/features/feature_adaptive-retry/story-should-retry.md +98 -0
  10. package/.blueprint/features/feature_adaptive-retry/story-strategy-recommendation.md +85 -0
  11. package/.blueprint/features/feature_agent-guardrails/FEATURE_SPEC.md +328 -0
  12. package/.blueprint/features/feature_agent-guardrails/IMPLEMENTATION_PLAN.md +90 -0
  13. package/.blueprint/features/feature_agent-guardrails/story-citation-requirements.md +50 -0
  14. package/.blueprint/features/feature_agent-guardrails/story-confidentiality.md +50 -0
  15. package/.blueprint/features/feature_agent-guardrails/story-escalation-protocol.md +55 -0
  16. package/.blueprint/features/feature_agent-guardrails/story-source-restrictions.md +50 -0
  17. package/.blueprint/features/feature_feedback-loop/FEATURE_SPEC.md +347 -0
  18. package/.blueprint/features/feature_feedback-loop/IMPLEMENTATION_PLAN.md +71 -0
  19. package/.blueprint/features/feature_feedback-loop/story-feedback-collection.md +63 -0
  20. package/.blueprint/features/feature_feedback-loop/story-feedback-config.md +61 -0
  21. package/.blueprint/features/feature_feedback-loop/story-feedback-insights.md +63 -0
  22. package/.blueprint/features/feature_feedback-loop/story-quality-gates.md +57 -0
  23. package/.blueprint/features/feature_pipeline-history/FEATURE_SPEC.md +239 -0
  24. package/.blueprint/features/feature_pipeline-history/IMPLEMENTATION_PLAN.md +71 -0
  25. package/.blueprint/features/feature_pipeline-history/story-clear-history.md +73 -0
  26. package/.blueprint/features/feature_pipeline-history/story-display-history.md +75 -0
  27. package/.blueprint/features/feature_pipeline-history/story-record-execution.md +76 -0
  28. package/.blueprint/features/feature_pipeline-history/story-show-statistics.md +85 -0
  29. package/.blueprint/features/feature_pipeline-insights/FEATURE_SPEC.md +288 -0
  30. package/.blueprint/features/feature_pipeline-insights/IMPLEMENTATION_PLAN.md +65 -0
  31. package/.blueprint/features/feature_pipeline-insights/story-anomaly-detection.md +71 -0
  32. package/.blueprint/features/feature_pipeline-insights/story-bottleneck-analysis.md +75 -0
  33. package/.blueprint/features/feature_pipeline-insights/story-failure-patterns.md +75 -0
  34. package/.blueprint/features/feature_pipeline-insights/story-json-output.md +75 -0
  35. package/.blueprint/features/feature_pipeline-insights/story-trend-analysis.md +78 -0
  36. package/.blueprint/features/feature_validate-command/FEATURE_SPEC.md +209 -0
  37. package/.blueprint/features/feature_validate-command/IMPLEMENTATION_PLAN.md +59 -0
  38. package/.blueprint/features/feature_validate-command/story-failure-output.md +61 -0
  39. package/.blueprint/features/feature_validate-command/story-node-version-check.md +52 -0
  40. package/.blueprint/features/feature_validate-command/story-run-validation.md +59 -0
  41. package/.blueprint/features/feature_validate-command/story-success-output.md +50 -0
  42. package/.blueprint/system_specification/SYSTEM_SPEC.md +248 -0
  43. package/README.md +182 -38
  44. package/SKILL.md +333 -23
  45. package/bin/cli.js +128 -20
  46. package/package.json +2 -2
  47. package/src/feedback.js +171 -0
  48. package/src/history.js +306 -0
  49. package/src/index.js +57 -2
  50. package/src/init.js +2 -6
  51. package/src/insights.js +504 -0
  52. package/src/retry.js +274 -0
  53. package/src/validate.js +172 -0
  54. package/src/skills.js +0 -93
package/SKILL.md CHANGED
@@ -18,6 +18,9 @@ description: Run the Alex → Cass → Nigel → Codey pipeline using Task tool
18
18
  | `{TEST_FILE}` | `./test/feature_{slug}.test.js` |
19
19
  | `{PLAN}` | `{FEAT_DIR}/IMPLEMENTATION_PLAN.md` |
20
20
  | `{QUEUE}` | `.claude/implement-queue.json` |
21
+ | `{HISTORY}` | `.claude/pipeline-history.json` |
22
+ | `{RETRY_CONFIG}` | `.claude/retry-config.json` |
23
+ | `{FEEDBACK_CONFIG}` | `.claude/feedback-config.json` |
21
24
 
22
25
  ## Invocation
23
26
 
@@ -26,6 +29,9 @@ description: Run the Alex → Cass → Nigel → Codey pipeline using Task tool
26
29
  /implement-feature "user-auth" # New feature
27
30
  /implement-feature "user-auth" --pause-after=alex|cass|nigel|codey-plan
28
31
  /implement-feature "user-auth" --no-commit
32
+ /implement-feature "user-auth" --no-feedback # Skip feedback collection
33
+ /implement-feature "user-auth" --no-validate # Skip pre-flight validation
34
+ /implement-feature "user-auth" --no-history # Skip history recording
29
35
  ```
30
36
 
31
37
  ## Pipeline Overview
@@ -35,14 +41,23 @@ description: Run the Alex → Cass → Nigel → Codey pipeline using Task tool
35
41
 
36
42
 
37
43
  ┌─────────────────────────────────────────┐
44
+ │ 0. Pre-flight validation (validate.js) │
38
45
  │ 1. Parse args, get slug │
39
46
  │ 2. Check system spec exists (gate) │
40
- │ 3. Initialize queue
41
- │ 4. Route based on flags/state
47
+ │ 3. Show insights preview (insights.js)
48
+ │ 4. Initialize queue + history entry
49
+ │ 5. Route based on flags/state │
42
50
  └─────────────────────────────────────────┘
43
51
 
44
52
 
45
- SPAWN ALEX → SPAWN CASS → SPAWN NIGEL → SPAWN CODEY AUTO-COMMIT
53
+ ALEX → [feedback] CASS → [feedback] NIGEL → [feedback]CODEY
54
+ │ │
55
+ └──────────── Record timing in history.js ──────────────────┘
56
+ │ │
57
+ └──────────── On failure: retry.js strategy ────────────────┘
58
+
59
+
60
+ AUTO-COMMIT → Record completion in history
46
61
  ```
47
62
 
48
63
  ## Output Constraints (CRITICAL)
@@ -57,6 +72,33 @@ description: Run the Alex → Cass → Nigel → Codey pipeline using Task tool
57
72
 
58
73
  ---
59
74
 
75
+ ## Step 0: Pre-flight Validation (NEW)
76
+
77
+ **Module:** `src/validate.js`
78
+
79
+ Unless `--no-validate` flag is set:
80
+
81
+ ```bash
82
+ # Run validation checks
83
+ node bin/cli.js validate
84
+ ```
85
+
86
+ **Checks performed:**
87
+ - Required directories exist (`.blueprint/`, `.business_context/`)
88
+ - System spec exists
89
+ - All 4 agent spec files present
90
+ - Business context has content
91
+ - Skills installed
92
+ - Node.js version >= 18
93
+
94
+ **On validation failure:**
95
+ - Show which checks failed with fix suggestions
96
+ - Ask user: "Fix issues and retry?" or "Continue anyway?" or "Abort"
97
+
98
+ **On validation success:** Continue to Step 1
99
+
100
+ ---
101
+
60
102
  ## Steps 1-5: Setup
61
103
 
62
104
  ### Step 1: Parse Arguments
@@ -68,6 +110,23 @@ If not provided: Ask user, convert to slug format (lowercase, hyphens), confirm.
68
110
  ### Step 3: System Spec Gate
69
111
  Check `{SYS_SPEC}` exists. If not: run Alex to create it, then **stop for review**.
70
112
 
113
+ ### Step 3.5: Insights Preview (NEW)
114
+
115
+ **Module:** `src/insights.js`
116
+
117
+ Unless `--no-history` flag is set, show pipeline insights:
118
+
119
+ ```bash
120
+ node bin/cli.js insights --json 2>/dev/null
121
+ ```
122
+
123
+ **Display to user:**
124
+ - Recent success rate (e.g., "Last 10 runs: 85% success")
125
+ - Estimated duration (e.g., "Estimated: ~12 min based on history")
126
+ - Any warnings (e.g., "Note: Nigel stage has 30% failure rate recently")
127
+
128
+ If no history exists, skip this step silently.
129
+
71
130
  ### Step 4: Route
72
131
  - Slug exists at `{FEAT_DIR}` → ask: continue from last state or restart
73
132
  - No slug → new feature pipeline
@@ -75,10 +134,26 @@ Check `{SYS_SPEC}` exists. If not: run Alex to create it, then **stop for review
75
134
  ### Step 5: Initialize
76
135
  Create/read `{QUEUE}`. Ensure dirs exist: `mkdir -p {FEAT_DIR} {TEST_DIR}`
77
136
 
137
+ **History Integration (NEW):**
138
+
139
+ Unless `--no-history` flag is set, start a history entry:
140
+
141
+ ```javascript
142
+ // Conceptual - orchestrator tracks this in memory
143
+ historyEntry = {
144
+ slug: "{slug}",
145
+ startedAt: new Date().toISOString(),
146
+ stages: {},
147
+ feedback: {}
148
+ }
149
+ ```
150
+
78
151
  ---
79
152
 
80
153
  ## Step 6: Spawn Alex Agent
81
154
 
155
+ **History:** Record `stages.alex.startedAt` before spawning.
156
+
82
157
  Use the Task tool with `subagent_type="general-purpose"`:
83
158
 
84
159
  **Prompt:**
@@ -110,15 +185,44 @@ Brief summary (5 bullets max): intent, key behaviours, scope, story themes, tens
110
185
 
111
186
  **On completion:**
112
187
  1. Verify `{FEAT_SPEC}` exists
113
- 2. Update queue: move feature to `cassQueue`
114
- 3. If `--pause-after=alex`: Show output path, ask user to continue
188
+ 2. **Record history:** `stages.alex = { completedAt, durationMs, status: "success" }`
189
+ 3. Update queue: move feature to `cassQueue`
190
+ 4. If `--pause-after=alex`: Show output path, ask user to continue
115
191
 
116
- **On failure:** Ask user (retry / skip / abort)
192
+ **On failure:** See [Error Handling with Retry](#error-handling-with-smart-retry)
193
+
194
+ ---
195
+
196
+ ## Step 6.5: Cass Feedback on Alex (NEW)
197
+
198
+ **Module:** `src/feedback.js`
199
+
200
+ Unless `--no-feedback` flag is set, collect feedback before Cass writes stories:
201
+
202
+ **Prompt addition to Cass:**
203
+ ```
204
+ FIRST, before writing stories, evaluate Alex's feature spec:
205
+ - Rating (1-5): How clear and complete is the spec?
206
+ - Issues: List any problems (e.g., "missing-error-handling", "unclear-scope")
207
+ - Recommendation: "proceed" | "pause" | "revise"
208
+
209
+ Output your feedback as:
210
+ FEEDBACK: { "rating": N, "issues": [...], "recommendation": "..." }
211
+ ```
212
+
213
+ **Quality Gate Check:**
214
+ - If rating < minRatingThreshold (default 3.0) OR recommendation = "pause"
215
+ - Ask user: "Cass rated Alex's spec {N}/5. Issues: {issues}. Continue anyway?"
216
+ - Options: Continue / Review spec / Abort
217
+
218
+ **Store feedback:** `feedback.cass = { about: "alex", rating, issues, recommendation }`
117
219
 
118
220
  ---
119
221
 
120
222
  ## Step 7: Spawn Cass Agent
121
223
 
224
+ **History:** Record `stages.cass.startedAt` before spawning.
225
+
122
226
  Use the Task tool with `subagent_type="general-purpose"`:
123
227
 
124
228
  **Prompt:**
@@ -155,15 +259,41 @@ Brief summary: story count, filenames, behaviours covered (5 bullets max)
155
259
 
156
260
  **On completion:**
157
261
  1. Verify at least one `story-*.md` exists in `{FEAT_DIR}`
158
- 2. Update queue: move feature to `nigelQueue`
159
- 3. If `--pause-after=cass`: Show story paths, ask user to continue
262
+ 2. **Record history:** `stages.cass = { completedAt, durationMs, status: "success" }`
263
+ 3. Update queue: move feature to `nigelQueue`
264
+ 4. If `--pause-after=cass`: Show story paths, ask user to continue
160
265
 
161
- **On failure:** Ask user (retry / skip / abort)
266
+ **On failure:** See [Error Handling with Retry](#error-handling-with-smart-retry)
267
+
268
+ ---
269
+
270
+ ## Step 7.5: Nigel Feedback on Cass (NEW)
271
+
272
+ **Module:** `src/feedback.js`
273
+
274
+ Unless `--no-feedback` flag is set:
275
+
276
+ **Prompt addition to Nigel:**
277
+ ```
278
+ FIRST, before writing tests, evaluate Cass's user stories:
279
+ - Rating (1-5): How testable are the stories?
280
+ - Issues: List any problems (e.g., "ambiguous-ac", "missing-edge-cases")
281
+ - Recommendation: "proceed" | "pause" | "revise"
282
+
283
+ Output your feedback as:
284
+ FEEDBACK: { "rating": N, "issues": [...], "recommendation": "..." }
285
+ ```
286
+
287
+ **Quality Gate Check:** Same as Step 6.5
288
+
289
+ **Store feedback:** `feedback.nigel = { about: "cass", rating, issues, recommendation }`
162
290
 
163
291
  ---
164
292
 
165
293
  ## Step 8: Spawn Nigel Agent
166
294
 
295
+ **History:** Record `stages.nigel.startedAt` before spawning.
296
+
167
297
  Use the Task tool with `subagent_type="general-purpose"`:
168
298
 
169
299
  **Prompt:**
@@ -203,15 +333,41 @@ Brief summary: test count, AC coverage %, assumptions (5 bullets max)
203
333
 
204
334
  **On completion:**
205
335
  1. Verify `{TEST_SPEC}` and `{TEST_FILE}` exist
206
- 2. Update queue: move feature to `codeyQueue`
207
- 3. If `--pause-after=nigel`: Show test paths, ask user to continue
336
+ 2. **Record history:** `stages.nigel = { completedAt, durationMs, status: "success" }`
337
+ 3. Update queue: move feature to `codeyQueue`
338
+ 4. If `--pause-after=nigel`: Show test paths, ask user to continue
208
339
 
209
- **On failure:** Ask user (retry / skip / abort)
340
+ **On failure:** See [Error Handling with Retry](#error-handling-with-smart-retry)
341
+
342
+ ---
343
+
344
+ ## Step 8.5: Codey Feedback on Nigel (NEW)
345
+
346
+ **Module:** `src/feedback.js`
347
+
348
+ Unless `--no-feedback` flag is set:
349
+
350
+ **Prompt addition to Codey (Plan phase):**
351
+ ```
352
+ FIRST, before creating the plan, evaluate Nigel's tests:
353
+ - Rating (1-5): How implementable are the tests?
354
+ - Issues: List any problems (e.g., "over-mocked", "missing-setup")
355
+ - Recommendation: "proceed" | "pause" | "revise"
356
+
357
+ Output your feedback as:
358
+ FEEDBACK: { "rating": N, "issues": [...], "recommendation": "..." }
359
+ ```
360
+
361
+ **Quality Gate Check:** Same as Step 6.5
362
+
363
+ **Store feedback:** `feedback.codey = { about: "nigel", rating, issues, recommendation }`
210
364
 
211
365
  ---
212
366
 
213
367
  ## Step 9: Spawn Codey Agent (Plan)
214
368
 
369
+ **History:** Record `stages.codeyPlan.startedAt` before spawning.
370
+
215
371
  Use the Task tool with `subagent_type="general-purpose"`:
216
372
 
217
373
  **Prompt:**
@@ -241,14 +397,17 @@ Plan structure (keep concise - aim for <80 lines total):
241
397
 
242
398
  **On completion:**
243
399
  1. Verify `{PLAN}` exists
244
- 2. If `--pause-after=codey-plan`: Show plan path, ask user to continue
400
+ 2. **Record history:** `stages.codeyPlan = { completedAt, durationMs, status: "success" }`
401
+ 3. If `--pause-after=codey-plan`: Show plan path, ask user to continue
245
402
 
246
- **On failure:** Ask user (retry / skip / abort)
403
+ **On failure:** See [Error Handling with Retry](#error-handling-with-smart-retry)
247
404
 
248
405
  ---
249
406
 
250
407
  ## Step 10: Spawn Codey Agent (Implement)
251
408
 
409
+ **History:** Record `stages.codeyImplement.startedAt` before spawning.
410
+
252
411
  Use the Task tool with `subagent_type="general-purpose"`:
253
412
 
254
413
  **Prompt:**
@@ -289,10 +448,11 @@ Brief summary: files changed (list), test status (X/Y passing), blockers if any
289
448
 
290
449
  **On completion:**
291
450
  1. Run `npm test` to verify
292
- 2. Update queue: move feature to `completed`
293
- 3. Proceed to auto-commit (unless `--no-commit`)
451
+ 2. **Record history:** `stages.codeyImplement = { completedAt, durationMs, status: "success" }`
452
+ 3. Update queue: move feature to `completed`
453
+ 4. Proceed to auto-commit (unless `--no-commit`)
294
454
 
295
- **On failure:** Ask user (retry / skip / abort)
455
+ **On failure:** See [Error Handling with Retry](#error-handling-with-smart-retry)
296
456
 
297
457
  ---
298
458
 
@@ -321,29 +481,128 @@ Co-Authored-By: Claude <noreply@anthropic.com>
321
481
 
322
482
  ---
323
483
 
324
- ## Step 12: Report Status
484
+ ## Step 12: Report Status & Finalize History (ENHANCED)
485
+
486
+ **Module:** `src/history.js`
487
+
488
+ Unless `--no-history` flag is set, finalize the history entry:
325
489
 
490
+ ```javascript
491
+ historyEntry.status = "success";
492
+ historyEntry.completedAt = new Date().toISOString();
493
+ historyEntry.totalDurationMs = completedAt - startedAt;
494
+ historyEntry.commitHash = "{hash}";
495
+ // Save to .claude/pipeline-history.json
496
+ ```
497
+
498
+ **Display summary:**
326
499
  ```
327
500
  ## Completed
328
501
  - feature_{slug}
329
502
  - Stories: N
330
503
  - Tests: N (all passing)
504
+ - Duration: X min (avg: Y min)
331
505
  - Commit: {hash}
332
506
 
507
+ ## Feedback Summary
508
+ - Alex spec: rated 4/5 by Cass
509
+ - Cass stories: rated 5/5 by Nigel
510
+ - Nigel tests: rated 4/5 by Codey
511
+
333
512
  ## Next Action
334
513
  Pipeline complete. Run `npm test` to verify or `/implement-feature` for next feature.
335
514
  ```
336
515
 
337
516
  ---
338
517
 
339
- ## Error Handling
518
+ ## Error Handling with Smart Retry (ENHANCED)
519
+
520
+ **Modules:** `src/retry.js`, `src/feedback.js`, `src/insights.js`
340
521
 
341
522
  After each agent spawn, if the Task tool returns an error or output validation fails:
342
523
 
343
- **Ask the user:**
344
- 1. **Retry** - Re-run the agent with same inputs
345
- 2. **Skip** - Move to next stage anyway (with warning about missing artifacts)
346
- 3. **Abort** - Stop pipeline, update queue with failure for recovery
524
+ ### 1. Analyze Failure Context
525
+
526
+ **Check feedback chain for clues:**
527
+ ```
528
+ If Cass flagged "unclear-scope" on Alex's spec
529
+ → Likely root cause identified
530
+ → Recommend: "add-context" strategy
531
+ ```
532
+
533
+ **Check history for patterns:**
534
+ ```bash
535
+ node bin/cli.js insights --failures --json
536
+ ```
537
+ - If this stage has >20% failure rate, suggest alternative strategy
538
+ - If this specific issue pattern correlates with failures, mention it
539
+
540
+ ### 2. Get Retry Strategy Recommendation
541
+
542
+ **Module:** `src/retry.js`
543
+
544
+ ```
545
+ Strategy recommendation based on:
546
+ - Stage: {stage}
547
+ - Attempt: {attemptNumber}
548
+ - Failure rate: {rate}%
549
+ - Feedback issues: {issues}
550
+
551
+ Recommended: {strategy}
552
+ ```
553
+
554
+ **Available strategies:**
555
+ | Strategy | Effect |
556
+ |----------|--------|
557
+ | `retry` | Simple retry with same prompt |
558
+ | `simplify-prompt` | Reduce scope: "Focus only on core happy path" |
559
+ | `add-context` | Include more output from previous stages |
560
+ | `reduce-stories` | Ask for fewer, more focused stories |
561
+ | `simplify-tests` | Ask for fewer, essential tests only |
562
+ | `incremental` | Implement one test at a time |
563
+
564
+ ### 3. Ask User with Recommendation
565
+
566
+ ```
567
+ ## Stage Failed: {stage}
568
+
569
+ Feedback context: Cass flagged "unclear-scope" on Alex's spec
570
+ History: This stage fails 25% of the time
571
+ Recommended strategy: add-context
572
+
573
+ Options:
574
+ 1. Retry with "add-context" strategy (recommended)
575
+ 2. Retry with simple retry
576
+ 3. Skip this stage (warning: missing artifacts)
577
+ 4. Abort pipeline
578
+ ```
579
+
580
+ ### 4. Apply Strategy and Retry
581
+
582
+ If user selects a retry strategy, modify the agent prompt:
583
+
584
+ **Example: add-context strategy**
585
+ ```
586
+ [Original prompt]
587
+
588
+ ## Additional Context (added due to retry)
589
+ Previous stage feedback indicated: "unclear-scope"
590
+ Here is additional context from earlier stages:
591
+ - System spec key points: [summary]
592
+ - Feature spec key decisions: [summary]
593
+ ```
594
+
595
+ ### 5. Record Failure in History
596
+
597
+ ```javascript
598
+ historyEntry.stages[stage] = {
599
+ status: "failed",
600
+ failedAt: "...",
601
+ attempts: N,
602
+ lastStrategy: "add-context",
603
+ feedbackContext: ["unclear-scope"]
604
+ };
605
+ ```
347
606
 
348
607
  **On abort:** Update queue `failed` array with:
349
608
  ```json
@@ -351,6 +610,8 @@ After each agent spawn, if the Task tool returns an error or output validation f
351
610
  "slug": "{slug}",
352
611
  "stage": "{stage}",
353
612
  "reason": "{error message}",
613
+ "feedbackContext": ["issues from feedback chain"],
614
+ "attemptCount": N,
354
615
  "timestamp": "{ISO timestamp}"
355
616
  }
356
617
  ```
@@ -394,3 +655,52 @@ Run `/implement-feature` again - reads queue and resumes from `current.stage`.
394
655
  | Cass | `.blueprint/agents/AGENT_BA_CASS.md` |
395
656
  | Nigel | `.blueprint/agents/AGENT_TESTER_NIGEL.md` |
396
657
  | Codey | `.blueprint/agents/AGENT_DEVELOPER_CODEY.md` |
658
+
659
+ ---
660
+
661
+ ## Module Integration Summary (NEW)
662
+
663
+ The pipeline integrates these orchestr8 modules:
664
+
665
+ | Module | File | Integration Points |
666
+ |--------|------|-------------------|
667
+ | **validate** | `src/validate.js` | Step 0: Pre-flight checks |
668
+ | **history** | `src/history.js` | Steps 5-12: Record timing, finalize entry |
669
+ | **insights** | `src/insights.js` | Step 3.5: Preview, On failure: Analysis |
670
+ | **feedback** | `src/feedback.js` | Steps 6.5, 7.5, 8.5: Quality gates |
671
+ | **retry** | `src/retry.js` | On failure: Strategy recommendation |
672
+
673
+ ### CLI Commands Available
674
+
675
+ ```bash
676
+ # Pre-flight validation
677
+ npx orchestr8 validate
678
+
679
+ # History management
680
+ npx orchestr8 history
681
+ npx orchestr8 history --stats
682
+ npx orchestr8 history --all
683
+
684
+ # Pipeline insights
685
+ npx orchestr8 insights
686
+ npx orchestr8 insights --feedback
687
+ npx orchestr8 insights --bottlenecks
688
+ npx orchestr8 insights --failures
689
+
690
+ # Retry configuration
691
+ npx orchestr8 retry-config
692
+ npx orchestr8 retry-config set maxRetries 5
693
+
694
+ # Feedback configuration
695
+ npx orchestr8 feedback-config
696
+ npx orchestr8 feedback-config set minRatingThreshold 3.5
697
+ ```
698
+
699
+ ### Data Files Created
700
+
701
+ | File | Purpose |
702
+ |------|---------|
703
+ | `.claude/pipeline-history.json` | Execution history with timing and feedback |
704
+ | `.claude/retry-config.json` | Retry strategies and thresholds |
705
+ | `.claude/feedback-config.json` | Feedback quality gate thresholds |
706
+ | `.claude/implement-queue.json` | Pipeline queue state (existing) |
package/bin/cli.js CHANGED
@@ -2,13 +2,36 @@
2
2
 
3
3
  const { init } = require('../src/init');
4
4
  const { update } = require('../src/update');
5
- const { addSkills, listSkills } = require('../src/skills');
6
5
  const { displayQueue, resetQueue } = require('../src/orchestrator');
6
+ const { validate, formatOutput } = require('../src/validate');
7
+ const { displayHistory, showStats, clearHistory } = require('../src/history');
8
+ const { displayInsights } = require('../src/insights');
9
+ const { displayConfig, setConfigValue, resetConfig } = require('../src/retry');
10
+ const {
11
+ displayConfig: displayFeedbackConfig,
12
+ setConfigValue: setFeedbackConfigValue,
13
+ resetConfig: resetFeedbackConfig
14
+ } = require('../src/feedback');
15
+ const { displayFeedbackInsights } = require('../src/insights');
7
16
 
8
17
  const args = process.argv.slice(2);
9
18
  const command = args[0];
10
19
  const subArg = args[1];
11
20
 
21
+ function parseFlags(args) {
22
+ const flags = {};
23
+ for (const arg of args) {
24
+ if (arg === '--all') flags.all = true;
25
+ if (arg === '--stats') flags.stats = true;
26
+ if (arg === '--force') flags.force = true;
27
+ if (arg === '--bottlenecks') flags.bottlenecks = true;
28
+ if (arg === '--failures') flags.failures = true;
29
+ if (arg === '--json') flags.json = true;
30
+ if (arg === '--feedback') flags.feedback = true;
31
+ }
32
+ return flags;
33
+ }
34
+
12
35
  const commands = {
13
36
  init: {
14
37
  fn: init,
@@ -18,14 +41,6 @@ const commands = {
18
41
  fn: update,
19
42
  description: 'Update agents, templates, and rituals (preserves your content)'
20
43
  },
21
- 'add-skills': {
22
- fn: () => addSkills(subArg || 'all'),
23
- description: 'Install recommended skills for an agent (or all)'
24
- },
25
- skills: {
26
- fn: () => listSkills(subArg),
27
- description: 'List recommended skills for agents'
28
- },
29
44
  queue: {
30
45
  fn: () => {
31
46
  if (subArg === 'reset') {
@@ -37,6 +52,83 @@ const commands = {
37
52
  },
38
53
  description: 'Show queue status (use "reset" to clear)'
39
54
  },
55
+ validate: {
56
+ fn: async () => {
57
+ const result = await validate();
58
+ const useColor = process.stdout.isTTY || false;
59
+ console.log(formatOutput(result, useColor));
60
+ process.exit(result.exitCode);
61
+ },
62
+ description: 'Run pre-flight checks to validate project configuration'
63
+ },
64
+ history: {
65
+ fn: async () => {
66
+ const flags = parseFlags(args);
67
+ if (subArg === 'clear') {
68
+ await clearHistory({ force: flags.force });
69
+ } else if (flags.stats) {
70
+ showStats();
71
+ } else {
72
+ displayHistory({ all: flags.all });
73
+ }
74
+ },
75
+ description: 'View pipeline execution history'
76
+ },
77
+ insights: {
78
+ fn: () => {
79
+ const flags = parseFlags(args);
80
+ if (flags.feedback) {
81
+ displayFeedbackInsights({ json: flags.json });
82
+ } else {
83
+ displayInsights({
84
+ bottlenecks: flags.bottlenecks,
85
+ failures: flags.failures,
86
+ json: flags.json
87
+ });
88
+ }
89
+ },
90
+ description: 'Analyze pipeline history for bottlenecks, failures, and trends'
91
+ },
92
+ 'retry-config': {
93
+ fn: () => {
94
+ if (subArg === 'set') {
95
+ const key = args[2];
96
+ const value = args[3];
97
+ if (!key || !value) {
98
+ console.error('Usage: retry-config set <key> <value>');
99
+ console.error('Valid keys: maxRetries, windowSize, highFailureThreshold');
100
+ process.exit(1);
101
+ }
102
+ setConfigValue(key, value);
103
+ } else if (subArg === 'reset') {
104
+ resetConfig();
105
+ console.log('Retry configuration reset to defaults.');
106
+ } else {
107
+ displayConfig();
108
+ }
109
+ },
110
+ description: 'Manage retry configuration for adaptive retry logic'
111
+ },
112
+ 'feedback-config': {
113
+ fn: () => {
114
+ if (subArg === 'set') {
115
+ const key = args[2];
116
+ const value = args[3];
117
+ if (!key || !value) {
118
+ console.error('Usage: feedback-config set <key> <value>');
119
+ console.error('Valid keys: minRatingThreshold, enabled');
120
+ process.exit(1);
121
+ }
122
+ setFeedbackConfigValue(key, value);
123
+ } else if (subArg === 'reset') {
124
+ resetFeedbackConfig();
125
+ console.log('Feedback configuration reset to defaults.');
126
+ } else {
127
+ displayFeedbackConfig();
128
+ }
129
+ },
130
+ description: 'Manage feedback loop configuration'
131
+ },
40
132
  help: {
41
133
  fn: showHelp,
42
134
  description: 'Show this help message'
@@ -45,27 +137,43 @@ const commands = {
45
137
 
46
138
  function showHelp() {
47
139
  console.log(`
48
- agent-workflow - Multi-agent workflow framework
140
+ orchestr8 - Multi-agent workflow framework
49
141
 
50
- Usage: agent-workflow <command> [options]
142
+ Usage: orchestr8 <command> [options]
51
143
 
52
144
  Commands:
53
145
  init Initialize .blueprint directory in current project
54
146
  update Update agents, templates, and rituals (preserves your content)
55
- add-skills [agent] Install recommended skills for an agent (alex, cass, nigel, codey, all)
56
- skills [agent] List recommended skills for agents
147
+ validate Run pre-flight checks to validate project configuration
57
148
  queue Show current queue state for /implement-feature pipeline
58
149
  queue reset Clear the queue and reset all state
150
+ history View recent pipeline runs (last 10 by default)
151
+ history --all View all pipeline runs
152
+ history --stats View aggregate statistics
153
+ history clear Clear all pipeline history (with confirmation)
154
+ history clear --force Clear all pipeline history (no confirmation)
155
+ insights Analyze pipeline for bottlenecks, failures, and trends
156
+ insights --bottlenecks Show only bottleneck analysis
157
+ insights --failures Show only failure patterns
158
+ insights --feedback Show feedback loop insights (calibration, correlations)
159
+ insights --json Output analysis as JSON
160
+ retry-config View current retry configuration
161
+ retry-config set <key> <value> Modify a config value (maxRetries, windowSize, highFailureThreshold)
162
+ retry-config reset Reset retry configuration to defaults
163
+ feedback-config View current feedback loop configuration
164
+ feedback-config set <key> <value> Modify a config value (minRatingThreshold, enabled)
165
+ feedback-config reset Reset feedback configuration to defaults
59
166
  help Show this help message
60
167
 
61
168
  Examples:
62
- npx agent-workflow init
63
- npx agent-workflow update
64
- npx agent-workflow add-skills all
65
- npx agent-workflow add-skills codey
66
- npx agent-workflow skills
67
- npx agent-workflow queue
68
- npx agent-workflow queue reset
169
+ npx orchestr8 init
170
+ npx orchestr8 update
171
+ npx orchestr8 validate
172
+ npx orchestr8 queue
173
+ npx orchestr8 history
174
+ npx orchestr8 history --stats
175
+ npx orchestr8 insights --feedback
176
+ npx orchestr8 feedback-config
69
177
  `);
70
178
  }
71
179