@polymorphism-tech/morph-spec 4.8.12 → 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.
Files changed (76) hide show
  1. package/README.md +379 -379
  2. package/bin/morph-spec.js +23 -2
  3. package/bin/{task-manager.cjs → task-manager.js} +249 -172
  4. package/claude-plugin.json +14 -14
  5. package/docs/CHEATSHEET.md +203 -203
  6. package/docs/QUICKSTART.md +1 -1
  7. package/framework/agents.json +224 -140
  8. package/framework/hooks/README.md +202 -202
  9. package/framework/hooks/claude-code/post-tool-use/dispatch.js +48 -2
  10. package/framework/hooks/claude-code/post-tool-use/validator-feedback.js +151 -0
  11. package/framework/hooks/claude-code/pre-tool-use/enforce-phase-writes.js +12 -0
  12. package/framework/hooks/claude-code/pre-tool-use/protect-spec-files.js +6 -0
  13. package/framework/hooks/claude-code/session-start/inject-morph-context.js +34 -0
  14. package/framework/hooks/claude-code/statusline.py +6 -0
  15. package/framework/hooks/claude-code/stop/validate-completion.js +38 -4
  16. package/framework/hooks/claude-code/teammate-idle/teammate-idle.js +87 -0
  17. package/framework/hooks/claude-code/user-prompt/set-terminal-title.js +58 -0
  18. package/framework/hooks/shared/phase-utils.js +4 -1
  19. package/framework/hooks/shared/state-reader.js +1 -0
  20. package/framework/skills/README.md +1 -0
  21. package/framework/skills/level-0-meta/brainstorming/SKILL.md +2 -0
  22. package/framework/skills/level-0-meta/code-review/SKILL.md +16 -0
  23. package/framework/skills/level-0-meta/code-review/references/review-guidelines.md +100 -0
  24. package/framework/skills/level-0-meta/code-review/scripts/scan-csharp.mjs +36 -6
  25. package/framework/skills/level-0-meta/code-review-nextjs/SKILL.md +16 -0
  26. package/framework/skills/level-0-meta/code-review-nextjs/scripts/scan-nextjs.mjs +189 -0
  27. package/framework/skills/level-0-meta/frontend-review/SKILL.md +359 -0
  28. package/framework/skills/level-0-meta/frontend-review/scripts/scan-accessibility.mjs +376 -0
  29. package/framework/skills/level-0-meta/morph-checklist/SKILL.md +1 -1
  30. package/framework/skills/level-0-meta/morph-replicate/SKILL.md +10 -8
  31. package/framework/skills/level-0-meta/morph-replicate/references/blazor-html-mapping.md +70 -0
  32. package/framework/skills/level-0-meta/post-implementation/SKILL.md +315 -0
  33. package/framework/skills/level-0-meta/post-implementation/scripts/detect-dev-server.mjs +153 -0
  34. package/framework/skills/level-0-meta/post-implementation/scripts/detect-stack.mjs +234 -0
  35. package/framework/skills/level-0-meta/terminal-title/SKILL.md +61 -0
  36. package/framework/skills/level-0-meta/terminal-title/scripts/set_title.sh +65 -0
  37. package/framework/skills/level-0-meta/tool-usage-guide/SKILL.md +50 -188
  38. package/framework/skills/level-0-meta/tool-usage-guide/references/tools-per-phase.md +213 -0
  39. package/framework/skills/level-0-meta/verification-before-completion/SKILL.md +2 -0
  40. package/framework/skills/level-1-workflows/phase-clarify/SKILL.md +4 -7
  41. package/framework/skills/level-1-workflows/phase-codebase-analysis/SKILL.md +1 -1
  42. package/framework/skills/level-1-workflows/phase-design/SKILL.md +71 -109
  43. package/framework/skills/level-1-workflows/phase-design/references/architecture-analysis-guide.md +89 -0
  44. package/framework/skills/level-1-workflows/phase-design/references/spec-authoring-guide.md +55 -0
  45. package/framework/skills/level-1-workflows/phase-implement/SKILL.md +171 -114
  46. package/framework/skills/level-1-workflows/phase-implement/references/vsa-implementation-guide.md +92 -0
  47. package/framework/skills/level-1-workflows/phase-setup/SKILL.md +1 -2
  48. package/framework/skills/level-1-workflows/phase-tasks/SKILL.md +35 -159
  49. package/framework/skills/level-1-workflows/phase-tasks/references/task-planning-patterns.md +172 -0
  50. package/framework/skills/level-1-workflows/phase-uiux/SKILL.md +42 -3
  51. package/framework/squad-templates/backend-only.json +14 -1
  52. package/framework/squad-templates/frontend-only.json +14 -1
  53. package/framework/squad-templates/full-stack.json +25 -8
  54. package/framework/standards/STANDARDS.json +631 -86
  55. package/framework/standards/frontend/design-system/aesthetic-direction.md +213 -0
  56. package/framework/templates/project/validate.js +122 -0
  57. package/framework/workflows/configs/zero-touch.json +7 -0
  58. package/package.json +87 -87
  59. package/src/commands/agents/dispatch-agents.js +53 -10
  60. package/src/commands/state/advance-phase.js +88 -13
  61. package/src/commands/state/index.js +2 -1
  62. package/src/commands/state/phase-runner.js +215 -0
  63. package/src/commands/tasks/task.js +25 -4
  64. package/src/core/paths/output-schema.js +2 -1
  65. package/src/lib/detectors/design-system-detector.js +5 -4
  66. package/src/lib/generators/recap-generator.js +16 -0
  67. package/src/lib/orchestration/team-orchestrator.js +171 -89
  68. package/src/lib/phase-chain/eligibility-checker.js +243 -0
  69. package/src/lib/standards/digest-builder.js +231 -0
  70. package/src/lib/tasks/task-parser.js +94 -0
  71. package/src/lib/validators/blazor/blazor-concurrency-analyzer.js +39 -0
  72. package/src/lib/validators/content/content-validator.js +34 -106
  73. package/src/lib/validators/nextjs/next-component-validator.js +2 -0
  74. package/src/lib/validators/validation-runner.js +2 -2
  75. package/src/utils/file-copier.js +1 -0
  76. 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.12"
8
+ cliVersion: "4.8.15"
9
9
  ---
10
10
 
11
11
  # MORPH Tasks - FASE 4
@@ -50,6 +50,31 @@ Quebre a especificação em tasks executáveis, defina ordem de execução e est
50
50
 
51
51
  ---
52
52
 
53
+ ## ✅ PRÉ-VOO OBRIGATÓRIO (antes de iniciar breakdown de tasks)
54
+
55
+ ### 1. Ler todos os prerequisitos em PARALELO
56
+
57
+ ```
58
+ # Uma única chamada, não sequencial:
59
+ Read: .morph/features/{feature}/1-design/spec.md
60
+ + Read: .morph/features/{feature}/1-design/contracts.cs
61
+ + Read: .morph/features/{feature}/1-design/decisions.md
62
+ + Read: .morph/features/{feature}/1-design/schema-analysis.md (se existir)
63
+ + Read: .morph/config/config.json (→ architecture.style)
64
+ ```
65
+
66
+ ### 2. Criar tasks de sessão para visibilidade
67
+
68
+ ```
69
+ TaskCreate: "Analisar spec e definir tasks" → activeForm: "Analisando spec"
70
+ TaskCreate: "Gerar tasks.md" → activeForm: "Gerando tasks.md"
71
+ TaskCreate: "Avanço de fase" → activeForm: "Avançando fase"
72
+ ```
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
+
76
+ ---
77
+
53
78
  ## Workflow
54
79
 
55
80
  ### CHECKPOINT DE ENTRADA: Verificar Pré-requisitos
@@ -93,90 +118,15 @@ cat .morph/config/config.json | grep -A3 '"architecture"'
93
118
 
94
119
  ### Passo 0.5: Plano de Tasks — VSA
95
120
 
96
- **Ref:** `framework/standards/architecture/vertical-slice/vertical-slice.md`
121
+ > Para padrões de tarefas VSA e mapeamento DDD por nível, veja `references/task-planning-patterns.md`
97
122
 
98
- Leia a seção `## Architecture Style: Vertical Slice` do spec.md para o **VSA Blueprint** (entity fields, operações, rotas, validações):
123
+ Leia a seção `## Architecture Style: Vertical Slice` do spec.md para o **VSA Blueprint**:
99
124
 
100
125
  ```bash
101
126
  grep -A30 "## Architecture Style" ".morph/features/$ARGUMENTS/1-design/spec.md"
102
127
  ```
103
128
 
104
- **Categorias de tasks VSA** (uma task por slice Handler + Validator + Endpoint juntos):
105
-
106
- | Categoria | Descrição | Arquivo(s) |
107
- |-----------|-----------|------------|
108
- | **entity** | Entity class + DbSet no ApplicationDbContext | `Entities/{Entity}.cs`, `Database/ApplicationDbContext.cs` |
109
- | **errors** | `{Entity}Errors` static class com factory methods | `Features/{Entity}Feature/{Entity}Errors.cs` |
110
- | **tags** | Constante em ApiTags (se tag nova) | `Constants/ApiTags.cs` |
111
- | **migration** | `dotnet ef migrations add` + `database update` | `Migrations/...` |
112
- | **slice** | Slice completo: Handler (+ Request + Response records) + Validator + Endpoint | `Features/{Entity}Feature/{Op}/{Op}Handler.cs`, `...Validator.cs`, `...Endpoint.cs` |
113
- | **tests** | Unit tests dos handlers | `Tests/Features/{Entity}Feature/...` |
114
- | **docs** | README, Swagger, comentários | — |
115
-
116
- **Ordem obrigatória (bottom-up VSA):**
117
-
118
- ```
119
- T001: Entity + DbContext DbSet
120
-
121
- T002: {Entity}Errors (factory methods)
122
-
123
- T003: ApiTags constant (se tag ainda não existe)
124
-
125
- T004: Migration (Add{Entity} + database update)
126
-
127
- T005: Slice Create{Entity} ← Handler+Validator+Endpoint = 1 task
128
- T006: Slice GetAll{Entity}s ← Handler+Endpoint = 1 task (sem Validator)
129
- T007: Slice Get{Entity}ById ← Handler+Validator+Endpoint = 1 task
130
- T008: Slice Update{Entity} ← Handler+Validator+Endpoint = 1 task
131
- T009: Slice Delete{Entity} ← Handler+Validator+Endpoint = 1 task
132
-
133
- T010+: Slices customizados (operações extra do VSA Blueprint)
134
-
135
- T0NN: Tests
136
- ```
137
-
138
- **Regras VSA para tasks:**
139
- - 1 task = 1 slice completo (Handler + Validator + Endpoint num único task)
140
- - `GetAll` NÃO tem Validator — mencionar explicitamente no task
141
- - Cada task de slice lista os 3 arquivos que devem ser criados no campo `files`
142
- - Entity task deve incluir a linha `DbSet<{Entity}>` no `ApplicationDbContext`
143
- - Migration task é separada da entity task (pode rodar em paralelo com errors + tags)
144
-
145
- **Exemplo de tasks VSA geradas:**
146
-
147
- ```json
148
- { "id": "T001", "title": "Criar Entity Book + registrar DbSet no ApplicationDbContext",
149
- "category": "entity", "dependencies": [], "estimatedMinutes": 20,
150
- "files": ["Entities/Book.cs", "Database/ApplicationDbContext.cs"] }
151
-
152
- { "id": "T002", "title": "Criar BookErrors (NotFound + outros factory methods)",
153
- "category": "errors", "dependencies": ["T001"], "estimatedMinutes": 10,
154
- "files": ["Features/BookFeature/BookErrors.cs"] }
155
-
156
- { "id": "T003", "title": "Adicionar ApiTags.Books em Constants/ApiTags.cs",
157
- "category": "tags", "dependencies": [], "estimatedMinutes": 5,
158
- "files": ["Constants/ApiTags.cs"] }
159
-
160
- { "id": "T004", "title": "Criar migration AddBook + aplicar ao banco",
161
- "category": "migration", "dependencies": ["T001"], "estimatedMinutes": 10,
162
- "files": ["Migrations/...AddBook.cs"] }
163
-
164
- { "id": "T005", "title": "Implementar slice CreateBook (Handler + Validator + Endpoint)",
165
- "category": "slice", "dependencies": ["T001", "T002", "T003", "T004"],
166
- "estimatedMinutes": 45,
167
- "files": [
168
- "Features/BookFeature/CreateBook/CreateBookHandler.cs",
169
- "Features/BookFeature/CreateBook/CreateBookValidator.cs",
170
- "Features/BookFeature/CreateBook/CreateBookEndpoint.cs"
171
- ] }
172
-
173
- { "id": "T006", "title": "Implementar slice GetAllBooks (Handler + Endpoint, sem Validator)",
174
- "category": "slice", "dependencies": ["T001", "T004"], "estimatedMinutes": 25,
175
- "files": [
176
- "Features/BookFeature/GetAllBooks/GetAllBooksHandler.cs",
177
- "Features/BookFeature/GetAllBooks/GetAllBooksEndpoint.cs"
178
- ] }
179
- ```
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.
180
130
 
181
131
  **Após definir tasks VSA, pule direto para o Passo 3 (Dependências).**
182
132
 
@@ -184,39 +134,15 @@ T0NN: Tests
184
134
 
185
135
  ### Passo 0.6: Ler Nível de Domínio — DDD
186
136
 
187
- **Ref:** `framework/standards/architecture/ddd/complexity-levels.md`
188
-
189
- Antes de quebrar tasks, leia a seção `## Domain Complexity` do spec.md:
137
+ Leia a seção `## Domain Complexity` do spec.md:
190
138
 
191
139
  ```bash
192
140
  grep -A15 "## Domain Complexity" ".morph/features/$ARGUMENTS/1-design/spec.md"
193
141
  ```
194
142
 
195
- > Se a seção não existir no spec.md, assuma **Nível 1 (CRUD)** e documente nos pre-requisitos da task.
196
-
197
- Use o nível para **restringir** as categorias de tasks às listadas para o nível detectado:
198
-
199
- | Nível | Categorias de Tasks |
200
- |-------|---------------------|
201
- | **1 — CRUD** | `domain` (Entity simples) → `infrastructure` (Repository, EF Config) → `application` (Service CRUD) → `presentation` (API/Page) → `tests` |
202
- | **2 — Business Logic** | `domain` (AggregateRoot, ValueObjects, DomainEvents) → `infrastructure` (Repository, EF Config) → `application` (Commands, Queries, Handlers) → `presentation` (API/Page) → `tests` |
203
- | **3 — Bounded Context** | `domain-bc` (BC setup, Aggregates, Events) → `infrastructure` (BC repositories, EF) → `application` (Commands, Queries, Integration handlers) → `presentation` → `tests` |
143
+ > Se a seção não existir, assuma **Nível 1 (CRUD)**.
204
144
 
205
- **Nível 1:** Nenhuma task adicional obrigatória apenas o padrão CRUD nas categorias listadas.
206
-
207
- **Tasks adicionais obrigatórias por nível:**
208
-
209
- **Nível 2 apenas:**
210
- - `T{N}: Implementar AggregateRoot {EntityName} com factory method e invariants` (domain)
211
- - `T{N}: Implementar ValueObjects: {lista do Aggregate Blueprint}` (domain)
212
- - `T{N}: Implementar DomainEvents: {lista do Aggregate Blueprint}` (domain)
213
- - `T{N}: Implementar Command Handlers com MediatR` (application)
214
- - `T{N}: Implementar Query Handlers com read models` (application)
215
-
216
- **Nível 3 apenas (além do Nível 2):**
217
- - `T{N}: Configurar namespace/pasta do Bounded Context {BoundedContext}` (infrastructure)
218
- - `T{N}: Implementar Integration Events para comunicação cross-BC` (domain-bc)
219
- - `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.
220
146
 
221
147
  ---
222
148
 
@@ -233,58 +159,9 @@ Leia `.morph/features/$ARGUMENTS/1-design/spec.md` e identifique:
233
159
 
234
160
  ### Passo 2: Quebrar em Tasks
235
161
 
236
- Crie tasks no formato **T{NNN}** seguindo ordem lógica de implementação.
237
-
238
- #### 2.1. Estrutura de Task
239
-
240
- ```json
241
- {
242
- "id": "T001",
243
- "title": "Criar Entity {Nome}",
244
- "description": "Implementar entity {Nome} com propriedades X, Y, Z seguindo padrões EF Core",
245
- "category": "domain",
246
- "dependencies": [],
247
- "estimatedMinutes": 30,
248
- "status": "pending",
249
- "specSections": ["## Domain Model", "## Business Rules"],
250
- "contractInterfaces": ["I{Nome}Repository"],
251
- "files": [
252
- "Domain/Entities/{Nome}.cs",
253
- "Infrastructure/Data/Configurations/{Nome}Configuration.cs"
254
- ]
255
- }
256
- ```
162
+ > Para estrutura JSON, categorias e ordem de implementação, veja `references/task-planning-patterns.md`
257
163
 
258
- #### 2.2. Categorias de Tasks
259
-
260
- | Categoria | Descrição | Exemplos |
261
- |-----------|-----------|----------|
262
- | **domain** | Entities, Value Objects, Enums | Entity, DomainException |
263
- | **application** | Services, DTOs, Interfaces | Service, Validator, Mapper |
264
- | **infrastructure** | DbContext, Repositories, External APIs | EF Config, Repository impl |
265
- | **presentation** | Controllers, Pages, Components | API endpoint, Blazor page |
266
- | **tests** | Unit tests, Integration tests | Service tests, API tests |
267
- | **infra** | Bicep, Migrations, Scripts | Azure resources, DB migration |
268
- | **docs** | README, API docs, Swagger | OpenAPI spec, README update |
269
-
270
- #### 2.3. Ordem de Implementação
271
-
272
- **Bottom-up approach:**
273
- ```
274
- 1. Domain (Entities, Enums, Value Objects)
275
-
276
- 2. Infrastructure (Repositories, DbContext configs)
277
-
278
- 3. Application (Services, DTOs, Business logic)
279
-
280
- 4. Presentation (Controllers, Pages, Components)
281
-
282
- 5. Tests (Unit → Integration)
283
-
284
- 6. Infra (Bicep, Migrations, Deploy scripts)
285
-
286
- 7. Docs (README, Swagger, Comments)
287
- ```
164
+ Crie tasks no formato **T{NNN}** seguindo bottom-up: domain → infrastructure → application → presentation → tests → infra → docs.
288
165
 
289
166
  ### Passo 3: Definir Dependências
290
167
 
@@ -329,7 +206,7 @@ Para cada task, estime tempo em minutos:
329
206
  | Média (Business logic, validações) | 60-120 min |
330
207
  | Complexa (Integrações, AI) | 120-240 min |
331
208
 
332
- ### Passo 6: Gerar `tasks.json`
209
+ ### Passo 6: Gerar `tasks.md`
333
210
 
334
211
  Crie `.morph/features/$ARGUMENTS/3-tasks/tasks.md` com a estrutura completa de tasks, checkpoints e estimativas.
335
212
 
@@ -340,7 +217,6 @@ Se houver recursos Azure, adicionar tasks de Bicep e migrations.
340
217
  ### Passo 8: Atualizar State
341
218
 
342
219
  ```bash
343
- npx morph-spec state set $ARGUMENTS phase tasks
344
220
  npx morph-spec state set $ARGUMENTS tasks.total {N}
345
221
  npx morph-spec state mark-output $ARGUMENTS tasks
346
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.12"
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 TODOS os estados (loading, error, empty, success)?
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": "thread-orchestrator",
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
  }