@zrg-sh/studio 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/LICENSE +21 -0
  2. package/ONBOARDING.html +270 -0
  3. package/README.md +82 -0
  4. package/bin/zrg-studio.mjs +67 -0
  5. package/package.json +29 -0
  6. package/src/commands/doctor.mjs +60 -0
  7. package/src/commands/init.mjs +44 -0
  8. package/src/lib/copy-template.mjs +42 -0
  9. package/src/lib/merge-claude-settings.mjs +54 -0
  10. package/template/.claude/agents/studio-analyst.md +109 -0
  11. package/template/.claude/agents/studio-designer.md +172 -0
  12. package/template/.claude/agents/studio-domain-framer.md +109 -0
  13. package/template/.claude/agents/studio-domain-merger.md +264 -0
  14. package/template/.claude/agents/studio-pm.md +169 -0
  15. package/template/.claude/agents/studio-reviewer.md +156 -0
  16. package/template/.claude/agents/studio-scenario-writer.md +152 -0
  17. package/template/.claude/commands/studio-analyst.md +45 -0
  18. package/template/.claude/commands/studio-designer.md +34 -0
  19. package/template/.claude/commands/studio-domain-framer.md +30 -0
  20. package/template/.claude/commands/studio-onboard.md +98 -0
  21. package/template/.claude/commands/studio-pm.md +39 -0
  22. package/template/.claude/commands/studio-scenario-writer.md +44 -0
  23. package/template/product-specs/CLAUDE.md +53 -0
  24. package/template/product-specs/agents/studio-analyst.md +109 -0
  25. package/template/product-specs/agents/studio-codebase-mapper.md +217 -0
  26. package/template/product-specs/agents/studio-conflict-resolver.md +169 -0
  27. package/template/product-specs/agents/studio-designer.md +172 -0
  28. package/template/product-specs/agents/studio-domain-extractor.md +365 -0
  29. package/template/product-specs/agents/studio-domain-framer.md +109 -0
  30. package/template/product-specs/agents/studio-domain-interviewer.md +246 -0
  31. package/template/product-specs/agents/studio-domain-merger.md +264 -0
  32. package/template/product-specs/agents/studio-god.md +779 -0
  33. package/template/product-specs/agents/studio-meta-god.md +335 -0
  34. package/template/product-specs/agents/studio-pm.md +169 -0
  35. package/template/product-specs/agents/studio-reviewer.md +156 -0
  36. package/template/product-specs/agents/studio-scenario-writer.md +152 -0
  37. package/template/product-specs/agents/studio-verifier.md +222 -0
  38. package/template/product-specs/docs/_meta/capability-map.example.md +103 -0
  39. package/template/product-specs/docs/_meta/doc-schema.md +134 -0
  40. package/template/product-specs/docs/_meta/domain-map.example.md +106 -0
  41. package/template/product-specs/docs/_meta/glossary.example.md +72 -0
  42. package/template/product-specs/docs/_meta/onboarding.example.md +142 -0
  43. package/template/product-specs/docs/_meta/product-vision.example.md +136 -0
  44. package/template/product-specs/hooks/studio-conflict-detect.sh +59 -0
  45. package/template/product-specs/hooks/studio-context-monitor.js +37 -0
  46. package/template/product-specs/hooks/studio-domain-guard.sh +40 -0
  47. package/template/product-specs/hooks/studio-prompt-guard.js +36 -0
  48. package/template/product-specs/hooks/studio-session-state.sh +55 -0
  49. package/template/product-specs/hooks/studio-stage-gate.sh +180 -0
  50. package/template/product-specs/references/checkpoints.md +27 -0
  51. package/template/product-specs/references/ddd-conventions.md +38 -0
  52. package/template/product-specs/references/gates.md +50 -0
  53. package/template/product-specs/references/model-profiles.md +28 -0
  54. package/template/product-specs/references/obsidian-conventions.md +51 -0
  55. package/template/product-specs/references/stage-pipeline.md +65 -0
  56. package/template/product-specs/rules/change-management.md +159 -0
  57. package/template/product-specs/rules/docs-conventions.md +81 -0
  58. package/template/product-specs/rules/domain-conventions.md +69 -0
  59. package/template/product-specs/rules/id-numbering.md +51 -0
  60. package/template/product-specs/rules/obsidian-conventions.md +51 -0
  61. package/template/product-specs/templates/change/01-intent.md +40 -0
  62. package/template/product-specs/templates/change/02-scenarios.md +66 -0
  63. package/template/product-specs/templates/change/03-analysis.md +64 -0
  64. package/template/product-specs/templates/change/04-domain.md +47 -0
  65. package/template/product-specs/templates/change/05-ux.md +46 -0
  66. package/template/product-specs/templates/change/metadata.yaml +26 -0
  67. package/template/product-specs/templates/config.json +19 -0
  68. package/template/product-specs/templates/domain/README.md +31 -0
  69. package/template/product-specs/templates/domain/aggregates.md +37 -0
  70. package/template/product-specs/templates/domain/api-contracts.md +29 -0
  71. package/template/product-specs/templates/domain/business-rules.md +30 -0
  72. package/template/product-specs/templates/domain/changelog.md +25 -0
  73. package/template/product-specs/templates/domain/data-model.md +34 -0
  74. package/template/product-specs/templates/domain/events.md +24 -0
  75. package/template/product-specs/templates/domain/integrations.md +27 -0
  76. package/template/product-specs/templates/domain/invariants.md +14 -0
  77. package/template/product-specs/templates/domain/links.yaml +20 -0
  78. package/template/product-specs/templates/domain/operational-sla.md +32 -0
  79. package/template/product-specs/templates/domain/ownership.md +13 -0
  80. package/template/product-specs/templates/domain/scenarios.md +65 -0
  81. package/template/product-specs/templates/domain/surfaces.md +51 -0
  82. package/template/product-specs/templates/domain/ubiquitous-language.md +12 -0
  83. package/template/product-specs/templates/meta/capability-map.md +55 -0
  84. package/template/product-specs/templates/meta/doc-schema.md +134 -0
  85. package/template/product-specs/templates/meta/domain-map.md +67 -0
  86. package/template/product-specs/templates/meta/glossary.md +30 -0
  87. package/template/product-specs/templates/meta/onboarding.md +108 -0
  88. package/template/product-specs/templates/state.md +19 -0
  89. package/template/product-specs/workflows/conflict-resolution.md +10 -0
  90. package/template/product-specs/workflows/domain-update.md +15 -0
  91. package/template/product-specs/workflows/map-codebase.md +17 -0
  92. package/template/product-specs/workflows/onboard-project.md +575 -0
  93. package/template/product-specs/workflows/pipeline-full.md +258 -0
  94. package/template/product-specs/workflows/pipeline-resume.md +21 -0
  95. package/template/product-specs/workflows/verify-change.md +12 -0
@@ -0,0 +1,81 @@
1
+ ---
2
+ paths:
3
+ - "docs/**"
4
+ ---
5
+
6
+ # Documentation conventions
7
+
8
+ ## File naming
9
+ - Файлы: kebab-case на английском (`business-rules.md`, `ubiquitous-language.md`)
10
+ - Папки доменов: kebab-case (`training-session`, `scenario-catalog`)
11
+ - Change packages: `PRDCT-XXXX` (четырёхзначный номер)
12
+ - НЕ называть файлы `index.md` — Obsidian graph показывает имя файла. Используй осмысленные имена (`domains-dashboard.md`, `changes-dashboard.md`)
13
+ - Файлы внутри PRDCT-папок: по шаблону (`01-discovery.md`, `02-product-spec.md`, ...)
14
+
15
+ ## Heading hierarchy
16
+ - H1 (`#`) — только один на файл, название документа
17
+ - H2 (`##`) — основные секции
18
+ - H3 (`###`) — подсекции
19
+ - H4+ — не использовать без необходимости
20
+
21
+ ## YAML frontmatter (ОБЯЗАТЕЛЬНО)
22
+ Каждый .md файл в docs/ ДОЛЖЕН иметь frontmatter:
23
+ ```yaml
24
+ ---
25
+ type: domain | change | adr | meta | aggregate | events | invariants | business-rules | ubiquitous-language | integrations | ownership | index
26
+ domain: training-session # если файл относится к домену
27
+ status: draft | active | accepted | deprecated
28
+ tags:
29
+ - domain/training-session # nested tag = домен
30
+ - aggregate # тип документа
31
+ owner: team-name
32
+ created: YYYY-MM-DD
33
+ ---
34
+ ```
35
+
36
+ ## Tags (nested hierarchy)
37
+ ```
38
+ #domain/<name> — принадлежность к домену
39
+ #change/PRDCT-XXXX — принадлежность к change package
40
+ #status/<state> — текущий статус
41
+ #adr/ADR-XXX — ссылка на ADR
42
+ #aggregate, #event, #invariant, #business-rule — тип документа
43
+ ```
44
+
45
+ ## Links & references
46
+ - Между документами vault: wikilinks `[[path/to/file]]`
47
+ - Внешние URL: markdown `[text](https://url)`
48
+ - Embeds (встраивание содержимого): `![[file]]`
49
+ - Block references: `[[file#^block-id]]`
50
+
51
+ ## Callouts (семантическая разметка)
52
+ - `> [!danger]` — инварианты (НЕЛЬЗЯ нарушить)
53
+ - `> [!warning]` — corner cases, breaking changes, риски
54
+ - `> [!info]` — business rules, контекст, пояснения
55
+ - `> [!bug]` — edge cases, известные проблемы
56
+ - `> [!question]` — открытые вопросы
57
+ - `> [!tip]` — рекомендации, живые дашборды
58
+ - `> [!example]` — примеры использования
59
+
60
+ ## Mermaid diagrams
61
+ - `stateDiagram-v2` — в aggregates.md (state machine агрегата)
62
+ - `erDiagram` — в aggregates.md (структура данных)
63
+ - `sequenceDiagram` — в events.md (flow событий между consumers)
64
+ - `graph` — в integrations.md (карта upstream/downstream зависимостей)
65
+ - `mindmap` — в capability-map.md (дерево возможностей)
66
+ - `gantt` — в rollout.md (таймлайн раскатки)
67
+
68
+ ## Dataview queries
69
+ - Для живых дашбордов в index/dashboard файлах
70
+ - Запросы строятся по frontmatter полям (type, domain, status, tags)
71
+ - НЕ дублировать данные руками — если можно собрать dataview, собирай dataview
72
+
73
+ ## Tables
74
+ - Всегда с заголовками
75
+ - Пустые ячейки: `—` (не пусто)
76
+
77
+ ## Status tracking
78
+ - Статус документа: в frontmatter `status:` И в metadata.yaml для change packages
79
+ - Допустимые статусы change: `draft | discovery | spec | analysis | in-progress | done`
80
+ - Допустимые статусы domain: `draft | active | deprecated`
81
+ - Допустимые статусы ADR: `proposed | accepted | deprecated | superseded`
@@ -0,0 +1,69 @@
1
+ ---
2
+ paths:
3
+ - "product-specs/docs/domains/**"
4
+ ---
5
+
6
+ # Domain modeling rules
7
+
8
+ ## Aggregate rules
9
+ - Агрегат = граница консистентности
10
+ - Один агрегат — одна транзакция
11
+ - Ссылки между агрегатами — только по ID
12
+ - Если данные нужны из другого домена — это ref, а не вложение
13
+
14
+ ### Здоровье агрегатов (не лимиты, а сигналы)
15
+ - 0 агрегатов в домене → это не домен, а словарь. Не создавай домен без агрегата
16
+ - Количество агрегатов не ограничено — 50 норм если каждый имеет чёткую ответственность
17
+ - **God-aggregate detector:** если агрегат имеет > 15 полей или > 7 состояний → задать вопрос: "Это точно один агрегат или тут два склеенных?"
18
+ - Агрегат с 1 полем → скорее всего value object, а не агрегат
19
+ - **Ключевой тест:** можно ли объяснить ответственность агрегата одним предложением? Если нет — разбивать
20
+
21
+ ## Ubiquitous language
22
+ - Каждый термин определён ровно в одном домене
23
+ - Forbidden synonyms — жёстко, нельзя использовать нигде
24
+ - Conflicts with — задокументировать, если термин значит другое в другом домене
25
+
26
+ ## Business rules
27
+ - Бизнес-правило = правило с возможными исключениями и edge cases
28
+ - Каждое правило ОБЯЗАНО иметь: rationale (зачем), source (откуда), edge cases
29
+ - Правило без rationale — это не правило, а догадка. Удалить или добавить rationale
30
+
31
+ ### Здоровье business rules
32
+ - 0 правил в домене → домен не проработан. Минимум бизнес-логика существует
33
+ - Количество не ограничено — 100 правил в домене billing это нормально
34
+ - **Тест качества:** правило проверяемое? Можно написать тест? Если нет — переформулировать
35
+ - **Дубликат-детектор:** два правила говорят одно и то же разными словами → объединить
36
+ - **Orphan-детектор:** правило без ссылки на PRDCT/DMNPRDCT → откуда взялось? Добавить source
37
+
38
+ ## Invariants
39
+ - Инвариант = правило, которое НИКОГДА не может быть нарушено
40
+ - Отличие от business rule: бизнес-правило может иметь исключения, инвариант — нет
41
+ - Формулировка: утвердительная (`Session всегда привязана к Learner ID`)
42
+
43
+ ### Здоровье invariants
44
+ - 0 инвариантов → домен не имеет constraints? Невозможно. Минимум 1 инвариант
45
+ - **Тест:** если инвариант нарушен — система сломана? Если нет — это business rule, не инвариант
46
+ - **Конфликт-детектор:** два инварианта противоречат друг другу → критическая проблема
47
+
48
+ ## Events
49
+ - Формат: PastTense (`SessionStarted`, `TurnCompleted`)
50
+ - Payload: минимально необходимый набор данных
51
+ - Гарантии: at-least-once по умолчанию
52
+ - Idempotency: всегда указывать ключ идемпотентности
53
+
54
+ ### Здоровье events
55
+ - Event без consumer → orphan. Зачем генерируем то что никто не слушает?
56
+ - Event без producer → ghost. Кто его вообще отправляет?
57
+ - **Payload bloat:** если payload > 10 полей → скорее всего протекает внутренняя структура агрегата. Payload = минимум для consumer
58
+ - **Cross-domain event:** если event пересекает домен → это domain boundary. Проверить что есть ACL или contract
59
+
60
+ ## Domain boundaries
61
+ - Если сомневаешься, вынеси в отдельный домен
62
+ - Лучше мелкие домены, чем один god-domain
63
+ - README.md: секция "Outside this domain" — обязательна
64
+
65
+ ## When reading domain docs
66
+ - Всегда читай README.md первым — понять границы
67
+ - Потом ubiquitous-language.md — понять термины
68
+ - Потом invariants.md — понять ограничения
69
+ - Только потом остальное
@@ -0,0 +1,51 @@
1
+ ---
2
+ paths:
3
+ - "product-specs/docs/changes/**"
4
+ - "product-specs/docs/domains/**"
5
+ ---
6
+
7
+ # ID numbering rules
8
+
9
+ Stable identifiers (HP-1, EC-3, AC-28, AD-19, AU-15, …) are durable contracts between change packages, domain canon, and code. e2e specs (`apps/web/e2e/hp-{1,2,3}-*.spec.ts`) and runtime handlers (`apps/web/src/domains/identity/widgets/landing/ui/landing-error-toast.tsx`) reference these IDs by name. Reusing or losing one silently breaks tests and traces.
10
+
11
+ ## Counter file
12
+
13
+ Single source of truth: [`product-specs/docs/changes/_id-counters.json`](../docs/changes/_id-counters.json).
14
+
15
+ Schema:
16
+ - `counters.<PREFIX>.next` — next free integer for this prefix.
17
+ - `counters.<PREFIX>.stage` / `.owner` — which stage agent is allowed to allocate.
18
+ - `history[]` — per-PRDCT allocation log written by the merger.
19
+
20
+ ## Allocation contract
21
+
22
+ A stage agent that emits any of these IDs MUST, in the same edit/commit:
23
+
24
+ 1. Read `_id-counters.json`.
25
+ 2. For each prefix it will use, take the current `counters.<PREFIX>.next` as the starting number.
26
+ 3. Allocate a contiguous block (`next`, `next+1`, …, `next+k-1`).
27
+ 4. Write `_id-counters.json` back with `counters.<PREFIX>.next += k` BEFORE finalizing the stage doc.
28
+
29
+ Prefix → owner:
30
+
31
+ | Prefix | Stage | Owner |
32
+ |---|---|---|
33
+ | HP, EC, ER, AC, PM, CC, SC | 02-scenarios | studio-scenario-writer |
34
+ | AS, TQ | 03-analysis | studio-analyst |
35
+ | AD | 04-domain | studio-domain-framer |
36
+ | AU, S | 05-ux | studio-designer |
37
+
38
+ ## Format
39
+
40
+ `<PREFIX>-<NUMBER>`. Padding follows the convention established by PRDCT-0001 (verify against `_id-counters.json` history before the first allocation in a new prefix):
41
+
42
+ - **Zero-padded to 2 digits always:** `AC` (`AC-01`), `AS` (`AS-01`), `AD` (`AD-01`), `AU` (`AU-01`).
43
+ - **No padding for ≤ 9, 2-digit from 10:** `HP`, `EC`, `ER`, `PM`, `CC`, `SC`, `TQ`, `S` (e.g. `HP-1`, `EC-12`).
44
+
45
+ ## Iron rules
46
+
47
+ 1. **Never reuse a number across PRDCTs.** Even if a prior PRDCT was cancelled or its scenario was deleted — that number is burned.
48
+ 2. **Gaps are acceptable.** A cancelled or aborted allocation is wasted, not recycled.
49
+ 3. **Anchors required after merge.** When a PRDCT enters `status: done` and `studio-domain-merger` runs, every allocated ID MUST appear as a durable anchor in the affected domain canon — either as a heading (`### HP-1 · …`) or as a bold inline prefix (`**HP-1**: …`). Paraphrasing prose without anchoring is a merge-gate violation.
50
+
51
+ See [`change-management.md`](./change-management.md) for the wider change-package lifecycle.
@@ -0,0 +1,51 @@
1
+ ---
2
+ paths:
3
+ - "docs/**"
4
+ ---
5
+
6
+ # Obsidian-specific conventions
7
+
8
+ ## Vault structure
9
+ - Obsidian — основной инструмент для работы с документацией
10
+ - Vault root: `docs/`
11
+ - Canvas файлы (`.canvas`): в `_meta/` для визуальных карт
12
+ - Dataview дашборды: `domains-dashboard.md`, `changes-dashboard.md`
13
+
14
+ ## Graph view optimization
15
+ - Каждый файл ДОЛЖЕН иметь осмысленное имя (НЕ `index.md`)
16
+ - Frontmatter `tags:` используются для группировки и цветов в graph view
17
+ - Рекомендуемые группы в graph:
18
+ - `path:"domains"` → синий (бизнес-домены)
19
+ - `path:"changes"` → зелёный (change packages)
20
+ - `path:"adrs"` → фиолетовый (решения)
21
+ - `path:"contexts"` → оранжевый (платформа)
22
+ - `path:"_meta"` → серый (метаданные)
23
+
24
+ ## Canvas files
25
+ - Формат: JSON Canvas (открытый стандарт)
26
+ - Nodes: embed domain README.md через `type: "file"`
27
+ - Edges: подписи = domain events или API contracts
28
+ - Colors: `"4"` = active, `"6"` = planned, `"0"` = infrastructure
29
+
30
+ ## Dataview patterns
31
+ ```
32
+ # Таблица из frontmatter:
33
+ TABLE field1, field2 FROM "folder" WHERE type = "X" SORT field1
34
+
35
+ # Задачи из чеклистов:
36
+ TASK FROM "folder" WHERE file.name = "invariants"
37
+
38
+ # Группировка:
39
+ TABLE status FROM "changes" WHERE type = "change" GROUP BY status
40
+ ```
41
+
42
+ ## Embeds
43
+ - Используй `![[file]]` для встраивания в дашборды
44
+ - Используй `![[file#heading]]` для встраивания секции
45
+ - Canvas: `type: "file"` для embed из vault
46
+
47
+ ## Plugins required
48
+ - **Dataview** — живые дашборды, запросы по frontmatter
49
+ - **Templater** (optional) — динамическое создание файлов из шаблонов
50
+ - **Kanban** (optional) — kanban-доски из markdown
51
+ - **Mermaid** — встроен в Obsidian, доп. плагин не нужен
@@ -0,0 +1,40 @@
1
+ ---
2
+ type: change
3
+ status: draft
4
+ tags:
5
+ - change/PRDCT-XXXX
6
+ - intent
7
+ created: YYYY-MM-DD
8
+ ---
9
+
10
+ # Intent · PRDCT-XXXX-name
11
+
12
+ ## Problem
13
+ <!-- Какую проблему решаем? Кто страдает? Доказательства (данные, фидбек). -->
14
+
15
+ ## Goal
16
+ <!-- Что хотим получить? Одно предложение. -->
17
+
18
+ ## KPI
19
+ <!-- Как измерим успех? Конкретная метрика + target. -->
20
+
21
+ ## Actors
22
+ | Actor | Role | Key need |
23
+ |-------|------|----------|
24
+
25
+ ## Boundaries
26
+ ### In scope
27
+ -
28
+
29
+ ### Out of scope
30
+ -
31
+
32
+ ## Why now
33
+ <!-- Бизнес-причина. Что произойдёт если отложить на 3 месяца? -->
34
+
35
+ ## Risks
36
+ <!-- Продуктовые риски. НЕ технические. -->
37
+ -
38
+
39
+ ## Open questions
40
+ -
@@ -0,0 +1,66 @@
1
+ ---
2
+ type: change
3
+ status: draft
4
+ tags:
5
+ - change/PRDCT-XXXX
6
+ - scenarios
7
+ created: YYYY-MM-DD
8
+ ---
9
+
10
+ # Scenarios · PRDCT-XXXX-name
11
+
12
+ Контракт поведения системы. Все роли работают от этого документа.
13
+
14
+ > [!danger] Gate rule
15
+ > Нет scenarios → нельзя писать код. Нельзя писать тесты. Нельзя делать UX.
16
+
17
+ ## Happy path scenarios
18
+
19
+ ### Scenario: [name]
20
+ ```gherkin
21
+ Given [precondition]
22
+ When [action]
23
+ Then [result]
24
+ And [side effect]
25
+ ```
26
+
27
+ ## Edge case scenarios
28
+
29
+ ### Scenario: [name]
30
+ ```gherkin
31
+ Given [unusual precondition]
32
+ When [action]
33
+ Then [expected handling]
34
+ ```
35
+
36
+ ## Error scenarios
37
+
38
+ ### Scenario: [name]
39
+ ```gherkin
40
+ Given [precondition]
41
+ When [action that fails]
42
+ Then [error handling]
43
+ And [user sees: specific message]
44
+ ```
45
+
46
+ ## Permission scenarios
47
+ ### Scenario: [role] can/cannot [action]
48
+ ```gherkin
49
+ Given user has role [role]
50
+ When user attempts [action]
51
+ Then [allowed/denied with specific response]
52
+ ```
53
+
54
+ ## Concurrent scenarios
55
+ ### Scenario: [name]
56
+ ```gherkin
57
+ Given [two actors doing something simultaneously]
58
+ When [conflict]
59
+ Then [resolution]
60
+ ```
61
+
62
+ ## Acceptance criteria
63
+ Derived from scenarios:
64
+ - [ ] AC-01: [from happy path scenario]
65
+ - [ ] AC-02: [from edge case]
66
+ - [ ] AC-03: [from error scenario]
@@ -0,0 +1,64 @@
1
+ ---
2
+ type: change
3
+ status: draft
4
+ tags:
5
+ - change/PRDCT-XXXX
6
+ - analysis
7
+ created: YYYY-MM-DD
8
+ ---
9
+
10
+ # System analysis · PRDCT-XXXX-name
11
+
12
+ > [!info] Принцип
13
+ > Системный анализ определяет ЧТО затронуто и КАКОЙ масштаб изменений. Без конкретных endpoints и schemas — это делает executor.
14
+
15
+ ## Affected systems
16
+ | System / Service | Impact level | What changes |
17
+ |-----------------|-------------|-------------|
18
+ <!-- high / medium / low -->
19
+
20
+ ## Affected bounded contexts
21
+ | Context | Current state | Expected change |
22
+ |---------|-------------|----------------|
23
+
24
+ ## Dependencies
25
+ ### Upstream (от кого зависим)
26
+ | System | What we need | Risk if unavailable |
27
+ |--------|-------------|-------------------|
28
+
29
+ ### Downstream (кто зависит от нас)
30
+ | System | What they use | Breaking change? |
31
+ |--------|-------------|-----------------|
32
+
33
+ ## Data impact
34
+ - New data entities needed?
35
+ - Existing data migration required?
36
+ - Data volume expectations:
37
+ - Retention / archival needs:
38
+
39
+ ## Async flows
40
+ <!-- Нужны ли фоновые процессы, очереди, события между сервисами? -->
41
+ ```mermaid
42
+ sequenceDiagram
43
+ ```
44
+
45
+ ## Integration points
46
+ | Integration | Protocol | Direction | New / Changed / Existing |
47
+ |------------|----------|-----------|------------------------|
48
+
49
+ ## Technical risks
50
+ | Risk | Probability | Impact | Mitigation |
51
+ |------|------------|--------|-----------|
52
+
53
+ ## Constraints
54
+ <!-- Технические ограничения, которые влияют на решение -->
55
+ - Performance:
56
+ - Scalability:
57
+ - Security:
58
+ - Compliance:
59
+
60
+ ## Open technical questions
61
+ -
62
+
63
+ > [!danger] Gate rule
64
+ > Нет analysis → нельзя моделировать домен. Без понимания масштаба impact нельзя определять boundaries.
@@ -0,0 +1,47 @@
1
+ ---
2
+ type: change
3
+ status: draft
4
+ tags:
5
+ - change/PRDCT-XXXX
6
+ - domain
7
+ created: YYYY-MM-DD
8
+ ---
9
+
10
+ # Domain framing · PRDCT-XXXX-name
11
+
12
+ ## Affected bounded contexts
13
+ | Context | Impact | What changes |
14
+ |---------|--------|-------------|
15
+
16
+ ## Aggregate changes
17
+
18
+ ### [Aggregate name]
19
+ **Responsibility:**
20
+ **New/changed fields:**
21
+ **State machine changes:**
22
+
23
+ ```mermaid
24
+ stateDiagram-v2
25
+ ```
26
+
27
+ ## New/changed business rules
28
+ | Rule | Description | Rationale | Edge cases |
29
+ |------|------------|-----------|------------|
30
+
31
+ ## New/changed events
32
+ | Event | Producer | Consumers | Payload | Guarantees |
33
+ |-------|----------|-----------|---------|-----------|
34
+
35
+ ## Invariants check
36
+ <!-- Для каждого инварианта затронутого домена -->
37
+ - [ ] [invariant] · ✅ preserved / ⚠️ impacted / ❌ violated
38
+
39
+ ## New invariants
40
+ -
41
+
42
+ ## Ubiquitous language
43
+ | Term | Definition | Forbidden synonyms |
44
+ |------|-----------|-------------------|
45
+
46
+ > [!danger] Gate rule
47
+ > Нет domain framing → нельзя делать UX. Нельзя делать код.
@@ -0,0 +1,46 @@
1
+ ---
2
+ type: change
3
+ status: draft
4
+ tags:
5
+ - change/PRDCT-XXXX
6
+ - ux
7
+ created: YYYY-MM-DD
8
+ ---
9
+
10
+ # UX projection · PRDCT-XXXX-name
11
+
12
+ > [!info] Принцип
13
+ > UI не придумывает логику — он показывает её. Каждый экран = отражение сценария.
14
+
15
+ ## Surfaces
16
+ | Surface | Type | Scenario ref | Mockup |
17
+ |---------|------|-------------|--------|
18
+
19
+ ## Flows
20
+
21
+ ### [Flow name] (ref: scenario [name])
22
+ 1. [step] → screen [X]
23
+ 2. [step] → screen [Y]
24
+
25
+ ## States per surface
26
+
27
+ ### [Surface name]
28
+ | State | Description | Mockup | data-test-id |
29
+ |-------|------------|--------|-------------|
30
+ | loading | | [[mockups/state-X-loading.html]] | state-X-loading |
31
+ | success | | [[mockups/state-X-success.html]] | state-X-success |
32
+ | error | | [[mockups/state-X-error.html]] | state-X-error |
33
+ | empty | | [[mockups/state-X-empty.html]] | state-X-empty |
34
+
35
+ ## Error messages
36
+ | Error | User message | Recovery action | data-test-id |
37
+ |-------|-------------|----------------|-------------|
38
+
39
+ ## Transitions
40
+ ```mermaid
41
+ stateDiagram-v2
42
+ ```
43
+
44
+ ## Mockups
45
+ All HTML mockups in `mockups/` directory:
46
+ - [[mockups/flow-X.html]]
@@ -0,0 +1,26 @@
1
+ id: PRDCT-XXXX-name
2
+ title: ""
3
+ status: intent
4
+ # status: intent | scenarios | analysis | domain | ux | done
5
+
6
+ created: YYYY-MM-DD
7
+ updated: YYYY-MM-DD
8
+
9
+ owners:
10
+ product: ""
11
+ backend: "" # also architect
12
+ designer: ""
13
+ frontend: ""
14
+ qa: ""
15
+
16
+ domains: []
17
+ capabilities: []
18
+
19
+ related_changes: []
20
+ pr_links: []
21
+
22
+ blocked_by: ""
23
+ conflicts_with: []
24
+
25
+ retroactive: false
26
+ retroactive_note: ""
@@ -0,0 +1,19 @@
1
+ {
2
+ "version": "0.1.0",
3
+ "role": "fullstack",
4
+ "model_profile": "balanced",
5
+ "handoff_mode": "branch",
6
+ "autonomous_allowed": false,
7
+ "obsidian_integration": true,
8
+ "language": "ru",
9
+ "stage_pipeline": ["draft", "discovery", "spec", "analysis", "design", "in-progress", "done"],
10
+ "roles": {
11
+ "pm": { "commands": ["pm", "feature", "status", "sync"] },
12
+ "analyst": { "commands": ["analyst", "new-domain", "status", "review"] },
13
+ "designer": { "commands": ["designer", "status"] },
14
+ "backend": { "commands": ["backend", "bug", "status", "verify"] },
15
+ "frontend": { "commands": ["frontend", "bug", "status", "verify"] },
16
+ "qa": { "commands": ["qa", "review", "status", "verify"] },
17
+ "fullstack": { "commands": ["*"] }
18
+ }
19
+ }
@@ -0,0 +1,31 @@
1
+ ---
2
+ type: domain
3
+ domain: DOMAIN_NAME
4
+ status: draft
5
+ owner: ""
6
+ tags:
7
+ - domain
8
+ created: YYYY-MM-DD
9
+ ---
10
+
11
+ # [Domain name]
12
+
13
+ ## What is this domain
14
+ <!-- Один абзац: какую бизнес-возможность представляет этот домен -->
15
+
16
+ ## Why it exists
17
+ <!-- Бизнес-обоснование -->
18
+
19
+ ## Boundaries
20
+
21
+ ### Inside this domain
22
+ -
23
+
24
+ ### Outside this domain (explicitly)
25
+ -
26
+
27
+ ## Key use cases
28
+ -
29
+
30
+ ## Owned by
31
+ <!-- Команда или ответственный -->
@@ -0,0 +1,37 @@
1
+ ---
2
+ type: aggregate
3
+ domain: DOMAIN_NAME
4
+ tags:
5
+ - domain/DOMAIN_NAME
6
+ - aggregate
7
+ ---
8
+
9
+ # Aggregates · [Domain name]
10
+
11
+ ## [Aggregate name]
12
+
13
+ ### Responsibility
14
+
15
+ ### State diagram
16
+
17
+ ```mermaid
18
+ stateDiagram-v2
19
+ [*] --> State1
20
+ State1 --> State2: action()
21
+ State2 --> [*]
22
+ ```
23
+
24
+ ### Structure
25
+
26
+ ```mermaid
27
+ erDiagram
28
+ AGGREGATE {
29
+ uuid id PK
30
+ }
31
+ ```
32
+
33
+ ### Boundaries
34
+
35
+ ### Consistency rules
36
+
37
+ ### Cannot be split from
@@ -0,0 +1,29 @@
1
+ ---
2
+ type: api-contracts
3
+ domain: _template
4
+ status: draft
5
+ tags:
6
+ - domain/_template
7
+ - api
8
+ created: YYYY-MM-DD
9
+ ---
10
+
11
+ # API contracts
12
+
13
+ ## Owned endpoints
14
+ | Method | Path | Description | Auth | Request | Response |
15
+ |--------|------|-------------|------|---------|----------|
16
+
17
+ ## Consumed endpoints (from other domains)
18
+ | Method | Path | Provider domain | Purpose |
19
+ |--------|------|----------------|---------|
20
+
21
+ ## Error codes
22
+ | Code | Meaning | When |
23
+ |------|---------|------|
24
+
25
+ ## Versioning
26
+ <!-- Стратегия версионирования API этого домена -->
27
+
28
+ ## OpenAPI specs
29
+ <!-- Ссылки на актуальные openapi.yaml из change packages -->