@polymorphism-tech/morph-spec 4.10.6 → 4.10.8
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/CLAUDE.md +3 -0
- package/LICENSE +71 -71
- package/README.md +379 -379
- package/bin/morph-spec.js +89 -0
- package/bin/task-manager.js +59 -6
- package/claude-plugin.json +14 -14
- package/docs/CHEATSHEET.md +1 -1
- package/docs/QUICKSTART.md +206 -206
- package/framework/agents/README.md +14 -14
- package/framework/agents/architecture/standards-architect.md +159 -159
- package/framework/agents/frontend/blazor-builder.md +13 -0
- package/framework/agents/frontend/css-specialist.md +87 -0
- package/framework/agents/frontend/nextjs-expert.md +13 -0
- package/framework/agents/frontend/nextjs-ui-specialist.md +218 -0
- package/framework/agents/frontend/ui-ux-designer.md +80 -10
- package/framework/agents/infrastructure/azure-architect.md +149 -149
- package/framework/agents/infrastructure/infra-architect.md +48 -48
- package/framework/agents.json +2268 -2567
- package/framework/hooks/README.md +204 -204
- package/framework/hooks/claude-code/post-tool-use/dispatch.js +10 -5
- package/framework/hooks/claude-code/session-start/inject-morph-context.js +10 -24
- package/framework/hooks/shared/phase-utils.js +139 -139
- package/framework/hooks/shared/worktree-helpers.js +30 -8
- package/framework/rules/csharp-standards.md +13 -13
- package/framework/rules/frontend-standards.md +13 -13
- package/framework/rules/infrastructure-standards.md +16 -16
- package/framework/rules/testing-standards.md +14 -14
- package/framework/skills/README.md +0 -1
- package/framework/skills/level-0-meta/morph-brainstorming/SKILL.md +12 -0
- package/framework/skills/level-0-meta/morph-code-review-nextjs/references/review-example-nextjs.md +254 -254
- package/framework/skills/level-0-meta/morph-init/SKILL.md +88 -3
- package/framework/skills/level-1-workflows/morph-phase-clarify/SKILL.md +247 -247
- package/framework/skills/level-1-workflows/morph-phase-codebase-analysis/SKILL.md +270 -270
- package/framework/skills/level-1-workflows/morph-phase-design/SKILL.md +515 -499
- package/framework/skills/level-1-workflows/morph-phase-implement/SKILL.md +508 -471
- package/framework/skills/level-1-workflows/morph-phase-plan/SKILL.md +12 -1
- package/framework/skills/level-1-workflows/morph-phase-setup/SKILL.md +272 -258
- package/framework/skills/level-1-workflows/morph-phase-tasks/SKILL.md +317 -311
- package/framework/skills/level-1-workflows/morph-phase-uiux/SKILL.md +424 -323
- package/framework/skills/level-1-workflows/morph-scope-escalation/SKILL.md +1 -1
- package/framework/standards/STANDARDS.json +2040 -2040
- package/framework/standards/frontend/nextjs/motion-patterns.md +321 -0
- package/framework/standards/frontend/nextjs/nextjs-patterns.md +17 -17
- package/framework/templates/README.md +814 -814
- package/framework/templates/code/dotnet/contracts/Commands.cs +74 -74
- package/framework/templates/code/dotnet/contracts/Entities.cs +25 -25
- package/framework/templates/code/dotnet/contracts/Queries.cs +74 -74
- package/framework/templates/code/dotnet/contracts/README.md +74 -74
- package/framework/templates/code/dotnet/contracts/api-contracts.cs +173 -173
- package/framework/templates/code/dotnet/frontend/component.razor +239 -239
- package/framework/templates/code/dotnet/jobs/agent.cs +163 -163
- package/framework/templates/code/dotnet/jobs/job.cs +171 -171
- package/framework/templates/code/dotnet/test.cs +239 -239
- package/framework/templates/code/sql/rls-policy.sql +57 -57
- package/framework/templates/code/sql/supabase-migration.sql +100 -100
- package/framework/templates/code/sql/supabase-migration.template.sql +113 -113
- package/framework/templates/code/typescript/contracts.ts +168 -168
- package/framework/templates/context/CONTEXT.md +181 -181
- package/framework/templates/context/design-system.md +211 -0
- package/framework/templates/docs/proposal.md +182 -182
- package/framework/templates/docs/user-stories.md +34 -34
- package/framework/templates/examples/design-system-examples.md +357 -357
- package/framework/templates/examples/spec-examples.md +90 -90
- package/framework/templates/feature/decisions.md +187 -187
- package/framework/templates/feature/recap.md +146 -146
- package/framework/templates/feature/tasks.md +199 -199
- package/framework/templates/infrastructure/azure/README.md +286 -286
- package/framework/templates/infrastructure/azure/deploy-checklist.md +426 -426
- package/framework/templates/infrastructure/azure/parameters.dev.json +29 -29
- package/framework/templates/infrastructure/azure/parameters.prod.json +29 -29
- package/framework/templates/infrastructure/azure/parameters.staging.json +29 -29
- package/framework/templates/infrastructure/docker/docker-compose.template.yml +67 -67
- package/framework/templates/infrastructure/docker/dockerfile-api.dockerfile +38 -38
- package/framework/templates/infrastructure/docker/dockerfile-web.dockerfile +48 -48
- package/framework/templates/infrastructure/docker/easypanel.template.json +54 -54
- package/package.json +82 -82
- package/src/commands/agents/agent-metrics.js +174 -0
- package/src/commands/agents/audit-dispatch.js +82 -0
- package/src/commands/agents/detect-agents.js +275 -0
- package/src/commands/agents/dispatch-agents.js +41 -135
- package/src/commands/agents/index.js +13 -4
- package/src/commands/agents/manage-agents.js +352 -0
- package/src/commands/project/doctor.js +59 -0
- package/src/commands/project/install-plugin-cmd.js +28 -28
- package/src/commands/project/setup-infra-cmd.js +12 -12
- package/src/commands/project/update.js +1 -17
- package/src/commands/project/worktree.js +58 -2
- package/src/commands/state/advance-phase.js +11 -3
- package/src/commands/tasks/index.js +4 -4
- package/src/commands/templates/index.js +5 -5
- package/src/commands/utils/index.js +3 -3
- package/src/commands/validation/index.js +4 -4
- package/src/core/state/phase-state-machine.js +217 -217
- package/src/core/state/state-manager.js +81 -0
- package/src/lib/agents/agents-manager.js +349 -0
- package/src/lib/agents/metrics-calculator.js +125 -0
- package/src/lib/agents/output-collector.js +75 -0
- package/src/lib/generators/context-generator.js +8 -7
- package/src/lib/generators/design-system-generator.js +298 -298
- package/src/lib/generators/index.js +10 -10
- package/src/lib/generators/metadata-extractor.js +387 -387
- package/src/lib/stack-filter.js +65 -65
- package/src/lib/standards/index.js +7 -7
- package/src/lib/standards/standards-context-injector.js +302 -302
- package/src/lib/tasks/task-parser.js +94 -3
- package/src/lib/validators/architecture/architecture-validator.js +387 -387
- package/src/lib/validators/architecture/index.js +7 -7
- package/src/lib/validators/blazor/blazor-concurrency-analyzer.js +316 -316
- package/src/lib/validators/blazor/blazor-state-validator.js +279 -279
- package/src/lib/validators/blazor/blazor-validator.js +369 -369
- package/src/lib/validators/blazor/index.js +9 -9
- package/src/lib/validators/checkpoint-persistence.js +39 -0
- package/src/lib/validators/content/content-validator.js +287 -279
- package/src/lib/validators/content/index.js +7 -7
- package/src/lib/validators/contracts/index.js +7 -7
- package/src/lib/validators/css/css-validator.js +352 -352
- package/src/lib/validators/css/index.js +7 -7
- package/src/lib/validators/design-system/design-system-validator.js +231 -231
- package/src/lib/validators/design-system/index.js +7 -7
- package/src/lib/validators/nextjs/index.js +6 -6
- package/src/lib/validators/nextjs/next-component-validator.js +183 -183
- package/src/lib/validators/packages/index.js +7 -7
- package/src/lib/validators/packages/package-validator.js +360 -360
- package/src/lib/validators/shared/index.js +12 -12
- package/src/lib/validators/shared/issue-counter.js +18 -18
- package/src/lib/validators/shared/result-formatter.js +124 -124
- package/src/lib/validators/spec-validator.js +2 -2
- package/src/lib/validators/ui/index.js +7 -7
- package/src/lib/validators/ui/ui-contrast-validator.js +422 -422
- package/src/lib/validators/validation-runner.js +20 -0
- package/src/scripts/global-install.js +58 -58
- package/src/scripts/install-plugin.js +126 -126
- package/src/scripts/setup-infra.js +1 -17
- package/src/utils/agent-id-mapper.js +11 -0
- package/src/utils/agents-installer.js +40 -8
- package/src/utils/claude-md-injector.js +90 -90
- package/src/utils/claude-settings-manager.js +1 -1
- package/src/utils/file-copier.js +200 -196
- package/src/utils/hooks-installer.js +556 -739
- package/src/utils/logger.js +32 -32
- package/src/utils/skills-installer.js +178 -178
- package/src/utils/tier-helpers.js +24 -0
- package/src/utils/version-checker.js +175 -175
- package/framework/agents/architecture/po-pm-advisor.md +0 -203
- package/framework/hooks/claude-code/user-prompt/set-terminal-title.js +0 -68
- package/framework/skills/level-1-workflows/morph-phase-implement/.morph/logs/activity.json +0 -38
- package/framework/skills/level-1-workflows/morph-phase-tasks/.morph/logs/activity.json +0 -14
- package/framework/templates/.idea/morph-templates.xml +0 -92
- package/framework/templates/.vscode/morph-templates.code-snippets +0 -186
|
@@ -1,311 +1,317 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: morph-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
|
-
user-invocable: false
|
|
6
|
-
allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
|
|
7
|
-
cliVersion: "4.10.
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
# MORPH Tasks — Phase 4
|
|
11
|
-
|
|
12
|
-
> INTERNAL: Workflow skill used by /morph-proposal during automated phase orchestration. Not a user command.
|
|
13
|
-
|
|
14
|
-
Break the approved specification into executable tasks, define execution order, and establish checkpoints.
|
|
15
|
-
|
|
16
|
-
## Prerequisites
|
|
17
|
-
|
|
18
|
-
- [ ] Phase 3 (Clarify) completed
|
|
19
|
-
- [ ] `spec.md` updated with clarifications
|
|
20
|
-
- [ ] All edge cases documented
|
|
21
|
-
|
|
22
|
-
## Recommended Tools
|
|
23
|
-
|
|
24
|
-
> **Ref:** `framework/skills/level-0-meta/morph-tool-usage-guide/SKILL.md` for complete guide.
|
|
25
|
-
> **Ref:** `framework/standards/integration/mcp/mcp-tools.md` for MCP reference.
|
|
26
|
-
> **Example:** `references/tasks-example.md` — filled-in tasks.md showing expected granularity and format.
|
|
27
|
-
> **Script:** `scripts/validate-tasks.mjs` — validates tasks.md structure, T### IDs, and required fields.
|
|
28
|
-
|
|
29
|
-
| Action | Tool | Alternative |
|
|
30
|
-
|--------|------|-------------|
|
|
31
|
-
| Read spec + contracts + decisions | **Read** all outputs | — |
|
|
32
|
-
| Analyze implementation complexity | **Grep** patterns in existing code | — |
|
|
33
|
-
| Count similar existing patterns | **Glob** `**/Services/**/*.cs` | — |
|
|
34
|
-
| Look up implementation patterns | **Context7 MCP** `query_docs()` | **WebSearch** |
|
|
35
|
-
| Create GitHub issues from tasks | **GitHub MCP** `create_issue()` | **Bash** `gh issue create ...` |
|
|
36
|
-
| Render tasks template | **Bash** `npx morph-spec template render docs/tasks ...` | — |
|
|
37
|
-
| Update state with task count | **Bash** `npx morph-spec state set ... tasks.total N` | — |
|
|
38
|
-
|
|
39
|
-
**Phase MCPs:** Context7 (estimate complexity), GitHub (create issues).
|
|
40
|
-
|
|
41
|
-
**Anti-patterns:**
|
|
42
|
-
- Task agent to break down a simple single-domain spec (do it directly)
|
|
43
|
-
- Creating tasks without reading all design outputs first
|
|
44
|
-
- **(VSA)** Creating separate tasks for Handler, Validator, and Endpoint — one slice = one task
|
|
45
|
-
- **(VSA)** Using DDD categories (`domain`, `application`, `infrastructure`) in VSA projects — use VSA categories: `entity`, `errors`, `tags`, `migration`, `slice`, `frontend`, `tests`
|
|
46
|
-
- **(VSA)** Creating a "Implement Service layer" task — there is no Service layer in VSA
|
|
47
|
-
- Using vague effort labels ("Low", "Medium", "S/M") — always use specific minute estimates
|
|
48
|
-
- Using non-standard task IDs (TASK-001, T01) — always use **T001** format (T + 3 digits)
|
|
49
|
-
|
|
50
|
-
---
|
|
51
|
-
|
|
52
|
-
## Pre-flight (before starting task breakdown)
|
|
53
|
-
|
|
54
|
-
### 0. Ensure tasks phase
|
|
55
|
-
|
|
56
|
-
```bash
|
|
57
|
-
npx morph-spec state get $ARGUMENTS
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
Check the `"phase"` field:
|
|
61
|
-
|
|
62
|
-
**If `"phase": "tasks"`** → correct phase, proceed.
|
|
63
|
-
|
|
64
|
-
**If `"phase": "clarify"`** → run in sequence:
|
|
65
|
-
1. `npx morph-spec state mark-output $ARGUMENTS clarifications`
|
|
66
|
-
2. `npx morph-spec phase advance $ARGUMENTS` (→ tasks)
|
|
67
|
-
|
|
68
|
-
**Any other value** → STOP — inconsistent state, report to user.
|
|
69
|
-
|
|
70
|
-
> **Rule:** Never write to `4-tasks/` until the phase is `tasks`. The hook will block writes.
|
|
71
|
-
|
|
72
|
-
---
|
|
73
|
-
|
|
74
|
-
### 1. Read all prerequisites in PARALLEL
|
|
75
|
-
|
|
76
|
-
```
|
|
77
|
-
# Single parallel call, not sequential:
|
|
78
|
-
Read: .morph/features/{feature}/1-design/spec.md
|
|
79
|
-
+ Read: .morph/features/{feature}/1-design/contracts.cs (or contracts.ts for TypeScript projects)
|
|
80
|
-
+ Read: .morph/features/{feature}/1-design/decisions.md
|
|
81
|
-
+ Read: .morph/features/{feature}/1-design/schema-analysis.md (if exists)
|
|
82
|
-
+ Read: .morph/config/config.json (→ architecture.style)
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
### 2. Create session tasks for visibility
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
TaskCreate: "
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
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
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
-
|
|
278
|
-
|
|
279
|
-
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
- [x]
|
|
284
|
-
- [x]
|
|
285
|
-
- [x]
|
|
286
|
-
- [x]
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
1
|
+
---
|
|
2
|
+
name: morph-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
|
+
user-invocable: false
|
|
6
|
+
allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
|
|
7
|
+
cliVersion: "4.10.8"
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# MORPH Tasks — Phase 4
|
|
11
|
+
|
|
12
|
+
> INTERNAL: Workflow skill used by /morph-proposal during automated phase orchestration. Not a user command.
|
|
13
|
+
|
|
14
|
+
Break the approved specification into executable tasks, define execution order, and establish checkpoints.
|
|
15
|
+
|
|
16
|
+
## Prerequisites
|
|
17
|
+
|
|
18
|
+
- [ ] Phase 3 (Clarify) completed
|
|
19
|
+
- [ ] `spec.md` updated with clarifications
|
|
20
|
+
- [ ] All edge cases documented
|
|
21
|
+
|
|
22
|
+
## Recommended Tools
|
|
23
|
+
|
|
24
|
+
> **Ref:** `framework/skills/level-0-meta/morph-tool-usage-guide/SKILL.md` for complete guide.
|
|
25
|
+
> **Ref:** `framework/standards/integration/mcp/mcp-tools.md` for MCP reference.
|
|
26
|
+
> **Example:** `references/tasks-example.md` — filled-in tasks.md showing expected granularity and format.
|
|
27
|
+
> **Script:** `scripts/validate-tasks.mjs` — validates tasks.md structure, T### IDs, and required fields.
|
|
28
|
+
|
|
29
|
+
| Action | Tool | Alternative |
|
|
30
|
+
|--------|------|-------------|
|
|
31
|
+
| Read spec + contracts + decisions | **Read** all outputs | — |
|
|
32
|
+
| Analyze implementation complexity | **Grep** patterns in existing code | — |
|
|
33
|
+
| Count similar existing patterns | **Glob** `**/Services/**/*.cs` | — |
|
|
34
|
+
| Look up implementation patterns | **Context7 MCP** `query_docs()` | **WebSearch** |
|
|
35
|
+
| Create GitHub issues from tasks | **GitHub MCP** `create_issue()` | **Bash** `gh issue create ...` |
|
|
36
|
+
| Render tasks template | **Bash** `npx morph-spec template render docs/tasks ...` | — |
|
|
37
|
+
| Update state with task count | **Bash** `npx morph-spec state set ... tasks.total N` | — |
|
|
38
|
+
|
|
39
|
+
**Phase MCPs:** Context7 (estimate complexity), GitHub (create issues).
|
|
40
|
+
|
|
41
|
+
**Anti-patterns:**
|
|
42
|
+
- Task agent to break down a simple single-domain spec (do it directly)
|
|
43
|
+
- Creating tasks without reading all design outputs first
|
|
44
|
+
- **(VSA)** Creating separate tasks for Handler, Validator, and Endpoint — one slice = one task
|
|
45
|
+
- **(VSA)** Using DDD categories (`domain`, `application`, `infrastructure`) in VSA projects — use VSA categories: `entity`, `errors`, `tags`, `migration`, `slice`, `frontend`, `tests`
|
|
46
|
+
- **(VSA)** Creating a "Implement Service layer" task — there is no Service layer in VSA
|
|
47
|
+
- Using vague effort labels ("Low", "Medium", "S/M") — always use specific minute estimates
|
|
48
|
+
- Using non-standard task IDs (TASK-001, T01) — always use **T001** format (T + 3 digits)
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Pre-flight (before starting task breakdown)
|
|
53
|
+
|
|
54
|
+
### 0. Ensure tasks phase
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
npx morph-spec state get $ARGUMENTS
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Check the `"phase"` field:
|
|
61
|
+
|
|
62
|
+
**If `"phase": "tasks"`** → correct phase, proceed.
|
|
63
|
+
|
|
64
|
+
**If `"phase": "clarify"`** → run in sequence:
|
|
65
|
+
1. `npx morph-spec state mark-output $ARGUMENTS clarifications`
|
|
66
|
+
2. `npx morph-spec phase advance $ARGUMENTS` (→ tasks)
|
|
67
|
+
|
|
68
|
+
**Any other value** → STOP — inconsistent state, report to user.
|
|
69
|
+
|
|
70
|
+
> **Rule:** Never write to `4-tasks/` until the phase is `tasks`. The hook will block writes.
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
### 1. Read all prerequisites in PARALLEL
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
# Single parallel call, not sequential:
|
|
78
|
+
Read: .morph/features/{feature}/1-design/spec.md
|
|
79
|
+
+ Read: .morph/features/{feature}/1-design/contracts.cs (or contracts.ts for TypeScript projects)
|
|
80
|
+
+ Read: .morph/features/{feature}/1-design/decisions.md
|
|
81
|
+
+ Read: .morph/features/{feature}/1-design/schema-analysis.md (if exists)
|
|
82
|
+
+ Read: .morph/config/config.json (→ architecture.style)
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### 2. Create session tasks for visibility
|
|
86
|
+
|
|
87
|
+
After detecting `activeAgents` from state, create tasks with agent context:
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
TaskCreate: "Analyze spec and define tasks"
|
|
91
|
+
→ description: "Active agents: {activeAgents.join(', ')}"
|
|
92
|
+
→ activeForm: "Analyzing spec"
|
|
93
|
+
TaskCreate: "Generate tasks.md"
|
|
94
|
+
→ description: "Architecture: {config.architecture.style}"
|
|
95
|
+
→ activeForm: "Generating tasks.md"
|
|
96
|
+
TaskCreate: "Phase advance" → activeForm: "Awaiting tasks approval + advancing phase"
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
> **Note:** Individual T001-T00N tasks are created as native tasks during the implementation phase (`phase-implement`). Here we only keep the 3 high-level tasks for this planning session.
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
### 3. Entry checkpoint — verify prerequisites
|
|
104
|
+
|
|
105
|
+
Before starting the breakdown:
|
|
106
|
+
|
|
107
|
+
- [ ] `spec.md` exists and approved by user?
|
|
108
|
+
- [ ] `contracts.cs`/`.ts` exists and matches real schema?
|
|
109
|
+
- [ ] `schema-analysis.md` validated (if applicable)?
|
|
110
|
+
- [ ] `decisions.md` contains ADRs for all critical choices?
|
|
111
|
+
- [ ] Design gate (`morph-spec approve $ARGUMENTS design`) approved?
|
|
112
|
+
- [ ] Clarifications (Phase 3) resolved and spec updated?
|
|
113
|
+
|
|
114
|
+
If any checkbox is NOT checked → return to corresponding phase and resolve.
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
npx morph-spec state get $ARGUMENTS
|
|
118
|
+
npx morph-spec approval-status $ARGUMENTS
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## Workflow
|
|
124
|
+
|
|
125
|
+
### Step 0: Detect Architecture Style
|
|
126
|
+
|
|
127
|
+
Before anything else, determine if the project is VSA or DDD:
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
cat .morph/config/config.json | grep -A3 '"architecture"'
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
**If `config.architecture.style === "vertical-slice"`** → follow **Step 0.5 (VSA)** and skip DDD path.
|
|
134
|
+
**Otherwise** → follow **Step 0.6 (DDD)** below.
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
### Step 0.5: VSA Task Plan
|
|
139
|
+
|
|
140
|
+
> For VSA task patterns and DDD-level mappings, see `references/task-planning-patterns.md`
|
|
141
|
+
|
|
142
|
+
Read the `## Architecture Style: Vertical Slice` section from spec.md for the **VSA Blueprint**:
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
grep -A30 "## Architecture Style" ".morph/features/$ARGUMENTS/1-design/spec.md"
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Create one task per slice following this order: entity → errors → tags → migration → CRUD slices → custom slices → frontend → tests. Each slice = Handler + Validator + Endpoint in a **single task**. `GetAll` operations do NOT have a Validator (no input parameters to validate).
|
|
149
|
+
|
|
150
|
+
Use VSA-specific categories: `entity`, `errors`, `tags`, `migration`, `slice`, `frontend`, `tests`.
|
|
151
|
+
|
|
152
|
+
**After defining VSA tasks, skip directly to Step 3 (Dependencies).**
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
### Step 0.6: Read Domain Level — DDD
|
|
157
|
+
|
|
158
|
+
Read the `## Domain Complexity` section from spec.md:
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
grep -A15 "## Domain Complexity" ".morph/features/$ARGUMENTS/1-design/spec.md"
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
> If the section doesn't exist, assume **Level 1 (CRUD)**.
|
|
165
|
+
|
|
166
|
+
Use the level to constrain categories:
|
|
167
|
+
- **Level 1**: domain → infrastructure → application → presentation → tests
|
|
168
|
+
- **Level 2**: adds AggregateRoot, ValueObjects, DomainEvents, CQRS handlers
|
|
169
|
+
- **Level 3**: adds BC setup, Integration Events
|
|
170
|
+
|
|
171
|
+
See `references/task-planning-patterns.md` for the complete table.
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
### Step 1: Analyze Spec
|
|
176
|
+
|
|
177
|
+
> **VSA:** If coming from Step 0.5, the task breakdown was already defined — use the generated examples as a base and skip to Step 3 (Dependencies).
|
|
178
|
+
|
|
179
|
+
Read `.morph/features/$ARGUMENTS/1-design/spec.md` and identify:
|
|
180
|
+
|
|
181
|
+
1. **Functional requirements** (FR001, FR002, ...)
|
|
182
|
+
2. **Technical components** (Entities, Services/Slices, Controllers/Endpoints, Pages)
|
|
183
|
+
3. **Infrastructure** (Bicep, migrations, configs)
|
|
184
|
+
4. **Tests** (Unit tests, integration tests)
|
|
185
|
+
|
|
186
|
+
### Step 2: Break Into Tasks
|
|
187
|
+
|
|
188
|
+
> For structure, categories, and implementation order, see `references/task-planning-patterns.md`
|
|
189
|
+
|
|
190
|
+
Create tasks using the **T{NNN}** format (T001, T002, ...) following bottom-up order: domain → infrastructure → application → presentation → tests → infra → docs.
|
|
191
|
+
|
|
192
|
+
The T### format is mandatory — it is used by `morph-spec task start/done` commands and the validate-tasks script. Do not use TASK-001, T01, or other formats.
|
|
193
|
+
|
|
194
|
+
### Step 3: Define Dependencies
|
|
195
|
+
|
|
196
|
+
For each task, specify dependencies:
|
|
197
|
+
|
|
198
|
+
```json
|
|
199
|
+
{
|
|
200
|
+
"id": "T005",
|
|
201
|
+
"title": "Create {Name}Service",
|
|
202
|
+
"dependencies": ["T001", "T002"],
|
|
203
|
+
"status": "pending"
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
**Rule:** A task can only be executed when all its dependencies are `completed`.
|
|
208
|
+
|
|
209
|
+
### Step 4: Establish Checkpoints
|
|
210
|
+
|
|
211
|
+
Define checkpoints after every **3 tasks** — this cadence matches the implementation phase's checkpoint-save frequency. Regular checkpoints catch integration issues early rather than at the end.
|
|
212
|
+
|
|
213
|
+
```json
|
|
214
|
+
{
|
|
215
|
+
"id": "CHECKPOINT_001",
|
|
216
|
+
"title": "Domain Layer Complete",
|
|
217
|
+
"afterTasks": ["T001", "T002", "T003"],
|
|
218
|
+
"validations": [
|
|
219
|
+
"All entities created",
|
|
220
|
+
"Migrations applied",
|
|
221
|
+
"Domain tests passing"
|
|
222
|
+
]
|
|
223
|
+
}
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### Step 5: Estimate Effort
|
|
227
|
+
|
|
228
|
+
For each task, estimate time **in minutes** (not vague labels like "Low/Medium"). Specific estimates help the plan phase determine execution strategy and parallelization.
|
|
229
|
+
|
|
230
|
+
| Complexity | Estimated Time |
|
|
231
|
+
|------------|----------------|
|
|
232
|
+
| Trivial (basic CRUD) | 15-30 min |
|
|
233
|
+
| Simple (Service, Controller) | 30-60 min |
|
|
234
|
+
| Medium (Business logic, validations) | 60-120 min |
|
|
235
|
+
| Complex (Integrations, AI) | 120-240 min |
|
|
236
|
+
|
|
237
|
+
### Step 6: Generate `tasks.md`
|
|
238
|
+
|
|
239
|
+
Create `.morph/features/$ARGUMENTS/4-tasks/tasks.md` with the complete task structure, checkpoints, and estimates.
|
|
240
|
+
|
|
241
|
+
### Step 7: Include IaC Tasks (if needed)
|
|
242
|
+
|
|
243
|
+
If there are Azure resources, add Bicep and migration tasks.
|
|
244
|
+
|
|
245
|
+
### Step 8: Update State
|
|
246
|
+
|
|
247
|
+
```bash
|
|
248
|
+
npx morph-spec state set $ARGUMENTS tasks.total {N}
|
|
249
|
+
npx morph-spec state mark-output $ARGUMENTS tasks
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
## Outputs
|
|
253
|
+
|
|
254
|
+
- `.morph/features/$ARGUMENTS/4-tasks/tasks.md` — Complete task breakdown
|
|
255
|
+
|
|
256
|
+
## Mandatory Approval Pause
|
|
257
|
+
|
|
258
|
+
Use `AskUserQuestion` to capture explicit approval before advancing. This gate prevents implementation from starting with an unapproved task list.
|
|
259
|
+
|
|
260
|
+
```json
|
|
261
|
+
{
|
|
262
|
+
"questions": [{
|
|
263
|
+
"header": "Approval",
|
|
264
|
+
"question": "Tasks generated. Approve to start implementation?",
|
|
265
|
+
"multiSelect": false,
|
|
266
|
+
"options": [
|
|
267
|
+
{ "label": "Approve and implement", "description": "Advance to implementation phase" },
|
|
268
|
+
{ "label": "I have feedback", "description": "Type what you want to change" }
|
|
269
|
+
]
|
|
270
|
+
}]
|
|
271
|
+
}
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
- **"Approve and implement"** →
|
|
275
|
+
```bash
|
|
276
|
+
npx morph-spec approve $ARGUMENTS tasks
|
|
277
|
+
npx morph-spec phase advance $ARGUMENTS
|
|
278
|
+
```
|
|
279
|
+
- **"I have feedback" or "Other"** → apply the feedback and repeat this PAUSE
|
|
280
|
+
|
|
281
|
+
## Completion Criteria
|
|
282
|
+
|
|
283
|
+
- [x] `tasks.md` created with all tasks
|
|
284
|
+
- [x] Tasks use T### format (T001, T002, ...) consistently
|
|
285
|
+
- [x] Tasks categorized correctly (DDD layers or VSA categories)
|
|
286
|
+
- [x] Dependencies mapped
|
|
287
|
+
- [x] Checkpoints defined (every 3 tasks)
|
|
288
|
+
- [x] Effort estimated in minutes per task
|
|
289
|
+
- [x] Execution order clear
|
|
290
|
+
- [x] IaC tasks included (if applicable)
|
|
291
|
+
- [x] State updated with total tasks (`state set tasks.total`)
|
|
292
|
+
- [x] User approved breakdown via `AskUserQuestion`
|
|
293
|
+
|
|
294
|
+
---
|
|
295
|
+
|
|
296
|
+
## Superpowers Integration
|
|
297
|
+
|
|
298
|
+
> Available when the `superpowers` plugin is installed.
|
|
299
|
+
|
|
300
|
+
| Skill | When to Use | Invocation |
|
|
301
|
+
|-------|-------------|-----------|
|
|
302
|
+
| `writing-plans` | After task breakdown, to plan implementation sequence | `Skill(superpowers:writing-plans)` |
|
|
303
|
+
| `executing-plans` | To execute the task plan in a separate session | `Skill(superpowers:executing-plans)` |
|
|
304
|
+
|
|
305
|
+
---
|
|
306
|
+
|
|
307
|
+
## Phase Outputs
|
|
308
|
+
|
|
309
|
+
<!-- morph-outputs:tasks -->
|
|
310
|
+
| Output | Caminho |
|
|
311
|
+
|--------|---------|
|
|
312
|
+
| `tasks` | `.morph/features/{feature}/4-tasks/tasks.md` |
|
|
313
|
+
<!-- /morph-outputs -->
|
|
314
|
+
|
|
315
|
+
---
|
|
316
|
+
|
|
317
|
+
After approval: "Planning complete! Run `/morph-apply $ARGUMENTS` to start implementation."
|