@dzhechkov/p-replicator 1.12.0 → 1.13.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/.dz-manifest.json +281 -65
  2. package/CHANGELOG.md +148 -1
  3. package/LICENSE +21 -0
  4. package/MULTIPLATFORM_ROADMAP.md +1 -1
  5. package/README/eng/01_quickstart.md +2 -2
  6. package/README/eng/02_user_guide.md +1 -1
  7. package/README/eng/03_admin_guide.md +2 -2
  8. package/README/eng/05_architecture.md +1 -1
  9. package/README/eng/README.md +2 -1
  10. package/README/ru/01_quickstart.md +2 -2
  11. package/README/ru/02_user_guide.md +1 -1
  12. package/README/ru/03_admin_guide.md +2 -2
  13. package/README/ru/05_architecture.md +1 -1
  14. package/README/ru/README.md +2 -1
  15. package/README/ru/html/index.html +8 -8
  16. package/README.md +150 -9
  17. package/bin/cli.js +0 -0
  18. package/package.json +10 -11
  19. package/sbom.json +604 -64
  20. package/scripts/check-pipeline-gaps.sh +510 -21
  21. package/src/commands/init.js +1 -1
  22. package/src/rule-components.json +5 -1
  23. package/src/utils.js +33 -3
  24. package/templates/.claude/agents/product-discoverer.md +38 -0
  25. package/templates/.claude/agents/replicate-coordinator.md +11 -1
  26. package/templates/.claude/commands/feature.md +72 -6
  27. package/templates/.claude/commands/go.md +6 -8
  28. package/templates/.claude/commands/harvest.md +5 -7
  29. package/templates/.claude/commands/replicate.md +169 -44
  30. package/templates/.claude/commands/start.md +28 -7
  31. package/templates/.claude/hooks/capture-source-path.cjs +795 -0
  32. package/templates/.claude/hooks/check-canon.cjs +493 -0
  33. package/templates/.claude/hooks/check-embed-contract.cjs +374 -0
  34. package/templates/.claude/hooks/check-external-deps.cjs +288 -0
  35. package/templates/.claude/hooks/check-file-ownership.cjs +424 -0
  36. package/templates/.claude/hooks/check-handoff-manifest.cjs +367 -0
  37. package/templates/.claude/hooks/check-job-contract.cjs +501 -0
  38. package/templates/.claude/hooks/check-look-origin.cjs +240 -0
  39. package/templates/.claude/hooks/check-look-trace.cjs +385 -0
  40. package/templates/.claude/hooks/check-metric-source.cjs +296 -0
  41. package/templates/.claude/hooks/check-model-cost.cjs +470 -0
  42. package/templates/.claude/hooks/check-ports.cjs +27 -6
  43. package/templates/.claude/hooks/check-review-contract.cjs +205 -0
  44. package/templates/.claude/hooks/check-source-version.cjs +312 -0
  45. package/templates/.claude/hooks/check-swarm-receipts.cjs +197 -0
  46. package/templates/.claude/hooks/check-webhook-contract.cjs +535 -0
  47. package/templates/.claude/hooks/statusline.cjs +2 -2
  48. package/templates/.claude/rules/embeddable-widget.md +73 -0
  49. package/templates/.claude/rules/feature-lifecycle.md +5 -6
  50. package/templates/.claude/rules/incoming-webhooks.md +99 -0
  51. package/templates/.claude/rules/long-running-job.md +73 -0
  52. package/templates/.claude/rules/model-call-cost.md +85 -0
  53. package/templates/.claude/rules/replicate-pipeline.md +122 -52
  54. package/templates/.claude/skills/brutal-honesty-review/SKILL.md +9 -0
  55. package/templates/.claude/skills/cc-toolkit-generator-enhanced/SKILL.md +4 -0
  56. package/templates/.claude/skills/cc-toolkit-generator-enhanced/modules/03-generate-p0.md +46 -1
  57. package/templates/.claude/skills/cc-toolkit-generator-enhanced/modules/04-generate-p1.md +7 -1
  58. package/templates/.claude/skills/cc-toolkit-generator-enhanced/modules/06-package-deliver.md +20 -2
  59. package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/claude-md-strategy.md +7 -0
  60. package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/automation-commands.md +17 -0
  61. package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/feature-lifecycle-ent.md +43 -5
  62. package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/feature-lifecycle.md +43 -7
  63. package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/start-command.md +19 -1
  64. package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/swarm-file-evidence.md +151 -0
  65. package/templates/.claude/skills/goap-research-ed25519/SKILL.md +37 -22
  66. package/templates/.claude/skills/goap-research-ed25519/references/negative-results.md +94 -0
  67. package/templates/.claude/skills/goap-research-ed25519/scripts/check_report_evidence.py +368 -4
  68. package/templates/.claude/skills/goap-research-ed25519/scripts/ed25519_verifier.py +122 -5
  69. package/templates/.claude/skills/goap-research-ed25519/scripts/evidence_fetch.py +33 -16
  70. package/templates/.claude/skills/goap-research-ed25519/scripts/quote_provenance.py +342 -0
  71. package/templates/.claude/skills/goap-research-ed25519/scripts/test_ed25519_verifier.py +60 -0
  72. package/templates/.claude/skills/goap-research-ed25519/scripts/test_evidence_provenance.py +139 -6
  73. package/templates/.claude/skills/goap-research-ed25519/scripts/test_quote_provenance.py +274 -0
  74. package/templates/.claude/skills/goap-research-ed25519/scripts/test_suite_completeness.py +2 -1
  75. package/templates/.claude/skills/knowledge-extractor/SKILL.md +4 -0
  76. package/templates/.claude/skills/pipeline-forge/SKILL.md +18 -23
  77. package/templates/.claude/skills/pipeline-forge/examples/replicate-analysis.md +7 -2
  78. package/templates/.claude/skills/pipeline-forge/references/patterns-catalog.md +19 -1
  79. package/templates/.claude/skills/pipeline-forge/references/self-extracted-patterns.md +17 -6
  80. package/templates/.claude/skills/pipeline-forge/references/skill-anatomy.md +0 -1
  81. package/templates/.claude/skills/requirements-validator/SKILL.md +18 -5
  82. package/templates/.claude/skills/requirements-validator/references/feature-report-contracts.md +67 -0
  83. package/templates/.claude/skills/requirements-validator/references/scoring-system.md +15 -6
  84. package/templates/.claude/skills/reverse-engineering-unicorn/modules/025-cjm-prototype.md +21 -1
  85. package/templates/.claude/skills/sparc-prd-mini/SKILL.md +173 -725
  86. package/tests/e2e/feature-contour.test.js +176 -0
  87. package/tests/fixtures/feature-contour/docs/features/demo-gate/01_specification.md +15 -0
  88. package/tests/fixtures/feature-contour/docs/features/demo-gate/02_pseudocode.md +19 -0
  89. package/tests/fixtures/feature-contour/docs/features/demo-gate/03_architecture.md +3 -0
  90. package/tests/fixtures/feature-contour/docs/features/demo-gate/04_refinement.md +3 -0
  91. package/tests/fixtures/feature-contour/docs/features/demo-gate/05_completion.md +7 -0
  92. package/tests/fixtures/feature-contour/docs/features/demo-gate/review-report.md +11 -0
  93. package/tests/fixtures/feature-contour/docs/features/demo-gate/validation-report.md +10 -0
  94. package/tests/fixtures/feature-contour/tests/demo.test.js +16 -0
  95. package/tests/snapshot/baseline.json +64 -40
  96. package/tests/unit/capture-source-path.test.js +492 -0
  97. package/tests/unit/check-canon.test.js +403 -0
  98. package/tests/unit/check-embed-contract.test.js +422 -0
  99. package/tests/unit/check-external-deps.test.js +363 -0
  100. package/tests/unit/check-file-ownership.test.js +388 -0
  101. package/tests/unit/check-handoff-manifest.test.js +410 -0
  102. package/tests/unit/check-job-contract.test.js +514 -0
  103. package/tests/unit/check-look-origin.test.js +180 -0
  104. package/tests/unit/check-look-trace.test.js +420 -0
  105. package/tests/unit/check-metric-source.test.js +325 -0
  106. package/tests/unit/check-model-cost.test.js +425 -0
  107. package/tests/unit/check-ports.test.js +46 -2
  108. package/tests/unit/check-review-contract.test.js +181 -0
  109. package/tests/unit/check-source-version.test.js +344 -0
  110. package/tests/unit/check-swarm-receipts.test.js +231 -0
  111. package/tests/unit/check-webhook-contract.test.js +536 -0
  112. package/tests/unit/db-port-rule.test.js +8 -2
  113. package/tests/unit/detection-ladder-registry.test.js +2 -2
  114. package/tests/unit/generator-swarm-contract.test.js +287 -0
  115. package/tests/unit/guard-honest-input-meta.test.js +64 -0
  116. package/tests/unit/honest-failure-rules.test.js +106 -9
  117. package/tests/unit/look-phase-contract.test.js +231 -0
  118. package/tests/unit/negative-conclusion-gate.test.js +300 -0
  119. package/tests/unit/quote-provenance.test.js +122 -0
  120. package/tests/unit/sync-templates-guard.test.js +46 -3
  121. package/tests/unit/traceability-completion-gate.test.js +267 -0
  122. package/tests/unit/utils.test.js +40 -3
@@ -14,15 +14,7 @@ description: >
14
14
 
15
15
  ## Architecture
16
16
 
17
- ```
18
- sparc-prd-mini/
19
- ├── SKILL.md # Оркестратор (этот файл)
20
- ├── references/
21
- │ └── sparc-methodology.md # SPARC framework (своё, уникальное)
22
- └── templates/
23
- ├── prd.md # PRD template
24
- └── CLAUDE.md # AI integration guide template
25
- ```
17
+ `SKILL.md` (оркестратор) + `references/sparc-methodology.md` (SPARC framework) + `templates/prd.md`, `templates/CLAUDE.md`.
26
18
 
27
19
  ## External Dependencies (view at runtime)
28
20
 
@@ -32,59 +24,23 @@ sparc-prd-mini/
32
24
  | Phase 1: Research | `goap-research-ed25519` | `.claude/skills/goap-research-ed25519/SKILL.md` | GOAP A* + OODA → Research Findings |
33
25
  | Phase 2: Solve | `problem-solver-enhanced` | `.claude/skills/problem-solver-enhanced/SKILL.md` | 9 modules + TRIZ → Solution Strategy |
34
26
 
35
- **Принцип:** Каждый внешний скилл — Single Source of Truth. Обновление оригинала автоматически подхватывается здесь.
36
-
37
- **Fallbacks (если скилл недоступен):**
38
- - `explore` недоступен → встроенные Socratic questions (3-5 вопросов)
39
- - `goap-research-ed25519` недоступен → прямой web_search по ключевым темам
40
- - `problem-solver-enhanced` недоступен → First Principles + SCQA only
27
+ **Принцип:** внешний скилл — Single Source of Truth. **Fallbacks:** explore встроенные Socratic questions (3-5); goap-research → прямой web_search; problem-solver → First Principles + SCQA.
41
28
 
42
29
  ## When to Use
43
30
 
44
- **Trigger Patterns:**
45
- - "sparc-prd-mini" / "PRD mini"
46
- - "создай PRD" / "подготовь документацию"
47
- - "vibe coding документация"
48
- - "SPARC документация"
49
- - "PRD auto" / "PRD manual" / "PRD с checkpoint"
50
- - "документация для разработки"
31
+ **Trigger Patterns:** "sparc-prd-mini" / "PRD mini" / "создай PRD" / "SPARC документация" / "PRD auto|manual|с checkpoint" / "документация для разработки".
51
32
 
52
33
  ## Operating Modes
53
34
 
54
- ### AUTO Mode (Default)
55
- ```
56
- Триггеры: "auto", "автоматически", "без остановок"
57
- ```
58
- Все 8 фаз выполняются последовательно без промежуточных подтверждений.
35
+ ### AUTO Mode (Default) — триггеры "auto", "автоматически", "без остановок": все 8 фаз подряд, без подтверждений.
59
36
 
60
- ### MANUAL Mode
61
- ```
62
- Триггеры: "manual", "пошагово", "с checkpoint", "с проверками"
63
- ```
64
- Checkpoint после каждой фазы. Пользователь подтверждает или корректирует.
37
+ ### MANUAL Mode — триггеры "manual", "пошагово", "с checkpoint": checkpoint после каждой фазы, пользователь подтверждает или корректирует.
65
38
 
66
- **Определение режима:**
67
- 1. Явно указан → использовать указанный
68
- 2. Задача простая → предложить AUTO
69
- 3. Задача сложная → предложить MANUAL
70
- 4. Неясно → спросить
39
+ **Определение режима:** явный → использовать; простая задача → предложить AUTO; сложная → MANUAL; неясно → спросить.
71
40
 
72
41
  ## Output Documents (11 files)
73
42
 
74
- ```
75
- /output/[product-name]-sparc/
76
- ├── PRD.md # Product Requirements Document
77
- ├── Solution_Strategy.md # Problem analysis (First Principles + TRIZ)
78
- ├── Specification.md # Requirements, user stories, acceptance criteria
79
- ├── Pseudocode.md # Algorithms, data flow, API contracts
80
- ├── Architecture.md # System design, tech stack, diagrams
81
- ├── Refinement.md # Edge cases, testing, optimization
82
- ├── Completion.md # Deployment, CI/CD, monitoring
83
- ├── Research_Findings.md # Market and technology research
84
- ├── Final_Summary.md # Executive summary
85
- └── .claude/
86
- └── CLAUDE.md # AI tools integration guide
87
- ```
43
+ `/output/[product-name]-sparc/`: PRD.md · Solution_Strategy.md · Specification.md · Pseudocode.md · Architecture.md · Refinement.md · Completion.md · Research_Findings.md · Final_Summary.md · `.claude/CLAUDE.md` (+ каталог) — 11 файлов.
88
44
 
89
45
  ## Document Role Map Contract
90
46
 
@@ -147,48 +103,13 @@ cross-document linkage only, not that an algorithm semantically implements the r
147
103
 
148
104
  ## Workflow Architecture
149
105
 
150
- ```
151
- ┌─────────────────────────────────────────────────────────────────┐
152
- │ INPUT: Описание продукта/идеи │
153
- │ ↓ │
154
- │ MODE SELECTION: AUTO или MANUAL │
155
- │ ↓ │
156
- │ GATE: Оценка ясности задачи │
157
- │ → Ясна? → Пропустить Explore (уведомить) │
158
- │ → Не ясна? → Phase 0: Explore │
159
- │ ↓ │
160
- │ Phase 0: EXPLORE → Product Brief │
161
- │ view(explore) │
162
- │ [MANUAL: ⏸️ CP0] │
163
- │ ↓ │
164
- │ Phase 1: RESEARCH → Research_Findings.md │
165
- │ view(goap-research-ed25519) │
166
- │ [MANUAL: ⏸️ CP1] │
167
- │ ↓ │
168
- │ Phase 2: SOLVE → Solution_Strategy.md │
169
- │ view(problem-solver-enhanced) │
170
- │ [MANUAL: ⏸️ CP2] │
171
- │ ↓ │
172
- │ Phase 3: SPECIFICATION → Specification.md + PRD.md │
173
- │ [MANUAL: ⏸️ CP3] (собственная логика) │
174
- │ ↓ │
175
- │ Phase 4: PSEUDOCODE → Pseudocode.md │
176
- │ [MANUAL: ⏸️ CP4] (собственная логика) │
177
- │ ↓ │
178
- │ Phase 5: ARCHITECTURE → Architecture.md │
179
- │ [MANUAL: ⏸️ CP5] (собственная логика) │
180
- │ ↓ │
181
- │ Phase 6: REFINEMENT → Refinement.md │
182
- │ [MANUAL: ⏸️ CP6] (собственная логика) │
183
- │ ↓ │
184
- │ Phase 7: COMPLETION → Completion.md + CLAUDE.md │
185
- │ [MANUAL: ⏸️ CP7] (собственная логика) │
186
- │ ↓ │
187
- │ SYNTHESIS → Final_Summary.md │
188
- │ ↓ │
189
- │ OUTPUT: 11 файлов │
190
- └─────────────────────────────────────────────────────────────────┘
191
- ```
106
+ `INPUT → mode (AUTO|MANUAL) → clarity gate → P0? → P1 → P2 → P3 → P4 → P5 → P6 → P7 → SYNTHESIS`.
107
+ If the task is clear, skip P0 and notify the user; otherwise run it. MANUAL pauses at CP0–CP7.
108
+
109
+ P0→`view(explore)`→Product Brief; P1→`view(goap-research-ed25519)`→`Research_Findings.md`;
110
+ P2→`view(problem-solver-enhanced)`→`Solution_Strategy.md`; P3→`Specification.md`+`PRD.md`;
111
+ P4→`Pseudocode.md`; P5→`Architecture.md`; P6→`Refinement.md`; P7→`Completion.md`+`CLAUDE.md`;
112
+ SYNTHESIS→`Final_Summary.md`; final package totals 11 files.
192
113
 
193
114
  ---
194
115
 
@@ -208,15 +129,7 @@ cross-document linkage only, not that an algorithm semantically implements the r
208
129
  - Непонятны ключевые функции
209
130
  - Противоречивые требования
210
131
 
211
- **При пропуске Explore:**
212
- ```
213
- ⚡ Фаза Explore пропущена — задача достаточно ясна.
214
- Сформирован Product Brief на основе вашего запроса.
215
- [показать Product Brief]
216
-
217
- [AUTO: переходим к Research...]
218
- [MANUAL: ⏸️ CHECKPOINT 0 — подтвердите или скорректируйте]
219
- ```
132
+ **При пропуске Explore:** сообщить «⚡ Фаза Explore пропущена — задача достаточно ясна», показать Product Brief; AUTO → сразу Research, MANUAL → CHECKPOINT 0.
220
133
 
221
134
  ---
222
135
 
@@ -228,47 +141,12 @@ view(".claude/skills/explore/SKILL.md")
228
141
  → Scope: уточнить продукт, аудиторию, features, constraints
229
142
  ```
230
143
 
231
- **Output — Product Brief:**
232
- ```markdown
233
- ## Product Brief
234
-
235
- **Product Name:** [Название]
236
- **Problem Statement:** [Какую проблему решаем]
237
- **Target Users:** [Целевая аудитория]
238
- **Core Value Proposition:** [Ключевая ценность]
239
-
240
- ### Key Features (MVP)
241
- 1. [Feature 1]
242
- 2. [Feature 2]
243
- 3. [Feature 3]
244
-
245
- ### Technical Context
246
- - Platform: [Web/Mobile/Desktop/API]
247
- - Stack Preferences: [Если есть]
248
- - Integrations: [Внешние системы]
249
- - Constraints: [Ограничения]
250
-
251
- ### Success Criteria
252
- - [Критерий 1]
253
- - [Критерий 2]
254
- ```
255
-
256
- **[MANUAL] CP0:**
257
- ```
258
- ═══════════════════════════════════════════════════════════════
259
- ⏸️ CHECKPOINT 0: Product Brief Complete
260
-
261
- [показать Product Brief]
144
+ **Output — Product Brief:** `## Product Brief` with Product Name, Problem Statement, Target Users,
145
+ Core Value Proposition; `### Key Features (MVP)` numbered Feature 1–3; `### Technical Context` with
146
+ Platform `[Web/Mobile/Desktop/API]`, Stack Preferences, Integrations, Constraints; `### Success
147
+ Criteria` with Criteria 1–2.
262
148
 
263
- Команды:
264
- • "ок" → перейти к Research
265
- • "уточни X" → уточнить аспект
266
- • "добавь Y" → добавить feature/requirement
267
- • "измени Z" → изменить параметр
268
-
269
- Ваше решение?
270
- ═══════════════════════════════════════════════════════════════
271
- ```
149
+ **[MANUAL] CP0:** show Product Brief; `ок` → Research; `уточни X`, `добавь Y`, `измени Z` edit it.
272
150
 
273
151
  ---
274
152
 
@@ -286,63 +164,15 @@ view(".claude/skills/goap-research-ed25519/SKILL.md")
286
164
  - User Research (поведенческие паттерны, боли)
287
165
  - Integration Research (APIs, compatibility)
288
166
 
289
- **Output — Research_Findings.md:**
290
- ```markdown
291
- ## Research Findings
292
-
293
- ### Executive Summary
294
- [Ключевые находки в 2-3 предложениях]
295
-
296
- ### Research Objective
297
- [Исходные вопросы]
298
-
299
- ### Methodology
300
- [GOAP план, источники]
301
-
302
- ### Market Analysis
303
- [Findings с inline citations]
304
-
305
- ### Competitive Landscape
306
- | Competitor | Strengths | Weaknesses | Differentiation |
307
- |------------|-----------|------------|-----------------|
308
-
309
- ### Technology Assessment
310
- [Findings с inline citations]
311
-
312
- ### User Insights
313
- [Findings с inline citations]
167
+ **Output — `Research_Findings.md`:** `## Research Findings` with Executive Summary (2–3 sentences),
168
+ Research Objective, Methodology (GOAP plan + sources), Market Analysis, Competitive Landscape table
169
+ `Competitor | Strengths | Weaknesses | Differentiation`, Technology Assessment, User Insights (all
170
+ findings use inline citations), Confidence Assessment (High = 3+ sources; Medium = 2; Low = needs
171
+ research), numbered Sources with URLs/reliability ratings, and Research Path Log with actions and
172
+ replanning decisions.
314
173
 
315
- ### Confidence Assessment
316
- - **High confidence:** [claims with 3+ sources]
317
- - **Medium confidence:** [claims with 2 sources]
318
- - **Low confidence:** [areas needing more research]
319
-
320
- ### Sources
321
- [Нумерованный список с URLs и reliability ratings]
322
-
323
- ### Research Path Log
324
- [Выполненные действия, replanning decisions]
325
- ```
326
-
327
- **[MANUAL] CP1:**
328
- ```
329
- ═══════════════════════════════════════════════════════════════
330
- ⏸️ CHECKPOINT 1: Research Complete
331
-
332
- **Ключевые находки:**
333
- [краткое summary]
334
-
335
- **Источники:** [число] sources, avg reliability [X.X]
336
-
337
- Команды:
338
- • "ок" → перейти к Solve
339
- • "глубже X" → исследовать тему детальнее
340
- • "добавь источники по Y" → найти больше источников
341
- • "сравни A и B" → сравнительный анализ
342
-
343
- Ваше решение?
344
- ═══════════════════════════════════════════════════════════════
345
- ```
174
+ **[MANUAL] CP1:** show key findings plus source count and average reliability `[X.X]`; `ок` → Solve;
175
+ `глубже X`, `добавь источники по Y`, `сравни A и B` refine research.
346
176
 
347
177
  ---
348
178
 
@@ -365,64 +195,14 @@ view(".claude/skills/problem-solver-enhanced/SKILL.md")
365
195
  8. OODA Loop — Observe, Orient, Decide, Act
366
196
  9. Solution Synthesis — интеграция
367
197
 
368
- **Output — Solution_Strategy.md:**
369
- ```markdown
370
- ## Solution Strategy
371
-
372
- ### Problem Statement (SCQA)
373
- - **Situation:** [Стабильный контекст]
374
- - **Complication:** [Что изменилось/проблема]
375
- - **Question:** [Ключевой вопрос]
376
- - **Answer:** [Предлагаемое решение]
377
-
378
- ### First Principles Analysis
379
- [Фундаментальные истины и выводы]
380
-
381
- ### Root Cause Analysis (5 Whys)
382
- 1. Why? → [Answer 1]
383
- 2. Why? → [Answer 2]
384
- 3. Why? → [Answer 3]
385
- 4. Why? → [Answer 4]
386
- 5. Why? → [Root Cause]
387
-
388
- ### Game Theory Analysis
389
- [Key players, interests, Nash equilibrium]
390
-
391
- ### Second-Order Effects
392
- [Consequences of consequences]
393
-
394
- ### Contradictions Resolved (TRIZ)
395
- | Contradiction | TRIZ Principle | Resolution |
396
- |---------------|----------------|------------|
397
-
398
- ### Recommended Approach
399
- [Детальное описание стратегии]
400
-
401
- ### Risk Assessment
402
- | Risk | Probability | Impact | Mitigation |
403
- |------|-------------|--------|------------|
404
- ```
198
+ **Output — `Solution_Strategy.md`:** `## Solution Strategy` with SCQA (Situation, Complication,
199
+ Question, Answer); First Principles; Root Cause Analysis (5 Whys: Answers 1–4, then Root Cause at
200
+ 5); Game Theory (players, interests, Nash equilibrium); Second-Order Effects; TRIZ table
201
+ `Contradiction | TRIZ Principle | Resolution`; Recommended Approach; Risk table
202
+ `Risk | Probability | Impact | Mitigation`.
405
203
 
406
- **[MANUAL] CP2:**
407
- ```
408
- ═══════════════════════════════════════════════════════════════
409
- ⏸️ CHECKPOINT 2: Solution Strategy Complete
410
-
411
- **Рекомендуемый подход:**
412
- [краткое summary]
413
-
414
- **Ключевые TRIZ решения:**
415
- [список]
416
-
417
- Команды:
418
- • "ок" → перейти к Specification
419
- • "альтернатива для X" → другой подход
420
- • "углуби анализ Y" → детальнее по модулю
421
- • "добавь stakeholder Z" → расширить game theory
422
-
423
- Ваше решение?
424
- ═══════════════════════════════════════════════════════════════
425
- ```
204
+ **[MANUAL] CP2:** show recommended approach and key TRIZ resolutions; `ок` → Specification;
205
+ `альтернатива для X`, `углуби анализ Y`, `добавь stakeholder Z` revise the strategy.
426
206
 
427
207
  ---
428
208
 
@@ -437,7 +217,7 @@ view(".claude/skills/problem-solver-enhanced/SKILL.md")
437
217
  - User Stories with Acceptance Criteria (Gherkin)
438
218
  - Feature Matrix (MVP/v1/v2)
439
219
  - Non-Functional Requirements (performance, security, scalability)
440
- - Success Metrics
220
+ - Success Metrics (each naming its value SOURCE — closed list, see Final Summary)
441
221
 
442
222
  **User Story Format:**
443
223
  ```
@@ -465,23 +245,9 @@ view("templates/prd.md")
465
245
  → Заполнить шаблон данными из Phase 0-2
466
246
  ```
467
247
 
468
- **[MANUAL] CP3:**
469
- ```
470
- ═══════════════════════════════════════════════════════════════
471
- ⏸️ CHECKPOINT 3: Specification Complete
472
-
473
- **User Stories:** [число] total, [число] MVP
474
- **NFRs:** Performance, Security, Scalability defined
475
-
476
- Команды:
477
- • "ок" → перейти к Pseudocode
478
- • "добавь user story для X" → добавить
479
- • "уточни acceptance criteria Y" → уточнить
480
- • "измени приоритет Z" → изменить
481
-
482
- Ваше решение?
483
- ═══════════════════════════════════════════════════════════════
484
- ```
248
+ **[MANUAL] CP3:** show total/MVP story counts and whether Performance, Security, Scalability NFRs
249
+ are defined; `ок` → Pseudocode; `добавь user story для X`, `уточни acceptance criteria Y`,
250
+ `измени приоритет Z` revise the specification.
485
251
 
486
252
  ---
487
253
 
@@ -489,64 +255,20 @@ view("templates/prd.md")
489
255
 
490
256
  **Цель:** Определить алгоритмы и data flow.
491
257
 
492
- **Output — `PSEUDOCODE_FILE`:**
493
- ```markdown
494
- ## Data Structures
495
-
496
- ### [Entity Name]
497
- type EntityName = {
498
- id: UUID
499
- field1: Type
500
- field2: Type
501
- created_at: Timestamp
502
- }
503
-
504
- ## Core Algorithms
505
-
506
- ### Algorithm: [Name]
507
- REALISES: [SC-… ids this algorithm implements, comma-separated]
508
- INPUT: [parameters]
509
- OUTPUT: [result]
510
-
511
- STEPS:
512
- 1. [step]
513
- 2. [step]
514
- 3. IF [condition]:
515
- [action]
516
- ELSE:
517
- [action]
518
- 4. RETURN [result]
519
-
520
- COMPLEXITY: O(n)
521
-
522
- ## API Contracts
523
-
524
- ### Endpoint: [Method] /path
525
- Request:
526
- Headers: { Authorization: Bearer <token> }
527
- Body: { field1: type, field2: type }
528
-
529
- Response (200):
530
- { data: type, meta: { ... } }
531
-
532
- Response (4xx/5xx):
533
- { error: { code: string, message: string } }
534
-
535
- ## State Transitions
536
- [Mermaid diagram]
537
-
538
- ## Error Handling Strategy
539
- [Error categories and responses]
540
- ```
258
+ **Output — `PSEUDOCODE_FILE`:** required blocks are `## Data Structures` (each entity names `id:
259
+ UUID`, fields and `created_at: Timestamp`); `## Core Algorithms`, where every block has:
260
+ `### Algorithm: [Name]` · `REALISES: [SC-… ids this algorithm implements]` · `INPUT:` · `OUTPUT:` ·
261
+ numbered `STEPS` with IF/ELSE and RETURN · `COMPLEXITY: O(n)`; `## API Contracts` (method/path,
262
+ Authorization Bearer header, body, Response
263
+ `200` data/meta, Response `4xx/5xx` error code/message); `## State Transitions` Mermaid; `## Error
264
+ Handling Strategy` categories/responses.
541
265
 
542
266
  **Шаг 4.9 — ПОКРЫТИЕ СЦЕНАРИЕВ (обязательный, до чекпойнта).**
543
267
 
544
- Resolve role `specification` through `DOCUMENT_ROLE_MAP` as `SPECIFICATION_FILE`.
545
- Resolve role `pseudocode` through `DOCUMENT_ROLE_MAP` as `PSEUDOCODE_FILE`. Re-read `SPECIFICATION_FILE` and
546
- collect every `SC-` scenario ID. Collect every algorithm's `REALISES` line from `PSEUDOCODE_FILE`.
547
- Write a `## Scenario Coverage` block into `PSEUDOCODE_FILE` — **in every
548
- case, including the one where everything is covered**, because an absent block and a block saying
549
- "all covered" are indistinguishable to the next reader:
268
+ Resolve role `specification` through `DOCUMENT_ROLE_MAP` as `SPECIFICATION_FILE`; Resolve role `pseudocode` through `DOCUMENT_ROLE_MAP` as `PSEUDOCODE_FILE`. Re-read `SPECIFICATION_FILE` and
269
+ collect every `SC-` ID; collect every algorithm's `REALISES` claim from `PSEUDOCODE_FILE`.
270
+ Write a `## Scenario Coverage` block into `PSEUDOCODE_FILE` in every
271
+ case, including the one where everything is covered:
550
272
 
551
273
  ```
552
274
  ## Scenario Coverage
@@ -558,16 +280,14 @@ Not claimed by any algorithm:
558
280
  |---|---|
559
281
  | SC-… | ui-only |
560
282
 
561
- Claimed by an algorithm but absent from [SPECIFICATION_FILE]:
283
+ Claimed by an algorithm but absent from Specification.md:
562
284
  | Algorithm | Claimed ID |
563
285
  |---|---|
564
286
  | [name] | SC-… |
565
287
  ```
566
288
 
567
- **Both tables are required, and both may be the single word `none`.** A traceability check that runs
568
- one way only is half a check: without the second table an algorithm can declare `REALISES: SC-US-009-3`
569
- for a scenario nobody ever wrote, and the dangling reference reads exactly like coverage. `none` is
570
- written out rather than left blank, because an empty table and a forgotten table look identical.
289
+ Both tables are required, and both may be the single word `none`; the reverse table catches a dangling
290
+ `REALISES: SC-US-009-3`. Blank is not `none`.
571
291
 
572
292
  **Reasons are a CLOSED list of five**, and nothing else is accepted:
573
293
 
@@ -579,38 +299,17 @@ written out rather than left blank, because an empty table and a forgotten table
579
299
  | `data-only` | satisfied by a schema or constraint, not by a procedure |
580
300
  | `config-only` | satisfied by OUR OWN configuration — a server setting, a header, a policy file — with no procedure to write |
581
301
 
582
- Free text is NOT a reason, and `N/A` is NOT a reason. A field that accepts anything records nothing:
583
- the whole value of the list is that an unclaimed scenario has to be one of a small number of
584
- recognisable things, and if it is none of them, the gap is real and belongs in the algorithms.
302
+ Free text is NOT a reason, and `N/A` is NOT a reason. A field that accepts anything records nothing;
303
+ anything outside the closed list is a real algorithm gap.
585
304
 
586
- **What this establishes, and what it does not.** It establishes that a CLAIM exists and that its two
587
- ends name each other. It does NOT establish that the algorithm's steps actually perform the check the
588
- scenario describes no comparison of names can. So this catches *"nobody wrote anything about this
589
- scenario"*; it does not catch *"someone wrote a line that mentions it"*. Say so here rather than
590
- letting a later reader assume the stronger thing.
305
+ This proves only a mutual naming CLAIM. It does NOT establish that the algorithm's steps actually perform the check:
306
+ it catches "nobody wrote anything about this scenario", not a wrong implementation
307
+ that merely mentions the ID.
591
308
 
592
- With the project-level default, `[SPECIFICATION_FILE]` renders as `Specification.md`, including the
593
- label `Claimed by an algorithm but absent from Specification.md:`. A supplied map renders the same
594
- label with its resolved `specification` filename.
309
+ The default label names `Specification.md`; a supplied map substitutes its resolved filename.
595
310
 
596
- **[MANUAL] CP4:**
597
- ```
598
- ═══════════════════════════════════════════════════════════════
599
- ⏸️ CHECKPOINT 4: Pseudocode Complete
600
-
601
- **Data Structures:** [число] entities
602
- **Algorithms:** [число] core algorithms
603
- **API Endpoints:** [число] endpoints
604
-
605
- Команды:
606
- • "ок" → перейти к Architecture
607
- • "оптимизируй алгоритм X" → улучшить
608
- • "добавь edge case Y" → добавить обработку
609
- • "измени структуру Z" → изменить
610
-
611
- Ваше решение?
612
- ═══════════════════════════════════════════════════════════════
613
- ```
311
+ **[MANUAL] CP4:** show entity/core-algorithm/API-endpoint counts; `ок` → Architecture;
312
+ `оптимизируй алгоритм X`, `добавь edge case Y`, `измени структуру Z` revise pseudocode.
614
313
 
615
314
  ---
616
315
 
@@ -624,46 +323,43 @@ view("references/sparc-methodology.md")
624
323
  → Секция Architecture для best practices
625
324
  ```
626
325
 
627
- **Output — `ARCHITECTURE_FILE`:**
628
- ```markdown
629
- ## Architecture Overview
630
-
631
- ### Architecture Style
632
- [Monolith / Microservices / Serverless / Hybrid]
633
-
634
- ### High-Level Diagram
635
- ```mermaid
636
- graph TB
637
- subgraph Client
638
- A[Web App]
639
- B[Mobile App]
640
- end
641
- subgraph API
642
- C[API Gateway]
643
- D[Service A]
644
- E[Service B]
645
- end
646
- subgraph Data
647
- F[(Database)]
648
- G[(Cache)]
649
- end
650
- ```
326
+ **Output — `ARCHITECTURE_FILE`:** required blocks are `## Architecture Overview` with style
327
+ `[Monolith / Microservices / Serverless / Hybrid]` and a Mermaid high-level diagram covering Client
328
+ (Web App, Mobile App), API (API Gateway, Service A, Service B), and Data (Database, Cache); `##
329
+ Component Breakdown`; `## Technology Stack` table `Layer | Technology | Rationale` with Frontend,
330
+ Backend, Database, Cache, Queue, Infrastructure; `## External Dependencies` as follows.
331
+
332
+ Record one row per external capability, not vendor: "sends email" and "reports bounces" are two
333
+ questions because a provider may do only one.
334
+
335
+ | Capability needed | Provider / API | Evidence | Verdict | Requirements relying on it |
336
+ |---|---|---|---|---|
337
+ | [what the product needs it to DO] | [service] | [link to the provider's own docs naming this capability] · checked [YYYY-MM-DD] | CONFIRMED | [REQ ids] |
338
+
339
+ Evidence MUST be the PROVIDER'S OWN documentation naming the capability, check date, and a short
340
+ verbatim QUOTE. These do NOT count: landing page, marketing page, pricing page, recollection ("the
341
+ model knows this API supports it"), or a URL nobody opened. An uncited capability is not confirmed.
342
+
343
+ **Verdicts — exactly three, because two would hide a difference that matters:**
651
344
 
652
- ## Component Breakdown
653
- [Detailed component descriptions]
345
+ | Verdict | Means | Consequence in Phase 2 |
346
+ |---|---|---|
347
+ | CONFIRMED | cited, and the citation names this capability | none |
348
+ | UNCONFIRMED | nobody could produce a citation | the REQUIREMENTS in that row's last column cannot enter Phase 3 — defer, remove or replace them. Unrelated work continues; the run is 🟡 CAVEATS at best and the row is NAMED in the report |
349
+ | CONTRADICTED | the provider's own docs say it cannot | 🔴 NEEDS WORK — the requirement rests on something that is not there |
654
350
 
655
- ## Technology Stack
351
+ `UNCONFIRMED` is the honest no-citation/no-web state: it is neither CONFIRMED nor CONTRADICTED. It
352
+ does not pass free: **scope the consequence to the REQUIREMENT, not the run**. Listed requirements
353
+ cannot enter Phase 3 until deferred, removed, or rewritten onto confirmable ground; unrelated work
354
+ continues. Otherwise an all-UNCONFIRMED inventory would make feasibility optional behind a caveat.
656
355
 
657
- | Layer | Technology | Rationale |
658
- |-------|------------|-----------|
659
- | Frontend | | |
660
- | Backend | | |
661
- | Database | | |
662
- | Cache | | |
663
- | Queue | | |
664
- | Infrastructure | | |
356
+ With none, write exactly: *"No external dependencies — this product calls no third-party service."*
357
+ An empty section and an absent section are indistinguishable, and only one of them means anything —
358
+ that is why the sentence is prescribed verbatim.
665
359
 
666
- ## External Dependencies
360
+ Row names are PLACEHOLDERS: NEVER copy a provider/capability from an example; APIs drift.
361
+
362
+ Then add `## External Dependencies
667
363
 
668
364
  Every capability this product needs from someone else's service. One row per capability, not one row
669
365
  per vendor: "sends email" and "reports bounces" are two questions, and a provider can do one without
@@ -673,13 +369,9 @@ the other.
673
369
  |---|---|---|---|---|
674
370
  | [what the product needs it to DO] | [service] | [link to the provider's own docs naming this capability] · checked [YYYY-MM-DD] | CONFIRMED | [REQ ids] |
675
371
 
676
- **Evidence — what counts, and what does not.** Evidence is a link to the PROVIDER'S OWN documentation
677
- that names the specific capability, plus the date it was checked, plus **a short verbatim QUOTE from
678
- that page stating the capability**. These do NOT count, and each is a way this check gets faked: a
679
- landing page or marketing page; a pricing page; recollection — "the model knows this API supports
680
- it"; and **a URL nobody opened** — a plausible-looking link is the cheapest possible forgery, which
681
- is exactly why the quote is required and the link alone is not enough. A capability nobody could cite
682
- is not confirmed, and saying so is the point of the middle verdict.
372
+ **Evidence — what counts.** A link to the PROVIDER'S OWN documentation naming the capability,
373
+ plus the date it was checked, plus **a short verbatim QUOTE from that page stating the capability**. These do NOT count (each a known fake): a landing page or marketing page; a pricing page; recollection ("the model knows"); **a URL nobody opened** — a plausible link
374
+ is the cheapest forgery, which is why the quote is required.
683
375
 
684
376
  **Verdicts — exactly three, because two would hide a difference that matters:**
685
377
 
@@ -689,60 +381,42 @@ is not confirmed, and saying so is the point of the middle verdict.
689
381
  | UNCONFIRMED | nobody could produce a citation | the REQUIREMENTS in that row's last column cannot enter Phase 3 — defer, remove or replace them. Unrelated work continues; the run is 🟡 CAVEATS at best and the row is NAMED in the report |
690
382
  | CONTRADICTED | the provider's own docs say it cannot | 🔴 NEEDS WORK — the requirement rests on something that is not there |
691
383
 
692
- `UNCONFIRMED` is not a failure to be hidden; it is the honest state of a project on a machine with no
693
- web access. Collapsing it into CONFIRMED overstates what is known; collapsing it into CONTRADICTED
694
- blocks work that may be perfectly fineand would push people to write a citation that isn't one,
695
- which is how a gate becomes theatre.
696
-
697
- But it does not pass for free either. **The consequence is scoped to the REQUIREMENT, not to the
698
- run:** the requirements listed in an `UNCONFIRMED` row do not enter Phase 3 until they are deferred,
699
- removed, or rewritten onto something confirmable. Everything not resting on that capability proceeds.
700
- Without this scoping an inventory of nothing but `UNCONFIRMED` rows would reach Phase 3 with a
701
- caveat, and external feasibility would never have to be established at all — the check would be
702
- optional in practice while looking mandatory on paper.
384
+ `UNCONFIRMED` is the honest offline state never collapse it into CONFIRMED (overstates) or
385
+ CONTRADICTED (invites fake citations; a gate becomes theatre). Nor is it free: **the consequence is
386
+ scoped to the REQUIREMENT, not the run**requirements in an `UNCONFIRMED` row do not enter Phase 3
387
+ until deferred, removed, or rewritten onto something confirmable; unrelated work proceeds. Without
388
+ this scoping an all-`UNCONFIRMED` inventory would pass with a caveat and the check would be optional
389
+ in practice while looking mandatory on paper.
703
390
 
704
391
  **If this product has no external dependencies**, write exactly that: *"No external dependencies —
705
392
  this product calls no third-party service."* An empty section and an absent section are
706
393
  indistinguishable, and only one of them means anything.
707
394
 
708
- Names in the row above are PLACEHOLDERS. Do not copy a real provider or a real capability from any
709
- example: what an API can do drifts, and a stale fact recorded as evidence is worse than none.
710
-
711
- ## Data Architecture
712
- [Data models, relationships, storage strategy]
395
+ Row names are PLACEHOLDERS never copy a real provider/capability from an example: API facts drift,
396
+ and a stale fact recorded as evidence is worse than none.
713
397
 
714
- ## Security Architecture
715
- [Authentication, authorization, encryption]
716
-
717
- ## Scalability Considerations
718
- [Horizontal/vertical scaling, bottlenecks]
719
- ```
398
+ ## Data Architecture` (models, relationships, storage), `## Security Architecture`
399
+ (authentication, authorization, encryption), and `## Scalability Considerations`
400
+ (horizontal/vertical scaling, bottlenecks).
720
401
 
721
402
  **Шаг 5.9 — СВЕРКА С ПСЕВДОКОДОМ (обязательный, до чекпойнта).**
722
403
 
723
- Фаза 4 написала модель данных ДО того, как эта фаза выбрала хранилище и технологии, и до сих пор
724
- ничто их не сверяло. Именно отсюда берутся расхождения, которые всплывают уже в коде: поле осталось
725
- булевым, когда схема получила перечисление; алгоритм пользуется полем, которого в схеме нет; у
726
- статуса три значения в одном документе и пять в другом.
727
-
728
- Resolve role `pseudocode` through `DOCUMENT_ROLE_MAP` as `PSEUDOCODE_FILE`.
729
- Resolve role `architecture` through `DOCUMENT_ROLE_MAP` as `ARCHITECTURE_FILE`. Перечитай в `PSEUDOCODE_FILE`
730
- ДВЕ секции — `## Data Structures` и `## Core Algorithms` — и сверь их с
731
- тем, что выбрано ЗДЕСЬ. Алгоритмы нужны обязательно: расхождение «алгоритм читает поле, которого в
732
- схеме нет» по одним лишь структурам данных не обнаруживается. Ищи три вида расхождений:
404
+ Фаза 4 определила логическую модель до выбора хранилища.
405
+ Resolve role `pseudocode` through `DOCUMENT_ROLE_MAP` as `PSEUDOCODE_FILE`;
406
+ Resolve role `architecture` through `DOCUMENT_ROLE_MAP` as `ARCHITECTURE_FILE`;
407
+ re-read ДВЕ секции `PSEUDOCODE_FILE` `## Data Structures` и
408
+ `## Core Algorithms` — then compare with `ARCHITECTURE_FILE`. Algorithms are mandatory: structures alone
409
+ cannot expose a read/write of a missing field. This catches boolean→enum drift, a missing algorithm
410
+ field, or a status with 3 values in one document and 5 in another. Find all three mismatch kinds:
733
411
 
734
412
  - **смена типа** — поле объявлено одним типом, а хранилище требует другого (булево против перечисления);
735
413
  - **отсутствующая колонка** — алгоритм читает или пишет поле, которого в схеме нет;
736
414
  - **несовпадение набора значений** — у одного и того же поля разное число допустимых значений.
737
415
 
738
- Какую сторону править решается по РОЛИ документа, а не по старшинству. `PSEUDOCODE_FILE` держит
739
- ЛОГИЧЕСКУЮ модель (что означает поле), `ARCHITECTURE_FILE` ФИЗИЧЕСКУЮ (где и как оно лежит).
740
- Поэтому: если эта фаза ввела осознанное физическое ограничение (тип хранилища, индекс, длина) —
741
- правится `PSEUDOCODE_FILE`; если выбранная технология НАРУШАЕТ требуемую семантику (теряются значения,
742
- исчезает состояние, которым пользуется алгоритм) — меняется выбор ЗДЕСЬ, потому что требование
743
- старше удобства реализации. Секция `## Data Architecture` этого документа остаётся на месте, но
744
- описывает отображение на хранилище и связи, а НЕ пересказывает список полей: второй экземпляр списка
745
- становится вторым местом, где начинается расхождение.
416
+ Fix by document ROLE: `PSEUDOCODE_FILE` owns LOGICAL meaning; `ARCHITECTURE_FILE` owns PHYSICAL
417
+ storage. A deliberate storage constraint (type/index/length) updates pseudocode; a technology that
418
+ BREAKS required semantics is changed HERE. `## Data Architecture` describes mapping/relationships,
419
+ NEVER a second field list.
746
420
 
747
421
  Результат записывается в `ARCHITECTURE_FILE` ВСЕГДА, отдельным блоком:
748
422
 
@@ -754,33 +428,14 @@ Resolve role `architecture` through `DOCUMENT_ROLE_MAP` as `ARCHITECTURE_FILE`.
754
428
  | … | смена типа / отсутствующая колонка / несовпадение набора значений | … |
755
429
  ```
756
430
 
757
- Если сверка не нашла ничего блок всё равно пишется, и он ОБЯЗАН назвать, что именно
758
- сверялось: «Расхождений с `[PSEUDOCODE_FILE]` не найдено. Сверены сущности: <перечисление>; алгоритмы:
759
- <перечисление>.» Одна фраза «расхождений нет» без перечня — это церемония, которую модель напишет
760
- не глядя; перечень делает утверждение проверяемым. Молчание не является результатом сверки: по нему
761
- нельзя отличить «сверили и чисто» от «не сверяли».
762
-
763
- With the project-level default, `PSEUDOCODE_FILE` is `Pseudocode.md` and `ARCHITECTURE_FILE` is
764
- `Architecture.md`; a supplied map changes only those resolved filenames, not the reconciliation.
765
-
766
- **[MANUAL] CP5:**
767
- ```
768
- ═══════════════════════════════════════════════════════════════
769
- ⏸️ CHECKPOINT 5: Architecture Complete
770
-
771
- **Style:** [architecture style]
772
- **Components:** [число] components
773
- **Tech Stack:** [key technologies]
431
+ If clean, the block is still REQUIRED and MUST say: «Расхождений с `[PSEUDOCODE_FILE]` не найдено.
432
+ Сверены сущности: <перечисление>; алгоритмы: <перечисление>.» Bare «расхождений нет» or silence is
433
+ not evidence.
774
434
 
775
- Команды:
776
- • "ок" → перейти к Refinement
777
- • "альтернатива для X" → другая технология
778
- • "углуби безопасность" → детальнее security
779
- • "добавь диаграмму Y" → добавить
435
+ Defaults are `Pseudocode.md`/`Architecture.md`; a supplied map changes filenames only.
780
436
 
781
- Ваше решение?
782
- ═══════════════════════════════════════════════════════════════
783
- ```
437
+ **CHECKPOINT 5** — **[MANUAL] CP5:** show architecture style, component count, and key technologies; `ок` → Refinement;
438
+ `альтернатива для X`, `углуби безопасность`, `добавь диаграмму Y` revise architecture.
784
439
 
785
440
  ---
786
441
 
@@ -788,77 +443,15 @@ With the project-level default, `PSEUDOCODE_FILE` is `Pseudocode.md` and `ARCHIT
788
443
 
789
444
  **Цель:** Edge cases, тестирование, оптимизация.
790
445
 
791
- **Output — `REFINEMENT_FILE`:**
792
- ```markdown
793
- ## Edge Cases Matrix
794
-
795
- | Scenario | Input | Expected | Handling |
796
- |----------|-------|----------|----------|
797
- | Empty input | | | |
798
- | Max size | | | |
799
- | Concurrent access | | | |
800
- | Network failure | | | |
801
-
802
- ## Testing Strategy
803
-
804
- ### Unit Tests
805
- [Coverage targets, critical paths]
806
-
807
- ### Integration Tests
808
- [Service interactions, API contracts]
809
-
810
- ### E2E Tests
811
- [User journeys, critical flows]
812
-
813
- ### Performance Tests
814
- [Load testing, benchmarks]
815
-
816
- ## Test Cases
817
-
818
- ### Feature: [Name]
819
- ```gherkin
820
- Scenario: [Happy path]
821
- Given [setup]
822
- When [action]
823
- Then [assertion]
824
-
825
- Scenario: [Error case]
826
- Given [setup]
827
- When [invalid action]
828
- Then [error handling]
829
- ```
830
-
831
- ## Performance Optimizations
832
- [Caching, indexing, lazy loading]
833
-
834
- ## Security Hardening
835
- [Input validation, rate limiting, audit logs]
446
+ **Output — `REFINEMENT_FILE`:** `## Edge Cases Matrix` table `Scenario | Input | Expected | Handling`
447
+ with every row: Empty input, Max size, Concurrent access, Network failure; `## Testing Strategy`
448
+ with Unit (coverage/critical paths), Integration (interactions/contracts), E2E (journeys/flows),
449
+ Performance (load/benchmarks); `## Test Cases` Gherkin Happy path and Error case, each Given/When/Then;
450
+ Performance Optimizations (caching/indexing/lazy loading); Security Hardening (input validation/rate
451
+ limiting/audit logs); Accessibility (WCAG/keyboard); Technical Debt (shortcuts/refactoring).
836
452
 
837
- ## Accessibility (a11y)
838
- [WCAG compliance, keyboard navigation]
839
-
840
- ## Technical Debt Items
841
- [Known shortcuts, future refactoring]
842
- ```
843
-
844
- **[MANUAL] CP6:**
845
- ```
846
- ═══════════════════════════════════════════════════════════════
847
- ⏸️ CHECKPOINT 6: Refinement Complete
848
-
849
- **Edge Cases:** [число] scenarios
850
- **Test Cases:** [число] tests
851
- **Optimizations:** [список]
852
-
853
- Команды:
854
- • "ок" → перейти к Completion
855
- • "добавь тест для X" → добавить test case
856
- • "углуби edge case Y" → расширить
857
- • "оптимизируй Z" → добавить оптимизацию
858
-
859
- Ваше решение?
860
- ═══════════════════════════════════════════════════════════════
861
- ```
453
+ **[MANUAL] CP6:** show edge-case/test counts and optimizations; `ок` → Completion;
454
+ `добавь тест для X`, `углуби edge case Y`, `оптимизируй Z` revise refinement.
862
455
 
863
456
  ---
864
457
 
@@ -868,72 +461,13 @@ Scenario: [Error case]
868
461
 
869
462
  **Output — `COMPLETION_FILE` + CLAUDE.md:**
870
463
 
871
- **Completion.md:**
872
- ```markdown
873
- ## Deployment Plan
874
-
875
- ### Pre-Deployment Checklist
876
- - [ ] All tests passing
877
- - [ ] Security audit complete
878
- - [ ] Documentation updated
879
- - [ ] Rollback plan tested
880
-
881
- ### Deployment Sequence
882
- 1. [Step 1]
883
- 2. [Step 2]
884
- 3. [Step 3]
885
-
886
- ### Rollback Procedure
887
- [Steps to rollback if issues]
888
-
889
- ## CI/CD Configuration
890
-
891
- ```yaml
892
- stages:
893
- - test
894
- - build
895
- - deploy
896
-
897
- test:
898
- script:
899
- - npm test
900
- - npm run lint
901
-
902
- deploy:
903
- script:
904
- - npm run build
905
- - deploy.sh
906
- ```
907
-
908
- ## Monitoring & Alerting
909
-
910
- ### Key Metrics
911
- | Metric | Threshold | Alert |
912
- |--------|-----------|-------|
913
- | Response time p99 | > 500ms | PagerDuty |
914
- | Error rate | > 1% | Slack |
915
- | CPU usage | > 80% | Email |
916
-
917
- ## Logging Strategy
918
- [Log levels, retention, aggregation]
919
-
920
- ## Handoff Checklists
921
-
922
- ### For Development Team
923
- - [ ] Repository access
924
- - [ ] Development environment setup
925
- - [ ] Code review guidelines
926
-
927
- ### For QA Team
928
- - [ ] Test environment access
929
- - [ ] Test data setup
930
- - [ ] Bug reporting process
931
-
932
- ### For Operations Team
933
- - [ ] Production access
934
- - [ ] Runbooks
935
- - [ ] Escalation procedures
936
- ```
464
+ **Completion.md required content:** Deployment Plan with Pre-Deployment checklist (all tests passing,
465
+ security audit complete, docs updated, rollback tested), Deployment Sequence Steps 1–3, and Rollback
466
+ Procedure; CI/CD stages `test → build → deploy` running `npm test`, `npm run lint`, `npm run build`,
467
+ `deploy.sh`; Monitoring table preserving `Response time p99 | > 500ms | PagerDuty`, `Error rate | >
468
+ 1% | Slack`, `CPU usage | > 80% | Email`; Logging levels/retention/aggregation; Handoff checklists:
469
+ Development (repository access, environment setup, review guidelines), QA (test environment, test
470
+ data, bug reporting), Operations (production access, runbooks, escalation).
937
471
 
938
472
  **CLAUDE.md:**
939
473
  ```
@@ -941,117 +475,46 @@ view("templates/CLAUDE.md")
941
475
  → Заполнить шаблон данными из всех предыдущих фаз
942
476
  ```
943
477
 
944
- **[MANUAL] CP7:**
945
- ```
946
- ═══════════════════════════════════════════════════════════════
947
- ⏸️ CHECKPOINT 7: Completion Ready
948
-
949
- **Deployment:** Plan + rollback ready
950
- **Monitoring:** [число] metrics configured
951
- **Handoffs:** Dev, QA, Ops checklists
952
-
953
- Команды:
954
- • "ок" / "финиш" → создать Final Package
955
- • "добавь мониторинг X" → добавить метрику
956
- • "углуби rollback" → расширить план
957
- • "измени CI/CD" → изменить pipeline
958
-
959
- Ваше решение?
960
- ═══════════════════════════════════════════════════════════════
961
- ```
478
+ **[MANUAL] CP7:** show deployment/rollback readiness, monitoring metric count, and Dev/QA/Ops
479
+ handoffs; `ок`/`финиш` → Final Package; `добавь мониторинг X`, `углуби rollback`, `измени CI/CD`
480
+ revise completion.
962
481
 
963
482
  ---
964
483
 
965
484
  ### SYNTHESIS: Final Summary
966
485
 
967
- **Output — Final_Summary.md:**
968
- ```markdown
969
- # [Product Name] - Executive Summary
970
-
971
- ## Overview
972
- [3-5 sentences describing the product and its value]
973
-
974
- ## Problem & Solution
975
- **Problem:** [What problem we're solving]
976
- **Solution:** [How we're solving it]
977
-
978
- ## Target Users
979
- [Primary and secondary personas]
980
-
981
- ## Key Features (MVP)
982
- 1. [Feature 1] - [value proposition]
983
- 2. [Feature 2] - [value proposition]
984
- 3. [Feature 3] - [value proposition]
985
-
986
- ## Technical Approach
987
- - **Architecture:** [style]
988
- - **Tech Stack:** [key technologies]
989
- - **Key Differentiators:** [technical advantages]
990
-
991
- ## Research Highlights
992
- [Top 3-5 insights from research phase]
993
-
994
- ## Success Metrics
995
- | Metric | Target | Timeline |
996
- |--------|--------|----------|
997
-
998
- ## Timeline & Phases
999
- | Phase | Features | Timeline |
1000
- |-------|----------|----------|
1001
- | MVP | | |
1002
- | v1.0 | | |
1003
- | v2.0 | | |
1004
-
1005
- ## Risks & Mitigations
1006
- | Risk | Mitigation |
1007
- |------|------------|
1008
-
1009
- ## Immediate Next Steps
1010
- 1. [Action 1]
1011
- 2. [Action 2]
1012
- 3. [Action 3]
1013
-
1014
- ## Documentation Package
1015
- - PRD.md - Product Requirements
1016
- - Solution_Strategy.md - Problem Analysis
1017
- - Specification.md - Detailed Requirements
1018
- - Pseudocode.md - Algorithms & Data Flow
1019
- - Architecture.md - System Design
1020
- - Refinement.md - Testing & Edge Cases
1021
- - Completion.md - Deployment & Operations
1022
- - Research_Findings.md - Market & Tech Research
1023
- - CLAUDE.md - AI Integration Guide
1024
- ```
486
+ **Output — `Final_Summary.md`:** title `[Product Name] - Executive Summary`; Overview (3–5
487
+ sentences); Problem & Solution; primary/secondary Target Users; MVP Features 1–3 with value;
488
+ Technical Approach (Architecture, Tech Stack, Key Differentiators); top 3–5 Research Highlights;
489
+ Success Metrics table:
490
+
491
+ | Metric | Target | Timeline | Источник значения |
492
+ |--------|--------|----------|-------------------|
493
+
494
+ **Every metric MUST name where its value comes from**, from a CLOSED list: `наш журнал` · `наша БД`
495
+ · `внешний API: <метод>` · `ручное измерение: <как>`. An empty cell and "из аналитики" are BLOCKERS,
496
+ not notes — measurability is otherwise decided by the SHAPE OF A NUMBER rather than by our ability to
497
+ OBTAIN it, so an unobtainable metric passes completeness, measurability and consistency with
498
+ distinction, and the feature gets designed around a promise nobody can keep. Manual measurement is a
499
+ legitimate answer; manual measurement presented as instrumented is not. A metric naming an external
500
+ API MUST produce a row in `## External Dependencies` — that inventory is the only route by which a
501
+ metric ever reaches a lens that looks outside these documents.
502
+
503
+ Then add Timeline table with MVP, v1.0, v2.0; Risks/Mitigations table; Immediate Next Steps Actions
504
+ 1–3; Documentation Package mapping every member: `PRD.md` Product Requirements,
505
+ `Solution_Strategy.md` Problem Analysis, `Specification.md` Detailed Requirements, `Pseudocode.md`
506
+ Algorithms & Data Flow, `Architecture.md` System Design, `Refinement.md` Testing & Edge Cases,
507
+ `Completion.md` Deployment & Operations, `Research_Findings.md` Market & Tech Research, `CLAUDE.md`
508
+ AI Integration Guide.
1025
509
 
1026
510
  ---
1027
511
 
1028
512
  ## Final Package Output
1029
513
 
1030
- ```
1031
- ═══════════════════════════════════════════════════════════════
1032
- 📦 SPARC DOCUMENTATION PACKAGE COMPLETE
1033
-
1034
- /output/[product-name]-sparc/
1035
- ├── PRD.md ✅ Product Requirements
1036
- ├── Solution_Strategy.md ✅ Problem Analysis
1037
- ├── Specification.md ✅ Detailed Requirements
1038
- ├── Pseudocode.md ✅ Algorithms & Data Flow
1039
- ├── Architecture.md ✅ System Design
1040
- ├── Refinement.md ✅ Testing & Edge Cases
1041
- ├── Completion.md ✅ Deployment & Operations
1042
- ├── Research_Findings.md ✅ Market & Tech Research
1043
- ├── Final_Summary.md ✅ Executive Summary
1044
- └── .claude/
1045
- └── CLAUDE.md ✅ AI Integration Guide
1046
-
1047
- Total: 11 files
1048
-
1049
- 🚀 READY FOR VIBE CODING
1050
-
1051
- [AUTO mode]: Все документы созданы автоматически
1052
- [MANUAL mode]: Все документы проверены на checkpoints
1053
- ═══════════════════════════════════════════════════════════════
1054
- ```
514
+ Report `📦 SPARC DOCUMENTATION PACKAGE COMPLETE`, path `/output/[product-name]-sparc/`, and the full
515
+ tree from **Output Documents (11 files)** with ✅ descriptions. End with `Total: 11 files`, `🚀 READY
516
+ FOR VIBE CODING`, then `[AUTO mode]: Все документы созданы автоматически` or `[MANUAL mode]: Все
517
+ документы проверены на checkpoints`.
1055
518
 
1056
519
  ---
1057
520
 
@@ -1114,7 +577,7 @@ sparc-prd-mini MANUAL
1114
577
 
1115
578
  **Actionability:**
1116
579
  - [ ] Каждое действие имеет owner и timeline
1117
- - [ ] Метрики успеха измеримы
580
+ - [ ] Метрики успеха измеримы И называют источник значения из закрытого списка
1118
581
  - [ ] Риски идентифицированы с mitigation планами
1119
582
 
1120
583
  ---
@@ -1137,23 +600,8 @@ sparc-prd-mini MANUAL
1137
600
 
1138
601
  При старте, если режим не указан:
1139
602
 
1140
- ```
1141
- ═══════════════════════════════════════════════════════════════
1142
- 🎯 SPARC PRD Mini v2 - Mode Selection
1143
-
1144
- Доступные режимы:
1145
-
1146
- 📌 AUTO — автономная генерация всех 11 документов
1147
- Быстро, без промежуточных остановок
1148
- Команда: "auto" / "автоматически"
1149
-
1150
- 📌 MANUAL — пошаговая генерация с checkpoint'ами
1151
- Контроль на каждой фазе, возможность коррекции
1152
- Команда: "manual" / "пошагово" / "с проверками"
1153
-
1154
- Какой режим предпочитаете?
1155
- ═══════════════════════════════════════════════════════════════
1156
- ```
603
+ Ask: `🎯 SPARC PRD Mini v2 — AUTO` (`auto`/`автоматически`: all 11 documents, no intermediate
604
+ stops) or `MANUAL` (`manual`/`пошагово`/`с проверками`: checkpoint each phase, corrections allowed)?
1157
605
 
1158
606
  ---
1159
607