@polymorphism-tech/morph-spec 4.3.6 → 4.5.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 (375) hide show
  1. package/.morph/.morphversion +3 -3
  2. package/.morph/analytics/threads-log.jsonl +44 -9
  3. package/.morph/config/config.json +2 -3
  4. package/.morph/framework/standards/STANDARDS.json +812 -0
  5. package/.morph/{standards → framework/standards}/ai-agents/team-orchestration.md +3 -3
  6. package/.morph/framework/standards/integration/mcp/mcp-tools.md +384 -0
  7. package/.morph/{templates → framework/templates}/README.md +17 -17
  8. package/.morph/{templates → framework/templates}/REGISTRY.json +48 -233
  9. package/.morph/framework/templates/code/dotnet/contracts/contracts.cs.hbs +172 -0
  10. package/.morph/{templates → framework/templates}/context/CONTEXT-FEATURE.md +1 -1
  11. package/.morph/{templates → framework/templates}/context/CONTEXT.md +3 -3
  12. package/.morph/framework/templates/docs/clarifications.md +253 -0
  13. package/.morph/framework/templates/docs/onboarding.md +123 -0
  14. package/.morph/framework/templates/docs/schema-analysis.md +119 -0
  15. package/.morph/{templates → framework/templates}/docs/spec.md +149 -149
  16. package/.morph/framework/templates/docs/ui-components.md +124 -0
  17. package/.morph/framework/templates/docs/ui-design-system.md +76 -0
  18. package/.morph/framework/templates/docs/ui-flows.md +167 -0
  19. package/.morph/framework/templates/docs/ui-mockups.md +98 -0
  20. package/.morph/{templates → framework/templates}/examples/spec-examples.md +1 -1
  21. package/.morph/{templates → framework/templates}/infrastructure/github/README.md +11 -11
  22. package/.morph/{templates → framework/templates}/infrastructure/github/workflows/deploy-azure-app-service.yml.hbs +2 -2
  23. package/.morph/{templates → framework/templates}/meta-prompts/parallel-workers/parallel-worker.md +2 -2
  24. package/.morph/{templates → framework/templates}/meta-prompts/validators/pre-commit-validator.md +1 -1
  25. package/.morph/logs/tool-failures.log +51 -0
  26. package/.morph/memory/pre-compact-2026-02-22T17-01-01-658Z.json +16 -0
  27. package/.morph/state.json +1 -1
  28. package/CLAUDE.md +20 -119
  29. package/README.md +20 -18
  30. package/bin/detect-agents.js +1 -1
  31. package/bin/morph-spec.js +116 -266
  32. package/bin/task-manager.cjs +2 -2
  33. package/bin/validate.js +1 -1
  34. package/claude-plugin.json +14 -0
  35. package/docs/claude-alignment-report.md +137 -0
  36. package/docs/plans/2026-02-22-claude-docs-morph-alignment-analysis.md +512 -0
  37. package/docs/plans/2026-02-22-claude-settings.md +515 -0
  38. package/docs/plans/2026-02-22-morph-cc-alignment-impl.md +728 -0
  39. package/docs/plans/2026-02-22-morph-spec-next.md +478 -0
  40. package/docs/plans/2026-02-22-native-alignment-design.md +199 -0
  41. package/docs/plans/2026-02-22-native-alignment-impl.md +925 -0
  42. package/docs/plans/2026-02-22-native-enrichment-design.md +244 -0
  43. package/docs/plans/2026-02-22-native-enrichment.md +735 -0
  44. package/framework/CLAUDE.md +77 -0
  45. package/framework/commands/morph-apply.md +9 -9
  46. package/framework/commands/morph-archive.md +8 -8
  47. package/framework/commands/morph-infra.md +1 -1
  48. package/framework/commands/morph-proposal.md +9 -9
  49. package/framework/commands/morph-status.md +3 -3
  50. package/framework/commands/morph-troubleshoot.md +1 -1
  51. package/framework/hooks/README.md +201 -282
  52. package/framework/hooks/claude-code/notification/approval-reminder.js +52 -0
  53. package/framework/hooks/claude-code/post-tool-use/dispatch.js +83 -0
  54. package/framework/hooks/claude-code/post-tool-use/handle-tool-failure.js +42 -0
  55. package/framework/hooks/claude-code/pre-compact/save-morph-context.js +61 -0
  56. package/framework/hooks/claude-code/pre-tool-use/enforce-phase-writes.js +71 -0
  57. package/framework/hooks/claude-code/pre-tool-use/protect-readonly-files.js +58 -0
  58. package/framework/hooks/claude-code/pre-tool-use/protect-spec-files.js +64 -0
  59. package/framework/hooks/claude-code/session-start/inject-morph-context.js +94 -0
  60. package/framework/hooks/claude-code/statusline.py +239 -0
  61. package/framework/hooks/claude-code/statusline.sh +7 -0
  62. package/framework/hooks/claude-code/stop/validate-completion.js +88 -0
  63. package/framework/hooks/claude-code/user-prompt/enrich-prompt.js +91 -0
  64. package/framework/hooks/shared/hook-response.js +45 -0
  65. package/framework/hooks/shared/phase-utils.js +129 -0
  66. package/framework/hooks/shared/state-reader.js +138 -0
  67. package/framework/hooks/shared/stdin-reader.js +26 -0
  68. package/framework/phases.json +145 -0
  69. package/framework/rules/csharp-standards.md +10 -0
  70. package/framework/rules/frontend-standards.md +14 -0
  71. package/framework/rules/infrastructure-standards.md +13 -0
  72. package/framework/rules/morph-workflow.md +86 -0
  73. package/framework/rules/testing-standards.md +11 -0
  74. package/framework/skills/level-0-meta/brainstorming.md +133 -0
  75. package/framework/skills/level-0-meta/code-review.md +12 -4
  76. package/framework/skills/level-0-meta/mcp-registry.json +207 -0
  77. package/framework/skills/level-0-meta/morph-checklist.md +9 -1
  78. package/framework/skills/level-0-meta/simulation-checklist.md +9 -1
  79. package/framework/skills/level-0-meta/tool-usage-guide.md +335 -0
  80. package/framework/skills/level-0-meta/verification-before-completion.md +145 -0
  81. package/framework/skills/level-1-workflows/morph-replicate.md +9 -1
  82. package/framework/skills/level-1-workflows/phase-clarify.md +65 -4
  83. package/framework/skills/level-1-workflows/phase-codebase-analysis.md +182 -0
  84. package/framework/skills/level-1-workflows/phase-design.md +342 -80
  85. package/framework/skills/level-1-workflows/phase-implement.md +254 -0
  86. package/framework/skills/level-1-workflows/phase-setup.md +76 -10
  87. package/framework/skills/level-1-workflows/phase-tasks.md +88 -7
  88. package/framework/skills/level-1-workflows/phase-uiux.md +95 -17
  89. package/framework/skills/level-2-domains/ai-agents/ai-system-architect.md +8 -1
  90. package/framework/skills/level-2-domains/architecture/po-pm-advisor.md +8 -1
  91. package/framework/skills/level-2-domains/architecture/prompt-engineer.md +8 -1
  92. package/framework/skills/level-2-domains/architecture/seo-growth-hacker.md +8 -1
  93. package/framework/skills/level-2-domains/architecture/standards-architect.md +11 -4
  94. package/framework/skills/level-2-domains/backend/api-designer.md +8 -1
  95. package/framework/skills/level-2-domains/backend/dotnet-senior.md +8 -1
  96. package/framework/skills/level-2-domains/backend/ef-modeler.md +8 -1
  97. package/framework/skills/level-2-domains/backend/hangfire-orchestrator.md +9 -2
  98. package/framework/skills/level-2-domains/backend/ms-agent-expert.md +8 -1
  99. package/framework/skills/level-2-domains/frontend/blazor-builder.md +8 -1
  100. package/framework/skills/level-2-domains/frontend/nextjs-expert.md +8 -1
  101. package/framework/skills/level-2-domains/frontend/ui-ux-designer.md +9 -2
  102. package/framework/skills/level-2-domains/infrastructure/azure-architect.md +8 -1
  103. package/framework/skills/level-2-domains/infrastructure/azure-deploy-specialist.md +8 -1
  104. package/framework/skills/level-2-domains/infrastructure/bicep-architect.md +8 -1
  105. package/framework/skills/level-2-domains/infrastructure/container-specialist.md +8 -1
  106. package/framework/skills/level-2-domains/infrastructure/devops-engineer.md +8 -1
  107. package/framework/skills/level-2-domains/integrations/asaas-financial.md +8 -1
  108. package/framework/skills/level-2-domains/integrations/azure-identity.md +8 -1
  109. package/framework/skills/level-2-domains/integrations/clerk-auth.md +8 -1
  110. package/framework/skills/level-2-domains/integrations/{hangfire-orchestrator.md → hangfire-integration.md} +8 -1
  111. package/framework/skills/level-2-domains/integrations/resend-email.md +8 -1
  112. package/framework/skills/level-2-domains/quality/code-analyzer.md +10 -3
  113. package/framework/skills/level-2-domains/quality/testing-specialist.md +8 -1
  114. package/framework/standards/STANDARDS.json +812 -0
  115. package/framework/standards/ai-agents/team-orchestration.md +3 -3
  116. package/framework/standards/frontend/nextjs/nextjs-patterns.md +17 -0
  117. package/framework/standards/integration/mcp/mcp-tools.md +384 -0
  118. package/framework/templates/README.md +17 -17
  119. package/framework/templates/REGISTRY.json +48 -233
  120. package/framework/templates/code/dotnet/contracts/contracts.cs.hbs +172 -0
  121. package/framework/templates/context/CONTEXT-FEATURE.md +1 -1
  122. package/framework/templates/context/CONTEXT.md +3 -3
  123. package/framework/templates/docs/clarifications.md +253 -0
  124. package/framework/templates/docs/onboarding.md +123 -0
  125. package/framework/templates/docs/schema-analysis.md +119 -0
  126. package/framework/templates/docs/spec.md +149 -149
  127. package/framework/templates/docs/ui-components.md +124 -0
  128. package/framework/templates/docs/ui-design-system.md +76 -0
  129. package/framework/templates/docs/ui-flows.md +167 -0
  130. package/framework/templates/docs/ui-mockups.md +98 -0
  131. package/framework/templates/docs/user-stories.md +34 -0
  132. package/framework/templates/examples/spec-examples.md +1 -1
  133. package/framework/templates/infrastructure/github/README.md +11 -11
  134. package/framework/templates/infrastructure/github/workflows/deploy-azure-app-service.yml.hbs +2 -2
  135. package/framework/templates/meta-prompts/parallel-workers/parallel-worker.md +2 -2
  136. package/framework/templates/meta-prompts/validators/pre-commit-validator.md +1 -1
  137. package/framework/workflows/configs/express.json +45 -0
  138. package/framework/workflows/configs/spec-only.json +43 -0
  139. package/framework/workflows/docs/enforcement-pipeline.md +8 -8
  140. package/framework/workflows/docs/full-morph.md +3 -3
  141. package/package.json +3 -2
  142. package/scripts/generate-refs.js +336 -0
  143. package/scripts/generate-standards-registry.js +44 -0
  144. package/scripts/validate-real.mjs +255 -0
  145. package/src/commands/feature/create-story.js +362 -361
  146. package/src/commands/feature/shard-spec.js +225 -224
  147. package/src/commands/feature/sprint-status.js +1 -1
  148. package/src/commands/generation/generate-onboarding.js +169 -0
  149. package/src/commands/generation/generate.js +2 -2
  150. package/src/commands/mcp/mcp-setup.js +315 -0
  151. package/src/commands/project/changes.js +66 -0
  152. package/src/commands/project/checkpoint.js +209 -0
  153. package/src/commands/project/cost.js +179 -0
  154. package/src/commands/project/diff.js +278 -0
  155. package/src/commands/project/doctor.js +55 -7
  156. package/src/commands/project/init.js +318 -76
  157. package/src/commands/project/revert.js +173 -0
  158. package/src/commands/project/standards.js +80 -0
  159. package/src/commands/project/status.js +376 -0
  160. package/src/commands/project/update-agents.js +23 -0
  161. package/src/commands/project/update.js +63 -30
  162. package/src/commands/state/advance-phase.js +4 -3
  163. package/src/commands/state/state.js +10 -3
  164. package/src/commands/state/validate-phase.js +19 -2
  165. package/src/commands/templates/template-customize.js +4 -4
  166. package/src/commands/templates/template-render.js +1 -1
  167. package/src/commands/templates/template-show.js +1 -1
  168. package/src/commands/validation/validate-feature.js +359 -0
  169. package/src/core/orchestrator.js +3 -38
  170. package/src/core/paths/output-schema.js +135 -0
  171. package/src/core/state/state-manager.js +831 -592
  172. package/src/core/templates/template-registry.js +2 -2
  173. package/src/core/workflows/workflow-detector.js +17 -1
  174. package/src/lib/agents/micro-agent-factory.js +1 -1
  175. package/src/lib/context/context-bundler.js +2 -1
  176. package/src/lib/detectors/claude-config-detector.js +392 -0
  177. package/src/lib/detectors/conversation-analyzer.js +4 -4
  178. package/src/lib/detectors/design-system-detector.js +6 -5
  179. package/src/lib/detectors/standards-generator.js +2 -2
  180. package/src/lib/generators/context-generator.js +539 -538
  181. package/src/lib/generators/recap-generator.js +1 -1
  182. package/src/lib/generators/settings-generator.js +210 -0
  183. package/src/lib/hooks/hook-executor.js +1 -1
  184. package/src/lib/installers/mcp-installer.js +299 -0
  185. package/src/lib/learning/learning-system.js +3 -3
  186. package/src/lib/orchestration/team-orchestrator.js +1 -1
  187. package/src/lib/standards/standards-context-injector.js +7 -7
  188. package/src/lib/threads/thread-coordinator.js +1 -1
  189. package/src/lib/troubleshooting/troubleshoot-grep.js +1 -1
  190. package/src/lib/validators/contracts/contract-compliance-validator.js +274 -273
  191. package/src/lib/validators/design-system/design-system-validator.js +1 -1
  192. package/src/lib/validators/spec-validator.js +258 -258
  193. package/src/lib/validators/validation-runner.js +270 -269
  194. package/src/utils/agents-installer.js +206 -0
  195. package/src/utils/claude-settings-manager.js +258 -0
  196. package/src/utils/file-copier.js +1 -1
  197. package/src/utils/hooks-installer.js +354 -28
  198. package/src/utils/skills-installer.js +74 -0
  199. package/.morph/project/context/detection-log.md +0 -16
  200. package/.morph/project/standards/inferred.md +0 -59
  201. package/framework/hooks/agent-stop/validate-and-continue.js +0 -96
  202. package/framework/hooks/agent-stop/validate-checkpoints.js +0 -101
  203. package/framework/hooks/agent-stop/validate-tests.js +0 -109
  204. package/framework/hooks/agent-teams/dispatch.js +0 -67
  205. package/framework/hooks/agent-teams/phase-advanced.js +0 -80
  206. package/framework/hooks/agent-teams/task-completed.js +0 -76
  207. package/framework/hooks/agent-teams/teammate-idle.js +0 -70
  208. package/src/commands/agents/agents-fuse.js +0 -97
  209. package/src/commands/agents/micro-agent.js +0 -112
  210. package/src/commands/agents/spawn-team.js +0 -237
  211. package/src/commands/agents/squad-template.js +0 -146
  212. package/src/commands/analytics/analytics.js +0 -176
  213. package/src/commands/context/context-prime.js +0 -63
  214. package/src/commands/context/core-four.js +0 -54
  215. package/src/commands/generation/generate-context.js +0 -40
  216. package/src/commands/project/detect-agents.js +0 -207
  217. package/src/commands/project/detect-workflow.js +0 -174
  218. package/src/commands/threads/thread-template.js +0 -103
  219. package/src/commands/threads/threads.js +0 -261
  220. package/src/commands/utils/session-summary.js +0 -291
  221. package/src/llm/analyzer.js +0 -215
  222. package/src/llm/few-shot-examples.js +0 -216
  223. package/src/llm/project-config-schema.json +0 -188
  224. package/src/llm/prompt-builder.js +0 -96
  225. /package/.morph/{project/context → context}/README.md +0 -0
  226. /package/.morph/{config → framework}/agents.json +0 -0
  227. /package/.morph/{standards → framework/standards}/ai-agents/blazor-ui.md +0 -0
  228. /package/.morph/{standards → framework/standards}/ai-agents/production.md +0 -0
  229. /package/.morph/{standards → framework/standards}/ai-agents/setup.md +0 -0
  230. /package/.morph/{standards → framework/standards}/ai-agents/workflows.md +0 -0
  231. /package/.morph/{standards → framework/standards}/architecture/ddd/aggregates.md +0 -0
  232. /package/.morph/{standards → framework/standards}/architecture/ddd/entities.md +0 -0
  233. /package/.morph/{standards → framework/standards}/architecture/ddd/value-objects.md +0 -0
  234. /package/.morph/{standards → framework/standards}/backend/api/minimal-api.md +0 -0
  235. /package/.morph/{standards → framework/standards}/backend/api/rest.md +0 -0
  236. /package/.morph/{standards → framework/standards}/backend/api/validation.md +0 -0
  237. /package/.morph/{standards → framework/standards}/backend/authentication/passkeys.md +0 -0
  238. /package/.morph/{standards → framework/standards}/backend/database/ef-core.md +0 -0
  239. /package/.morph/{standards → framework/standards}/backend/database/migrations.md +0 -0
  240. /package/.morph/{standards → framework/standards}/backend/database/postgresql/database.md +0 -0
  241. /package/.morph/{standards → framework/standards}/backend/database/repository-patterns.md +0 -0
  242. /package/.morph/{standards → framework/standards}/backend/database/vector-search-rag.md +0 -0
  243. /package/.morph/{standards → framework/standards}/backend/dotnet/async.md +0 -0
  244. /package/.morph/{standards → framework/standards}/backend/dotnet/core.md +0 -0
  245. /package/.morph/{standards → framework/standards}/backend/dotnet/di.md +0 -0
  246. /package/.morph/{standards → framework/standards}/backend/dotnet/program-cs-checklist.md +0 -0
  247. /package/.morph/{standards → framework/standards}/backend/integrations/asaas/asaas-api.md +0 -0
  248. /package/.morph/{standards → framework/standards}/backend/integrations/clerk/clerk-auth.md +0 -0
  249. /package/.morph/{standards → framework/standards}/backend/integrations/hangfire/hangfire-jobs.md +0 -0
  250. /package/.morph/{standards → framework/standards}/backend/integrations/resend/resend-email.md +0 -0
  251. /package/.morph/{standards → framework/standards}/context/analytics.md +0 -0
  252. /package/.morph/{standards → framework/standards}/context/bundles.md +0 -0
  253. /package/.morph/{standards → framework/standards}/context/priming.md +0 -0
  254. /package/.morph/{standards → framework/standards}/core/architecture.md +0 -0
  255. /package/.morph/{standards → framework/standards}/core/coding.md +0 -0
  256. /package/.morph/{standards → framework/standards}/core/git-branching-strategy.md +0 -0
  257. /package/.morph/{standards → framework/standards}/core/git.md +0 -0
  258. /package/.morph/{standards → framework/standards}/core/testing.md +0 -0
  259. /package/.morph/{standards → framework/standards}/data/nosql/blob-storage.md +0 -0
  260. /package/.morph/{standards → framework/standards}/data/nosql/cache/redis.md +0 -0
  261. /package/.morph/{standards → framework/standards}/data/nosql/cosmos-db.md +0 -0
  262. /package/.morph/{standards → framework/standards}/data/vector-search/azure-ai-search.md +0 -0
  263. /package/.morph/{standards → framework/standards}/data/vector-search/rag-chunking.md +0 -0
  264. /package/.morph/{standards → framework/standards}/frontend/blazor/design-checklist.md +0 -0
  265. /package/.morph/{standards → framework/standards}/frontend/blazor/fluent-ui-setup.md +0 -0
  266. /package/.morph/{standards → framework/standards}/frontend/blazor/fluent-ui.md +0 -0
  267. /package/.morph/{standards → framework/standards}/frontend/blazor/html-conversion.md +0 -0
  268. /package/.morph/{standards → framework/standards}/frontend/blazor/lifecycle.md +0 -0
  269. /package/.morph/{standards → framework/standards}/frontend/blazor/pitfalls.md +0 -0
  270. /package/.morph/{standards → framework/standards}/frontend/blazor/state.md +0 -0
  271. /package/.morph/{standards → framework/standards}/frontend/design-system/animations.md +0 -0
  272. /package/.morph/{standards → framework/standards}/frontend/design-system/naming.md +0 -0
  273. /package/.morph/{standards → framework/standards}/frontend/nextjs/nextjs-patterns.md +0 -0
  274. /package/.morph/{standards → framework/standards}/infrastructure/azure/azure.md +0 -0
  275. /package/.morph/{standards → framework/standards}/infrastructure/azure/bicep/bicep-patterns.md +0 -0
  276. /package/.morph/{standards → framework/standards}/infrastructure/azure/devops/azure-devops-setup.md +0 -0
  277. /package/.morph/{standards → framework/standards}/infrastructure/azure/devops/local-development.md +0 -0
  278. /package/.morph/{standards → framework/standards}/infrastructure/azure/services/functions.md +0 -0
  279. /package/.morph/{standards → framework/standards}/infrastructure/azure/services/service-bus.md +0 -0
  280. /package/.morph/{standards → framework/standards}/infrastructure/azure/services/storage.md +0 -0
  281. /package/.morph/{standards → framework/standards}/infrastructure/docker/easypanel-deploy.md +0 -0
  282. /package/.morph/{standards → framework/standards}/infrastructure/supabase/mcp-setup.md +0 -0
  283. /package/.morph/{standards → framework/standards}/infrastructure/supabase/supabase-auth.md +0 -0
  284. /package/.morph/{standards → framework/standards}/infrastructure/supabase/supabase-pgvector.md +0 -0
  285. /package/.morph/{standards → framework/standards}/infrastructure/supabase/supabase-rls.md +0 -0
  286. /package/.morph/{standards → framework/standards}/infrastructure/supabase/supabase-storage.md +0 -0
  287. /package/.morph/{standards → framework/standards}/integration/api/graphql.md +0 -0
  288. /package/.morph/{standards → framework/standards}/integration/api/grpc.md +0 -0
  289. /package/.morph/{standards → framework/standards}/integration/api/rest-design.md +0 -0
  290. /package/.morph/{standards → framework/standards}/integration/event-driven/cqrs.md +0 -0
  291. /package/.morph/{standards → framework/standards}/integration/event-driven/event-sourcing.md +0 -0
  292. /package/.morph/{standards → framework/standards}/integration/event-driven/service-bus.md +0 -0
  293. /package/.morph/{standards → framework/standards}/observability/logging.md +0 -0
  294. /package/.morph/{standards → framework/standards}/observability/metrics.md +0 -0
  295. /package/.morph/{standards → framework/standards}/observability/monitoring.md +0 -0
  296. /package/.morph/{standards → framework/standards}/observability/tracing.md +0 -0
  297. /package/.morph/{standards → framework/standards}/workflows/parallel-execution.md +0 -0
  298. /package/.morph/{standards → framework/standards}/workflows/thread-management.md +0 -0
  299. /package/.morph/{templates → framework/templates}/.idea/morph-templates.xml +0 -0
  300. /package/.morph/{templates → framework/templates}/.vscode/morph-templates.code-snippets +0 -0
  301. /package/.morph/{templates → framework/templates}/IDE-SNIPPETS.md +0 -0
  302. /package/.morph/{templates → framework/templates}/code/dotnet/backend/repository.cs +0 -0
  303. /package/.morph/{templates → framework/templates}/code/dotnet/backend/service.cs +0 -0
  304. /package/.morph/{templates → framework/templates}/code/dotnet/contracts/Commands.cs +0 -0
  305. /package/.morph/{templates → framework/templates}/code/dotnet/contracts/Entities.cs +0 -0
  306. /package/.morph/{templates → framework/templates}/code/dotnet/contracts/Queries.cs +0 -0
  307. /package/.morph/{templates → framework/templates}/code/dotnet/contracts/README.md +0 -0
  308. /package/.morph/{templates → framework/templates}/code/dotnet/contracts/api-contracts.cs +0 -0
  309. /package/.morph/{templates → framework/templates}/code/dotnet/contracts/contracts.cs +0 -0
  310. /package/.morph/{templates → framework/templates}/code/dotnet/database/migration.cs +0 -0
  311. /package/.morph/{templates → framework/templates}/code/dotnet/frontend/component.razor +0 -0
  312. /package/.morph/{templates → framework/templates}/code/dotnet/jobs/agent.cs +0 -0
  313. /package/.morph/{templates → framework/templates}/code/dotnet/jobs/job.cs +0 -0
  314. /package/.morph/{templates → framework/templates}/code/dotnet/test.cs +0 -0
  315. /package/.morph/{templates → framework/templates}/code/sql/rls-policy.sql +0 -0
  316. /package/.morph/{templates → framework/templates}/code/sql/supabase-migration.sql +0 -0
  317. /package/.morph/{templates → framework/templates}/code/sql/supabase-migration.template.sql +0 -0
  318. /package/.morph/{templates → framework/templates}/code/typescript/contracts.ts +0 -0
  319. /package/.morph/{templates → framework/templates}/docs/proposal.md +0 -0
  320. /package/.morph/{templates → framework/templates}/examples/design-system-examples.md +0 -0
  321. /package/.morph/{templates → framework/templates}/feature/decisions.md +0 -0
  322. /package/.morph/{templates → framework/templates}/feature/recap.md +0 -0
  323. /package/.morph/{templates → framework/templates}/feature/tasks.md +0 -0
  324. /package/.morph/{templates → framework/templates}/infrastructure/azure/Dockerfile.example +0 -0
  325. /package/.morph/{templates → framework/templates}/infrastructure/azure/README.md +0 -0
  326. /package/.morph/{templates → framework/templates}/infrastructure/azure/app-insights.bicep +0 -0
  327. /package/.morph/{templates → framework/templates}/infrastructure/azure/app-service.bicep +0 -0
  328. /package/.morph/{templates → framework/templates}/infrastructure/azure/container-app-env.bicep +0 -0
  329. /package/.morph/{templates → framework/templates}/infrastructure/azure/container-app.bicep +0 -0
  330. /package/.morph/{templates → framework/templates}/infrastructure/azure/deploy-checklist.md +0 -0
  331. /package/.morph/{templates → framework/templates}/infrastructure/azure/deploy.ps1 +0 -0
  332. /package/.morph/{templates → framework/templates}/infrastructure/azure/deploy.sh +0 -0
  333. /package/.morph/{templates → framework/templates}/infrastructure/azure/key-vault.bicep +0 -0
  334. /package/.morph/{templates → framework/templates}/infrastructure/azure/main.bicep +0 -0
  335. /package/.morph/{templates → framework/templates}/infrastructure/azure/parameters.dev.json +0 -0
  336. /package/.morph/{templates → framework/templates}/infrastructure/azure/parameters.prod.json +0 -0
  337. /package/.morph/{templates → framework/templates}/infrastructure/azure/parameters.staging.json +0 -0
  338. /package/.morph/{templates → framework/templates}/infrastructure/azure/sql-database.bicep +0 -0
  339. /package/.morph/{templates → framework/templates}/infrastructure/azure/storage.bicep +0 -0
  340. /package/.morph/{templates → framework/templates}/infrastructure/docker/Dockerfile.template +0 -0
  341. /package/.morph/{templates → framework/templates}/infrastructure/docker/docker-compose.template.yml +0 -0
  342. /package/.morph/{templates → framework/templates}/infrastructure/docker/dockerfile-api.dockerfile +0 -0
  343. /package/.morph/{templates → framework/templates}/infrastructure/docker/dockerfile-web.dockerfile +0 -0
  344. /package/.morph/{templates → framework/templates}/infrastructure/docker/easypanel.template.json +0 -0
  345. /package/.morph/{templates → framework/templates}/infrastructure/github/actions/azure-auth/action.yml.hbs +0 -0
  346. /package/.morph/{templates → framework/templates}/infrastructure/github/actions/docker-build-push/action.yml.hbs +0 -0
  347. /package/.morph/{templates → framework/templates}/infrastructure/github/actions/health-check/action.yml.hbs +0 -0
  348. /package/.morph/{templates → framework/templates}/infrastructure/github/workflows/deploy-easypanel.yml.hbs +0 -0
  349. /package/.morph/{templates → framework/templates}/infrastructure/github/workflows/docker-build-push.yml.hbs +0 -0
  350. /package/.morph/{templates → framework/templates}/infrastructure/github/workflows/dotnet-build.yml.hbs +0 -0
  351. /package/.morph/{templates → framework/templates}/integrations/asaas-client.cs +0 -0
  352. /package/.morph/{templates → framework/templates}/integrations/asaas-webhook.cs +0 -0
  353. /package/.morph/{templates → framework/templates}/integrations/azure-identity-config.cs +0 -0
  354. /package/.morph/{templates → framework/templates}/integrations/clerk-config.cs +0 -0
  355. /package/.morph/{templates → framework/templates}/meta-prompts/fusion/fusion-agent.md +0 -0
  356. /package/.morph/{templates → framework/templates}/meta-prompts/fusion/fusion-aggregator.md +0 -0
  357. /package/.morph/{templates → framework/templates}/meta-prompts/hops/hop-retry.md +0 -0
  358. /package/.morph/{templates → framework/templates}/meta-prompts/hops/hop-validation.md +0 -0
  359. /package/.morph/{templates → framework/templates}/meta-prompts/hops/hop-wrapper.md +0 -0
  360. /package/.morph/{templates → framework/templates}/meta-prompts/parallel-workers/parallel-coordinator.md +0 -0
  361. /package/.morph/{templates → framework/templates}/meta-prompts/squad-leaders/backend-squad.md +0 -0
  362. /package/.morph/{templates → framework/templates}/meta-prompts/squad-leaders/frontend-squad.md +0 -0
  363. /package/.morph/{templates → framework/templates}/meta-prompts/squad-leaders/squad-leader.md +0 -0
  364. /package/.morph/{templates → framework/templates}/meta-prompts/validators/checkpoint-validator.md +0 -0
  365. /package/.morph/{templates → framework/templates}/saas/subscription.cs +0 -0
  366. /package/.morph/{templates → framework/templates}/saas/tenant.cs +0 -0
  367. /package/.morph/{templates → framework/templates}/state.template.json +0 -0
  368. /package/.morph/{templates → framework/templates}/ui/FluentDesignTheme.cs +0 -0
  369. /package/.morph/{templates → framework/templates}/ui/MudTheme.cs +0 -0
  370. /package/.morph/{templates → framework/templates}/ui/design-system.css +0 -0
  371. /package/framework/hooks/{commit-msg → git/commit-msg}/conventional-commits.sh +0 -0
  372. /package/framework/hooks/{pre-commit → git/pre-commit}/agents.sh +0 -0
  373. /package/framework/hooks/{pre-commit → git/pre-commit}/orchestrator.sh +0 -0
  374. /package/framework/hooks/{pre-commit → git/pre-commit}/specs.sh +0 -0
  375. /package/framework/hooks/{pre-push → git/pre-push}/run-tests.sh +0 -0
@@ -0,0 +1,254 @@
1
+ ---
2
+ name: phase-implement
3
+ description: >
4
+ MORPH-SPEC Phase 5 (Implement). Executes tasks.md task-by-task with checkpoint validation every 3 tasks, producing code and recap.md. Called by /morph-apply.
5
+ argument-hint: "[feature-name]"
6
+ disable-model-invocation: true
7
+ context: fork
8
+ agent: general-purpose
9
+ user-invocable: false
10
+ allowed-tools: Read, Write, Edit, Bash, Glob, Grep
11
+ ---
12
+
13
+ # MORPH Implement - FASE 5
14
+
15
+ > INTERNAL: Workflow skill used by /morph-apply during automated phase orchestration. Not a user command.
16
+
17
+ Implemente as tasks definidas na FASE 4, com checkpoints a cada 3 tasks e recap final.
18
+
19
+ ## Pré-requisitos
20
+
21
+ - [ ] FASE 4 (Tasks) concluída
22
+ - [ ] `tasks.md` ou `tasks.json` aprovado pelo usuário
23
+ - [ ] Tasks gate (`morph-spec approve $ARGUMENTS tasks`) aprovado
24
+ - [ ] Todos os outputs de design existem (spec.md, contracts.cs, decisions.md)
25
+
26
+ ## Ferramentas Recomendadas
27
+
28
+ > **Ref:** `framework/skills/level-0-meta/tool-usage-guide.md` para guia completo.
29
+ > **Ref:** `framework/standards/integration/mcp/mcp-tools.md` para referência MCP.
30
+
31
+ | Ação | Ferramenta | Alternativa |
32
+ |------|------------|-------------|
33
+ | Ler task details | **Read** tasks.json, spec.md, contracts.cs | — |
34
+ | Criar novos arquivos | **Write** source files | — |
35
+ | Modificar arquivos existentes | **Edit** source files | — |
36
+ | Consultar API de biblioteca | **Context7 MCP** `query_docs()` | **WebSearch** + **WebFetch** |
37
+ | Executar migrations | **Supabase MCP** `query()` | **Bash** `npx supabase migration ...` |
38
+ | Build do projeto | **Bash** `dotnet build` ou `npm run build` | — |
39
+ | Rodar testes | **Bash** `dotnet test` ou `npm test` | — |
40
+ | Checkpoint validation | **Bash** `npx morph-spec validate-feature ...` | — |
41
+ | Marcar task concluída | **Bash** `npx morph-spec task done $ARGUMENTS T001` | — |
42
+ | Smoke test no browser | **Playwright MCP** `browser_navigate()` + `browser_snapshot()` | Manual |
43
+ | Verificar erros de console | **Playwright MCP** `browser_console_messages()` | — |
44
+ | Screenshot para recap | **Playwright MCP** `browser_take_screenshot()` | — |
45
+ | Criar PR | **Bash** `gh pr create ...` | **GitHub MCP** `create_pull_request()` |
46
+ | Atualizar state | **Bash** `npx morph-spec state set ...` | — |
47
+
48
+ **MCPs desta fase:** Supabase (migrations, RLS), Context7 (API lookup), Playwright (smoke test), GitHub (PRs).
49
+
50
+ **Anti-padrões:**
51
+ - ❌ Task agent para editar um único arquivo (use Edit direto)
52
+ - ✅ Task agent para implementar service layer em 5+ arquivos (multi-file legítimo)
53
+ - ❌ Bash `cat` para criar arquivos (use Write tool)
54
+ - ❌ Bash `sed` para modificar código (use Edit tool)
55
+ - ❌ Implementar sem ler contracts.cs primeiro (contracts são a fonte de verdade!)
56
+
57
+ ---
58
+
59
+ ## Workflow
60
+
61
+ ### CHECKPOINT DE ENTRADA: Verificar Pré-requisitos
62
+
63
+ **⏸️ Antes de iniciar implementação:**
64
+
65
+ - [ ] `tasks.md` ou `tasks.json` existe e foi aprovado?
66
+ - [ ] Tasks gate aprovado (`morph-spec approve $ARGUMENTS tasks`)?
67
+ - [ ] `spec.md` atualizado com clarificações?
68
+ - [ ] `contracts.cs` corresponde ao schema real?
69
+ - [ ] Build base do projeto compila sem erros?
70
+
71
+ ```bash
72
+ npx morph-spec state get $ARGUMENTS
73
+ npx morph-spec approval-status $ARGUMENTS
74
+ ```
75
+
76
+ **❌ Se alguma checkbox NÃO estiver marcada:**
77
+ → Voltar para a fase correspondente
78
+
79
+ ---
80
+
81
+ ### Passo 1: Carregar Contexto Completo
82
+
83
+ Leia TODOS os outputs antes de implementar:
84
+
85
+ 1. `.morph/features/$ARGUMENTS/3-tasks/tasks.md` — Lista de tasks
86
+ 2. `.morph/features/$ARGUMENTS/1-design/spec.md` — Especificação completa
87
+ 3. `.morph/features/$ARGUMENTS/1-design/contracts.cs` — Interfaces e DTOs
88
+ 4. `.morph/features/$ARGUMENTS/1-design/decisions.md` — ADRs
89
+ 5. `.morph/features/$ARGUMENTS/1-design/schema-analysis.md` — Schema real (se existir)
90
+ 6. `.morph/features/$ARGUMENTS/2-ui/design-system.md` — Design tokens (se existir)
91
+
92
+ ### Passo 2: Iniciar Primeira Task
93
+
94
+ ```bash
95
+ npx morph-spec task next $ARGUMENTS
96
+ npx morph-spec task start $ARGUMENTS T001
97
+ ```
98
+
99
+ Para cada task:
100
+
101
+ 1. **Ler a task description** completa
102
+ 2. **Ler contracts.cs** para DTOs/interfaces relevantes
103
+ 3. **Implementar** usando Write (novo) ou Edit (existente)
104
+ 4. **Verificar** — build, lint, testes
105
+ 5. **Marcar como done:**
106
+ ```bash
107
+ npx morph-spec task done $ARGUMENTS T001
108
+ ```
109
+
110
+ ### Passo 3: Checkpoint a Cada 3 Tasks
111
+
112
+ **A cada 3 tasks completadas:**
113
+
114
+ ```bash
115
+ # Save checkpoint
116
+ npx morph-spec checkpoint-save $ARGUMENTS
117
+
118
+ # Run validation
119
+ npx morph-spec validate-feature $ARGUMENTS --phase implement
120
+ ```
121
+
122
+ **Se validação falhar:**
123
+ 1. NÃO avançar para próxima task
124
+ 2. Corrigir issues reportados
125
+ 3. Re-rodar validação
126
+ 4. Só então prosseguir
127
+
128
+ ### Passo 4: Test-Driven Development (Recomendado)
129
+
130
+ Para cada task de implementação:
131
+
132
+ 1. **Escrever teste primeiro** (unit test para service/domain)
133
+ 2. **Rodar teste** — deve falhar (RED)
134
+ 3. **Implementar** o mínimo para passar
135
+ 4. **Rodar teste** — deve passar (GREEN)
136
+ 5. **Refatorar** se necessário (REFACTOR)
137
+
138
+ ```bash
139
+ # .NET
140
+ dotnet test --filter "FullyQualifiedName~{TestClass}"
141
+
142
+ # Node.js
143
+ npm test -- test/path/to/test.js
144
+ ```
145
+
146
+ ### Passo 5: Smoke Test com Playwright (se UI)
147
+
148
+ Após implementar componentes visuais:
149
+
150
+ ```javascript
151
+ // Navegar para a página
152
+ await mcp__playwright__browser_navigate({ url: 'http://localhost:5000/feature-page' });
153
+
154
+ // Capturar estado da página
155
+ await mcp__playwright__browser_snapshot();
156
+
157
+ // Verificar erros de console
158
+ await mcp__playwright__browser_console_messages({ level: 'error' });
159
+
160
+ // Screenshot para recap
161
+ await mcp__playwright__browser_take_screenshot({ type: 'png' });
162
+ ```
163
+
164
+ ### Passo 6: Gerar `recap.md`
165
+
166
+ Após TODAS as tasks completadas:
167
+
168
+ ```bash
169
+ npx morph-spec generate recap $ARGUMENTS
170
+ ```
171
+
172
+ Ou crie manualmente `.morph/features/$ARGUMENTS/4-implement/recap.md`:
173
+
174
+ ```markdown
175
+ # Recap — {Feature Name}
176
+
177
+ ## Summary
178
+ {1-2 parágrafos descrevendo o que foi implementado}
179
+
180
+ ## Tasks Completed
181
+ - [x] T001: {título}
182
+ - [x] T002: {título}
183
+ - ...
184
+
185
+ ## Key Decisions During Implementation
186
+ - {Decisão 1}: {Razão}
187
+ - {Decisão 2}: {Razão}
188
+
189
+ ## Files Created/Modified
190
+ {Lista de arquivos}
191
+
192
+ ## Tests
193
+ - Unit tests: X passing
194
+ - Integration tests: Y passing
195
+
196
+ ## Validation Results
197
+ {Output do morph-spec validate-feature}
198
+
199
+ ## Screenshots
200
+ {Se UI, incluir screenshots}
201
+ ```
202
+
203
+ ### Passo 7: Atualizar State
204
+
205
+ ```bash
206
+ npx morph-spec state set $ARGUMENTS phase implement
207
+ npx morph-spec state set $ARGUMENTS status done
208
+ npx morph-spec state mark-output $ARGUMENTS recap
209
+ ```
210
+
211
+ ---
212
+
213
+ ## Integração com Superpowers
214
+
215
+ > Disponível quando o plugin `superpowers` está instalado.
216
+
217
+ | Skill | Quando Usar | Invocação |
218
+ |-------|-------------|-----------|
219
+ | `test-driven-development` | Para cada task de implementação | `Skill(superpowers:test-driven-development)` |
220
+ | `systematic-debugging` | Quando testes falham ou erros inesperados | `Skill(superpowers:systematic-debugging)` |
221
+ | `requesting-code-review` | Após implementação completa | `Skill(superpowers:requesting-code-review)` |
222
+ | `verification-before-completion` | Antes de marcar feature como done | Use `verification-before-completion` (morph-spec version) |
223
+
224
+ ---
225
+
226
+ ## Outputs Gerados
227
+
228
+ - Código fonte implementado (vários arquivos)
229
+ - Testes unitários e de integração
230
+ - `.morph/features/$ARGUMENTS/4-implement/recap.md` — Resumo da implementação
231
+
232
+ ## Critérios de Conclusão
233
+
234
+ - [x] Todas as tasks completadas
235
+ - [x] Build compila sem erros
236
+ - [x] Testes passando
237
+ - [x] Validation pipeline passa
238
+ - [x] `recap.md` gerado
239
+ - [x] State atualizado para `status: done`
240
+ - [x] Checkpoints salvos a cada 3 tasks
241
+
242
+ ---
243
+
244
+ ## Outputs desta Fase
245
+
246
+ <!-- morph:outputs:implement -->
247
+ | Output | Caminho |
248
+ |--------|---------|
249
+ | `recap` | `.morph/features/{feature}/4-implement/recap.md` |
250
+ <!-- /morph:outputs -->
251
+
252
+ ---
253
+
254
+ Feature completa! Considere criar um PR e rodar `morph-spec session-summary $ARGUMENTS`.
@@ -1,3 +1,12 @@
1
+ ---
2
+ name: phase-setup
3
+ description: >
4
+ MORPH-SPEC Phase 1 (Setup). Reads project context, identifies the stack, activates relevant agents, and creates the feature folder structure. Called at the start of every feature.
5
+ argument-hint: "[feature-name]"
6
+ user-invocable: false
7
+ allowed-tools: Read, Write, Edit, Bash, Glob, Grep
8
+ ---
9
+
1
10
  # MORPH Setup - FASE 1
2
11
 
3
12
  > INTERNAL: Workflow skill used by /morph-proposal during automated phase orchestration. Not a user command.
@@ -10,14 +19,51 @@ Inicialize o contexto e prepare o ambiente para uma feature aprovada.
10
19
  - [ ] Proposal foi aprovado pelo usuário
11
20
  - [ ] Agentes foram detectados e registrados no state
12
21
 
22
+ ## Ferramentas Recomendadas
23
+
24
+ > **Ref:** `framework/skills/level-0-meta/tool-usage-guide.md` para guia completo.
25
+ > **Ref:** `framework/standards/integration/mcp/mcp-tools.md` para referência MCP.
26
+
27
+ | Ação | Ferramenta | Alternativa |
28
+ |------|------------|-------------|
29
+ | Verificar state | **Bash** `npx morph-spec state get` | — |
30
+ | Detectar agentes + standards | **Bash** `npx morph-spec detect-agents --json` | — |
31
+ | Ler contexto do projeto | **Read** `.morph/context/README.md` | — |
32
+ | Ler config | **Read** `.morph/config.json` | — |
33
+ | Escanear estrutura do projeto | **Glob** `src/**/*.{ts,tsx,cs}` | — |
34
+ | Metadata do repositório | **GitHub MCP** `get_repo()` | **Bash** `gh repo view --json` |
35
+ | Atualizar state | **Bash** `npx morph-spec state set` | — |
36
+
37
+ **MCPs desta fase:** GitHub (opcional — metadata do repo).
38
+
39
+ **Anti-padrões:**
40
+ - ❌ Task agent para detectar stack (detect-agents CLI já faz isso)
41
+ - ❌ WebSearch para info local do projeto (use Read/Glob)
42
+ - ❌ Ler agents.json manualmente (detect-agents retorna standards processados)
43
+
44
+ ---
45
+
13
46
  ## Workflow
14
47
 
48
+ ### CHECKPOINT DE ENTRADA: Verificar Pré-requisitos
49
+
50
+ **⏸️ Antes de prosseguir com setup:**
51
+
52
+ - [ ] `proposal.md` existe em `.morph/features/$ARGUMENTS/`?
53
+ - [ ] Proposal foi apresentado e aprovado pelo usuário?
54
+ - [ ] Feature foi registrada no state?
55
+
56
+ **❌ Se alguma checkbox NÃO estiver marcada:**
57
+ → Voltar para FASE 0 (Proposal)
58
+
59
+ ---
60
+
15
61
  ### Passo 1: Verificar State
16
62
 
17
63
  Confirme que a feature existe no state:
18
64
 
19
65
  ```bash
20
- npx morph-spec state get {feature-name}
66
+ npx morph-spec state get $ARGUMENTS
21
67
  ```
22
68
 
23
69
  Se não existir, volte para FASE 0 (proposal).
@@ -45,13 +91,13 @@ O output JSON contém `standardsSummary` com todos os standards relevantes para
45
91
  ```
46
92
 
47
93
  **Standards resolution order** (automático):
48
- 1. `.morph/project/standards/*.md` (project overrides - highest priority)
49
- 2. `.morph/standards/*.md` (AI Agent Framework, Azure)
94
+ 1. `.morph/context/*.md` (project overrides - highest priority)
95
+ 2. `.morph/framework/standards/*.md` (AI Agent Framework, Azure)
50
96
  3. `framework/standards/*.md` (Blazor, CSS, .NET)
51
- 4. `.morph/project/standards/inferred.md` (always loaded if exists)
97
+ 4. `.morph/context/inferred.md` (always loaded if exists)
52
98
 
53
99
  **Contexto geral** (leia manualmente):
54
- - `.morph/project/context/README.md` - Overview do projeto
100
+ - `.morph/context/README.md` - Overview do projeto
55
101
  - `.morph/config.json` - Configurações
56
102
 
57
103
  ### Passo 3: Confirmar Stack
@@ -66,18 +112,18 @@ Baseado no proposal e contexto, confirme:
66
112
  Mostre os agentes detectados no proposal:
67
113
 
68
114
  ```bash
69
- npx morph-spec state get {feature-name}
115
+ npx morph-spec state get $ARGUMENTS
70
116
  ```
71
117
 
72
- Parse o JSON e liste os `activeAgents` com seus emojis e responsabilidades (consulte `.morph/config/agents.json`).
118
+ Parse o JSON e liste os `activeAgents` com seus emojis e responsabilidades (consulte `.morph/framework/agents.json`).
73
119
 
74
120
  ### Passo 5: Atualizar State
75
121
 
76
122
  Marque a feature como na fase SETUP:
77
123
 
78
124
  ```bash
79
- npx morph-spec state set {feature-name} phase setup
80
- npx morph-spec state set {feature-name} status in_progress
125
+ npx morph-spec state set $ARGUMENTS phase setup
126
+ npx morph-spec state set $ARGUMENTS status in_progress
81
127
  ```
82
128
 
83
129
  ## Outputs
@@ -103,4 +149,24 @@ npx morph-spec state set {feature-name} status in_progress
103
149
 
104
150
  ---
105
151
 
106
- Continuar automaticamente para próxima fase (UI/UX se detectado, ou Design).
152
+ ## Integração com Superpowers
153
+
154
+ > Disponível quando o plugin `superpowers` está instalado.
155
+
156
+ | Skill | Quando Usar | Invocação |
157
+ |-------|-------------|-----------|
158
+ | `using-git-worktrees` | Se feature requer isolamento do workspace | `Skill(superpowers:using-git-worktrees)` |
159
+
160
+ ---
161
+
162
+ ## Outputs desta Fase
163
+
164
+ <!-- morph:outputs:proposal -->
165
+ | Output | Caminho |
166
+ |--------|---------|
167
+ | `proposal` | `.morph/features/{feature}/0-proposal/proposal.md` |
168
+ <!-- /morph:outputs -->
169
+
170
+ ---
171
+
172
+ Continuar automaticamente para próxima fase (UI/UX se detectado, ou Design).
@@ -1,3 +1,13 @@
1
+ ---
2
+ name: phase-tasks
3
+ description: >
4
+ MORPH-SPEC Phase 4 (Tasks). Breaks the approved design into ordered implementation tasks with dependencies and checkpoints, producing tasks.md. Called after clarifications resolve.
5
+ argument-hint: "[feature-name]"
6
+ disable-model-invocation: true
7
+ user-invocable: false
8
+ allowed-tools: Read, Write, Edit, Bash, Glob, Grep
9
+ ---
10
+
1
11
  # MORPH Tasks - FASE 4
2
12
 
3
13
  > INTERNAL: Workflow skill used by /morph-proposal during automated phase orchestration. Not a user command.
@@ -10,11 +20,61 @@ Quebre a especificação em tasks executáveis, defina ordem de execução e est
10
20
  - [ ] `spec.md` atualizado com clarificações
11
21
  - [ ] Todos os edge cases documentados
12
22
 
23
+ ## Ferramentas Recomendadas
24
+
25
+ > **Ref:** `framework/skills/level-0-meta/tool-usage-guide.md` para guia completo.
26
+ > **Ref:** `framework/standards/integration/mcp/mcp-tools.md` para referência MCP.
27
+
28
+ | Ação | Ferramenta | Alternativa |
29
+ |------|------------|-------------|
30
+ | Ler spec + contracts + decisions | **Read** todos os outputs | — |
31
+ | Analisar complexidade de implementação | **Grep** padrões no código existente | — |
32
+ | Contar padrões similares existentes | **Glob** `**/Services/**/*.cs` | — |
33
+ | Consultar padrões de implementação | **Context7 MCP** `query_docs()` | **WebSearch** |
34
+ | Criar issues no GitHub a partir das tasks | **GitHub MCP** `create_issue()` | **Bash** `gh issue create ...` |
35
+ | Renderizar template de tasks | **Bash** `npx morph-spec template render docs/tasks ...` | — |
36
+ | Atualizar state com total de tasks | **Bash** `npx morph-spec state set ... tasks.total N` | — |
37
+
38
+ **MCPs desta fase:** Context7 (estimar complexidade), GitHub (criar issues).
39
+
40
+ **Anti-padrões:**
41
+ - ❌ Task agent para quebrar spec simples (faça diretamente)
42
+ - ✅ Task agent para specs complexos com 50+ requisitos (análise legítima multi-step)
43
+ - ❌ Criar tasks.json sem ler todos os outputs primeiro
44
+
45
+ ---
46
+
13
47
  ## Workflow
14
48
 
49
+ ### CHECKPOINT DE ENTRADA: Verificar Pré-requisitos
50
+
51
+ **⏸️ PAUSE - Antes de iniciar o breakdown de tasks:**
52
+
53
+ - [ ] `spec.md` existe e foi aprovado pelo usuário?
54
+ - [ ] `contracts.cs` existe e corresponde ao schema real?
55
+ - [ ] `schema-analysis.md` foi validado (se aplicável)?
56
+ - [ ] `decisions.md` contém ADRs para todas as escolhas críticas?
57
+ - [ ] Design gate (`morph-spec approve $ARGUMENTS design`) foi aprovado?
58
+ - [ ] Clarificações (FASE 3) foram resolvidas e spec atualizado?
59
+
60
+ **❌ Se alguma checkbox NÃO estiver marcada:**
61
+ → Voltar para a fase correspondente e resolver
62
+
63
+ **✅ Se TODAS as checkboxes estiverem marcadas:**
64
+ → Prosseguir para análise e breakdown
65
+
66
+ ```bash
67
+ # Verificar estado atual:
68
+ npx morph-spec state get $ARGUMENTS
69
+ # Verificar se design foi aprovado:
70
+ npx morph-spec approval get $ARGUMENTS design
71
+ ```
72
+
73
+ ---
74
+
15
75
  ### Passo 1: Analisar Spec
16
76
 
17
- Leia `.morph/project/outputs/{feature}/spec.md` e identifique:
77
+ Leia `.morph/features/$ARGUMENTS/1-design/spec.md` e identifique:
18
78
 
19
79
  1. **Requisitos funcionais** (FR001, FR002, ...)
20
80
  2. **Componentes técnicos** (Entities, Services, Controllers, Pages)
@@ -121,7 +181,7 @@ Para cada task, estime tempo em minutos:
121
181
 
122
182
  ### Passo 6: Gerar `tasks.json`
123
183
 
124
- Crie `.morph/project/outputs/{feature}/tasks.json` com a estrutura completa de tasks, checkpoints e estimativas.
184
+ Crie `.morph/features/$ARGUMENTS/3-tasks/tasks.md` com a estrutura completa de tasks, checkpoints e estimativas.
125
185
 
126
186
  ### Passo 7: Incluir Tasks de IaC (se necessário)
127
187
 
@@ -130,14 +190,14 @@ Se houver recursos Azure, adicionar tasks de Bicep e migrations.
130
190
  ### Passo 8: Atualizar State
131
191
 
132
192
  ```bash
133
- npx morph-spec state set {feature-name} phase tasks
134
- npx morph-spec state set {feature-name} tasks.total {N}
135
- npx morph-spec state mark-output {feature-name} tasks
193
+ npx morph-spec state set $ARGUMENTS phase tasks
194
+ npx morph-spec state set $ARGUMENTS tasks.total {N}
195
+ npx morph-spec state mark-output $ARGUMENTS tasks
136
196
  ```
137
197
 
138
198
  ## Outputs Gerados
139
199
 
140
- - `.morph/project/outputs/{feature}/tasks.json` - Breakdown completo de tasks
200
+ - `.morph/features/$ARGUMENTS/3-tasks/tasks.md` - Breakdown completo de tasks
141
201
 
142
202
  ## PAUSA OBRIGATÓRIA
143
203
 
@@ -161,4 +221,25 @@ Apresente ao usuário 3 ações sugeridas:
161
221
 
162
222
  ---
163
223
 
164
- Após aprovação: "Planejamento completo! Execute `/morph-apply {feature}` para iniciar implementação."
224
+ ## Integração com Superpowers
225
+
226
+ > Disponível quando o plugin `superpowers` está instalado.
227
+
228
+ | Skill | Quando Usar | Invocação |
229
+ |-------|-------------|-----------|
230
+ | `writing-plans` | Após breakdown de tasks, para planejar sequência de implementação | `Skill(superpowers:writing-plans)` |
231
+ | `executing-plans` | Para executar o plano de tasks em sessão separada | `Skill(superpowers:executing-plans)` |
232
+
233
+ ---
234
+
235
+ ## Outputs desta Fase
236
+
237
+ <!-- morph:outputs:tasks -->
238
+ | Output | Caminho |
239
+ |--------|---------|
240
+ | `tasks` | `.morph/features/{feature}/3-tasks/tasks.md` |
241
+ <!-- /morph:outputs -->
242
+
243
+ ---
244
+
245
+ Após aprovação: "Planejamento completo! Execute `/morph-apply $ARGUMENTS` para iniciar implementação."
@@ -1,3 +1,12 @@
1
+ ---
2
+ name: phase-uiux
3
+ description: >
4
+ MORPH-SPEC Phase 1.5 (UI/UX). Creates design-system.md, mockups.md, components.md, and flows.md before technical spec. Auto-activates for features with UI keywords.
5
+ argument-hint: "[feature-name]"
6
+ user-invocable: false
7
+ allowed-tools: Read, Write, Edit, Bash, Glob, Grep
8
+ ---
9
+
1
10
  # MORPH UI/UX Design - FASE 1.5
2
11
 
3
12
  > INTERNAL: Workflow skill used by /morph-proposal during automated phase orchestration. Not a user command.
@@ -10,6 +19,36 @@ Fase condicional para features com front-end. Coleta requisitos de UI/UX, gera w
10
19
  - [ ] Feature tem keywords de UI detectadas (blazor, ui, component, page, dashboard, wizard, form, chart)
11
20
  - [ ] `uiux-designer` agent ativado
12
21
 
22
+ ## Ferramentas Recomendadas
23
+
24
+ > **Ref:** `framework/skills/level-0-meta/tool-usage-guide.md` para guia completo.
25
+ > **Ref:** `framework/standards/integration/mcp/mcp-tools.md` para referência MCP.
26
+
27
+ | Ação | Ferramenta | Alternativa |
28
+ |------|------------|-------------|
29
+ | Verificar design system existente | **Read** `.morph/context/design-system.md` | — |
30
+ | Ler screenshots do usuário | **Read** (arquivo de imagem) | — |
31
+ | Buscar variáveis CSS existentes | **Grep** `--root:` em `*.css,*.scss` | — |
32
+ | Encontrar componentes existentes | **Glob** `**/Components/**/*.razor` ou `**/components/**/*.tsx` | — |
33
+ | Extrair design tokens do Figma | **Figma MCP** `get_file({ fileKey })` | Read CSS/SCSS variables |
34
+ | Documentação de componentes UI | **Context7 MCP** `query_docs({ libraryId, query })` | **WebSearch** + **WebFetch** |
35
+ | Preview de página existente | **Playwright MCP** `browser_navigate()` + `browser_take_screenshot()` | **WebFetch** URL |
36
+ | Inspecionar estrutura da página | **Playwright MCP** `browser_snapshot()` | **WebFetch** + parse manual |
37
+ | Testar layout responsivo | **Playwright MCP** `browser_resize()` + `browser_take_screenshot()` | Manual testing |
38
+ | Referências de design externas | **WebSearch** + **WebFetch** | — |
39
+ | Renderizar templates UI | **Bash** `npx morph-spec template render docs/ui-mockups ...` | — |
40
+ | Gerar design system de CSS existente | **Bash** `npx morph-spec generate design-system --scan` | — |
41
+ | Atualizar state | **Bash** `npx morph-spec state mark-output ...` | — |
42
+
43
+ **MCPs desta fase:** Figma (design tokens), Playwright (preview, inspeção, responsividade), Context7 (docs de componentes).
44
+
45
+ **Anti-padrões:**
46
+ - ❌ WebSearch para docs MudBlazor (use Context7 MCP — mais preciso)
47
+ - ❌ Task agent para ler um screenshot (use Read direto na imagem)
48
+ - ❌ Adivinhar props de componentes (use Context7 para API real)
49
+
50
+ ---
51
+
13
52
  ## Workflow
14
53
 
15
54
  ### Passo 0: Verificar Design System Existe
@@ -27,8 +66,8 @@ Se nenhum design system for detectado (verificar output):
27
66
  - Você pode gerar manualmente agora: `npx morph-spec generate design-system`
28
67
 
29
68
  2. **Opção B - Criar manualmente:**
30
- - Crie `.morph/project/design-system.md` (project-level, compartilhado)
31
- - Ou `.morph/project/outputs/{feature}/ui-design-system.md` (feature-specific)
69
+ - Crie `.morph/context/design-system.md` (project-level, compartilhado)
70
+ - Ou `.morph/features/$ARGUMENTS/2-ui/design-system.md` (feature-specific)
32
71
 
33
72
  3. **Opção C - Scan existing CSS:**
34
73
  - Se o projeto já tem CSS com variáveis: `npx morph-spec generate design-system --scan`
@@ -43,7 +82,7 @@ Se nenhum design system for detectado (verificar output):
43
82
  Verifique se agentes ativos incluem `uiux-designer`:
44
83
 
45
84
  ```bash
46
- npx morph-spec state get {feature-name}
85
+ npx morph-spec state get $ARGUMENTS
47
86
  ```
48
87
 
49
88
  Se `uiux-designer` NÃO estiver nos `activeAgents`, pule esta fase e continue para FASE 2 (Design).
@@ -77,12 +116,14 @@ Escolha entre **Fluent UI Blazor** (recomendado para AI-first) ou **MudBlazor**
77
116
 
78
117
  ### Passo 4: Gerar Deliverables
79
118
 
80
- Crie os seguintes arquivos em `.morph/project/outputs/{feature}/`:
119
+ Crie os seguintes arquivos em `.morph/features/$ARGUMENTS/`:
120
+
121
+ > **Use templates:** Utilize `npx morph-spec template render` para gerar os arquivos a partir dos templates em `.morph/framework/templates/docs/`. Templates disponíveis: `ui-design-system`, `ui-mockups`, `ui-components`, `ui-flows`.
81
122
 
82
123
  #### 4.1. `ui-design-system.md`
83
124
 
84
- **Se design system project-level existe (`.morph/project/design-system.md`):**
85
- - Referencie-o nos specs: "Uses project design system at .morph/project/design-system.md"
125
+ **Se design system project-level existe (`.morph/context/design-system.md`):**
126
+ - Referencie-o nos specs: "Uses project design system at .morph/context/design-system.md"
86
127
  - Crie `ui-design-system.md` apenas se houver cores/componentes **específicos** da feature
87
128
 
88
129
  **Se não existe:**
@@ -116,6 +157,24 @@ Fluxos de usuário completos:
116
157
  - Edge cases (o que acontece se...?)
117
158
  - Validações e feedback
118
159
 
160
+ ### CHECKPOINT: Validar Deliverables UI
161
+
162
+ **⏸️ PAUSE - Antes de prosseguir para acessibilidade:**
163
+
164
+ - [ ] Design system definido (project-level ou feature-level)?
165
+ - [ ] Wireframes cobrem TODOS os estados (loading, error, empty, success)?
166
+ - [ ] Componentes especificados com props reais da biblioteca UI escolhida?
167
+ - [ ] Fluxos de usuário completos com edge cases?
168
+ - [ ] Biblioteca UI escolhida documentada como ADR em `decisions.md`?
169
+
170
+ **❌ Se alguma checkbox NÃO estiver marcada:**
171
+ → Voltar e completar o deliverable faltante
172
+
173
+ **✅ Se TODAS as checkboxes estiverem marcadas:**
174
+ → Prosseguir para validação de acessibilidade
175
+
176
+ ---
177
+
119
178
  ### Passo 5: Validar Acessibilidade e Responsividade
120
179
 
121
180
  Documente nos arquivos UI:
@@ -131,20 +190,26 @@ Documente nos arquivos UI:
131
190
  ### Passo 6: Atualizar State
132
191
 
133
192
  ```bash
134
- npx morph-spec state set {feature-name} phase uiux-design
135
- npx morph-spec state mark-output {feature-name} ui-design-system
136
- npx morph-spec state mark-output {feature-name} ui-mockups
137
- npx morph-spec state mark-output {feature-name} ui-components
138
- npx morph-spec state mark-output {feature-name} ui-flows
193
+ npx morph-spec state set $ARGUMENTS phase uiux-design
194
+ npx morph-spec state mark-output $ARGUMENTS ui-design-system
195
+ npx morph-spec state mark-output $ARGUMENTS ui-mockups
196
+ npx morph-spec state mark-output $ARGUMENTS ui-components
197
+ npx morph-spec state mark-output $ARGUMENTS ui-flows
139
198
  ```
140
199
 
200
+ > **Nota sobre formatos:** Os comandos `mark-output` aceitam TANTO kebab-case (`ui-design-system`)
201
+ > QUANTO camelCase (`uiDesignSystem`). Ambos os formatos funcionam igualmente! Use o que for mais
202
+ > confortável para você. Exemplos:
203
+ > - `npx morph-spec state mark-output my-feature uiDesignSystem` ✅
204
+ > - `npx morph-spec state mark-output my-feature ui-design-system` ✅
205
+
141
206
  ## Outputs Gerados
142
207
 
143
- - `.morph/project/outputs/{feature}/ui-design-system.md`
144
- - `.morph/project/outputs/{feature}/ui-mockups.md`
145
- - `.morph/project/outputs/{feature}/ui-components.md`
146
- - `.morph/project/outputs/{feature}/ui-flows.md`
147
- - `.morph/project/outputs/{feature}/decisions.md` (atualizado com ADR UI library)
208
+ - `.morph/features/$ARGUMENTS/2-ui/design-system.md`
209
+ - `.morph/features/$ARGUMENTS/2-ui/mockups.md`
210
+ - `.morph/features/$ARGUMENTS/2-ui/components.md`
211
+ - `.morph/features/$ARGUMENTS/2-ui/flows.md`
212
+ - `.morph/features/$ARGUMENTS/1-design/decisions.md` (atualizado com ADR UI library)
148
213
 
149
214
  ## PAUSA OBRIGATÓRIA
150
215
 
@@ -166,4 +231,17 @@ Apresente ao usuário 3 ações sugeridas:
166
231
 
167
232
  ---
168
233
 
169
- Continuar automaticamente para FASE 2 (Design) após aprovação.
234
+ ## Outputs desta Fase
235
+
236
+ <!-- morph:outputs:uiux -->
237
+ | Output | Caminho |
238
+ |--------|---------|
239
+ | `uiDesignSystem` | `.morph/features/{feature}/2-ui/design-system.md` |
240
+ | `uiMockups` | `.morph/features/{feature}/2-ui/mockups.md` |
241
+ | `uiComponents` | `.morph/features/{feature}/2-ui/components.md` |
242
+ | `uiFlows` | `.morph/features/{feature}/2-ui/flows.md` |
243
+ <!-- /morph:outputs -->
244
+
245
+ ---
246
+
247
+ Continuar automaticamente para FASE 2 (Design) após aprovação.