sinapse-ai 1.15.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 +58 -6
- package/.sinapse-ai/development/tasks/spec-analyze.md +460 -0
- package/.sinapse-ai/development/tasks/spec-clarify.md +374 -0
- package/.sinapse-ai/development/workflows/spec-pipeline.yaml +121 -7
- package/.sinapse-ai/install-manifest.yaml +16 -8
- package/.sinapse-ai/product/templates/spec-tmpl.md +18 -0
- package/AGENTS.md +1 -1
- package/CHANGELOG.md +2 -3
- package/package.json +1 -1
|
@@ -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:
|
|
@@ -5625,6 +5625,32 @@ entities:
|
|
|
5625
5625
|
extensionPoints: []
|
|
5626
5626
|
checksum: sha256:702907ff987ef8db70bc7dba93aadcf40ba9d080321f8305dad7f9e2de10d1b2
|
|
5627
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'
|
|
5628
5654
|
spec-assess-complexity:
|
|
5629
5655
|
path: .sinapse-ai/development/tasks/spec-assess-complexity.md
|
|
5630
5656
|
layer: L2
|
|
@@ -5651,6 +5677,29 @@ entities:
|
|
|
5651
5677
|
extensionPoints: []
|
|
5652
5678
|
checksum: sha256:7ef9f00dad98113dcf6c273e0d56333aece4fa892c91fff8935d3c3c552748ae
|
|
5653
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'
|
|
5654
5703
|
spec-critique:
|
|
5655
5704
|
path: .sinapse-ai/development/tasks/spec-critique.md
|
|
5656
5705
|
layer: L2
|
|
@@ -7418,8 +7467,8 @@ entities:
|
|
|
7418
7467
|
score: 0.5
|
|
7419
7468
|
constraints: []
|
|
7420
7469
|
extensionPoints: []
|
|
7421
|
-
checksum: sha256:
|
|
7422
|
-
lastVerified: '2026-06-
|
|
7470
|
+
checksum: sha256:58207c62ca73c18d9584232bc62ec43ee5f11dc4337d231eee5bf2cc87d15b78
|
|
7471
|
+
lastVerified: '2026-06-24T15:32:36.159Z'
|
|
7423
7472
|
state-persistence-tmpl:
|
|
7424
7473
|
path: .sinapse-ai/product/templates/state-persistence-tmpl.yaml
|
|
7425
7474
|
layer: L2
|
|
@@ -13655,6 +13704,7 @@ entities:
|
|
|
13655
13704
|
- plan-create-context
|
|
13656
13705
|
- plan-create-implementation
|
|
13657
13706
|
- qa-review-build
|
|
13707
|
+
- spec-analyze
|
|
13658
13708
|
- spec-assess-complexity
|
|
13659
13709
|
- spec-critique
|
|
13660
13710
|
- spec-gather-requirements
|
|
@@ -15074,7 +15124,9 @@ entities:
|
|
|
15074
15124
|
- spec-assess-complexity
|
|
15075
15125
|
- spec-research-dependencies
|
|
15076
15126
|
- spec-write-spec
|
|
15127
|
+
- spec-clarify
|
|
15077
15128
|
- spec-critique
|
|
15129
|
+
- spec-analyze
|
|
15078
15130
|
- architect
|
|
15079
15131
|
- analyst
|
|
15080
15132
|
externalDeps: []
|
|
@@ -15086,8 +15138,8 @@ entities:
|
|
|
15086
15138
|
score: 0.4
|
|
15087
15139
|
constraints: []
|
|
15088
15140
|
extensionPoints: []
|
|
15089
|
-
checksum: sha256:
|
|
15090
|
-
lastVerified: '2026-06-
|
|
15141
|
+
checksum: sha256:d0da3844cdf7e71c59a13b22e6c715b23a0ae55337aaa6dfc7248de99bdc6ff4
|
|
15142
|
+
lastVerified: '2026-06-24T15:32:36.251Z'
|
|
15091
15143
|
story-development-cycle:
|
|
15092
15144
|
path: .sinapse-ai/development/workflows/story-development-cycle.yaml
|
|
15093
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)
|
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
# Spec Pipeline: Clarify Specification
|
|
2
|
+
|
|
3
|
+
> **Phase:** 4b - Clarify
|
|
4
|
+
> **Owner Agent:** @project-lead
|
|
5
|
+
> **Pipeline:** spec-pipeline
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Purpose
|
|
10
|
+
|
|
11
|
+
Desambiguar a especificação ANTES do QA gate e do plano. Roda DEPOIS de `write` (spec escrita)
|
|
12
|
+
e ANTES de `critique`. Varre o `spec.md` por uma taxonomia de 9 categorias de cobertura, faz no
|
|
13
|
+
máximo 5 perguntas guiadas por (Impacto × Incerteza) — uma de cada vez — e integra cada resposta
|
|
14
|
+
atomicamente no `spec.md`. Sub-especificação descoberta tarde é o retrabalho mais caro do pipeline;
|
|
15
|
+
o clarify ataca isso cedo, perguntando apenas o que muda decisão downstream.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## autoClaude
|
|
20
|
+
|
|
21
|
+
```yaml
|
|
22
|
+
autoClaude:
|
|
23
|
+
version: '3.0'
|
|
24
|
+
pipelinePhase: spec-clarify
|
|
25
|
+
|
|
26
|
+
elicit: true # Interactive - asks the user clarifying questions
|
|
27
|
+
deterministic: false # Output depends on user answers
|
|
28
|
+
composable: true
|
|
29
|
+
|
|
30
|
+
selfCritique:
|
|
31
|
+
required: false
|
|
32
|
+
|
|
33
|
+
inputs:
|
|
34
|
+
- name: storyId
|
|
35
|
+
type: string
|
|
36
|
+
required: true
|
|
37
|
+
|
|
38
|
+
- name: spec
|
|
39
|
+
type: file
|
|
40
|
+
path: docs/stories/{storyId}/spec/spec.md
|
|
41
|
+
required: true
|
|
42
|
+
|
|
43
|
+
- name: requirements
|
|
44
|
+
type: file
|
|
45
|
+
path: docs/stories/{storyId}/spec/requirements.json
|
|
46
|
+
required: false
|
|
47
|
+
|
|
48
|
+
outputs:
|
|
49
|
+
- name: spec.md
|
|
50
|
+
type: file
|
|
51
|
+
path: docs/stories/{storyId}/spec/spec.md
|
|
52
|
+
mutation: append # Adds/updates the `## Clarifications` section + target sections
|
|
53
|
+
|
|
54
|
+
verification:
|
|
55
|
+
type: gate
|
|
56
|
+
blocking: false # Skippable with explicit rework-risk warning
|
|
57
|
+
completion_field: clarificationComplete
|
|
58
|
+
|
|
59
|
+
contextRequirements:
|
|
60
|
+
projectContext: true
|
|
61
|
+
filesContext: true
|
|
62
|
+
implementationPlan: false
|
|
63
|
+
spec: true
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Coverage Taxonomy (9 categories)
|
|
69
|
+
|
|
70
|
+
Varra o `spec.md` e marque cada categoria como **Clear / Partial / Missing**. Perguntas só nascem
|
|
71
|
+
de categorias `Partial` ou `Missing` cujo esclarecimento muda uma decisão downstream.
|
|
72
|
+
|
|
73
|
+
```yaml
|
|
74
|
+
taxonomy:
|
|
75
|
+
- id: tax-1
|
|
76
|
+
name: 'Functional Scope & Behavior'
|
|
77
|
+
looks_for: 'Core actions, in/out of scope, behavioral edges'
|
|
78
|
+
|
|
79
|
+
- id: tax-2
|
|
80
|
+
name: 'Domain & Data Model'
|
|
81
|
+
looks_for: 'Entities, attributes, relationships, identity, lifecycle/state'
|
|
82
|
+
|
|
83
|
+
- id: tax-3
|
|
84
|
+
name: 'Interaction & UX Flow'
|
|
85
|
+
looks_for: 'Steps, states, error/empty states, accessibility intent'
|
|
86
|
+
|
|
87
|
+
- id: tax-4
|
|
88
|
+
name: 'Non-Functional Quality Attributes'
|
|
89
|
+
looks_for: 'Performance, scale, latency, availability, security targets (quantified)'
|
|
90
|
+
|
|
91
|
+
- id: tax-5
|
|
92
|
+
name: 'Integration & External Dependencies'
|
|
93
|
+
looks_for: 'External services, APIs, contracts, failure modes of integrations'
|
|
94
|
+
|
|
95
|
+
- id: tax-6
|
|
96
|
+
name: 'Edge Cases & Failure Handling'
|
|
97
|
+
looks_for: 'Boundary conditions, invalid input, partial failure, recovery'
|
|
98
|
+
|
|
99
|
+
- id: tax-7
|
|
100
|
+
name: 'Constraints & Tradeoffs'
|
|
101
|
+
looks_for: 'Hard constraints, rejected alternatives, explicit tradeoffs'
|
|
102
|
+
|
|
103
|
+
- id: tax-8
|
|
104
|
+
name: 'Terminology & Consistency'
|
|
105
|
+
looks_for: 'Consistent naming, no synonym drift, defined glossary terms'
|
|
106
|
+
|
|
107
|
+
- id: tax-9
|
|
108
|
+
name: 'Completion Signals'
|
|
109
|
+
looks_for: 'Measurable done criteria, acceptance signals, Success Criteria present'
|
|
110
|
+
|
|
111
|
+
- id: tax-misc
|
|
112
|
+
name: 'Misc / Signals'
|
|
113
|
+
looks_for: 'TODO / ??? placeholders, unquantified adjectives (fast/scalable/secure), [NEEDS CLARIFICATION] markers'
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## Question Selection (Impact × Uncertainty)
|
|
119
|
+
|
|
120
|
+
```yaml
|
|
121
|
+
selection:
|
|
122
|
+
heuristic: 'Impact × Uncertainty'
|
|
123
|
+
|
|
124
|
+
rule: |
|
|
125
|
+
Only include questions whose answers materially impact architecture, data modeling,
|
|
126
|
+
task decomposition, test design, UX behavior, operational readiness, or compliance
|
|
127
|
+
validation. Discard cosmetic questions that do not change a downstream decision.
|
|
128
|
+
|
|
129
|
+
prioritize:
|
|
130
|
+
- High impact + high uncertainty (ask first)
|
|
131
|
+
- High impact + medium uncertainty
|
|
132
|
+
discard:
|
|
133
|
+
- Low impact (any uncertainty)
|
|
134
|
+
- Already Clear in the taxonomy scan
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## Question Format
|
|
140
|
+
|
|
141
|
+
```yaml
|
|
142
|
+
question_format:
|
|
143
|
+
max_questions: 5
|
|
144
|
+
one_at_a_time: true # Ask, wait for answer, integrate, then next
|
|
145
|
+
|
|
146
|
+
styles:
|
|
147
|
+
- type: multiple_choice
|
|
148
|
+
options: '2 to 5 mutually exclusive options'
|
|
149
|
+
include_recommendation: true # Mark the recommended option
|
|
150
|
+
- type: short_answer
|
|
151
|
+
constraint: 'answer in <= 5 words'
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## Integration (atomic)
|
|
157
|
+
|
|
158
|
+
Cada resposta é integrada IMEDIATAMENTE antes da próxima pergunta — registro + aplicação na seção-alvo.
|
|
159
|
+
|
|
160
|
+
```yaml
|
|
161
|
+
integration:
|
|
162
|
+
log_section:
|
|
163
|
+
create_if_missing: '## Clarifications'
|
|
164
|
+
subsection: '### Session {YYYY-MM-DD}'
|
|
165
|
+
entry_format: '- Q: {question} -> A: {answer}'
|
|
166
|
+
|
|
167
|
+
apply_change:
|
|
168
|
+
description: 'Apply the answer to the target section of the spec'
|
|
169
|
+
targets:
|
|
170
|
+
- Functional Requirements (FR-*)
|
|
171
|
+
- Key Entities / Data Model
|
|
172
|
+
- Success Criteria (SC-*)
|
|
173
|
+
- Edge Cases
|
|
174
|
+
- Constraints (CON-*)
|
|
175
|
+
rule: 'Never log an answer without applying it to the target section'
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## Stop Criteria
|
|
181
|
+
|
|
182
|
+
```yaml
|
|
183
|
+
stop_when:
|
|
184
|
+
any_of:
|
|
185
|
+
- 'All critical ambiguities resolved'
|
|
186
|
+
- 'User says proceed / done / skip'
|
|
187
|
+
- 'Reached 5 questions'
|
|
188
|
+
- 'No critical ambiguity detected in the taxonomy scan (zero questions is valid)'
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## Gate
|
|
194
|
+
|
|
195
|
+
```yaml
|
|
196
|
+
gate:
|
|
197
|
+
order: 'Run (and complete) clarify BEFORE the plan phase'
|
|
198
|
+
blocking: false
|
|
199
|
+
|
|
200
|
+
on_skip:
|
|
201
|
+
allowed: true
|
|
202
|
+
required_action: |
|
|
203
|
+
Warn explicitly: downstream rework risk increases when clarification is skipped.
|
|
204
|
+
message: |
|
|
205
|
+
⚠️ Skipping clarification. Ambiguities in the spec may surface during plan/implement,
|
|
206
|
+
increasing rework cost. Proceeding at user request.
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## Execution Flow
|
|
212
|
+
|
|
213
|
+
### Step 1: Scan Coverage
|
|
214
|
+
|
|
215
|
+
```yaml
|
|
216
|
+
scan:
|
|
217
|
+
action: scan_spec_against_taxonomy
|
|
218
|
+
for_each: category in taxonomy
|
|
219
|
+
process: |
|
|
220
|
+
1. Read spec.md
|
|
221
|
+
2. Mark category Clear / Partial / Missing
|
|
222
|
+
3. Note specific gap location (section)
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
### Step 2: Select Questions
|
|
226
|
+
|
|
227
|
+
```yaml
|
|
228
|
+
select:
|
|
229
|
+
action: rank_by_impact_uncertainty
|
|
230
|
+
process: |
|
|
231
|
+
1. Build candidate questions from Partial/Missing categories
|
|
232
|
+
2. Apply the materially-impacts filter (discard cosmetic)
|
|
233
|
+
3. Rank by Impact x Uncertainty
|
|
234
|
+
4. Cap the queue at 5
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
### Step 3: Ask & Integrate Loop
|
|
238
|
+
|
|
239
|
+
```yaml
|
|
240
|
+
ask_loop:
|
|
241
|
+
for_each: question in selected (max 5)
|
|
242
|
+
process: |
|
|
243
|
+
1. Ask ONE question (multiple-choice 2-5 opts w/ recommendation, OR short answer <=5 words)
|
|
244
|
+
2. Wait for the answer
|
|
245
|
+
3. Append `- Q: ... -> A: ...` under `## Clarifications` / `### Session {date}`
|
|
246
|
+
4. Apply the answer to the target spec section
|
|
247
|
+
5. Re-check stop criteria; break if met
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
### Step 4: Finalize
|
|
251
|
+
|
|
252
|
+
```yaml
|
|
253
|
+
finalize:
|
|
254
|
+
action: confirm_clarification_complete
|
|
255
|
+
process: |
|
|
256
|
+
1. Ensure every asked question was both logged AND applied
|
|
257
|
+
2. Set clarificationComplete = true
|
|
258
|
+
3. Hand off to critique
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
---
|
|
262
|
+
|
|
263
|
+
## Integration
|
|
264
|
+
|
|
265
|
+
### Command Integration (@project-lead)
|
|
266
|
+
|
|
267
|
+
```yaml
|
|
268
|
+
command:
|
|
269
|
+
name: '*clarify-spec'
|
|
270
|
+
syntax: '*clarify-spec {story-id}'
|
|
271
|
+
agent: pm
|
|
272
|
+
|
|
273
|
+
examples:
|
|
274
|
+
- '*clarify-spec STORY-42'
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
### Pipeline Integration
|
|
278
|
+
|
|
279
|
+
```yaml
|
|
280
|
+
pipeline:
|
|
281
|
+
phase: clarify
|
|
282
|
+
previous_phase: spec
|
|
283
|
+
next_phase: critique
|
|
284
|
+
|
|
285
|
+
requires:
|
|
286
|
+
- spec.md
|
|
287
|
+
|
|
288
|
+
optional:
|
|
289
|
+
- requirements.json
|
|
290
|
+
|
|
291
|
+
gate: true # Order gate: complete before plan
|
|
292
|
+
blocking: false # Skippable with rework-risk warning
|
|
293
|
+
|
|
294
|
+
pass_to_next:
|
|
295
|
+
- spec.md
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
---
|
|
299
|
+
|
|
300
|
+
## Error Handling
|
|
301
|
+
|
|
302
|
+
```yaml
|
|
303
|
+
errors:
|
|
304
|
+
- id: missing-spec
|
|
305
|
+
condition: 'spec.md not found'
|
|
306
|
+
action: 'Halt - cannot clarify without a spec'
|
|
307
|
+
blocking: true
|
|
308
|
+
|
|
309
|
+
- id: no-ambiguity
|
|
310
|
+
condition: 'Taxonomy scan finds zero critical ambiguities'
|
|
311
|
+
action: 'Skip questions, set clarificationComplete=true, proceed to critique'
|
|
312
|
+
blocking: false
|
|
313
|
+
|
|
314
|
+
- id: user-defers
|
|
315
|
+
condition: 'User declines to answer / says proceed'
|
|
316
|
+
action: 'Warn of rework risk, set clarificationComplete=false, proceed'
|
|
317
|
+
blocking: false
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
---
|
|
321
|
+
|
|
322
|
+
## Examples
|
|
323
|
+
|
|
324
|
+
### Example: Clarify a vague NFR
|
|
325
|
+
|
|
326
|
+
**Input:** spec.md says "the endpoint should be fast" (tax-4 = Partial, unquantified adjective)
|
|
327
|
+
|
|
328
|
+
**Interaction:**
|
|
329
|
+
|
|
330
|
+
```
|
|
331
|
+
Q: What is the acceptable p95 latency for the endpoint?
|
|
332
|
+
A) < 100ms B) < 300ms (recommended) C) < 1s D) No target needed
|
|
333
|
+
A: B
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
**Spec mutation:**
|
|
337
|
+
|
|
338
|
+
```markdown
|
|
339
|
+
## Clarifications
|
|
340
|
+
|
|
341
|
+
### Session 2026-06-24
|
|
342
|
+
|
|
343
|
+
- Q: What is the acceptable p95 latency for the endpoint? → A: < 300ms (p95)
|
|
344
|
+
|
|
345
|
+
<!-- and NFR section updated: -->
|
|
346
|
+
| Category | Requirement | Target |
|
|
347
|
+
| ----------- | ------------------------ | ------------- |
|
|
348
|
+
| Performance | Endpoint response (p95) | < 300ms |
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
---
|
|
352
|
+
|
|
353
|
+
## Metadata
|
|
354
|
+
|
|
355
|
+
```yaml
|
|
356
|
+
metadata:
|
|
357
|
+
story: '3.4b'
|
|
358
|
+
epic: 'Epic 3 - Spec Pipeline'
|
|
359
|
+
created: '2026-06-24'
|
|
360
|
+
author: '@project-lead (Axis)'
|
|
361
|
+
version: '1.0.0'
|
|
362
|
+
source: 'GitHub Spec Kit — templates/commands/clarify.md'
|
|
363
|
+
tags:
|
|
364
|
+
- spec-pipeline
|
|
365
|
+
- clarify
|
|
366
|
+
- ambiguity
|
|
367
|
+
- elicitation
|
|
368
|
+
- product-lead
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
## Handoff
|
|
372
|
+
next_agent: @quality-gate
|
|
373
|
+
next_command: *critique-spec {story-id}
|
|
374
|
+
condition: Clarification complete (no critical ambiguities open) OR user proceeds with rework-risk warning
|
|
@@ -4,8 +4,10 @@ workflow:
|
|
|
4
4
|
version: "1.0"
|
|
5
5
|
description: >-
|
|
6
6
|
Pipeline completo que transforma requisitos informais em especificações
|
|
7
|
-
executáveis. Orquestra
|
|
8
|
-
Adapta as fases baseado na complexidade do requisito.
|
|
7
|
+
executáveis. Orquestra as fases: Gather → Assess → Research → Write → Clarify →
|
|
8
|
+
Critique → Plan → Analyze. Adapta as fases baseado na complexidade do requisito.
|
|
9
|
+
Clarify desambigua a spec antes do QA gate; Analyze faz a consistência cruzada
|
|
10
|
+
(read-only) antes da implementação.
|
|
9
11
|
|
|
10
12
|
Part of the Auto-Claude ADE (Autonomous Development Engine) infrastructure.
|
|
11
13
|
|
|
@@ -51,11 +53,21 @@ workflow:
|
|
|
51
53
|
action: run_phase
|
|
52
54
|
phase: spec
|
|
53
55
|
|
|
56
|
+
- event: command
|
|
57
|
+
command: "*clarify-spec"
|
|
58
|
+
action: run_phase
|
|
59
|
+
phase: clarify
|
|
60
|
+
|
|
54
61
|
- event: command
|
|
55
62
|
command: "*critique-spec"
|
|
56
63
|
action: run_phase
|
|
57
64
|
phase: critique
|
|
58
65
|
|
|
66
|
+
- event: command
|
|
67
|
+
command: "*analyze-spec"
|
|
68
|
+
action: run_phase
|
|
69
|
+
phase: analyze
|
|
70
|
+
|
|
59
71
|
# ═══════════════════════════════════════════════════════════════════════════════════
|
|
60
72
|
# CONFIGURATION
|
|
61
73
|
# ═══════════════════════════════════════════════════════════════════════════════════
|
|
@@ -86,15 +98,17 @@ workflow:
|
|
|
86
98
|
|
|
87
99
|
phases:
|
|
88
100
|
# SIMPLE: Minimal pipeline for straightforward tasks
|
|
101
|
+
# Includes clarify (cheap, avoids rework) but skips analyze.
|
|
89
102
|
SIMPLE:
|
|
90
103
|
description: "Tarefa direta, padrões existentes"
|
|
91
104
|
steps:
|
|
92
105
|
- gather
|
|
93
106
|
- spec
|
|
107
|
+
- clarify
|
|
94
108
|
- critique
|
|
95
109
|
estimated_time: "30-60 min"
|
|
96
110
|
|
|
97
|
-
# STANDARD: Full pipeline for moderate complexity
|
|
111
|
+
# STANDARD: Full pipeline for moderate complexity (clarify + analyze)
|
|
98
112
|
STANDARD:
|
|
99
113
|
description: "Complexidade moderada, alguma pesquisa necessária"
|
|
100
114
|
steps:
|
|
@@ -102,11 +116,13 @@ workflow:
|
|
|
102
116
|
- assess
|
|
103
117
|
- research
|
|
104
118
|
- spec
|
|
119
|
+
- clarify
|
|
105
120
|
- critique
|
|
106
121
|
- plan
|
|
122
|
+
- analyze
|
|
107
123
|
estimated_time: "2-4 hours"
|
|
108
124
|
|
|
109
|
-
# COMPLEX: Extended pipeline with revision loop
|
|
125
|
+
# COMPLEX: Extended pipeline with revision loop (clarify + analyze)
|
|
110
126
|
COMPLEX:
|
|
111
127
|
description: "Alta complexidade, múltiplas iterações"
|
|
112
128
|
steps:
|
|
@@ -114,10 +130,12 @@ workflow:
|
|
|
114
130
|
- assess
|
|
115
131
|
- research
|
|
116
132
|
- spec
|
|
133
|
+
- clarify
|
|
117
134
|
- critique_1
|
|
118
135
|
- revise
|
|
119
136
|
- critique_2
|
|
120
137
|
- plan
|
|
138
|
+
- analyze
|
|
121
139
|
estimated_time: "4-8 hours"
|
|
122
140
|
flags:
|
|
123
141
|
- "Architectural review recommended"
|
|
@@ -293,12 +311,54 @@ workflow:
|
|
|
293
311
|
|
|
294
312
|
on_success:
|
|
295
313
|
log: "📝 Specification written: docs/stories/{storyId}/spec/spec.md"
|
|
296
|
-
next:
|
|
314
|
+
next: clarify
|
|
297
315
|
|
|
298
316
|
on_failure:
|
|
299
317
|
action: halt
|
|
300
318
|
error: "Failed to write specification"
|
|
301
319
|
|
|
320
|
+
# ═════════════════════════════════════════════════════════════════════════════════
|
|
321
|
+
# PHASE 4b: CLARIFY SPECIFICATION
|
|
322
|
+
# ═════════════════════════════════════════════════════════════════════════════════
|
|
323
|
+
|
|
324
|
+
- step: clarify
|
|
325
|
+
phase: "4b"
|
|
326
|
+
phase_name: "Clarify Specification"
|
|
327
|
+
agent: pm
|
|
328
|
+
|
|
329
|
+
description: >-
|
|
330
|
+
Interactive ambiguity resolution BEFORE the QA gate. Scans the spec across a
|
|
331
|
+
9-category coverage taxonomy, asks at most 5 questions (one at a time, guided by
|
|
332
|
+
Impact × Uncertainty), and integrates each answer atomically into spec.md
|
|
333
|
+
(## Clarifications section). Reduces costly downstream rework.
|
|
334
|
+
|
|
335
|
+
task: spec-clarify.md
|
|
336
|
+
|
|
337
|
+
inputs:
|
|
338
|
+
storyId: "{storyId}"
|
|
339
|
+
spec: "docs/stories/{storyId}/spec/spec.md"
|
|
340
|
+
requirements: "docs/stories/{storyId}/spec/requirements.json"
|
|
341
|
+
|
|
342
|
+
outputs:
|
|
343
|
+
- spec.md (updated)
|
|
344
|
+
|
|
345
|
+
elicit: true # Requires user interaction
|
|
346
|
+
|
|
347
|
+
gate: true # Order gate: complete BEFORE plan
|
|
348
|
+
blocking: false # Skippable with explicit rework-risk warning
|
|
349
|
+
|
|
350
|
+
on_success:
|
|
351
|
+
log: "💬 Clarification complete: {clarify.questionsAsked} questions resolved"
|
|
352
|
+
next: critique
|
|
353
|
+
|
|
354
|
+
on_skip:
|
|
355
|
+
log: "⚠️ Clarification skipped - downstream rework risk increases"
|
|
356
|
+
next: critique
|
|
357
|
+
|
|
358
|
+
on_failure:
|
|
359
|
+
action: continue
|
|
360
|
+
fallback: "Proceed to critique; flag open ambiguities as risks"
|
|
361
|
+
|
|
302
362
|
# ═════════════════════════════════════════════════════════════════════════════════
|
|
303
363
|
# PHASE 5: CRITIQUE SPECIFICATION
|
|
304
364
|
# ═════════════════════════════════════════════════════════════════════════════════
|
|
@@ -435,7 +495,50 @@ workflow:
|
|
|
435
495
|
|
|
436
496
|
on_success:
|
|
437
497
|
log: "📋 Implementation plan created"
|
|
438
|
-
|
|
498
|
+
next: analyze
|
|
499
|
+
|
|
500
|
+
# ═════════════════════════════════════════════════════════════════════════════════
|
|
501
|
+
# PHASE 7: ANALYZE CROSS-CONSISTENCY (final, READ-ONLY)
|
|
502
|
+
# ═════════════════════════════════════════════════════════════════════════════════
|
|
503
|
+
|
|
504
|
+
- step: analyze
|
|
505
|
+
phase: 7
|
|
506
|
+
phase_name: "Analyze Cross-Consistency"
|
|
507
|
+
agent: qa
|
|
508
|
+
|
|
509
|
+
description: >-
|
|
510
|
+
READ-ONLY cross-consistency gate. Cross-references spec ↔ plan ↔ tasks ↔ constitution
|
|
511
|
+
in 6 detection passes (Duplication, Ambiguity, Underspecification, Constitution Alignment,
|
|
512
|
+
Coverage Gaps, Inconsistency) and emits a findings table + coverage metrics. Does not
|
|
513
|
+
modify any file. CRITICAL findings (any constitution conflict) block implementation.
|
|
514
|
+
|
|
515
|
+
condition: "complexity.result !== 'SIMPLE'" # SIMPLE skips analyze
|
|
516
|
+
|
|
517
|
+
task: spec-analyze.md
|
|
518
|
+
|
|
519
|
+
inputs:
|
|
520
|
+
storyId: "{storyId}"
|
|
521
|
+
spec: "docs/stories/{storyId}/spec/spec.md"
|
|
522
|
+
plan: "docs/stories/{storyId}/spec/plan.json"
|
|
523
|
+
tasks: "docs/stories/{storyId}/spec/tasks.md"
|
|
524
|
+
constitution: ".sinapse-ai/constitution.md"
|
|
525
|
+
|
|
526
|
+
outputs:
|
|
527
|
+
- analyze-report.json
|
|
528
|
+
|
|
529
|
+
gate: true # Blocking gate
|
|
530
|
+
read_only: true # Never mutates artifacts
|
|
531
|
+
|
|
532
|
+
on_verdict:
|
|
533
|
+
PASS:
|
|
534
|
+
log: "✅ Analyze PASS (coverage: {analyze.metrics.coveragePct}%, 0 CRITICAL)"
|
|
535
|
+
action: continue
|
|
536
|
+
complete: true
|
|
537
|
+
|
|
538
|
+
BLOCKED:
|
|
539
|
+
log: "🛑 Analyze BLOCKED: {analyze.metrics.criticalCount} CRITICAL finding(s)"
|
|
540
|
+
action: halt
|
|
541
|
+
escalate_to: "@architect"
|
|
439
542
|
|
|
440
543
|
# ═══════════════════════════════════════════════════════════════════════════════════
|
|
441
544
|
# WORKFLOW COMPLETION
|
|
@@ -458,6 +561,7 @@ workflow:
|
|
|
458
561
|
• docs/stories/{storyId}/spec/research.json
|
|
459
562
|
• docs/stories/{storyId}/spec/spec.md
|
|
460
563
|
• docs/stories/{storyId}/spec/critique.json
|
|
564
|
+
• docs/stories/{storyId}/spec/analyze-report.json
|
|
461
565
|
|
|
462
566
|
📌 Next Steps:
|
|
463
567
|
• Review spec.md
|
|
@@ -470,11 +574,13 @@ workflow:
|
|
|
470
574
|
- research.json
|
|
471
575
|
- spec.md
|
|
472
576
|
- critique.json
|
|
577
|
+
- analyze-report.json
|
|
473
578
|
|
|
474
579
|
next_steps:
|
|
475
580
|
- "Review specification: docs/stories/{storyId}/spec/spec.md"
|
|
476
581
|
- "Start development: @developer *develop {storyId}"
|
|
477
582
|
- "View critique: docs/stories/{storyId}/spec/critique.json"
|
|
583
|
+
- "View analyze report: docs/stories/{storyId}/spec/analyze-report.json"
|
|
478
584
|
|
|
479
585
|
# ═══════════════════════════════════════════════════════════════════════════════════
|
|
480
586
|
# ERROR HANDLING
|
|
@@ -519,15 +625,21 @@ workflow:
|
|
|
519
625
|
state: research_complete
|
|
520
626
|
- after: spec
|
|
521
627
|
state: spec_written
|
|
628
|
+
- after: clarify
|
|
629
|
+
state: clarification_complete
|
|
522
630
|
- after: critique
|
|
523
631
|
state: critique_complete
|
|
632
|
+
- after: plan
|
|
633
|
+
state: plan_complete
|
|
524
634
|
|
|
525
635
|
resume_from:
|
|
526
636
|
requirements_gathered: assess
|
|
527
637
|
complexity_assessed: research
|
|
528
638
|
research_complete: spec
|
|
529
|
-
spec_written:
|
|
639
|
+
spec_written: clarify
|
|
640
|
+
clarification_complete: critique
|
|
530
641
|
critique_complete: plan
|
|
642
|
+
plan_complete: analyze
|
|
531
643
|
|
|
532
644
|
# ═══════════════════════════════════════════════════════════════════════════════════
|
|
533
645
|
# INTEGRATION
|
|
@@ -568,7 +680,9 @@ workflow:
|
|
|
568
680
|
- spec-assess-complexity.md
|
|
569
681
|
- spec-research-dependencies.md
|
|
570
682
|
- spec-write-spec.md
|
|
683
|
+
- spec-clarify.md
|
|
571
684
|
- spec-critique.md
|
|
685
|
+
- spec-analyze.md
|
|
572
686
|
tags:
|
|
573
687
|
- spec-pipeline
|
|
574
688
|
- workflow
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
# - SHA256 hashes for change detection
|
|
8
8
|
# - File types for categorization
|
|
9
9
|
#
|
|
10
|
-
version: 1.
|
|
10
|
+
version: 1.16.0
|
|
11
11
|
generator: scripts/generate-install-manifest.js
|
|
12
|
-
file_count:
|
|
12
|
+
file_count: 1152
|
|
13
13
|
files:
|
|
14
14
|
- path: cli/commands/config/index.js
|
|
15
15
|
hash: sha256:bfa83cb1dc111b0b30dd298dc0abc2150b73f939b6cd4458effa8e6d407bc9e2
|
|
@@ -1344,9 +1344,9 @@ files:
|
|
|
1344
1344
|
type: data
|
|
1345
1345
|
size: 9602
|
|
1346
1346
|
- path: data/entity-registry.yaml
|
|
1347
|
-
hash: sha256:
|
|
1347
|
+
hash: sha256:5afcfac2ecfcbda210a85f77a18829c23a0dd80a0be5fc42c5081d419a3ac73b
|
|
1348
1348
|
type: data
|
|
1349
|
-
size:
|
|
1349
|
+
size: 549348
|
|
1350
1350
|
- path: data/learned-patterns.yaml
|
|
1351
1351
|
hash: sha256:1a4cd045c087b9dfd7046ff1464a9d2edb85fba77cf0b6fba14f4bb9004c741e
|
|
1352
1352
|
type: data
|
|
@@ -2547,10 +2547,18 @@ files:
|
|
|
2547
2547
|
hash: sha256:702907ff987ef8db70bc7dba93aadcf40ba9d080321f8305dad7f9e2de10d1b2
|
|
2548
2548
|
type: task
|
|
2549
2549
|
size: 18077
|
|
2550
|
+
- path: development/tasks/spec-analyze.md
|
|
2551
|
+
hash: sha256:5a73974cb88ca58274f907416839e8c864a3e35cf832668d3b2c582de3f6b26a
|
|
2552
|
+
type: task
|
|
2553
|
+
size: 11675
|
|
2550
2554
|
- path: development/tasks/spec-assess-complexity.md
|
|
2551
2555
|
hash: sha256:7ef9f00dad98113dcf6c273e0d56333aece4fa892c91fff8935d3c3c552748ae
|
|
2552
2556
|
type: task
|
|
2553
2557
|
size: 10451
|
|
2558
|
+
- path: development/tasks/spec-clarify.md
|
|
2559
|
+
hash: sha256:e4eee7ea80f146a697433462287aaff138536b148705337f2f32d66d2a83db5c
|
|
2560
|
+
type: task
|
|
2561
|
+
size: 8932
|
|
2554
2562
|
- path: development/tasks/spec-critique.md
|
|
2555
2563
|
hash: sha256:7d0243ab61b08e5c70fdd12ead90a2403b7dd3659ce3a68e54f4274b3347b07a
|
|
2556
2564
|
type: task
|
|
@@ -2988,9 +2996,9 @@ files:
|
|
|
2988
2996
|
type: workflow
|
|
2989
2997
|
size: 2606
|
|
2990
2998
|
- path: development/workflows/spec-pipeline.yaml
|
|
2991
|
-
hash: sha256:
|
|
2999
|
+
hash: sha256:d0da3844cdf7e71c59a13b22e6c715b23a0ae55337aaa6dfc7248de99bdc6ff4
|
|
2992
3000
|
type: workflow
|
|
2993
|
-
size:
|
|
3001
|
+
size: 28350
|
|
2994
3002
|
- path: development/workflows/story-development-cycle.yaml
|
|
2995
3003
|
hash: sha256:137fc6d2a7aedb50bbebfa045e877c382399604708ce03477f358f282b76727f
|
|
2996
3004
|
type: workflow
|
|
@@ -4188,9 +4196,9 @@ files:
|
|
|
4188
4196
|
type: template
|
|
4189
4197
|
size: 16666
|
|
4190
4198
|
- path: product/templates/spec-tmpl.md
|
|
4191
|
-
hash: sha256:
|
|
4199
|
+
hash: sha256:58207c62ca73c18d9584232bc62ec43ee5f11dc4337d231eee5bf2cc87d15b78
|
|
4192
4200
|
type: template
|
|
4193
|
-
size:
|
|
4201
|
+
size: 4220
|
|
4194
4202
|
- path: product/templates/state-persistence-tmpl.yaml
|
|
4195
4203
|
hash: sha256:3f8bb48230df89cf987330f7c9aff19edbc35a65a9cbff799e28480155dd8919
|
|
4196
4204
|
type: template
|
|
@@ -7,6 +7,11 @@
|
|
|
7
7
|
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
+
> **Marking uncertainty:** For any point that is genuinely undefined, inline the marker
|
|
11
|
+
> `[NEEDS CLARIFICATION: <the specific question>]` instead of guessing. Ceiling: **3 markers**.
|
|
12
|
+
> If more than 3 are needed, the spec is too ambiguous to proceed — run the clarify gate
|
|
13
|
+
> (`*clarify-spec {story-id}`) before continuing.
|
|
14
|
+
|
|
10
15
|
## 1. Overview
|
|
11
16
|
|
|
12
17
|
### 1.1 Summary
|
|
@@ -63,6 +68,19 @@
|
|
|
63
68
|
- {{this}}
|
|
64
69
|
{{/each}}
|
|
65
70
|
|
|
71
|
+
### 2.5 Success Criteria
|
|
72
|
+
|
|
73
|
+
> Measurable, **technology-agnostic** outcomes — describe the observable result, never the
|
|
74
|
+
> implementation. No tool, framework, or library names here (e.g. "user completes checkout in
|
|
75
|
+
> < 3s", not "Stripe call returns in < 3s").
|
|
76
|
+
|
|
77
|
+
| ID | Success Criterion | How it's measured |
|
|
78
|
+
| ------ | ------------------------------------------ | ----------------- |
|
|
79
|
+
|
|
80
|
+
{{#each success-criteria}}
|
|
81
|
+
| {{id}} | {{criterion}} | {{measure}} |
|
|
82
|
+
{{/each}}
|
|
83
|
+
|
|
66
84
|
---
|
|
67
85
|
|
|
68
86
|
## 3. Technical Approach
|
package/AGENTS.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# AGENTS.md
|
|
2
2
|
|
|
3
3
|
> SINAPSE AI -- AI-Orchestrated System for Full Stack Development
|
|
4
|
-
> 17 squads · 172 agents (all `@`-resolvable in Codex) · 1,
|
|
4
|
+
> 17 squads · 172 agents (all `@`-resolvable in Codex) · 1,412 task files, 1,348 resolvable via the parametric activator
|
|
5
5
|
>
|
|
6
6
|
> Codex resolves every agent and its real tasks at runtime from source (no frozen
|
|
7
7
|
> snapshot): `node .codex/scripts/resolve-codex-agent.js <agent> [command]`.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
## [1.
|
|
1
|
+
## [1.16.0](https://github.com/caioimori/sinapse-ai/compare/1.15.0...1.16.0) (2026-06-25)
|
|
2
2
|
|
|
3
3
|
### Features
|
|
4
4
|
|
|
5
|
-
*
|
|
6
|
-
* **statusline:** selos de identidade de agente + banner de install ([a80a353](https://github.com/caioimori/sinapse-ai/commit/a80a3532eb5143d882872301aad2aadc7e9abe79))
|
|
5
|
+
* add clarify and analyze gates to Spec Pipeline ([#280](https://github.com/caioimori/sinapse-ai/issues/280)) ([18b643f](https://github.com/caioimori/sinapse-ai/commit/18b643fe6d4038bb5a9967dccdd7b34bf3b9f6cc))
|
|
7
6
|
|
|
8
7
|
# Changelog
|
|
9
8
|
|