@dzhechkov/keysarium 1.2.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/README.md +29 -11
  2. package/package.json +2 -2
  3. package/src/utils.js +1 -1
  4. package/templates/.claude/commands/brain-export.md +99 -20
  5. package/templates/.claude/commands/brain-import.md +75 -4
  6. package/templates/.claude/commands/bto-benchmark.md +302 -0
  7. package/templates/.claude/commands/harvest.md +28 -46
  8. package/templates/.claude/rules/trust-tiers.md +1 -0
  9. package/templates/.claude/skills/knowledge-extractor/SKILL.md +254 -0
  10. package/templates/.claude/skills/knowledge-extractor/modules/01-extract.md +188 -0
  11. package/templates/.claude/skills/knowledge-extractor/modules/02-classify.md +99 -0
  12. package/templates/.claude/skills/knowledge-extractor/modules/03-gate.md +150 -0
  13. package/templates/.claude/skills/knowledge-extractor/modules/04-integrate.md +159 -0
  14. package/templates/.claude/skills/knowledge-extractor/references/artifact-categories.md +100 -0
  15. package/templates/.claude/skills/knowledge-extractor/references/maturity-model.md +94 -0
  16. package/templates/.claude/skills/knowledge-extractor/references/quality-gates.md +98 -0
  17. package/templates/.claude/skills/knowledge-extractor/templates/artifact-card.md +63 -0
  18. package/templates/.claude/skills/knowledge-extractor/templates/harvest-report.md +102 -0
  19. package/templates/CLAUDE.md +42 -22
  20. package/templates/docs/continuous-learning-guide.md +622 -0
  21. package/templates/docs/feature-adr/01-architecture.md +750 -0
  22. package/templates/docs/feature-adr/02-functionality.md +712 -0
  23. package/templates/docs/feature-adr/03-deployment-guide.md +614 -0
  24. package/templates/docs/feature-adr/04-admin-guide.md +564 -0
  25. package/templates/docs/feature-adr/05-user-guide.md +508 -0
  26. package/templates/docs/feature-adr/06-user-flows.md +1101 -0
  27. package/templates/docs/improvement-directions.md +8 -4
  28. package/templates/docs/keysarium-core/01-architecture.md +559 -0
  29. package/templates/docs/keysarium-core/02-functionality.md +955 -0
  30. package/templates/docs/keysarium-core/03-deployment-guide.md +625 -0
  31. package/templates/docs/keysarium-core/04-admin-guide.md +529 -0
  32. package/templates/docs/keysarium-core/05-user-guide.md +599 -0
  33. package/templates/docs/keysarium-core/06-user-flows.md +804 -0
  34. package/templates/docs/skills-bto/01-deployment-guide.md +1 -1
  35. package/templates/docs/skills-bto/02-admin-guide.md +4 -1
  36. package/templates/docs/skills-bto/03-user-guide.md +4 -3
  37. package/templates/docs/skills-bto/04-infrastructure-requirements.md +2 -1
  38. package/templates/docs/skills-bto/05-architecture.md +11 -11
  39. package/templates/docs/skills-bto/06-user-flows.md +2 -1
  40. package/templates/lib/dream-engine.md +1 -1
  41. package/templates/lib/memory-protocol.md +131 -22
  42. package/templates/lib/reward-tracker.md +6 -3
@@ -0,0 +1,712 @@
1
+ # Функциональность @dzhechkov/skills-feature-adr
2
+
3
+ > Полный справочник по каждому из 9 шагов pipeline, reference-материалам и anti-patterns.
4
+
5
+ ## Содержание
6
+
7
+ 1. [Step 0: Complexity Router](#1-step-0-complexity-router)
8
+ 2. [Step 1: Requirements Gathering](#2-step-1-requirements-gathering)
9
+ 3. [Step 2: Research](#3-step-2-research)
10
+ 4. [Step 3: Architecture Decision Records](#4-step-3-architecture-decision-records)
11
+ 5. [Step 4: Domain-Driven Design](#5-step-4-domain-driven-design)
12
+ 6. [Step 5: Technical Architecture](#6-step-5-technical-architecture)
13
+ 7. [Step 6: Implementation Plan](#7-step-6-implementation-plan)
14
+ 8. [Step 7: Code Generation](#8-step-7-code-generation)
15
+ 9. [Step 8: Quality Engineering](#9-step-8-quality-engineering)
16
+ 10. [Reference Materials](#10-reference-materials)
17
+ 11. [Anti-Patterns](#11-anti-patterns)
18
+
19
+ ---
20
+
21
+ ## 1. Step 0: Complexity Router
22
+
23
+ **Tiers:** All | **Model:** haiku | **Time:** ~30 секунд | **Promise:** `FEATURE_ADR_ROUTED`
24
+
25
+ Классифицирует фичу в один из 4 тиров и определяет какие шаги активны.
26
+
27
+ ### 6 измерений оценки
28
+
29
+ | Измерение | 1 (S) | 2 (M) | 3 (L) | 4 (XL) |
30
+ |-----------|-------|-------|-------|--------|
31
+ | **Files Affected** | 1-3 | 4-10 | 11-30 | 30+ |
32
+ | **Domains Touched** | 1 | 1-2 | 2-4 | 4+ |
33
+ | **New Integrations** | 0 | 0-1 | 1-3 | 3+ |
34
+ | **Breaking Changes** | 0 | 0 | 0-2 | 2+ |
35
+ | **New Data Models** | 0 | 0-1 | 1-3 | 3+ |
36
+ | **Cross-Cutting Concerns** | 0 | 0-1 | 1-2 | 3+ |
37
+
38
+ Cross-cutting concerns: auth, logging, caching, i18n, error handling.
39
+
40
+ ### Scoring
41
+
42
+ | Tier | Score Range | Time Budget |
43
+ |------|-----------|-------------|
44
+ | **S** (Small) | 6-8 | ~15 min |
45
+ | **M** (Medium) | 9-13 | ~45 min |
46
+ | **L** (Large) | 14-19 | ~2 hours |
47
+ | **XL** (Extra Large) | 20-24 | 4+ hours |
48
+
49
+ ### Override Rules
50
+
51
+ 1. Любое измерение = 4 (XL) → минимум tier **L**
52
+ 2. Breaking changes > 0 → минимум tier **M**
53
+ 3. Слова "refactor", "migration", "redesign" → bias toward **L/XL**
54
+ 4. Пользователь может явно запросить tier
55
+
56
+ ### Step Activation Matrix
57
+
58
+ | Step | S | M | L | XL |
59
+ |------|---|---|---|-----|
60
+ | 0 Complexity Router | ✅ | ✅ | ✅ | ✅ |
61
+ | 1 Requirements | ✅ (light) | ✅ | ✅ | ✅ |
62
+ | 2 Research | — | — | ✅ | ✅ |
63
+ | 3 ADR | — | ✅ (1 ADR) | ✅ (N ADRs) | ✅ (N ADRs) |
64
+ | 4 DDD | — | — | ✅ | ✅ |
65
+ | 5 Architecture | — | ✅ (light) | ✅ (full) | ✅ (full) |
66
+ | 6 Implementation Plan | ✅ (inline) | ✅ | ✅ | ✅ |
67
+ | 7 Code | ✅ | ✅ | ✅ | ✅ (parallel) |
68
+ | 8 QE | ✅ (smoke) | ✅ (unit+review) | ✅ (unit+integ+review) | ✅ (full+panel) |
69
+
70
+ ### Time Budget Distribution (R/P/I/Q = Requirements/Planning/Implementation/QE)
71
+
72
+ | Tier | R | P | I | Q | Total |
73
+ |------|---|---|---|---|-------|
74
+ | S | 2 min | 0 | 10 min | 3 min | 15 min |
75
+ | M | 5 min | 10 min | 20 min | 10 min | 45 min |
76
+ | L | 15 min | 30 min | 45 min | 30 min | 2 hours |
77
+ | XL | 30 min | 60 min | 90 min | 60 min | 4 hours |
78
+
79
+ ### Output
80
+
81
+ - **Файл:** `00_complexity_assessment.md`
82
+ - **Содержит:** dimension scores, total score, tier, override justification, active steps, time budget
83
+
84
+ ---
85
+
86
+ ## 2. Step 1: Requirements Gathering
87
+
88
+ **Tiers:** All | **Model:** sonnet | **Promise:** `FEATURE_ADR_REQUIREMENTS_GATHERED`
89
+
90
+ ### Процесс
91
+
92
+ 1. **Загрузить `explore` skill** для M/L/XL (для S — пропуск)
93
+ 2. **Stakeholders** — end user, developer consumer, approver
94
+ 3. **Functional Requirements** — FR-N с acceptance criteria (Given/When/Then)
95
+ 4. **Non-Functional Requirements** (M+ only) — performance, security, scalability, compatibility, accessibility
96
+ 5. **Constraints** — technical, business, organizational
97
+ 6. **Scope Boundaries** — in scope / out of scope / dependencies / dependents
98
+ 7. **Open Questions** — что требует уточнения
99
+
100
+ ### Глубина по тирам
101
+
102
+ | Tier | Подход |
103
+ |------|--------|
104
+ | S | 3-5 bullet points inline, без файла |
105
+ | M/L/XL | Полный structured document `01_requirements.md` |
106
+
107
+ ### Пример FR
108
+
109
+ ```markdown
110
+ ### FR-1: Уведомление о новом заказе
111
+
112
+ **Given** пользователь подписан на уведомления
113
+ **When** создаётся новый заказ
114
+ **Then** пользователь получает push-уведомление в течение 5 секунд
115
+ ```
116
+
117
+ ### Output
118
+
119
+ - **Файл:** `01_requirements.md` (или inline для S-tier)
120
+ - **Variable:** `{REQUIREMENTS}`
121
+
122
+ ---
123
+
124
+ ## 3. Step 2: Research
125
+
126
+ **Tiers:** L/XL only | **Model:** sonnet | **Agents:** 2 parallel
127
+
128
+ ### 2 параллельных потока
129
+
130
+ #### Agent 1 — Codebase Pattern Research
131
+
132
+ - Поиск похожих features в кодовой базе
133
+ - Идентификация established patterns
134
+ - Каталогизация shared utilities/services
135
+ - Документирование test patterns
136
+ - Data access patterns
137
+
138
+ #### Agent 2 — External Pattern Research
139
+
140
+ - Industry solutions & best practices
141
+ - Framework conventions & recommendations
142
+ - Доступные библиотеки с trade-offs
143
+ - Known anti-patterns
144
+
145
+ ### Synthesis
146
+
147
+ Результаты объединяются в Pattern Summary:
148
+ - Recommended approach vs alternatives
149
+ - Library evaluation
150
+ - Anti-patterns to avoid
151
+ - Clear recommendation с rationale
152
+
153
+ ### Output
154
+
155
+ - **Файл:** `02_research.md`
156
+ - **Variable:** `{RESEARCH_FINDINGS}`
157
+
158
+ ---
159
+
160
+ ## 4. Step 3: Architecture Decision Records
161
+
162
+ **Tiers:** M+ only | **Model:** opus | **Promise (совместно с Steps 2-5):** `FEATURE_ADR_DESIGNED`
163
+
164
+ ### Сигналы для ADR
165
+
166
+ - Technology choice (database, queue, framework)
167
+ - Pattern choice (Repository vs Active Record)
168
+ - Integration strategy (REST vs GraphQL vs gRPC)
169
+ - Data modeling (normalized vs denormalized)
170
+ - Deployment strategy (monolith vs microservice)
171
+ - Trade-off decisions (consistency vs availability)
172
+
173
+ ### ADR Template
174
+
175
+ ```markdown
176
+ # ADR-001: {Decision Title}
177
+
178
+ ## Status
179
+ Proposed | Accepted | Superseded
180
+
181
+ ## Context
182
+ {Problem space — NOT solution}
183
+
184
+ ## Decision Drivers
185
+ - {Constraint 1}
186
+ - {Constraint 2}
187
+
188
+ ## Considered Options
189
+ ### Option A: {Name}
190
+ - ✅ Pro 1
191
+ - ❌ Con 1
192
+
193
+ ### Option B: {Name}
194
+ - ✅ Pro 1
195
+ - ❌ Con 1
196
+
197
+ ## Decision Matrix
198
+ | Criterion | Weight | Option A | Option B |
199
+ |-----------|--------|----------|----------|
200
+ | Performance | 0.3 | 8 | 6 |
201
+ | Simplicity | 0.3 | 7 | 9 |
202
+ | Extensibility | 0.4 | 9 | 5 |
203
+ | **Weighted** | | **8.1** | **6.5** |
204
+
205
+ ## Decision
206
+ {Chosen option} — because {1-2 sentence rationale}
207
+
208
+ ## Consequences
209
+ ### Positive
210
+ - {Benefit}
211
+ ### Negative
212
+ - {Tradeoff}
213
+ ### Risks
214
+ - {Risk} → Mitigation: {mitigation}
215
+
216
+ ## Links
217
+ - Requirement: FR-{N}
218
+ - Related: ADR-{M}
219
+ ```
220
+
221
+ ### Глубина по тирам
222
+
223
+ | Tier | Количество ADR |
224
+ |------|---------------|
225
+ | M | 1 ADR для главного решения |
226
+ | L/XL | N ADR для каждого значимого решения |
227
+
228
+ ### Anti-Patterns (блокирующие)
229
+
230
+ | Pattern | Действие |
231
+ |---------|---------|
232
+ | Только 1 option в ADR | **BLOCK** — минимум 2 альтернативы |
233
+ | Нет consequences | **BLOCK** — обязательны |
234
+ | Decision без context | **BLOCK** — контекст = проблема, не решение |
235
+ | Premature optimization | **FLAG** — warn |
236
+
237
+ ### Output
238
+
239
+ - **Директория:** `03_adr/001-{decision-slug}.md`, `002-*.md`, ...
240
+ - **Variable:** `{ADR_DECISIONS}`
241
+
242
+ ---
243
+
244
+ ## 5. Step 4: Domain-Driven Design
245
+
246
+ **Tiers:** L/XL only | **Model:** opus
247
+
248
+ ### Компоненты DDD
249
+
250
+ #### Bounded Contexts
251
+
252
+ Определяются по:
253
+ - Разные stakeholders
254
+ - Разные data lifecycles
255
+ - Разные ubiquitous languages
256
+ - Shared data с разной семантикой
257
+
258
+ #### Ubiquitous Language
259
+
260
+ Точные определения терминов для каждого контекста:
261
+ ```
262
+ Order (e-commerce context): A customer's purchase request
263
+ Order (fulfillment context): A shipment instruction
264
+ NOT confused with: Invoice, Quote
265
+ ```
266
+
267
+ #### Aggregates & Entities
268
+
269
+ - Consistency boundaries
270
+ - Identity definitions
271
+ - Domain events
272
+
273
+ #### Relationships
274
+
275
+ | Тип | Описание |
276
+ |-----|---------|
277
+ | Shared Kernel | Общая модель между контекстами |
278
+ | Customer-Supplier | Downstream зависит от upstream |
279
+ | Conformist | Downstream полностью следует upstream |
280
+ | Anti-Corruption Layer | Изолирующий адаптер |
281
+ | Open Host Service | Публичный API для потребителей |
282
+
283
+ #### Codebase Compatibility Check
284
+
285
+ - Проверка naming conflicts
286
+ - ORM compatibility
287
+ - Pattern alignment
288
+
289
+ ### Output
290
+
291
+ - **Файлы:** `04_domain_model.md` + `diagrams/domain-model.mermaid`
292
+ - **Variable:** `{DOMAIN_MODEL}`
293
+
294
+ ---
295
+
296
+ ## 6. Step 5: Technical Architecture
297
+
298
+ **Tiers:** M+ only | **Model:** opus
299
+
300
+ ### C4 Levels
301
+
302
+ #### Level 1 — System Context (L/XL only)
303
+
304
+ ```mermaid
305
+ graph TD
306
+ U[User] --> S[Your System]
307
+ S --> E1[External System 1]
308
+ S --> E2[External System 2]
309
+ ```
310
+
311
+ - Actors/users
312
+ - Your system (центр)
313
+ - External systems
314
+ - Trust boundaries
315
+
316
+ #### Level 2 — Container Diagram (L/XL only)
317
+
318
+ - Technical building blocks (web app, API, database, queue, cache)
319
+ - Technologies (React, Node.js, PostgreSQL, Redis)
320
+ - Interactions
321
+
322
+ #### Level 3 — Component Diagram (M/L/XL)
323
+
324
+ - Components внутри affected container
325
+ - Responsibilities
326
+ - Dependencies
327
+
328
+ ### Sequence Diagrams (L/XL)
329
+
330
+ - Happy path flow
331
+ - Main error flow
332
+ - Async flow (if applicable)
333
+
334
+ ### Дополнительно (L/XL)
335
+
336
+ - **Data flow & storage** — new tables, migrations, schema changes
337
+ - **API design** — endpoints, request/response schemas, error codes
338
+
339
+ ### Глубина по тирам
340
+
341
+ | Tier | Что включается |
342
+ |------|---------------|
343
+ | M | Component diagram only |
344
+ | L/XL | Full C4 (L1+L2+L3) + sequence diagrams + data/API design |
345
+
346
+ ### Output
347
+
348
+ - **Файлы:** `05_architecture.md` + `diagrams/architecture-c4.mermaid`, `diagrams/sequence-*.mermaid`
349
+ - **Variable:** `{ARCHITECTURE}`
350
+
351
+ ---
352
+
353
+ ## 7. Step 6: Implementation Plan
354
+
355
+ **Tiers:** All | **Model:** sonnet | **Promise:** `FEATURE_ADR_PLANNED`
356
+
357
+ ### Task Format
358
+
359
+ ```
360
+ TASK-N: {Title}
361
+ Description: {What to do}
362
+ Files: {Files affected}
363
+ Depends on: TASK-M (or none)
364
+ Test: {How to verify}
365
+ ```
366
+
367
+ ### Task Properties
368
+
369
+ - **Independent** — reviewable/testable in isolation
370
+ - **Completable** — produces working code, not half-done
371
+ - **Testable** — clear done criteria
372
+
373
+ ### Dependency Graph
374
+
375
+ Valid DAG (no cycles). Задачи организуются в **parallel groups** — группы независимых задач, которые можно выполнять одновременно.
376
+
377
+ ```
378
+ Group 1: TASK-1, TASK-2 (independent)
379
+ ↓
380
+ Group 2: TASK-3 (depends on TASK-1), TASK-4 (depends on TASK-2)
381
+ ↓
382
+ Group 3: TASK-5 (depends on TASK-3 + TASK-4)
383
+ ```
384
+
385
+ ### Checkpoints между группами для верификации промежуточного прогресса.
386
+
387
+ ### Risk Assessment (L/XL only)
388
+
389
+ - Blockers — что может заблокировать
390
+ - Fallbacks — запасные варианты
391
+ - External dependencies — внешние зависимости
392
+
393
+ ### Глубина по тирам
394
+
395
+ | Tier | Подход |
396
+ |------|--------|
397
+ | S | Inline checklist (3-5 items, без файла) |
398
+ | M/L/XL | Full structured document |
399
+
400
+ ### Output
401
+
402
+ - **Файл:** `06_implementation_plan.md`
403
+ - **Variable:** `{IMPL_PLAN}`
404
+
405
+ ---
406
+
407
+ ## 8. Step 7: Code Generation
408
+
409
+ **Tiers:** All | **Model:** opus | **Promise:** `FEATURE_ADR_IMPLEMENTED`
410
+
411
+ ### Pre-Implementation Checklist
412
+
413
+ - [ ] Read similar implementations in codebase
414
+ - [ ] Identify naming conventions
415
+ - [ ] Study import patterns
416
+ - [ ] Document error handling patterns
417
+ - [ ] Review test patterns
418
+
419
+ ### Execution Strategy
420
+
421
+ 1. Для каждой задачи из плана:
422
+ - Read existing files to be modified
423
+ - Implement following existing patterns
424
+ - Verify against architecture diagram
425
+ - Verify against ADR decisions
426
+ 2. **L/XL:** parallel agents per module/domain
427
+ 3. After all agents: verify integration points, fix mismatches, run existing tests
428
+
429
+ ### Code Quality Rules
430
+
431
+ 1. Follow existing patterns (consistency > novelty)
432
+ 2. No over-engineering
433
+ 3. No premature abstraction
434
+ 4. Handle errors at boundaries only
435
+ 5. Self-documenting code > comments
436
+ 6. Respect ADR decisions
437
+
438
+ ### Change Manifest
439
+
440
+ Отслеживает все файлы: created / modified / deleted.
441
+
442
+ ### Глубина по тирам
443
+
444
+ | Tier | Подход |
445
+ |------|--------|
446
+ | S | Single-pass implementation |
447
+ | M | Sequential with checkpoints |
448
+ | L/XL | Parallel agents per module |
449
+
450
+ ### Output
451
+
452
+ - **Фактические изменения кода** в репозитории
453
+ - **Файл:** `07_code_changes/change_manifest.md`
454
+ - **Variable:** `{CODE_CHANGES}`
455
+
456
+ ---
457
+
458
+ ## 9. Step 8: Quality Engineering
459
+
460
+ **Tiers:** All | **Model:** sonnet | **Promise:** `FEATURE_ADR_VERIFIED`
461
+
462
+ ### Phase 1: Smoke Tests (All tiers)
463
+
464
+ - [ ] Code compiles / no syntax errors
465
+ - [ ] Existing test suite passes (no regressions)
466
+ - [ ] Linter passes (if configured)
467
+ - [ ] Type checker passes (if configured)
468
+
469
+ **Для S-tier:** если Phase 1 passed → done.
470
+
471
+ ### Phase 2: Test Generation (M+)
472
+
473
+ #### Unit Tests
474
+
475
+ - Happy path
476
+ - Edge cases
477
+ - Error scenarios
478
+
479
+ #### Integration Tests (L/XL)
480
+
481
+ - API endpoints
482
+ - Database operations
483
+ - Queue interactions
484
+ - External service mocks
485
+
486
+ #### E2E Tests (XL only)
487
+
488
+ - Complete user journeys
489
+ - Realistic data volumes
490
+ - Failure scenarios
491
+
492
+ ### Phase 3: Code Review (M+)
493
+
494
+ #### 5 Review Dimensions
495
+
496
+ | Dimension | Weight | Что проверяется |
497
+ |-----------|--------|----------------|
498
+ | Correctness | 30% | Requirements covered? Edge cases? |
499
+ | Security | 20% | Injection, auth, data exposure? |
500
+ | Maintainability | 20% | Readable, patterns, future-proof? |
501
+ | Performance | 15% | N+1 queries? Unnecessary allocations? |
502
+ | Consistency | 15% | Conventions? Naming? |
503
+
504
+ #### 4 Severity Levels
505
+
506
+ | Level | Symbol | Meaning |
507
+ |-------|--------|---------|
508
+ | BLOCKER | 🔴 | Must fix before merge |
509
+ | WARNING | 🟡 | Should fix, not blocking |
510
+ | SUGGESTION | 🔵 | Nice to have |
511
+ | PRAISE | 🟢 | Well done |
512
+
513
+ ### Phase 4: Multi-Agent Review Panel (XL only)
514
+
515
+ 3 параллельных агента (sonnet):
516
+
517
+ | Agent | Focus |
518
+ |-------|-------|
519
+ | Correctness Reviewer | Requirements coverage, logic errors |
520
+ | Security Reviewer | OWASP top 10, auth, data protection |
521
+ | Architecture Reviewer | Pattern compliance, ADR adherence |
522
+
523
+ ### Phase 5: Acceptance Criteria Validation
524
+
525
+ Для каждого FR-N из Step 1:
526
+
527
+ | Requirement | Status | Evidence |
528
+ |------------|--------|---------|
529
+ | FR-1 | ✅ PASS | Unit test `test_notification_sent` |
530
+ | FR-2 | ❌ FAIL | Missing error handling |
531
+ | FR-3 | ⚠️ PARTIAL | Works for push, not email |
532
+
533
+ ### QE Report
534
+
535
+ ```markdown
536
+ # QE Report
537
+
538
+ ## Summary
539
+ - Tests: 42/45 passed
540
+ - Findings: 0 🔴, 2 🟡, 3 🔵, 5 🟢
541
+ - Requirements: 8/10 PASS, 1 PARTIAL, 1 FAIL
542
+
543
+ ## Verdict: ⚠️ CONDITIONAL
544
+ Fix FR-2 error handling before merge.
545
+ ```
546
+
547
+ #### Verdicts
548
+
549
+ | Verdict | Meaning |
550
+ |---------|---------|
551
+ | ✅ READY | All tests pass, no blockers, all requirements met |
552
+ | ❌ NEEDS FIXES | Blockers found, must fix |
553
+ | ⚠️ CONDITIONAL | Minor issues, can merge with tracked follow-ups |
554
+
555
+ ### Глубина по тирам
556
+
557
+ | Tier | Scope |
558
+ |------|-------|
559
+ | S | Smoke tests only |
560
+ | M | Unit tests + basic review |
561
+ | L | Unit + integration + thorough review |
562
+ | XL | Full QE (all tests + security + performance + review panel) |
563
+
564
+ ### Output
565
+
566
+ - **Файл:** `08_qe_report.md`
567
+ - **Variable:** `{QE_RESULTS}`
568
+
569
+ ---
570
+
571
+ ## 10. Reference Materials
572
+
573
+ ### 10.1. complexity-matrix.md
574
+
575
+ Справочник по скорингу Complexity Router:
576
+ - Dimension scoring guide для каждого из 6 измерений
577
+ - Step activation matrix для каждого тира
578
+ - Quick decision tree
579
+
580
+ ### 10.2. adr-template.md
581
+
582
+ Полный шаблон ADR с секциями:
583
+ - Status, Context, Decision Drivers, Considered Options, Decision Matrix, Decision, Consequences, Links
584
+ - ADR numbering convention (001-*.md)
585
+ - Quality checklist
586
+
587
+ ### 10.3. c4-template.md
588
+
589
+ Шаблоны Mermaid-диаграмм для:
590
+ - Level 1 (System Context)
591
+ - Level 2 (Container)
592
+ - Level 3 (Component)
593
+ - Sequence diagrams
594
+ - Tips for effective diagrams
595
+
596
+ ### 10.4. qe-checklist.md
597
+
598
+ - Pre-implementation shift-left checks
599
+ - During-implementation continuous checks
600
+ - Post-implementation checklist: correctness, security (OWASP-aligned), performance, maintainability, compatibility
601
+ - Review severity guide
602
+ - Tier-specific depth table
603
+
604
+ ---
605
+
606
+ ## 11. Anti-Patterns
607
+
608
+ ### Блокирующие
609
+
610
+ | Pattern | Detection | Action |
611
+ |---------|-----------|--------|
612
+ | Skip Step 0 | Jump to coding without classification | **BLOCK** |
613
+ | Skip Step 6 | Code without implementation plan | **BLOCK** |
614
+ | Skip Step 8 | Ship without QE | **BLOCK** |
615
+ | ADR with 1 option | No alternatives considered | **BLOCK** |
616
+ | No consequences in ADR | Decision without impact analysis | **BLOCK** |
617
+ | Code without ADR (M+) | Architecture without decisions | **BLOCK** |
618
+
619
+ ### Предупреждающие
620
+
621
+ | Pattern | Detection | Action |
622
+ |---------|-----------|--------|
623
+ | Over-engineer S-tier | Full pipeline for config change | **FLAG** during Router |
624
+ | Under-engineer XL | Skip ADR/DDD for major refactor | **FLAG** during Router |
625
+ | Decision without context | ADR starts from solution | **FLAG** |
626
+ | Premature optimization | Optimizing before profiling | **FLAG** |
627
+
628
+ ---
629
+
630
+ ## Cross-Step Variables
631
+
632
+ Полный реестр переменных, передаваемых между шагами:
633
+
634
+ | Variable | Set In | Used In | Type |
635
+ |----------|--------|---------|------|
636
+ | `{COMPLEXITY_TIER}` | Step 0 | All | S / M / L / XL |
637
+ | `{ACTIVE_STEPS}` | Step 0 | Orchestrator | list[int] |
638
+ | `{TIME_BUDGET}` | Step 0 | All | dict |
639
+ | `{REQUIREMENTS}` | Step 1 | Steps 2-8 | structured |
640
+ | `{RESEARCH_FINDINGS}` | Step 2 | Steps 3-5 | structured |
641
+ | `{ADR_DECISIONS}` | Step 3 | Steps 4-7 | list[ADR] |
642
+ | `{DOMAIN_MODEL}` | Step 4 | Steps 5-7 | structured |
643
+ | `{ARCHITECTURE}` | Step 5 | Steps 6-7 | structured |
644
+ | `{IMPL_PLAN}` | Step 6 | Step 7 | list[task] |
645
+ | `{CODE_CHANGES}` | Step 7 | Step 8 | list[file] |
646
+ | `{QE_RESULTS}` | Step 8 | Final report | structured |
647
+
648
+ ---
649
+
650
+ ## DAG выполнения
651
+
652
+ ### S-Tier (linear)
653
+
654
+ ```
655
+ Step 0 → Step 1 → Step 6 → Step 7 → Step 8
656
+ ```
657
+
658
+ ### M-Tier (linear)
659
+
660
+ ```
661
+ Step 0 → Step 1 → Step 3 → Step 5 → Step 6 → Step 7 → Step 8
662
+ ```
663
+
664
+ ### L-Tier (parallel pairs)
665
+
666
+ ```mermaid
667
+ graph LR
668
+ S0[Step 0] --> S1[Step 1]
669
+ S1 --> S2[Step 2]
670
+ S1 --> S3[Step 3]
671
+ S2 --> S4[Step 4]
672
+ S3 --> S4
673
+ S2 --> S5[Step 5]
674
+ S3 --> S5
675
+ S4 --> S5
676
+ S5 --> S6[Step 6]
677
+ S6 --> S7[Step 7]
678
+ S7 --> S8[Step 8]
679
+ ```
680
+
681
+ ### XL-Tier (full DAG + multi-agent)
682
+
683
+ ```mermaid
684
+ graph LR
685
+ S0[Step 0] --> S1[Step 1]
686
+ S1 --> S2[Step 2<br/>2 agents]
687
+ S1 --> S3[Step 3<br/>N ADRs]
688
+ S2 --> S4[Step 4]
689
+ S3 --> S4
690
+ S2 --> S5[Step 5]
691
+ S3 --> S5
692
+ S4 --> S5
693
+ S5 --> S6[Step 6]
694
+ S6 --> S7[Step 7<br/>N agents per module]
695
+ S7 --> S8[Step 8<br/>3-agent review panel]
696
+ ```
697
+
698
+ ---
699
+
700
+ ## Model Routing
701
+
702
+ | Step | Model | Rationale |
703
+ |------|-------|-----------|
704
+ | 0 Complexity Router | haiku | Simple classification |
705
+ | 1 Requirements | sonnet | Analytical requirements |
706
+ | 2 Research | sonnet | Research synthesis |
707
+ | 3 ADR | opus | Complex trade-off reasoning |
708
+ | 4 DDD | opus | Domain modeling |
709
+ | 5 Architecture | opus | System design |
710
+ | 6 Implementation Plan | sonnet | Task decomposition |
711
+ | 7 Code | opus | Code generation |
712
+ | 8 QE | sonnet | Review and testing |