@polymorphism-tech/morph-spec 4.7.1 → 4.8.1
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/.morph/analytics/threads-log.jsonl +54 -0
- package/.morph/state.json +198 -0
- package/LICENSE +1 -2
- package/README.md +379 -414
- package/bin/morph-spec.js +57 -403
- package/bin/validate.js +2 -26
- package/claude-plugin.json +2 -2
- package/docs/ARCHITECTURE.md +43 -46
- package/docs/CHEATSHEET.md +203 -221
- package/docs/COMMAND-FLOWS.md +319 -289
- package/docs/QUICKSTART.md +2 -8
- package/docs/plans/2026-02-22-claude-docs-morph-alignment-analysis.md +2 -0
- package/docs/plans/2026-02-22-claude-settings.md +2 -0
- package/docs/plans/2026-02-22-morph-cc-alignment-impl.md +2 -0
- package/docs/plans/2026-02-22-morph-spec-next.md +2 -0
- package/docs/plans/2026-02-22-native-alignment-design.md +2 -0
- package/docs/plans/2026-02-22-native-alignment-impl.md +2 -0
- package/docs/plans/2026-02-22-native-enrichment-design.md +2 -0
- package/docs/plans/2026-02-22-native-enrichment.md +2 -0
- package/docs/plans/2026-02-23-ddd-architecture-refactor.md +2 -0
- package/docs/plans/2026-02-23-ddd-nextsteps.md +2 -0
- package/docs/plans/2026-02-23-infra-architect-refactor.md +2 -0
- package/docs/plans/2026-02-23-nextjs-code-review-design.md +2 -1
- package/docs/plans/2026-02-23-nextjs-code-review-impl.md +2 -0
- package/docs/plans/2026-02-23-nextjs-standards-design.md +2 -1
- package/docs/plans/2026-02-23-nextjs-standards-impl.md +2 -0
- package/docs/plans/2026-02-24-cli-radical-simplification.md +592 -0
- package/docs/plans/2026-02-24-framework-failure-points.md +125 -0
- package/docs/plans/2026-02-24-morph-init-design.md +337 -0
- package/docs/plans/2026-02-24-morph-init-impl.md +1269 -0
- package/docs/plans/2026-02-24-tutorial-command-design.md +71 -0
- package/docs/plans/2026-02-24-tutorial-command.md +298 -0
- package/framework/CLAUDE.md +2 -2
- package/framework/commands/morph-proposal.md +3 -3
- package/framework/hooks/README.md +11 -10
- package/framework/hooks/claude-code/notification/approval-reminder.js +2 -0
- package/framework/hooks/claude-code/post-tool-use/dispatch.js +1 -1
- package/framework/hooks/claude-code/pre-tool-use/protect-readonly-files.js +4 -55
- package/framework/hooks/claude-code/session-start/inject-morph-context.js +20 -5
- package/framework/hooks/claude-code/statusline.py +6 -1
- package/framework/hooks/claude-code/stop/validate-completion.js +1 -1
- package/framework/hooks/claude-code/user-prompt/enrich-prompt.js +1 -1
- package/framework/hooks/dev/check-sync-health.js +117 -0
- package/framework/hooks/dev/guard-version-numbers.js +57 -0
- package/framework/hooks/dev/sync-standards-registry.js +60 -0
- package/framework/hooks/dev/sync-template-registry.js +60 -0
- package/framework/hooks/dev/validate-skill-format.js +70 -0
- package/framework/hooks/dev/validate-standard-format.js +73 -0
- package/framework/hooks/shared/payload-utils.js +39 -0
- package/framework/hooks/shared/state-reader.js +25 -1
- package/framework/rules/morph-workflow.md +1 -1
- package/framework/skills/level-0-meta/morph-init/SKILL.md +216 -0
- package/framework/skills/level-0-meta/morph-replicate/SKILL.md +4 -4
- package/framework/skills/level-0-meta/tool-usage-guide/SKILL.md +4 -4
- package/framework/skills/level-0-meta/verification-before-completion/SKILL.md +1 -1
- package/framework/skills/level-1-workflows/phase-clarify/SKILL.md +192 -191
- package/framework/skills/level-1-workflows/phase-codebase-analysis/SKILL.md +181 -180
- package/framework/skills/level-1-workflows/phase-design/SKILL.md +339 -338
- package/framework/skills/level-1-workflows/phase-implement/SKILL.md +254 -253
- package/framework/skills/level-1-workflows/phase-setup/SKILL.md +168 -170
- package/framework/skills/level-1-workflows/phase-tasks/SKILL.md +284 -283
- package/framework/skills/level-1-workflows/phase-uiux/SKILL.md +246 -245
- package/framework/templates/examples/design-system-examples.md +1 -1
- package/framework/templates/ui/FluentDesignTheme.cs +1 -1
- package/framework/templates/ui/MudTheme.cs +1 -1
- package/framework/templates/ui/design-system.css +1 -1
- package/package.json +4 -2
- package/scripts/bump-version.js +248 -0
- package/scripts/install-dev-hooks.js +138 -0
- package/src/commands/agents/index.js +1 -2
- package/src/commands/index.js +13 -16
- package/src/commands/project/doctor.js +100 -14
- package/src/commands/project/index.js +7 -10
- package/src/commands/project/init.js +398 -555
- package/src/commands/project/install-plugin-cmd.js +28 -0
- package/src/commands/project/setup-infra-cmd.js +12 -0
- package/src/commands/project/tutorial.js +115 -0
- package/src/commands/project/update.js +22 -37
- package/src/commands/state/approve.js +213 -221
- package/src/commands/state/index.js +0 -1
- package/src/commands/state/state.js +337 -365
- package/src/commands/templates/index.js +0 -4
- package/src/commands/trust/trust.js +1 -93
- package/src/commands/utils/index.js +1 -5
- package/src/commands/validation/index.js +1 -5
- package/src/core/registry/command-registry.js +11 -285
- package/src/core/state/state-manager.js +5 -2
- package/src/lib/detectors/index.js +81 -87
- package/src/lib/detectors/structure-detector.js +275 -273
- package/src/lib/generators/recap-generator.js +232 -225
- package/src/lib/installers/mcp-installer.js +18 -3
- package/src/scripts/global-install.js +34 -0
- package/src/scripts/install-plugin.js +126 -0
- package/src/scripts/setup-infra.js +203 -0
- package/src/utils/agents-installer.js +10 -1
- package/src/utils/hooks-installer.js +70 -17
- package/CLAUDE.md +0 -77
- package/docs/claude-alignment-report.md +0 -137
- package/docs/examples/order-management/contracts.cs +0 -84
- package/docs/examples/order-management/proposal.md +0 -24
- package/docs/examples/order-management/spec.md +0 -162
- package/src/commands/feature/create-story.js +0 -362
- package/src/commands/feature/index.js +0 -6
- package/src/commands/feature/shard-spec.js +0 -225
- package/src/commands/feature/sprint-status.js +0 -250
- package/src/commands/generation/generate-onboarding.js +0 -169
- package/src/commands/generation/generate.js +0 -276
- package/src/commands/generation/index.js +0 -5
- package/src/commands/learning/capture-pattern.js +0 -121
- package/src/commands/learning/index.js +0 -5
- package/src/commands/learning/search-patterns.js +0 -126
- package/src/commands/mcp/mcp.js +0 -102
- package/src/commands/project/changes.js +0 -66
- package/src/commands/project/cost.js +0 -179
- package/src/commands/project/detect.js +0 -114
- package/src/commands/project/diff.js +0 -278
- package/src/commands/project/revert.js +0 -173
- package/src/commands/project/standards.js +0 -80
- package/src/commands/project/sync.js +0 -167
- package/src/commands/project/update-agents.js +0 -23
- package/src/commands/state/rollback-phase.js +0 -185
- package/src/commands/templates/template-customize.js +0 -87
- package/src/commands/templates/template-list.js +0 -114
- package/src/commands/templates/template-show.js +0 -129
- package/src/commands/templates/template-validate.js +0 -91
- package/src/commands/utils/troubleshoot.js +0 -222
- package/src/commands/validation/analyze-blazor-concurrency.js +0 -193
- package/src/commands/validation/lint-fluent.js +0 -352
- package/src/commands/validation/validate-blazor-state.js +0 -210
- package/src/commands/validation/validate-blazor.js +0 -156
- package/src/commands/validation/validate-css.js +0 -84
- package/src/lib/detectors/conversation-analyzer.js +0 -163
- package/src/lib/learning/index.js +0 -7
- package/src/lib/learning/learning-system.js +0 -520
- package/src/lib/troubleshooting/index.js +0 -8
- package/src/lib/troubleshooting/troubleshoot-grep.js +0 -198
- package/src/lib/troubleshooting/troubleshoot-index.js +0 -144
- package/src/llm/environment-detector.js +0 -43
|
@@ -1,284 +1,285 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: phase-tasks
|
|
3
|
-
description: MORPH-SPEC Phase 4 (Tasks). Breaks approved spec into bottom-up ordered implementation tasks (T001...TXXX) with dependencies, checkpoints every 3 tasks, and effort estimates, producing tasks.md. Use after design and clarification phases to create a structured implementation plan before coding starts.
|
|
4
|
-
argument-hint: "[feature-name]"
|
|
5
|
-
disable-model-invocation: true
|
|
6
|
-
user-invocable: false
|
|
7
|
-
allowed-tools: Read, Write, Edit, Bash, Glob, Grep
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
- [ ]
|
|
20
|
-
- [ ]
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
> **Ref:** `framework/
|
|
26
|
-
> **
|
|
27
|
-
> **
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
|
33
|
-
|
|
|
34
|
-
|
|
|
35
|
-
|
|
|
36
|
-
|
|
|
37
|
-
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
- [ ] `
|
|
56
|
-
- [ ] `
|
|
57
|
-
- [ ] `
|
|
58
|
-
- [ ]
|
|
59
|
-
- [ ]
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
| **
|
|
94
|
-
| **
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
- `T{N}: Implementar
|
|
103
|
-
- `T{N}: Implementar
|
|
104
|
-
- `T{N}: Implementar
|
|
105
|
-
- `T{N}: Implementar
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
- `T{N}:
|
|
110
|
-
- `T{N}: Implementar
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
"
|
|
133
|
-
"
|
|
134
|
-
"
|
|
135
|
-
"
|
|
136
|
-
"
|
|
137
|
-
"
|
|
138
|
-
"
|
|
139
|
-
"
|
|
140
|
-
"
|
|
141
|
-
|
|
142
|
-
"
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
| **
|
|
153
|
-
| **
|
|
154
|
-
| **
|
|
155
|
-
| **
|
|
156
|
-
| **
|
|
157
|
-
| **
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
"
|
|
186
|
-
"
|
|
187
|
-
"
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
"
|
|
201
|
-
"
|
|
202
|
-
"
|
|
203
|
-
|
|
204
|
-
"
|
|
205
|
-
"
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
|
218
|
-
|
|
|
219
|
-
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
npx morph-spec state set $ARGUMENTS tasks
|
|
234
|
-
npx morph-spec state
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
- [x]
|
|
253
|
-
- [x]
|
|
254
|
-
- [x]
|
|
255
|
-
- [x]
|
|
256
|
-
- [x]
|
|
257
|
-
- [x]
|
|
258
|
-
- [x]
|
|
259
|
-
- [x]
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
| `
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
1
|
+
---
|
|
2
|
+
name: phase-tasks
|
|
3
|
+
description: MORPH-SPEC Phase 4 (Tasks). Breaks approved spec into bottom-up ordered implementation tasks (T001...TXXX) with dependencies, checkpoints every 3 tasks, and effort estimates, producing tasks.md. Use after design and clarification phases to create a structured implementation plan before coding starts.
|
|
4
|
+
argument-hint: "[feature-name]"
|
|
5
|
+
disable-model-invocation: true
|
|
6
|
+
user-invocable: false
|
|
7
|
+
allowed-tools: Read, Write, Edit, Bash, Glob, Grep
|
|
8
|
+
cliVersion: "4.8.1"
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# MORPH Tasks - FASE 4
|
|
12
|
+
|
|
13
|
+
> INTERNAL: Workflow skill used by /morph-proposal during automated phase orchestration. Not a user command.
|
|
14
|
+
|
|
15
|
+
Quebre a especificação em tasks executáveis, defina ordem de execução e estabeleça checkpoints.
|
|
16
|
+
|
|
17
|
+
## Pré-requisitos
|
|
18
|
+
|
|
19
|
+
- [ ] FASE 3 (Clarify) concluída
|
|
20
|
+
- [ ] `spec.md` atualizado com clarificações
|
|
21
|
+
- [ ] Todos os edge cases documentados
|
|
22
|
+
|
|
23
|
+
## Ferramentas Recomendadas
|
|
24
|
+
|
|
25
|
+
> **Ref:** `framework/skills/level-0-meta/tool-usage-guide/SKILL.md` para guia completo.
|
|
26
|
+
> **Ref:** `framework/standards/integration/mcp/mcp-tools.md` para referência MCP.
|
|
27
|
+
> **Example:** `references/tasks-example.md` — filled-in tasks.md showing expected granularity and format.
|
|
28
|
+
> **Script:** `scripts/validate-tasks.mjs` — validates tasks.md structure, T### IDs, and required fields.
|
|
29
|
+
|
|
30
|
+
| Ação | Ferramenta | Alternativa |
|
|
31
|
+
|------|------------|-------------|
|
|
32
|
+
| Ler spec + contracts + decisions | **Read** todos os outputs | — |
|
|
33
|
+
| Analisar complexidade de implementação | **Grep** padrões no código existente | — |
|
|
34
|
+
| Contar padrões similares existentes | **Glob** `**/Services/**/*.cs` | — |
|
|
35
|
+
| Consultar padrões de implementação | **Context7 MCP** `query_docs()` | **WebSearch** |
|
|
36
|
+
| Criar issues no GitHub a partir das tasks | **GitHub MCP** `create_issue()` | **Bash** `gh issue create ...` |
|
|
37
|
+
| Renderizar template de tasks | **Bash** `npx morph-spec template render docs/tasks ...` | — |
|
|
38
|
+
| Atualizar state com total de tasks | **Bash** `npx morph-spec state set ... tasks.total N` | — |
|
|
39
|
+
|
|
40
|
+
**MCPs desta fase:** Context7 (estimar complexidade), GitHub (criar issues).
|
|
41
|
+
|
|
42
|
+
**Anti-padrões:**
|
|
43
|
+
- ❌ Task agent para quebrar spec simples (faça diretamente)
|
|
44
|
+
- ✅ Task agent para specs complexos com 50+ requisitos (análise legítima multi-step)
|
|
45
|
+
- ❌ Criar tasks.json sem ler todos os outputs primeiro
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Workflow
|
|
50
|
+
|
|
51
|
+
### CHECKPOINT DE ENTRADA: Verificar Pré-requisitos
|
|
52
|
+
|
|
53
|
+
**⏸️ PAUSE - Antes de iniciar o breakdown de tasks:**
|
|
54
|
+
|
|
55
|
+
- [ ] `spec.md` existe e foi aprovado pelo usuário?
|
|
56
|
+
- [ ] `contracts.cs` existe e corresponde ao schema real?
|
|
57
|
+
- [ ] `schema-analysis.md` foi validado (se aplicável)?
|
|
58
|
+
- [ ] `decisions.md` contém ADRs para todas as escolhas críticas?
|
|
59
|
+
- [ ] Design gate (`morph-spec approve $ARGUMENTS design`) foi aprovado?
|
|
60
|
+
- [ ] Clarificações (FASE 3) foram resolvidas e spec atualizado?
|
|
61
|
+
|
|
62
|
+
**❌ Se alguma checkbox NÃO estiver marcada:**
|
|
63
|
+
→ Voltar para a fase correspondente e resolver
|
|
64
|
+
|
|
65
|
+
**✅ Se TODAS as checkboxes estiverem marcadas:**
|
|
66
|
+
→ Prosseguir para análise e breakdown
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
# Verificar estado atual:
|
|
70
|
+
npx morph-spec state get $ARGUMENTS
|
|
71
|
+
# Verificar se design foi aprovado:
|
|
72
|
+
npx morph-spec approval get $ARGUMENTS design
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
### Passo 0: Ler Nível de Domínio
|
|
78
|
+
|
|
79
|
+
**Ref:** `framework/standards/architecture/ddd/complexity-levels.md`
|
|
80
|
+
|
|
81
|
+
Antes de quebrar tasks, leia a seção `## Domain Complexity` do spec.md:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
grep -A15 "## Domain Complexity" ".morph/features/$ARGUMENTS/1-design/spec.md"
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
> Se a seção não existir no spec.md, assuma **Nível 1 (CRUD)** e documente nos pre-requisitos da task.
|
|
88
|
+
|
|
89
|
+
Use o nível para **restringir** as categorias de tasks às listadas para o nível detectado:
|
|
90
|
+
|
|
91
|
+
| Nível | Categorias de Tasks |
|
|
92
|
+
|-------|---------------------|
|
|
93
|
+
| **1 — CRUD** | `domain` (Entity simples) → `infrastructure` (Repository, EF Config) → `application` (Service CRUD) → `presentation` (API/Page) → `tests` |
|
|
94
|
+
| **2 — Business Logic** | `domain` (AggregateRoot, ValueObjects, DomainEvents) → `infrastructure` (Repository, EF Config) → `application` (Commands, Queries, Handlers) → `presentation` (API/Page) → `tests` |
|
|
95
|
+
| **3 — Bounded Context** | `domain-bc` (BC setup, Aggregates, Events) → `infrastructure` (BC repositories, EF) → `application` (Commands, Queries, Integration handlers) → `presentation` → `tests` |
|
|
96
|
+
|
|
97
|
+
**Nível 1:** Nenhuma task adicional obrigatória — apenas o padrão CRUD nas categorias listadas.
|
|
98
|
+
|
|
99
|
+
**Tasks adicionais obrigatórias por nível:**
|
|
100
|
+
|
|
101
|
+
**Nível 2 apenas:**
|
|
102
|
+
- `T{N}: Implementar AggregateRoot {EntityName} com factory method e invariants` (domain)
|
|
103
|
+
- `T{N}: Implementar ValueObjects: {lista do Aggregate Blueprint}` (domain)
|
|
104
|
+
- `T{N}: Implementar DomainEvents: {lista do Aggregate Blueprint}` (domain)
|
|
105
|
+
- `T{N}: Implementar Command Handlers com MediatR` (application)
|
|
106
|
+
- `T{N}: Implementar Query Handlers com read models` (application)
|
|
107
|
+
|
|
108
|
+
**Nível 3 apenas (além do Nível 2):**
|
|
109
|
+
- `T{N}: Configurar namespace/pasta do Bounded Context {BoundedContext}` (infrastructure)
|
|
110
|
+
- `T{N}: Implementar Integration Events para comunicação cross-BC` (domain-bc)
|
|
111
|
+
- `T{N}: Implementar handlers de Integration Events` (application)
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
### Passo 1: Analisar Spec
|
|
116
|
+
|
|
117
|
+
Leia `.morph/features/$ARGUMENTS/1-design/spec.md` e identifique:
|
|
118
|
+
|
|
119
|
+
1. **Requisitos funcionais** (FR001, FR002, ...)
|
|
120
|
+
2. **Componentes técnicos** (Entities, Services, Controllers, Pages)
|
|
121
|
+
3. **Infraestrutura** (Bicep, migrations, configs)
|
|
122
|
+
4. **Testes** (Unit tests, integration tests)
|
|
123
|
+
|
|
124
|
+
### Passo 2: Quebrar em Tasks
|
|
125
|
+
|
|
126
|
+
Crie tasks no formato **T{NNN}** seguindo ordem lógica de implementação.
|
|
127
|
+
|
|
128
|
+
#### 2.1. Estrutura de Task
|
|
129
|
+
|
|
130
|
+
```json
|
|
131
|
+
{
|
|
132
|
+
"id": "T001",
|
|
133
|
+
"title": "Criar Entity {Nome}",
|
|
134
|
+
"description": "Implementar entity {Nome} com propriedades X, Y, Z seguindo padrões EF Core",
|
|
135
|
+
"category": "domain",
|
|
136
|
+
"dependencies": [],
|
|
137
|
+
"estimatedMinutes": 30,
|
|
138
|
+
"status": "pending",
|
|
139
|
+
"specSections": ["## Domain Model", "## Business Rules"],
|
|
140
|
+
"contractInterfaces": ["I{Nome}Repository"],
|
|
141
|
+
"files": [
|
|
142
|
+
"Domain/Entities/{Nome}.cs",
|
|
143
|
+
"Infrastructure/Data/Configurations/{Nome}Configuration.cs"
|
|
144
|
+
]
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
#### 2.2. Categorias de Tasks
|
|
149
|
+
|
|
150
|
+
| Categoria | Descrição | Exemplos |
|
|
151
|
+
|-----------|-----------|----------|
|
|
152
|
+
| **domain** | Entities, Value Objects, Enums | Entity, DomainException |
|
|
153
|
+
| **application** | Services, DTOs, Interfaces | Service, Validator, Mapper |
|
|
154
|
+
| **infrastructure** | DbContext, Repositories, External APIs | EF Config, Repository impl |
|
|
155
|
+
| **presentation** | Controllers, Pages, Components | API endpoint, Blazor page |
|
|
156
|
+
| **tests** | Unit tests, Integration tests | Service tests, API tests |
|
|
157
|
+
| **infra** | Bicep, Migrations, Scripts | Azure resources, DB migration |
|
|
158
|
+
| **docs** | README, API docs, Swagger | OpenAPI spec, README update |
|
|
159
|
+
|
|
160
|
+
#### 2.3. Ordem de Implementação
|
|
161
|
+
|
|
162
|
+
**Bottom-up approach:**
|
|
163
|
+
```
|
|
164
|
+
1. Domain (Entities, Enums, Value Objects)
|
|
165
|
+
↓
|
|
166
|
+
2. Infrastructure (Repositories, DbContext configs)
|
|
167
|
+
↓
|
|
168
|
+
3. Application (Services, DTOs, Business logic)
|
|
169
|
+
↓
|
|
170
|
+
4. Presentation (Controllers, Pages, Components)
|
|
171
|
+
↓
|
|
172
|
+
5. Tests (Unit → Integration)
|
|
173
|
+
↓
|
|
174
|
+
6. Infra (Bicep, Migrations, Deploy scripts)
|
|
175
|
+
↓
|
|
176
|
+
7. Docs (README, Swagger, Comments)
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Passo 3: Definir Dependências
|
|
180
|
+
|
|
181
|
+
Para cada task, especifique dependências:
|
|
182
|
+
|
|
183
|
+
```json
|
|
184
|
+
{
|
|
185
|
+
"id": "T005",
|
|
186
|
+
"title": "Criar {Nome}Service",
|
|
187
|
+
"dependencies": ["T001", "T002"],
|
|
188
|
+
"status": "pending"
|
|
189
|
+
}
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
**Regra:** Task só pode ser executada quando todas as dependências estão `completed`.
|
|
193
|
+
|
|
194
|
+
### Passo 4: Estabelecer Checkpoints
|
|
195
|
+
|
|
196
|
+
Defina checkpoints a cada **3 tasks** ou **marcos significativos**:
|
|
197
|
+
|
|
198
|
+
```json
|
|
199
|
+
{
|
|
200
|
+
"id": "CHECKPOINT_001",
|
|
201
|
+
"title": "Domain Layer Completo",
|
|
202
|
+
"afterTasks": ["T001", "T002", "T003"],
|
|
203
|
+
"validations": [
|
|
204
|
+
"Todas as entities criadas",
|
|
205
|
+
"Migrations aplicadas",
|
|
206
|
+
"Testes de domain passando"
|
|
207
|
+
]
|
|
208
|
+
}
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### Passo 5: Estimar Esforço
|
|
212
|
+
|
|
213
|
+
Para cada task, estime tempo em minutos:
|
|
214
|
+
|
|
215
|
+
| Complexidade | Tempo Estimado |
|
|
216
|
+
|--------------|----------------|
|
|
217
|
+
| Trivial (CRUD básico) | 15-30 min |
|
|
218
|
+
| Simples (Service, Controller) | 30-60 min |
|
|
219
|
+
| Média (Business logic, validações) | 60-120 min |
|
|
220
|
+
| Complexa (Integrações, AI) | 120-240 min |
|
|
221
|
+
|
|
222
|
+
### Passo 6: Gerar `tasks.json`
|
|
223
|
+
|
|
224
|
+
Crie `.morph/features/$ARGUMENTS/3-tasks/tasks.md` com a estrutura completa de tasks, checkpoints e estimativas.
|
|
225
|
+
|
|
226
|
+
### Passo 7: Incluir Tasks de IaC (se necessário)
|
|
227
|
+
|
|
228
|
+
Se houver recursos Azure, adicionar tasks de Bicep e migrations.
|
|
229
|
+
|
|
230
|
+
### Passo 8: Atualizar State
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
npx morph-spec state set $ARGUMENTS phase tasks
|
|
234
|
+
npx morph-spec state set $ARGUMENTS tasks.total {N}
|
|
235
|
+
npx morph-spec state mark-output $ARGUMENTS tasks
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
## Outputs Gerados
|
|
239
|
+
|
|
240
|
+
- `.morph/features/$ARGUMENTS/3-tasks/tasks.md` - Breakdown completo de tasks
|
|
241
|
+
|
|
242
|
+
## PAUSA OBRIGATÓRIA
|
|
243
|
+
|
|
244
|
+
Apresente ao usuário 3 ações sugeridas:
|
|
245
|
+
|
|
246
|
+
1. **Aprovar breakdown e iniciar implementação**
|
|
247
|
+
2. **Repriorizar tasks** - Mudar ordem de execução
|
|
248
|
+
3. **Adicionar/remover tasks** - Ajustar escopo
|
|
249
|
+
|
|
250
|
+
## Critérios de Avanço
|
|
251
|
+
|
|
252
|
+
- [x] `tasks.json` criado com todas as tasks
|
|
253
|
+
- [x] Tasks categorizadas corretamente
|
|
254
|
+
- [x] Dependências mapeadas
|
|
255
|
+
- [x] Checkpoints definidos (a cada 3 tasks)
|
|
256
|
+
- [x] Esforço estimado por task
|
|
257
|
+
- [x] Ordem de execução clara
|
|
258
|
+
- [x] Tasks de IaC incluídas (se aplicável)
|
|
259
|
+
- [x] State atualizado com total de tasks
|
|
260
|
+
- [x] Usuário aprovou breakdown
|
|
261
|
+
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
## Integração com Superpowers
|
|
265
|
+
|
|
266
|
+
> Disponível quando o plugin `superpowers` está instalado.
|
|
267
|
+
|
|
268
|
+
| Skill | Quando Usar | Invocação |
|
|
269
|
+
|-------|-------------|-----------|
|
|
270
|
+
| `writing-plans` | Após breakdown de tasks, para planejar sequência de implementação | `Skill(superpowers:writing-plans)` |
|
|
271
|
+
| `executing-plans` | Para executar o plano de tasks em sessão separada | `Skill(superpowers:executing-plans)` |
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
275
|
+
## Outputs desta Fase
|
|
276
|
+
|
|
277
|
+
<!-- morph:outputs:tasks -->
|
|
278
|
+
| Output | Caminho |
|
|
279
|
+
|--------|---------|
|
|
280
|
+
| `tasks` | `.morph/features/{feature}/3-tasks/tasks.md` |
|
|
281
|
+
<!-- /morph:outputs -->
|
|
282
|
+
|
|
283
|
+
---
|
|
284
|
+
|
|
284
285
|
Após aprovação: "Planejamento completo! Execute `/morph-apply $ARGUMENTS` para iniciar implementação."
|