@polymorphism-tech/morph-spec 4.5.0 → 4.7.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 (292) hide show
  1. package/CLAUDE.md +77 -56
  2. package/README.md +394 -700
  3. package/docs/ARCHITECTURE.md +331 -0
  4. package/docs/CHEATSHEET.md +221 -0
  5. package/docs/COMMAND-FLOWS.md +368 -0
  6. package/docs/QUICKSTART.md +212 -0
  7. package/docs/examples/order-management/contracts.cs +84 -0
  8. package/docs/examples/order-management/proposal.md +24 -0
  9. package/docs/examples/order-management/spec.md +162 -0
  10. package/docs/plans/2026-02-23-ddd-architecture-refactor.md +1153 -0
  11. package/docs/plans/2026-02-23-ddd-nextsteps.md +682 -0
  12. package/docs/plans/2026-02-23-infra-architect-refactor.md +437 -0
  13. package/docs/plans/2026-02-23-nextjs-code-review-design.md +156 -0
  14. package/docs/plans/2026-02-23-nextjs-code-review-impl.md +1254 -0
  15. package/docs/plans/2026-02-23-nextjs-standards-design.md +149 -0
  16. package/docs/plans/2026-02-23-nextjs-standards-impl.md +1846 -0
  17. package/framework/{skills/level-2-domains → agents}/README.md +14 -14
  18. package/framework/{skills/level-2-domains → agents}/ai-agents/ai-system-architect.md +1 -4
  19. package/framework/{skills/level-2-domains → agents}/architecture/po-pm-advisor.md +1 -2
  20. package/framework/{skills/level-2-domains → agents}/architecture/prompt-engineer.md +1 -2
  21. package/framework/{skills/level-2-domains → agents}/architecture/seo-growth-hacker.md +1 -2
  22. package/framework/{skills/level-2-domains → agents}/architecture/standards-architect.md +159 -162
  23. package/framework/agents/backend/api-designer.md +103 -0
  24. package/framework/{skills/level-2-domains → agents}/backend/dotnet-senior.md +1 -2
  25. package/framework/agents/backend/ef-modeler.md +119 -0
  26. package/framework/{skills/level-2-domains → agents}/backend/hangfire-orchestrator.md +1 -4
  27. package/framework/{skills/level-2-domains → agents}/backend/ms-agent-expert.md +1 -4
  28. package/framework/{skills/level-2-domains → agents}/frontend/blazor-builder.md +1 -4
  29. package/framework/agents/frontend/nextjs-expert.md +118 -0
  30. package/framework/{skills/level-2-domains → agents}/frontend/ui-ux-designer.md +1 -2
  31. package/framework/{skills/level-2-domains → agents}/infrastructure/azure-architect.md +147 -148
  32. package/framework/{skills/level-2-domains → agents}/infrastructure/azure-deploy-specialist.md +1 -2
  33. package/framework/{skills/level-2-domains → agents}/infrastructure/bicep-architect.md +1 -4
  34. package/framework/{skills/level-2-domains → agents}/infrastructure/container-specialist.md +1 -4
  35. package/framework/{skills/level-2-domains → agents}/infrastructure/devops-engineer.md +1 -4
  36. package/framework/agents/infrastructure/infra-architect.md +45 -0
  37. package/framework/{skills/level-2-domains → agents}/integrations/asaas-financial.md +1 -4
  38. package/framework/{skills/level-2-domains → agents}/integrations/azure-identity.md +1 -4
  39. package/framework/{skills/level-2-domains → agents}/integrations/clerk-auth.md +1 -4
  40. package/framework/{skills/level-2-domains → agents}/integrations/hangfire-integration.md +1 -2
  41. package/framework/{skills/level-2-domains → agents}/integrations/resend-email.md +1 -4
  42. package/framework/{skills/level-2-domains → agents}/quality/code-analyzer.md +1 -4
  43. package/framework/{skills/level-2-domains → agents}/quality/testing-specialist.md +1 -4
  44. package/framework/agents.json +1145 -278
  45. package/framework/hooks/claude-code/statusline.py +384 -85
  46. package/framework/hooks/shared/phase-utils.js +129 -129
  47. package/framework/rules/frontend-standards.md +0 -3
  48. package/framework/rules/nextjs-standards.md +17 -0
  49. package/framework/skills/README.md +66 -0
  50. package/framework/skills/level-0-meta/{brainstorming.md → brainstorming/SKILL.md} +3 -1
  51. package/framework/skills/level-0-meta/brainstorming/references/proposal-example.md +138 -0
  52. package/framework/skills/level-0-meta/{code-review.md → code-review/SKILL.md} +3 -2
  53. package/framework/skills/level-0-meta/code-review/references/review-example.md +164 -0
  54. package/framework/skills/level-0-meta/code-review/scripts/scan-csharp.mjs +121 -0
  55. package/framework/skills/level-0-meta/code-review-nextjs/SKILL.md +147 -0
  56. package/framework/skills/level-0-meta/code-review-nextjs/references/review-example-nextjs.md +254 -0
  57. package/framework/skills/level-0-meta/{morph-checklist.md → morph-checklist/SKILL.md} +2 -5
  58. package/framework/skills/{level-1-workflows/morph-replicate.md → level-0-meta/morph-replicate/SKILL.md} +6 -7
  59. package/framework/skills/level-0-meta/{simulation-checklist.md → simulation-checklist/SKILL.md} +3 -6
  60. package/framework/skills/level-0-meta/{tool-usage-guide.md → tool-usage-guide/SKILL.md} +4 -5
  61. package/framework/skills/level-0-meta/{verification-before-completion.md → verification-before-completion/SKILL.md} +3 -1
  62. package/framework/skills/level-0-meta/verification-before-completion/scripts/check-phase-outputs.mjs +110 -0
  63. package/framework/skills/level-1-workflows/{phase-clarify.md → phase-clarify/SKILL.md} +3 -3
  64. package/framework/skills/level-1-workflows/phase-clarify/references/clarifications-example.md +117 -0
  65. package/framework/skills/level-1-workflows/{phase-codebase-analysis.md → phase-codebase-analysis/SKILL.md} +2 -3
  66. package/framework/skills/level-1-workflows/{phase-design.md → phase-design/SKILL.md} +46 -182
  67. package/framework/skills/level-1-workflows/phase-design/references/spec-example.md +253 -0
  68. package/framework/skills/level-1-workflows/{phase-implement.md → phase-implement/SKILL.md} +3 -3
  69. package/framework/skills/level-1-workflows/phase-implement/references/recap-example.md +132 -0
  70. package/framework/skills/level-1-workflows/{phase-setup.md → phase-setup/SKILL.md} +2 -3
  71. package/framework/skills/level-1-workflows/{phase-tasks.md → phase-tasks/SKILL.md} +42 -3
  72. package/framework/skills/level-1-workflows/phase-tasks/references/tasks-example.md +231 -0
  73. package/framework/skills/level-1-workflows/phase-tasks/scripts/validate-tasks.mjs +112 -0
  74. package/framework/skills/level-1-workflows/{phase-uiux.md → phase-uiux/SKILL.md} +2 -3
  75. package/framework/standards/STANDARDS.json +121 -0
  76. package/framework/standards/architecture/ddd/bounded-contexts.md +105 -0
  77. package/framework/standards/architecture/ddd/complexity-levels.md +108 -0
  78. package/framework/standards/architecture/ddd/ubiquitous-language.md +58 -0
  79. package/framework/standards/frontend/nextjs/app-router.md +123 -0
  80. package/framework/standards/frontend/nextjs/components.md +132 -0
  81. package/framework/standards/frontend/nextjs/data-fetching.md +126 -0
  82. package/framework/standards/frontend/nextjs/forms.md +128 -0
  83. package/framework/standards/frontend/nextjs/naming-conventions.md +67 -0
  84. package/framework/standards/frontend/nextjs/project-structure.md +102 -0
  85. package/framework/standards/frontend/nextjs/state-management.md +72 -0
  86. package/framework/standards/frontend/nextjs/testing.md +111 -0
  87. package/framework/templates/REGISTRY.json +538 -142
  88. package/framework/templates/code/dotnet/contracts/contracts-level1.cs +69 -0
  89. package/framework/templates/code/dotnet/contracts/contracts-level2.cs +86 -0
  90. package/framework/templates/code/dotnet/contracts/contracts-level3.cs +41 -0
  91. package/framework/templates/docs/spec.md +49 -0
  92. package/framework/templates/frontend/nextjs/Dockerfile.nextjs.hbs +43 -0
  93. package/framework/templates/frontend/nextjs/client-component.tsx.hbs +26 -0
  94. package/framework/templates/frontend/nextjs/env.mjs.hbs +32 -0
  95. package/framework/templates/frontend/nextjs/feature-form.tsx.hbs +56 -0
  96. package/framework/templates/frontend/nextjs/page.tsx.hbs +22 -0
  97. package/framework/templates/frontend/nextjs/tsconfig.json.hbs +26 -0
  98. package/framework/templates/frontend/nextjs/use-feature.ts.hbs +54 -0
  99. package/framework/templates/project-structure/dotnet-ddd.md +70 -0
  100. package/framework/workflows/docs/enforcement-pipeline.md +2 -1
  101. package/package.json +1 -1
  102. package/scripts/scan-nextjs.mjs +169 -0
  103. package/src/commands/project/doctor.js +52 -1
  104. package/src/commands/project/init.js +19 -65
  105. package/src/commands/project/update.js +7 -63
  106. package/src/lib/detectors/claude-config-detector.js +1 -3
  107. package/src/lib/standards/standards-context-injector.js +5 -0
  108. package/src/lib/validators/nextjs/index.js +6 -0
  109. package/src/lib/validators/nextjs/next-component-validator.js +181 -0
  110. package/src/lib/validators/validation-runner.js +5 -0
  111. package/src/utils/agents-installer.js +16 -4
  112. package/src/utils/skills-installer.js +59 -15
  113. package/.morph/.morphversion +0 -5
  114. package/.morph/analytics/threads-log.jsonl +0 -44
  115. package/.morph/config/config.json +0 -8
  116. package/.morph/context/README.md +0 -17
  117. package/.morph/framework/agents.json +0 -948
  118. package/.morph/framework/standards/STANDARDS.json +0 -812
  119. package/.morph/framework/standards/ai-agents/blazor-ui.md +0 -364
  120. package/.morph/framework/standards/ai-agents/production.md +0 -415
  121. package/.morph/framework/standards/ai-agents/setup.md +0 -418
  122. package/.morph/framework/standards/ai-agents/team-orchestration.md +0 -479
  123. package/.morph/framework/standards/ai-agents/workflows.md +0 -354
  124. package/.morph/framework/standards/architecture/ddd/aggregates.md +0 -120
  125. package/.morph/framework/standards/architecture/ddd/entities.md +0 -99
  126. package/.morph/framework/standards/architecture/ddd/value-objects.md +0 -124
  127. package/.morph/framework/standards/backend/api/minimal-api.md +0 -494
  128. package/.morph/framework/standards/backend/api/rest.md +0 -492
  129. package/.morph/framework/standards/backend/api/validation.md +0 -88
  130. package/.morph/framework/standards/backend/authentication/passkeys.md +0 -428
  131. package/.morph/framework/standards/backend/database/ef-core.md +0 -199
  132. package/.morph/framework/standards/backend/database/migrations.md +0 -393
  133. package/.morph/framework/standards/backend/database/postgresql/database.md +0 -352
  134. package/.morph/framework/standards/backend/database/repository-patterns.md +0 -528
  135. package/.morph/framework/standards/backend/database/vector-search-rag.md +0 -541
  136. package/.morph/framework/standards/backend/dotnet/async.md +0 -366
  137. package/.morph/framework/standards/backend/dotnet/core.md +0 -117
  138. package/.morph/framework/standards/backend/dotnet/di.md +0 -439
  139. package/.morph/framework/standards/backend/dotnet/program-cs-checklist.md +0 -92
  140. package/.morph/framework/standards/backend/integrations/asaas/asaas-api.md +0 -216
  141. package/.morph/framework/standards/backend/integrations/clerk/clerk-auth.md +0 -290
  142. package/.morph/framework/standards/backend/integrations/hangfire/hangfire-jobs.md +0 -350
  143. package/.morph/framework/standards/backend/integrations/resend/resend-email.md +0 -385
  144. package/.morph/framework/standards/context/analytics.md +0 -96
  145. package/.morph/framework/standards/context/bundles.md +0 -110
  146. package/.morph/framework/standards/context/priming.md +0 -78
  147. package/.morph/framework/standards/core/architecture.md +0 -185
  148. package/.morph/framework/standards/core/coding.md +0 -214
  149. package/.morph/framework/standards/core/git-branching-strategy.md +0 -403
  150. package/.morph/framework/standards/core/git.md +0 -185
  151. package/.morph/framework/standards/core/testing.md +0 -295
  152. package/.morph/framework/standards/data/nosql/blob-storage.md +0 -102
  153. package/.morph/framework/standards/data/nosql/cache/redis.md +0 -97
  154. package/.morph/framework/standards/data/nosql/cosmos-db.md +0 -118
  155. package/.morph/framework/standards/data/vector-search/azure-ai-search.md +0 -121
  156. package/.morph/framework/standards/data/vector-search/rag-chunking.md +0 -104
  157. package/.morph/framework/standards/frontend/blazor/design-checklist.md +0 -222
  158. package/.morph/framework/standards/frontend/blazor/fluent-ui-setup.md +0 -595
  159. package/.morph/framework/standards/frontend/blazor/fluent-ui.md +0 -137
  160. package/.morph/framework/standards/frontend/blazor/html-conversion.md +0 -184
  161. package/.morph/framework/standards/frontend/blazor/lifecycle.md +0 -195
  162. package/.morph/framework/standards/frontend/blazor/pitfalls.md +0 -198
  163. package/.morph/framework/standards/frontend/blazor/state.md +0 -191
  164. package/.morph/framework/standards/frontend/design-system/animations.md +0 -151
  165. package/.morph/framework/standards/frontend/design-system/naming.md +0 -64
  166. package/.morph/framework/standards/frontend/nextjs/nextjs-patterns.md +0 -198
  167. package/.morph/framework/standards/infrastructure/azure/azure.md +0 -624
  168. package/.morph/framework/standards/infrastructure/azure/bicep/bicep-patterns.md +0 -422
  169. package/.morph/framework/standards/infrastructure/azure/devops/azure-devops-setup.md +0 -516
  170. package/.morph/framework/standards/infrastructure/azure/devops/local-development.md +0 -520
  171. package/.morph/framework/standards/infrastructure/azure/services/functions.md +0 -486
  172. package/.morph/framework/standards/infrastructure/azure/services/service-bus.md +0 -459
  173. package/.morph/framework/standards/infrastructure/azure/services/storage.md +0 -407
  174. package/.morph/framework/standards/infrastructure/docker/easypanel-deploy.md +0 -196
  175. package/.morph/framework/standards/infrastructure/supabase/mcp-setup.md +0 -252
  176. package/.morph/framework/standards/infrastructure/supabase/supabase-auth.md +0 -176
  177. package/.morph/framework/standards/infrastructure/supabase/supabase-pgvector.md +0 -169
  178. package/.morph/framework/standards/infrastructure/supabase/supabase-rls.md +0 -184
  179. package/.morph/framework/standards/infrastructure/supabase/supabase-storage.md +0 -153
  180. package/.morph/framework/standards/integration/api/graphql.md +0 -91
  181. package/.morph/framework/standards/integration/api/grpc.md +0 -114
  182. package/.morph/framework/standards/integration/api/rest-design.md +0 -95
  183. package/.morph/framework/standards/integration/event-driven/cqrs.md +0 -101
  184. package/.morph/framework/standards/integration/event-driven/event-sourcing.md +0 -124
  185. package/.morph/framework/standards/integration/event-driven/service-bus.md +0 -95
  186. package/.morph/framework/standards/integration/mcp/mcp-tools.md +0 -384
  187. package/.morph/framework/standards/observability/logging.md +0 -131
  188. package/.morph/framework/standards/observability/metrics.md +0 -121
  189. package/.morph/framework/standards/observability/monitoring.md +0 -114
  190. package/.morph/framework/standards/observability/tracing.md +0 -132
  191. package/.morph/framework/standards/workflows/parallel-execution.md +0 -112
  192. package/.morph/framework/standards/workflows/thread-management.md +0 -113
  193. package/.morph/framework/templates/.idea/morph-templates.xml +0 -92
  194. package/.morph/framework/templates/.vscode/morph-templates.code-snippets +0 -186
  195. package/.morph/framework/templates/IDE-SNIPPETS.md +0 -266
  196. package/.morph/framework/templates/README.md +0 -814
  197. package/.morph/framework/templates/REGISTRY.json +0 -1492
  198. package/.morph/framework/templates/code/dotnet/backend/repository.cs +0 -141
  199. package/.morph/framework/templates/code/dotnet/backend/service.cs +0 -139
  200. package/.morph/framework/templates/code/dotnet/contracts/Commands.cs +0 -74
  201. package/.morph/framework/templates/code/dotnet/contracts/Entities.cs +0 -25
  202. package/.morph/framework/templates/code/dotnet/contracts/Queries.cs +0 -74
  203. package/.morph/framework/templates/code/dotnet/contracts/README.md +0 -74
  204. package/.morph/framework/templates/code/dotnet/contracts/api-contracts.cs +0 -173
  205. package/.morph/framework/templates/code/dotnet/contracts/contracts.cs +0 -217
  206. package/.morph/framework/templates/code/dotnet/contracts/contracts.cs.hbs +0 -172
  207. package/.morph/framework/templates/code/dotnet/database/migration.cs +0 -83
  208. package/.morph/framework/templates/code/dotnet/frontend/component.razor +0 -239
  209. package/.morph/framework/templates/code/dotnet/jobs/agent.cs +0 -163
  210. package/.morph/framework/templates/code/dotnet/jobs/job.cs +0 -171
  211. package/.morph/framework/templates/code/dotnet/test.cs +0 -239
  212. package/.morph/framework/templates/code/sql/rls-policy.sql +0 -57
  213. package/.morph/framework/templates/code/sql/supabase-migration.sql +0 -100
  214. package/.morph/framework/templates/code/sql/supabase-migration.template.sql +0 -113
  215. package/.morph/framework/templates/code/typescript/contracts.ts +0 -168
  216. package/.morph/framework/templates/context/CONTEXT-FEATURE.md +0 -276
  217. package/.morph/framework/templates/context/CONTEXT.md +0 -181
  218. package/.morph/framework/templates/docs/clarifications.md +0 -253
  219. package/.morph/framework/templates/docs/onboarding.md +0 -123
  220. package/.morph/framework/templates/docs/proposal.md +0 -182
  221. package/.morph/framework/templates/docs/schema-analysis.md +0 -119
  222. package/.morph/framework/templates/docs/spec.md +0 -149
  223. package/.morph/framework/templates/docs/ui-components.md +0 -124
  224. package/.morph/framework/templates/docs/ui-design-system.md +0 -76
  225. package/.morph/framework/templates/docs/ui-flows.md +0 -167
  226. package/.morph/framework/templates/docs/ui-mockups.md +0 -98
  227. package/.morph/framework/templates/examples/design-system-examples.md +0 -357
  228. package/.morph/framework/templates/examples/spec-examples.md +0 -90
  229. package/.morph/framework/templates/feature/decisions.md +0 -187
  230. package/.morph/framework/templates/feature/recap.md +0 -146
  231. package/.morph/framework/templates/feature/tasks.md +0 -199
  232. package/.morph/framework/templates/infrastructure/azure/Dockerfile.example +0 -82
  233. package/.morph/framework/templates/infrastructure/azure/README.md +0 -286
  234. package/.morph/framework/templates/infrastructure/azure/app-insights.bicep +0 -63
  235. package/.morph/framework/templates/infrastructure/azure/app-service.bicep +0 -164
  236. package/.morph/framework/templates/infrastructure/azure/container-app-env.bicep +0 -49
  237. package/.morph/framework/templates/infrastructure/azure/container-app.bicep +0 -156
  238. package/.morph/framework/templates/infrastructure/azure/deploy-checklist.md +0 -426
  239. package/.morph/framework/templates/infrastructure/azure/deploy.ps1 +0 -229
  240. package/.morph/framework/templates/infrastructure/azure/deploy.sh +0 -208
  241. package/.morph/framework/templates/infrastructure/azure/key-vault.bicep +0 -91
  242. package/.morph/framework/templates/infrastructure/azure/main.bicep +0 -189
  243. package/.morph/framework/templates/infrastructure/azure/parameters.dev.json +0 -29
  244. package/.morph/framework/templates/infrastructure/azure/parameters.prod.json +0 -29
  245. package/.morph/framework/templates/infrastructure/azure/parameters.staging.json +0 -29
  246. package/.morph/framework/templates/infrastructure/azure/sql-database.bicep +0 -103
  247. package/.morph/framework/templates/infrastructure/azure/storage.bicep +0 -106
  248. package/.morph/framework/templates/infrastructure/docker/Dockerfile.template +0 -58
  249. package/.morph/framework/templates/infrastructure/docker/docker-compose.template.yml +0 -67
  250. package/.morph/framework/templates/infrastructure/docker/dockerfile-api.dockerfile +0 -38
  251. package/.morph/framework/templates/infrastructure/docker/dockerfile-web.dockerfile +0 -48
  252. package/.morph/framework/templates/infrastructure/docker/easypanel.template.json +0 -54
  253. package/.morph/framework/templates/infrastructure/github/README.md +0 -593
  254. package/.morph/framework/templates/infrastructure/github/actions/azure-auth/action.yml.hbs +0 -22
  255. package/.morph/framework/templates/infrastructure/github/actions/docker-build-push/action.yml.hbs +0 -45
  256. package/.morph/framework/templates/infrastructure/github/actions/health-check/action.yml.hbs +0 -27
  257. package/.morph/framework/templates/infrastructure/github/workflows/deploy-azure-app-service.yml.hbs +0 -61
  258. package/.morph/framework/templates/infrastructure/github/workflows/deploy-easypanel.yml.hbs +0 -31
  259. package/.morph/framework/templates/infrastructure/github/workflows/docker-build-push.yml.hbs +0 -59
  260. package/.morph/framework/templates/infrastructure/github/workflows/dotnet-build.yml.hbs +0 -39
  261. package/.morph/framework/templates/integrations/asaas-client.cs +0 -387
  262. package/.morph/framework/templates/integrations/asaas-webhook.cs +0 -351
  263. package/.morph/framework/templates/integrations/azure-identity-config.cs +0 -288
  264. package/.morph/framework/templates/integrations/clerk-config.cs +0 -258
  265. package/.morph/framework/templates/meta-prompts/fusion/fusion-agent.md +0 -76
  266. package/.morph/framework/templates/meta-prompts/fusion/fusion-aggregator.md +0 -100
  267. package/.morph/framework/templates/meta-prompts/hops/hop-retry.md +0 -78
  268. package/.morph/framework/templates/meta-prompts/hops/hop-validation.md +0 -97
  269. package/.morph/framework/templates/meta-prompts/hops/hop-wrapper.md +0 -36
  270. package/.morph/framework/templates/meta-prompts/parallel-workers/parallel-coordinator.md +0 -113
  271. package/.morph/framework/templates/meta-prompts/parallel-workers/parallel-worker.md +0 -80
  272. package/.morph/framework/templates/meta-prompts/squad-leaders/backend-squad.md +0 -90
  273. package/.morph/framework/templates/meta-prompts/squad-leaders/frontend-squad.md +0 -126
  274. package/.morph/framework/templates/meta-prompts/squad-leaders/squad-leader.md +0 -43
  275. package/.morph/framework/templates/meta-prompts/validators/checkpoint-validator.md +0 -107
  276. package/.morph/framework/templates/meta-prompts/validators/pre-commit-validator.md +0 -95
  277. package/.morph/framework/templates/saas/subscription.cs +0 -347
  278. package/.morph/framework/templates/saas/tenant.cs +0 -338
  279. package/.morph/framework/templates/state.template.json +0 -17
  280. package/.morph/framework/templates/ui/FluentDesignTheme.cs +0 -149
  281. package/.morph/framework/templates/ui/MudTheme.cs +0 -281
  282. package/.morph/framework/templates/ui/design-system.css +0 -226
  283. package/.morph/logs/tool-failures.log +0 -51
  284. package/.morph/memory/pre-compact-2026-02-22T17-01-01-658Z.json +0 -16
  285. package/.morph/state.json +0 -48
  286. package/framework/skills/level-2-domains/backend/api-designer.md +0 -66
  287. package/framework/skills/level-2-domains/backend/ef-modeler.md +0 -65
  288. package/framework/skills/level-2-domains/frontend/nextjs-expert.md +0 -161
  289. package/framework/skills/level-3-technologies/README.md +0 -7
  290. package/framework/skills/level-4-patterns/README.md +0 -7
  291. package/framework/templates/code/dotnet/contracts/contracts.cs +0 -217
  292. package/framework/templates/code/dotnet/contracts/contracts.cs.hbs +0 -172
@@ -1,61 +0,0 @@
1
- name: Deploy to Azure App Service
2
-
3
- on:
4
- workflow_call:
5
- inputs:
6
- environment:
7
- required: true
8
- type: string
9
- resource-group:
10
- required: true
11
- type: string
12
- app-service-name:
13
- required: true
14
- type: string
15
- package-path:
16
- required: false
17
- type: string
18
- default: './publish'
19
-
20
- jobs:
21
- deploy:
22
- runs-on: ubuntu-latest
23
- environment: ${{{{ inputs.environment }}}}
24
- steps:
25
- - uses: actions/checkout@v4
26
-
27
- - name: Azure Login (OIDC)
28
- uses: azure/login@v1
29
- with:
30
- client-id: ${{{{ secrets.AZURE_CLIENT_ID }}}}
31
- tenant-id: ${{{{ secrets.AZURE_TENANT_ID }}}}
32
- subscription-id: ${{{{ secrets.AZURE_SUBSCRIPTION_ID }}}}
33
-
34
- - name: Deploy Infrastructure (Bicep)
35
- uses: azure/arm-deploy@v1
36
- with:
37
- resourceGroupName: ${{{{ inputs.resource-group }}}}
38
- template: .morph/framework/templates/infra/main.bicep
39
- parameters: .morph/framework/templates/infra/parameters.${{{{ inputs.environment }}}}.json
40
-
41
- - name: Setup .NET
42
- uses: actions/setup-dotnet@v4
43
- with:
44
- dotnet-version: '{{DOTNET_VERSION}}'
45
-
46
- - name: Publish .NET App
47
- run: dotnet publish -c Release -o ${{{{ inputs.package-path }}}}
48
-
49
- - name: Deploy to App Service
50
- uses: azure/webapps-deploy@v2
51
- with:
52
- app-name: ${{{{ inputs.app-service-name }}}}
53
- package: ${{{{ inputs.package-path }}}}
54
-
55
- - name: Health Check
56
- run: |
57
- APP_URL=$(az webapp show \
58
- --name ${{{{ inputs.app-service-name }}}} \
59
- --resource-group ${{{{ inputs.resource-group }}}} \
60
- --query defaultHostName -o tsv)
61
- curl --retry 10 --retry-delay 5 --retry-connrefused https://$APP_URL/health
@@ -1,31 +0,0 @@
1
- name: Deploy to EasyPanel
2
-
3
- on:
4
- workflow_call:
5
- inputs:
6
- environment:
7
- required: true
8
- type: string
9
- image:
10
- required: true
11
- type: string
12
-
13
- jobs:
14
- deploy:
15
- runs-on: ubuntu-latest
16
- environment: ${{{{ inputs.environment }}}}
17
- steps:
18
- - name: Trigger EasyPanel Deploy
19
- run: |
20
- curl -X POST ${{{{ secrets.EASYPANEL_WEBHOOK_URL }}}} \
21
- -H "Authorization: Bearer ${{{{ secrets.EASYPANEL_API_TOKEN }}}}" \
22
- -H "Content-Type: application/json" \
23
- -d '{
24
- "image": "${{{{ inputs.image }}}}",
25
- "environment": "${{{{ inputs.environment }}}}"
26
- }'
27
-
28
- - name: Health Check
29
- run: |
30
- sleep 30 # Wait for deployment
31
- curl --retry 10 --retry-delay 5 --retry-connrefused ${{{{ secrets.APP_URL }}}}/health
@@ -1,59 +0,0 @@
1
- name: Build & Push Docker Image
2
-
3
- on:
4
- workflow_call:
5
- inputs:
6
- registry:
7
- required: true
8
- type: string
9
- image-name:
10
- required: true
11
- type: string
12
- dockerfile-path:
13
- required: false
14
- type: string
15
- default: 'Dockerfile'
16
- build-context:
17
- required: false
18
- type: string
19
- default: '.'
20
- outputs:
21
- image-tag:
22
- value: ${{{{ jobs.docker.outputs.tag }}}}
23
-
24
- jobs:
25
- docker:
26
- runs-on: ubuntu-latest
27
- outputs:
28
- tag: ${{{{ steps.meta.outputs.tags }}}}
29
- steps:
30
- - uses: actions/checkout@v4
31
-
32
- - name: Set up Docker Buildx
33
- uses: docker/setup-buildx-action@v3
34
-
35
- - name: Login to Registry
36
- uses: docker/login-action@v3
37
- with:
38
- registry: ${{{{ inputs.registry }}}}
39
- username: ${{{{ secrets.REGISTRY_USERNAME }}}}
40
- password: ${{{{ secrets.REGISTRY_PASSWORD }}}}
41
-
42
- - name: Docker metadata
43
- id: meta
44
- uses: docker/metadata-action@v5
45
- with:
46
- images: ${{{{ inputs.registry }}}}/${{{{ inputs.image-name }}}}
47
- tags: |
48
- type=ref,event=branch
49
- type=sha,prefix=${{{{ inputs.image-name }}}}-
50
-
51
- - name: Build and push
52
- uses: docker/build-push-action@v5
53
- with:
54
- context: ${{{{ inputs.build-context }}}}
55
- file: ${{{{ inputs.dockerfile-path }}}}
56
- push: true
57
- tags: ${{{{ steps.meta.outputs.tags }}}}
58
- cache-from: type=gha
59
- cache-to: type=gha,mode=max
@@ -1,39 +0,0 @@
1
- name: Build .NET Application
2
-
3
- on:
4
- workflow_call:
5
- inputs:
6
- dotnet-version:
7
- required: false
8
- type: string
9
- default: '{{DOTNET_VERSION}}'
10
- build-configuration:
11
- required: false
12
- type: string
13
- default: 'Release'
14
- run-tests:
15
- required: false
16
- type: boolean
17
- default: true
18
-
19
- jobs:
20
- build:
21
- runs-on: ubuntu-latest
22
- steps:
23
- - uses: actions/checkout@v4
24
-
25
- - name: Setup .NET
26
- uses: actions/setup-dotnet@v4
27
- with:
28
- dotnet-version: ${{{{ inputs.dotnet-version }}}}
29
-
30
- - name: Restore dependencies
31
- run: dotnet restore
32
-
33
- - name: Build
34
- run: dotnet build --configuration ${{{{ inputs.build-configuration }}}} --no-restore
35
-
36
- {{#if run-tests}}
37
- - name: Test
38
- run: dotnet test --configuration ${{{{ inputs.build-configuration }}}} --no-build --verbosity normal
39
- {{/if}}
@@ -1,387 +0,0 @@
1
- // ==============================================================================
2
- // MORPH-SPEC - Asaas Client Template
3
- // HTTP Client para integração com Asaas API
4
- // ==============================================================================
5
-
6
- using System.Net.Http.Json;
7
- using System.Text.Json.Serialization;
8
- using Microsoft.Extensions.Logging;
9
- using Microsoft.Extensions.Options;
10
-
11
- namespace {{Namespace}}.Infrastructure.Services;
12
-
13
- // ==============================================================================
14
- // OPTIONS
15
- // ==============================================================================
16
-
17
- public class AsaasOptions
18
- {
19
- public const string SectionName = "Asaas";
20
-
21
- /// <summary>
22
- /// Base URL da API (sandbox ou produção)
23
- /// Sandbox: https://sandbox.asaas.com/api/v3
24
- /// Produção: https://www.asaas.com/api/v3
25
- /// </summary>
26
- public string BaseUrl { get; set; } = "https://sandbox.asaas.com/api/v3";
27
-
28
- /// <summary>
29
- /// API Key do Asaas
30
- /// </summary>
31
- public string ApiKey { get; set; } = string.Empty;
32
- }
33
-
34
- // ==============================================================================
35
- // INTERFACE
36
- // ==============================================================================
37
-
38
- public interface IAsaasClient
39
- {
40
- // Customers
41
- Task<AsaasCustomer> CreateCustomerAsync(CreateCustomerRequest request, CancellationToken ct = default);
42
- Task<AsaasCustomer?> GetCustomerByIdAsync(string customerId, CancellationToken ct = default);
43
- Task<AsaasCustomer?> GetCustomerByCpfCnpjAsync(string cpfCnpj, CancellationToken ct = default);
44
-
45
- // Payments
46
- Task<AsaasPayment> CreatePaymentAsync(CreatePaymentRequest request, CancellationToken ct = default);
47
- Task<AsaasPayment?> GetPaymentAsync(string paymentId, CancellationToken ct = default);
48
- Task<AsaasPixQrCode?> GetPixQrCodeAsync(string paymentId, CancellationToken ct = default);
49
-
50
- // Subscriptions
51
- Task<AsaasSubscription> CreateSubscriptionAsync(CreateSubscriptionRequest request, CancellationToken ct = default);
52
- Task<AsaasSubscription?> GetSubscriptionAsync(string subscriptionId, CancellationToken ct = default);
53
- Task CancelSubscriptionAsync(string subscriptionId, CancellationToken ct = default);
54
- }
55
-
56
- // ==============================================================================
57
- // IMPLEMENTATION
58
- // ==============================================================================
59
-
60
- public class AsaasClient : IAsaasClient
61
- {
62
- private readonly HttpClient _httpClient;
63
- private readonly ILogger<AsaasClient> _logger;
64
-
65
- public AsaasClient(HttpClient httpClient, ILogger<AsaasClient> logger)
66
- {
67
- _httpClient = httpClient;
68
- _logger = logger;
69
- }
70
-
71
- // =========================================================================
72
- // CUSTOMERS
73
- // =========================================================================
74
-
75
- public async Task<AsaasCustomer> CreateCustomerAsync(CreateCustomerRequest request, CancellationToken ct = default)
76
- {
77
- _logger.LogInformation("Creating Asaas customer: {Name}", request.Name);
78
-
79
- var response = await _httpClient.PostAsJsonAsync("customers", request, ct);
80
- await EnsureSuccessAsync(response, "create customer");
81
-
82
- return await response.Content.ReadFromJsonAsync<AsaasCustomer>(ct)
83
- ?? throw new AsaasException("Failed to deserialize customer response");
84
- }
85
-
86
- public async Task<AsaasCustomer?> GetCustomerByIdAsync(string customerId, CancellationToken ct = default)
87
- {
88
- var response = await _httpClient.GetAsync($"customers/{customerId}", ct);
89
-
90
- if (response.StatusCode == System.Net.HttpStatusCode.NotFound)
91
- return null;
92
-
93
- await EnsureSuccessAsync(response, "get customer");
94
- return await response.Content.ReadFromJsonAsync<AsaasCustomer>(ct);
95
- }
96
-
97
- public async Task<AsaasCustomer?> GetCustomerByCpfCnpjAsync(string cpfCnpj, CancellationToken ct = default)
98
- {
99
- var response = await _httpClient.GetAsync($"customers?cpfCnpj={cpfCnpj}", ct);
100
- await EnsureSuccessAsync(response, "search customer");
101
-
102
- var result = await response.Content.ReadFromJsonAsync<AsaasListResponse<AsaasCustomer>>(ct);
103
- return result?.Data?.FirstOrDefault();
104
- }
105
-
106
- // =========================================================================
107
- // PAYMENTS
108
- // =========================================================================
109
-
110
- public async Task<AsaasPayment> CreatePaymentAsync(CreatePaymentRequest request, CancellationToken ct = default)
111
- {
112
- _logger.LogInformation("Creating Asaas payment for customer {CustomerId}, type {BillingType}, value {Value}",
113
- request.Customer, request.BillingType, request.Value);
114
-
115
- var response = await _httpClient.PostAsJsonAsync("payments", request, ct);
116
- await EnsureSuccessAsync(response, "create payment");
117
-
118
- return await response.Content.ReadFromJsonAsync<AsaasPayment>(ct)
119
- ?? throw new AsaasException("Failed to deserialize payment response");
120
- }
121
-
122
- public async Task<AsaasPayment?> GetPaymentAsync(string paymentId, CancellationToken ct = default)
123
- {
124
- var response = await _httpClient.GetAsync($"payments/{paymentId}", ct);
125
-
126
- if (response.StatusCode == System.Net.HttpStatusCode.NotFound)
127
- return null;
128
-
129
- await EnsureSuccessAsync(response, "get payment");
130
- return await response.Content.ReadFromJsonAsync<AsaasPayment>(ct);
131
- }
132
-
133
- public async Task<AsaasPixQrCode?> GetPixQrCodeAsync(string paymentId, CancellationToken ct = default)
134
- {
135
- var response = await _httpClient.GetAsync($"payments/{paymentId}/pixQrCode", ct);
136
-
137
- if (response.StatusCode == System.Net.HttpStatusCode.NotFound)
138
- return null;
139
-
140
- await EnsureSuccessAsync(response, "get pix qrcode");
141
- return await response.Content.ReadFromJsonAsync<AsaasPixQrCode>(ct);
142
- }
143
-
144
- // =========================================================================
145
- // SUBSCRIPTIONS
146
- // =========================================================================
147
-
148
- public async Task<AsaasSubscription> CreateSubscriptionAsync(CreateSubscriptionRequest request, CancellationToken ct = default)
149
- {
150
- _logger.LogInformation("Creating Asaas subscription for customer {CustomerId}", request.Customer);
151
-
152
- var response = await _httpClient.PostAsJsonAsync("subscriptions", request, ct);
153
- await EnsureSuccessAsync(response, "create subscription");
154
-
155
- return await response.Content.ReadFromJsonAsync<AsaasSubscription>(ct)
156
- ?? throw new AsaasException("Failed to deserialize subscription response");
157
- }
158
-
159
- public async Task<AsaasSubscription?> GetSubscriptionAsync(string subscriptionId, CancellationToken ct = default)
160
- {
161
- var response = await _httpClient.GetAsync($"subscriptions/{subscriptionId}", ct);
162
-
163
- if (response.StatusCode == System.Net.HttpStatusCode.NotFound)
164
- return null;
165
-
166
- await EnsureSuccessAsync(response, "get subscription");
167
- return await response.Content.ReadFromJsonAsync<AsaasSubscription>(ct);
168
- }
169
-
170
- public async Task CancelSubscriptionAsync(string subscriptionId, CancellationToken ct = default)
171
- {
172
- _logger.LogInformation("Canceling Asaas subscription {SubscriptionId}", subscriptionId);
173
-
174
- var response = await _httpClient.DeleteAsync($"subscriptions/{subscriptionId}", ct);
175
- await EnsureSuccessAsync(response, "cancel subscription");
176
- }
177
-
178
- // =========================================================================
179
- // HELPERS
180
- // =========================================================================
181
-
182
- private async Task EnsureSuccessAsync(HttpResponseMessage response, string operation)
183
- {
184
- if (!response.IsSuccessStatusCode)
185
- {
186
- var error = await response.Content.ReadAsStringAsync();
187
- _logger.LogError("Asaas API error during {Operation}: {StatusCode} - {Error}",
188
- operation, response.StatusCode, error);
189
- throw new AsaasException($"Failed to {operation}: {response.StatusCode} - {error}");
190
- }
191
- }
192
- }
193
-
194
- // ==============================================================================
195
- // DTOS
196
- // ==============================================================================
197
-
198
- public record CreateCustomerRequest
199
- {
200
- [JsonPropertyName("name")]
201
- public required string Name { get; init; }
202
-
203
- [JsonPropertyName("cpfCnpj")]
204
- public required string CpfCnpj { get; init; }
205
-
206
- [JsonPropertyName("email")]
207
- public string? Email { get; init; }
208
-
209
- [JsonPropertyName("phone")]
210
- public string? Phone { get; init; }
211
-
212
- [JsonPropertyName("mobilePhone")]
213
- public string? MobilePhone { get; init; }
214
-
215
- [JsonPropertyName("externalReference")]
216
- public string? ExternalReference { get; init; }
217
- }
218
-
219
- public record CreatePaymentRequest
220
- {
221
- [JsonPropertyName("customer")]
222
- public required string Customer { get; init; }
223
-
224
- [JsonPropertyName("billingType")]
225
- public required string BillingType { get; init; } // BOLETO, PIX, CREDIT_CARD
226
-
227
- [JsonPropertyName("value")]
228
- public required decimal Value { get; init; }
229
-
230
- [JsonPropertyName("dueDate")]
231
- public required string DueDate { get; init; } // yyyy-MM-dd
232
-
233
- [JsonPropertyName("description")]
234
- public string? Description { get; init; }
235
-
236
- [JsonPropertyName("externalReference")]
237
- public string? ExternalReference { get; init; }
238
- }
239
-
240
- public record CreateSubscriptionRequest
241
- {
242
- [JsonPropertyName("customer")]
243
- public required string Customer { get; init; }
244
-
245
- [JsonPropertyName("billingType")]
246
- public required string BillingType { get; init; }
247
-
248
- [JsonPropertyName("value")]
249
- public required decimal Value { get; init; }
250
-
251
- [JsonPropertyName("nextDueDate")]
252
- public required string NextDueDate { get; init; }
253
-
254
- [JsonPropertyName("cycle")]
255
- public required string Cycle { get; init; } // MONTHLY, WEEKLY, BIWEEKLY, YEARLY
256
-
257
- [JsonPropertyName("description")]
258
- public string? Description { get; init; }
259
-
260
- [JsonPropertyName("externalReference")]
261
- public string? ExternalReference { get; init; }
262
- }
263
-
264
- public record AsaasCustomer
265
- {
266
- [JsonPropertyName("id")]
267
- public string Id { get; init; } = string.Empty;
268
-
269
- [JsonPropertyName("name")]
270
- public string Name { get; init; } = string.Empty;
271
-
272
- [JsonPropertyName("cpfCnpj")]
273
- public string CpfCnpj { get; init; } = string.Empty;
274
-
275
- [JsonPropertyName("email")]
276
- public string? Email { get; init; }
277
-
278
- [JsonPropertyName("externalReference")]
279
- public string? ExternalReference { get; init; }
280
- }
281
-
282
- public record AsaasPayment
283
- {
284
- [JsonPropertyName("id")]
285
- public string Id { get; init; } = string.Empty;
286
-
287
- [JsonPropertyName("customer")]
288
- public string Customer { get; init; } = string.Empty;
289
-
290
- [JsonPropertyName("value")]
291
- public decimal Value { get; init; }
292
-
293
- [JsonPropertyName("status")]
294
- public string Status { get; init; } = string.Empty;
295
-
296
- [JsonPropertyName("billingType")]
297
- public string BillingType { get; init; } = string.Empty;
298
-
299
- [JsonPropertyName("dueDate")]
300
- public string DueDate { get; init; } = string.Empty;
301
-
302
- [JsonPropertyName("invoiceUrl")]
303
- public string? InvoiceUrl { get; init; }
304
-
305
- [JsonPropertyName("bankSlipUrl")]
306
- public string? BankSlipUrl { get; init; }
307
-
308
- [JsonPropertyName("externalReference")]
309
- public string? ExternalReference { get; init; }
310
- }
311
-
312
- public record AsaasPixQrCode
313
- {
314
- [JsonPropertyName("encodedImage")]
315
- public string? EncodedImage { get; init; }
316
-
317
- [JsonPropertyName("payload")]
318
- public string? Payload { get; init; }
319
-
320
- [JsonPropertyName("expirationDate")]
321
- public string? ExpirationDate { get; init; }
322
- }
323
-
324
- public record AsaasSubscription
325
- {
326
- [JsonPropertyName("id")]
327
- public string Id { get; init; } = string.Empty;
328
-
329
- [JsonPropertyName("customer")]
330
- public string Customer { get; init; } = string.Empty;
331
-
332
- [JsonPropertyName("value")]
333
- public decimal Value { get; init; }
334
-
335
- [JsonPropertyName("status")]
336
- public string Status { get; init; } = string.Empty;
337
-
338
- [JsonPropertyName("cycle")]
339
- public string Cycle { get; init; } = string.Empty;
340
-
341
- [JsonPropertyName("nextDueDate")]
342
- public string NextDueDate { get; init; } = string.Empty;
343
-
344
- [JsonPropertyName("externalReference")]
345
- public string? ExternalReference { get; init; }
346
- }
347
-
348
- public record AsaasListResponse<T>
349
- {
350
- [JsonPropertyName("data")]
351
- public List<T>? Data { get; init; }
352
-
353
- [JsonPropertyName("totalCount")]
354
- public int TotalCount { get; init; }
355
- }
356
-
357
- // ==============================================================================
358
- // EXCEPTION
359
- // ==============================================================================
360
-
361
- public class AsaasException : Exception
362
- {
363
- public AsaasException(string message) : base(message) { }
364
- public AsaasException(string message, Exception innerException) : base(message, innerException) { }
365
- }
366
-
367
- // ==============================================================================
368
- // DEPENDENCY INJECTION
369
- // ==============================================================================
370
-
371
- public static class AsaasServiceExtensions
372
- {
373
- public static IServiceCollection AddAsaasClient(this IServiceCollection services, IConfiguration configuration)
374
- {
375
- services.Configure<AsaasOptions>(configuration.GetSection(AsaasOptions.SectionName));
376
-
377
- services.AddHttpClient<IAsaasClient, AsaasClient>((sp, client) =>
378
- {
379
- var options = sp.GetRequiredService<IOptions<AsaasOptions>>().Value;
380
- client.BaseAddress = new Uri(options.BaseUrl.TrimEnd('/') + "/");
381
- client.DefaultRequestHeaders.Add("access_token", options.ApiKey);
382
- client.DefaultRequestHeaders.Add("User-Agent", "MORPH-SPEC/1.0");
383
- });
384
-
385
- return services;
386
- }
387
- }