murmur8 3.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/.blueprint/agents/AGENT_BA_CASS.md +239 -0
  2. package/.blueprint/agents/AGENT_DEVELOPER_CODEY.md +308 -0
  3. package/.blueprint/agents/AGENT_SPECIFICATION_ALEX.md +183 -0
  4. package/.blueprint/agents/AGENT_TESTER_NIGEL.md +159 -0
  5. package/.blueprint/agents/GUARDRAILS.md +83 -0
  6. package/.blueprint/agents/TEAM_MANIFESTO.md +91 -0
  7. package/.blueprint/features/.gitkeep +0 -0
  8. package/.blueprint/features/feature_adaptive-retry/FEATURE_SPEC.md +239 -0
  9. package/.blueprint/features/feature_adaptive-retry/IMPLEMENTATION_PLAN.md +48 -0
  10. package/.blueprint/features/feature_adaptive-retry/story-prompt-modification.md +85 -0
  11. package/.blueprint/features/feature_adaptive-retry/story-retry-config.md +89 -0
  12. package/.blueprint/features/feature_adaptive-retry/story-should-retry.md +98 -0
  13. package/.blueprint/features/feature_adaptive-retry/story-strategy-recommendation.md +85 -0
  14. package/.blueprint/features/feature_agent-guardrails/FEATURE_SPEC.md +328 -0
  15. package/.blueprint/features/feature_agent-guardrails/IMPLEMENTATION_PLAN.md +90 -0
  16. package/.blueprint/features/feature_agent-guardrails/story-citation-requirements.md +50 -0
  17. package/.blueprint/features/feature_agent-guardrails/story-confidentiality.md +50 -0
  18. package/.blueprint/features/feature_agent-guardrails/story-escalation-protocol.md +55 -0
  19. package/.blueprint/features/feature_agent-guardrails/story-source-restrictions.md +50 -0
  20. package/.blueprint/features/feature_compressed-feedback/FEATURE_SPEC.md +136 -0
  21. package/.blueprint/features/feature_compressed-feedback/IMPLEMENTATION_PLAN.md +40 -0
  22. package/.blueprint/features/feature_feedback-loop/FEATURE_SPEC.md +347 -0
  23. package/.blueprint/features/feature_feedback-loop/IMPLEMENTATION_PLAN.md +71 -0
  24. package/.blueprint/features/feature_feedback-loop/story-feedback-collection.md +63 -0
  25. package/.blueprint/features/feature_feedback-loop/story-feedback-config.md +61 -0
  26. package/.blueprint/features/feature_feedback-loop/story-feedback-insights.md +63 -0
  27. package/.blueprint/features/feature_feedback-loop/story-quality-gates.md +57 -0
  28. package/.blueprint/features/feature_interactive-alex/FEATURE_SPEC.md +263 -0
  29. package/.blueprint/features/feature_interactive-alex/IMPLEMENTATION_PLAN.md +69 -0
  30. package/.blueprint/features/feature_interactive-alex/handoff-alex.md +19 -0
  31. package/.blueprint/features/feature_interactive-alex/handoff-cass.md +21 -0
  32. package/.blueprint/features/feature_interactive-alex/handoff-nigel.md +19 -0
  33. package/.blueprint/features/feature_interactive-alex/story-flag-routing.md +54 -0
  34. package/.blueprint/features/feature_interactive-alex/story-iterative-drafting.md +65 -0
  35. package/.blueprint/features/feature_interactive-alex/story-pipeline-integration.md +66 -0
  36. package/.blueprint/features/feature_interactive-alex/story-session-lifecycle.md +75 -0
  37. package/.blueprint/features/feature_interactive-alex/story-system-spec-creation.md +57 -0
  38. package/.blueprint/features/feature_lazy-business-context/FEATURE_SPEC.md +140 -0
  39. package/.blueprint/features/feature_lazy-business-context/IMPLEMENTATION_PLAN.md +54 -0
  40. package/.blueprint/features/feature_model-native-features/FEATURE_SPEC.md +174 -0
  41. package/.blueprint/features/feature_model-native-features/IMPLEMENTATION_PLAN.md +45 -0
  42. package/.blueprint/features/feature_parallel-abort/FEATURE_SPEC.md +117 -0
  43. package/.blueprint/features/feature_parallel-confirm/FEATURE_SPEC.md +90 -0
  44. package/.blueprint/features/feature_parallel-features/FEATURE_SPEC.md +291 -0
  45. package/.blueprint/features/feature_parallel-features/IMPLEMENTATION_PLAN.md +73 -0
  46. package/.blueprint/features/feature_parallel-lock/FEATURE_SPEC.md +119 -0
  47. package/.blueprint/features/feature_parallel-logging/FEATURE_SPEC.md +105 -0
  48. package/.blueprint/features/feature_parallel-preflight/FEATURE_SPEC.md +141 -0
  49. package/.blueprint/features/feature_pipeline-history/FEATURE_SPEC.md +239 -0
  50. package/.blueprint/features/feature_pipeline-history/IMPLEMENTATION_PLAN.md +71 -0
  51. package/.blueprint/features/feature_pipeline-history/story-clear-history.md +73 -0
  52. package/.blueprint/features/feature_pipeline-history/story-display-history.md +75 -0
  53. package/.blueprint/features/feature_pipeline-history/story-record-execution.md +76 -0
  54. package/.blueprint/features/feature_pipeline-history/story-show-statistics.md +85 -0
  55. package/.blueprint/features/feature_pipeline-insights/FEATURE_SPEC.md +288 -0
  56. package/.blueprint/features/feature_pipeline-insights/IMPLEMENTATION_PLAN.md +65 -0
  57. package/.blueprint/features/feature_pipeline-insights/story-anomaly-detection.md +71 -0
  58. package/.blueprint/features/feature_pipeline-insights/story-bottleneck-analysis.md +75 -0
  59. package/.blueprint/features/feature_pipeline-insights/story-failure-patterns.md +75 -0
  60. package/.blueprint/features/feature_pipeline-insights/story-json-output.md +75 -0
  61. package/.blueprint/features/feature_pipeline-insights/story-trend-analysis.md +78 -0
  62. package/.blueprint/features/feature_shared-guardrails/FEATURE_SPEC.md +119 -0
  63. package/.blueprint/features/feature_shared-guardrails/IMPLEMENTATION_PLAN.md +34 -0
  64. package/.blueprint/features/feature_shared-guardrails/story-extract-guardrails.md +60 -0
  65. package/.blueprint/features/feature_shared-guardrails/story-update-init-commands.md +63 -0
  66. package/.blueprint/features/feature_slim-agent-prompts/FEATURE_SPEC.md +145 -0
  67. package/.blueprint/features/feature_slim-agent-prompts/IMPLEMENTATION_PLAN.md +87 -0
  68. package/.blueprint/features/feature_slim-agent-prompts/story-create-runtime-prompt-template.md +59 -0
  69. package/.blueprint/features/feature_slim-agent-prompts/story-create-slim-agent-prompts.md +65 -0
  70. package/.blueprint/features/feature_slim-agent-prompts/story-skill-integration.md +53 -0
  71. package/.blueprint/features/feature_smart-story-routing/FEATURE_SPEC.md +147 -0
  72. package/.blueprint/features/feature_smart-story-routing/IMPLEMENTATION_PLAN.md +73 -0
  73. package/.blueprint/features/feature_template-extraction/FEATURE_SPEC.md +134 -0
  74. package/.blueprint/features/feature_template-extraction/IMPLEMENTATION_PLAN.md +46 -0
  75. package/.blueprint/features/feature_upstream-summaries/FEATURE_SPEC.md +150 -0
  76. package/.blueprint/features/feature_upstream-summaries/IMPLEMENTATION_PLAN.md +70 -0
  77. package/.blueprint/features/feature_validate-command/FEATURE_SPEC.md +209 -0
  78. package/.blueprint/features/feature_validate-command/IMPLEMENTATION_PLAN.md +59 -0
  79. package/.blueprint/features/feature_validate-command/story-failure-output.md +61 -0
  80. package/.blueprint/features/feature_validate-command/story-node-version-check.md +52 -0
  81. package/.blueprint/features/feature_validate-command/story-run-validation.md +59 -0
  82. package/.blueprint/features/feature_validate-command/story-success-output.md +50 -0
  83. package/.blueprint/prompts/TEMPLATE.md +65 -0
  84. package/.blueprint/prompts/alex-runtime.md +49 -0
  85. package/.blueprint/prompts/cass-runtime.md +46 -0
  86. package/.blueprint/prompts/codey-implement-runtime.md +52 -0
  87. package/.blueprint/prompts/codey-plan-runtime.md +47 -0
  88. package/.blueprint/prompts/nigel-runtime.md +47 -0
  89. package/.blueprint/system_specification/.gitkeep +0 -0
  90. package/.blueprint/system_specification/SYSTEM_SPEC.md +248 -0
  91. package/.blueprint/templates/FEATURE_SPEC.md +125 -0
  92. package/.blueprint/templates/STORY_TEMPLATE.md +96 -0
  93. package/.blueprint/templates/SYSTEM_SPEC.md +128 -0
  94. package/.blueprint/templates/TEST_TEMPLATE.md +76 -0
  95. package/.blueprint/ways_of_working/DEVELOPMENT_RITUAL.md +178 -0
  96. package/.business_context/README.md +27 -0
  97. package/LICENSE +21 -0
  98. package/README.md +564 -0
  99. package/SKILL.md +840 -0
  100. package/bin/cli.js +388 -0
  101. package/package.json +36 -0
  102. package/src/business-context.js +91 -0
  103. package/src/classifier.js +173 -0
  104. package/src/feedback.js +201 -0
  105. package/src/handoff.js +148 -0
  106. package/src/history.js +306 -0
  107. package/src/index.js +170 -0
  108. package/src/init.js +139 -0
  109. package/src/insights.js +504 -0
  110. package/src/interactive.js +338 -0
  111. package/src/orchestrator.js +217 -0
  112. package/src/parallel.js +1544 -0
  113. package/src/retry.js +274 -0
  114. package/src/stack.js +320 -0
  115. package/src/tools/index.js +27 -0
  116. package/src/tools/prompts.js +45 -0
  117. package/src/tools/schemas.js +38 -0
  118. package/src/tools/validation.js +83 -0
  119. package/src/update.js +112 -0
  120. package/src/validate.js +172 -0
@@ -0,0 +1,61 @@
1
+ # Story — Feedback Configuration
2
+
3
+ ## User Story
4
+
5
+ As a **developer**, I want **CLI commands to view and modify feedback thresholds** so that **I can tune quality gate sensitivity based on my project's needs**.
6
+
7
+ ---
8
+
9
+ ## Context / Scope
10
+
11
+ - Per FEATURE_SPEC.md:Section 7, configuration is stored in `.claude/feedback-config.json`
12
+ - Per FEATURE_SPEC.md:Section 7, new CLI commands: `murmur8 feedback-config` and `murmur8 feedback-config set <key> <value>`
13
+ - Parallel track to quality gates — configuration can be set independently
14
+
15
+ ---
16
+
17
+ ## Acceptance Criteria
18
+
19
+ **AC-1 — View feedback configuration**
20
+ - Given the user runs `murmur8 feedback-config`,
21
+ - When the command executes,
22
+ - Then the current configuration is displayed including:
23
+ - `minRatingThreshold` (default: 3.0)
24
+ - `enabled` (default: true)
25
+ - Any custom issue-to-strategy mappings
26
+
27
+ **AC-2 — Set threshold value**
28
+ - Given the user runs `murmur8 feedback-config set minRating <value>`,
29
+ - When the value is a number between 1.0 and 5.0,
30
+ - Then the threshold is updated in `.claude/feedback-config.json`,
31
+ - And a confirmation message is displayed.
32
+
33
+ **AC-3 — Invalid threshold rejected**
34
+ - Given the user runs `murmur8 feedback-config set minRating <value>`,
35
+ - When the value is outside 1.0-5.0 range or not a number,
36
+ - Then an error message is displayed,
37
+ - And the configuration is not modified.
38
+
39
+ **AC-4 — Enable/disable feedback system**
40
+ - Given the user runs `murmur8 feedback-config set enabled <true|false>`,
41
+ - When the command executes,
42
+ - Then the `enabled` flag is updated,
43
+ - And when disabled, feedback collection and quality gates are skipped.
44
+
45
+ **AC-5 — Configuration file created on first set**
46
+ - Given `.claude/feedback-config.json` does not exist,
47
+ - When the user runs a `feedback-config set` command,
48
+ - Then the file is created with default values plus the specified override.
49
+
50
+ **AC-6 — Configuration file is gitignored**
51
+ - Given a project is initialised with murmur8,
52
+ - When feedback configuration is created,
53
+ - Then `.claude/feedback-config.json` is included in gitignore patterns.
54
+
55
+ ---
56
+
57
+ ## Out of Scope
58
+
59
+ - Per-agent threshold configuration (single global threshold for MVP)
60
+ - Custom issue code definition via CLI
61
+ - Configuration import/export
@@ -0,0 +1,63 @@
1
+ # Story — Feedback Insights
2
+
3
+ ## User Story
4
+
5
+ As a **developer**, I want **correlation analysis between feedback scores and pipeline outcomes** so that **I can understand how predictive agent feedback is and tune thresholds accordingly**.
6
+
7
+ ---
8
+
9
+ ## Context / Scope
10
+
11
+ - Per FEATURE_SPEC.md:Section 7, extends `src/insights.js` with feedback analysis functions
12
+ - Per FEATURE_SPEC.md:Section 6 (Rule 4), calculates agent calibration as correlation between ratings and outcomes
13
+ - Depends on feedback being stored in history (story-feedback-collection.md)
14
+ - Per FEATURE_SPEC.md:Section 9, requires 10+ completed runs for meaningful results
15
+
16
+ ---
17
+
18
+ ## Acceptance Criteria
19
+
20
+ **AC-1 — Feedback analysis command**
21
+ - Given the user runs `murmur8 insights --feedback`,
22
+ - When sufficient history exists (10+ completed runs with feedback),
23
+ - Then a feedback analysis report is displayed.
24
+
25
+ **AC-2 — Agent calibration scoring**
26
+ - Given the feedback analysis runs,
27
+ - When calibration is calculated per agent,
28
+ - Then each agent receives a calibration score (0.0-1.0):
29
+ - 0.0 = feedback uncorrelated with outcomes
30
+ - 1.0 = perfect predictor of success/failure
31
+ - And the score is displayed as "Cass calibration: 0.72" format.
32
+
33
+ **AC-3 — Issue pattern correlation**
34
+ - Given feedback history contains issue codes,
35
+ - When the analysis runs,
36
+ - Then issue codes are correlated with failure outcomes,
37
+ - And frequently predictive issues are highlighted (e.g., "`unclear-scope` preceded 80% of failures").
38
+
39
+ **AC-4 — Threshold recommendation**
40
+ - Given sufficient calibration data exists,
41
+ - When the analysis runs,
42
+ - Then a recommended `minRatingThreshold` is suggested based on historical data,
43
+ - And the recommendation balances false positives (unnecessary pauses) and false negatives (missed quality issues).
44
+
45
+ **AC-5 — Insufficient data handling**
46
+ - Given the user runs `murmur8 insights --feedback`,
47
+ - When fewer than 10 completed runs with feedback exist,
48
+ - Then a message is displayed: "Insufficient data for feedback analysis. {N}/10 runs with feedback available."
49
+
50
+ **AC-6 — Retry strategy mapping**
51
+ - Given feedback analysis identifies predictive issue patterns,
52
+ - When the user views insights,
53
+ - Then issue-to-strategy mappings are displayed (per FEATURE_SPEC.md:Rule 3),
54
+ - And the user can see which retry strategies are recommended for common issues.
55
+
56
+ ---
57
+
58
+ ## Out of Scope
59
+
60
+ - Cross-pipeline feedback aggregation (each project is independent)
61
+ - Real-time calibration updates during pipeline execution
62
+ - Natural language interpretation of feedback patterns
63
+ - Automatic threshold adjustment (user must run `feedback-config set`)
@@ -0,0 +1,57 @@
1
+ # Story — Quality Gates
2
+
3
+ ## User Story
4
+
5
+ As a **developer**, I want **the pipeline to pause when feedback indicates quality concerns** so that **I can review and address issues before proceeding with flawed inputs**.
6
+
7
+ ---
8
+
9
+ ## Context / Scope
10
+
11
+ - Per FEATURE_SPEC.md:Section 4 (Alternative: Quality Gate Triggers Pause), pipeline pauses when rating < threshold or recommendation is "pause"
12
+ - Default threshold is 3.0 (per FEATURE_SPEC.md:Section 4)
13
+ - Depends on feedback collection (story-feedback-collection.md)
14
+ - Per SYSTEM_SPEC.md:Section 8, failure handling already supports pause/review — quality gates extend this
15
+
16
+ ---
17
+
18
+ ## Acceptance Criteria
19
+
20
+ **AC-1 — Quality gate evaluation**
21
+ - Given feedback is collected from an agent,
22
+ - When the orchestrator evaluates the feedback,
23
+ - Then `shouldPause` is true if:
24
+ - `rating < minRatingThreshold`, OR
25
+ - `recommendation === "pause"`
26
+
27
+ **AC-2 — Pipeline pauses on quality gate trigger**
28
+ - Given `shouldPause` evaluates to true,
29
+ - When the quality gate is triggered,
30
+ - Then the pipeline pauses before the current agent begins its main work,
31
+ - And the user is prompted with: "Quality gate triggered. {Agent} rated previous stage {rating}/5. Issues: {issues}. (review/proceed/abort)"
32
+
33
+ **AC-3 — User can proceed past quality gate**
34
+ - Given the pipeline is paused at a quality gate,
35
+ - When the user chooses "proceed",
36
+ - Then the pipeline continues with the current agent's main work,
37
+ - And the decision is recorded in history.
38
+
39
+ **AC-4 — User can abort at quality gate**
40
+ - Given the pipeline is paused at a quality gate,
41
+ - When the user chooses "abort",
42
+ - Then the pipeline stops,
43
+ - And the feature is moved to the failed list with reason "quality_gate_abort".
44
+
45
+ **AC-5 — User can review at quality gate**
46
+ - Given the pipeline is paused at a quality gate,
47
+ - When the user chooses "review",
48
+ - Then the pipeline remains paused,
49
+ - And the user can examine upstream artifacts before deciding to proceed or abort.
50
+
51
+ ---
52
+
53
+ ## Out of Scope
54
+
55
+ - Automatic remediation or revision of upstream artifacts
56
+ - Multiple threshold levels per agent (single global threshold for MVP)
57
+ - Bypassing quality gates without explicit user action
@@ -0,0 +1,263 @@
1
+ # Feature Specification: Interactive Alex
2
+
3
+ ## 1. Feature Intent
4
+
5
+ **Problem:** Currently, Alex runs as a one-shot sub-agent via the Task tool, producing feature specifications autonomously without user input. This works well when users have clear requirements, but leads to suboptimal specs when requirements are ambiguous or incomplete. Users must either accept potentially misaligned specs or manually restart the pipeline after reviewing and editing.
6
+
7
+ **Solution:** Add an interactive conversational mode where Alex engages in back-and-forth dialogue with the user to collaboratively create specifications. This mode triggers automatically when no spec exists, or explicitly via the `--interactive` flag.
8
+
9
+ **Why this matters:**
10
+ - Reduces spec revision cycles by capturing user intent upfront
11
+ - Improves spec quality through targeted clarifying questions
12
+ - Maintains Alex's role as system conscience while adding user collaboration
13
+ - Aligns with Alex's existing "guiding but revisable" design philosophy
14
+
15
+ ---
16
+
17
+ ## 2. Scope
18
+
19
+ ### In Scope
20
+
21
+ - `--interactive` flag for `/implement-feature` command
22
+ - Auto-detection: trigger interactive mode when SYSTEM_SPEC.md or FEATURE_SPEC.md is missing
23
+ - Interactive session flow for both system specs and feature specs
24
+ - Conversational draft-review-approve cycle
25
+ - Integration with existing `--pause-after=alex` flag for exit control
26
+ - Session state management (in-memory, not persisted to queue)
27
+
28
+ ### Out of Scope
29
+
30
+ - Interactive modes for other agents (Cass, Nigel, Codey) - future features
31
+ - Persistent conversation history between sessions
32
+ - Multi-user collaboration (only single user supported)
33
+ - GUI or rich terminal UI (text-based conversation only)
34
+ - Changes to the agent sub-agent runtime prompt format
35
+
36
+ ---
37
+
38
+ ## 3. Actors
39
+
40
+ ### Primary: Human User
41
+ - Invokes `/implement-feature` with optional `--interactive` flag
42
+ - Provides feature context and answers Alex's clarifying questions
43
+ - Reviews and approves draft spec sections
44
+ - Decides whether to continue pipeline or pause for further review
45
+
46
+ ### Secondary: Alex Agent
47
+ - Operates in conversational mode instead of autonomous mode
48
+ - Asks clarifying questions to understand user intent
49
+ - Drafts spec sections incrementally for user feedback
50
+ - Produces final FEATURE_SPEC.md (or SYSTEM_SPEC.md) upon approval
51
+
52
+ ### Affected: Downstream Pipeline
53
+ - Cass, Nigel, Codey continue to operate autonomously after Alex completes
54
+ - No changes to their behaviour or prompts
55
+
56
+ ---
57
+
58
+ ## 4. Behaviour Model
59
+
60
+ ### 4.1 Trigger Conditions
61
+
62
+ Interactive mode activates when ANY of these conditions are true:
63
+
64
+ | Condition | Artifact Missing | Flag Present | Mode |
65
+ |-----------|------------------|--------------|------|
66
+ | No system spec | SYSTEM_SPEC.md | - | Interactive system spec creation |
67
+ | No feature spec | FEATURE_SPEC.md | - | Interactive feature spec creation |
68
+ | Explicit request | - | `--interactive` | Interactive feature spec creation |
69
+ | Both flags | - | `--interactive --pause-after=alex` | Interactive, then pause |
70
+
71
+ ### 4.2 Session Flow
72
+
73
+ ```
74
+ User: /implement-feature "user-auth"
75
+
76
+
77
+ ┌─────────────────────────────────────────┐
78
+ │ Check: SYSTEM_SPEC.md exists? │
79
+ │ No → Enter Interactive System Spec │
80
+ │ Yes → Continue │
81
+ └─────────────────────────────────────────┘
82
+
83
+
84
+ ┌─────────────────────────────────────────┐
85
+ │ Check: FEATURE_SPEC.md exists? │
86
+ │ No → Enter Interactive Feature Spec │
87
+ │ Check: --interactive flag? │
88
+ │ Yes → Enter Interactive Feature Spec │
89
+ │ No → Run autonomous Alex │
90
+ └─────────────────────────────────────────┘
91
+
92
+
93
+ ┌─────────────────────────────────────────┐
94
+ │ INTERACTIVE SESSION │
95
+ │ 1. Alex: "Describe what you want..." │
96
+ │ 2. User: provides description │
97
+ │ 3. Alex: asks clarifying questions │
98
+ │ 4. User: answers questions │
99
+ │ 5. Alex: drafts spec section │
100
+ │ 6. User: approves / requests changes │
101
+ │ 7. Repeat 3-6 until spec complete │
102
+ │ 8. Alex: writes final spec file │
103
+ └─────────────────────────────────────────┘
104
+
105
+
106
+ ┌─────────────────────────────────────────┐
107
+ │ Exit: --pause-after=alex present? │
108
+ │ Yes → Stop for review │
109
+ │ No → Continue pipeline (Cass, etc.) │
110
+ └─────────────────────────────────────────┘
111
+ ```
112
+
113
+ ### 4.3 Conversational Phases
114
+
115
+ **Phase 1: Context Gathering**
116
+ - Alex reads system spec (if exists), business context, and any existing feature artifacts
117
+ - Alex asks: "Describe the feature you want to build. What problem does it solve and for whom?"
118
+ - User provides initial description
119
+ - Alex acknowledges understanding and identifies gaps
120
+
121
+ **Phase 2: Clarifying Questions**
122
+ - Alex asks 2-4 targeted questions based on:
123
+ - Missing information relative to FEATURE_SPEC template sections
124
+ - Ambiguities in user description
125
+ - Potential conflicts with system spec
126
+ - Questions are asked one batch at a time, not all at once
127
+ - User answers in natural language
128
+ - Alex confirms understanding before proceeding
129
+
130
+ **Phase 3: Iterative Drafting**
131
+ - Alex drafts spec sections incrementally (Intent first, then Scope, etc.)
132
+ - After each section, Alex presents draft and asks: "Does this capture your intent? Any changes?"
133
+ - User can: approve, request changes, or add context
134
+ - Alex revises based on feedback
135
+ - Process continues until all relevant sections are complete
136
+
137
+ **Phase 4: Finalization**
138
+ - Alex presents complete spec summary
139
+ - User gives final approval
140
+ - Alex writes FEATURE_SPEC.md to disk
141
+ - Alex produces handoff summary as normal
142
+
143
+ ### 4.4 Session Commands
144
+
145
+ During interactive session, user can issue commands:
146
+
147
+ | Command | Effect |
148
+ |---------|--------|
149
+ | `/approve` or `yes` | Approve current draft, proceed to next section |
150
+ | `/change <feedback>` | Request specific changes to current section |
151
+ | `/skip` | Skip current section (mark as "TBD" in spec) |
152
+ | `/restart` | Restart current section from scratch |
153
+ | `/abort` | Exit interactive mode without writing spec |
154
+ | `/done` | Finalize spec even if some sections incomplete |
155
+
156
+ ---
157
+
158
+ ## 5. Dependencies
159
+
160
+ ### System Dependencies
161
+ - Requires SKILL.md update to support `--interactive` flag parsing
162
+ - Requires change to pipeline routing logic (Steps 2-3 in SKILL.md)
163
+ - Uses existing Task tool infrastructure for Alex agent spawning
164
+
165
+ ### Artifact Dependencies
166
+ - Reads: `.blueprint/system_specification/SYSTEM_SPEC.md` (if exists)
167
+ - Reads: `.business_context/` directory
168
+ - Reads: `.blueprint/templates/FEATURE_SPEC.md` (for section guidance)
169
+ - Writes: `{FEAT_DIR}/FEATURE_SPEC.md`
170
+ - Writes: `{FEAT_DIR}/handoff-alex.md`
171
+
172
+ ### Configuration Dependencies
173
+ - No new config files required
174
+ - May optionally respect `feedback-config.json` thresholds for self-assessment
175
+
176
+ ---
177
+
178
+ ## 6. Rules & Constraints
179
+
180
+ ### Session Rules
181
+ 1. **Single active session:** Only one interactive session can run at a time
182
+ 2. **In-memory state:** Session state is not persisted; if user aborts mid-session, no partial spec is saved
183
+ 3. **Timeout handling:** No explicit timeout; session continues until user approves or aborts
184
+ 4. **No parallelism:** Interactive mode is inherently sequential
185
+
186
+ ### Spec Quality Rules
187
+ 1. **Template alignment:** Final spec must include at minimum: Intent, Scope, and Actors sections
188
+ 2. **Flagged assumptions:** All inferences must be explicitly marked as assumptions
189
+ 3. **System spec alignment:** Feature spec must not contradict system spec boundaries
190
+
191
+ ### Pipeline Integration Rules
192
+ 1. **Gate preservation:** System spec gate still applies - if no system spec, must create one first
193
+ 2. **Handoff required:** Interactive Alex still produces `handoff-alex.md` for Cass
194
+ 3. **Queue update:** On completion, queue is updated as normal (feature moves to cassQueue)
195
+ 4. **History recording:** Interactive sessions are recorded in pipeline-history.json with `mode: "interactive"`
196
+
197
+ ---
198
+
199
+ ## 7. Non-Functional Considerations
200
+
201
+ ### Usability
202
+ - Alex's questions should be clear and actionable (not open-ended)
203
+ - Each conversational turn should be concise (under 200 words for Alex)
204
+ - Progress indication: show which sections are complete vs remaining
205
+
206
+ ### Performance
207
+ - No additional file I/O until final spec write
208
+ - No external API calls beyond existing Claude conversation
209
+
210
+ ### Auditability
211
+ - Final spec includes note: "Created via interactive session"
212
+ - History entry includes: question count, revision count, session duration
213
+
214
+ ---
215
+
216
+ ## 8. Assumptions & Open Questions
217
+
218
+ ### Assumptions
219
+ 1. Users prefer conversational UX over form-filling for spec creation
220
+ 2. 2-4 clarifying questions is sufficient for most features
221
+ 3. Iterative section-by-section drafting is more effective than full-spec-at-once
222
+ 4. Users will invoke interactive mode for ambiguous or novel features
223
+
224
+ ### Open Questions
225
+ 1. **Q:** Should interactive mode support resumption if session is interrupted?
226
+ - **Tentative:** No, keep simple for v1. User can restart if interrupted.
227
+
228
+ 2. **Q:** Should Alex offer to create SYSTEM_SPEC.md interactively if missing?
229
+ - **Tentative:** Yes, same interactive flow applies.
230
+
231
+ 3. **Q:** Should there be a `--no-interactive` flag to force autonomous mode even when spec is missing?
232
+ - **Tentative:** No, the auto-trigger is a reasonable default. Users can create empty placeholder specs to skip.
233
+
234
+ ---
235
+
236
+ ## 9. Story Themes
237
+
238
+ The following themes will guide user story creation:
239
+
240
+ 1. **Flag Parsing & Routing** - Handling `--interactive` flag and auto-detection logic
241
+ 2. **Conversational Session Management** - Session lifecycle, commands, state tracking
242
+ 3. **Iterative Spec Drafting** - Question flow, section drafting, revision handling
243
+ 4. **Pipeline Integration** - Queue updates, history recording, downstream handoff
244
+ 5. **Error & Edge Cases** - Abort handling, incomplete specs, timeout scenarios
245
+
246
+ ---
247
+
248
+ ## 10. Design Tensions & Trade-offs
249
+
250
+ | Tension | Resolution |
251
+ |---------|------------|
252
+ | **Autonomy vs Control:** Alex's value is autonomous coherence enforcement, but interactive mode prioritizes user control | Interactive mode is opt-in/auto-trigger, not default. Alex still enforces coherence through questions and flagging, just collaboratively. |
253
+ | **Speed vs Quality:** Interactive mode is slower than autonomous | Users self-select: clear requirements = autonomous mode; unclear requirements = interactive mode. Net quality improvement expected. |
254
+ | **Simplicity vs Persistence:** Session state could be persisted for resumption | V1 keeps state in-memory for simplicity. Persistence is a future enhancement if users request it. |
255
+ | **Single agent vs Multi-agent:** Could extend interactive mode to all agents | Scoped to Alex for v1. Alex is the upstream bottleneck; downstream agents benefit from clearer specs without needing interactivity. |
256
+
257
+ ---
258
+
259
+ ## Change Log
260
+
261
+ | Date | Change | Reason |
262
+ |------|--------|--------|
263
+ | 2026-02-26 | Initial feature specification | Define interactive Alex mode for collaborative spec creation |
@@ -0,0 +1,69 @@
1
+ # Implementation Plan: Interactive Alex
2
+
3
+ ## Summary
4
+
5
+ Create `src/interactive.js` module implementing a state machine for interactive spec creation sessions. The module exports functions for flag parsing, mode detection, session lifecycle management, and pipeline integration. SKILL.md routing logic will be updated to check for `--interactive` flag and missing specs, delegating to the new module.
6
+
7
+ ## Files to Create/Modify
8
+
9
+ | Path | Action | Purpose |
10
+ |------|--------|---------|
11
+ | `src/interactive.js` | Create | Session state machine and command handlers |
12
+ | `SKILL.md` | Modify | Add `--interactive` flag docs, update routing logic |
13
+ | `src/orchestrator.js` | Modify | Add interactive mode history fields |
14
+ | `src/history.js` | Modify | Support `mode: "interactive"` and session metrics |
15
+
16
+ ## Implementation Steps
17
+
18
+ 1. **Create `src/interactive.js` with core exports**
19
+ - `parseFlags(args)` - Extract `--interactive` and `--pause-after` flags
20
+ - `shouldEnterInteractiveMode(flags, hasSystemSpec, hasFeatureSpec)` - Routing logic
21
+ - Export constants: `SESSION_STATES`, `SECTION_ORDER`, `MIN_REQUIRED_SECTIONS`
22
+
23
+ 2. **Implement session state machine**
24
+ - States: `idle` → `gathering` → `questioning` → `drafting` → `finalizing`
25
+ - `createSession(target)` - Initialize session for 'system' or 'feature' spec
26
+ - `getSessionProgress(session)` - Return complete vs remaining section counts
27
+
28
+ 3. **Implement command handlers**
29
+ - `handleCommand(session, command)` - Route `/approve`, `/change`, `/skip`, `/restart`, `/abort`, `/done`
30
+ - Each handler mutates session state and returns next action indicator
31
+ - `/change <feedback>` increments `revisionCount`, stores feedback
32
+
33
+ 4. **Implement section drafting flow**
34
+ - `getNextSection(session)` - Return next section to draft based on `SECTION_ORDER`
35
+ - `markSectionComplete(session, section)` - Update section status
36
+ - `markSectionTBD(session, section)` - Mark skipped sections
37
+
38
+ 5. **Implement context gathering**
39
+ - `gatherContext(session)` - Read system spec, business context, templates
40
+ - `identifyGaps(session, userDescription)` - Return 2-4 information gaps
41
+ - `generateQuestions(gaps)` - Produce actionable questions
42
+
43
+ 6. **Implement finalization**
44
+ - `canFinalize(session)` - Check if Intent, Scope, Actors are complete/TBD
45
+ - `generateSpec(session)` - Produce spec content with TBD markers and note
46
+ - `writeSpec(session, outputPath)` - Write FEATURE_SPEC.md or SYSTEM_SPEC.md
47
+
48
+ 7. **Implement handoff generation**
49
+ - `generateHandoff(session)` - Produce handoff-alex.md content
50
+ - Include: key decisions, files created, question/revision counts
51
+
52
+ 8. **Update history.js for interactive metrics**
53
+ - Add `mode`, `questionCount`, `revisionCount`, `sessionDurationMs` fields
54
+ - Update `recordEntry()` to accept interactive session data
55
+
56
+ 9. **Update SKILL.md routing logic**
57
+ - Document `--interactive` flag in usage section
58
+ - Add conditional check after system spec gate: if interactive mode, enter session loop
59
+ - On session complete, continue to downstream agents or pause
60
+
61
+ 10. **Wire up orchestrator queue transitions**
62
+ - Ensure `moveToNextStage()` works with interactive completion
63
+ - No structural changes needed, just ensure integration works
64
+
65
+ ## Risks/Questions
66
+
67
+ - **Token limits**: Interactive session loop may accumulate context. Consider clearing conversation history between sections if Claude context fills up.
68
+ - **Testing gaps**: Current tests use inline stubs. After implementation, update tests to import from `src/interactive.js` directly.
69
+ - **Word count enforcement**: The 200-word limit for Alex responses is a prompt constraint, not code-enforced. Document this in SKILL.md.
@@ -0,0 +1,19 @@
1
+ ## Handoff Summary
2
+ **For:** Cass
3
+ **Feature:** interactive-alex
4
+
5
+ ### Key Decisions
6
+ - Interactive mode triggers automatically when specs are missing, or explicitly via `--interactive` flag
7
+ - Session flow: context gathering → clarifying questions → iterative drafting → finalization
8
+ - In-memory state only (no persistence for v1)
9
+ - Supports both SYSTEM_SPEC.md and FEATURE_SPEC.md creation
10
+ - Integrates with existing `--pause-after=alex` for exit control
11
+
12
+ ### Files Created
13
+ - .blueprint/features/feature_interactive-alex/FEATURE_SPEC.md
14
+
15
+ ### Open Questions
16
+ - None - all resolved in spec
17
+
18
+ ### Critical Context
19
+ Focus stories on: flag parsing/routing, conversational session management, iterative spec drafting, pipeline integration. The feature modifies SKILL.md routing and adds a new interaction pattern while keeping downstream agents (Cass, Nigel, Codey) unchanged.
@@ -0,0 +1,21 @@
1
+ ## Handoff Summary
2
+ **For:** Nigel
3
+ **Feature:** interactive-alex
4
+
5
+ ### Key Decisions
6
+ - Split into 5 stories covering distinct concerns: routing, session lifecycle, drafting, pipeline integration, system spec creation
7
+ - Each story has 5-7 testable acceptance criteria in Given/When/Then format
8
+ - Focused on observable behavior and user commands
9
+
10
+ ### Files Created
11
+ - story-flag-routing.md - `--interactive` flag parsing and auto-detection
12
+ - story-session-lifecycle.md - Session commands (/approve, /change, /skip, /restart, /abort, /done)
13
+ - story-iterative-drafting.md - Context gathering, questions, section drafting
14
+ - story-pipeline-integration.md - Spec output, handoff, queue, history
15
+ - story-system-spec-creation.md - Interactive SYSTEM_SPEC.md creation when missing
16
+
17
+ ### Open Questions
18
+ - None
19
+
20
+ ### Critical Context
21
+ Tests should focus on SKILL.md routing logic and the new `src/interactive.js` module. Mock the conversation loop for unit tests; the iterative drafting can use state machine patterns.
@@ -0,0 +1,19 @@
1
+ ## Handoff Summary
2
+ **For:** Codey
3
+ **Feature:** interactive-alex
4
+
5
+ ### Key Decisions
6
+ - 29 tests covering all 5 stories with 100% AC coverage
7
+ - Tests use Node.js built-in test runner (node:test)
8
+ - Mock-based testing for session state machine and routing
9
+ - State machine pattern for session lifecycle
10
+
11
+ ### Files Created
12
+ - test/artifacts/feature_interactive-alex/test-spec.md
13
+ - test/feature_interactive-alex.test.js
14
+
15
+ ### Open Questions
16
+ - None
17
+
18
+ ### Critical Context
19
+ Create `src/interactive.js` with session state machine (idle → gathering → questioning → drafting → finalizing). Update SKILL.md routing logic to check for `--interactive` flag and missing specs. All tests currently pass with stubs - implement the actual logic.
@@ -0,0 +1,54 @@
1
+ # User Story: Flag Parsing & Mode Routing
2
+
3
+ ## Story
4
+
5
+ **As a** developer using murmur8,
6
+ **I want** the `/implement-feature` command to detect when interactive mode is needed and route accordingly,
7
+ **so that** I get a collaborative spec experience for new/unclear features without manual flag management.
8
+
9
+ ## Acceptance Criteria
10
+
11
+ ### AC-1: Explicit Interactive Flag
12
+
13
+ **Given** a user invokes `/implement-feature "my-feature" --interactive`
14
+ **When** the command parses flags
15
+ **Then** interactive mode is activated regardless of existing spec files
16
+
17
+ ### AC-2: Auto-Detect Missing System Spec
18
+
19
+ **Given** a user invokes `/implement-feature "my-feature"` without `--interactive`
20
+ **And** `.blueprint/system_specification/SYSTEM_SPEC.md` does not exist
21
+ **When** the pipeline routing logic runs
22
+ **Then** interactive mode is activated for system spec creation
23
+
24
+ ### AC-3: Auto-Detect Missing Feature Spec
25
+
26
+ **Given** a user invokes `/implement-feature "my-feature"` without `--interactive`
27
+ **And** `SYSTEM_SPEC.md` exists
28
+ **And** `.blueprint/features/feature_my-feature/FEATURE_SPEC.md` does not exist
29
+ **When** the pipeline routing logic runs
30
+ **Then** interactive mode is activated for feature spec creation
31
+
32
+ ### AC-4: Autonomous Mode When Specs Exist
33
+
34
+ **Given** a user invokes `/implement-feature "my-feature"` without `--interactive`
35
+ **And** both `SYSTEM_SPEC.md` and `FEATURE_SPEC.md` exist
36
+ **When** the pipeline routing logic runs
37
+ **Then** Alex runs in autonomous (non-interactive) mode
38
+
39
+ ### AC-5: Combined Flags
40
+
41
+ **Given** a user invokes `/implement-feature "my-feature" --interactive --pause-after=alex`
42
+ **When** the command parses flags
43
+ **Then** interactive mode is activated
44
+ **And** the pipeline will pause after Alex completes (before Cass)
45
+
46
+ ## Out of Scope
47
+
48
+ - `--no-interactive` flag to force autonomous mode (users can create placeholder specs)
49
+ - Interactive modes for agents other than Alex
50
+ - Flag validation errors (handled by existing CLI parsing)
51
+
52
+ ## References
53
+
54
+ - Feature Spec: `.blueprint/features/feature_interactive-alex/FEATURE_SPEC.md` (Section 4.1)