@polymorphism-tech/morph-spec 4.12.0 → 4.14.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 (316) hide show
  1. package/CLAUDE.md +7 -7
  2. package/README.md +28 -34
  3. package/bin/morph-spec.js +41 -24
  4. package/bin/task-manager.js +962 -1341
  5. package/bin/validate.js +1 -1
  6. package/claude-plugin.json +1 -1
  7. package/docs/CHEATSHEET.md +14 -16
  8. package/docs/QUICKSTART.md +15 -15
  9. package/framework/CLAUDE.md +5 -2
  10. package/framework/agents/README.md +3 -4
  11. package/framework/agents/ai-agents/ai-system-architect.md +6 -10
  12. package/framework/agents/architecture/seo-growth-hacker.md +166 -326
  13. package/framework/agents/architecture/standards-architect.md +21 -31
  14. package/framework/agents/backend/dotnet-senior.md +160 -86
  15. package/framework/agents/backend/ef-modeler.md +2 -6
  16. package/framework/agents/backend/hangfire-orchestrator.md +8 -9
  17. package/framework/agents/backend/ms-agent-expert.md +1 -1
  18. package/framework/agents/frontend/nextjs-expert.md +198 -133
  19. package/framework/agents/frontend/ui-ux-designer.md +226 -267
  20. package/framework/agents/infrastructure/infra-architect.md +191 -27
  21. package/framework/agents/integrations/clerk-auth.md +19 -26
  22. package/framework/agents/integrations/hangfire-integration.md +1 -4
  23. package/framework/agents.json +1084 -2278
  24. package/framework/commands/morph-apply.md +4 -6
  25. package/framework/commands/morph-preflight.md +192 -269
  26. package/framework/commands/morph-proposal.md +210 -238
  27. package/framework/commands/morph-status.md +72 -92
  28. package/framework/commands/morph-troubleshoot.md +6 -13
  29. package/framework/hooks/README.md +1 -6
  30. package/framework/hooks/claude-code/post-tool-use/validator-feedback.js +4 -6
  31. package/framework/hooks/claude-code/pre-compact/save-morph-context.js +12 -7
  32. package/framework/hooks/claude-code/pre-tool-use/enforce-phase-writes.js +2 -2
  33. package/framework/hooks/claude-code/pre-tool-use/protect-spec-files.js +2 -2
  34. package/framework/hooks/claude-code/pre-tool-use/task-tracking-guard.js +5 -10
  35. package/framework/hooks/claude-code/session-start/inject-morph-context.js +63 -30
  36. package/framework/hooks/claude-code/session-start/resume-context.js +77 -0
  37. package/framework/hooks/claude-code/statusline.py +4 -5
  38. package/framework/hooks/claude-code/stop/validate-completion.js +4 -4
  39. package/framework/hooks/claude-code/user-prompt/enrich-prompt.js +8 -8
  40. package/framework/hooks/shared/compact-restore.js +28 -5
  41. package/framework/hooks/shared/phase-utils.js +4 -8
  42. package/framework/hooks/shared/state-reader.js +34 -3
  43. package/framework/phases.json +162 -200
  44. package/framework/rules/ai-agents-standards.md +15 -0
  45. package/framework/rules/asaas-standards.md +13 -0
  46. package/framework/rules/clerk-standards.md +13 -0
  47. package/framework/rules/csharp-standards.md +8 -4
  48. package/framework/rules/data-standards.md +18 -0
  49. package/framework/rules/dotnet-templates.md +87 -0
  50. package/framework/rules/frontend-standards.md +13 -13
  51. package/framework/rules/hangfire-standards.md +13 -0
  52. package/framework/rules/infrastructure-standards.md +27 -16
  53. package/framework/rules/morph-workflow.md +73 -13
  54. package/framework/rules/nextjs-standards.md +1 -0
  55. package/framework/rules/nextjs-templates.md +40 -0
  56. package/framework/rules/resend-standards.md +12 -0
  57. package/framework/rules/supabase-standards.md +29 -0
  58. package/framework/skills/README.md +6 -8
  59. package/framework/skills/level-0-meta/mcp-registry.json +21 -99
  60. package/framework/{standards/ai-agents/team-orchestration.md → skills/level-0-meta/morph-agent-teams/SKILL.md} +472 -479
  61. package/framework/skills/level-0-meta/morph-brainstorming/SKILL.md +28 -1
  62. package/framework/skills/level-0-meta/morph-checklist/SKILL.md +2 -2
  63. package/framework/skills/level-0-meta/morph-code-review/SKILL.md +1 -5
  64. package/framework/skills/level-0-meta/morph-code-review/scripts/scan-csharp.mjs +1 -1
  65. package/framework/skills/level-0-meta/morph-frontend-review/SKILL.md +23 -41
  66. package/framework/skills/level-0-meta/morph-init/SKILL.md +18 -14
  67. package/framework/skills/level-0-meta/morph-parallel-dispatch/SKILL.md +225 -0
  68. package/framework/skills/level-0-meta/morph-post-implementation/SKILL.md +20 -0
  69. package/framework/skills/level-0-meta/morph-tool-usage-guide/SKILL.md +4 -8
  70. package/framework/skills/level-0-meta/morph-tool-usage-guide/references/tools-per-phase.md +15 -59
  71. package/framework/skills/level-0-meta/morph-verification-before-completion/SKILL.md +7 -19
  72. package/framework/skills/level-0-meta/morph-verification-before-completion/scripts/check-phase-outputs.mjs +8 -8
  73. package/framework/skills/level-1-workflows/README.md +1 -1
  74. package/framework/skills/level-1-workflows/morph-phase-codebase-analysis/SKILL.md +49 -50
  75. package/framework/skills/level-1-workflows/morph-phase-design/SKILL.md +57 -123
  76. package/framework/skills/level-1-workflows/morph-phase-design/references/architecture-analysis-guide.md +5 -50
  77. package/framework/skills/level-1-workflows/morph-phase-design/references/spec-example.md +1 -1
  78. package/framework/skills/level-1-workflows/morph-phase-implement/SKILL.md +127 -159
  79. package/framework/skills/level-1-workflows/morph-phase-implement/prompts/code-quality-reviewer-prompt.md +1 -1
  80. package/framework/skills/level-1-workflows/morph-phase-implement/prompts/implementer-prompt.md +4 -3
  81. package/framework/skills/level-1-workflows/morph-phase-implement/prompts/spec-reviewer-prompt.md +2 -2
  82. package/framework/skills/level-1-workflows/morph-phase-implement/references/recap-example.md +1 -1
  83. package/framework/skills/level-1-workflows/morph-phase-plan/SKILL.md +17 -13
  84. package/framework/skills/level-1-workflows/morph-phase-tasks/SKILL.md +22 -40
  85. package/framework/skills/level-1-workflows/morph-phase-tasks/references/task-planning-patterns.md +143 -172
  86. package/framework/skills/level-1-workflows/morph-phase-tasks/references/tasks-example.md +5 -5
  87. package/framework/skills/level-1-workflows/morph-phase-uiux/SKILL.md +57 -77
  88. package/framework/skills/level-1-workflows/morph-scope-escalation/SKILL.md +1 -1
  89. package/framework/squad-templates/backend-only.json +6 -6
  90. package/framework/squad-templates/frontend-only.json +17 -8
  91. package/framework/squad-templates/full-stack.json +29 -24
  92. package/framework/standards/STANDARDS.json +1021 -2369
  93. package/framework/standards/backend/dotnet/fluent-validation-vsa.md +200 -0
  94. package/framework/standards/backend/dotnet/result-pattern.md +213 -0
  95. package/framework/standards/backend/dotnet/scalar-ui.md +172 -0
  96. package/framework/standards/backend/dotnet/scrutor.md +158 -0
  97. package/framework/standards/backend/dotnet/vsa-handler-patterns.md +274 -0
  98. package/framework/standards/frontend/nextjs/motion-patterns.md +1 -1
  99. package/framework/standards/infrastructure/supabase/mcp-setup.md +83 -193
  100. package/framework/standards/integration/mcp/mcp-tools.md +91 -77
  101. package/framework/templates/IDE-SNIPPETS.md +2 -6
  102. package/framework/templates/README.md +709 -814
  103. package/framework/templates/REGISTRY.json +223 -762
  104. package/framework/templates/code/dotnet/abstractions/api-endpoint.cs +7 -0
  105. package/framework/templates/code/dotnet/abstractions/error.cs +60 -0
  106. package/framework/templates/code/dotnet/abstractions/handler.cs +12 -0
  107. package/framework/templates/code/dotnet/abstractions/result.cs +74 -0
  108. package/framework/templates/code/dotnet/backend/repository.cs +148 -141
  109. package/framework/templates/code/dotnet/constants/api-tags.cs +6 -0
  110. package/framework/templates/code/dotnet/exceptions/exception-handler.cs +32 -0
  111. package/framework/templates/code/dotnet/extensions/database-extensions.cs +20 -0
  112. package/framework/templates/code/dotnet/extensions/handler-registration.cs +38 -0
  113. package/framework/templates/code/dotnet/extensions/health-checks.cs +24 -0
  114. package/framework/templates/code/dotnet/extensions/map-endpoints.cs +35 -0
  115. package/framework/templates/code/dotnet/extensions/result-extensions.cs +29 -0
  116. package/framework/templates/code/dotnet/feature/endpoint.cs.hbs +21 -0
  117. package/framework/templates/code/dotnet/feature/entity.cs.hbs +8 -0
  118. package/framework/templates/code/dotnet/feature/errors.cs.hbs +8 -0
  119. package/framework/templates/code/dotnet/feature/handler.cs.hbs +24 -0
  120. package/framework/templates/code/dotnet/feature/request.cs.hbs +4 -0
  121. package/framework/templates/code/dotnet/feature/response.cs.hbs +4 -0
  122. package/framework/templates/code/dotnet/feature/validator.cs.hbs +15 -0
  123. package/framework/templates/code/dotnet/jobs/job.cs +21 -17
  124. package/framework/templates/code/dotnet/pipelines/logging-decorator.cs +31 -0
  125. package/framework/templates/code/dotnet/pipelines/validation-decorator.cs +97 -0
  126. package/framework/templates/code/dotnet/test.cs +192 -106
  127. package/framework/templates/context/ARCHITECTURE.md +89 -0
  128. package/framework/templates/context/CONTEXT-FEATURE.md +2 -2
  129. package/framework/templates/context/CONTEXT.md +180 -181
  130. package/framework/templates/context/design-system.md +1 -5
  131. package/framework/templates/docs/onboarding.md +2 -3
  132. package/framework/templates/docs/proposal.md +171 -182
  133. package/framework/templates/docs/spec.md +1 -3
  134. package/framework/templates/docs/ui-components.md +0 -72
  135. package/framework/templates/examples/design-system-examples.md +4 -4
  136. package/framework/templates/feature/decisions.md +0 -66
  137. package/framework/templates/feature/recap.md +1 -2
  138. package/framework/templates/infrastructure/github/README.md +56 -593
  139. package/framework/templates/integrations/clerk-config.cs +0 -41
  140. package/framework/templates/meta-prompts/parallel-workers/parallel-worker.md +2 -2
  141. package/framework/templates/meta-prompts/squad-leaders/backend-squad.md +1 -2
  142. package/framework/templates/meta-prompts/squad-leaders/frontend-squad.md +83 -126
  143. package/framework/templates/meta-prompts/validators/pre-commit-validator.md +2 -2
  144. package/framework/templates/project/validate.js +2 -4
  145. package/framework/templates/ui/design-system.css +1 -1
  146. package/framework/workflows/README.md +8 -8
  147. package/framework/workflows/configs/fast-track.json +51 -0
  148. package/framework/workflows/configs/full.json +68 -0
  149. package/framework/workflows/configs/standard.json +7 -3
  150. package/framework/workflows/docs/STORY-DRIVEN-DEVELOPMENT.md +1 -1
  151. package/framework/workflows/docs/enforcement-pipeline.md +18 -19
  152. package/framework/workflows/docs/full-morph.md +69 -76
  153. package/framework/workflows/docs/standard.md +49 -44
  154. package/framework/workflows/docs/ui-refresh.md +1 -1
  155. package/package.json +3 -3
  156. package/src/commands/agents/dispatch-agents.js +55 -116
  157. package/src/commands/context/context-refresh.js +79 -0
  158. package/src/commands/phase/phase-reset.js +1 -1
  159. package/src/commands/project/doctor.js +10 -32
  160. package/src/commands/project/init.js +12 -0
  161. package/src/commands/project/status.js +6 -12
  162. package/src/commands/scaffold/scaffold.js +131 -0
  163. package/src/commands/scope/escalate.js +1 -1
  164. package/src/commands/state/advance-phase.js +15 -29
  165. package/src/commands/state/state.js +20 -5
  166. package/src/commands/tasks/task.js +0 -30
  167. package/src/commands/validation/validate-feature.js +3 -10
  168. package/src/core/paths/output-schema.js +12 -13
  169. package/src/core/state/phase-state-machine.js +211 -217
  170. package/src/core/state/state-manager.js +9 -9
  171. package/src/lib/agents/agents-manager.js +2 -2
  172. package/src/lib/agents/output-collector.js +1 -2
  173. package/src/lib/detectors/design-system-detector.js +4 -4
  174. package/src/lib/detectors/index.js +1 -11
  175. package/src/lib/generators/architecture-scanner.js +640 -0
  176. package/src/lib/generators/context-generator.js +3 -3
  177. package/src/lib/generators/design-system-generator.js +508 -587
  178. package/src/lib/generators/index.js +12 -10
  179. package/src/lib/generators/metadata-extractor.js +386 -387
  180. package/src/lib/generators/recap-generator.js +4 -4
  181. package/src/lib/generators/scaffold-generator.js +317 -0
  182. package/src/lib/generators/settings-generator.js +0 -1
  183. package/src/lib/phase-chain/phase-validator.js +64 -42
  184. package/src/lib/stack/stack-profile.js +2 -2
  185. package/src/lib/standards/digest-builder.js +72 -285
  186. package/src/lib/tasks/task-parser.js +11 -5
  187. package/src/lib/validators/architecture/architecture-validator.js +259 -387
  188. package/src/lib/validators/content/content-validator.js +287 -287
  189. package/src/lib/validators/css/css-validator.js +340 -352
  190. package/src/lib/validators/packages/package-validator.js +347 -360
  191. package/src/lib/validators/shared/issue-counter.js +14 -18
  192. package/src/lib/validators/validation-runner.js +3 -19
  193. package/src/scripts/setup-infra.js +1 -1
  194. package/src/utils/agents-installer.js +61 -10
  195. package/src/utils/file-copier.js +1 -0
  196. package/src/utils/hooks-installer.js +11 -19
  197. package/src/utils/skills-installer.js +178 -178
  198. package/framework/agents/architecture/prompt-engineer.md +0 -195
  199. package/framework/agents/backend/api-designer.md +0 -106
  200. package/framework/agents/frontend/blazor-builder.md +0 -229
  201. package/framework/agents/frontend/nextjs-ui-specialist.md +0 -218
  202. package/framework/agents/infrastructure/azure-architect.md +0 -150
  203. package/framework/agents/infrastructure/azure-deploy-specialist.md +0 -707
  204. package/framework/agents/infrastructure/bicep-architect.md +0 -132
  205. package/framework/agents/infrastructure/container-specialist.md +0 -137
  206. package/framework/agents/infrastructure/devops-engineer.md +0 -126
  207. package/framework/agents/integrations/azure-identity.md +0 -148
  208. package/framework/agents/quality/code-analyzer.md +0 -239
  209. package/framework/agents/quality/testing-specialist.md +0 -130
  210. package/framework/hooks/claude-code/notification/approval-reminder.js +0 -57
  211. package/framework/hooks/claude-code/post-tool-use/context-refresh.js +0 -109
  212. package/framework/hooks/claude-code/post-tool-use/skill-reminder.js +0 -78
  213. package/framework/index/troubleshooting-index.json +0 -184
  214. package/framework/rules/testing-standards.md +0 -14
  215. package/framework/skills/level-0-meta/morph-replicate/SKILL.md +0 -230
  216. package/framework/skills/level-0-meta/morph-replicate/references/blazor-html-mapping.md +0 -70
  217. package/framework/skills/level-1-workflows/morph-phase-clarify/SKILL.md +0 -256
  218. package/framework/skills/level-1-workflows/morph-phase-clarify/references/clarifications-example.md +0 -117
  219. package/framework/skills/level-1-workflows/morph-phase-setup/SKILL.md +0 -269
  220. package/framework/standards/ai-agents/blazor-ui.md +0 -364
  221. package/framework/standards/architecture/ddd/aggregates.md +0 -120
  222. package/framework/standards/architecture/ddd/bounded-contexts.md +0 -105
  223. package/framework/standards/architecture/ddd/complexity-levels.md +0 -108
  224. package/framework/standards/architecture/ddd/entities.md +0 -99
  225. package/framework/standards/architecture/ddd/ubiquitous-language.md +0 -58
  226. package/framework/standards/architecture/ddd/value-objects.md +0 -124
  227. package/framework/standards/backend/api/minimal-api.md +0 -494
  228. package/framework/standards/backend/api/rest.md +0 -492
  229. package/framework/standards/backend/authentication/passkeys.md +0 -428
  230. package/framework/standards/backend/database/ef-core.md +0 -199
  231. package/framework/standards/backend/database/migrations.md +0 -393
  232. package/framework/standards/backend/database/repository-patterns.md +0 -528
  233. package/framework/standards/backend/dotnet/async.md +0 -366
  234. package/framework/standards/backend/dotnet/core.md +0 -117
  235. package/framework/standards/backend/dotnet/di.md +0 -439
  236. package/framework/standards/backend/dotnet/program-cs-checklist.md +0 -92
  237. package/framework/standards/context/analytics.md +0 -96
  238. package/framework/standards/context/bundles.md +0 -110
  239. package/framework/standards/context/priming.md +0 -78
  240. package/framework/standards/core/architecture.md +0 -185
  241. package/framework/standards/core/coding.md +0 -214
  242. package/framework/standards/core/git-branching-strategy.md +0 -403
  243. package/framework/standards/core/git.md +0 -185
  244. package/framework/standards/core/testing.md +0 -295
  245. package/framework/standards/data/nosql/blob-storage.md +0 -102
  246. package/framework/standards/data/vector-search/azure-ai-search.md +0 -121
  247. package/framework/standards/frontend/blazor/design-checklist.md +0 -222
  248. package/framework/standards/frontend/blazor/fluent-ui-setup.md +0 -595
  249. package/framework/standards/frontend/blazor/fluent-ui.md +0 -137
  250. package/framework/standards/frontend/blazor/html-conversion.md +0 -184
  251. package/framework/standards/frontend/blazor/lifecycle.md +0 -195
  252. package/framework/standards/frontend/blazor/pitfalls.md +0 -198
  253. package/framework/standards/frontend/blazor/state.md +0 -191
  254. package/framework/standards/frontend/design-system/aesthetic-direction.md +0 -266
  255. package/framework/standards/frontend/design-system/design-trends.md +0 -171
  256. package/framework/standards/infrastructure/azure/azure.md +0 -624
  257. package/framework/standards/infrastructure/azure/bicep/bicep-patterns.md +0 -422
  258. package/framework/standards/infrastructure/azure/devops/azure-devops-setup.md +0 -516
  259. package/framework/standards/infrastructure/azure/devops/local-development.md +0 -520
  260. package/framework/standards/infrastructure/azure/services/functions.md +0 -486
  261. package/framework/standards/infrastructure/azure/services/service-bus.md +0 -459
  262. package/framework/standards/infrastructure/azure/services/storage.md +0 -407
  263. package/framework/standards/infrastructure/vercel/vercel-database.md +0 -106
  264. package/framework/standards/integration/api/graphql.md +0 -91
  265. package/framework/standards/integration/api/grpc.md +0 -114
  266. package/framework/standards/integration/api/rest-design.md +0 -95
  267. package/framework/standards/integration/event-driven/cqrs.md +0 -101
  268. package/framework/standards/integration/event-driven/event-sourcing.md +0 -124
  269. package/framework/standards/integration/event-driven/service-bus.md +0 -95
  270. package/framework/standards/observability/logging.md +0 -131
  271. package/framework/standards/observability/metrics.md +0 -121
  272. package/framework/standards/observability/monitoring.md +0 -114
  273. package/framework/standards/observability/tracing.md +0 -132
  274. package/framework/standards/workflows/parallel-execution.md +0 -112
  275. package/framework/standards/workflows/thread-management.md +0 -113
  276. package/framework/templates/code/dotnet/backend/service.cs +0 -139
  277. package/framework/templates/code/dotnet/contracts/Commands.cs +0 -74
  278. package/framework/templates/code/dotnet/contracts/Entities.cs +0 -25
  279. package/framework/templates/code/dotnet/contracts/Queries.cs +0 -74
  280. package/framework/templates/code/dotnet/contracts/api-contracts.cs +0 -173
  281. package/framework/templates/code/dotnet/contracts/contracts-level1.cs +0 -69
  282. package/framework/templates/code/dotnet/contracts/contracts-level2.cs +0 -86
  283. package/framework/templates/code/dotnet/contracts/contracts-level3.cs +0 -41
  284. package/framework/templates/code/dotnet/frontend/component.razor +0 -239
  285. package/framework/templates/infrastructure/azure/Dockerfile.example +0 -82
  286. package/framework/templates/infrastructure/azure/README.md +0 -286
  287. package/framework/templates/infrastructure/azure/app-insights.bicep +0 -63
  288. package/framework/templates/infrastructure/azure/app-service.bicep +0 -164
  289. package/framework/templates/infrastructure/azure/container-app-env.bicep +0 -49
  290. package/framework/templates/infrastructure/azure/container-app.bicep +0 -156
  291. package/framework/templates/infrastructure/azure/deploy-checklist.md +0 -426
  292. package/framework/templates/infrastructure/azure/deploy.ps1 +0 -229
  293. package/framework/templates/infrastructure/azure/deploy.sh +0 -208
  294. package/framework/templates/infrastructure/azure/key-vault.bicep +0 -91
  295. package/framework/templates/infrastructure/azure/main.bicep +0 -189
  296. package/framework/templates/infrastructure/azure/parameters.dev.json +0 -29
  297. package/framework/templates/infrastructure/azure/parameters.prod.json +0 -29
  298. package/framework/templates/infrastructure/azure/parameters.staging.json +0 -29
  299. package/framework/templates/infrastructure/azure/sql-database.bicep +0 -103
  300. package/framework/templates/infrastructure/azure/storage.bicep +0 -106
  301. package/framework/templates/infrastructure/github/actions/azure-auth/action.yml.hbs +0 -22
  302. package/framework/templates/infrastructure/github/workflows/deploy-azure-app-service.yml.hbs +0 -61
  303. package/framework/templates/integrations/azure-identity-config.cs +0 -288
  304. package/framework/templates/project-structure/dotnet-ddd.md +0 -70
  305. package/framework/templates/saas/subscription.cs +0 -347
  306. package/framework/templates/saas/tenant.cs +0 -338
  307. package/framework/templates/ui/FluentDesignTheme.cs +0 -149
  308. package/framework/templates/ui/MudTheme.cs +0 -281
  309. package/framework/workflows/configs/nodejs-cli.json +0 -40
  310. package/src/commands/standards/context-budget.js +0 -89
  311. package/src/lib/standards/index.js +0 -7
  312. package/src/lib/standards/standards-context-injector.js +0 -302
  313. package/src/lib/validators/blazor/blazor-concurrency-analyzer.js +0 -316
  314. package/src/lib/validators/blazor/blazor-state-validator.js +0 -279
  315. package/src/lib/validators/blazor/blazor-validator.js +0 -369
  316. package/src/lib/validators/blazor/index.js +0 -9
@@ -53,6 +53,33 @@ Gather information before generating ideas. This step is what makes morph-aware
53
53
  6. **Scan codebase** — use Glob/Grep to understand existing patterns, domain models, and service boundaries relevant to the feature
54
54
  7. **Check MCP tools** — if Context7, GitHub, or other MCPs are available, use them for research
55
55
 
56
+ ### Step 1.5: Assess Complexity & Recommend Workflow
57
+
58
+ Based on the context gathered in Step 1, evaluate the feature's complexity to select the appropriate workflow tier. Use this decision table:
59
+
60
+ | Indicator | Fast-Track | Standard | Full |
61
+ |-----------|-----------|----------|------|
62
+ | Files affected | 1-3 | 3-10 | 10+ |
63
+ | Entities/domains | 1 | 1-2 | 3+ |
64
+ | External integrations | None | None | 1+ |
65
+ | Infrastructure changes | No | No | Yes |
66
+ | UI design needed | No | Optional | Yes |
67
+ | Examples | CRUD field, rename, toggle, fix | Pagination, filter, export, refactor | Auth system, migration, platform redesign |
68
+
69
+ **Actions:**
70
+ 1. Count entities, domains, integrations, and UI requirements from the feature request
71
+ 2. Match against the table above to determine the tier
72
+ 3. Set the workflow in state:
73
+ ```bash
74
+ morph-spec state set $ARGUMENTS workflow fast-track # or standard / full
75
+ ```
76
+ 4. Inform the user of the recommendation via `AskUserQuestion` with options to confirm or override:
77
+ - Header: `Workflow`
78
+ - Question: "Based on complexity analysis, I recommend **{tier}** workflow ({N} phases). Override?"
79
+ - Options: `Confirm {tier}` / `Switch to standard` / `Switch to full` / `Switch to fast-track`
80
+
81
+ > **Note:** The user can always override later with `morph-spec state set <feature> workflow <tier>`.
82
+
56
83
  ### Step 2: Ask Clarifying Questions
57
84
 
58
85
  Use `AskUserQuestion` to collect responses — **NEVER list questions as plain text**.
@@ -107,7 +134,7 @@ For each approach, document:
107
134
  Then edit the rendered file to add the brainstorming results.
108
135
 
109
136
  **Phase 2 (Design):**
110
- Write the decision as an ADR (Architecture Decision Record) in `.morph/features/$ARGUMENTS/1-design/decisions.md`.
137
+ Write the decision as an ADR (Architecture Decision Record) in `.morph/features/$ARGUMENTS/2-design/decisions.md`.
111
138
 
112
139
  3. **Update state** (mandatory — do not skip):
113
140
  ```bash
@@ -84,10 +84,10 @@ Types: `deploy`, `security`, `seo`, `performance`, `accessibility`, `legal-brazi
84
84
  - [ ] Response/distributed caching with invalidation
85
85
  - [ ] All I/O operations are async (no `.Result` / `.Wait()`)
86
86
 
87
- ### Frontend (Blazor)
87
+ ### Frontend
88
88
  - [ ] Lazy loading, virtualization for large lists
89
89
  - [ ] Debounce search inputs
90
- - [ ] `@key` in loops, `ShouldRender()` for perf
90
+ - [ ] Memoization for expensive renders
91
91
 
92
92
  ### Infrastructure
93
93
  - [ ] CDN for static assets, gzip/brotli compression
@@ -5,15 +5,11 @@ user-invocable: true
5
5
  allowed-tools: Read, Write, Edit, Bash, Glob, Grep
6
6
  stacks:
7
7
  - dotnet
8
- - blazor
9
8
  ---
10
9
 
11
10
  # Code Review Checklist
12
11
 
13
12
  > Comprehensive checklist for .NET code review: naming, architecture, clean code, duplication, and runtime patterns.
14
- > **Ref:** `framework/standards/core/coding.md` for naming conventions and style.
15
- > **Ref:** `framework/standards/core/architecture.md` for layer rules and SOLID.
16
- > **Ref:** `framework/standards/backend/database/ef-core.md` for DbContext patterns and background ops.
17
13
  > **Example:** `references/review-example.md` — filled-in review showing expected finding format and severity levels.
18
14
  > **Script:** `scripts/scan-csharp.mjs` — automated scan for CRITICAL/HIGH violations before manual review.
19
15
  > **Ref:** `references/review-guidelines.md` — false-positive rubric, confidence scoring, evidence format.
@@ -106,7 +102,7 @@ If skipping: output `"Skipping code-review: [reason]"` and stop.
106
102
  ## Async & Cancellation
107
103
 
108
104
  - [ ] `[CRITICAL]` CancellationToken propagated through entire call chain
109
- - [ ] `[CRITICAL]` No `.Result` or `.Wait()` (deadlock risk in Blazor Server)
105
+ - [ ] `[CRITICAL]` No `.Result` or `.Wait()` (deadlock risk in ASP.NET)
110
106
  - [ ] `[HIGH]` No `async void` (except event handlers)
111
107
  - [ ] `[HIGH]` Timeout configured for external operations
112
108
  - [ ] `[MEDIUM]` `ConfigureAwait(false)` only in library code
@@ -12,7 +12,7 @@
12
12
  * node scan-csharp.mjs --diff # scan only changed files (git diff main...HEAD)
13
13
  * node scan-csharp.mjs --diff --base=develop # use different base branch
14
14
  *
15
- * Checks (ref: framework/standards/core/coding.md):
15
+ * Checks:
16
16
  * - UPPER_SNAKE_CASE constants → should be PascalCase
17
17
  * - Hungarian notation → strName, iCount, btnSubmit
18
18
  * - Missing CancellationToken → async methods without CT param
@@ -3,7 +3,7 @@ name: morph-frontend-review
3
3
  description: Complete frontend audit — validates design outputs (design-system, WCAG contrast,
4
4
  mockups), static accessibility scan (TSX + Razor), responsive screenshots at 3
5
5
  breakpoints via Playwright, axe-core a11y at runtime, and SEO (Next.js metadata). Covers Next.js
6
- and Blazor. Triggered at end of phase-uiux and post-implementation.
6
+ Triggered at end of phase-uiux and post-implementation.
7
7
  argument-hint: "[feature-name]"
8
8
  user-invocable: true
9
9
  allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion,
@@ -12,7 +12,6 @@ allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion,
12
12
  mcp__playwright__browser_evaluate, mcp__playwright__browser_console_messages
13
13
  cliVersion: "4.8.19"
14
14
  stacks:
15
- - blazor
16
15
  - nextjs
17
16
  ---
18
17
 
@@ -40,14 +39,14 @@ Beyond the stack, determine the **context** by examining what exists:
40
39
 
41
40
  ```bash
42
41
  # Check if design outputs exist
43
- ls .morph/features/$ARGUMENTS/2-ui/ 2>/dev/null
42
+ ls .morph/features/$ARGUMENTS/1-ui/ 2>/dev/null
44
43
 
45
44
  # Check if implemented frontend files exist
46
- find . -name "*.tsx" -o -name "*.razor" 2>/dev/null | head -5
45
+ find . -name "*.tsx" 2>/dev/null | head -5
47
46
  ```
48
47
 
49
- - If `.morph/features/$ARGUMENTS/2-ui/ui-design-system.md` exists → context includes **design validation**
50
- - If implemented frontend files exist (`.tsx`, `.razor`) → context includes **implementation validation**
48
+ - If `.morph/features/$ARGUMENTS/1-ui/design-system.md` exists → context includes **design validation**
49
+ - If implemented frontend files exist (`.tsx`) → context includes **implementation validation**
51
50
  - Both can coexist
52
51
 
53
52
  Store `stack`, `frontendPath`, `startCommand` and the detected context — all steps depend on them.
@@ -60,21 +59,21 @@ Store `stack`, `frontendPath`, `startCommand` and the detected context — all s
60
59
  morph-spec validate-feature $ARGUMENTS
61
60
  ```
62
61
 
63
- Verify existence and quality of the 4 mandatory outputs in `.morph/features/$ARGUMENTS/2-ui/`:
62
+ Verify existence and quality of the 4 mandatory outputs in `.morph/features/$ARGUMENTS/1-ui/`:
64
63
 
65
64
  ```
66
- [ ] ui-design-system.md — color palette, typography tokens, spacing
67
- [ ] ui-mockups.md — wireframes with responsive states
68
- [ ] ui-components.md — technical component specs
69
- [ ] ui-flows.md — user journeys and edge cases
70
- [ ] WCAG AA Contrast: primary and text colors ≥ 4.5:1 (check ui-design-system.md)
65
+ [ ] design-system.md — color palette, typography tokens, spacing
66
+ [ ] mockups.md — wireframes with responsive states
67
+ [ ] components.md — technical component specs
68
+ [ ] flows.md — user journeys and edge cases
69
+ [ ] WCAG AA Contrast: primary and text colors ≥ 4.5:1 (check design-system.md)
71
70
  [ ] Documented touch targets: ≥ 44x44px for mobile
72
71
  [ ] Loading/error/empty states defined in mockups
73
72
  ```
74
73
 
75
74
  **🚫 BLOCK** if `validate-feature` fails or mandatory outputs missing.
76
75
 
77
- Read `ui-design-system.md` and manually verify that primary and text colors have a contrast ratio
76
+ Read `design-system.md` and manually verify that primary and text colors have a contrast ratio
78
77
  ≥ 4.5:1. Reference tools: WebAIM Contrast Checker (WCAG 2.1 AA criteria).
79
78
 
80
79
  ---
@@ -85,20 +84,19 @@ Read `ui-design-system.md` and manually verify that primary and text colors have
85
84
  node .claude/skills/morph-frontend-review/scripts/scan-accessibility.mjs $frontendPath
86
85
  ```
87
86
 
88
- The script automatically detects file extensions to determine Next.js (`.tsx`) vs
89
- Blazor (`.razor`). If `frontendPath` is not defined, the script uses `.` (project root).
87
+ The script automatically detects file extensions for Next.js (`.tsx`).
88
+ If `frontendPath` is not defined, the script uses `.` (project root).
90
89
 
91
90
  **Checks implemented:**
92
91
 
93
92
  | ID | Severity | Files | Checks |
94
93
  |----|-----------|---------|---------|
95
- | `IMG_MISSING_ALT` | CRITICAL | .tsx, .razor | `<img` missing `alt=` attribute |
96
- | `INPUT_MISSING_LABEL` | HIGH | .tsx, .razor | `<input`/`<InputText`/`<FluentTextField` without `aria-label`, `aria-labelledby`, or associated `<label for=` |
97
- | `HEADING_HIERARCHY` | HIGH | .tsx, .razor | Heading level skip (H1→H3 skipping H2) |
98
- | `LINK_NO_TEXT` | HIGH | .tsx, .razor | `<a` empty or with only icon and no `aria-label` |
99
- | `BUTTON_NO_TEXT` | HIGH | .tsx, .razor | `<button`/`<FluentButton` no text and no `aria-label` |
100
- | `AUTOPLAY_MEDIA` | MEDIUM | .tsx, .razor | `<video`/`<audio` with `autoPlay` without `muted` |
101
- | `FLUENT_CHECKBOX_NO_LABEL` | MEDIUM | .razor | `<FluentCheckbox` without `Label=` |
94
+ | `IMG_MISSING_ALT` | CRITICAL | .tsx | `<img` missing `alt=` attribute |
95
+ | `INPUT_MISSING_LABEL` | HIGH | .tsx | `<input` without `aria-label`, `aria-labelledby`, or associated `<label for=` |
96
+ | `HEADING_HIERARCHY` | HIGH | .tsx | Heading level skip (H1→H3 skipping H2) |
97
+ | `LINK_NO_TEXT` | HIGH | .tsx | `<a` empty or with only icon and no `aria-label` |
98
+ | `BUTTON_NO_TEXT` | HIGH | .tsx | `<button` no text and no `aria-label` |
99
+ | `AUTOPLAY_MEDIA` | MEDIUM | .tsx | `<video`/`<audio` with `autoPlay` without `muted` |
102
100
 
103
101
  **🚫 BLOCK** if any CRITICAL finding or HIGH count ≥ 3.
104
102
 
@@ -118,22 +116,6 @@ node .claude/skills/morph-code-review-nextjs/scripts/scan-nextjs.mjs $frontendPa
118
116
 
119
117
  **🚫 BLOCK** if CRITICAL findings found.
120
118
 
121
- ### If DOTNET or FULLSTACK (Blazor):
122
-
123
- Manually verify the main checklist categories for the implemented feature:
124
-
125
- ```
126
- [ ] Blazor components with correctly typed parameters
127
- [ ] EventCallback<T> for events — no direct Action/Func
128
- [ ] Dispose implemented where there are subscriptions (IDisposable)
129
- [ ] No business logic in .razor files (separate into @code or classes)
130
- [ ] StateHasChanged() called only when necessary
131
- [ ] Forms with EditForm and DataAnnotationsValidator
132
- [ ] Required fields with [Required] and defined error messages
133
- ```
134
-
135
- **🚫 BLOCK** if any CRITICAL item is found.
136
-
137
119
  ---
138
120
 
139
121
  ## Step 4 — Responsive Screenshots (Playwright MCP)
@@ -149,7 +131,7 @@ node .claude/skills/morph-post-implementation/scripts/detect-dev-server.mjs "$st
149
131
  Extract the main feature URLs by reading `spec.md`:
150
132
 
151
133
  ```bash
152
- Read: .morph/features/$ARGUMENTS/1-design/spec.md
134
+ Read: .morph/features/$ARGUMENTS/2-design/spec.md
153
135
  ```
154
136
 
155
137
  For each main page (max 3), capture screenshots at 3 breakpoints:
@@ -181,7 +163,7 @@ await mcp__playwright__browser_take_screenshot({
181
163
  ```
182
164
 
183
165
  Screenshots saved to: `.morph/features/$ARGUMENTS/visual-screenshots/`
184
- (works in both phase `2-ui` and `5-implement`)
166
+ (works in both phase `1-ui` and `5-implement`)
185
167
 
186
168
  ### 4c. If dev server NOT available (exit 1):
187
169
 
@@ -313,7 +295,7 @@ Save to `.morph/features/$ARGUMENTS/visual-screenshots/morph-frontend-review-sum
313
295
 
314
296
  ### Step 1 — Design Outputs
315
297
  - validate-feature: ✅ PASS / 🚫 BLOCK
316
- - Outputs verified: ui-design-system.md, ui-mockups.md, ui-components.md, ui-flows.md
298
+ - Outputs verified: design-system.md, mockups.md, components.md, flows.md
317
299
  - WCAG Contrast: {result}
318
300
 
319
301
  ### Step 2 — Static Accessibility Scan
@@ -108,7 +108,7 @@ Gather evidence to build a stack map. Run these in parallel:
108
108
  | `Glob` | `**/docker-compose*.yml` | Container services |
109
109
  | `Glob` | `database/migrations/**` | Supabase local dev |
110
110
  | `Glob` | `supabase/**` | Supabase project config |
111
- | `Glob` | `**/*.razor` | Blazor |
111
+
112
112
  | `Glob` | `**/Abstractions/IHandler.cs` | VSA pattern (KanaiyaKatarmal) |
113
113
  | `Glob` | `**/Pipelines/ValidationDecorator.cs` | VSA pipeline |
114
114
  | `Glob` | `**/Features/**/*Feature` | VSA feature folder suffix |
@@ -123,7 +123,7 @@ Read each found `package.json` for dependency names. Build an **evidence map**:
123
123
  ```
124
124
  stack: [nextjs, dotnet, ...]
125
125
  integrations: [supabase, docker, clerk, ...]
126
- uiLibrary: shadcn | fluent-ui | mudblazor | null
126
+ uiLibrary: shadcn | null
127
127
  monorepo: true | false
128
128
  frontendPath: src/frontend (if monorepo)
129
129
  backendPath: src/backend (if monorepo)
@@ -147,7 +147,7 @@ Ask at most 3 questions, only those that apply:
147
147
  |---|----------|-----------|---------|
148
148
  | 1 | *"In one sentence: what is the main purpose of **[ProjectName]**?"* | Always | README.md Overview |
149
149
  | 2 | *"Confirmed: frontend at `{frontendPath}`, backend at `{backendPath}`. Correct?"* | Monorepo detected | Validate paths before persisting |
150
- | 3 | *"Supabase Cloud (managed) or self-hosted?"* | Supabase detected | MCP URL configuration |
150
+ | 3 | *"Supabase Cloud (managed) or self-hosted?"* | Supabase detected | Local dev configuration |
151
151
 
152
152
  Do **not** ask about technology already confirmed by file evidence.
153
153
 
@@ -348,10 +348,10 @@ And inform the user:
348
348
  ```
349
349
  ✓ Detected: Vertical Slice Architecture (IHandler.cs / *Feature folders)
350
350
  → config.json: architecture.style = "vertical-slice"
351
- → morph-spec will use vsa-architect + contracts-vsa.cs for features
351
+ → morph-spec will use dotnet-senior + contracts-vsa.cs for features
352
352
  ```
353
353
 
354
- > This key is what activates `vsa-architect` instead of `domain-architect` during `/morph-proposal`.
354
+ > This key is what activates `dotnet-senior` (VSA mode) during `/morph-proposal`.
355
355
 
356
356
  **If the project doesn't exist yet (new VSA project from scratch)**, also inform:
357
357
 
@@ -369,12 +369,8 @@ To create a new VSA project:
369
369
  For each detected integration with an available MCP:
370
370
 
371
371
  **Supabase detected:**
372
- > *"Configure Supabase MCP? Uses OAuth — no credentials needed."*
373
- - YES → write remote config to `.claude/settings.local.json`:
374
- ```json
375
- "supabase": { "type": "http", "url": "https://mcp.supabase.com/mcp" }
376
- ```
377
- - NO → show snippet + `morph-spec mcp setup supabase`
372
+ > *"Supabase CLI detected. Local Docker instance will be used for all database operations (`npx supabase start`)."*
373
+ > No MCP configuration needed — CLI is the primary and only tool for Supabase interaction.
378
374
 
379
375
  **GitHub:**
380
376
  > *"Configure GitHub MCP? Requires Docker + a `GITHUB_PERSONAL_ACCESS_TOKEN`."*
@@ -396,6 +392,14 @@ For each detected integration with an available MCP:
396
392
  ```
397
393
  - NO → show snippet + `morph-spec mcp setup vercel`
398
394
 
395
+ **Asaas detected** (integrations includes "asaas"):
396
+ > *"Configure Asaas MCP? Provides API docs, schemas, and code examples for the Asaas payments API."*
397
+ - YES → write config to `.claude/settings.local.json`:
398
+ ```json
399
+ "asaas": { "type": "http", "url": "https://docs.asaas.com/mcp" }
400
+ ```
401
+ - NO → skip (use WebFetch on https://docs.asaas.com for API docs)
402
+
399
403
  Only offer Docker, Azure if explicitly detected in `.env.example`.
400
404
 
401
405
  > **Format rules for MCP configs:**
@@ -475,9 +479,9 @@ If the project stack suggests a non-standard workflow, ask the user:
475
479
 
476
480
  | Stack | Default Workflow | Alternative |
477
481
  |-------|-----------------|-------------|
478
- | Node.js CLI (no UI) | `nodejs-cli` (skips uiux/clarify/sync) | `standard` |
479
- | .NET + Blazor | `standard` (all phases) | — |
480
- | Next.js | `standard` (all phases) | — |
482
+ | Simple feature | `fast-track` (proposal → tasks → implement) | `standard` |
483
+ | Medium feature | `standard` (proposal → design → plan → tasks → implement) | `full` |
484
+ | Complex feature | `full` (all phases including uiux + sync) | — |
481
485
 
482
486
  For Node.js CLI projects, update config:
483
487
  ```json
@@ -0,0 +1,225 @@
1
+ ---
2
+ name: morph-parallel-dispatch
3
+ description: Plan and execute parallel agent dispatch using P-Threads, F-Threads, and squad templates. Covers thread types, file scope isolation, dependency analysis, and conflict resolution for multi-domain features.
4
+ user-invocable: true
5
+ argument-hint: "[feature-name]"
6
+ allowed-tools: Read, Bash, Glob, Grep
7
+ ---
8
+
9
+ # Parallel Dispatch — MORPH-SPEC Thread Management
10
+
11
+ > Orchestrate concurrent agent execution with strict file scope isolation, dependency-aware wave planning, and automatic conflict resolution.
12
+
13
+ ## Thread Types
14
+
15
+ | Type | Code | Purpose | Lifecycle |
16
+ |------|------|---------|-----------|
17
+ | Base | B-Thread | Default implementation thread | Bounded by feature phase |
18
+ | Parallel | P-Thread | Concurrent isolated execution | Short (1 task scope) |
19
+ | Fusion | F-Thread | Best-of-N competing implementations | Short (1 prompt scope) |
20
+ | Long-Running | L-Thread | Multi-session persistent work | Days/weeks |
21
+ | Zero-Touch | Z-Thread | Fully autonomous execution | Bounded by trust level |
22
+
23
+ ## When to Use Parallel Execution
24
+
25
+ | Condition | Decision |
26
+ |-----------|----------|
27
+ | 5+ independent tasks | Use P-Threads |
28
+ | Multi-domain (backend + frontend) | Use P-Threads with squad templates |
29
+ | 15+ files to create | Use P-Threads |
30
+ | Tasks have zero dependency overlap | Use P-Threads |
31
+ | Tasks share file scope | Do NOT parallelize |
32
+ | Sequential data flow required | Do NOT parallelize |
33
+
34
+ ## Thread Lifecycle
35
+
36
+ ```
37
+ pending --> running --> completed
38
+ --> failed --> (retry) --> running
39
+ --> killed
40
+ ```
41
+
42
+ ## Parallelization Planning
43
+
44
+ ### Step 1: Dependency Analysis
45
+
46
+ ```bash
47
+ morph-spec detect-workflow $FEATURE_NAME
48
+
49
+ # Identifies: parallelizable tasks, sequential chains, waves
50
+ # Output:
51
+ # Parallelizable tasks: T001, T002, T003 (no dependencies)
52
+ # Sequential: T004 (depends on T001), T005 (depends on T002)
53
+ # Execution plan:
54
+ # Wave 1: [T001, T002, T003] (parallel)
55
+ # Wave 2: [T004, T005] (parallel, after wave 1)
56
+ # Wave 3: [T006] (sequential)
57
+ ```
58
+
59
+ ### Step 2: File Scope Assignment
60
+
61
+ Assign exclusive file ownership to each parallel worker. No overlap allowed — if overlap is unavoidable, make it sequential.
62
+
63
+ ```
64
+ Worker A (Backend): Features/, Services/, Endpoints/, DTOs/
65
+ Worker B (Frontend): app/, components/, hooks/, styles/
66
+ ```
67
+
68
+ **Example — Next.js + .NET VSA feature:**
69
+
70
+ ```
71
+ P-Thread 1 (VSA Backend):
72
+ src/Features/UserAuth/
73
+ CreateUser.cs (endpoint + handler)
74
+ GetUser.cs (endpoint + handler)
75
+ UserValidator.cs (FluentValidation)
76
+ Contracts/UserDto.cs (shared DTOs)
77
+
78
+ P-Thread 2 (Next.js Frontend):
79
+ app/users/
80
+ page.tsx (route page)
81
+ layout.tsx (layout)
82
+ components/users/
83
+ user-form.tsx (shadcn/ui form)
84
+ user-table.tsx (data table)
85
+ hooks/
86
+ use-users.ts (React Query hook)
87
+ ```
88
+
89
+ ### Step 3: Choose Squad Template
90
+
91
+ Pre-defined squad configurations for common feature shapes:
92
+
93
+ | Template | Agents | Use Case |
94
+ |----------|--------|----------|
95
+ | `full-stack` | Backend lead + Frontend lead + Coordinator | Full-stack features |
96
+ | `backend-only` | Backend specialists (3-4 agents) | API-only work |
97
+ | `frontend-only` | Frontend specialists (2-3 agents) | UI-only work |
98
+
99
+ ```bash
100
+ morph-spec squad-template list
101
+ morph-spec squad-template show full-stack
102
+ morph-spec squad-template use full-stack --feature=$FEATURE_NAME
103
+ ```
104
+
105
+ ## Execution Flow
106
+
107
+ ```
108
+ Orchestrator
109
+ |
110
+ +-- spawn parallel: Worker A (files: Features/, Services/)
111
+ +-- spawn parallel: Worker B (files: app/, components/)
112
+ |
113
+ | [Workers execute concurrently -- no interaction]
114
+ |
115
+ +-- wait-all (poll or explicit sync)
116
+ |
117
+ +-- merge results (check for conflicts)
118
+ +-- run integration validation
119
+ +-- report consolidated output
120
+ ```
121
+
122
+ ## P-Thread Rules
123
+
124
+ 1. **File scope isolation**: Each P-Thread has exclusive write access to its files
125
+ 2. **No cross-thread dependencies**: P-Thread tasks are self-contained
126
+ 3. **Shared read access**: All P-Threads can read spec.md, standards, contracts
127
+ 4. **Merge on completion**: Coordinator merges results after all P-Threads complete
128
+ 5. **Max concurrent**: Default 3, max 5 (configurable in llm-interaction.json)
129
+
130
+ ## Parallel vs Fusion
131
+
132
+ | Aspect | Parallel (P-Thread) | Fusion (F-Thread) |
133
+ |--------|---------------------|-------------------|
134
+ | Goal | Divide scope | Compete on same scope |
135
+ | Output | Different files | Same files, best one wins |
136
+ | Workers collaborate? | No | No |
137
+ | Merge | Combine all files | Select best implementation |
138
+ | Use case | Large features | Design decisions, quality optimization |
139
+
140
+ ## Conflict Resolution
141
+
142
+ ### File Conflicts (two workers wrote same file)
143
+
144
+ This should NOT happen if scopes are properly defined. If it does:
145
+
146
+ ```bash
147
+ morph-spec agents review aggregate $FEATURE_NAME \
148
+ --agents=dotnet-senior,nextjs-expert \
149
+ --strategy=best-of-n
150
+ ```
151
+
152
+ ### Interface Mismatches (A expects contract B did not fulfill)
153
+
154
+ - Document the mismatch in the coordinator report
155
+ - Fix in post-merge sequential step
156
+ - Update shared contracts/DTOs to reflect actual implementation
157
+
158
+ ## Long-Running Threads (L-Threads)
159
+
160
+ L-Threads run periodic stop hooks every 30 minutes:
161
+
162
+ ```json
163
+ {
164
+ "stopHooks": {
165
+ "enabled": true,
166
+ "interval": 30,
167
+ "maxRetries": 5,
168
+ "hooks": ["validate-and-continue", "validate-checkpoints"]
169
+ }
170
+ }
171
+ ```
172
+
173
+ ### Resume Pattern
174
+
175
+ ```bash
176
+ morph-spec bundle load $FEATURE_NAME
177
+ # Load resume context, continue from checkpoint
178
+ ```
179
+
180
+ ## Thread State in state.json
181
+
182
+ ```json
183
+ {
184
+ "threads": {
185
+ "thread-abc12345": {
186
+ "id": "thread-abc12345",
187
+ "type": "parallel",
188
+ "agent": "dotnet-senior",
189
+ "feature": "user-auth",
190
+ "status": "running",
191
+ "startedAt": "2026-02-19T00:00:00Z",
192
+ "events": [
193
+ { "type": "started", "timestamp": "..." },
194
+ { "type": "checkpoint_passed", "timestamp": "...", "checkpointNum": 1 }
195
+ ],
196
+ "metrics": {
197
+ "tasksCompleted": 3,
198
+ "checkpointsPassed": 1,
199
+ "errors": 0
200
+ }
201
+ }
202
+ }
203
+ }
204
+ ```
205
+
206
+ ## Monitoring
207
+
208
+ ```bash
209
+ morph-spec threads list $FEATURE_NAME
210
+ morph-spec threads analytics $FEATURE_NAME
211
+ morph-spec threads wait-all $FEATURE_NAME
212
+ morph-spec threads wait-any $FEATURE_NAME
213
+ ```
214
+
215
+ ## Configuration
216
+
217
+ ```json
218
+ {
219
+ "parallelExecution": {
220
+ "enabled": true,
221
+ "maxConcurrent": 3,
222
+ "defaultStrategy": "best-of-n"
223
+ }
224
+ }
225
+ ```
@@ -104,8 +104,28 @@ Read validation output, fix reported issues, and re-run until it passes.
104
104
 
105
105
  ---
106
106
 
107
+ ### Step 4b — Verify RLS Policies (Supabase projects)
108
+
109
+ > **Supabase CLI:** If the project uses Supabase, verify RLS policies on the local Docker instance:
110
+ >
111
+ > 1. Get DB URL: `npx supabase status` → extract `DB URL`
112
+ > 2. Query: `psql <DB_URL> -c "SELECT tablename, policyname, cmd, qual FROM pg_policies WHERE schemaname = 'public'"`
113
+ > 3. For each table modified in this feature, verify:
114
+ > - [ ] RLS is enabled (`ALTER TABLE ... ENABLE ROW LEVEL SECURITY`)
115
+ > - [ ] SELECT policy exists for authenticated users
116
+ > - [ ] INSERT/UPDATE/DELETE policies match feature requirements
117
+ > 4. If any table is missing RLS → **flag as CRITICAL** (blocks PR)
118
+ >
119
+ > If local Supabase is not running, check for RLS policy files in the `supabase/migrations/` directory and verify they cover modified tables. If no Supabase in the stack, skip this step.
120
+
121
+ ---
122
+
107
123
  ## Step 5 — Smoke Test (Playwright MCP)
108
124
 
125
+ > **Docker CLI:** Before smoke testing, verify local services are running: `docker ps --format "table {{.Names}}\t{{.Status}}"` — all expected containers should show "Up". If Supabase containers are down, run `npx supabase start` before proceeding.
126
+
127
+ > **MCP:** Smoke testing via **Playwright MCP** is the primary method. If Playwright MCP is not available, fall back to `curl`/`WebFetch` for endpoint verification (limited — cannot test JS-rendered pages or interactions).
128
+
109
129
  ### 5a. Detect Dev Server
110
130
 
111
131
  ```bash
@@ -64,7 +64,7 @@ Dispatch specialist agents as **Task subagents** when ALL conditions are met:
64
64
  ```
65
65
  Feature with multiple active agents?
66
66
  │
67
- ├─ design phase → Dispatch domain-architect (complexity analysis)
67
+ ├─ design phase → Dispatch architect (complexity analysis)
68
68
  │ + tech leads (spec validation) — in PARALLEL
69
69
  │
70
70
  ├─ tasks phase → Dispatch per-domain task planners (if spec has 50+ reqs
@@ -76,9 +76,9 @@ Feature with multiple active agents?
76
76
  ```
77
77
 
78
78
  **Key principle (from real-world usage):** Define subagents by **TASK**, not by **ROLE**.
79
- - ✅ "Analyze this proposal for DDD complexity and return level + blueprint" (task)
79
+ - ✅ "Analyze this proposal for complexity and return level + blueprint" (task)
80
80
  - ✅ "Implement backend tasks T001-T005 for feature X" (task)
81
- - ❌ "Be a domain architect" (vague role assignment — poor results)
81
+ - ❌ "Be an architect" (vague role assignment — poor results)
82
82
 
83
83
  ---
84
84
 
@@ -136,10 +136,8 @@ Criterion: if reading file B does not depend on the CONTENT of file A, read both
136
136
  | Phase | Primary MCPs | Dispatch subagents? |
137
137
  |-------|-------------|---------------------|
138
138
  | Proposal | GitHub (optional) | No |
139
- | Setup | GitHub (optional) | No |
140
139
  | UI/UX | Playwright, Context7 | No |
141
- | Design | Supabase, Context7, GitHub | Yes (domain-architect + schema in parallel) |
142
- | Clarify | Context7, GitHub | No |
140
+ | Design | Supabase, Context7, GitHub | Yes (architect + schema in parallel) |
143
141
  | Plan | Context7, GitHub | No |
144
142
  | Tasks | Context7, GitHub | Yes (when spec has 20+ reqs or 3+ domains) |
145
143
  | Implement | Supabase, Context7, Playwright, GitHub | Yes (when tasks.total ≥ 6 and 2+ domains) |
@@ -218,7 +216,6 @@ For the canonical list of MCPs, their tools, phase relevance, and fallbacks, see
218
216
  | Setup | GitHub | `gh` CLI |
219
217
  | UI/UX | Playwright, Context7 | WebFetch, Read CSS |
220
218
  | Design | Supabase, Context7, GitHub | Grep + Read code |
221
- | Clarify | Context7, GitHub | WebSearch |
222
219
  | Tasks | Context7, GitHub | WebSearch, `gh` CLI |
223
220
  | Implement | Supabase, Context7, Playwright, GitHub | CLI tools |
224
221
 
@@ -236,7 +233,6 @@ When the `superpowers` plugin is installed, additional skills enhance each phase
236
233
  |-------|------------------|---------|
237
234
  | Setup | `using-git-worktrees` | Isolate feature work |
238
235
  | Design | `writing-plans`, `brainstorming` | Structure approach, explore alternatives |
239
- | Clarify | `systematic-debugging` | Investigate technical ambiguities |
240
236
  | Tasks | `writing-plans`, `executing-plans` | Plan and execute implementation |
241
237
  | Implement | `test-driven-development`, `systematic-debugging`, `requesting-code-review` | TDD, debug failures, review |
242
238