@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.
- package/LICENSE +21 -0
- package/ONBOARDING.html +270 -0
- package/README.md +82 -0
- package/bin/zrg-studio.mjs +67 -0
- package/package.json +29 -0
- package/src/commands/doctor.mjs +60 -0
- package/src/commands/init.mjs +44 -0
- package/src/lib/copy-template.mjs +42 -0
- package/src/lib/merge-claude-settings.mjs +54 -0
- package/template/.claude/agents/studio-analyst.md +109 -0
- package/template/.claude/agents/studio-designer.md +172 -0
- package/template/.claude/agents/studio-domain-framer.md +109 -0
- package/template/.claude/agents/studio-domain-merger.md +264 -0
- package/template/.claude/agents/studio-pm.md +169 -0
- package/template/.claude/agents/studio-reviewer.md +156 -0
- package/template/.claude/agents/studio-scenario-writer.md +152 -0
- package/template/.claude/commands/studio-analyst.md +45 -0
- package/template/.claude/commands/studio-designer.md +34 -0
- package/template/.claude/commands/studio-domain-framer.md +30 -0
- package/template/.claude/commands/studio-onboard.md +98 -0
- package/template/.claude/commands/studio-pm.md +39 -0
- package/template/.claude/commands/studio-scenario-writer.md +44 -0
- package/template/product-specs/CLAUDE.md +53 -0
- package/template/product-specs/agents/studio-analyst.md +109 -0
- package/template/product-specs/agents/studio-codebase-mapper.md +217 -0
- package/template/product-specs/agents/studio-conflict-resolver.md +169 -0
- package/template/product-specs/agents/studio-designer.md +172 -0
- package/template/product-specs/agents/studio-domain-extractor.md +365 -0
- package/template/product-specs/agents/studio-domain-framer.md +109 -0
- package/template/product-specs/agents/studio-domain-interviewer.md +246 -0
- package/template/product-specs/agents/studio-domain-merger.md +264 -0
- package/template/product-specs/agents/studio-god.md +779 -0
- package/template/product-specs/agents/studio-meta-god.md +335 -0
- package/template/product-specs/agents/studio-pm.md +169 -0
- package/template/product-specs/agents/studio-reviewer.md +156 -0
- package/template/product-specs/agents/studio-scenario-writer.md +152 -0
- package/template/product-specs/agents/studio-verifier.md +222 -0
- package/template/product-specs/docs/_meta/capability-map.example.md +103 -0
- package/template/product-specs/docs/_meta/doc-schema.md +134 -0
- package/template/product-specs/docs/_meta/domain-map.example.md +106 -0
- package/template/product-specs/docs/_meta/glossary.example.md +72 -0
- package/template/product-specs/docs/_meta/onboarding.example.md +142 -0
- package/template/product-specs/docs/_meta/product-vision.example.md +136 -0
- package/template/product-specs/hooks/studio-conflict-detect.sh +59 -0
- package/template/product-specs/hooks/studio-context-monitor.js +37 -0
- package/template/product-specs/hooks/studio-domain-guard.sh +40 -0
- package/template/product-specs/hooks/studio-prompt-guard.js +36 -0
- package/template/product-specs/hooks/studio-session-state.sh +55 -0
- package/template/product-specs/hooks/studio-stage-gate.sh +180 -0
- package/template/product-specs/references/checkpoints.md +27 -0
- package/template/product-specs/references/ddd-conventions.md +38 -0
- package/template/product-specs/references/gates.md +50 -0
- package/template/product-specs/references/model-profiles.md +28 -0
- package/template/product-specs/references/obsidian-conventions.md +51 -0
- package/template/product-specs/references/stage-pipeline.md +65 -0
- package/template/product-specs/rules/change-management.md +159 -0
- package/template/product-specs/rules/docs-conventions.md +81 -0
- package/template/product-specs/rules/domain-conventions.md +69 -0
- package/template/product-specs/rules/id-numbering.md +51 -0
- package/template/product-specs/rules/obsidian-conventions.md +51 -0
- package/template/product-specs/templates/change/01-intent.md +40 -0
- package/template/product-specs/templates/change/02-scenarios.md +66 -0
- package/template/product-specs/templates/change/03-analysis.md +64 -0
- package/template/product-specs/templates/change/04-domain.md +47 -0
- package/template/product-specs/templates/change/05-ux.md +46 -0
- package/template/product-specs/templates/change/metadata.yaml +26 -0
- package/template/product-specs/templates/config.json +19 -0
- package/template/product-specs/templates/domain/README.md +31 -0
- package/template/product-specs/templates/domain/aggregates.md +37 -0
- package/template/product-specs/templates/domain/api-contracts.md +29 -0
- package/template/product-specs/templates/domain/business-rules.md +30 -0
- package/template/product-specs/templates/domain/changelog.md +25 -0
- package/template/product-specs/templates/domain/data-model.md +34 -0
- package/template/product-specs/templates/domain/events.md +24 -0
- package/template/product-specs/templates/domain/integrations.md +27 -0
- package/template/product-specs/templates/domain/invariants.md +14 -0
- package/template/product-specs/templates/domain/links.yaml +20 -0
- package/template/product-specs/templates/domain/operational-sla.md +32 -0
- package/template/product-specs/templates/domain/ownership.md +13 -0
- package/template/product-specs/templates/domain/scenarios.md +65 -0
- package/template/product-specs/templates/domain/surfaces.md +51 -0
- package/template/product-specs/templates/domain/ubiquitous-language.md +12 -0
- package/template/product-specs/templates/meta/capability-map.md +55 -0
- package/template/product-specs/templates/meta/doc-schema.md +134 -0
- package/template/product-specs/templates/meta/domain-map.md +67 -0
- package/template/product-specs/templates/meta/glossary.md +30 -0
- package/template/product-specs/templates/meta/onboarding.md +108 -0
- package/template/product-specs/templates/state.md +19 -0
- package/template/product-specs/workflows/conflict-resolution.md +10 -0
- package/template/product-specs/workflows/domain-update.md +15 -0
- package/template/product-specs/workflows/map-codebase.md +17 -0
- package/template/product-specs/workflows/onboard-project.md +575 -0
- package/template/product-specs/workflows/pipeline-full.md +258 -0
- package/template/product-specs/workflows/pipeline-resume.md +21 -0
- package/template/product-specs/workflows/verify-change.md +12 -0
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
# Pipeline: Full Feature
|
|
2
|
+
|
|
3
|
+
2-layer pipeline with cross-reviews. Change package = business docs only.
|
|
4
|
+
Executor writes code after change is done. Merger updates domain docs.
|
|
5
|
+
|
|
6
|
+
## Naming
|
|
7
|
+
|
|
8
|
+
- **PRDCT-NNNN-feature-name** -- change package directory name
|
|
9
|
+
- Location: `product-specs/docs/changes/PRDCT-NNNN-feature-name/`
|
|
10
|
+
|
|
11
|
+
## Roles
|
|
12
|
+
|
|
13
|
+
| Alias | Agent | Notes |
|
|
14
|
+
|-------|-------|-------|
|
|
15
|
+
| PM | studio-pm | Product intent, business goals |
|
|
16
|
+
| Scenario Writer | studio-scenario-writer | Gherkin scenarios |
|
|
17
|
+
| Analyst | studio-analyst | System analysis |
|
|
18
|
+
| Domain Framer | studio-domain-framer | Domain modeling |
|
|
19
|
+
| Designer | studio-designer | UX flows, mockups |
|
|
20
|
+
| Executor | studio-executor | Code implementation (backend + frontend) |
|
|
21
|
+
| Merger | studio-domain-merger | Updates domain docs from change |
|
|
22
|
+
|
|
23
|
+
## Pipeline overview
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
LAYER 1: WHAT & WHY
|
|
27
|
+
Stage 1 PM --> 01-intent.md
|
|
28
|
+
Stage 1.5 Analyst --> cross-review-intent.md
|
|
29
|
+
Stage 2 Scenario Writer --> 02-scenarios.md
|
|
30
|
+
Stage 2.5 Analyst --> cross-review-scenarios.md (technically possible?)
|
|
31
|
+
|
|
32
|
+
LAYER 2: HOW IT WORKS
|
|
33
|
+
Stage 3 Analyst --> 03-analysis.md
|
|
34
|
+
Stage 3.5 PM --> cross-review-analysis.md (matches intent?)
|
|
35
|
+
Stage 4 Domain Framer + PM --> 04-domain.md
|
|
36
|
+
Stage 4.5 Analyst --> cross-review-domain.md (covers all scenarios?)
|
|
37
|
+
|
|
38
|
+
LAYER 3: HOW IT LOOKS
|
|
39
|
+
Stage 5 Designer --> 05-ux.md + mockups/
|
|
40
|
+
Stage 5.5 QA --> cross-review-ux.md (all scenarios covered?)
|
|
41
|
+
|
|
42
|
+
POST-CHANGE
|
|
43
|
+
Executor --> backend + frontend code
|
|
44
|
+
Merger --> domain docs updated
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Cross-review matrix
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
Stage Author(s) Reviewer(s) Focus
|
|
53
|
+
----- -------- ---------- -----
|
|
54
|
+
1.5 PM Analyst Problem clear? Boundaries defined?
|
|
55
|
+
2.5 Scenario Writer Analyst Scenarios technically possible? Edge cases?
|
|
56
|
+
3.5 Analyst PM System analysis matches business intent?
|
|
57
|
+
4.5 Domain Framer + PM Analyst Domain model covers all scenarios? Invariants?
|
|
58
|
+
5.5 Designer QA Surfaces cover all scenarios? All states?
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Gate rules
|
|
64
|
+
|
|
65
|
+
Gates enforce ordering. A stage cannot start until its prerequisites pass.
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
Gate Requires
|
|
69
|
+
---- --------
|
|
70
|
+
No scenarios --> no analysis 02-scenarios.md must exist before Stage 3
|
|
71
|
+
No analysis --> no domain 03-analysis.md must exist before Stage 4
|
|
72
|
+
No domain --> no UX 04-domain.md must exist before Stage 5
|
|
73
|
+
No scenarios --> no UX 02-scenarios.md must exist before Stage 5
|
|
74
|
+
Canon not edited directly Domain docs updated only through merger
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
If a gate is not met, the pipeline stops and reports which artifact is missing.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Execution
|
|
82
|
+
|
|
83
|
+
### LAYER 1: WHAT & WHY
|
|
84
|
+
|
|
85
|
+
#### Stage 1: Intent (PM)
|
|
86
|
+
1. Run Agent: studio-pm.md + "Feature: $ARGUMENTS"
|
|
87
|
+
2. Output: `01-intent.md` -- problem, goal, KPI, actors, boundaries
|
|
88
|
+
3. STATE.md: `current_stage: 1`
|
|
89
|
+
|
|
90
|
+
#### Stage 1.5: Cross-review -- Analyst reviews Intent
|
|
91
|
+
Analyst reads `01-intent.md` and checks:
|
|
92
|
+
- Problem clearly stated?
|
|
93
|
+
- Boundaries well-defined?
|
|
94
|
+
- KPI measurable?
|
|
95
|
+
|
|
96
|
+
Output: `cross-review-intent.md`
|
|
97
|
+
If NEEDS WORK --> return to PM (max 2 retries).
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
#### Stage 2: Scenarios (Scenario Writer)
|
|
102
|
+
1. Run Agent: studio-scenario-writer.md + "PRDCT: $PRDCT_ID"
|
|
103
|
+
2. Output: `02-scenarios.md` -- happy paths, edge cases, error scenarios, permissions, concurrent
|
|
104
|
+
3. STATE.md: `current_stage: 2`
|
|
105
|
+
|
|
106
|
+
#### Stage 2.5: Cross-review -- Analyst reviews Scenarios
|
|
107
|
+
Analyst reads `02-scenarios.md` and checks:
|
|
108
|
+
- Each scenario technically feasible?
|
|
109
|
+
- Missing constraints? (rate limits, concurrency, file sizes)
|
|
110
|
+
- Edge cases sufficient (>= 5)?
|
|
111
|
+
|
|
112
|
+
Output: `cross-review-scenarios.md`
|
|
113
|
+
If NEEDS WORK --> return to Stage 2 (max 2 retries).
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
### LAYER 2: HOW IT WORKS
|
|
118
|
+
|
|
119
|
+
#### Stage 3: System Analysis (Analyst)
|
|
120
|
+
**Gate: `02-scenarios.md` must exist.**
|
|
121
|
+
|
|
122
|
+
1. Run Agent: studio-analyst.md + "PRDCT: $PRDCT_ID"
|
|
123
|
+
2. Output: `03-analysis.md` -- system impact, technical constraints, integration points
|
|
124
|
+
3. STATE.md: `current_stage: 3`
|
|
125
|
+
|
|
126
|
+
#### Stage 3.5: Cross-review -- PM reviews Analysis
|
|
127
|
+
PM re-reads `03-analysis.md` and checks:
|
|
128
|
+
- System analysis matches business intent?
|
|
129
|
+
- Constraints reasonable?
|
|
130
|
+
- No scope creep?
|
|
131
|
+
|
|
132
|
+
Output: `cross-review-analysis.md`
|
|
133
|
+
If NEEDS WORK --> return to Stage 3 (max 2 retries).
|
|
134
|
+
|
|
135
|
+
#### Stage 4: Domain (Domain Framer + PM)
|
|
136
|
+
**Gate: `03-analysis.md` must exist.**
|
|
137
|
+
|
|
138
|
+
1. Run Agent: studio-domain-framer.md + "PRDCT: $PRDCT_ID"
|
|
139
|
+
2. PM provides business context, Domain Framer models the domain
|
|
140
|
+
3. Output: `04-domain.md` -- aggregates, rules, events, invariants, ubiquitous language
|
|
141
|
+
4. STATE.md: `current_stage: 4`
|
|
142
|
+
|
|
143
|
+
#### Stage 4.5: Cross-review -- Analyst reviews Domain
|
|
144
|
+
Analyst reads `04-domain.md` and checks:
|
|
145
|
+
- Domain model covers all scenarios?
|
|
146
|
+
- Terminology clear for non-technical stakeholders?
|
|
147
|
+
- Invariants correct? Boundaries reasonable?
|
|
148
|
+
|
|
149
|
+
Output: `cross-review-domain.md`
|
|
150
|
+
If NEEDS WORK --> return to Stage 4 (max 2 retries).
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
### LAYER 3: HOW IT LOOKS
|
|
155
|
+
|
|
156
|
+
#### Stage 5: UX (Designer)
|
|
157
|
+
**Gate: `04-domain.md` AND `02-scenarios.md` must exist.**
|
|
158
|
+
|
|
159
|
+
1. Run Agent: studio-designer.md + "PRDCT: $PRDCT_ID"
|
|
160
|
+
2. Output: `05-ux.md` + `mockups/` directory with HTML files
|
|
161
|
+
3. STATE.md: `current_stage: 5`
|
|
162
|
+
|
|
163
|
+
#### Stage 5.5: Cross-review -- QA reviews UX
|
|
164
|
+
QA reads `05-ux.md` and checks:
|
|
165
|
+
- Every scenario from 02-scenarios.md has a corresponding surface?
|
|
166
|
+
- All states represented (loading, success, error, empty)?
|
|
167
|
+
- Error messages defined?
|
|
168
|
+
- Permissions per surface specified?
|
|
169
|
+
|
|
170
|
+
Output: `cross-review-ux.md`
|
|
171
|
+
If NEEDS WORK --> return to Stage 5 (max 2 retries).
|
|
172
|
+
|
|
173
|
+
**After Stage 5.5 passes: status -> done. Change package is complete.**
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
### POST-CHANGE FLOW
|
|
178
|
+
|
|
179
|
+
#### Code Implementation (Executor)
|
|
180
|
+
1. Run Agent: studio-executor.md + "PRDCT: $PRDCT_ID"
|
|
181
|
+
2. Executor reads domain docs + scenarios + UX -> writes backend + frontend code
|
|
182
|
+
3. Code derives API contracts, DB schema, components from domain knowledge + scenarios
|
|
183
|
+
|
|
184
|
+
#### Domain Docs Update (Merger)
|
|
185
|
+
1. Run Agent: studio-domain-merger.md + "PRDCT: $PRDCT_ID"
|
|
186
|
+
2. Merger reads change package (01-05) -> updates domain docs:
|
|
187
|
+
- aggregates.md, business-rules.md, events.md, invariants.md
|
|
188
|
+
- ubiquitous-language.md, scenarios.md, surfaces.md
|
|
189
|
+
- api-contracts.md, data-model.md (from actual code, not docs)
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## Cross-review format
|
|
194
|
+
|
|
195
|
+
Every cross-review file follows this structure:
|
|
196
|
+
|
|
197
|
+
```markdown
|
|
198
|
+
# Cross-review: [Artifact] reviewed by [Reviewer]
|
|
199
|
+
|
|
200
|
+
## Verdict: APPROVED / NEEDS WORK / BLOCKED
|
|
201
|
+
|
|
202
|
+
## Findings
|
|
203
|
+
| # | Finding | Severity | File:Section | Recommendation |
|
|
204
|
+
|---|---------|----------|-------------|---------------|
|
|
205
|
+
|
|
206
|
+
## Critical (must fix before next stage)
|
|
207
|
+
-
|
|
208
|
+
|
|
209
|
+
## Recommendations (nice to have)
|
|
210
|
+
-
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
## Iteration rules
|
|
216
|
+
|
|
217
|
+
When a cross-review returns NEEDS WORK:
|
|
218
|
+
|
|
219
|
+
1. Author revises the document based on findings
|
|
220
|
+
2. Reviewer re-reads the revised document
|
|
221
|
+
3. **Max 2 retries per cross-review stage**
|
|
222
|
+
4. After 2 failed retries:
|
|
223
|
+
- Log the unresolved findings
|
|
224
|
+
- Proceed to next stage with a warning annotation
|
|
225
|
+
- STATE.md: `warnings: ["unresolved cross-review at stage X.5"]`
|
|
226
|
+
|
|
227
|
+
When a cross-review returns BLOCKED:
|
|
228
|
+
|
|
229
|
+
1. Record with reason
|
|
230
|
+
2. Pipeline halts at that stage
|
|
231
|
+
3. Requires human intervention to unblock
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
## Autonomous mode
|
|
236
|
+
|
|
237
|
+
When invoked with `--auto`:
|
|
238
|
+
|
|
239
|
+
- All cross-reviews execute automatically (no human prompts)
|
|
240
|
+
- NEEDS WORK --> automatic revision by author (max 2 iterations per stage)
|
|
241
|
+
- BLOCKED --> halt and notify
|
|
242
|
+
- Skip all confirmation prompts
|
|
243
|
+
- Each agent runs with full fresh context
|
|
244
|
+
- Progress reported via STATE.md updates
|
|
245
|
+
|
|
246
|
+
---
|
|
247
|
+
|
|
248
|
+
## Final summary
|
|
249
|
+
|
|
250
|
+
```
|
|
251
|
+
PRDCT-NNNN-feature-name
|
|
252
|
+
Layer 1 (What & Why): 01-intent.md, 02-scenarios.md
|
|
253
|
+
Layer 2 (How it works): 03-analysis.md, 04-domain.md
|
|
254
|
+
Layer 3 (How it looks): 05-ux.md + mockups/
|
|
255
|
+
Cross-reviews: N files
|
|
256
|
+
Warnings: [any unresolved items]
|
|
257
|
+
Status: DONE / IN PROGRESS / BLOCKED
|
|
258
|
+
```
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Pipeline: Resume
|
|
2
|
+
|
|
3
|
+
Возобновление работы с места остановки.
|
|
4
|
+
|
|
5
|
+
## Process
|
|
6
|
+
1. Прочитай `.planning/STATE.md` → определи current_chg, current_phase
|
|
7
|
+
2. Если нет STATE.md → "Нет активной работы. Запусти /studio-pm для начала."
|
|
8
|
+
3. Прочитай `product-specs/docs/changes/$PRDCT/metadata.yaml` → определи status
|
|
9
|
+
4. Определи следующую стадию по stage-pipeline:
|
|
10
|
+
draft → /studio-analyst
|
|
11
|
+
discovery → /studio-analyst (continue)
|
|
12
|
+
spec → /studio-analyst (domain impact)
|
|
13
|
+
analysis → /studio-designer
|
|
14
|
+
design → /studio-backend
|
|
15
|
+
in-progress → определи что не заполнено (06? 07? 08?)
|
|
16
|
+
done → "PRDCT завершён."
|
|
17
|
+
|
|
18
|
+
5. Покажи:
|
|
19
|
+
"Текущая позиция: PRDCT-XXXX, стадия: [X]
|
|
20
|
+
Следующий шаг: /studio-[role] PRDCT-XXXX"
|
|
21
|
+
6. Спроси: "Запустить?"
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Workflow: Verify Change
|
|
2
|
+
|
|
3
|
+
## Input
|
|
4
|
+
PRDCT-XXXX
|
|
5
|
+
|
|
6
|
+
## Process
|
|
7
|
+
1. Read entire change package
|
|
8
|
+
2. Spawn studio-verifier agent with PRDCT context
|
|
9
|
+
3. Receive VERIFICATION.md
|
|
10
|
+
4. If verdict = GAPS → show gaps, ask user what to do
|
|
11
|
+
5. If verdict = PASS → "PRDCT-XXXX verified. Ready for PR."
|
|
12
|
+
6. If verdict = FAIL → show critical issues, recommend fixes
|