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,248 @@
1
+ # System Specification — murmur8
2
+
3
+ ## 1. Purpose & Intent
4
+
5
+ **murmur8** is a multi-agent workflow framework that automates feature development from specification to implementation. It coordinates four specialized AI agents (Alex, Cass, Nigel, Codey) through a sequential pipeline, ensuring that features are explicitly specified, documented with user stories, tested, and implemented with traceability.
6
+
7
+ **Why this system exists:**
8
+ - To transform feature ideas into working, tested code through a structured, repeatable process
9
+ - To maintain coherence between specifications, stories, tests, and implementation
10
+ - To reduce ambiguity and drift by enforcing explicit handoffs between agents
11
+
12
+ **Who it exists for:**
13
+ - Developers using Claude Code who want automated, spec-driven feature development
14
+ - Teams seeking a structured approach to AI-assisted software engineering
15
+
16
+ **What success looks like:**
17
+ - Features are implemented with full traceability from spec to code
18
+ - Tests are written before implementation, providing a stable contract
19
+ - All artifacts (specs, stories, tests, code) are aligned and consistent
20
+
21
+ **What must not be compromised:**
22
+ - Explicit specification before implementation
23
+ - Test-first development contracts
24
+ - Agent role boundaries and handoff integrity
25
+
26
+ ---
27
+
28
+ ## 2. Business & Domain Context
29
+
30
+ murmur8 operates in the domain of AI-assisted software development, specifically within the Claude Code CLI environment.
31
+
32
+ **Relevant drivers:**
33
+ - Growing adoption of AI coding assistants
34
+ - Need for structured processes to guide AI-generated code
35
+ - Requirement for traceability and quality assurance in automated development
36
+
37
+ **Domain constraints:**
38
+ - Operates within Claude Code's Task tool for spawning sub-agents
39
+ - Subject to Claude's token limits (optimized via incremental writes)
40
+ - Relies on file-based artifacts for persistence and handoffs
41
+
42
+ **Assumptions:**
43
+ - Users have Node.js 18+ installed
44
+ - Users have Claude Code CLI available
45
+ - Projects use standard testing frameworks (Jest, Node test runner)
46
+ - The `.business_context/` directory contains project-specific domain knowledge
47
+
48
+ ---
49
+
50
+ ## 3. System Boundaries
51
+
52
+ ### In Scope
53
+
54
+ - **CLI tooling:** `init`, `update`, `skills`, `add-skills`, `queue` commands
55
+ - **Agent orchestration:** Sequential pipeline via `/implement-feature` skill
56
+ - **Artifact management:** Feature specs, user stories, test specs, tests, implementation plans
57
+ - **Queue persistence:** Recovery and resumption from `.claude/implement-queue.json`
58
+ - **Skills integration:** Installing optional skills from skills.sh ecosystem
59
+
60
+ ### Out of Scope
61
+
62
+ - Runtime test execution environment (assumes existing test infrastructure)
63
+ - CI/CD integration (users configure their own pipelines)
64
+ - Project-specific business logic (provided via `.business_context/`)
65
+ - IDE integration beyond Claude Code CLI
66
+
67
+ ---
68
+
69
+ ## 4. Actors & Roles
70
+
71
+ ### Human User
72
+ - **Description:** Developer invoking murmur8 commands and the `/implement-feature` skill
73
+ - **Primary goals:** Automate feature development, maintain control over scope and quality
74
+ - **Authority:** Final arbiter on intent, scope, and breaking changes; can pause/abort pipeline
75
+
76
+ ### Alex (System Specification & Chief-of-Staff)
77
+ - **Description:** Creates and maintains system and feature specifications
78
+ - **Primary goals:** Prevent drift, ensure coherence, produce feature specs for downstream agents
79
+ - **Authority:** Can define and evolve specifications; cannot make unilateral product decisions
80
+
81
+ ### Cass (Story Writer / Business Analyst)
82
+ - **Description:** Translates feature specs into user stories and acceptance criteria
83
+ - **Primary goals:** Produce explicit, testable, behaviour-first stories
84
+ - **Authority:** Elaborates specifications into stories; does not introduce unspecified behaviour
85
+
86
+ ### Nigel (Tester)
87
+ - **Description:** Creates test specifications and executable tests from user stories
88
+ - **Primary goals:** Expose ambiguities, provide stable test contracts
89
+ - **Authority:** Defines test coverage; does not implement production code
90
+
91
+ ### Codey (Developer)
92
+ - **Description:** Implements features according to plans and test contracts
93
+ - **Primary goals:** Make tests pass, maintain code quality
94
+ - **Authority:** Writes implementation code; does not modify tests without agreement
95
+
96
+ ---
97
+
98
+ ## 5. Core Domain Concepts
99
+
100
+ ### Feature
101
+ - **Definition:** A bounded unit of functionality identified by a slug (e.g., `user-auth`)
102
+ - **Key attributes:** slug, feature spec, user stories, tests, implementation plan
103
+ - **Lifecycle:** Created by Alex, elaborated by Cass, tested by Nigel, implemented by Codey
104
+
105
+ ### Pipeline Stage
106
+ - **Definition:** A discrete phase in the feature development workflow
107
+ - **Key attributes:** agent owner, input artifacts, output artifacts
108
+ - **Stages:** alex, cass, nigel, codey-plan, codey-implement, auto-commit
109
+
110
+ ### Queue
111
+ - **Definition:** Persistent state tracking features through the pipeline
112
+ - **Key attributes:** current, alexQueue, cassQueue, nigelQueue, codeyQueue, completed, failed
113
+ - **Lifecycle:** Created on first run, updated at each stage transition, cleared on completion
114
+
115
+ ### Artifact
116
+ - **Definition:** A file produced by an agent as output
117
+ - **Types:** SYSTEM_SPEC.md, FEATURE_SPEC.md, story-*.md, test-spec.md, *.test.js, IMPLEMENTATION_PLAN.md
118
+
119
+ ### Skill
120
+ - **Definition:** A Claude Code command that provides specialized agent capabilities
121
+ - **Key attributes:** name, description, prompt template
122
+ - **Lifecycle:** Installed via `add-skills`, invoked via slash commands
123
+
124
+ ---
125
+
126
+ ## 6. High-Level Lifecycle & State Model
127
+
128
+ ### Pipeline Lifecycle
129
+
130
+ ```
131
+ INIT → ALEX → CASS → NIGEL → CODEY_PLAN → CODEY_IMPLEMENT → COMMIT → COMPLETE
132
+
133
+ PAUSED (--pause-after)
134
+
135
+ RESUME
136
+ ```
137
+
138
+ ### Feature States
139
+
140
+ | State | Entry Condition | Exit Condition |
141
+ |-------|----------------|----------------|
142
+ | **pending** | Feature slug provided | Agent starts processing |
143
+ | **in_progress** | Agent spawned for stage | Agent completes or fails |
144
+ | **completed** | All stages pass, commit done | Moved to completed list |
145
+ | **failed** | Agent error or abort | Moved to failed list |
146
+
147
+ ### Recovery
148
+ - On re-invocation, pipeline reads `current.stage` from queue and resumes
149
+ - Failed features can be retried or restarted from scratch
150
+
151
+ ---
152
+
153
+ ## 7. Governing Rules & Invariants
154
+
155
+ ### Pipeline Rules
156
+ - **Sequential execution:** Agents execute in order (Alex → Cass → Nigel → Codey)
157
+ - **Artifact gates:** Each stage requires output artifacts before proceeding
158
+ - **System spec gate:** Pipeline cannot proceed without SYSTEM_SPEC.md
159
+
160
+ ### Agent Rules
161
+ - **Single responsibility:** Each agent has defined inputs and outputs; no overlap
162
+ - **No silent changes:** Agents flag deviations; do not silently alter specifications
163
+ - **Incremental output:** All agents write one file at a time to avoid token limits
164
+
165
+ ### Queue Rules
166
+ - **Single current:** Only one feature can be `current` at a time
167
+ - **Immutable completed:** Completed features are not re-processed unless explicitly restarted
168
+ - **Recovery-safe:** Queue file enables resumption after failures
169
+
170
+ ### Implementation Rules
171
+ - **Tests are contracts:** Codey implements against tests, not around them
172
+ - **No test deletion:** Tests cannot be removed without explicit approval
173
+ - **Green suite required:** Implementation is complete only when all tests pass
174
+
175
+ ---
176
+
177
+ ## 8. Cross-Cutting Concerns
178
+
179
+ ### Traceability
180
+ - Every test maps to acceptance criteria (AC → Test ID table)
181
+ - Every story maps to feature spec sections
182
+ - Commit messages reference artifacts and agents
183
+
184
+ ### Token Limit Management
185
+ - Incremental file writes (one file at a time)
186
+ - Brief summaries (5 bullets max)
187
+ - Reference by path instead of quoting content
188
+ - Consolidated artifacts (Nigel: 2 files, not 4)
189
+
190
+ ### Failure Handling
191
+ - Each agent spawn offers: retry, skip, abort
192
+ - Failures are recorded with stage, reason, and timestamp
193
+ - Queue persists state for recovery
194
+
195
+ ### Observability
196
+ - Queue status available via `murmur8 queue`
197
+ - Each agent provides completion summary
198
+ - Commit messages document pipeline execution
199
+
200
+ ---
201
+
202
+ ## 9. Non-Functional Expectations
203
+
204
+ ### Reliability
205
+ - Pipeline resumes from last checkpoint on failure
206
+ - Queue file is gitignored to avoid conflicts
207
+ - Deterministic output given same inputs
208
+
209
+ ### Performance
210
+ - Optimized for Claude's 4096 output token limit
211
+ - Incremental processing reduces memory pressure
212
+ - Skills installed once per project
213
+
214
+ ### Extensibility
215
+ - Skills can be added per-agent from skills.sh ecosystem
216
+ - Agent specifications can be customized in `.blueprint/agents/`
217
+ - Business context directory allows project-specific grounding
218
+
219
+ ### Maintainability
220
+ - `update` command replaces framework files while preserving user content
221
+ - Clear separation: framework dirs (replaced) vs user dirs (preserved)
222
+
223
+ ---
224
+
225
+ ## 10. Known Gaps, Risks & Open Questions
226
+
227
+ ### Known Limitations
228
+ - Pipeline is sequential; no parallel agent execution
229
+ - Single-feature focus; no batch processing
230
+ - Assumes Node.js testing ecosystem
231
+
232
+ ### Risks
233
+ - Token limit errors if agents generate excessive output
234
+ - Agent specifications may need tuning for non-standard projects
235
+ - Skill installation requires network access
236
+
237
+ ### Open Questions
238
+ - Should agents support alternative testing frameworks?
239
+ - Could pipeline stages be made configurable or skippable?
240
+ - How to handle features that span multiple repositories?
241
+
242
+ ---
243
+
244
+ ## 11. Change Log (System-Level)
245
+
246
+ | Date | Change | Reason | Approved By |
247
+ |------|--------|--------|-------------|
248
+ | 2026-02-24 | Initial system specification | Document murmur8 v2.5.0 | Alex |
@@ -0,0 +1,125 @@
1
+ # Feature Specification — <Feature Name>
2
+
3
+ ## 1. Feature Intent
4
+ **Why this feature exists.**
5
+
6
+ - Problem being addressed
7
+ - User or system need
8
+ - How this supports the system purpose
9
+
10
+ > If this does not clearly align to the System Spec, Alex must flag it.
11
+
12
+ ---
13
+
14
+ ## 2. Scope
15
+ ### In Scope
16
+ - Behaviours, flows, or decisions this feature introduces
17
+
18
+ ### Out of Scope
19
+ - Explicit exclusions
20
+ - Deferred behaviour
21
+
22
+ ---
23
+
24
+ ## 3. Actors Involved
25
+ **Who interacts with this feature.**
26
+
27
+ For each actor:
28
+ - Actor name
29
+ - What they can do in this feature
30
+ - What they cannot do
31
+
32
+ ---
33
+
34
+ ## 4. Behaviour Overview
35
+ **What the feature does, conceptually.**
36
+
37
+ - Happy-path behaviour
38
+ - Key alternatives or branches
39
+ - User-visible outcomes
40
+
41
+ (No UI detail here — behaviour only.)
42
+
43
+ ---
44
+
45
+ ## 5. State & Lifecycle Interactions
46
+ **How this feature touches the system lifecycle.**
47
+
48
+ - States entered
49
+ - States exited
50
+ - States modified
51
+ - Whether this feature is:
52
+ - state-creating
53
+ - state-transitioning
54
+ - state-constraining
55
+
56
+ ---
57
+
58
+ ## 6. Rules & Decision Logic
59
+ **New or exercised rules.**
60
+
61
+ For each rule:
62
+ - Description
63
+ - Inputs
64
+ - Outputs
65
+ - Deterministic vs discretionary
66
+
67
+ ---
68
+
69
+ ## 7. Dependencies
70
+ **What this feature relies on.**
71
+
72
+ - System components
73
+ - External systems
74
+ - Policy or legislative dependencies
75
+ - Operational dependencies
76
+
77
+ ---
78
+
79
+ ## 8. Non-Functional Considerations
80
+ **Only where relevant.**
81
+
82
+ - Performance sensitivity
83
+ - Audit/logging needs
84
+ - Error tolerance
85
+ - Security implications
86
+
87
+ ---
88
+
89
+ ## 9. Assumptions & Open Questions
90
+ **What must be true for this feature to work.**
91
+
92
+ - Assumptions
93
+ - Unknowns
94
+ - Areas needing confirmation
95
+
96
+ ---
97
+
98
+ ## 10. Impact on System Specification
99
+ **Alex-owned reconciliation section.**
100
+
101
+ - Does this feature:
102
+ - Reinforce existing system assumptions?
103
+ - Stretch them?
104
+ - Contradict them?
105
+
106
+ If contradiction exists:
107
+ - Describe the tension
108
+ - Propose a system spec change (do not apply it)
109
+ - Flag for decision
110
+
111
+ ---
112
+
113
+ ## 11. Handover to BA (Cass)
114
+ **What Cass should derive from this spec.**
115
+
116
+ - Story themes
117
+ - Expected story boundaries
118
+ - Areas needing careful story framing
119
+
120
+ ---
121
+
122
+ ## 12. Change Log (Feature-Level)
123
+ | Date | Change | Reason | Raised By |
124
+ |-----|------|--------|-----------|
125
+ | | | | |
@@ -0,0 +1,96 @@
1
+ # User Story Template
2
+
3
+ Use this template when writing user stories and acceptance criteria.
4
+
5
+ ---
6
+
7
+ ## Screen [N] — [Title]
8
+
9
+ ### User story
10
+ As a [role], I want [capability] so that [benefit].
11
+
12
+ ---
13
+
14
+ ### Context / scope
15
+ - Professional user (Solicitor)
16
+ - England standard possession claim
17
+ - Screen is reached when: [entry condition]
18
+ - Route:
19
+ - `GET /claims/[route-name]`
20
+ - `POST /claims/[route-name]`
21
+ - This screen captures: [what data]
22
+
23
+ ---
24
+
25
+ ### Acceptance criteria
26
+
27
+ Write ACs in **Given/When/Then** format (precondition, action, result):
28
+
29
+ **AC-1 — [Short description]**
30
+ - Given [precondition],
31
+ - When [action],
32
+ - Then [expected result].
33
+
34
+ **AC-2 — [Short description]**
35
+ - Given [precondition],
36
+ - When [action],
37
+ - Then [expected result].
38
+
39
+ <!-- Continue with AC-3, AC-4, etc. -->
40
+
41
+ **AC-N — Previous navigation**
42
+ - Given I click Previous,
43
+ - Then I am returned to [previous route]
44
+ - And any entered data is preserved in session.
45
+
46
+ **AC-N+1 — Continue navigation**
47
+ - Given I click Continue and validation passes,
48
+ - Then I am redirected to [next route].
49
+
50
+ **AC-N+2 — Cancel behaviour**
51
+ - Given I click Cancel,
52
+ - Then I am returned to /case-list
53
+ - And the claim draft remains stored in session.
54
+
55
+ **AC-N+3 — Accessibility compliance**
56
+ - Given validation errors occur,
57
+ - Then:
58
+ - a GOV.UK error summary is displayed at the top of the page,
59
+ - errors link to the relevant field,
60
+ - focus moves to the error summary,
61
+ - and all inputs are properly labelled and keyboard accessible.
62
+
63
+ ---
64
+
65
+ ### Session persistence
66
+
67
+ ```js
68
+ session.claim.fieldName = {
69
+ property: 'value' | null
70
+ }
71
+ ```
72
+
73
+ ---
74
+
75
+ ### Out of scope
76
+ - [Item 1]
77
+ - [Item 2]
78
+
79
+ ---
80
+
81
+ ## Guidelines for writing user stories
82
+
83
+ ### Every AC must be:
84
+ - Deterministic
85
+ - Observable via the UI or session
86
+ - Unambiguous
87
+
88
+ ### Routing must be explicit for:
89
+ - Previous link
90
+ - Continue button
91
+ - Cancel link
92
+ - Any conditional paths
93
+
94
+ ### Keep stories focused:
95
+ - Maximum 5-7 ACs per story
96
+ - If more needed, split into multiple story files
@@ -0,0 +1,128 @@
1
+ # System Specification — <System Name>
2
+
3
+ ## 1. Purpose & Intent
4
+ **Why this system exists.**
5
+
6
+ - Problem the system is solving
7
+ - Who it exists for
8
+ - What success looks like in business terms
9
+ - What *must not* be compromised
10
+
11
+ > This section anchors all future decisions.
12
+ > If a feature contradicts this, Alex must flag it.
13
+
14
+ ---
15
+
16
+ ## 2. Business & Domain Context
17
+ **Grounded in `.business_context`.**
18
+
19
+ - Relevant policy, legislation, or organisational drivers
20
+ - Domain constraints the system must respect
21
+ - Known external pressures (operational, judicial, regulatory, etc.)
22
+
23
+ **Assumptions**
24
+ - Explicit assumptions currently being made
25
+ - What is expected to change over time
26
+
27
+ ---
28
+
29
+ ## 3. System Boundaries
30
+ **What is in scope vs out of scope.**
31
+
32
+ ### In Scope
33
+ - Capabilities this system explicitly owns
34
+
35
+ ### Out of Scope
36
+ - Capabilities intentionally excluded
37
+ - Adjacent systems or manual processes
38
+
39
+ ---
40
+
41
+ ## 4. Actors & Roles
42
+ **Who interacts with the system and how.**
43
+
44
+ For each actor:
45
+ - Actor name
46
+ - Description
47
+ - Primary goals
48
+ - Authority level (what they can and cannot do)
49
+
50
+ ---
51
+
52
+ ## 5. Core Domain Concepts
53
+ **Shared language and meanings.**
54
+
55
+ For each concept:
56
+ - Name
57
+ - Definition
58
+ - Key attributes
59
+ - Lifecycle relevance (if applicable)
60
+
61
+ > This is the canonical vocabulary.
62
+ > Feature specs and stories must not redefine these silently.
63
+
64
+ ---
65
+
66
+ ## 6. High-Level Lifecycle & State Model
67
+ **How the system behaves over time.**
68
+
69
+ - Key lifecycle phases
70
+ - High-level states
71
+ - Entry / exit conditions
72
+ - Terminal vs non-terminal states
73
+
74
+ Notes:
75
+ - Known complexity or ambiguity
76
+ - Areas expected to evolve
77
+
78
+ ---
79
+
80
+ ## 7. Governing Rules & Invariants
81
+ **What must always be true.**
82
+
83
+ - Business rules that must not be violated
84
+ - Legal or policy invariants
85
+ - Cross-feature constraints
86
+
87
+ Examples:
88
+ - “X cannot occur unless Y has happened”
89
+ - “Once in state Z, only A or B are permitted”
90
+
91
+ ---
92
+
93
+ ## 8. Cross-Cutting Concerns
94
+ **Concerns that affect multiple features.**
95
+
96
+ - Multi-party behaviour
97
+ - Divergence / convergence
98
+ - Auditability
99
+ - Transparency
100
+ - Accessibility
101
+ - Observability
102
+ - Resilience / failure handling
103
+
104
+ ---
105
+
106
+ ## 9. Non-Functional Expectations (System-Level)
107
+ **Not exhaustive NFRs, but system intent.**
108
+
109
+ - Performance expectations (qualitative)
110
+ - Reliability expectations
111
+ - Security posture
112
+ - Scalability assumptions
113
+
114
+ ---
115
+
116
+ ## 10. Known Gaps, Risks & Open Questions
117
+ **Explicit uncertainty.**
118
+
119
+ - Known weak points in the design
120
+ - Open policy or domain questions
121
+ - Areas where future features are expected to challenge the system
122
+
123
+ ---
124
+
125
+ ## 11. Change Log (System-Level)
126
+ | Date | Change | Reason | Approved By |
127
+ |-----|------|--------|-------------|
128
+ | | | | |
@@ -0,0 +1,76 @@
1
+ # Test Template
2
+
3
+ Use this template when writing test specifications and executable tests.
4
+
5
+ ---
6
+
7
+ ## Outputs you must produce
8
+
9
+ ### 1. test-spec.md (write FIRST, keep under 100 lines)
10
+ - Brief understanding (5-10 lines max)
11
+ - AC to Test ID mapping table (compact format)
12
+ - Key assumptions (bullet list)
13
+
14
+ ### 2. Executable test file (write SECOND)
15
+ - One `describe` block per user story
16
+ - One `it` block per acceptance criterion
17
+ - Self-documenting test names with minimal comments
18
+
19
+ ---
20
+
21
+ ## AC to Test ID Mapping Table Format
22
+
23
+ | AC | Test ID | Scenario |
24
+ |----|---------|----------|
25
+ | AC-1 | T-1.1 | Valid credentials leads to success |
26
+ | AC-1 | T-1.2 | Invalid password leads to error |
27
+ | AC-2 | T-2.1 | Missing field shows validation |
28
+
29
+ ---
30
+
31
+ ## Traceability Table Format
32
+
33
+ | Acceptance Criterion | Test IDs | Notes |
34
+ |---------------------|----------|-------|
35
+ | AC-1 | T-1.1, T-1.2 | Happy path covered |
36
+ | AC-2 | T-2.1 | Edge case pending |
37
+
38
+ ---
39
+
40
+ ## Test Design Principles
41
+
42
+ - **Clarity over cleverness**: Prioritise readability with explicit steps
43
+ - **Determinism**: Avoid flaky patterns and random inputs
44
+ - **Coverage with intent**: Focus on behavioural coverage, not test count
45
+ - **Boundaries and edge cases**: Consider min/max, empty/null, invalid formats
46
+
47
+ ---
48
+
49
+ ## Test Structure Example
50
+
51
+ ```javascript
52
+ describe('Feature: [Feature Name]', () => {
53
+ describe('[User Story Reference]', () => {
54
+ it('T-1.1: [behaviour description]', async () => {
55
+ // Given [precondition]
56
+ // When [action]
57
+ // Then [expected result]
58
+ });
59
+
60
+ it('T-1.2: [another behaviour]', () => {
61
+ // Test implementation
62
+ });
63
+ });
64
+ });
65
+ ```
66
+
67
+ ---
68
+
69
+ ## Guidelines
70
+
71
+ - Make failure states meaningful with expected error messages
72
+ - Avoid over-prescribing implementation details
73
+ - Focus on externally observable behaviour
74
+ - Keep tests small and isolated with one main assertion per test
75
+ - Clean up async tasks and resources at test end
76
+ - Use `it.skip` or `test.todo` for pending/blocked tests