sinapse-ai 1.14.0 → 1.16.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.
- package/.sinapse-ai/data/entity-registry.yaml +66 -16
- package/.sinapse-ai/development/tasks/spec-analyze.md +460 -0
- package/.sinapse-ai/development/tasks/spec-clarify.md +374 -0
- package/.sinapse-ai/development/templates/chrome-brain/rules/chrome-brain-autoload.md +4 -0
- package/.sinapse-ai/development/templates/chrome-brain/scripts/chrome-brain-log.cjs +78 -0
- package/.sinapse-ai/development/templates/chrome-brain/scripts/chrome-ensure.cjs +108 -0
- package/.sinapse-ai/development/workflows/spec-pipeline.yaml +121 -7
- package/.sinapse-ai/install-manifest.yaml +34 -14
- package/.sinapse-ai/product/templates/spec-tmpl.md +18 -0
- package/.sinapse-ai/product/templates/statusline/agent-badges.json +862 -0
- package/.sinapse-ai/product/templates/statusline/statusline-script.js +36 -2
- package/.sinapse-ai/product/templates/statusline/track-agent.cjs +119 -9
- package/AGENTS.md +1 -1
- package/CHANGELOG.md +2 -6
- package/bin/commands/install.js +22 -44
- package/bin/lib/header.js +14 -10
- package/bin/lib/setup-statusline.js +12 -1
- package/bin/modules/chrome-brain-installer.js +124 -199
- package/package.json +1 -1
- package/scripts/gen-agent-badges.js +105 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
metadata:
|
|
2
2
|
version: 1.0.0
|
|
3
|
-
lastUpdated: '2026-06-
|
|
4
|
-
entityCount:
|
|
3
|
+
lastUpdated: '2026-06-24T15:49:40.486Z'
|
|
4
|
+
entityCount: 794
|
|
5
5
|
checksumAlgorithm: sha256
|
|
6
6
|
resolutionRate: 100
|
|
7
7
|
entities:
|
|
@@ -163,8 +163,8 @@ entities:
|
|
|
163
163
|
score: 0.7
|
|
164
164
|
constraints: []
|
|
165
165
|
extensionPoints: []
|
|
166
|
-
checksum: sha256:
|
|
167
|
-
lastVerified: '2026-06-
|
|
166
|
+
checksum: sha256:626521b1e3cdba60377871b0549a36c0da35ea5f57a9174df65273b5797508e2
|
|
167
|
+
lastVerified: '2026-06-24T05:00:49.158Z'
|
|
168
168
|
local:
|
|
169
169
|
path: bin/commands/local.js
|
|
170
170
|
layer: L1
|
|
@@ -407,8 +407,8 @@ entities:
|
|
|
407
407
|
score: 0.7
|
|
408
408
|
constraints: []
|
|
409
409
|
extensionPoints: []
|
|
410
|
-
checksum: sha256:
|
|
411
|
-
lastVerified: '2026-06-
|
|
410
|
+
checksum: sha256:46f58aab3365467fc31e44b4e5db321aded90de64aa1f81a96305bd65ad90061
|
|
411
|
+
lastVerified: '2026-06-24T05:00:49.160Z'
|
|
412
412
|
prompts:
|
|
413
413
|
path: bin/lib/prompts.js
|
|
414
414
|
layer: L1
|
|
@@ -452,8 +452,8 @@ entities:
|
|
|
452
452
|
score: 0.7
|
|
453
453
|
constraints: []
|
|
454
454
|
extensionPoints: []
|
|
455
|
-
checksum: sha256:
|
|
456
|
-
lastVerified: '2026-06-
|
|
455
|
+
checksum: sha256:05d5dc88053f5d675e58a68f268d53a2f1497eb13ae63ac21f73220ecadcaca4
|
|
456
|
+
lastVerified: '2026-06-24T05:00:49.161Z'
|
|
457
457
|
squads:
|
|
458
458
|
path: bin/lib/squads.js
|
|
459
459
|
layer: L1
|
|
@@ -486,8 +486,6 @@ entities:
|
|
|
486
486
|
- chrome
|
|
487
487
|
- brain
|
|
488
488
|
- installer
|
|
489
|
-
- chrome-ensure
|
|
490
|
-
- (auto-launch)
|
|
491
489
|
usedBy:
|
|
492
490
|
- cli
|
|
493
491
|
- install
|
|
@@ -500,8 +498,8 @@ entities:
|
|
|
500
498
|
score: 0.7
|
|
501
499
|
constraints: []
|
|
502
500
|
extensionPoints: []
|
|
503
|
-
checksum: sha256:
|
|
504
|
-
lastVerified: '2026-06-
|
|
501
|
+
checksum: sha256:e1186d8324dd01d78a9f17c8a5015e51f661d952d70aa339464097e0f3d1fd97
|
|
502
|
+
lastVerified: '2026-06-24T13:49:06.202Z'
|
|
505
503
|
env-config:
|
|
506
504
|
path: bin/modules/env-config.js
|
|
507
505
|
layer: L1
|
|
@@ -5627,6 +5625,32 @@ entities:
|
|
|
5627
5625
|
extensionPoints: []
|
|
5628
5626
|
checksum: sha256:702907ff987ef8db70bc7dba93aadcf40ba9d080321f8305dad7f9e2de10d1b2
|
|
5629
5627
|
lastVerified: '2026-06-15T00:26:26.297Z'
|
|
5628
|
+
spec-analyze:
|
|
5629
|
+
path: .sinapse-ai/development/tasks/spec-analyze.md
|
|
5630
|
+
layer: L2
|
|
5631
|
+
type: task
|
|
5632
|
+
purpose: Provar, antes de gastar geração de código, que cada requisito virou task e que nada contradiz a
|
|
5633
|
+
keywords:
|
|
5634
|
+
- spec
|
|
5635
|
+
- analyze
|
|
5636
|
+
- 'pipeline:'
|
|
5637
|
+
- cross-consistency
|
|
5638
|
+
usedBy:
|
|
5639
|
+
- spec-pipeline
|
|
5640
|
+
dependencies:
|
|
5641
|
+
- architect
|
|
5642
|
+
externalDeps: []
|
|
5643
|
+
plannedDeps:
|
|
5644
|
+
- spec
|
|
5645
|
+
- constitution
|
|
5646
|
+
- tasks
|
|
5647
|
+
lifecycle: production
|
|
5648
|
+
adaptability:
|
|
5649
|
+
score: 0.8
|
|
5650
|
+
constraints: []
|
|
5651
|
+
extensionPoints: []
|
|
5652
|
+
checksum: sha256:5a73974cb88ca58274f907416839e8c864a3e35cf832668d3b2c582de3f6b26a
|
|
5653
|
+
lastVerified: '2026-06-24T15:49:40.276Z'
|
|
5630
5654
|
spec-assess-complexity:
|
|
5631
5655
|
path: .sinapse-ai/development/tasks/spec-assess-complexity.md
|
|
5632
5656
|
layer: L2
|
|
@@ -5653,6 +5677,29 @@ entities:
|
|
|
5653
5677
|
extensionPoints: []
|
|
5654
5678
|
checksum: sha256:7ef9f00dad98113dcf6c273e0d56333aece4fa892c91fff8935d3c3c552748ae
|
|
5655
5679
|
lastVerified: '2026-06-15T00:26:26.298Z'
|
|
5680
|
+
spec-clarify:
|
|
5681
|
+
path: .sinapse-ai/development/tasks/spec-clarify.md
|
|
5682
|
+
layer: L2
|
|
5683
|
+
type: task
|
|
5684
|
+
purpose: Desambiguar a especificação ANTES do QA gate e do plano. Roda DEPOIS de `write` (spec escrita)
|
|
5685
|
+
keywords:
|
|
5686
|
+
- spec
|
|
5687
|
+
- clarify
|
|
5688
|
+
- 'pipeline:'
|
|
5689
|
+
- specification
|
|
5690
|
+
usedBy:
|
|
5691
|
+
- spec-pipeline
|
|
5692
|
+
dependencies: []
|
|
5693
|
+
externalDeps: []
|
|
5694
|
+
plannedDeps:
|
|
5695
|
+
- spec
|
|
5696
|
+
lifecycle: production
|
|
5697
|
+
adaptability:
|
|
5698
|
+
score: 0.8
|
|
5699
|
+
constraints: []
|
|
5700
|
+
extensionPoints: []
|
|
5701
|
+
checksum: sha256:e4eee7ea80f146a697433462287aaff138536b148705337f2f32d66d2a83db5c
|
|
5702
|
+
lastVerified: '2026-06-24T15:49:40.277Z'
|
|
5656
5703
|
spec-critique:
|
|
5657
5704
|
path: .sinapse-ai/development/tasks/spec-critique.md
|
|
5658
5705
|
layer: L2
|
|
@@ -7420,8 +7467,8 @@ entities:
|
|
|
7420
7467
|
score: 0.5
|
|
7421
7468
|
constraints: []
|
|
7422
7469
|
extensionPoints: []
|
|
7423
|
-
checksum: sha256:
|
|
7424
|
-
lastVerified: '2026-06-
|
|
7470
|
+
checksum: sha256:58207c62ca73c18d9584232bc62ec43ee5f11dc4337d231eee5bf2cc87d15b78
|
|
7471
|
+
lastVerified: '2026-06-24T15:32:36.159Z'
|
|
7425
7472
|
state-persistence-tmpl:
|
|
7426
7473
|
path: .sinapse-ai/product/templates/state-persistence-tmpl.yaml
|
|
7427
7474
|
layer: L2
|
|
@@ -13657,6 +13704,7 @@ entities:
|
|
|
13657
13704
|
- plan-create-context
|
|
13658
13705
|
- plan-create-implementation
|
|
13659
13706
|
- qa-review-build
|
|
13707
|
+
- spec-analyze
|
|
13660
13708
|
- spec-assess-complexity
|
|
13661
13709
|
- spec-critique
|
|
13662
13710
|
- spec-gather-requirements
|
|
@@ -15076,7 +15124,9 @@ entities:
|
|
|
15076
15124
|
- spec-assess-complexity
|
|
15077
15125
|
- spec-research-dependencies
|
|
15078
15126
|
- spec-write-spec
|
|
15127
|
+
- spec-clarify
|
|
15079
15128
|
- spec-critique
|
|
15129
|
+
- spec-analyze
|
|
15080
15130
|
- architect
|
|
15081
15131
|
- analyst
|
|
15082
15132
|
externalDeps: []
|
|
@@ -15088,8 +15138,8 @@ entities:
|
|
|
15088
15138
|
score: 0.4
|
|
15089
15139
|
constraints: []
|
|
15090
15140
|
extensionPoints: []
|
|
15091
|
-
checksum: sha256:
|
|
15092
|
-
lastVerified: '2026-06-
|
|
15141
|
+
checksum: sha256:d0da3844cdf7e71c59a13b22e6c715b23a0ae55337aaa6dfc7248de99bdc6ff4
|
|
15142
|
+
lastVerified: '2026-06-24T15:32:36.251Z'
|
|
15093
15143
|
story-development-cycle:
|
|
15094
15144
|
path: .sinapse-ai/development/workflows/story-development-cycle.yaml
|
|
15095
15145
|
layer: L2
|
|
@@ -0,0 +1,460 @@
|
|
|
1
|
+
# Spec Pipeline: Analyze Cross-Consistency
|
|
2
|
+
|
|
3
|
+
> **Phase:** 7 - Analyze (final, READ-ONLY)
|
|
4
|
+
> **Owner Agent:** @quality-gate
|
|
5
|
+
> **Pipeline:** spec-pipeline
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Purpose
|
|
10
|
+
|
|
11
|
+
Provar, antes de gastar geração de código, que cada requisito virou task e que nada contradiz a
|
|
12
|
+
constituição do projeto. Roda DEPOIS de `plan` (fase final do pipeline) e ANTES do handoff para
|
|
13
|
+
implementação. É um gate **READ-ONLY**: não modifica nenhum arquivo — apenas lê spec ↔ plan ↔ tasks
|
|
14
|
+
↔ constitution, roda 6 passes de detecção e emite uma matriz requisito→task com lacunas e
|
|
15
|
+
inconsistências classificadas por severidade. Qualquer conflito constitucional é automaticamente
|
|
16
|
+
CRITICAL e bloqueia a implementação.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## autoClaude
|
|
21
|
+
|
|
22
|
+
```yaml
|
|
23
|
+
autoClaude:
|
|
24
|
+
version: '3.0'
|
|
25
|
+
pipelinePhase: spec-analyze
|
|
26
|
+
|
|
27
|
+
elicit: false
|
|
28
|
+
deterministic: true # Same artifacts = same findings
|
|
29
|
+
composable: true
|
|
30
|
+
|
|
31
|
+
readOnly: true # Contract: never mutate any file
|
|
32
|
+
selfCritique:
|
|
33
|
+
required: false
|
|
34
|
+
|
|
35
|
+
inputs:
|
|
36
|
+
- name: storyId
|
|
37
|
+
type: string
|
|
38
|
+
required: true
|
|
39
|
+
|
|
40
|
+
- name: spec
|
|
41
|
+
type: file
|
|
42
|
+
path: docs/stories/{storyId}/spec/spec.md
|
|
43
|
+
required: true
|
|
44
|
+
|
|
45
|
+
- name: plan
|
|
46
|
+
type: file
|
|
47
|
+
path: docs/stories/{storyId}/spec/plan.json
|
|
48
|
+
required: true
|
|
49
|
+
|
|
50
|
+
- name: tasks
|
|
51
|
+
type: file
|
|
52
|
+
path: docs/stories/{storyId}/spec/tasks.md
|
|
53
|
+
required: false
|
|
54
|
+
|
|
55
|
+
- name: constitution
|
|
56
|
+
type: file
|
|
57
|
+
path: .sinapse-ai/constitution.md
|
|
58
|
+
required: true
|
|
59
|
+
|
|
60
|
+
outputs:
|
|
61
|
+
- name: analyze-report.json
|
|
62
|
+
type: file
|
|
63
|
+
path: docs/stories/{storyId}/spec/analyze-report.json
|
|
64
|
+
schema: analyze-report-schema
|
|
65
|
+
|
|
66
|
+
verification:
|
|
67
|
+
type: gate
|
|
68
|
+
blocking: true
|
|
69
|
+
verdict_field: gate
|
|
70
|
+
|
|
71
|
+
contextRequirements:
|
|
72
|
+
projectContext: true
|
|
73
|
+
filesContext: true
|
|
74
|
+
implementationPlan: true
|
|
75
|
+
spec: true
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Read-Only Contract
|
|
81
|
+
|
|
82
|
+
```yaml
|
|
83
|
+
read_only_contract:
|
|
84
|
+
rule: 'This task MUST NOT modify any file. Findings become recommendations, never auto-fixes.'
|
|
85
|
+
rationale: 'An audit that edits the artifacts it audits cannot be trusted.'
|
|
86
|
+
violations:
|
|
87
|
+
- Editing spec.md / plan.json / tasks.md / constitution.md
|
|
88
|
+
- Applying "auto-fixes" to resolve findings
|
|
89
|
+
when_change_needed: 'Recommend the change; adjustment is done by the owner agent in a later pass.'
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Detection Passes (6)
|
|
95
|
+
|
|
96
|
+
Cruze 4 artefatos: `spec.md` (FR-###, SC-###, user stories, edge cases) ↔ `plan.json`
|
|
97
|
+
(arquitetura, data model, fases) ↔ `tasks.md` (IDs, fases, marcador `[P]`, file paths) ↔
|
|
98
|
+
`constitution.md` (princípios MUST/SHOULD).
|
|
99
|
+
|
|
100
|
+
```yaml
|
|
101
|
+
passes:
|
|
102
|
+
- id: pass-1
|
|
103
|
+
name: 'Duplication'
|
|
104
|
+
detects: 'Near-duplicate requirements; the same behavior specified twice'
|
|
105
|
+
default_severity: MEDIUM
|
|
106
|
+
|
|
107
|
+
- id: pass-2
|
|
108
|
+
name: 'Ambiguity'
|
|
109
|
+
detects: 'Vague adjectives (fast/scalable/secure) without a metric; TODO/??? placeholders; open [NEEDS CLARIFICATION] markers'
|
|
110
|
+
default_severity: HIGH
|
|
111
|
+
|
|
112
|
+
- id: pass-3
|
|
113
|
+
name: 'Underspecification'
|
|
114
|
+
detects: 'Requirement with no object/outcome; task referencing an undefined file/path'
|
|
115
|
+
default_severity: HIGH
|
|
116
|
+
|
|
117
|
+
- id: pass-4
|
|
118
|
+
name: 'Constitution Alignment'
|
|
119
|
+
detects: 'Conflict with a MUST principle; a mandatory constitution section absent'
|
|
120
|
+
default_severity: CRITICAL # Always
|
|
121
|
+
|
|
122
|
+
- id: pass-5
|
|
123
|
+
name: 'Coverage Gaps'
|
|
124
|
+
detects: 'Requirement (FR-*) with zero tasks; task with no mapped requirement; Success Criterion (SC-*) with no task'
|
|
125
|
+
default_severity: HIGH
|
|
126
|
+
|
|
127
|
+
- id: pass-6
|
|
128
|
+
name: 'Inconsistency'
|
|
129
|
+
detects: 'Terminology drift; entity in plan absent from spec; contradictory task ordering'
|
|
130
|
+
default_severity: MEDIUM
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## Severity Rules
|
|
136
|
+
|
|
137
|
+
```yaml
|
|
138
|
+
severity:
|
|
139
|
+
levels: [CRITICAL, HIGH, MEDIUM, LOW]
|
|
140
|
+
|
|
141
|
+
rules:
|
|
142
|
+
- 'Constitution conflict (pass-4) is ALWAYS CRITICAL — never downgraded, reinterpreted, or silently ignored.'
|
|
143
|
+
- 'Coverage gap on a P0/P1 requirement -> escalate to CRITICAL.'
|
|
144
|
+
- 'Ambiguity / Underspecification default HIGH; cosmetic-only -> LOW.'
|
|
145
|
+
- 'Duplication / Inconsistency default MEDIUM.'
|
|
146
|
+
|
|
147
|
+
max_findings: 50
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## Output: Findings Table + Metrics
|
|
153
|
+
|
|
154
|
+
A saída humana é uma tabela de findings seguida do Coverage Summary. O artefato persistido é
|
|
155
|
+
`analyze-report.json` (schema abaixo).
|
|
156
|
+
|
|
157
|
+
```markdown
|
|
158
|
+
## Analyze Report — {storyId}
|
|
159
|
+
|
|
160
|
+
| ID | Category | Severity | Location | Summary | Recommendation |
|
|
161
|
+
| --- | -------- | -------- | -------- | ------- | -------------- |
|
|
162
|
+
| A-1 | Constitution Alignment | CRITICAL | spec.md#3.1 ↔ constitution.md#Art-IV | Spec invents an unsourced feature | Remove or trace to FR-*/research; do not dilute Art. IV |
|
|
163
|
+
| A-2 | Coverage Gaps | HIGH | FR-3 ↔ tasks.md | FR-3 has zero tasks | Add a task covering FR-3 |
|
|
164
|
+
|
|
165
|
+
### Coverage Summary
|
|
166
|
+
|
|
167
|
+
- Total Requirements: {n}
|
|
168
|
+
- Total Tasks: {n}
|
|
169
|
+
- Coverage: {covered}/{total} ({pct}%)
|
|
170
|
+
- Ambiguity findings: {n}
|
|
171
|
+
- Duplication findings: {n}
|
|
172
|
+
- CRITICAL count: {n}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## Gate
|
|
178
|
+
|
|
179
|
+
```yaml
|
|
180
|
+
gate:
|
|
181
|
+
order: 'Run AFTER plan, as the final phase, BEFORE handoff to implementation'
|
|
182
|
+
blocking: true
|
|
183
|
+
|
|
184
|
+
verdict:
|
|
185
|
+
PASS:
|
|
186
|
+
condition: 'No CRITICAL findings'
|
|
187
|
+
next_action: 'Proceed to implementation (@developer *develop)'
|
|
188
|
+
BLOCKED:
|
|
189
|
+
condition: 'One or more CRITICAL findings (includes ANY constitution conflict)'
|
|
190
|
+
next_action: |
|
|
191
|
+
Resolve CRITICAL findings before /implement by ADJUSTING spec / plan / tasks.
|
|
192
|
+
A constitution conflict MUST NOT be diluted, reinterpreted, or silently ignored.
|
|
193
|
+
escalate_to: '@architect'
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
## Execution Flow
|
|
199
|
+
|
|
200
|
+
### Step 1: Load Artifacts (read-only)
|
|
201
|
+
|
|
202
|
+
```yaml
|
|
203
|
+
load:
|
|
204
|
+
action: gather_all_artifacts
|
|
205
|
+
files:
|
|
206
|
+
- spec.md (required)
|
|
207
|
+
- plan.json (required)
|
|
208
|
+
- tasks.md (optional)
|
|
209
|
+
- constitution.md (required)
|
|
210
|
+
guard: 'Open read-only. No write handles.'
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
### Step 2: Build Requirement→Task Matrix
|
|
214
|
+
|
|
215
|
+
```yaml
|
|
216
|
+
build_matrix:
|
|
217
|
+
action: map_requirements_to_tasks
|
|
218
|
+
process: |
|
|
219
|
+
1. Extract FR-*, NFR-*, SC-* from spec.md
|
|
220
|
+
2. Extract task IDs + their referenced requirement from tasks.md
|
|
221
|
+
3. Build a bidirectional map (requirement <-> tasks)
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### Step 3: Run 6 Detection Passes
|
|
225
|
+
|
|
226
|
+
```yaml
|
|
227
|
+
run_passes:
|
|
228
|
+
for_each: pass in [Duplication, Ambiguity, Underspecification, Constitution Alignment, Coverage Gaps, Inconsistency]
|
|
229
|
+
process: |
|
|
230
|
+
1. Execute detection over the relevant artifact pair(s)
|
|
231
|
+
2. Record each finding (location, summary)
|
|
232
|
+
3. Assign severity (constitution conflict ALWAYS CRITICAL)
|
|
233
|
+
4. Cap total findings at 50
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
### Step 4: Compute Metrics
|
|
237
|
+
|
|
238
|
+
```yaml
|
|
239
|
+
metrics:
|
|
240
|
+
action: compute_coverage
|
|
241
|
+
fields:
|
|
242
|
+
- totalRequirements
|
|
243
|
+
- totalTasks
|
|
244
|
+
- coveragePct
|
|
245
|
+
- ambiguityCount
|
|
246
|
+
- duplicationCount
|
|
247
|
+
- criticalCount
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
### Step 5: Emit Report + Verdict
|
|
251
|
+
|
|
252
|
+
```yaml
|
|
253
|
+
emit:
|
|
254
|
+
action: write_analyze_report
|
|
255
|
+
outputs:
|
|
256
|
+
- findings table (markdown, to user)
|
|
257
|
+
- analyze-report.json (persisted artifact)
|
|
258
|
+
verdict: 'BLOCKED if criticalCount > 0, else PASS'
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
---
|
|
262
|
+
|
|
263
|
+
## Output Schema
|
|
264
|
+
|
|
265
|
+
```json
|
|
266
|
+
{
|
|
267
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
268
|
+
"type": "object",
|
|
269
|
+
"required": ["storyId", "analyzedAt", "gate", "findings", "metrics"],
|
|
270
|
+
"properties": {
|
|
271
|
+
"storyId": { "type": "string" },
|
|
272
|
+
"analyzedAt": { "type": "string", "format": "date-time" },
|
|
273
|
+
"analyzedBy": { "type": "string", "default": "@quality-gate" },
|
|
274
|
+
"readOnly": { "type": "boolean", "const": true },
|
|
275
|
+
"gate": { "enum": ["PASS", "BLOCKED"] },
|
|
276
|
+
"gateReason": { "type": "string" },
|
|
277
|
+
"findings": {
|
|
278
|
+
"type": "array",
|
|
279
|
+
"maxItems": 50,
|
|
280
|
+
"items": {
|
|
281
|
+
"type": "object",
|
|
282
|
+
"required": ["id", "category", "severity", "location", "summary", "recommendation"],
|
|
283
|
+
"properties": {
|
|
284
|
+
"id": { "type": "string", "pattern": "^A-\\d+$" },
|
|
285
|
+
"category": {
|
|
286
|
+
"enum": [
|
|
287
|
+
"Duplication",
|
|
288
|
+
"Ambiguity",
|
|
289
|
+
"Underspecification",
|
|
290
|
+
"Constitution Alignment",
|
|
291
|
+
"Coverage Gaps",
|
|
292
|
+
"Inconsistency"
|
|
293
|
+
]
|
|
294
|
+
},
|
|
295
|
+
"severity": { "enum": ["CRITICAL", "HIGH", "MEDIUM", "LOW"] },
|
|
296
|
+
"location": { "type": "string" },
|
|
297
|
+
"summary": { "type": "string" },
|
|
298
|
+
"recommendation": { "type": "string" }
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
},
|
|
302
|
+
"metrics": {
|
|
303
|
+
"type": "object",
|
|
304
|
+
"required": ["totalRequirements", "totalTasks", "coveragePct", "criticalCount"],
|
|
305
|
+
"properties": {
|
|
306
|
+
"totalRequirements": { "type": "integer", "minimum": 0 },
|
|
307
|
+
"totalTasks": { "type": "integer", "minimum": 0 },
|
|
308
|
+
"coveragePct": { "type": "number", "minimum": 0, "maximum": 100 },
|
|
309
|
+
"ambiguityCount": { "type": "integer", "minimum": 0 },
|
|
310
|
+
"duplicationCount": { "type": "integer", "minimum": 0 },
|
|
311
|
+
"criticalCount": { "type": "integer", "minimum": 0 }
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
---
|
|
319
|
+
|
|
320
|
+
## Integration
|
|
321
|
+
|
|
322
|
+
### Command Integration (@quality-gate)
|
|
323
|
+
|
|
324
|
+
```yaml
|
|
325
|
+
command:
|
|
326
|
+
name: '*analyze-spec'
|
|
327
|
+
syntax: '*analyze-spec {story-id}'
|
|
328
|
+
agent: qa
|
|
329
|
+
|
|
330
|
+
examples:
|
|
331
|
+
- '*analyze-spec STORY-42'
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
### Pipeline Integration
|
|
335
|
+
|
|
336
|
+
```yaml
|
|
337
|
+
pipeline:
|
|
338
|
+
phase: analyze
|
|
339
|
+
previous_phase: plan
|
|
340
|
+
next_phase: none # Final phase - hands off to implementation (SDC)
|
|
341
|
+
|
|
342
|
+
requires:
|
|
343
|
+
- spec.md
|
|
344
|
+
- plan.json
|
|
345
|
+
- constitution.md
|
|
346
|
+
|
|
347
|
+
optional:
|
|
348
|
+
- tasks.md
|
|
349
|
+
|
|
350
|
+
gate: true # Blocking gate
|
|
351
|
+
readOnly: true
|
|
352
|
+
|
|
353
|
+
on_verdict:
|
|
354
|
+
PASS:
|
|
355
|
+
action: handoff_to_implementation
|
|
356
|
+
BLOCKED:
|
|
357
|
+
action: halt
|
|
358
|
+
escalate_to: '@architect'
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
---
|
|
362
|
+
|
|
363
|
+
## Error Handling
|
|
364
|
+
|
|
365
|
+
```yaml
|
|
366
|
+
errors:
|
|
367
|
+
- id: missing-spec
|
|
368
|
+
condition: 'spec.md not found'
|
|
369
|
+
action: 'Halt - cannot analyze without a spec'
|
|
370
|
+
blocking: true
|
|
371
|
+
|
|
372
|
+
- id: missing-plan
|
|
373
|
+
condition: 'plan.json not found'
|
|
374
|
+
action: 'Halt - analyze runs after plan'
|
|
375
|
+
blocking: true
|
|
376
|
+
|
|
377
|
+
- id: missing-tasks
|
|
378
|
+
condition: 'tasks.md not found'
|
|
379
|
+
action: 'Run with reduced coverage analysis; flag tasks coverage as UNKNOWN'
|
|
380
|
+
blocking: false
|
|
381
|
+
|
|
382
|
+
- id: missing-constitution
|
|
383
|
+
condition: 'constitution.md not found'
|
|
384
|
+
action: 'Halt - constitution alignment pass cannot run'
|
|
385
|
+
blocking: true
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
---
|
|
389
|
+
|
|
390
|
+
## Examples
|
|
391
|
+
|
|
392
|
+
### Example: BLOCKED on constitution conflict + coverage gap
|
|
393
|
+
|
|
394
|
+
**Input:** spec.md adds a feature with no FR source; FR-3 has no task.
|
|
395
|
+
|
|
396
|
+
**Output:**
|
|
397
|
+
|
|
398
|
+
```json
|
|
399
|
+
{
|
|
400
|
+
"storyId": "STORY-42",
|
|
401
|
+
"analyzedBy": "@quality-gate",
|
|
402
|
+
"readOnly": true,
|
|
403
|
+
"gate": "BLOCKED",
|
|
404
|
+
"gateReason": "1 CRITICAL (constitution conflict) + 1 HIGH (coverage gap)",
|
|
405
|
+
"findings": [
|
|
406
|
+
{
|
|
407
|
+
"id": "A-1",
|
|
408
|
+
"category": "Constitution Alignment",
|
|
409
|
+
"severity": "CRITICAL",
|
|
410
|
+
"location": "spec.md#3.1 ↔ constitution.md#Article-IV",
|
|
411
|
+
"summary": "Spec includes a feature with no FR/research source (No Invention)",
|
|
412
|
+
"recommendation": "Remove the feature or trace it to a requirement; do not dilute Article IV"
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
"id": "A-2",
|
|
416
|
+
"category": "Coverage Gaps",
|
|
417
|
+
"severity": "HIGH",
|
|
418
|
+
"location": "FR-3 ↔ tasks.md",
|
|
419
|
+
"summary": "FR-3 has zero tasks",
|
|
420
|
+
"recommendation": "Add at least one task covering FR-3"
|
|
421
|
+
}
|
|
422
|
+
],
|
|
423
|
+
"metrics": {
|
|
424
|
+
"totalRequirements": 5,
|
|
425
|
+
"totalTasks": 7,
|
|
426
|
+
"coveragePct": 80,
|
|
427
|
+
"ambiguityCount": 0,
|
|
428
|
+
"duplicationCount": 0,
|
|
429
|
+
"criticalCount": 1
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
---
|
|
435
|
+
|
|
436
|
+
## Metadata
|
|
437
|
+
|
|
438
|
+
```yaml
|
|
439
|
+
metadata:
|
|
440
|
+
story: '3.7'
|
|
441
|
+
epic: 'Epic 3 - Spec Pipeline'
|
|
442
|
+
created: '2026-06-24'
|
|
443
|
+
author: '@quality-gate (Litmus)'
|
|
444
|
+
version: '1.0.0'
|
|
445
|
+
source: 'GitHub Spec Kit — templates/commands/analyze.md'
|
|
446
|
+
tags:
|
|
447
|
+
- spec-pipeline
|
|
448
|
+
- analyze
|
|
449
|
+
- consistency
|
|
450
|
+
- constitution
|
|
451
|
+
- read-only
|
|
452
|
+
- quality-gate
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
## Handoff
|
|
456
|
+
next_agent: @developer
|
|
457
|
+
next_command: *develop {story-id}
|
|
458
|
+
condition: Analyze gate is PASS (no CRITICAL findings)
|
|
459
|
+
alternatives:
|
|
460
|
+
- agent: @architect, command: *analyze-impact, condition: Analyze gate is BLOCKED (CRITICAL findings open)
|