@polymorphism-tech/morph-spec 4.21.0 → 5.0.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.
Files changed (213) hide show
  1. package/CLAUDE.md +57 -71
  2. package/README.md +2 -2
  3. package/bin/morph-spec.js +224 -491
  4. package/claude-plugin.json +1 -1
  5. package/docs/CHEATSHEET.md +1 -1
  6. package/docs/QUICKSTART.md +1 -1
  7. package/framework/CLAUDE.md +55 -38
  8. package/framework/MORPH.md +244 -0
  9. package/framework/agents.json +127 -1183
  10. package/framework/commands/morph-apply.md +56 -240
  11. package/framework/commands/morph-archive.md +48 -85
  12. package/framework/commands/morph-preflight.md +7 -7
  13. package/framework/commands/morph-proposal.md +35 -191
  14. package/framework/commands/morph-status.md +19 -50
  15. package/framework/commands/morph-troubleshoot.md +2 -2
  16. package/framework/evals/rubrics/README.md +44 -0
  17. package/framework/evals/rubrics/architecture.md +46 -0
  18. package/framework/evals/rubrics/code-quality.md +50 -0
  19. package/framework/evals/rubrics/contracts.md +47 -0
  20. package/framework/evals/rubrics/test-coverage.md +50 -0
  21. package/framework/evals/scenarios/dotnet-crud.yaml +42 -0
  22. package/framework/evals/scenarios/nextjs-auth.yaml +38 -0
  23. package/framework/evals/suites/standard.yaml +5 -0
  24. package/framework/evals/trace-schema.md +67 -0
  25. package/framework/hooks/claude-code/core/README.md +3 -0
  26. package/framework/hooks/claude-code/core/denylist.json +14 -0
  27. package/framework/hooks/claude-code/{pre-tool-use → core}/enforce-phase-writes.js +5 -5
  28. package/framework/hooks/claude-code/core/post-edit-typecheck.js +69 -0
  29. package/framework/hooks/claude-code/core/pre-bash-denylist.js +29 -0
  30. package/framework/hooks/claude-code/{pre-tool-use → core}/protect-spec-files.js +4 -6
  31. package/framework/hooks/claude-code/{stop → core}/validate-completion.js +13 -82
  32. package/framework/hooks/shared/phase-utils.js +20 -28
  33. package/framework/hooks/shared/state-reader.js +4 -5
  34. package/framework/{skills/level-0-meta/mcp-registry.json → mcp/registry.json} +254 -210
  35. package/framework/phases.json +40 -114
  36. package/framework/rubrics/eval-rubric.json +66 -0
  37. package/framework/skills/README.md +39 -64
  38. package/framework/skills/core/README.md +3 -0
  39. package/framework/skills/core/morph-brainstorming/SKILL.md +102 -0
  40. package/framework/skills/core/morph-eval/SKILL.md +57 -0
  41. package/framework/skills/core/morph-implement/SKILL.md +83 -0
  42. package/framework/skills/core/morph-plan/SKILL.md +64 -0
  43. package/framework/skills/core/morph-review/SKILL.md +62 -0
  44. package/framework/skills/core/morph-stack-scan/SKILL.md +109 -0
  45. package/framework/skills/core/morph-standards/SKILL.md +49 -0
  46. package/framework/standards/STANDARDS.json +32 -0
  47. package/framework/standards/frontend/design-system/ai-image-generation.md +244 -0
  48. package/framework/standards/integration/mcp/mcp-tools.md +48 -0
  49. package/framework/templates/CLAUDE.md.core.guide.md +29 -0
  50. package/framework/templates/CLAUDE.md.core.template +22 -0
  51. package/framework/templates/REGISTRY.json +4 -4
  52. package/framework/workflows/configs/fast-track.json +5 -10
  53. package/framework/workflows/configs/full.json +4 -8
  54. package/framework/workflows/configs/quick.json +32 -0
  55. package/framework/workflows/configs/standard.json +57 -64
  56. package/package.json +7 -6
  57. package/src/commands/mcp/mcp-setup.js +58 -31
  58. package/src/commands/project/doctor.js +69 -70
  59. package/src/commands/project/init.js +26 -5
  60. package/src/commands/project/status.js +18 -19
  61. package/src/commands/state/approve.js +1 -1
  62. package/src/commands/validation/validate-feature.js +18 -112
  63. package/src/core/paths/output-schema.js +133 -151
  64. package/src/core/state/phase-state-machine.js +10 -24
  65. package/src/core/state/state-manager.js +17 -17
  66. package/src/core/workflows/workflow-detector.js +214 -31
  67. package/src/core/workflows/workflow-router.js +204 -0
  68. package/src/dashboard/app/pages/AgentMap.jsx +32 -33
  69. package/src/dashboard/app/pages/LiveState.jsx +1 -1
  70. package/src/dashboard/app/pages/PhasePipeline.jsx +2 -4
  71. package/src/dashboard/app/pages/SkillsLibrary.jsx +2 -3
  72. package/src/dashboard/app/pages/Workflows.jsx +2 -2
  73. package/src/dashboard/scanner/agents-scanner.js +30 -35
  74. package/src/lib/agents/metrics-aggregator.js +1 -1
  75. package/src/lib/agents/output-collector.js +7 -8
  76. package/src/lib/context/context-builder.js +289 -0
  77. package/src/lib/detectors/claude-config-detector.js +19 -3
  78. package/src/lib/generators/context-generator.js +20 -42
  79. package/src/lib/generators/index.js +1 -0
  80. package/src/lib/generators/mandate-generator.js +512 -0
  81. package/src/lib/generators/metadata-extractor.js +1 -1
  82. package/src/lib/generators/recap-generator.js +3 -4
  83. package/src/lib/installers/mcp-installer.js +300 -92
  84. package/src/lib/phase-chain/phase-validator.js +36 -40
  85. package/src/lib/stack/stack-profile.js +74 -91
  86. package/src/lib/tasks/task-parser.js +1 -1
  87. package/src/lib/tasks/wave-resolver.js +353 -0
  88. package/src/lib/validators/checkpoint-persistence.js +2 -2
  89. package/src/lib/validators/content/cross-phase-validator.js +281 -0
  90. package/src/lib/validators/content/index.js +1 -0
  91. package/src/lib/validators/shared/emit-validator-dispatch.js +6 -56
  92. package/src/scripts/global-install.js +2 -27
  93. package/src/utils/agents-installer.js +224 -447
  94. package/src/utils/claude-settings-manager.js +57 -15
  95. package/src/utils/file-copier.js +1 -0
  96. package/src/utils/hooks-installer.js +15 -117
  97. package/src/utils/skills-installer.js +12 -18
  98. package/bin/detect-agents.js +0 -226
  99. package/bin/task-manager.js +0 -1036
  100. package/framework/agents/README.md +0 -13
  101. package/framework/agents/ai-agents/ai-system-architect.md +0 -194
  102. package/framework/agents/ai-agents/vector-search-expert.md +0 -247
  103. package/framework/agents/architecture/architecture-expert.md +0 -98
  104. package/framework/agents/architecture/morph-spec-architect.md +0 -66
  105. package/framework/agents/architecture/packages-validator.md +0 -89
  106. package/framework/agents/architecture/security-expert.md +0 -79
  107. package/framework/agents/architecture/seo-growth-hacker.md +0 -168
  108. package/framework/agents/architecture/standards-architect.md +0 -153
  109. package/framework/agents/backend/dotnet-senior.md +0 -163
  110. package/framework/agents/backend/ef-modeler.md +0 -119
  111. package/framework/agents/backend/hangfire-orchestrator.md +0 -133
  112. package/framework/agents/backend/ms-agent-expert.md +0 -55
  113. package/framework/agents/backend/neon-expert.md +0 -379
  114. package/framework/agents/frontend/css-specialist.md +0 -89
  115. package/framework/agents/frontend/design-system-validator.md +0 -100
  116. package/framework/agents/frontend/gsap-animator.md +0 -131
  117. package/framework/agents/frontend/nextjs-component-validator.md +0 -97
  118. package/framework/agents/frontend/nextjs-expert.md +0 -201
  119. package/framework/agents/frontend/ui-designer.md +0 -259
  120. package/framework/agents/infrastructure/infra-architect.md +0 -215
  121. package/framework/agents/integrations/asaas-financial.md +0 -138
  122. package/framework/agents/integrations/neon-auth.md +0 -151
  123. package/framework/agents/integrations/resend-email.md +0 -127
  124. package/framework/hooks/claude-code/post-tool-use/agent-complete.js +0 -122
  125. package/framework/hooks/claude-code/post-tool-use/dispatch.js +0 -363
  126. package/framework/hooks/claude-code/post-tool-use/handle-tool-failure.js +0 -78
  127. package/framework/hooks/claude-code/post-tool-use/validator-feedback.js +0 -194
  128. package/framework/hooks/claude-code/pre-compact/save-morph-context.js +0 -199
  129. package/framework/hooks/claude-code/pre-tool-use/task-tracking-guard.js +0 -55
  130. package/framework/hooks/claude-code/session-start/inject-morph-context.js +0 -323
  131. package/framework/hooks/claude-code/session-start/post-compact-restore.js +0 -41
  132. package/framework/hooks/claude-code/session-start/resume-context.js +0 -77
  133. package/framework/hooks/claude-code/teammate-idle/teammate-idle.js +0 -90
  134. package/framework/hooks/claude-code/user-prompt/enrich-prompt.js +0 -114
  135. package/framework/hooks/shared/compact-restore.js +0 -123
  136. package/framework/hooks/shared/dispatch-helpers.js +0 -147
  137. package/framework/hooks/shared/skill-reminder-helpers.js +0 -79
  138. package/framework/hooks/shared/stale-task-reset.js +0 -57
  139. package/framework/hooks/shared/worktree-helpers.js +0 -75
  140. package/framework/skills/level-0-meta/README.md +0 -7
  141. package/framework/skills/level-0-meta/morph-agent-teams/SKILL.md +0 -472
  142. package/framework/skills/level-0-meta/morph-brainstorming/SKILL.md +0 -174
  143. package/framework/skills/level-0-meta/morph-brainstorming/references/proposal-example.md +0 -138
  144. package/framework/skills/level-0-meta/morph-checklist/SKILL.md +0 -145
  145. package/framework/skills/level-0-meta/morph-code-review/SKILL.md +0 -250
  146. package/framework/skills/level-0-meta/morph-code-review/references/review-example.md +0 -164
  147. package/framework/skills/level-0-meta/morph-code-review/references/review-guidelines.md +0 -100
  148. package/framework/skills/level-0-meta/morph-code-review/scripts/scan-csharp.mjs +0 -151
  149. package/framework/skills/level-0-meta/morph-code-review-nextjs/SKILL.md +0 -165
  150. package/framework/skills/level-0-meta/morph-code-review-nextjs/references/review-example-nextjs.md +0 -254
  151. package/framework/skills/level-0-meta/morph-code-review-nextjs/scripts/scan-nextjs.mjs +0 -189
  152. package/framework/skills/level-0-meta/morph-frontend-review/SKILL.md +0 -344
  153. package/framework/skills/level-0-meta/morph-frontend-review/scripts/scan-accessibility.mjs +0 -376
  154. package/framework/skills/level-0-meta/morph-init/SKILL.md +0 -537
  155. package/framework/skills/level-0-meta/morph-parallel-dispatch/SKILL.md +0 -225
  156. package/framework/skills/level-0-meta/morph-post-implementation/SKILL.md +0 -382
  157. package/framework/skills/level-0-meta/morph-post-implementation/scripts/detect-dev-server.mjs +0 -153
  158. package/framework/skills/level-0-meta/morph-post-implementation/scripts/detect-stack.mjs +0 -234
  159. package/framework/skills/level-0-meta/morph-simulation-checklist/SKILL.md +0 -106
  160. package/framework/skills/level-0-meta/morph-tool-usage-guide/SKILL.md +0 -243
  161. package/framework/skills/level-0-meta/morph-tool-usage-guide/references/tools-per-phase.md +0 -169
  162. package/framework/skills/level-0-meta/morph-verification-before-completion/SKILL.md +0 -148
  163. package/framework/skills/level-0-meta/morph-verification-before-completion/scripts/check-phase-outputs.mjs +0 -110
  164. package/framework/skills/level-1-workflows/README.md +0 -7
  165. package/framework/skills/level-1-workflows/morph-phase-codebase-analysis/SKILL.md +0 -269
  166. package/framework/skills/level-1-workflows/morph-phase-design/SKILL.md +0 -453
  167. package/framework/skills/level-1-workflows/morph-phase-design/references/architecture-analysis-guide.md +0 -44
  168. package/framework/skills/level-1-workflows/morph-phase-design/references/spec-authoring-guide.md +0 -55
  169. package/framework/skills/level-1-workflows/morph-phase-design/references/spec-example.md +0 -253
  170. package/framework/skills/level-1-workflows/morph-phase-implement/.morph/logs/activity.json +0 -38
  171. package/framework/skills/level-1-workflows/morph-phase-implement/SKILL.md +0 -493
  172. package/framework/skills/level-1-workflows/morph-phase-implement/prompts/code-quality-reviewer-prompt.md +0 -50
  173. package/framework/skills/level-1-workflows/morph-phase-implement/prompts/implementer-prompt.md +0 -46
  174. package/framework/skills/level-1-workflows/morph-phase-implement/prompts/spec-reviewer-prompt.md +0 -47
  175. package/framework/skills/level-1-workflows/morph-phase-implement/references/recap-example.md +0 -132
  176. package/framework/skills/level-1-workflows/morph-phase-implement/references/vsa-implementation-guide.md +0 -92
  177. package/framework/skills/level-1-workflows/morph-phase-plan/SKILL.md +0 -257
  178. package/framework/skills/level-1-workflows/morph-phase-tasks/.morph/logs/activity.json +0 -14
  179. package/framework/skills/level-1-workflows/morph-phase-tasks/SKILL.md +0 -291
  180. package/framework/skills/level-1-workflows/morph-phase-tasks/references/task-planning-patterns.md +0 -143
  181. package/framework/skills/level-1-workflows/morph-phase-tasks/references/tasks-example.md +0 -404
  182. package/framework/skills/level-1-workflows/morph-phase-tasks/scripts/validate-tasks.mjs +0 -112
  183. package/framework/skills/level-1-workflows/morph-phase-uiux/SKILL.md +0 -788
  184. package/framework/skills/level-1-workflows/morph-scope-escalation/SKILL.md +0 -147
  185. package/framework/squad-templates/backend-only.json +0 -47
  186. package/framework/squad-templates/frontend-only.json +0 -56
  187. package/framework/squad-templates/full-stack.json +0 -74
  188. package/src/commands/agents/agent-metrics.js +0 -174
  189. package/src/commands/agents/audit-dispatch.js +0 -82
  190. package/src/commands/agents/detect-agents.js +0 -275
  191. package/src/commands/agents/dispatch-agents.js +0 -461
  192. package/src/commands/agents/index.js +0 -13
  193. package/src/commands/agents/manage-agents.js +0 -352
  194. package/src/commands/agents/project-metrics.js +0 -74
  195. package/src/commands/phase/phase-reset.js +0 -74
  196. package/src/commands/scope/escalate.js +0 -217
  197. package/src/commands/state/advance-phase.js +0 -600
  198. package/src/commands/state/phase-runner.js +0 -215
  199. package/src/commands/state/state.js +0 -444
  200. package/src/commands/task/expand.js +0 -100
  201. package/src/commands/tasks/index.js +0 -4
  202. package/src/commands/tasks/task.js +0 -105
  203. package/src/commands/templates/index.js +0 -5
  204. package/src/commands/templates/template-render.js +0 -93
  205. package/src/commands/trust/trust.js +0 -118
  206. package/src/lib/agents/agents-manager.js +0 -349
  207. package/src/lib/build/build-runner.js +0 -99
  208. package/src/lib/checkpoints/checkpoint-hooks.js +0 -111
  209. package/src/lib/contracts/sprint-contract-generator.js +0 -137
  210. package/src/lib/scope/impact-analyzer.js +0 -106
  211. package/src/lib/trust/trust-manager.js +0 -157
  212. package/src/utils/tier-helpers.js +0 -24
  213. /package/framework/hooks/claude-code/{post-tool-use → core}/loop-detect.js +0 -0
@@ -1,291 +0,0 @@
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.21.0"
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
- - [ ] Design phase completed and approved
19
- - [ ] `spec.md` exists and approved
20
- - [ ] Plan phase completed
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** `morph-spec template render docs/tasks ...` | — |
37
- | Update state with task count | **Bash** `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 generic layer 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
- morph-spec state get $ARGUMENTS
58
- ```
59
-
60
- Check the `"phase"` field:
61
-
62
- **If `"phase": "tasks"`** → correct phase, proceed.
63
-
64
- **If `"phase": "plan"`** → run:
65
- 1. `morph-spec phase advance $ARGUMENTS` (→ tasks)
66
-
67
- **Any other value** → STOP — inconsistent state, report to user.
68
-
69
- > **Rule:** Never write to `4-tasks/` until the phase is `tasks`. The hook will block writes.
70
-
71
- ---
72
-
73
- ## MANDATORY: Session Tasks
74
-
75
- > **BEFORE reading any files**, analyze the task breakdown workflow and create session tasks.
76
- >
77
- > **Rules:** Minimum 2 tasks, typically 3-4. Mark `in_progress` before starting, `completed` after.
78
- >
79
- > **Typical tasks:** spec analysis and task definition, tasks.md generation, state update and approval
80
-
81
- ### 1. Read all prerequisites in PARALLEL
82
-
83
- ```
84
- # Single parallel call, not sequential:
85
- Read: .morph/features/{feature}/2-design/spec.md
86
- + Read: .morph/features/{feature}/2-design/contracts.cs (or contracts.ts for TypeScript projects)
87
- + Read: .morph/features/{feature}/2-design/decisions.md
88
- + Read: .morph/features/{feature}/2-design/schema-analysis.md (if exists)
89
- + Read: .morph/config/config.json (→ architecture.style)
90
- ```
91
-
92
- ---
93
-
94
- ### 2. Entry checkpoint — verify prerequisites
95
-
96
- Before starting the breakdown:
97
-
98
- - [ ] `spec.md` exists and approved by user?
99
- - [ ] `contracts.cs`/`.ts` exists and matches real schema?
100
- - [ ] `schema-analysis.md` validated (if applicable)?
101
- - [ ] `decisions.md` contains ADRs for all critical choices?
102
- - [ ] Design gate (`morph-spec approve $ARGUMENTS design`) approved?
103
- - [ ] Clarifications (Phase 3) resolved and spec updated?
104
-
105
- If any checkbox is NOT checked → return to corresponding phase and resolve.
106
-
107
- ```bash
108
- morph-spec state get $ARGUMENTS
109
- morph-spec approval-status $ARGUMENTS
110
- ```
111
-
112
- ---
113
-
114
- ## Workflow
115
-
116
- ### Step 0: Detect Architecture Style
117
-
118
- Before anything else, determine the architecture style:
119
-
120
- ```bash
121
- cat .morph/config/config.json | grep -A3 '"architecture"'
122
- ```
123
-
124
- **If `config.architecture.style === "vertical-slice"`** → follow **Step 0.5 (VSA)**.
125
- **Otherwise** → proceed to **Step 1 (Analyze Spec)** with standard layer-based task breakdown.
126
-
127
- ---
128
-
129
- ### Step 0.5: VSA Task Plan
130
-
131
- > For VSA task patterns, see `references/task-planning-patterns.md`
132
-
133
- Read the `## Architecture Style: Vertical Slice` section from spec.md for the **VSA Blueprint**:
134
-
135
- ```bash
136
- grep -A30 "## Architecture Style" ".morph/features/$ARGUMENTS/2-design/spec.md"
137
- ```
138
-
139
- 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).
140
-
141
- Use VSA-specific categories: `entity`, `errors`, `tags`, `migration`, `slice`, `frontend`, `tests`.
142
-
143
- **After defining VSA tasks, skip directly to Step 3 (Dependencies).**
144
-
145
- ---
146
-
147
- ---
148
-
149
- ### Step 1: Analyze Spec
150
-
151
- > **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).
152
-
153
- Read `.morph/features/$ARGUMENTS/2-design/spec.md` and identify:
154
-
155
- 1. **Functional requirements** (FR001, FR002, ...)
156
- 2. **Technical components** (Entities, Services/Slices, Controllers/Endpoints, Pages)
157
- 3. **Infrastructure** (Bicep, migrations, configs)
158
- 4. **Tests** (Unit tests, integration tests)
159
-
160
- ### Step 2: Break Into Tasks
161
-
162
- > For structure, categories, and implementation order, see `references/task-planning-patterns.md`
163
-
164
- Create tasks using the **T{NNN}** format (T001, T002, ...) following bottom-up order: domain → infrastructure → application → presentation → tests → infra → docs.
165
-
166
- 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.
167
-
168
- ### Step 3: Define Dependencies
169
-
170
- For each task, specify dependencies:
171
-
172
- ```json
173
- {
174
- "id": "T005",
175
- "title": "Create {Name}Service",
176
- "dependencies": ["T001", "T002"],
177
- "status": "pending"
178
- }
179
- ```
180
-
181
- **Rule:** A task can only be executed when all its dependencies are `completed`.
182
-
183
- ### Step 4: Establish Checkpoints
184
-
185
- 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.
186
-
187
- ```json
188
- {
189
- "id": "CHECKPOINT_001",
190
- "title": "Domain Layer Complete",
191
- "afterTasks": ["T001", "T002", "T003"],
192
- "validations": [
193
- "All entities created",
194
- "Migrations applied",
195
- "Domain tests passing"
196
- ]
197
- }
198
- ```
199
-
200
- ### Step 5: Estimate Effort
201
-
202
- For each task, estimate time **in minutes** (not vague labels like "Low/Medium"). Specific estimates help the plan phase determine execution strategy and parallelization.
203
-
204
- | Complexity | Estimated Time |
205
- |------------|----------------|
206
- | Trivial (basic CRUD) | 15-30 min |
207
- | Simple (Service, Controller) | 30-60 min |
208
- | Medium (Business logic, validations) | 60-120 min |
209
- | Complex (Integrations, AI) | 120-240 min |
210
-
211
- ### Step 6: Generate `tasks.md`
212
-
213
- Create `.morph/features/$ARGUMENTS/4-tasks/tasks.md` with the complete task structure, checkpoints, and estimates.
214
-
215
- ### Step 7: Include IaC Tasks (if needed)
216
-
217
- If there are Azure resources, add Bicep and migration tasks.
218
-
219
- ### Step 8: Update State
220
-
221
- ```bash
222
- morph-spec state set $ARGUMENTS tasks.total {N}
223
- morph-spec state mark-output $ARGUMENTS tasks
224
- ```
225
-
226
- ## Outputs
227
-
228
- - `.morph/features/$ARGUMENTS/4-tasks/tasks.md` — Complete task breakdown
229
-
230
- ## Mandatory Approval Pause
231
-
232
- Use `AskUserQuestion` to capture explicit approval before advancing. This gate prevents implementation from starting with an unapproved task list.
233
-
234
- ```json
235
- {
236
- "questions": [{
237
- "header": "Approval",
238
- "question": "Tasks generated. Approve to start implementation?",
239
- "multiSelect": false,
240
- "options": [
241
- { "label": "Approve and implement", "description": "Advance to implementation phase" },
242
- { "label": "I have feedback", "description": "Type what you want to change" }
243
- ]
244
- }]
245
- }
246
- ```
247
-
248
- - **"Approve and implement"** →
249
- ```bash
250
- morph-spec approve $ARGUMENTS tasks
251
- morph-spec phase advance $ARGUMENTS
252
- ```
253
- - **"I have feedback" or "Other"** → apply the feedback and repeat this PAUSE
254
-
255
- ## Completion Criteria
256
-
257
- - [x] `tasks.md` created with all tasks
258
- - [x] Tasks use T### format (T001, T002, ...) consistently
259
- - [x] Tasks categorized correctly (VSA categories or standard layers)
260
- - [x] Dependencies mapped
261
- - [x] Checkpoints defined (every 3 tasks)
262
- - [x] Effort estimated in minutes per task
263
- - [x] Execution order clear
264
- - [x] IaC tasks included (if applicable)
265
- - [x] State updated with total tasks (`state set tasks.total`)
266
- - [x] User approved breakdown via `AskUserQuestion`
267
-
268
- ---
269
-
270
- ## Superpowers Integration
271
-
272
- > Available when the `superpowers` plugin is installed.
273
-
274
- | Skill | When to Use | Invocation |
275
- |-------|-------------|-----------|
276
- | `writing-plans` | After task breakdown, to plan implementation sequence | `Skill(superpowers:writing-plans)` |
277
- | `executing-plans` | To execute the task plan in a separate session | `Skill(superpowers:executing-plans)` |
278
-
279
- ---
280
-
281
- ## Phase Outputs
282
-
283
- <!-- morph-outputs:tasks -->
284
- | Output | Caminho |
285
- |--------|---------|
286
- | `tasks` | `.morph/features/{feature}/4-tasks/tasks.md` |
287
- <!-- /morph-outputs -->
288
-
289
- ---
290
-
291
- After approval: "Planning complete! Run `/morph-apply $ARGUMENTS` to start implementation."
@@ -1,143 +0,0 @@
1
- # Task Planning Patterns — VSA
2
-
3
- > Padrões detalhados de task planning para Vertical Slice Architecture.
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
- ## Estrutura de Task (formato JSON)
95
-
96
- ```json
97
- {
98
- "id": "T001",
99
- "title": "Criar Entity {Nome}",
100
- "description": "Implementar entity {Nome} com propriedades X, Y, Z seguindo padrões EF Core",
101
- "category": "entity",
102
- "dependencies": [],
103
- "estimatedMinutes": 30,
104
- "status": "pending",
105
- "specSections": ["## Domain Model", "## Business Rules"],
106
- "contractInterfaces": ["I{Nome}Repository"],
107
- "files": [
108
- "Entities/{Nome}.cs",
109
- "Database/ApplicationDbContext.cs"
110
- ]
111
- }
112
- ```
113
-
114
- ## Categorias de Tasks (VSA)
115
-
116
- | Categoria | Descrição | Exemplos |
117
- |-----------|-----------|----------|
118
- | **entity** | Entities, Enums | Entity class, DbSet registration |
119
- | **errors** | Error factory classes | `{Entity}Errors.cs` |
120
- | **tags** | API endpoint tags | `ApiTags.cs` constants |
121
- | **migration** | DB migrations | EF migrations |
122
- | **slice** | Complete VSA slice | Handler + Validator + Endpoint |
123
- | **tests** | Unit tests, Integration tests | Handler tests, API tests |
124
- | **infra** | Docker, Migrations, Scripts | docker-compose, PostgreSQL migrations |
125
- | **docs** | README, API docs | OpenAPI spec, README update |
126
-
127
- ## Ordem de Implementação Bottom-Up (VSA)
128
-
129
- ```
130
- 1. Entity + DbContext registration
131
- ↓
132
- 2. Errors + ApiTags
133
- ↓
134
- 3. Migrations
135
- ↓
136
- 4. Slices (Handler + Validator + Endpoint per operation)
137
- ↓
138
- 5. Tests (Unit → Integration)
139
- ↓
140
- 6. Infra (Docker, PostgreSQL migrations)
141
- ↓
142
- 7. Docs (README, Swagger)
143
- ```