bms-speckit-plugin 5.3.0 → 6.1.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.
|
@@ -49,6 +49,8 @@ You are a senior quality control engineer performing a comprehensive audit of a
|
|
|
49
49
|
|
|
50
50
|
## Phase A: Code Errors (MUST pass before other phases)
|
|
51
51
|
|
|
52
|
+
### A1. Standard Checks
|
|
53
|
+
|
|
52
54
|
1. Run the build command (`npm run build`, `tsc`, `python -m py_compile`, etc.)
|
|
53
55
|
2. Run linter (`eslint .`, `flake8`, `ruff check`, etc.)
|
|
54
56
|
3. Run the full test suite (`npm test`, `pytest`, etc.)
|
|
@@ -59,6 +61,50 @@ You are a senior quality control engineer performing a comprehensive audit of a
|
|
|
59
61
|
- Re-run to confirm fix
|
|
60
62
|
5. Repeat until all three (build + lint + test) pass with zero errors
|
|
61
63
|
|
|
64
|
+
### A2. Runtime Safety Patterns
|
|
65
|
+
|
|
66
|
+
Build and lint miss an entire class of runtime errors — type-correct syntax that crashes when executed. These checks close that gap. **Detect the project language(s) first, then apply the relevant checks.**
|
|
67
|
+
|
|
68
|
+
#### Language Config Strictness
|
|
69
|
+
|
|
70
|
+
Check that the project's type checker / compiler is configured for maximum strictness:
|
|
71
|
+
|
|
72
|
+
- **TypeScript** — `tsconfig.json` should have `"strict": true` (or at minimum: `noImplicitAny`, `strictNullChecks`, `noImplicitReturns`, `noUncheckedIndexedAccess`). Enable and fix resulting errors.
|
|
73
|
+
- **Python** — If using mypy/pyright, check config has `strict = true` or equivalent. If no type checker is configured, flag it.
|
|
74
|
+
- **Go** — Verify `go vet` passes. Check for unchecked errors (`errcheck`).
|
|
75
|
+
- **Rust** — Verify `#![deny(warnings)]` or strict clippy lints are enabled.
|
|
76
|
+
- **Other** — Check for the language's equivalent strict/lint configuration.
|
|
77
|
+
|
|
78
|
+
#### Type Mismatch Patterns
|
|
79
|
+
|
|
80
|
+
Grep source files for patterns where a value of one type is used where another type is expected. These are the most common causes of runtime crashes that pass build/lint:
|
|
81
|
+
|
|
82
|
+
1. **Iterable/collection confusion** — A function returns one collection type but the caller treats it as another:
|
|
83
|
+
- Spreading non-iterables: `[...obj]` where `obj` is a plain object (JS/TS crashes), `[...fn()]` where `fn` returns a dict/object instead of a list/array
|
|
84
|
+
- Iterating dicts/objects: `for x in fn()` where `fn` returns a dict (Python iterates keys, not values)
|
|
85
|
+
- Calling collection methods on wrong types: `.map()`, `.filter()`, `.reduce()` on non-arrays; `.keys()` on a list instead of a dict
|
|
86
|
+
- **Fix:** Add explicit return type annotations on the function, add runtime type checks at the call site (e.g., `Array.isArray()`, `isinstance()`)
|
|
87
|
+
|
|
88
|
+
2. **Null/undefined/None access** — Chained property or method access on values from external sources (API responses, DB results, user input, config files) without null guards:
|
|
89
|
+
- JS/TS: `data.result.items.map(...)` where any level could be `undefined`
|
|
90
|
+
- Python: `data["result"]["items"]` where any key could be missing
|
|
91
|
+
- **Fix:** Add optional chaining, default values, or explicit null/key-existence checks
|
|
92
|
+
|
|
93
|
+
3. **Type assertion/cast bypass** — Code that overrides the type system's safety checks:
|
|
94
|
+
- TS: `as SomeType`, `!` non-null assertion
|
|
95
|
+
- Python: `cast()`, `# type: ignore`
|
|
96
|
+
- Go: unchecked type assertions `val := x.(Type)` without `, ok` pattern
|
|
97
|
+
- **Fix:** Verify each assertion is actually correct. Replace with type guards or proper error handling where possible
|
|
98
|
+
|
|
99
|
+
4. **Implicit type coercion** — Operations that silently convert types, masking bugs:
|
|
100
|
+
- JS/TS: `==` instead of `===`, string concatenation with numbers (`"count: " + count`)
|
|
101
|
+
- Python: comparing different types without explicit conversion
|
|
102
|
+
- **Fix:** Use strict equality, explicit type conversion
|
|
103
|
+
|
|
104
|
+
5. **Missing return type annotations on data transformers** — Functions that reshape, map, filter, or aggregate data should always have explicit return types. Without them, the type system infers too broadly and callers may use the result incorrectly.
|
|
105
|
+
- Grep for exported functions and functions whose results are spread or iterated
|
|
106
|
+
- **Fix:** Add explicit return type annotations
|
|
107
|
+
|
|
62
108
|
## Phase B: Security Audit
|
|
63
109
|
|
|
64
110
|
1. Run `npm audit` or `pip audit` to check for known vulnerabilities
|
|
@@ -162,6 +208,8 @@ After completing all phases, provide a summary report:
|
|
|
162
208
|
- [ ] Build: PASS/FAIL (X errors fixed)
|
|
163
209
|
- [ ] Lint: PASS/FAIL (X errors fixed)
|
|
164
210
|
- [ ] Tests: PASS/FAIL (X failures fixed)
|
|
211
|
+
- [ ] Language config strictness: PASS/SKIP (X issues fixed)
|
|
212
|
+
- [ ] Runtime safety patterns: PASS (X type mismatches fixed)
|
|
165
213
|
|
|
166
214
|
### Security
|
|
167
215
|
- [ ] No hardcoded secrets
|
|
@@ -9,14 +9,16 @@
|
|
|
9
9
|
# to prevent loss and provide traceability per the project constitution.
|
|
10
10
|
|
|
11
11
|
id: bms_speckit_development_pipeline
|
|
12
|
-
version:
|
|
12
|
+
version: 5.0.0
|
|
13
13
|
name: BMS Speckit Automated Development Pipeline
|
|
14
14
|
description: >
|
|
15
15
|
Full engineering workflow from requirement to verified implementation.
|
|
16
|
-
Chains brainstorming,
|
|
17
|
-
analysis, implementation (TDD), and final
|
|
18
|
-
Commits after every important step. Uses knowledge-mcp
|
|
19
|
-
and specify steps to ground specs in real HOSxP data.
|
|
16
|
+
Chains brainstorming, external research, constitution, specification,
|
|
17
|
+
planning, task generation, analysis, implementation (TDD), and final
|
|
18
|
+
verification. Commits after every important step. Uses knowledge-mcp
|
|
19
|
+
during brainstorm and specify steps to ground specs in real HOSxP data.
|
|
20
|
+
Uses WebSearch and context7 during research to survey best practices
|
|
21
|
+
and current library documentation.
|
|
20
22
|
category: Development
|
|
21
23
|
|
|
22
24
|
# ─── Chain Sequence ────────────────────────────────────────────────────────────
|
|
@@ -51,7 +53,50 @@ chain_sequence:
|
|
|
51
53
|
system architecture. Also search bms, moph, nhso collections
|
|
52
54
|
if relevant to the feature.
|
|
53
55
|
|
|
54
|
-
- step_id:
|
|
56
|
+
- step_id: step_2_research
|
|
57
|
+
skill_id: internal.research
|
|
58
|
+
action: execute
|
|
59
|
+
phase: 1
|
|
60
|
+
description: >
|
|
61
|
+
Survey external best practices, recommended libraries, compliance
|
|
62
|
+
standards, and reference architectures via WebSearch and context7.
|
|
63
|
+
Produces a research brief that enriches the specification step.
|
|
64
|
+
timeout_seconds: 300
|
|
65
|
+
input:
|
|
66
|
+
source: "{{step_1_brainstorm.output}}"
|
|
67
|
+
output:
|
|
68
|
+
artifacts: [specs/*/research.md]
|
|
69
|
+
post_action:
|
|
70
|
+
commit: true
|
|
71
|
+
message: "feat(speckit): research — best practices and technology survey"
|
|
72
|
+
push: true
|
|
73
|
+
error_handling:
|
|
74
|
+
on_failure: continue
|
|
75
|
+
max_retries: 1
|
|
76
|
+
tools:
|
|
77
|
+
- WebSearch
|
|
78
|
+
- mcp__plugin_context7_context7__resolve-library-id
|
|
79
|
+
- mcp__plugin_context7_context7__query-docs
|
|
80
|
+
opinionated_prompts:
|
|
81
|
+
system_context: >
|
|
82
|
+
Research external best practices, design patterns, and recommended
|
|
83
|
+
libraries/frameworks relevant to the feature described in step 1.
|
|
84
|
+
|
|
85
|
+
1. Identify research topics from the brainstorm output.
|
|
86
|
+
2. WebSearch for best practices, architecture guidance, and proven
|
|
87
|
+
patterns for each topic.
|
|
88
|
+
3. For each technology/library identified: compare alternatives
|
|
89
|
+
(maintenance, bundle size, license), then use context7
|
|
90
|
+
resolve-library-id + query-docs to fetch current documentation.
|
|
91
|
+
4. If the feature involves sensitive data (healthcare, financial, PII),
|
|
92
|
+
research relevant compliance standards and security guidelines.
|
|
93
|
+
5. Search for similar implementations or reference architectures.
|
|
94
|
+
|
|
95
|
+
Output a research brief containing: best practices summary,
|
|
96
|
+
recommended libraries with rationale, documentation references,
|
|
97
|
+
security/compliance notes, and prior art.
|
|
98
|
+
|
|
99
|
+
- step_id: step_3_constitution
|
|
55
100
|
skill_id: speckit.constitution
|
|
56
101
|
action: execute
|
|
57
102
|
phase: 1
|
|
@@ -84,7 +129,7 @@ chain_sequence:
|
|
|
84
129
|
TDD is non-negotiable. Constitution must enforce testing at all levels,
|
|
85
130
|
atomic commits, reusable components, and centralized business logic.
|
|
86
131
|
|
|
87
|
-
- step_id:
|
|
132
|
+
- step_id: step_4_claude_md_sync
|
|
88
133
|
skill_id: internal.claude_md_verify
|
|
89
134
|
action: execute
|
|
90
135
|
phase: 1
|
|
@@ -105,14 +150,15 @@ chain_sequence:
|
|
|
105
150
|
Read CLAUDE.md and verify it complies with specs/constitution.md.
|
|
106
151
|
Update CLAUDE.md if it conflicts with or is missing constitution rules.
|
|
107
152
|
|
|
108
|
-
- step_id:
|
|
153
|
+
- step_id: step_5_specify
|
|
109
154
|
skill_id: speckit.specify
|
|
110
155
|
action: execute
|
|
111
156
|
phase: 1
|
|
112
|
-
description: Create feature specification enriched with HOSxP knowledge
|
|
157
|
+
description: Create feature specification enriched with HOSxP knowledge and research findings
|
|
113
158
|
timeout_seconds: 300
|
|
114
159
|
input:
|
|
115
160
|
requirement: "{{step_1_brainstorm.output}}"
|
|
161
|
+
research: "{{step_2_research.output}}"
|
|
116
162
|
output:
|
|
117
163
|
artifacts: [specs/*/spec.md]
|
|
118
164
|
post_action:
|
|
@@ -126,19 +172,22 @@ chain_sequence:
|
|
|
126
172
|
system_context: >
|
|
127
173
|
Generate a complete, testable specification. Include acceptance criteria,
|
|
128
174
|
data models, API contracts, and edge cases.
|
|
175
|
+
Incorporate research findings from step 2 — recommended libraries,
|
|
176
|
+
best practices, and compliance requirements should be referenced
|
|
177
|
+
in the specification.
|
|
129
178
|
Use mcp__bms-knowledge-mcp__search_knowledge to search the hosxp
|
|
130
179
|
collection for exact table names, field names, data types, and
|
|
131
180
|
relationships needed by this feature. Reference actual HOSxP
|
|
132
181
|
data structures in the spec, not assumed ones.
|
|
133
182
|
|
|
134
|
-
- step_id:
|
|
183
|
+
- step_id: step_6_plan
|
|
135
184
|
skill_id: speckit.plan
|
|
136
185
|
action: execute
|
|
137
186
|
phase: 1
|
|
138
187
|
description: Generate implementation plan from specification
|
|
139
188
|
timeout_seconds: 300
|
|
140
189
|
input:
|
|
141
|
-
source: "{{
|
|
190
|
+
source: "{{step_5_specify.artifacts}}"
|
|
142
191
|
output:
|
|
143
192
|
artifacts: [specs/*/plan.md]
|
|
144
193
|
post_action:
|
|
@@ -153,14 +202,14 @@ chain_sequence:
|
|
|
153
202
|
Plan in ordered steps. Include file paths, component boundaries,
|
|
154
203
|
test strategy, and rollback considerations.
|
|
155
204
|
|
|
156
|
-
- step_id:
|
|
205
|
+
- step_id: step_7_tasks
|
|
157
206
|
skill_id: speckit.tasks
|
|
158
207
|
action: execute
|
|
159
208
|
phase: 1
|
|
160
209
|
description: Generate dependency-ordered task list
|
|
161
210
|
timeout_seconds: 300
|
|
162
211
|
input:
|
|
163
|
-
source: "{{
|
|
212
|
+
source: "{{step_6_plan.artifacts}}"
|
|
164
213
|
output:
|
|
165
214
|
artifacts: [specs/*/tasks.md]
|
|
166
215
|
post_action:
|
|
@@ -175,14 +224,14 @@ chain_sequence:
|
|
|
175
224
|
Tasks must be atomic, dependency-ordered, and each independently testable.
|
|
176
225
|
Include clear acceptance criteria per task.
|
|
177
226
|
|
|
178
|
-
- step_id:
|
|
227
|
+
- step_id: step_8_analyze
|
|
179
228
|
skill_id: speckit.analyze
|
|
180
229
|
action: execute
|
|
181
230
|
phase: 1
|
|
182
231
|
description: Cross-artifact consistency and quality check
|
|
183
232
|
timeout_seconds: 300
|
|
184
233
|
input:
|
|
185
|
-
source: "{{
|
|
234
|
+
source: "{{step_7_tasks.artifacts}}"
|
|
186
235
|
output:
|
|
187
236
|
artifacts: [analysis_report]
|
|
188
237
|
post_action:
|
|
@@ -194,12 +243,14 @@ chain_sequence:
|
|
|
194
243
|
max_retries: 1
|
|
195
244
|
opinionated_prompts:
|
|
196
245
|
system_context: >
|
|
197
|
-
Check spec ↔ plan ↔ tasks consistency. Flag gaps,
|
|
198
|
-
and missing test coverage.
|
|
246
|
+
Check spec ↔ plan ↔ tasks ↔ research consistency. Flag gaps,
|
|
247
|
+
contradictions, and missing test coverage. Verify that research
|
|
248
|
+
recommendations are reflected in the spec and plan.
|
|
249
|
+
Non-destructive — report only.
|
|
199
250
|
|
|
200
251
|
# ── Phase 2: Implementation (main context) ────────────────────────────────
|
|
201
252
|
|
|
202
|
-
- step_id:
|
|
253
|
+
- step_id: step_9_compact
|
|
203
254
|
skill_id: internal.compact
|
|
204
255
|
action: execute
|
|
205
256
|
phase: 2
|
|
@@ -209,7 +260,7 @@ chain_sequence:
|
|
|
209
260
|
on_failure: continue
|
|
210
261
|
max_retries: 0
|
|
211
262
|
|
|
212
|
-
- step_id:
|
|
263
|
+
- step_id: step_10_implement_with_rolling_qc
|
|
213
264
|
skill_id: speckit.implement
|
|
214
265
|
action: execute_loop
|
|
215
266
|
phase: 2
|
|
@@ -219,7 +270,7 @@ chain_sequence:
|
|
|
219
270
|
next task. Catches bugs at the source, not at the end.
|
|
220
271
|
timeout_seconds: 3600
|
|
221
272
|
input:
|
|
222
|
-
tasks_path: "{{
|
|
273
|
+
tasks_path: "{{step_7_tasks.artifacts}}"
|
|
223
274
|
loop_engine: ralph-loop
|
|
224
275
|
completion_promise: "FINISHED"
|
|
225
276
|
max_iterations: 10
|
|
@@ -237,6 +288,16 @@ chain_sequence:
|
|
|
237
288
|
For EACH task, execute this rolling QC cycle:
|
|
238
289
|
|
|
239
290
|
1. IMPLEMENT — write code following TDD (tests first, then implementation)
|
|
291
|
+
RUNTIME SAFETY RULES (prevent errors that build/lint miss):
|
|
292
|
+
- Always add explicit return type annotations on data transformation
|
|
293
|
+
functions. Never rely on type inference for functions whose return
|
|
294
|
+
values are spread, iterated, or passed to collection methods
|
|
295
|
+
- Never spread or iterate a function return value without verifying
|
|
296
|
+
it returns the expected collection type (array not object, list not dict)
|
|
297
|
+
- Use strict equality, add null/undefined/None guards for external
|
|
298
|
+
data (API responses, DB results, config, user input)
|
|
299
|
+
- Write unit tests that execute data transformation functions and
|
|
300
|
+
verify the output type and shape
|
|
240
301
|
2. INLINE QC — immediately after implementation, run:
|
|
241
302
|
a. Build/compile — fix any type or build errors
|
|
242
303
|
b. Lint — fix all lint errors and warnings
|
|
@@ -245,6 +306,9 @@ chain_sequence:
|
|
|
245
306
|
XSS, unvalidated input in the code you just wrote
|
|
246
307
|
e. UX check — if UI code was changed, verify error messages are
|
|
247
308
|
actionable, loading states exist, and user feedback is present
|
|
309
|
+
f. Runtime safety scan — grep for spread/iteration on non-collection
|
|
310
|
+
types, missing return type annotations on data transformation
|
|
311
|
+
functions, loose equality operators. Fix any found.
|
|
248
312
|
3. FIX — fix every issue found in step 2, then re-run checks
|
|
249
313
|
4. COMMIT — only commit when build + lint + tests all pass with zero errors
|
|
250
314
|
5. NEXT TASK — proceed to the next task
|
|
@@ -256,19 +320,19 @@ chain_sequence:
|
|
|
256
320
|
validation pass. Apply improvements, re-run all tests, confirm zero
|
|
257
321
|
regression. Only output FINISHED after everything is validated.
|
|
258
322
|
|
|
259
|
-
- step_id:
|
|
323
|
+
- step_id: step_11_final_quality_gate
|
|
260
324
|
agent_id: bms-speckit:quality-control
|
|
261
325
|
action: dispatch_agent
|
|
262
326
|
phase: 2
|
|
263
327
|
description: >
|
|
264
328
|
Final comprehensive QC sweep by the quality-control agent. Since inline
|
|
265
329
|
QC already caught per-task issues, this focuses on cross-cutting concerns:
|
|
266
|
-
dependency health, deep security audit, overall UX consistency,
|
|
267
|
-
accessibility compliance.
|
|
330
|
+
dependency health, deep security audit, overall UX consistency,
|
|
331
|
+
accessibility compliance, and deployment artifact validation.
|
|
268
332
|
timeout_seconds: 900
|
|
269
333
|
post_action:
|
|
270
334
|
commit: true
|
|
271
|
-
message: "fix(speckit): final QC — security, deps, UX consistency, accessibility"
|
|
335
|
+
message: "fix(speckit): final QC — security, deps, UX consistency, accessibility, deployment"
|
|
272
336
|
push: true
|
|
273
337
|
error_handling:
|
|
274
338
|
on_failure: stop
|
|
@@ -284,10 +348,14 @@ chain_sequence:
|
|
|
284
348
|
all features, empty states, responsive design
|
|
285
349
|
D. Accessibility — alt text, form labels, keyboard nav, heading hierarchy
|
|
286
350
|
E. Integration check — verify all components work together end-to-end
|
|
351
|
+
F. Deployment artifacts — Dockerfile lint, base image CVE check via
|
|
352
|
+
WebSearch, docker-compose validation, .dockerignore, CI/CD configs
|
|
353
|
+
(skipped if no deployment files exist)
|
|
287
354
|
Fix everything possible. Flag major dependency updates for user review.
|
|
288
|
-
|
|
355
|
+
Proceed to merge unless unfixed build errors, test failures, or
|
|
356
|
+
critical security vulnerabilities remain.
|
|
289
357
|
|
|
290
|
-
- step_id:
|
|
358
|
+
- step_id: step_12_merge
|
|
291
359
|
skill_id: internal.git_merge_to_main
|
|
292
360
|
action: execute
|
|
293
361
|
phase: 2
|
|
@@ -308,22 +376,26 @@ chain_sequence:
|
|
|
308
376
|
metadata:
|
|
309
377
|
author: manoirx
|
|
310
378
|
created_at: "2026-03-29"
|
|
311
|
-
|
|
312
|
-
|
|
379
|
+
updated_at: "2026-04-02"
|
|
380
|
+
tags: [speckit, tdd, workflow, development, chain, engineering, hosxp, knowledge, research]
|
|
381
|
+
estimated_duration_seconds: 6300
|
|
313
382
|
commit_strategy: per_step
|
|
314
383
|
knowledge_collections:
|
|
315
384
|
hosxp: "Data dictionaries, ER diagrams, table schemas, module architecture"
|
|
316
385
|
bms: "BMS tools, organization, API info"
|
|
317
386
|
moph: "Ministry of Public Health regulations"
|
|
318
387
|
nhso: "NHSO reimbursement rules and announcements"
|
|
388
|
+
external_research:
|
|
389
|
+
websearch: "Best practices, library comparisons, compliance standards, reference architectures"
|
|
390
|
+
context7: "Current library documentation and API references"
|
|
319
391
|
phases:
|
|
320
392
|
phase_1:
|
|
321
393
|
name: Specification & Planning
|
|
322
|
-
steps: [step_1 through
|
|
394
|
+
steps: [step_1 through step_8]
|
|
323
395
|
execution: subagent
|
|
324
396
|
reason: Preserve main context window for implementation
|
|
325
397
|
phase_2:
|
|
326
398
|
name: Implementation & Verification & Merge
|
|
327
|
-
steps: [
|
|
399
|
+
steps: [step_9 through step_12]
|
|
328
400
|
execution: main_context
|
|
329
401
|
reason: Implementation needs full tool access and ralph-loop
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bms-speckit-plugin",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.1.0",
|
|
4
4
|
"description": "Chain-orchestrated development pipeline: /bms-speckit takes requirements and runs brainstorm → constitution → specify → plan → tasks → analyze → implement → verify with per-step error handling",
|
|
5
5
|
"files": [
|
|
6
6
|
".claude-plugin/",
|
|
@@ -14,7 +14,7 @@ Chain blueprint: `blueprints/bms-speckit-pipeline.yaml`
|
|
|
14
14
|
3. On step failure, check the **error policy** before proceeding:
|
|
15
15
|
- `on_failure: stop` → halt the chain and report which step failed
|
|
16
16
|
- `on_failure: continue` → log the failure and proceed to next step
|
|
17
|
-
4. Pass `$ARGUMENTS` (the user's requirement) to step 1 (brainstorm). Step
|
|
17
|
+
4. Pass `$ARGUMENTS` (the user's requirement) to step 1 (brainstorm). Step 5 (specify) receives the **output from step 1 enriched by step 2 research**
|
|
18
18
|
5. **Commit and push after every important step** — each artifact-producing step must commit its output before proceeding to the next step
|
|
19
19
|
6. **Report progress** to the user at every step transition
|
|
20
20
|
7. Do NOT ask for confirmation between steps
|
|
@@ -27,16 +27,17 @@ Before dispatching the Phase 1 subagent, create a progress tracker so the user c
|
|
|
27
27
|
|
|
28
28
|
```
|
|
29
29
|
TaskCreate: "Step 1: Brainstorm — explore requirements"
|
|
30
|
-
TaskCreate: "Step 2:
|
|
31
|
-
TaskCreate: "Step 3:
|
|
32
|
-
TaskCreate: "Step 4:
|
|
33
|
-
TaskCreate: "Step 5:
|
|
34
|
-
TaskCreate: "Step 6:
|
|
35
|
-
TaskCreate: "Step 7:
|
|
36
|
-
TaskCreate: "Step 8:
|
|
37
|
-
TaskCreate: "Step 9:
|
|
38
|
-
TaskCreate: "Step 10:
|
|
39
|
-
TaskCreate: "Step 11:
|
|
30
|
+
TaskCreate: "Step 2: Research — best practices & technology survey"
|
|
31
|
+
TaskCreate: "Step 3: Constitution — engineering principles"
|
|
32
|
+
TaskCreate: "Step 4: CLAUDE.md sync"
|
|
33
|
+
TaskCreate: "Step 5: Specify — feature specification"
|
|
34
|
+
TaskCreate: "Step 6: Plan — implementation plan"
|
|
35
|
+
TaskCreate: "Step 7: Tasks — task list"
|
|
36
|
+
TaskCreate: "Step 8: Analyze — consistency check"
|
|
37
|
+
TaskCreate: "Step 9: Compact context"
|
|
38
|
+
TaskCreate: "Step 10: Implement with rolling QC"
|
|
39
|
+
TaskCreate: "Step 11: Final quality gate"
|
|
40
|
+
TaskCreate: "Step 12: Merge to main"
|
|
40
41
|
```
|
|
41
42
|
|
|
42
43
|
Then output a message to the user:
|
|
@@ -57,14 +58,14 @@ You are running the BMS Speckit specification and planning chain. Execute each s
|
|
|
57
58
|
|
|
58
59
|
**IMPORTANT — Progress reporting:** Before starting each step, output a progress message to the user in this format:
|
|
59
60
|
|
|
60
|
-
`[Step N/
|
|
61
|
+
`[Step N/12] step_name — description...`
|
|
61
62
|
|
|
62
63
|
After completing each step, output:
|
|
63
64
|
|
|
64
|
-
`[Step N/
|
|
65
|
+
`[Step N/12] DONE — brief result summary`
|
|
65
66
|
|
|
66
67
|
### Step 1 — Brainstorm `[on_failure: STOP]`
|
|
67
|
-
- **Progress:** Output `[Step 1/
|
|
68
|
+
- **Progress:** Output `[Step 1/12] Brainstorm — exploring requirements and design...`
|
|
68
69
|
- **Skill:** `superpowers.brainstorm`
|
|
69
70
|
- **Input:** "$ARGUMENTS"
|
|
70
71
|
- **Purpose:** Explore intent, requirements, design alternatives, and edge cases
|
|
@@ -72,66 +73,88 @@ After completing each step, output:
|
|
|
72
73
|
- **Output:** Detailed specification document
|
|
73
74
|
- **Timeout:** 300s
|
|
74
75
|
- **Post-action:** Commit all files and push. Message: `feat(speckit): brainstorm — explore requirements and design`
|
|
75
|
-
- **Done:** Output `[Step 1/
|
|
76
|
+
- **Done:** Output `[Step 1/12] DONE — brainstorm complete`
|
|
76
77
|
|
|
77
|
-
### Step 2 —
|
|
78
|
-
- **Progress:** Output `[Step 2/
|
|
78
|
+
### Step 2 — Research `[on_failure: CONTINUE]`
|
|
79
|
+
- **Progress:** Output `[Step 2/12] Research — surveying best practices and technologies...`
|
|
80
|
+
- **Purpose:** Research external best practices, proven patterns, recommended libraries/frameworks, and informative reference material relevant to the user's requirement. This grounds the pipeline in current industry knowledge before specification begins.
|
|
81
|
+
- **Tools:** Use `WebSearch` and `mcp__plugin_context7_context7__resolve-library-id` + `mcp__plugin_context7_context7__query-docs` for library documentation
|
|
82
|
+
- **Timeout:** 300s
|
|
83
|
+
- **Process:**
|
|
84
|
+
1. **Identify research topics** from Step 1 output — extract key technologies, patterns, and domains that need external validation
|
|
85
|
+
2. **Best practices search** — WebSearch for best practices, design patterns, and architecture guidance relevant to the feature (e.g., "real-time dashboard best practices", "patient data security standards", "React table performance optimization")
|
|
86
|
+
3. **Library/framework survey** — For each technology identified in brainstorm:
|
|
87
|
+
- WebSearch for current recommended libraries, compare alternatives (stars, maintenance, bundle size, license)
|
|
88
|
+
- Use context7 `resolve-library-id` then `query-docs` to fetch current documentation for top candidates
|
|
89
|
+
4. **Security & compliance research** — If the feature involves sensitive data (healthcare, financial, PII), search for relevant compliance standards and security guidelines
|
|
90
|
+
5. **Prior art** — Search for similar implementations, open-source examples, or reference architectures that inform the design
|
|
91
|
+
- **Output:** A research brief saved as `specs/*/research.md` containing:
|
|
92
|
+
- **Best practices summary** — key patterns and principles to follow
|
|
93
|
+
- **Recommended libraries** — with rationale (why this over alternatives)
|
|
94
|
+
- **Documentation references** — links and key API details from context7
|
|
95
|
+
- **Security/compliance notes** — standards to adhere to (if applicable)
|
|
96
|
+
- **Prior art** — reference implementations or architectures found
|
|
97
|
+
- **Post-action:** Commit all files and push. Message: `feat(speckit): research — best practices and technology survey`
|
|
98
|
+
- **Done:** Output `[Step 2/12] DONE — research brief created (N topics researched)`
|
|
99
|
+
|
|
100
|
+
### Step 3 — Constitution `[on_failure: STOP]`
|
|
101
|
+
- **Progress:** Output `[Step 3/12] Constitution — establishing engineering principles...`
|
|
79
102
|
- **Skill:** `speckit.constitution`
|
|
80
103
|
- **Input:** "Establish and enforce a comprehensive set of engineering principles that prioritize high code quality, strict adherence to Test-Driven Development (TDD) practices, and well-defined testing standards across unit, component, integration, and API levels to ensure system reliability and maintainability, maintain a consistent, user-friendly, and professional user interface aligned with strong user experience (UX) guidelines, optimize application performance through efficient architecture and resource management; enforce disciplined version control practices with frequent, atomic commits to minimize risk and improve traceability, promote the development and reuse of modular components and functions while centralizing business logic to avoid duplication and ensure consistency, provide clear, informative user feedback and progress reporting throughout system interactions, and leverage all available tools, frameworks, and domain-specific expertise to support developers in delivering robust, scalable, and high-quality applications."
|
|
81
104
|
- **Output:** `specs/constitution.md`
|
|
82
105
|
- **Timeout:** 300s
|
|
83
|
-
- **Done:** Output `[Step
|
|
106
|
+
- **Done:** Output `[Step 3/12] DONE — constitution created`
|
|
84
107
|
|
|
85
|
-
### Step
|
|
86
|
-
- **Progress:** Output `[Step
|
|
108
|
+
### Step 4 — CLAUDE.md Sync `[on_failure: CONTINUE]`
|
|
109
|
+
- **Progress:** Output `[Step 4/12] CLAUDE.md Sync — verifying compliance...`
|
|
87
110
|
- **Action:** Read CLAUDE.md and verify it complies with the constitution in `specs/constitution.md`. Update CLAUDE.md if it conflicts with or is missing constitution rules.
|
|
88
111
|
- **Timeout:** 120s
|
|
89
112
|
- **Post-action:** Commit all files and push. Message: `feat(speckit): add constitution and sync CLAUDE.md`
|
|
90
|
-
- **Done:** Output `[Step
|
|
113
|
+
- **Done:** Output `[Step 4/12] DONE — CLAUDE.md synced`
|
|
91
114
|
|
|
92
|
-
### Step
|
|
93
|
-
- **Progress:** Output `[Step
|
|
115
|
+
### Step 5 — Specify `[on_failure: STOP]`
|
|
116
|
+
- **Progress:** Output `[Step 5/12] Specify — creating feature specification...`
|
|
94
117
|
- **Skill:** `speckit.specify`
|
|
95
|
-
- **Input:** Use the detailed specification output from Step 1 (brainstorm)
|
|
118
|
+
- **Input:** Use the detailed specification output from Step 1 (brainstorm) **enriched with the research findings from Step 2**. Include recommended libraries, best practices, and compliance requirements from the research brief in the specification input.
|
|
96
119
|
- **Knowledge lookup:** Use `mcp__bms-knowledge-mcp__search_knowledge` to search the `hosxp` collection for exact table names, field names, data types, and relationships needed by this feature. Reference actual HOSxP data structures in the spec.
|
|
97
120
|
- **Output:** `specs/*/spec.md`
|
|
98
121
|
- **Timeout:** 300s
|
|
99
122
|
- **Retry:** up to 2 attempts
|
|
100
123
|
- **Post-action:** Commit all files and push. Message: `feat(speckit): add feature specification`
|
|
101
|
-
- **Done:** Output `[Step
|
|
124
|
+
- **Done:** Output `[Step 5/12] DONE — specification created`
|
|
102
125
|
|
|
103
|
-
### Step
|
|
104
|
-
- **Progress:** Output `[Step
|
|
126
|
+
### Step 6 — Plan `[on_failure: STOP]`
|
|
127
|
+
- **Progress:** Output `[Step 6/12] Plan — generating implementation plan...`
|
|
105
128
|
- **Skill:** `speckit.plan`
|
|
106
|
-
- **Input:** reads from step
|
|
129
|
+
- **Input:** reads from step 5 artifacts
|
|
107
130
|
- **Output:** `specs/*/plan.md`
|
|
108
131
|
- **Timeout:** 300s
|
|
109
132
|
- **Retry:** up to 2 attempts
|
|
110
133
|
- **Post-action:** Commit all files and push. Message: `feat(speckit): add implementation plan`
|
|
111
|
-
- **Done:** Output `[Step
|
|
134
|
+
- **Done:** Output `[Step 6/12] DONE — plan created`
|
|
112
135
|
|
|
113
|
-
### Step
|
|
114
|
-
- **Progress:** Output `[Step
|
|
136
|
+
### Step 7 — Tasks `[on_failure: STOP]`
|
|
137
|
+
- **Progress:** Output `[Step 7/12] Tasks — generating task list...`
|
|
115
138
|
- **Skill:** `speckit.tasks`
|
|
116
|
-
- **Input:** reads from step
|
|
139
|
+
- **Input:** reads from step 6 artifacts
|
|
117
140
|
- **Output:** `specs/*/tasks.md`
|
|
118
141
|
- **Timeout:** 300s
|
|
119
142
|
- **Retry:** up to 2 attempts
|
|
120
143
|
- **Post-action:** Commit all files and push. Message: `feat(speckit): add task list`
|
|
121
|
-
- **Done:** Output `[Step
|
|
144
|
+
- **Done:** Output `[Step 7/12] DONE — N tasks created`
|
|
122
145
|
|
|
123
|
-
### Step
|
|
124
|
-
- **Progress:** Output `[Step
|
|
146
|
+
### Step 8 — Analyze `[on_failure: CONTINUE]`
|
|
147
|
+
- **Progress:** Output `[Step 8/12] Analyze — cross-artifact consistency check...`
|
|
125
148
|
- **Skill:** `speckit.analyze`
|
|
126
|
-
- **Purpose:** Cross-artifact consistency check (spec ↔ plan ↔ tasks). Non-destructive — report only.
|
|
149
|
+
- **Purpose:** Cross-artifact consistency check (spec ↔ plan ↔ tasks ↔ research). Non-destructive — report only.
|
|
127
150
|
- **Timeout:** 300s
|
|
128
151
|
- **Post-action:** Commit all files and push. Message: `feat(speckit): add cross-artifact analysis report`
|
|
129
|
-
- **Done:** Output `[Step
|
|
152
|
+
- **Done:** Output `[Step 8/12] DONE — analysis complete`
|
|
130
153
|
|
|
131
154
|
After all steps complete, return: the feature name, number of tasks created, and the path to tasks.md.
|
|
132
155
|
"""
|
|
133
156
|
|
|
134
|
-
After the subagent completes, update tasks 1-
|
|
157
|
+
After the subagent completes, update tasks 1-8 as completed using TaskUpdate, then output:
|
|
135
158
|
|
|
136
159
|
> Phase 1 complete. N tasks created at specs/feature-name/tasks.md
|
|
137
160
|
> Starting Phase 2 (implementation)...
|
|
@@ -142,32 +165,36 @@ After the subagent completes, update tasks 1-7 as completed using TaskUpdate, th
|
|
|
142
165
|
|
|
143
166
|
> **Execution context:** Runs in main context after subagent completes.
|
|
144
167
|
|
|
145
|
-
### Step
|
|
146
|
-
- **Progress:** Output `[Step
|
|
168
|
+
### Step 9 — Compact `[on_failure: CONTINUE]`
|
|
169
|
+
- **Progress:** Output `[Step 9/12] Compact — freeing context window...`
|
|
147
170
|
- **Action:** Run `/compact` to free context window before implementation.
|
|
148
|
-
- **Done:** Update task
|
|
171
|
+
- **Done:** Update task 9 as completed.
|
|
149
172
|
|
|
150
|
-
### Step
|
|
151
|
-
- **Progress:** Output `[Step
|
|
173
|
+
### Step 10 — Implement with Rolling QC `[on_failure: CONTINUE | max_retries: 3]`
|
|
174
|
+
- **Progress:** Output `[Step 10/12] Implement — starting rolling QC loop (N tasks)...`
|
|
152
175
|
- **Engine:** ralph-loop
|
|
153
176
|
- **Input:** Use the **tasks.md path returned by the Phase 1 subagent** (e.g. `specs/my-feature/tasks.md`). Replace `{TASKS_PATH}` below with the actual path.
|
|
154
177
|
- **Completion promise:** `FINISHED`
|
|
155
178
|
- **Max iterations:** 10
|
|
156
179
|
- **Pattern:** Rolling Review — each task gets its own QC cycle before moving to the next
|
|
157
180
|
- **Per-task cycle:**
|
|
158
|
-
1. **IMPLEMENT** — write code following TDD (tests first, then implementation)
|
|
181
|
+
1. **IMPLEMENT** — write code following TDD (tests first, then implementation). **Runtime safety rules:**
|
|
182
|
+
- Always add explicit return type annotations on data transformation functions — never rely on type inference for functions whose return values are spread, iterated, or passed to collection methods
|
|
183
|
+
- Never spread or iterate a function's return value without verifying it returns the expected collection type (e.g., array not object, list not dict)
|
|
184
|
+
- Use strict equality, add null/undefined/None guards for external data (API responses, DB results, config, user input)
|
|
185
|
+
- Add unit tests that actually execute data transformation functions and verify the output type and shape
|
|
159
186
|
2. **INLINE QC** — immediately run: build, lint, ALL tests, security quick scan, UX check
|
|
160
187
|
3. **FIX** — fix every issue found, re-run checks
|
|
161
188
|
4. **COMMIT** — only commit when build + lint + tests pass with zero errors
|
|
162
189
|
5. **NEXT** — move to next task
|
|
163
190
|
- **Action:** Run:
|
|
164
191
|
|
|
165
|
-
`/ralph-loop:ralph-loop "systematically execute speckit.implement via the Skill tool to complete every task defined in {TASKS_PATH} with strict adherence to specification requirements. IMPORTANT: apply rolling QC after EACH task — after implementing a task run build and fix build errors, run linter and fix lint errors, run ALL tests (not just new ones) and fix failures, check for hardcoded secrets and injection vulnerabilities in code you just wrote, verify UI code has actionable error messages and loading states
|
|
192
|
+
`/ralph-loop:ralph-loop "systematically execute speckit.implement via the Skill tool to complete every task defined in {TASKS_PATH} with strict adherence to specification requirements. IMPORTANT: apply rolling QC after EACH task — after implementing a task run build and fix build errors, run linter and fix lint errors, run ALL tests (not just new ones) and fix failures, check for hardcoded secrets and injection vulnerabilities in code you just wrote, verify UI code has actionable error messages and loading states. RUNTIME SAFETY: always add explicit return type annotations on data transformation functions, never spread or iterate a function return value without verifying it returns the expected collection type, use strict equality and null guards for external data, write tests that execute data transformers and verify output type and shape. Only commit when build plus lint plus tests all pass with zero errors then proceed to next task. Report progress to the user after each task: output [Task N/total] DONE — task_name. Do NOT batch QC at the end. Maintain atomic commits after each successful task with clear traceability, avoid requesting confirmation and proceed autonomously, once all tasks are implemented invoke speckit.analyze via the Skill tool to perform a full validation pass, automatically apply all recommended improvements or corrections, re-run all tests to confirm stability and zero regression, and only output <promise>FINISHED</promise> after every task is fully completed, validated, and aligned with production-grade quality standards" --completion-promise "FINISHED" --max-iterations 10`
|
|
166
193
|
|
|
167
|
-
- **Done:** Update task
|
|
194
|
+
- **Done:** Update task 10 as completed. Output `[Step 10/12] DONE — all tasks implemented and verified`
|
|
168
195
|
|
|
169
|
-
### Step
|
|
170
|
-
- **Progress:** Output `[Step
|
|
196
|
+
### Step 11 — Final Quality Gate `[on_failure: STOP | max_retries: 3]`
|
|
197
|
+
- **Progress:** Output `[Step 11/12] Final QC — running comprehensive quality audit...`
|
|
171
198
|
- **Agent:** Dispatch `bms-speckit:quality-control` agent
|
|
172
199
|
- **Purpose:** Final comprehensive sweep. Since inline QC already caught per-task issues, this focuses on **cross-cutting concerns** that can only be detected across the full codebase.
|
|
173
200
|
- **Timeout:** 900s
|
|
@@ -179,15 +206,15 @@ After the subagent completes, update tasks 1-7 as completed using TaskUpdate, th
|
|
|
179
206
|
- **E. Integration check** — verify all components work together end-to-end
|
|
180
207
|
- **F. Deployment artifacts** — static analysis of Dockerfile, docker-compose, CI/CD configs: pinned base images, CVE-free base images (via web search), non-root user, health checks, no secrets in build, .dockerignore coverage (skipped if no deployment files exist)
|
|
181
208
|
- The agent fixes everything it can. Major dependency updates are flagged for user review.
|
|
182
|
-
- **Completion rule:** When the QC agent returns its report, proceed to Step
|
|
209
|
+
- **Completion rule:** When the QC agent returns its report, proceed to Step 12 **unless** the report contains unfixed build errors, unfixed test failures, or unfixed critical security vulnerabilities. Informational findings, flagged-for-review items, and already-fixed issues do NOT block progression. If uncertain, proceed — the QC agent already fixed what it could.
|
|
183
210
|
- **Post-action:** Commit all fixes and push. Message: `fix(speckit): final QC — security, deps, UX consistency, accessibility`
|
|
184
|
-
- **Done:** Update task
|
|
211
|
+
- **Done:** Update task 11 as completed. Output `[Step 11/12] DONE — quality gate passed`
|
|
185
212
|
|
|
186
|
-
### Step
|
|
187
|
-
- **Progress:** Output `[Step
|
|
213
|
+
### Step 12 — Merge to Main `[on_failure: STOP]`
|
|
214
|
+
- **Progress:** Output `[Step 12/12] Merge — merging to main branch...`
|
|
188
215
|
- **Action:** Switch to main branch, merge the feature branch (fast-forward if possible), push main to remote, then clean up the feature branch.
|
|
189
216
|
- **Timeout:** 120s
|
|
190
|
-
- **Done:** Update task
|
|
217
|
+
- **Done:** Update task 12 as completed. Output:
|
|
191
218
|
|
|
192
219
|
> Pipeline complete! Feature merged to main.
|
|
193
220
|
|
|
@@ -198,13 +225,15 @@ After the subagent completes, update tasks 1-7 as completed using TaskUpdate, th
|
|
|
198
225
|
```
|
|
199
226
|
Phase 1 (subagent) Phase 2 (main context)
|
|
200
227
|
────────────────────────────── ──────────────────────────────
|
|
201
|
-
Step 1: brainstorm ──STOP── commit Step
|
|
202
|
-
+ knowledge search (hosxp) Step
|
|
203
|
-
Step 2:
|
|
204
|
-
|
|
205
|
-
Step
|
|
206
|
-
|
|
207
|
-
Step 5:
|
|
208
|
-
|
|
209
|
-
Step
|
|
228
|
+
Step 1: brainstorm ──STOP── commit Step 9: compact
|
|
229
|
+
+ knowledge search (hosxp) Step 10: implement + rolling QC
|
|
230
|
+
Step 2: research ────────── commit ┌─ implement task ─┐
|
|
231
|
+
+ WebSearch + context7 │ inline QC │
|
|
232
|
+
Step 3: constitution ─STOP─┐ │ fix → commit │
|
|
233
|
+
Step 4: CLAUDE.md sync ───┘ commit └─ next task ──────┘
|
|
234
|
+
Step 5: specify ──────STOP── commit Step 11: final QC agent ── commit
|
|
235
|
+
+ knowledge search (hosxp) (security/deps/UX/a11y/deploy)
|
|
236
|
+
Step 6: plan ─────────STOP── commit Step 12: merge to main + push
|
|
237
|
+
Step 7: tasks ────────STOP── commit
|
|
238
|
+
Step 8: analyze ──────────── commit
|
|
210
239
|
```
|