@polymorphism-tech/morph-spec 1.0.4 → 2.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 (152) hide show
  1. package/CLAUDE.md +1381 -0
  2. package/LICENSE +72 -0
  3. package/README.md +89 -6
  4. package/bin/detect-agents.js +225 -0
  5. package/bin/morph-spec.js +120 -0
  6. package/bin/render-template.js +302 -0
  7. package/bin/semantic-detect-agents.js +246 -0
  8. package/bin/validate-agents-skills.js +239 -0
  9. package/bin/validate-agents.js +69 -0
  10. package/bin/validate-phase.js +263 -0
  11. package/content/.azure/README.md +293 -0
  12. package/content/.azure/docs/azure-devops-setup.md +454 -0
  13. package/content/.azure/docs/branch-strategy.md +398 -0
  14. package/content/.azure/docs/local-development.md +515 -0
  15. package/content/.azure/pipelines/pipeline-variables.yml +34 -0
  16. package/content/.azure/pipelines/prod-pipeline.yml +319 -0
  17. package/content/.azure/pipelines/staging-pipeline.yml +234 -0
  18. package/content/.azure/pipelines/templates/build-dotnet.yml +75 -0
  19. package/content/.azure/pipelines/templates/deploy-app-service.yml +94 -0
  20. package/content/.azure/pipelines/templates/deploy-container-app.yml +120 -0
  21. package/content/.azure/pipelines/templates/infra-deploy.yml +90 -0
  22. package/content/.claude/commands/morph-apply.md +118 -26
  23. package/content/.claude/commands/morph-archive.md +9 -9
  24. package/content/.claude/commands/morph-clarify.md +184 -0
  25. package/content/.claude/commands/morph-design.md +275 -0
  26. package/content/.claude/commands/morph-proposal.md +56 -15
  27. package/content/.claude/commands/morph-setup.md +100 -0
  28. package/content/.claude/commands/morph-status.md +47 -32
  29. package/content/.claude/commands/morph-tasks.md +319 -0
  30. package/content/.claude/commands/morph-uiux.md +211 -0
  31. package/content/.claude/skills/specialists/ai-system-architect.md +604 -0
  32. package/content/.claude/skills/specialists/ms-agent-expert.md +143 -89
  33. package/content/.claude/skills/specialists/ui-ux-designer.md +744 -9
  34. package/content/.claude/skills/stacks/dotnet-blazor.md +244 -8
  35. package/content/.claude/skills/stacks/dotnet-nextjs.md +2 -2
  36. package/content/.morph/.morphversion +5 -0
  37. package/content/.morph/config/agents.json +101 -8
  38. package/content/.morph/config/azure-pricing.json +70 -0
  39. package/content/.morph/config/azure-pricing.schema.json +50 -0
  40. package/content/.morph/config/config.template.json +15 -3
  41. package/content/.morph/docs/STORY-DRIVEN-DEVELOPMENT.md +392 -0
  42. package/content/.morph/hooks/README.md +239 -0
  43. package/content/.morph/hooks/pre-commit-agents.sh +24 -0
  44. package/content/.morph/hooks/pre-commit-all.sh +48 -0
  45. package/content/.morph/hooks/pre-commit-costs.sh +91 -0
  46. package/content/.morph/hooks/pre-commit-specs.sh +49 -0
  47. package/content/.morph/hooks/pre-commit-tests.sh +60 -0
  48. package/content/.morph/project.md +5 -4
  49. package/content/.morph/schemas/agent.schema.json +296 -0
  50. package/content/.morph/standards/agent-framework-setup.md +453 -0
  51. package/content/.morph/standards/architecture.md +142 -7
  52. package/content/.morph/standards/azure.md +218 -23
  53. package/content/.morph/standards/coding.md +47 -12
  54. package/content/.morph/standards/dotnet10-migration.md +494 -0
  55. package/content/.morph/standards/fluent-ui-setup.md +590 -0
  56. package/content/.morph/standards/migration-guide.md +514 -0
  57. package/content/.morph/standards/passkeys-auth.md +423 -0
  58. package/content/.morph/standards/vector-search-rag.md +536 -0
  59. package/content/.morph/state.json +18 -0
  60. package/content/.morph/templates/FluentDesignTheme.cs +149 -0
  61. package/content/.morph/templates/MudTheme.cs +281 -0
  62. package/content/.morph/templates/contracts.cs +55 -55
  63. package/content/.morph/templates/decisions.md +4 -4
  64. package/content/.morph/templates/design-system.css +226 -0
  65. package/content/.morph/templates/infra/.dockerignore.example +89 -0
  66. package/content/.morph/templates/infra/Dockerfile.example +82 -0
  67. package/content/.morph/templates/infra/README.md +286 -0
  68. package/content/.morph/templates/infra/app-service.bicep +164 -0
  69. package/content/.morph/templates/infra/deploy.ps1 +229 -0
  70. package/content/.morph/templates/infra/deploy.sh +208 -0
  71. package/content/.morph/templates/infra/main.bicep +41 -7
  72. package/content/.morph/templates/infra/parameters.dev.json +6 -0
  73. package/content/.morph/templates/infra/parameters.prod.json +6 -0
  74. package/content/.morph/templates/infra/parameters.staging.json +29 -0
  75. package/content/.morph/templates/proposal.md +3 -3
  76. package/content/.morph/templates/recap.md +3 -3
  77. package/content/.morph/templates/spec.md +9 -8
  78. package/content/.morph/templates/sprint-status.yaml +68 -0
  79. package/content/.morph/templates/state.template.json +222 -0
  80. package/content/.morph/templates/story.md +143 -0
  81. package/content/.morph/templates/tasks.md +1 -1
  82. package/content/.morph/templates/ui-components.md +276 -0
  83. package/content/.morph/templates/ui-design-system.md +286 -0
  84. package/content/.morph/templates/ui-flows.md +336 -0
  85. package/content/.morph/templates/ui-mockups.md +133 -0
  86. package/content/.morph/test-infra/example.bicep +59 -0
  87. package/content/CLAUDE.md +124 -0
  88. package/content/README.md +79 -0
  89. package/detectors/config-detector.js +223 -0
  90. package/detectors/conversation-analyzer.js +163 -0
  91. package/detectors/index.js +84 -0
  92. package/detectors/standards-generator.js +275 -0
  93. package/detectors/structure-detector.js +221 -0
  94. package/docs/README.md +149 -0
  95. package/docs/api/cost-calculator.js.html +513 -0
  96. package/docs/api/design-system-generator.js.html +382 -0
  97. package/docs/api/fonts/Montserrat/Montserrat-Bold.eot +0 -0
  98. package/docs/api/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
  99. package/docs/api/fonts/Montserrat/Montserrat-Bold.woff +0 -0
  100. package/docs/api/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
  101. package/docs/api/fonts/Montserrat/Montserrat-Regular.eot +0 -0
  102. package/docs/api/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
  103. package/docs/api/fonts/Montserrat/Montserrat-Regular.woff +0 -0
  104. package/docs/api/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
  105. package/docs/api/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
  106. package/docs/api/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +978 -0
  107. package/docs/api/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
  108. package/docs/api/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
  109. package/docs/api/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
  110. package/docs/api/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
  111. package/docs/api/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +1049 -0
  112. package/docs/api/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
  113. package/docs/api/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
  114. package/docs/api/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
  115. package/docs/api/global.html +5263 -0
  116. package/docs/api/index.html +96 -0
  117. package/docs/api/scripts/collapse.js +39 -0
  118. package/docs/api/scripts/commonNav.js +28 -0
  119. package/docs/api/scripts/linenumber.js +25 -0
  120. package/docs/api/scripts/nav.js +12 -0
  121. package/docs/api/scripts/polyfill.js +4 -0
  122. package/docs/api/scripts/prettify/Apache-License-2.0.txt +202 -0
  123. package/docs/api/scripts/prettify/lang-css.js +2 -0
  124. package/docs/api/scripts/prettify/prettify.js +28 -0
  125. package/docs/api/scripts/search.js +99 -0
  126. package/docs/api/state-manager.js.html +423 -0
  127. package/docs/api/styles/jsdoc.css +776 -0
  128. package/docs/api/styles/prettify.css +80 -0
  129. package/docs/examples.md +328 -0
  130. package/docs/getting-started.md +302 -0
  131. package/docs/installation.md +361 -0
  132. package/docs/templates.md +418 -0
  133. package/docs/validation-checklist.md +266 -0
  134. package/package.json +39 -12
  135. package/src/commands/cost.js +181 -0
  136. package/src/commands/create-story.js +283 -0
  137. package/src/commands/detect.js +104 -0
  138. package/src/commands/doctor.js +67 -0
  139. package/src/commands/generate.js +149 -0
  140. package/src/commands/init.js +69 -45
  141. package/src/commands/shard-spec.js +224 -0
  142. package/src/commands/sprint-status.js +250 -0
  143. package/src/commands/state.js +333 -0
  144. package/src/commands/sync.js +167 -0
  145. package/src/commands/update-pricing.js +206 -0
  146. package/src/commands/update.js +88 -13
  147. package/src/lib/complexity-analyzer.js +292 -0
  148. package/src/lib/cost-calculator.js +429 -0
  149. package/src/lib/design-system-generator.js +298 -0
  150. package/src/lib/state-manager.js +340 -0
  151. package/src/utils/file-copier.js +59 -0
  152. package/src/utils/version-checker.js +175 -0
@@ -2,63 +2,78 @@
2
2
 
3
3
  Mostre o status atual do projeto MORPH e features em desenvolvimento.
4
4
 
5
- ## O que verificar
5
+ ## Como Usar
6
+
7
+ **SEMPRE** use o state-manager CLI para obter status:
8
+
9
+ ```bash
10
+ node bin/state-manager.js list
11
+ ```
12
+
13
+ Este comando automaticamente mostra:
14
+ - Todas as features ativas
15
+ - Fase atual de cada feature
16
+ - Progresso de tasks (X/Y)
17
+ - Agentes ativos
18
+ - Custos estimados
19
+
20
+ ## Verificações Adicionais
6
21
 
7
22
  ### 1. Configuração MORPH
8
23
  - [ ] `.morph/project.md` existe e está preenchido
9
24
  - [ ] `.morph/config/config.json` configurado
10
25
  - [ ] `.morph/standards/` presentes
11
26
 
12
- ### 2. Features Ativas
27
+ ### 2. Detalhes de Feature Específica
13
28
 
14
- Verifique `.morph/features/` e para cada feature:
29
+ Para obter JSON detalhado de uma feature:
15
30
 
16
- ```
17
- Feature: {name}
18
- ├── Status: {Draft|In Review|Approved|In Progress|Done}
19
- ├── Phase: {Proposal|Design|Clarify|Tasks|Implement}
20
- ├── Progress: {X}/{Y} tasks
21
- ├── Agents: {lista de agentes ativos}
22
- └── Cost: ${X}/month estimated
31
+ ```bash
32
+ node bin/state-manager.js get {feature-name}
23
33
  ```
24
34
 
25
35
  ### 3. Features Arquivadas
26
36
 
27
- Verifique `.morph/archive/` e liste:
37
+ Verifique `.morph/project/archive/` manualmente se necessário:
28
38
  - Quantas features concluídas
29
39
  - Tempo total gasto
30
40
  - Custo acumulado
31
41
 
32
42
  ### 4. Specs Ativas
33
43
 
34
- Verifique `.morph/specs/` para specs consolidadas.
44
+ Verifique `.morph/project/specs/` para specs consolidadas.
35
45
 
36
46
  ## Output
37
47
 
38
- Apresente um dashboard como:
48
+ O comando `node bin/state-manager.js list` automaticamente gera um dashboard formatado:
39
49
 
40
50
  ```
41
- ╔════════════════════════════════════════════╗
42
- MORPH PROJECT STATUS
43
- ╠════════════════════════════════════════════╣
44
- ║ Project: {name}
45
- ║ Type: Blazor Server
46
- ╠════════════════════════════════════════════╣
47
- ║ FEATURES IN PROGRESS
48
- ╠════════════════════════════════════════════╣
49
- ║ 📝 {feature-1}
50
- ║ Phase: Implement | Tasks: 5/12
51
- ║ Agents: 📐☁️🔥🗄️💰
52
- ╠════════════════════════════════════════════╣
53
- ║ 📝 {feature-2}
54
- ║ Phase: Design | Tasks: 0/0
55
- ║ Agents: 📐☁️🔥🗄️💰⏰
56
- ╠════════════════════════════════════════════╣
57
- ARCHIVED: 3 features
58
- ║ TOTAL COST: ~$12/month ║
59
- ╚════════════════════════════════════════════╝
51
+ ╔════════════════════════════════════════════════════════════════╗
52
+ MORPH-SPEC PROJECT STATUS
53
+ ╠════════════════════════════════════════════════════════════════╣
54
+ ║ Project: {PROJECT_NAME}
55
+ ║ Type: blazor-server
56
+ ╠════════════════════════════════════════════════════════════════╣
57
+ ║ FEATURES
58
+ ╠════════════════════════════════════════════════════════════════╣
59
+ ║ 📝 {feature-1}
60
+ ║ Phase: implement │ Tasks: 5/12
61
+ ║ Agents: blazor-builder ef-modeler hangfire-orchestrator
62
+ ╠════════════════════════════════════════════════════════════════╣
63
+ ║ 📝 {feature-2}
64
+ ║ Phase: design │ Tasks: 0/0
65
+ ║ Agents: None
66
+ ╠════════════════════════════════════════════════════════════════╣
67
+ SUMMARY
68
+ ╠════════════════════════════════════════════════════════════════╣
69
+ ║ Total Features: 2 ║
70
+ ║ Completed: 0 ║
71
+ ║ Estimated Cost: $5.50/month ║
72
+ ╚════════════════════════════════════════════════════════════════╝
60
73
  ```
61
74
 
75
+ **Simplesmente execute o comando e mostre o resultado ao usuário.**
76
+
62
77
  ## Ações Disponíveis
63
78
 
64
79
  Sugira próximas ações:
@@ -0,0 +1,319 @@
1
+ # MORPH Tasks - FASE 4
2
+
3
+ Quebre a especificação em tasks executáveis, defina ordem de execução e estabeleça checkpoints.
4
+
5
+ ## Uso
6
+
7
+ ```
8
+ /morph-tasks {feature-name}
9
+ ```
10
+
11
+ ## Pré-requisitos
12
+
13
+ - [ ] FASE 3 (Clarify) concluída
14
+ - [ ] `spec.md` atualizado com clarificações
15
+ - [ ] Todos os edge cases documentados
16
+
17
+ ## Workflow
18
+
19
+ ### Passo 1: Analisar Spec
20
+
21
+ Leia `.morph/project/outputs/{feature}/spec.md` e identifique:
22
+
23
+ 1. **Requisitos funcionais** (FR001, FR002, ...)
24
+ 2. **Componentes técnicos** (Entities, Services, Controllers, Pages)
25
+ 3. **Infraestrutura** (Bicep, migrations, configs)
26
+ 4. **Testes** (Unit tests, integration tests)
27
+
28
+ ### Passo 2: Quebrar em Tasks
29
+
30
+ Crie tasks no formato **T{NNN}** seguindo ordem lógica de implementação.
31
+
32
+ #### 2.1. Estrutura de Task
33
+
34
+ ```json
35
+ {
36
+ "id": "T001",
37
+ "title": "Criar Entity {Nome}",
38
+ "description": "Implementar entity {Nome} com propriedades X, Y, Z seguindo padrões EF Core",
39
+ "category": "domain",
40
+ "dependencies": [],
41
+ "estimatedMinutes": 30,
42
+ "status": "pending",
43
+ "files": [
44
+ "Domain/Entities/{Nome}.cs",
45
+ "Infrastructure/Data/Configurations/{Nome}Configuration.cs"
46
+ ]
47
+ }
48
+ ```
49
+
50
+ #### 2.2. Categorias de Tasks
51
+
52
+ | Categoria | Descrição | Exemplos |
53
+ |-----------|-----------|----------|
54
+ | **domain** | Entities, Value Objects, Enums | Entity, DomainException |
55
+ | **application** | Services, DTOs, Interfaces | Service, Validator, Mapper |
56
+ | **infrastructure** | DbContext, Repositories, External APIs | EF Config, Repository impl |
57
+ | **presentation** | Controllers, Pages, Components | API endpoint, Blazor page |
58
+ | **tests** | Unit tests, Integration tests | Service tests, API tests |
59
+ | **infra** | Bicep, Migrations, Scripts | Azure resources, DB migration |
60
+ | **docs** | README, API docs, Swagger | OpenAPI spec, README update |
61
+
62
+ #### 2.3. Ordem de Implementação
63
+
64
+ **Bottom-up approach:**
65
+ ```
66
+ 1. Domain (Entities, Enums, Value Objects)
67
+
68
+ 2. Infrastructure (Repositories, DbContext configs)
69
+
70
+ 3. Application (Services, DTOs, Business logic)
71
+
72
+ 4. Presentation (Controllers, Pages, Components)
73
+
74
+ 5. Tests (Unit → Integration)
75
+
76
+ 6. Infra (Bicep, Migrations, Deploy scripts)
77
+
78
+ 7. Docs (README, Swagger, Comments)
79
+ ```
80
+
81
+ ### Passo 3: Definir Dependências
82
+
83
+ Para cada task, especifique dependências:
84
+
85
+ ```json
86
+ {
87
+ "id": "T005",
88
+ "title": "Criar {Nome}Service",
89
+ "dependencies": ["T001", "T002"], // Precisa de Entities primeiro
90
+ "status": "pending"
91
+ }
92
+ ```
93
+
94
+ **Regra:** Task só pode ser executada quando todas as dependências estão `completed`.
95
+
96
+ ### Passo 4: Estabelecer Checkpoints
97
+
98
+ Defina checkpoints a cada **3 tasks** ou **marcos significativos**:
99
+
100
+ ```json
101
+ {
102
+ "id": "CHECKPOINT_001",
103
+ "title": "Domain Layer Completo",
104
+ "afterTasks": ["T001", "T002", "T003"],
105
+ "validations": [
106
+ "Todas as entities criadas",
107
+ "Migrations aplicadas",
108
+ "Testes de domain passando"
109
+ ]
110
+ }
111
+ ```
112
+
113
+ **Checkpoints obrigatórios:**
114
+ - Após domain layer
115
+ - Após infrastructure layer
116
+ - Após application layer
117
+ - Após presentation layer
118
+ - Antes de deploy (final)
119
+
120
+ ### Passo 5: Estimar Esforço
121
+
122
+ Para cada task, estime tempo em minutos:
123
+
124
+ | Complexidade | Tempo Estimado |
125
+ |--------------|----------------|
126
+ | Trivial (CRUD básico) | 15-30 min |
127
+ | Simples (Service, Controller) | 30-60 min |
128
+ | Média (Business logic, validações) | 60-120 min |
129
+ | Complexa (Integrações, AI) | 120-240 min |
130
+
131
+ **Total:** Some todos os tempos para estimar esforço total da feature.
132
+
133
+ ### Passo 6: Gerar `tasks.json`
134
+
135
+ Crie `.morph/project/outputs/{feature}/tasks.json`:
136
+
137
+ ```json
138
+ {
139
+ "feature": "{feature-name}",
140
+ "totalTasks": 15,
141
+ "estimatedHours": 8.5,
142
+ "checkpoints": [
143
+ {
144
+ "id": "CHECKPOINT_001",
145
+ "title": "Domain Layer Completo",
146
+ "afterTasks": ["T001", "T002", "T003"]
147
+ },
148
+ {
149
+ "id": "CHECKPOINT_002",
150
+ "title": "Application Layer Completo",
151
+ "afterTasks": ["T006", "T007", "T008"]
152
+ }
153
+ ],
154
+ "tasks": [
155
+ {
156
+ "id": "T001",
157
+ "title": "Criar Entity {Nome}",
158
+ "description": "...",
159
+ "category": "domain",
160
+ "dependencies": [],
161
+ "estimatedMinutes": 30,
162
+ "status": "pending",
163
+ "files": ["Domain/Entities/{Nome}.cs"]
164
+ },
165
+ {
166
+ "id": "T002",
167
+ "title": "Configurar EF para {Nome}",
168
+ "description": "...",
169
+ "category": "infrastructure",
170
+ "dependencies": ["T001"],
171
+ "estimatedMinutes": 20,
172
+ "status": "pending",
173
+ "files": ["Infrastructure/Data/Configurations/{Nome}Configuration.cs"]
174
+ }
175
+ // ... mais tasks
176
+ ]
177
+ }
178
+ ```
179
+
180
+ ### Passo 7: Incluir Tasks de IaC (se necessário)
181
+
182
+ Se houver recursos Azure:
183
+
184
+ ```json
185
+ {
186
+ "id": "T050",
187
+ "title": "Criar Bicep para Azure SQL",
188
+ "description": "Bicep module para Azure SQL Database Basic tier",
189
+ "category": "infra",
190
+ "dependencies": ["T001", "T002"], // Domain entities devem existir
191
+ "estimatedMinutes": 45,
192
+ "status": "pending",
193
+ "files": [
194
+ "infra/modules/sql-database.bicep",
195
+ "infra/parameters.dev.json"
196
+ ]
197
+ },
198
+ {
199
+ "id": "T051",
200
+ "title": "Criar migration inicial",
201
+ "description": "EF Core migration com todas as entities",
202
+ "category": "infra",
203
+ "dependencies": ["T002", "T003"],
204
+ "estimatedMinutes": 15,
205
+ "status": "pending",
206
+ "files": ["Infrastructure/Data/Migrations/"]
207
+ }
208
+ ```
209
+
210
+ ### Passo 8: Atualizar State
211
+
212
+ ```bash
213
+ # Marcar fase como tasks
214
+ node bin/state-manager.js set {feature-name} phase tasks
215
+
216
+ # Definir total de tasks
217
+ node bin/state-manager.js set {feature-name} tasks.total {N}
218
+
219
+ # Marcar output tasks criado
220
+ node bin/state-manager.js mark-output {feature-name} tasks
221
+ ```
222
+
223
+ ## Outputs Gerados
224
+
225
+ - `.morph/project/outputs/{feature}/tasks.json` - Breakdown completo de tasks
226
+
227
+ **Resumo em formato texto:**
228
+
229
+ Gere também um resumo visual em `.morph/project/outputs/{feature}/tasks-summary.md`:
230
+
231
+ ```markdown
232
+ # Tasks Breakdown - {Feature Name}
233
+
234
+ ## Overview
235
+ - **Total Tasks:** 15
236
+ - **Estimated Time:** 8.5 hours
237
+ - **Checkpoints:** 3
238
+
239
+ ## Tasks by Category
240
+
241
+ ### Domain (3 tasks, 1.5h)
242
+ - T001: Criar Entity {Nome} (30min)
243
+ - T002: Configurar EF para {Nome} (20min)
244
+ - T003: Criar Enum {Status} (15min)
245
+
246
+ ### Infrastructure (4 tasks, 2h)
247
+ - T004: Criar Repository interface (30min)
248
+ - T005: Implementar Repository (60min)
249
+ - ...
250
+
251
+ ### Application (5 tasks, 3h)
252
+ - T006: Criar {Nome}Service (90min)
253
+ - T007: Criar DTOs (45min)
254
+ - ...
255
+
256
+ ### Presentation (3 tasks, 2h)
257
+ - T010: Criar API Controller (60min)
258
+ - T011: Criar Blazor Page (60min)
259
+ - ...
260
+
261
+ ## Checkpoints
262
+
263
+ ### CHECKPOINT_001: Domain Layer Completo
264
+ **After:** T001, T002, T003
265
+ **Validations:**
266
+ - [ ] Entities criadas
267
+ - [ ] EF configurations ok
268
+ - [ ] Compile sem erros
269
+
270
+ ### CHECKPOINT_002: Application Layer Completo
271
+ **After:** T006, T007, T008
272
+ **Validations:**
273
+ - [ ] Services implementados
274
+ - [ ] DTOs validados
275
+ - [ ] Testes unitários passando
276
+
277
+ ## Execution Order
278
+
279
+ ```
280
+ T001 → T002 → T003 → CHECKPOINT_001
281
+
282
+ T004 → T005
283
+
284
+ T006 → T007 → T008 → CHECKPOINT_002
285
+
286
+ T010 → T011 → T012
287
+
288
+ T013 → T014 → T015 → CHECKPOINT_003
289
+ ```
290
+ ```
291
+
292
+ ## ⛔ PAUSA OBRIGATÓRIA
293
+
294
+ Apresente ao usuário 3 ações sugeridas:
295
+
296
+ 1. ✅ **Aprovar breakdown e iniciar implementação**
297
+ Prosseguir para `/morph-apply` (FASE 5)
298
+
299
+ 2. 🔀 **Repriorizar tasks**
300
+ Mudar ordem de execução se necessário
301
+
302
+ 3. ➕ **Adicionar/remover tasks**
303
+ Ajustar escopo se alguma task foi esquecida ou é desnecessária
304
+
305
+ ## Critérios de Avanço
306
+
307
+ - [x] `tasks.json` criado com todas as tasks
308
+ - [x] Tasks categorizadas corretamente
309
+ - [x] Dependências mapeadas
310
+ - [x] Checkpoints definidos (a cada 3 tasks)
311
+ - [x] Esforço estimado por task
312
+ - [x] Ordem de execução clara
313
+ - [x] Tasks de IaC incluídas (se aplicável)
314
+ - [x] State atualizado com total de tasks
315
+ - [x] Usuário aprovou breakdown
316
+
317
+ ---
318
+
319
+ **Feature:** $ARGUMENTS
@@ -0,0 +1,211 @@
1
+ # MORPH UI/UX Design - FASE 1.5
2
+
3
+ Fase obrigatória para features com front-end. Coleta requisitos de UI/UX, gera wireframes, specs de componentes e fluxos de usuário.
4
+
5
+ ## Uso
6
+
7
+ ```
8
+ /morph-uiux {feature-name}
9
+ ```
10
+
11
+ ## Pré-requisitos
12
+
13
+ - [ ] FASE 1 (Setup) concluída
14
+ - [ ] Feature tem keywords de UI detectadas (blazor, ui, component, page, dashboard, wizard, form, chart)
15
+ - [ ] `uiux-designer` agent ativado
16
+
17
+ ## Workflow
18
+
19
+ ### Passo 1: Detectar Se Fase É Necessária
20
+
21
+ Verifique se agentes ativos incluem `uiux-designer`:
22
+
23
+ ```bash
24
+ node bin/state-manager.js get {feature-name}
25
+ ```
26
+
27
+ Se `uiux-designer` NÃO estiver nos `activeAgents`, pule esta fase e vá para `/morph-design`.
28
+
29
+ ### Passo 2: Coletar Input do Usuário
30
+
31
+ **SEMPRE perguntar ao usuário PRIMEIRO:**
32
+
33
+ 1. **Layout e estilo**:
34
+ - Você tem alguma ideia de layout em mente?
35
+ - Tem alguma referência visual? (sites, apps, screenshots)
36
+ - Como imagina o fluxo do usuário?
37
+
38
+ 2. **Componentes e interações**:
39
+ - Quais os principais componentes desta tela/página?
40
+ - Quais estados precisam ser considerados? (loading, error, empty, success)
41
+
42
+ 3. **Imagens de referência**:
43
+ - Tem imagens de exemplo que eu possa analisar?
44
+ - Se SIM: use Read tool para ler screenshots e extrair padrões
45
+
46
+ ### Passo 3: Decidir Biblioteca UI
47
+
48
+ Escolha entre **Fluent UI Blazor** (recomendado para AI-first) ou **MudBlazor** (componentes complexos):
49
+
50
+ **Critérios:**
51
+ - Fluent UI: Para dashboards, forms simples, AI components, Microsoft design language
52
+ - MudBlazor: Para data grids avançadas, charts complexos, material design
53
+
54
+ **Documente a decisão:**
55
+ ```bash
56
+ # Adicionar ADR em decisions.md
57
+ echo "## ADR: UI Library Choice
58
+
59
+ Decision: [Fluent UI / MudBlazor]
60
+
61
+ Rationale:
62
+ - {Justificativa baseada nos requisitos}
63
+
64
+ Date: $(date +%Y-%m-%d)" >> .morph/project/outputs/{feature}/decisions.md
65
+ ```
66
+
67
+ ### Passo 4: Gerar Deliverables
68
+
69
+ Crie os seguintes arquivos em `.morph/project/outputs/{feature}/`:
70
+
71
+ #### 4.1. `ui-design-system.md`
72
+
73
+ Design system com:
74
+ - Paleta de cores (primary, secondary, accent, semantic)
75
+ - Tipografia (heading scales, body text, code)
76
+ - Spacing e layout (grid, margins, paddings)
77
+ - Componentes base (buttons, inputs, cards)
78
+
79
+ #### 4.2. `ui-mockups.md`
80
+
81
+ Wireframes ASCII + descrições:
82
+ - Layout geral de cada tela/página
83
+ - Posicionamento de componentes
84
+ - Responsividade (desktop, tablet, mobile)
85
+ - Estados (loading, error, empty, success)
86
+
87
+ Exemplo:
88
+ ```
89
+ ┌─────────────────────────────────────────┐
90
+ │ Header [🔔] [👤] │
91
+ ├─────────────────────────────────────────┤
92
+ │ ┌─────────┐ │
93
+ │ │ Sidebar │ Main Content Area │
94
+ │ │ Menu │ ┌─────────────────────┐ │
95
+ │ │ │ │ Dashboard Card │ │
96
+ │ │ • Home │ │ - Chart │ │
97
+ │ │ • Data │ │ - Metrics │ │
98
+ │ └─────────┘ └─────────────────────┘ │
99
+ └─────────────────────────────────────────┘
100
+ ```
101
+
102
+ #### 4.3. `ui-components.md`
103
+
104
+ Specs técnicas de componentes Fluent UI/MudBlazor:
105
+ - Componente a usar (FluentButton, MudDataGrid, etc.)
106
+ - Props e configurações
107
+ - Eventos e bindings
108
+ - Validações e estados
109
+
110
+ Exemplo:
111
+ ```markdown
112
+ ### DashboardCard Component
113
+
114
+ **Library:** FluentCard
115
+ **Props:**
116
+ - Title: string
117
+ - Subtitle: string (optional)
118
+ - Loading: bool
119
+
120
+ **Events:**
121
+ - OnRefresh: EventCallback
122
+
123
+ **Variants:**
124
+ - Default (outline)
125
+ - Filled (accent color)
126
+ - Error (danger color)
127
+ ```
128
+
129
+ #### 4.4. `ui-flows.md`
130
+
131
+ Fluxos de usuário completos:
132
+ - User stories
133
+ - Diagramas de fluxo (texto/ASCII)
134
+ - Edge cases (o que acontece se...?)
135
+ - Validações e feedback
136
+
137
+ Exemplo:
138
+ ```
139
+ ## Fluxo: Adicionar Item
140
+
141
+ 1. User clica "Adicionar Item"
142
+ 2. Modal abre com form
143
+ - Loading: Skeleton placeholders
144
+ - Error: Toast notification
145
+ 3. User preenche campos
146
+ - Validação em tempo real
147
+ - Campos required marcados com *
148
+ 4. User clica "Salvar"
149
+ - Success: Modal fecha + toast "Item adicionado"
150
+ - Error: Modal permanece + mensagem de erro destacada
151
+ ```
152
+
153
+ ### Passo 5: Validar Acessibilidade e Responsividade
154
+
155
+ Documente nos arquivos UI:
156
+ - **WCAG 2.1 Level AA** compliance
157
+ - Contraste de cores adequado
158
+ - Labels acessíveis para screen readers
159
+ - Navegação por teclado
160
+ - **Responsive breakpoints**
161
+ - Desktop (>1200px)
162
+ - Tablet (768px - 1199px)
163
+ - Mobile (<768px)
164
+
165
+ ### Passo 6: Atualizar State
166
+
167
+ ```bash
168
+ # Marcar fase como uiux-design
169
+ node bin/state-manager.js set {feature-name} phase uiux-design
170
+
171
+ # Marcar outputs criados
172
+ node bin/state-manager.js mark-output {feature-name} ui-design-system
173
+ node bin/state-manager.js mark-output {feature-name} ui-mockups
174
+ node bin/state-manager.js mark-output {feature-name} ui-components
175
+ node bin/state-manager.js mark-output {feature-name} ui-flows
176
+ ```
177
+
178
+ ## Outputs Gerados
179
+
180
+ - `.morph/project/outputs/{feature}/ui-design-system.md`
181
+ - `.morph/project/outputs/{feature}/ui-mockups.md`
182
+ - `.morph/project/outputs/{feature}/ui-components.md`
183
+ - `.morph/project/outputs/{feature}/ui-flows.md`
184
+ - `.morph/project/outputs/{feature}/decisions.md` (atualizado com ADR UI library)
185
+
186
+ ## ⛔ PAUSA OBRIGATÓRIA
187
+
188
+ Apresente ao usuário 3 ações sugeridas:
189
+
190
+ 1. ✅ **Aprovar UI/UX e prosseguir para design técnico**
191
+ Continuar para `/morph-design` (FASE 2)
192
+
193
+ 2. 🎨 **Ajustar wireframes/componentes de telas específicas**
194
+ Revisar mockups ou adicionar mais detalhes
195
+
196
+ 3. 🔄 **Revisar biblioteca UI escolhida (Fluent UI ↔ MudBlazor)**
197
+ Mudar decisão se justificado
198
+
199
+ ## Critérios de Avanço
200
+
201
+ - [x] Input do usuário coletado (layout, referências)
202
+ - [x] Biblioteca UI escolhida e justificada (ADR)
203
+ - [x] 4 deliverables criados (design-system, mockups, components, flows)
204
+ - [x] Acessibilidade WCAG 2.1 documentada
205
+ - [x] Responsividade especificada
206
+ - [x] State atualizado
207
+ - [x] Usuário aprovou UI/UX
208
+
209
+ ---
210
+
211
+ **Feature:** $ARGUMENTS