@polymorphism-tech/morph-spec 4.8.14 → 4.8.15
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/README.md +2 -2
- package/bin/morph-spec.js +23 -2
- package/bin/task-manager.js +202 -14
- package/claude-plugin.json +1 -1
- package/docs/CHEATSHEET.md +1 -1
- package/docs/QUICKSTART.md +1 -1
- package/framework/agents.json +113 -116
- package/framework/hooks/claude-code/post-tool-use/dispatch.js +48 -2
- package/framework/hooks/claude-code/post-tool-use/validator-feedback.js +151 -0
- package/framework/hooks/claude-code/pre-tool-use/enforce-phase-writes.js +6 -0
- package/framework/hooks/claude-code/pre-tool-use/protect-spec-files.js +6 -0
- package/framework/hooks/claude-code/session-start/inject-morph-context.js +27 -0
- package/framework/hooks/claude-code/stop/validate-completion.js +17 -2
- package/framework/hooks/claude-code/teammate-idle/teammate-idle.js +87 -0
- package/framework/hooks/claude-code/user-prompt/set-terminal-title.js +58 -0
- package/framework/hooks/shared/phase-utils.js +1 -1
- package/framework/hooks/shared/state-reader.js +1 -0
- package/framework/skills/README.md +1 -0
- package/framework/skills/level-0-meta/brainstorming/SKILL.md +2 -0
- package/framework/skills/level-0-meta/code-review/SKILL.md +16 -0
- package/framework/skills/level-0-meta/code-review/references/review-guidelines.md +100 -0
- package/framework/skills/level-0-meta/code-review/scripts/scan-csharp.mjs +36 -6
- package/framework/skills/level-0-meta/code-review-nextjs/SKILL.md +16 -0
- package/framework/skills/level-0-meta/code-review-nextjs/scripts/scan-nextjs.mjs +189 -0
- package/framework/skills/level-0-meta/frontend-review/SKILL.md +359 -0
- package/framework/skills/level-0-meta/frontend-review/scripts/scan-accessibility.mjs +376 -0
- package/framework/skills/level-0-meta/morph-checklist/SKILL.md +1 -1
- package/framework/skills/level-0-meta/morph-replicate/SKILL.md +10 -8
- package/framework/skills/level-0-meta/morph-replicate/references/blazor-html-mapping.md +70 -0
- package/framework/skills/level-0-meta/post-implementation/SKILL.md +315 -0
- package/framework/skills/level-0-meta/post-implementation/scripts/detect-dev-server.mjs +153 -0
- package/framework/skills/level-0-meta/post-implementation/scripts/detect-stack.mjs +234 -0
- package/framework/skills/level-0-meta/terminal-title/SKILL.md +61 -0
- package/framework/skills/level-0-meta/terminal-title/scripts/set_title.sh +65 -0
- package/framework/skills/level-0-meta/tool-usage-guide/SKILL.md +13 -206
- package/framework/skills/level-0-meta/tool-usage-guide/references/tools-per-phase.md +213 -0
- package/framework/skills/level-0-meta/verification-before-completion/SKILL.md +2 -0
- package/framework/skills/level-1-workflows/phase-clarify/SKILL.md +4 -7
- package/framework/skills/level-1-workflows/phase-codebase-analysis/SKILL.md +1 -1
- package/framework/skills/level-1-workflows/phase-design/SKILL.md +16 -110
- package/framework/skills/level-1-workflows/phase-design/references/architecture-analysis-guide.md +89 -0
- package/framework/skills/level-1-workflows/phase-design/references/spec-authoring-guide.md +55 -0
- package/framework/skills/level-1-workflows/phase-implement/SKILL.md +153 -118
- package/framework/skills/level-1-workflows/phase-implement/references/vsa-implementation-guide.md +92 -0
- package/framework/skills/level-1-workflows/phase-setup/SKILL.md +1 -2
- package/framework/skills/level-1-workflows/phase-tasks/SKILL.md +11 -158
- package/framework/skills/level-1-workflows/phase-tasks/references/task-planning-patterns.md +172 -0
- package/framework/skills/level-1-workflows/phase-uiux/SKILL.md +42 -3
- package/framework/squad-templates/backend-only.json +14 -1
- package/framework/squad-templates/frontend-only.json +14 -1
- package/framework/squad-templates/full-stack.json +25 -8
- package/framework/standards/STANDARDS.json +631 -86
- package/framework/standards/frontend/design-system/aesthetic-direction.md +213 -0
- package/framework/templates/project/validate.js +122 -0
- package/framework/workflows/configs/zero-touch.json +7 -0
- package/package.json +1 -1
- package/src/commands/agents/dispatch-agents.js +53 -10
- package/src/commands/state/advance-phase.js +56 -0
- package/src/commands/state/index.js +2 -1
- package/src/commands/state/phase-runner.js +215 -0
- package/src/commands/tasks/task.js +23 -2
- package/src/core/paths/output-schema.js +1 -1
- package/src/lib/generators/recap-generator.js +16 -0
- package/src/lib/orchestration/team-orchestrator.js +171 -89
- package/src/lib/phase-chain/eligibility-checker.js +243 -0
- package/src/lib/standards/digest-builder.js +231 -0
- package/src/lib/validators/blazor/blazor-concurrency-analyzer.js +39 -0
- package/src/lib/validators/nextjs/next-component-validator.js +2 -0
- package/src/lib/validators/validation-runner.js +2 -2
- package/src/utils/file-copier.js +1 -0
- package/src/utils/hooks-installer.js +31 -7
|
@@ -5,7 +5,7 @@ argument-hint: "[feature-name]"
|
|
|
5
5
|
disable-model-invocation: true
|
|
6
6
|
user-invocable: false
|
|
7
7
|
allowed-tools: Read, Write, Edit, Bash, Glob, Grep
|
|
8
|
-
cliVersion: "4.8.
|
|
8
|
+
cliVersion: "4.8.15"
|
|
9
9
|
---
|
|
10
10
|
|
|
11
11
|
# MORPH Tasks - FASE 4
|
|
@@ -71,6 +71,8 @@ TaskCreate: "Gerar tasks.md" → activeForm: "Gerando tasks.md"
|
|
|
71
71
|
TaskCreate: "Avanço de fase" → activeForm: "Avançando fase"
|
|
72
72
|
```
|
|
73
73
|
|
|
74
|
+
> **Nota:** As tasks individuais T001-T00N serão criadas como native tasks durante a fase de implementação (`phase-implement`). Aqui mantemos apenas as 3 tasks de alto nível desta sessão de planejamento.
|
|
75
|
+
|
|
74
76
|
---
|
|
75
77
|
|
|
76
78
|
## Workflow
|
|
@@ -116,90 +118,15 @@ cat .morph/config/config.json | grep -A3 '"architecture"'
|
|
|
116
118
|
|
|
117
119
|
### Passo 0.5: Plano de Tasks — VSA
|
|
118
120
|
|
|
119
|
-
|
|
121
|
+
> Para padrões de tarefas VSA e mapeamento DDD por nível, veja `references/task-planning-patterns.md`
|
|
120
122
|
|
|
121
|
-
Leia a seção `## Architecture Style: Vertical Slice` do spec.md para o **VSA Blueprint
|
|
123
|
+
Leia a seção `## Architecture Style: Vertical Slice` do spec.md para o **VSA Blueprint**:
|
|
122
124
|
|
|
123
125
|
```bash
|
|
124
126
|
grep -A30 "## Architecture Style" ".morph/features/$ARGUMENTS/1-design/spec.md"
|
|
125
127
|
```
|
|
126
128
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
| Categoria | Descrição | Arquivo(s) |
|
|
130
|
-
|-----------|-----------|------------|
|
|
131
|
-
| **entity** | Entity class + DbSet no ApplicationDbContext | `Entities/{Entity}.cs`, `Database/ApplicationDbContext.cs` |
|
|
132
|
-
| **errors** | `{Entity}Errors` static class com factory methods | `Features/{Entity}Feature/{Entity}Errors.cs` |
|
|
133
|
-
| **tags** | Constante em ApiTags (se tag nova) | `Constants/ApiTags.cs` |
|
|
134
|
-
| **migration** | `dotnet ef migrations add` + `database update` | `Migrations/...` |
|
|
135
|
-
| **slice** | Slice completo: Handler (+ Request + Response records) + Validator + Endpoint | `Features/{Entity}Feature/{Op}/{Op}Handler.cs`, `...Validator.cs`, `...Endpoint.cs` |
|
|
136
|
-
| **tests** | Unit tests dos handlers | `Tests/Features/{Entity}Feature/...` |
|
|
137
|
-
| **docs** | README, Swagger, comentários | — |
|
|
138
|
-
|
|
139
|
-
**Ordem obrigatória (bottom-up VSA):**
|
|
140
|
-
|
|
141
|
-
```
|
|
142
|
-
T001: Entity + DbContext DbSet
|
|
143
|
-
↓
|
|
144
|
-
T002: {Entity}Errors (factory methods)
|
|
145
|
-
↓
|
|
146
|
-
T003: ApiTags constant (se tag ainda não existe)
|
|
147
|
-
↓
|
|
148
|
-
T004: Migration (Add{Entity} + database update)
|
|
149
|
-
↓
|
|
150
|
-
T005: Slice Create{Entity} ← Handler+Validator+Endpoint = 1 task
|
|
151
|
-
T006: Slice GetAll{Entity}s ← Handler+Endpoint = 1 task (sem Validator)
|
|
152
|
-
T007: Slice Get{Entity}ById ← Handler+Validator+Endpoint = 1 task
|
|
153
|
-
T008: Slice Update{Entity} ← Handler+Validator+Endpoint = 1 task
|
|
154
|
-
T009: Slice Delete{Entity} ← Handler+Validator+Endpoint = 1 task
|
|
155
|
-
↓
|
|
156
|
-
T010+: Slices customizados (operações extra do VSA Blueprint)
|
|
157
|
-
↓
|
|
158
|
-
T0NN: Tests
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
**Regras VSA para tasks:**
|
|
162
|
-
- 1 task = 1 slice completo (Handler + Validator + Endpoint num único task)
|
|
163
|
-
- `GetAll` NÃO tem Validator — mencionar explicitamente no task
|
|
164
|
-
- Cada task de slice lista os 3 arquivos que devem ser criados no campo `files`
|
|
165
|
-
- Entity task deve incluir a linha `DbSet<{Entity}>` no `ApplicationDbContext`
|
|
166
|
-
- Migration task é separada da entity task (pode rodar em paralelo com errors + tags)
|
|
167
|
-
|
|
168
|
-
**Exemplo de tasks VSA geradas:**
|
|
169
|
-
|
|
170
|
-
```json
|
|
171
|
-
{ "id": "T001", "title": "Criar Entity Book + registrar DbSet no ApplicationDbContext",
|
|
172
|
-
"category": "entity", "dependencies": [], "estimatedMinutes": 20,
|
|
173
|
-
"files": ["Entities/Book.cs", "Database/ApplicationDbContext.cs"] }
|
|
174
|
-
|
|
175
|
-
{ "id": "T002", "title": "Criar BookErrors (NotFound + outros factory methods)",
|
|
176
|
-
"category": "errors", "dependencies": ["T001"], "estimatedMinutes": 10,
|
|
177
|
-
"files": ["Features/BookFeature/BookErrors.cs"] }
|
|
178
|
-
|
|
179
|
-
{ "id": "T003", "title": "Adicionar ApiTags.Books em Constants/ApiTags.cs",
|
|
180
|
-
"category": "tags", "dependencies": [], "estimatedMinutes": 5,
|
|
181
|
-
"files": ["Constants/ApiTags.cs"] }
|
|
182
|
-
|
|
183
|
-
{ "id": "T004", "title": "Criar migration AddBook + aplicar ao banco",
|
|
184
|
-
"category": "migration", "dependencies": ["T001"], "estimatedMinutes": 10,
|
|
185
|
-
"files": ["Migrations/...AddBook.cs"] }
|
|
186
|
-
|
|
187
|
-
{ "id": "T005", "title": "Implementar slice CreateBook (Handler + Validator + Endpoint)",
|
|
188
|
-
"category": "slice", "dependencies": ["T001", "T002", "T003", "T004"],
|
|
189
|
-
"estimatedMinutes": 45,
|
|
190
|
-
"files": [
|
|
191
|
-
"Features/BookFeature/CreateBook/CreateBookHandler.cs",
|
|
192
|
-
"Features/BookFeature/CreateBook/CreateBookValidator.cs",
|
|
193
|
-
"Features/BookFeature/CreateBook/CreateBookEndpoint.cs"
|
|
194
|
-
] }
|
|
195
|
-
|
|
196
|
-
{ "id": "T006", "title": "Implementar slice GetAllBooks (Handler + Endpoint, sem Validator)",
|
|
197
|
-
"category": "slice", "dependencies": ["T001", "T004"], "estimatedMinutes": 25,
|
|
198
|
-
"files": [
|
|
199
|
-
"Features/BookFeature/GetAllBooks/GetAllBooksHandler.cs",
|
|
200
|
-
"Features/BookFeature/GetAllBooks/GetAllBooksEndpoint.cs"
|
|
201
|
-
] }
|
|
202
|
-
```
|
|
129
|
+
Crie uma task por slice (entity → errors → tags → migration → slices CRUD → slices custom → tests). Cada slice = Handler + Validator + Endpoint numa única task. `GetAll` não tem Validator.
|
|
203
130
|
|
|
204
131
|
**Após definir tasks VSA, pule direto para o Passo 3 (Dependências).**
|
|
205
132
|
|
|
@@ -207,39 +134,15 @@ T0NN: Tests
|
|
|
207
134
|
|
|
208
135
|
### Passo 0.6: Ler Nível de Domínio — DDD
|
|
209
136
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
Antes de quebrar tasks, leia a seção `## Domain Complexity` do spec.md:
|
|
137
|
+
Leia a seção `## Domain Complexity` do spec.md:
|
|
213
138
|
|
|
214
139
|
```bash
|
|
215
140
|
grep -A15 "## Domain Complexity" ".morph/features/$ARGUMENTS/1-design/spec.md"
|
|
216
141
|
```
|
|
217
142
|
|
|
218
|
-
> Se a seção não existir
|
|
219
|
-
|
|
220
|
-
Use o nível para **restringir** as categorias de tasks às listadas para o nível detectado:
|
|
221
|
-
|
|
222
|
-
| Nível | Categorias de Tasks |
|
|
223
|
-
|-------|---------------------|
|
|
224
|
-
| **1 — CRUD** | `domain` (Entity simples) → `infrastructure` (Repository, EF Config) → `application` (Service CRUD) → `presentation` (API/Page) → `tests` |
|
|
225
|
-
| **2 — Business Logic** | `domain` (AggregateRoot, ValueObjects, DomainEvents) → `infrastructure` (Repository, EF Config) → `application` (Commands, Queries, Handlers) → `presentation` (API/Page) → `tests` |
|
|
226
|
-
| **3 — Bounded Context** | `domain-bc` (BC setup, Aggregates, Events) → `infrastructure` (BC repositories, EF) → `application` (Commands, Queries, Integration handlers) → `presentation` → `tests` |
|
|
227
|
-
|
|
228
|
-
**Nível 1:** Nenhuma task adicional obrigatória — apenas o padrão CRUD nas categorias listadas.
|
|
143
|
+
> Se a seção não existir, assuma **Nível 1 (CRUD)**.
|
|
229
144
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
**Nível 2 apenas:**
|
|
233
|
-
- `T{N}: Implementar AggregateRoot {EntityName} com factory method e invariants` (domain)
|
|
234
|
-
- `T{N}: Implementar ValueObjects: {lista do Aggregate Blueprint}` (domain)
|
|
235
|
-
- `T{N}: Implementar DomainEvents: {lista do Aggregate Blueprint}` (domain)
|
|
236
|
-
- `T{N}: Implementar Command Handlers com MediatR` (application)
|
|
237
|
-
- `T{N}: Implementar Query Handlers com read models` (application)
|
|
238
|
-
|
|
239
|
-
**Nível 3 apenas (além do Nível 2):**
|
|
240
|
-
- `T{N}: Configurar namespace/pasta do Bounded Context {BoundedContext}` (infrastructure)
|
|
241
|
-
- `T{N}: Implementar Integration Events para comunicação cross-BC` (domain-bc)
|
|
242
|
-
- `T{N}: Implementar handlers de Integration Events` (application)
|
|
145
|
+
Use o nível para restringir categorias (Nível 1: domain→infra→application→presentation→tests; Nível 2: adiciona AggregateRoot, ValueObjects, DomainEvents, CQRS handlers; Nível 3: adiciona BC setup, Integration Events). Ver `references/task-planning-patterns.md` para tabela completa.
|
|
243
146
|
|
|
244
147
|
---
|
|
245
148
|
|
|
@@ -256,58 +159,9 @@ Leia `.morph/features/$ARGUMENTS/1-design/spec.md` e identifique:
|
|
|
256
159
|
|
|
257
160
|
### Passo 2: Quebrar em Tasks
|
|
258
161
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
#### 2.1. Estrutura de Task
|
|
262
|
-
|
|
263
|
-
```json
|
|
264
|
-
{
|
|
265
|
-
"id": "T001",
|
|
266
|
-
"title": "Criar Entity {Nome}",
|
|
267
|
-
"description": "Implementar entity {Nome} com propriedades X, Y, Z seguindo padrões EF Core",
|
|
268
|
-
"category": "domain",
|
|
269
|
-
"dependencies": [],
|
|
270
|
-
"estimatedMinutes": 30,
|
|
271
|
-
"status": "pending",
|
|
272
|
-
"specSections": ["## Domain Model", "## Business Rules"],
|
|
273
|
-
"contractInterfaces": ["I{Nome}Repository"],
|
|
274
|
-
"files": [
|
|
275
|
-
"Domain/Entities/{Nome}.cs",
|
|
276
|
-
"Infrastructure/Data/Configurations/{Nome}Configuration.cs"
|
|
277
|
-
]
|
|
278
|
-
}
|
|
279
|
-
```
|
|
280
|
-
|
|
281
|
-
#### 2.2. Categorias de Tasks
|
|
282
|
-
|
|
283
|
-
| Categoria | Descrição | Exemplos |
|
|
284
|
-
|-----------|-----------|----------|
|
|
285
|
-
| **domain** | Entities, Value Objects, Enums | Entity, DomainException |
|
|
286
|
-
| **application** | Services, DTOs, Interfaces | Service, Validator, Mapper |
|
|
287
|
-
| **infrastructure** | DbContext, Repositories, External APIs | EF Config, Repository impl |
|
|
288
|
-
| **presentation** | Controllers, Pages, Components | API endpoint, Blazor page |
|
|
289
|
-
| **tests** | Unit tests, Integration tests | Service tests, API tests |
|
|
290
|
-
| **infra** | Bicep, Migrations, Scripts | Azure resources, DB migration |
|
|
291
|
-
| **docs** | README, API docs, Swagger | OpenAPI spec, README update |
|
|
162
|
+
> Para estrutura JSON, categorias e ordem de implementação, veja `references/task-planning-patterns.md`
|
|
292
163
|
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
**Bottom-up approach:**
|
|
296
|
-
```
|
|
297
|
-
1. Domain (Entities, Enums, Value Objects)
|
|
298
|
-
↓
|
|
299
|
-
2. Infrastructure (Repositories, DbContext configs)
|
|
300
|
-
↓
|
|
301
|
-
3. Application (Services, DTOs, Business logic)
|
|
302
|
-
↓
|
|
303
|
-
4. Presentation (Controllers, Pages, Components)
|
|
304
|
-
↓
|
|
305
|
-
5. Tests (Unit → Integration)
|
|
306
|
-
↓
|
|
307
|
-
6. Infra (Bicep, Migrations, Deploy scripts)
|
|
308
|
-
↓
|
|
309
|
-
7. Docs (README, Swagger, Comments)
|
|
310
|
-
```
|
|
164
|
+
Crie tasks no formato **T{NNN}** seguindo bottom-up: domain → infrastructure → application → presentation → tests → infra → docs.
|
|
311
165
|
|
|
312
166
|
### Passo 3: Definir Dependências
|
|
313
167
|
|
|
@@ -363,7 +217,6 @@ Se houver recursos Azure, adicionar tasks de Bicep e migrations.
|
|
|
363
217
|
### Passo 8: Atualizar State
|
|
364
218
|
|
|
365
219
|
```bash
|
|
366
|
-
npx morph-spec state set $ARGUMENTS phase tasks
|
|
367
220
|
npx morph-spec state set $ARGUMENTS tasks.total {N}
|
|
368
221
|
npx morph-spec state mark-output $ARGUMENTS tasks
|
|
369
222
|
```
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# Task Planning Patterns — VSA e DDD
|
|
2
|
+
|
|
3
|
+
> Padrões detalhados de task planning para VSA e DDD.
|
|
4
|
+
> Referenciado pelos Passos 0.5 e 0.6 de `phase-tasks/SKILL.md`.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Padrão VSA (Vertical Slice Architecture)
|
|
9
|
+
|
|
10
|
+
**Ref:** `framework/standards/architecture/vertical-slice/vertical-slice.md`
|
|
11
|
+
|
|
12
|
+
### Categorias de tasks VSA
|
|
13
|
+
|
|
14
|
+
Uma task por slice — Handler + Validator + Endpoint juntos:
|
|
15
|
+
|
|
16
|
+
| Categoria | Descrição | Arquivo(s) |
|
|
17
|
+
|-----------|-----------|------------|
|
|
18
|
+
| **entity** | Entity class + DbSet no ApplicationDbContext | `Entities/{Entity}.cs`, `Database/ApplicationDbContext.cs` |
|
|
19
|
+
| **errors** | `{Entity}Errors` static class com factory methods | `Features/{Entity}Feature/{Entity}Errors.cs` |
|
|
20
|
+
| **tags** | Constante em ApiTags (se tag nova) | `Constants/ApiTags.cs` |
|
|
21
|
+
| **migration** | `dotnet ef migrations add` + `database update` | `Migrations/...` |
|
|
22
|
+
| **slice** | Slice completo: Handler (+ Request + Response records) + Validator + Endpoint | `Features/{Entity}Feature/{Op}/{Op}Handler.cs`, `...Validator.cs`, `...Endpoint.cs` |
|
|
23
|
+
| **tests** | Unit tests dos handlers | `Tests/Features/{Entity}Feature/...` |
|
|
24
|
+
| **docs** | README, Swagger, comentários | — |
|
|
25
|
+
|
|
26
|
+
### Ordem obrigatória (bottom-up VSA)
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
T001: Entity + DbContext DbSet
|
|
30
|
+
↓
|
|
31
|
+
T002: {Entity}Errors (factory methods)
|
|
32
|
+
↓
|
|
33
|
+
T003: ApiTags constant (se tag ainda não existe)
|
|
34
|
+
↓
|
|
35
|
+
T004: Migration (Add{Entity} + database update)
|
|
36
|
+
↓
|
|
37
|
+
T005: Slice Create{Entity} ← Handler+Validator+Endpoint = 1 task
|
|
38
|
+
T006: Slice GetAll{Entity}s ← Handler+Endpoint = 1 task (sem Validator)
|
|
39
|
+
T007: Slice Get{Entity}ById ← Handler+Validator+Endpoint = 1 task
|
|
40
|
+
T008: Slice Update{Entity} ← Handler+Validator+Endpoint = 1 task
|
|
41
|
+
T009: Slice Delete{Entity} ← Handler+Validator+Endpoint = 1 task
|
|
42
|
+
↓
|
|
43
|
+
T010+: Slices customizados (operações extra do VSA Blueprint)
|
|
44
|
+
↓
|
|
45
|
+
T0NN: Tests
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Regras VSA para tasks
|
|
49
|
+
|
|
50
|
+
- 1 task = 1 slice completo (Handler + Validator + Endpoint num único task)
|
|
51
|
+
- `GetAll` NÃO tem Validator — mencionar explicitamente no task
|
|
52
|
+
- Cada task de slice lista os 3 arquivos que devem ser criados no campo `files`
|
|
53
|
+
- Entity task deve incluir a linha `DbSet<{Entity}>` no `ApplicationDbContext`
|
|
54
|
+
- Migration task é separada da entity task (pode rodar em paralelo com errors + tags)
|
|
55
|
+
|
|
56
|
+
### Exemplos de tasks VSA
|
|
57
|
+
|
|
58
|
+
```json
|
|
59
|
+
{ "id": "T001", "title": "Criar Entity Book + registrar DbSet no ApplicationDbContext",
|
|
60
|
+
"category": "entity", "dependencies": [], "estimatedMinutes": 20,
|
|
61
|
+
"files": ["Entities/Book.cs", "Database/ApplicationDbContext.cs"] }
|
|
62
|
+
|
|
63
|
+
{ "id": "T002", "title": "Criar BookErrors (NotFound + outros factory methods)",
|
|
64
|
+
"category": "errors", "dependencies": ["T001"], "estimatedMinutes": 10,
|
|
65
|
+
"files": ["Features/BookFeature/BookErrors.cs"] }
|
|
66
|
+
|
|
67
|
+
{ "id": "T003", "title": "Adicionar ApiTags.Books em Constants/ApiTags.cs",
|
|
68
|
+
"category": "tags", "dependencies": [], "estimatedMinutes": 5,
|
|
69
|
+
"files": ["Constants/ApiTags.cs"] }
|
|
70
|
+
|
|
71
|
+
{ "id": "T004", "title": "Criar migration AddBook + aplicar ao banco",
|
|
72
|
+
"category": "migration", "dependencies": ["T001"], "estimatedMinutes": 10,
|
|
73
|
+
"files": ["Migrations/...AddBook.cs"] }
|
|
74
|
+
|
|
75
|
+
{ "id": "T005", "title": "Implementar slice CreateBook (Handler + Validator + Endpoint)",
|
|
76
|
+
"category": "slice", "dependencies": ["T001", "T002", "T003", "T004"],
|
|
77
|
+
"estimatedMinutes": 45,
|
|
78
|
+
"files": [
|
|
79
|
+
"Features/BookFeature/CreateBook/CreateBookHandler.cs",
|
|
80
|
+
"Features/BookFeature/CreateBook/CreateBookValidator.cs",
|
|
81
|
+
"Features/BookFeature/CreateBook/CreateBookEndpoint.cs"
|
|
82
|
+
] }
|
|
83
|
+
|
|
84
|
+
{ "id": "T006", "title": "Implementar slice GetAllBooks (Handler + Endpoint, sem Validator)",
|
|
85
|
+
"category": "slice", "dependencies": ["T001", "T004"], "estimatedMinutes": 25,
|
|
86
|
+
"files": [
|
|
87
|
+
"Features/BookFeature/GetAllBooks/GetAllBooksHandler.cs",
|
|
88
|
+
"Features/BookFeature/GetAllBooks/GetAllBooksEndpoint.cs"
|
|
89
|
+
] }
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Padrão DDD — Mapeamento de Níveis para Categorias
|
|
95
|
+
|
|
96
|
+
**Ref:** `framework/standards/architecture/ddd/complexity-levels.md`
|
|
97
|
+
|
|
98
|
+
### Categorias por nível de complexidade
|
|
99
|
+
|
|
100
|
+
| Nível | Categorias de Tasks |
|
|
101
|
+
|-------|---------------------|
|
|
102
|
+
| **1 — CRUD** | `domain` (Entity simples) → `infrastructure` (Repository, EF Config) → `application` (Service CRUD) → `presentation` (API/Page) → `tests` |
|
|
103
|
+
| **2 — Business Logic** | `domain` (AggregateRoot, ValueObjects, DomainEvents) → `infrastructure` (Repository, EF Config) → `application` (Commands, Queries, Handlers) → `presentation` (API/Page) → `tests` |
|
|
104
|
+
| **3 — Bounded Context** | `domain-bc` (BC setup, Aggregates, Events) → `infrastructure` (BC repositories, EF) → `application` (Commands, Queries, Integration handlers) → `presentation` → `tests` |
|
|
105
|
+
|
|
106
|
+
**Nível 1:** Nenhuma task adicional obrigatória — apenas o padrão CRUD nas categorias listadas.
|
|
107
|
+
|
|
108
|
+
### Tasks adicionais obrigatórias por nível
|
|
109
|
+
|
|
110
|
+
**Nível 2 apenas:**
|
|
111
|
+
- `T{N}: Implementar AggregateRoot {EntityName} com factory method e invariants` (domain)
|
|
112
|
+
- `T{N}: Implementar ValueObjects: {lista do Aggregate Blueprint}` (domain)
|
|
113
|
+
- `T{N}: Implementar DomainEvents: {lista do Aggregate Blueprint}` (domain)
|
|
114
|
+
- `T{N}: Implementar Command Handlers com MediatR` (application)
|
|
115
|
+
- `T{N}: Implementar Query Handlers com read models` (application)
|
|
116
|
+
|
|
117
|
+
**Nível 3 apenas (além do Nível 2):**
|
|
118
|
+
- `T{N}: Configurar namespace/pasta do Bounded Context {BoundedContext}` (infrastructure)
|
|
119
|
+
- `T{N}: Implementar Integration Events para comunicação cross-BC` (domain-bc)
|
|
120
|
+
- `T{N}: Implementar handlers de Integration Events` (application)
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Estrutura de Task (formato JSON)
|
|
125
|
+
|
|
126
|
+
```json
|
|
127
|
+
{
|
|
128
|
+
"id": "T001",
|
|
129
|
+
"title": "Criar Entity {Nome}",
|
|
130
|
+
"description": "Implementar entity {Nome} com propriedades X, Y, Z seguindo padrões EF Core",
|
|
131
|
+
"category": "domain",
|
|
132
|
+
"dependencies": [],
|
|
133
|
+
"estimatedMinutes": 30,
|
|
134
|
+
"status": "pending",
|
|
135
|
+
"specSections": ["## Domain Model", "## Business Rules"],
|
|
136
|
+
"contractInterfaces": ["I{Nome}Repository"],
|
|
137
|
+
"files": [
|
|
138
|
+
"Domain/Entities/{Nome}.cs",
|
|
139
|
+
"Infrastructure/Data/Configurations/{Nome}Configuration.cs"
|
|
140
|
+
]
|
|
141
|
+
}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Categorias de Tasks (DDD)
|
|
145
|
+
|
|
146
|
+
| Categoria | Descrição | Exemplos |
|
|
147
|
+
|-----------|-----------|----------|
|
|
148
|
+
| **domain** | Entities, Value Objects, Enums | Entity, DomainException |
|
|
149
|
+
| **application** | Services, DTOs, Interfaces | Service, Validator, Mapper |
|
|
150
|
+
| **infrastructure** | DbContext, Repositories, External APIs | EF Config, Repository impl |
|
|
151
|
+
| **presentation** | Controllers, Pages, Components | API endpoint, Blazor page |
|
|
152
|
+
| **tests** | Unit tests, Integration tests | Service tests, API tests |
|
|
153
|
+
| **infra** | Bicep, Migrations, Scripts | Azure resources, DB migration |
|
|
154
|
+
| **docs** | README, API docs, Swagger | OpenAPI spec, README update |
|
|
155
|
+
|
|
156
|
+
## Ordem de Implementação Bottom-Up
|
|
157
|
+
|
|
158
|
+
```
|
|
159
|
+
1. Domain (Entities, Enums, Value Objects)
|
|
160
|
+
↓
|
|
161
|
+
2. Infrastructure (Repositories, DbContext configs)
|
|
162
|
+
↓
|
|
163
|
+
3. Application (Services, DTOs, Business logic)
|
|
164
|
+
↓
|
|
165
|
+
4. Presentation (Controllers, Pages, Components)
|
|
166
|
+
↓
|
|
167
|
+
5. Tests (Unit → Integration)
|
|
168
|
+
↓
|
|
169
|
+
6. Infra (Bicep, Migrations, Deploy scripts)
|
|
170
|
+
↓
|
|
171
|
+
7. Docs (README, Swagger, Comments)
|
|
172
|
+
```
|
|
@@ -4,7 +4,7 @@ description: MORPH-SPEC Phase 1.5 (UI/UX). Creates design-system.md, mockups.md,
|
|
|
4
4
|
argument-hint: "[feature-name]"
|
|
5
5
|
user-invocable: false
|
|
6
6
|
allowed-tools: Read, Write, Edit, Bash, Glob, Grep
|
|
7
|
-
cliVersion: "4.8.
|
|
7
|
+
cliVersion: "4.8.15"
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
# MORPH UI/UX Design - FASE 1.5
|
|
@@ -87,6 +87,26 @@ npx morph-spec state get $ARGUMENTS
|
|
|
87
87
|
|
|
88
88
|
Se `uiux-designer` NÃO estiver nos `activeAgents`, pule esta fase e continue para FASE 2 (Design).
|
|
89
89
|
|
|
90
|
+
### Passo 1.5: Design Thinking — Direção Estética
|
|
91
|
+
|
|
92
|
+
> **Ref:** `framework/standards/frontend/design-system/aesthetic-direction.md`
|
|
93
|
+
|
|
94
|
+
**ANTES de coletar requisitos técnicos**, definir a direção visual com 4 perguntas:
|
|
95
|
+
|
|
96
|
+
1. **Purpose**: Que problema resolve? Quem usa? Qual o contexto profissional?
|
|
97
|
+
2. **Tone**: Qual direção? (Minimal Refined / Editorial / Soft Professional / Industrial / Modern Luxury)
|
|
98
|
+
3. **Differentiation**: Qual o 1 elemento memorável desta interface?
|
|
99
|
+
4. **Constraints**: Framework, performance budget, brand guidelines existentes
|
|
100
|
+
|
|
101
|
+
**CRITICAL:** Commitar à direção ANTES das specs técnicas. Documentar em `ui-design-system.md`
|
|
102
|
+
na seção `## Aesthetic Direction` (template disponível no standard acima).
|
|
103
|
+
|
|
104
|
+
**Anti-padrões a evitar:**
|
|
105
|
+
- ❌ Gradiente roxo em fundo branco (AI cliché)
|
|
106
|
+
- ❌ Inter/Roboto como fonte de display
|
|
107
|
+
- ❌ Grid 3-colunas de cards sem diferencial visual
|
|
108
|
+
- ❌ Paleta de 5 cores de peso igual (sem dominant + accent)
|
|
109
|
+
|
|
90
110
|
### Passo 2: Coletar Input do Usuário
|
|
91
111
|
|
|
92
112
|
**SEMPRE perguntar ao usuário PRIMEIRO:**
|
|
@@ -128,6 +148,8 @@ Crie os seguintes arquivos em `.morph/features/$ARGUMENTS/`:
|
|
|
128
148
|
|
|
129
149
|
**Se não existe:**
|
|
130
150
|
- Crie design system feature-level completo com:
|
|
151
|
+
- **Seção `## Aesthetic Direction`** (usar template de `aesthetic-direction.md`):
|
|
152
|
+
direção, font pair, color philosophy, motion intent, composition approach
|
|
131
153
|
- Paleta de cores (primary, secondary, accent, semantic)
|
|
132
154
|
- Tipografia (heading scales, body text, code)
|
|
133
155
|
- Spacing e layout (grid, margins, paddings)
|
|
@@ -161,8 +183,11 @@ Fluxos de usuário completos:
|
|
|
161
183
|
|
|
162
184
|
**⏸️ PAUSE - Antes de prosseguir para acessibilidade:**
|
|
163
185
|
|
|
186
|
+
- [ ] Direção estética definida e documentada em `ui-design-system.md`?
|
|
187
|
+
- [ ] Font pair especificado (não apenas Inter/Roboto para display)?
|
|
188
|
+
- [ ] Color philosophy: dominant + accent + rationale documentados?
|
|
164
189
|
- [ ] Design system definido (project-level ou feature-level)?
|
|
165
|
-
- [ ] Wireframes cobrem
|
|
190
|
+
- [ ] Wireframes cobrem todos os estados (loading, error, empty, success)?
|
|
166
191
|
- [ ] Componentes especificados com props reais da biblioteca UI escolhida?
|
|
167
192
|
- [ ] Fluxos de usuário completos com edge cases?
|
|
168
193
|
- [ ] Biblioteca UI escolhida documentada como ADR em `decisions.md`?
|
|
@@ -190,7 +215,6 @@ Documente nos arquivos UI:
|
|
|
190
215
|
### Passo 6: Atualizar State
|
|
191
216
|
|
|
192
217
|
```bash
|
|
193
|
-
npx morph-spec state set $ARGUMENTS phase uiux-design
|
|
194
218
|
npx morph-spec state mark-output $ARGUMENTS ui-design-system
|
|
195
219
|
npx morph-spec state mark-output $ARGUMENTS ui-mockups
|
|
196
220
|
npx morph-spec state mark-output $ARGUMENTS ui-components
|
|
@@ -211,6 +235,21 @@ npx morph-spec state mark-output $ARGUMENTS ui-flows
|
|
|
211
235
|
- `.morph/features/$ARGUMENTS/2-ui/flows.md`
|
|
212
236
|
- `.morph/features/$ARGUMENTS/1-design/decisions.md` (atualizado com ADR UI library)
|
|
213
237
|
|
|
238
|
+
### Passo 7: Validar Design com Frontend Review
|
|
239
|
+
|
|
240
|
+
Após gerar todos os 4 outputs de UI e atualizar o state (Passo 6):
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
/frontend-review $ARGUMENTS
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
O skill valida: contraste WCAG dos tokens, existência de todos os outputs, acessibilidade
|
|
247
|
+
estática no design, e gera screenshots dos mockups se dev server disponível.
|
|
248
|
+
|
|
249
|
+
**🚫 Se o frontend-review bloquear**, corrija os issues antes de apresentar ao usuário.
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
214
253
|
## PAUSA OBRIGATÓRIA
|
|
215
254
|
|
|
216
255
|
Apresente ao usuário 3 ações sugeridas:
|
|
@@ -30,5 +30,18 @@
|
|
|
30
30
|
"ef-modeler": "Entity models, DbContext, migrations",
|
|
31
31
|
"api-designer": "Controllers, DTOs, Swagger docs"
|
|
32
32
|
},
|
|
33
|
-
"estimatedParallelGain": "2-3x throughput vs sequential"
|
|
33
|
+
"estimatedParallelGain": "2-3x throughput vs sequential",
|
|
34
|
+
"agent_team": {
|
|
35
|
+
"team_name_pattern": "{feature}-backend",
|
|
36
|
+
"lead": "standards-architect",
|
|
37
|
+
"teammates": [
|
|
38
|
+
{
|
|
39
|
+
"id": "dotnet-senior",
|
|
40
|
+
"spawn_context": "standards/coding.md, standards/architecture/, contracts.cs, spec.md",
|
|
41
|
+
"task_scope": "backend tasks (domain logic, application services, EF Core, API endpoints, DTOs)"
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"coordination_notes": "Single-domain squad — Agent Teams not required. Use subagents for parallelization.",
|
|
45
|
+
"quality_gate": "Require plan approval before implementation. Only approve plans that match contracts.cs."
|
|
46
|
+
}
|
|
34
47
|
}
|
|
@@ -30,5 +30,18 @@
|
|
|
30
30
|
"blazor-builder": ".razor components, code-behind, state management",
|
|
31
31
|
"css-specialist": "CSS modules, design system implementation, responsive layout"
|
|
32
32
|
},
|
|
33
|
-
"estimatedParallelGain": "2x throughput vs sequential"
|
|
33
|
+
"estimatedParallelGain": "2x throughput vs sequential",
|
|
34
|
+
"agent_team": {
|
|
35
|
+
"team_name_pattern": "{feature}-frontend",
|
|
36
|
+
"lead": "standards-architect",
|
|
37
|
+
"teammates": [
|
|
38
|
+
{
|
|
39
|
+
"id": "ui-designer",
|
|
40
|
+
"spawn_context": "standards/css-architecture.md, standards/css-design-system.md, design-system.md, spec.md",
|
|
41
|
+
"task_scope": "frontend tasks (Blazor components, CSS, design system implementation, responsive layout)"
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"coordination_notes": "Single-domain squad — Agent Teams not required. Use subagents for parallelization.",
|
|
45
|
+
"quality_gate": "Require plan approval before implementation. Only approve plans that match spec.md and design-system.md."
|
|
46
|
+
}
|
|
34
47
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"name": "Full Stack Squad",
|
|
4
4
|
"description": "Full-stack feature squad: backend API + Blazor frontend + Azure infra",
|
|
5
5
|
"parallel": true,
|
|
6
|
-
"coordination": "
|
|
6
|
+
"coordination": "standards-architect",
|
|
7
7
|
"waitForAll": true,
|
|
8
8
|
"agents": [
|
|
9
9
|
{
|
|
@@ -24,12 +24,6 @@
|
|
|
24
24
|
"domain": "infrastructure",
|
|
25
25
|
"standards": ["azure.md", "bicep.md"]
|
|
26
26
|
},
|
|
27
|
-
{
|
|
28
|
-
"id": "thread-orchestrator",
|
|
29
|
-
"role": "Parallel Coordinator",
|
|
30
|
-
"domain": "developer-experience",
|
|
31
|
-
"standards": []
|
|
32
|
-
},
|
|
33
27
|
{
|
|
34
28
|
"id": "context-optimizer",
|
|
35
29
|
"role": "Context Manager",
|
|
@@ -48,5 +42,28 @@
|
|
|
48
42
|
"frontend": "Blazor components, pages, CSS",
|
|
49
43
|
"infrastructure": "Bicep templates, deployment scripts"
|
|
50
44
|
},
|
|
51
|
-
"estimatedParallelGain": "3-5x throughput vs sequential"
|
|
45
|
+
"estimatedParallelGain": "3-5x throughput vs sequential",
|
|
46
|
+
"agent_team": {
|
|
47
|
+
"team_name_pattern": "{feature}-full-stack",
|
|
48
|
+
"lead": "standards-architect",
|
|
49
|
+
"teammates": [
|
|
50
|
+
{
|
|
51
|
+
"id": "dotnet-senior",
|
|
52
|
+
"spawn_context": "standards/coding.md, standards/architecture/, contracts.cs, spec.md",
|
|
53
|
+
"task_scope": "backend tasks (domain logic, EF Core, API endpoints, DTOs)"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"id": "blazor-builder",
|
|
57
|
+
"spawn_context": "standards/coding.md, standards/blazor-components.md, design-system.md, spec.md",
|
|
58
|
+
"task_scope": "frontend tasks (Blazor pages, components, CSS, state management)"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"id": "bicep-architect",
|
|
62
|
+
"spawn_context": "standards/azure.md, standards/bicep.md, spec.md",
|
|
63
|
+
"task_scope": "infrastructure tasks (Bicep templates, App Service, Azure resources)"
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
"coordination_notes": "Backend deve sinalizar quando contracts.cs/DTOs estiverem estáveis antes do frontend prosseguir com chamadas de API. Infrastructure pode executar em paralelo com backend/frontend.",
|
|
67
|
+
"quality_gate": "Require plan approval before each teammate implements. Only approve plans that match contracts.cs and spec.md."
|
|
68
|
+
}
|
|
52
69
|
}
|