@polymorphism-tech/morph-spec 3.2.0 → 4.3.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.
- package/README.md +1 -14
- package/bin/detect-agents.js +1 -1
- package/bin/morph-spec.js +403 -40
- package/bin/validate.js +5 -5
- package/docs/getting-started.md +0 -5
- package/docs/next-generation/AGENTS.md +521 -0
- package/docs/next-generation/ANALYSIS.md +555 -0
- package/docs/next-generation/ARCHITECTURE.md +436 -0
- package/docs/next-generation/CONTEXT-OPTIMIZATION.md +267 -0
- package/docs/next-generation/EXECUTION-FLOW.md +274 -0
- package/docs/next-generation/FEATURES.md +688 -0
- package/docs/next-generation/META-PROMPTS.md +235 -0
- package/docs/next-generation/MIGRATION-GUIDE.md +253 -0
- package/docs/next-generation/README.md +231 -0
- package/docs/next-generation/ROADMAP.md +801 -0
- package/docs/next-generation/THREAD-MANAGEMENT.md +240 -0
- package/docs/validation-checklist.md +0 -1
- package/package.json +5 -5
- package/src/commands/agents/agents-fuse.js +96 -0
- package/src/commands/agents/index.js +4 -0
- package/src/commands/agents/micro-agent.js +112 -0
- package/src/commands/{spawn-team.js → agents/spawn-team.js} +237 -172
- package/src/commands/agents/squad-template.js +146 -0
- package/src/commands/analytics/analytics.js +176 -0
- package/src/commands/context/context-prime.js +63 -0
- package/src/commands/context/core-four.js +54 -0
- package/src/commands/{create-story.js → feature/create-story.js} +357 -354
- package/src/commands/feature/index.js +6 -0
- package/src/commands/{shard-spec.js → feature/shard-spec.js} +2 -2
- package/src/commands/{sprint-status.js → feature/sprint-status.js} +1 -1
- package/src/commands/{generate-context.js → generation/generate-context.js} +40 -40
- package/src/commands/{generate.js → generation/generate.js} +4 -4
- package/src/commands/generation/index.js +5 -0
- package/src/commands/index.js +16 -0
- package/src/commands/{capture-pattern.js → learning/capture-pattern.js} +121 -121
- package/src/commands/learning/index.js +5 -0
- package/src/commands/mcp/mcp.js +102 -0
- package/src/commands/{detect-agents.js → project/detect-agents.js} +178 -178
- package/src/commands/project/detect-workflow.js +174 -0
- package/src/commands/{detect.js → project/detect.js} +104 -104
- package/src/commands/{doctor.js → project/doctor.js} +221 -4
- package/src/commands/project/index.js +10 -0
- package/src/commands/{init.js → project/init.js} +305 -295
- package/src/commands/{sync.js → project/sync.js} +167 -167
- package/src/commands/{update.js → project/update.js} +240 -240
- package/src/commands/{advance-phase.js → state/advance-phase.js} +101 -25
- package/src/commands/{approve.js → state/approve.js} +221 -221
- package/src/commands/state/index.js +8 -0
- package/src/commands/{rollback-phase.js → state/rollback-phase.js} +185 -185
- package/src/commands/{state.js → state/state.js} +334 -334
- package/src/commands/{validate-phase.js → state/validate-phase.js} +221 -221
- package/src/commands/tasks/index.js +4 -0
- package/src/commands/{task.js → tasks/task.js} +78 -78
- package/src/commands/templates/index.js +8 -0
- package/src/commands/templates/template-customize.js +101 -0
- package/src/commands/templates/template-list.js +128 -0
- package/src/commands/templates/template-render.js +174 -0
- package/src/commands/templates/template-show.js +131 -0
- package/src/commands/templates/template-validate.js +91 -0
- package/src/commands/threads/thread-template.js +103 -0
- package/src/commands/threads/threads.js +261 -0
- package/src/commands/trust/trust.js +205 -0
- package/src/commands/utils/index.js +7 -0
- package/src/commands/{session-summary.js → utils/session-summary.js} +291 -291
- package/src/commands/{troubleshoot.js → utils/troubleshoot.js} +222 -222
- package/src/commands/{analyze-blazor-concurrency.js → validation/analyze-blazor-concurrency.js} +193 -193
- package/src/commands/validation/index.js +8 -0
- package/src/commands/{lint-fluent.js → validation/lint-fluent.js} +352 -352
- package/src/commands/{validate-blazor-state.js → validation/validate-blazor-state.js} +210 -210
- package/src/commands/{validate-blazor.js → validation/validate-blazor.js} +156 -156
- package/src/commands/{validate-css.js → validation/validate-css.js} +84 -84
- package/src/core/index.js +10 -0
- package/src/{orchestrator.js → core/orchestrator.js} +8 -8
- package/src/core/registry/command-registry.js +302 -0
- package/src/core/registry/index.js +8 -0
- package/src/core/registry/validator-registry.js +204 -0
- package/src/core/state/index.js +8 -0
- package/src/{lib → core/state}/phase-state-machine.js +214 -214
- package/src/{lib → core/state}/state-manager.js +588 -534
- package/src/core/templates/index.js +9 -0
- package/src/core/templates/template-registry.js +335 -0
- package/src/core/templates/template-renderer.js +477 -0
- package/src/core/templates/template-validator.js +296 -0
- package/src/core/workflows/index.js +7 -0
- package/src/core/workflows/workflow-detector.js +452 -0
- package/src/lib/agents/micro-agent-factory.js +161 -0
- package/src/lib/{complexity-analyzer.js → analysis/complexity-analyzer.js} +441 -441
- package/src/lib/analysis/index.js +7 -0
- package/src/lib/analytics/analytics-engine.js +345 -0
- package/src/lib/{checkpoint-hooks.js → checkpoints/checkpoint-hooks.js} +35 -0
- package/src/lib/checkpoints/index.js +7 -0
- package/src/lib/context/context-bundler.js +240 -0
- package/src/lib/context/context-optimizer.js +212 -0
- package/src/lib/context/context-tracker.js +273 -0
- package/src/lib/context/core-four-tracker.js +201 -0
- package/src/lib/context/mcp-optimizer.js +200 -0
- package/src/lib/detectors/config-detector.js +223 -223
- package/src/lib/detectors/conversation-analyzer.js +163 -163
- package/src/lib/{design-system-detector.js → detectors/design-system-detector.js} +187 -187
- package/src/lib/detectors/index.js +87 -84
- package/src/lib/detectors/standards-generator.js +275 -275
- package/src/lib/detectors/structure-detector.js +245 -245
- package/src/lib/execution/fusion-executor.js +304 -0
- package/src/lib/execution/parallel-executor.js +270 -0
- package/src/lib/{context-generator.js → generators/context-generator.js} +526 -516
- package/src/lib/generators/index.js +10 -0
- package/src/lib/{metadata-extractor.js → generators/metadata-extractor.js} +387 -380
- package/src/lib/{recap-generator.js → generators/recap-generator.js} +205 -205
- package/src/lib/hooks/hook-executor.js +169 -0
- package/src/lib/hooks/stop-hook-executor.js +286 -0
- package/src/lib/hops/hop-composer.js +221 -0
- package/src/lib/learning/index.js +7 -0
- package/src/lib/orchestration/index.js +7 -0
- package/src/lib/{team-orchestrator.js → orchestration/team-orchestrator.js} +323 -323
- package/src/lib/stacks/index.js +7 -0
- package/src/lib/{stack-resolver.js → stacks/stack-resolver.js} +180 -148
- package/src/lib/standards/index.js +7 -0
- package/src/lib/{standards-context-injector.js → standards/standards-context-injector.js} +298 -288
- package/src/lib/threads/thread-coordinator.js +238 -0
- package/src/lib/threads/thread-manager.js +317 -0
- package/src/lib/tracking/artifact-trail.js +202 -0
- package/src/lib/troubleshooting/index.js +8 -0
- package/src/lib/{troubleshoot-grep.js → troubleshooting/troubleshoot-grep.js} +204 -204
- package/src/lib/{troubleshoot-index.js → troubleshooting/troubleshoot-index.js} +144 -144
- package/src/lib/trust/trust-manager.js +269 -0
- package/src/lib/validators/{architecture-validator.js → architecture/architecture-validator.js} +8 -8
- package/src/lib/validators/architecture/index.js +7 -0
- package/src/lib/{blazor-concurrency-analyzer.js → validators/blazor/blazor-concurrency-analyzer.js} +277 -288
- package/src/lib/{blazor-state-validator.js → validators/blazor/blazor-state-validator.js} +279 -291
- package/src/lib/{blazor-validator.js → validators/blazor/blazor-validator.js} +369 -374
- package/src/lib/validators/blazor/index.js +9 -0
- package/src/lib/validators/{content-validator.js → content/content-validator.js} +351 -351
- package/src/lib/validators/content/index.js +7 -0
- package/src/lib/validators/{contract-compliance-validator.js → contracts/contract-compliance-validator.js} +273 -273
- package/src/lib/validators/contracts/index.js +7 -0
- package/src/lib/{css-validator.js → validators/css/css-validator.js} +352 -352
- package/src/lib/validators/css/index.js +7 -0
- package/src/lib/validators/{design-system-validator.js → design-system/design-system-validator.js} +231 -231
- package/src/lib/validators/design-system/index.js +7 -0
- package/src/lib/validators/packages/index.js +7 -0
- package/src/lib/validators/shared/index.js +12 -0
- package/src/lib/validators/shared/issue-counter.js +18 -0
- package/src/lib/validators/shared/result-formatter.js +124 -0
- package/src/lib/{spec-validator.js → validators/spec-validator.js} +258 -258
- package/src/lib/validators/ui/index.js +7 -0
- package/src/lib/{validation-runner.js → validators/validation-runner.js} +286 -284
- package/src/ui/wizard-questions.js +0 -2
- package/src/utils/color-utils.js +70 -0
- package/src/utils/file-copier.js +188 -189
- package/src/utils/process-handler.js +97 -0
- package/stacks/blazor-azure/.morph/config/agents.json +948 -764
- package/stacks/blazor-azure/.morph/hooks/{pre-commit-tests.sh → pre-commit/tests-csharp.sh} +3 -2
- package/stacks/blazor-azure/.morph/templates/infrastructure/github/workflows/cd-prod.yml.hbs +41 -0
- package/stacks/blazor-azure/.morph/templates/infrastructure/github/workflows/cd-staging.yml.hbs +24 -0
- package/stacks/blazor-azure/.morph/templates/infrastructure/github/workflows/ci-build.yml.hbs +23 -0
- package/stacks/nextjs-supabase/.morph/config/agents.json +345 -345
- package/stacks/nextjs-supabase/.morph/hooks/pre-commit/tests-typescript.sh +61 -0
- package/stacks/nextjs-supabase/.morph/templates/infrastructure/github/workflows/cd-prod.yml.hbs +22 -0
- package/stacks/nextjs-supabase/.morph/templates/infrastructure/github/workflows/cd-staging.yml.hbs +22 -0
- package/stacks/nextjs-supabase/.morph/templates/infrastructure/github/workflows/ci-build.yml.hbs +35 -0
- package/stacks/nextjs-supabase/README.md +6 -15
- package/CLAUDE.md +0 -648
- package/bin/render-template.js +0 -349
- package/bin/semantic-detect-agents.js +0 -247
- package/bin/validate-agents-skills.js +0 -257
- package/bin/validate-agents.js +0 -70
- package/bin/validate-phase.js +0 -263
- package/docs/examples.md +0 -328
- package/docs/llm-interaction-config.md +0 -735
- package/scripts/reorganize-skills.cjs +0 -175
- package/scripts/validate-agents-structure.cjs +0 -52
- package/scripts/validate-skills.cjs +0 -180
- package/src/commands/deploy.js +0 -780
- package/src/commands/migrate-state.js +0 -158
- package/src/commands/upgrade.js +0 -346
- package/src/lib/continuous-validator.js +0 -421
- package/src/lib/decision-constraint-loader.js +0 -109
- package/src/lib/design-system-scaffolder.js +0 -299
- package/src/lib/hook-executor.js +0 -257
- package/src/lib/mockup-generator.js +0 -366
- package/src/lib/ui-detector.js +0 -350
- package/src/llm/schema-validator.js +0 -121
- package/src/sanitizer/.gitkeep +0 -0
- package/src/scanner/.gitkeep +0 -0
- package/src/types/index.js +0 -477
- package/src/ui/.gitkeep +0 -0
- package/src/writer/.gitkeep +0 -0
- package/stacks/blazor-azure/.azure/README.md +0 -293
- package/stacks/blazor-azure/.azure/docs/azure-devops-setup.md +0 -454
- package/stacks/blazor-azure/.azure/docs/branch-strategy.md +0 -398
- package/stacks/blazor-azure/.azure/docs/local-development.md +0 -515
- package/stacks/blazor-azure/.azure/pipelines/pipeline-variables.yml +0 -34
- package/stacks/blazor-azure/.azure/pipelines/prod-pipeline.yml +0 -319
- package/stacks/blazor-azure/.azure/pipelines/staging-pipeline.yml +0 -234
- package/stacks/blazor-azure/.azure/pipelines/templates/build-dotnet.yml +0 -75
- package/stacks/blazor-azure/.azure/pipelines/templates/deploy-app-service.yml +0 -94
- package/stacks/blazor-azure/.azure/pipelines/templates/deploy-container-app.yml +0 -120
- package/stacks/blazor-azure/.azure/pipelines/templates/infra-deploy.yml +0 -90
- package/stacks/blazor-azure/.claude/commands/morph-apply.md +0 -221
- package/stacks/blazor-azure/.claude/commands/morph-archive.md +0 -79
- package/stacks/blazor-azure/.claude/commands/morph-deploy.md +0 -529
- package/stacks/blazor-azure/.claude/commands/morph-infra.md +0 -209
- package/stacks/blazor-azure/.claude/commands/morph-preflight.md +0 -227
- package/stacks/blazor-azure/.claude/commands/morph-proposal.md +0 -122
- package/stacks/blazor-azure/.claude/commands/morph-status.md +0 -86
- package/stacks/blazor-azure/.claude/commands/morph-troubleshoot.md +0 -122
- package/stacks/blazor-azure/.claude/settings.local.json +0 -15
- package/stacks/blazor-azure/.claude/skills/level-0-meta/README.md +0 -7
- package/stacks/blazor-azure/.claude/skills/level-0-meta/code-review.md +0 -226
- package/stacks/blazor-azure/.claude/skills/level-0-meta/morph-checklist.md +0 -117
- package/stacks/blazor-azure/.claude/skills/level-0-meta/simulation-checklist.md +0 -77
- package/stacks/blazor-azure/.claude/skills/level-1-workflows/README.md +0 -7
- package/stacks/blazor-azure/.claude/skills/level-1-workflows/morph-replicate.md +0 -213
- package/stacks/blazor-azure/.claude/skills/level-1-workflows/phase-clarify.md +0 -131
- package/stacks/blazor-azure/.claude/skills/level-1-workflows/phase-design.md +0 -213
- package/stacks/blazor-azure/.claude/skills/level-1-workflows/phase-setup.md +0 -106
- package/stacks/blazor-azure/.claude/skills/level-1-workflows/phase-tasks.md +0 -164
- package/stacks/blazor-azure/.claude/skills/level-1-workflows/phase-uiux.md +0 -169
- package/stacks/blazor-azure/.claude/skills/level-2-domains/README.md +0 -14
- package/stacks/blazor-azure/.claude/skills/level-2-domains/ai-agents/ai-system-architect.md +0 -192
- package/stacks/blazor-azure/.claude/skills/level-2-domains/architecture/po-pm-advisor.md +0 -197
- package/stacks/blazor-azure/.claude/skills/level-2-domains/architecture/prompt-engineer.md +0 -189
- package/stacks/blazor-azure/.claude/skills/level-2-domains/architecture/seo-growth-hacker.md +0 -320
- package/stacks/blazor-azure/.claude/skills/level-2-domains/architecture/standards-architect.md +0 -156
- package/stacks/blazor-azure/.claude/skills/level-2-domains/backend/dotnet-senior.md +0 -287
- package/stacks/blazor-azure/.claude/skills/level-2-domains/backend/ef-modeler.md +0 -113
- package/stacks/blazor-azure/.claude/skills/level-2-domains/backend/hangfire-orchestrator.md +0 -126
- package/stacks/blazor-azure/.claude/skills/level-2-domains/backend/ms-agent-expert.md +0 -109
- package/stacks/blazor-azure/.claude/skills/level-2-domains/frontend/blazor-builder.md +0 -210
- package/stacks/blazor-azure/.claude/skills/level-2-domains/frontend/nextjs-expert.md +0 -154
- package/stacks/blazor-azure/.claude/skills/level-2-domains/frontend/ui-ux-designer.md +0 -191
- package/stacks/blazor-azure/.claude/skills/level-2-domains/infrastructure/azure-architect.md +0 -142
- package/stacks/blazor-azure/.claude/skills/level-2-domains/infrastructure/azure-deploy-specialist.md +0 -699
- package/stacks/blazor-azure/.claude/skills/level-2-domains/infrastructure/bicep-architect.md +0 -126
- package/stacks/blazor-azure/.claude/skills/level-2-domains/infrastructure/container-specialist.md +0 -131
- package/stacks/blazor-azure/.claude/skills/level-2-domains/infrastructure/devops-engineer.md +0 -119
- package/stacks/blazor-azure/.claude/skills/level-2-domains/integrations/asaas-financial.md +0 -130
- package/stacks/blazor-azure/.claude/skills/level-2-domains/integrations/azure-identity.md +0 -142
- package/stacks/blazor-azure/.claude/skills/level-2-domains/integrations/clerk-auth.md +0 -108
- package/stacks/blazor-azure/.claude/skills/level-2-domains/integrations/resend-email.md +0 -119
- package/stacks/blazor-azure/.claude/skills/level-2-domains/quality/code-analyzer.md +0 -235
- package/stacks/blazor-azure/.claude/skills/level-2-domains/quality/testing-specialist.md +0 -126
- package/stacks/blazor-azure/.claude/skills/level-3-technologies/README.md +0 -7
- package/stacks/blazor-azure/.claude/skills/level-4-patterns/README.md +0 -7
- package/stacks/blazor-azure/.morph/archive/.gitkeep +0 -25
- package/stacks/blazor-azure/.morph/docs/STORY-DRIVEN-DEVELOPMENT.md +0 -392
- package/stacks/blazor-azure/.morph/docs/workflows/design-impl.md +0 -37
- package/stacks/blazor-azure/.morph/docs/workflows/enforcement-pipeline.md +0 -668
- package/stacks/blazor-azure/.morph/docs/workflows/fast-track.md +0 -29
- package/stacks/blazor-azure/.morph/docs/workflows/full-morph.md +0 -76
- package/stacks/blazor-azure/.morph/docs/workflows/standard.md +0 -44
- package/stacks/blazor-azure/.morph/docs/workflows/ui-refresh.md +0 -39
- package/stacks/blazor-azure/.morph/examples/api-nextjs/README.md +0 -241
- package/stacks/blazor-azure/.morph/examples/api-nextjs/contracts.ts +0 -307
- package/stacks/blazor-azure/.morph/examples/api-nextjs/spec.md +0 -399
- package/stacks/blazor-azure/.morph/examples/api-nextjs/tasks.md +0 -168
- package/stacks/blazor-azure/.morph/examples/micro-saas/README.md +0 -125
- package/stacks/blazor-azure/.morph/examples/micro-saas/contracts.cs +0 -358
- package/stacks/blazor-azure/.morph/examples/micro-saas/decisions.md +0 -246
- package/stacks/blazor-azure/.morph/examples/micro-saas/spec.md +0 -236
- package/stacks/blazor-azure/.morph/examples/micro-saas/tasks.md +0 -150
- package/stacks/blazor-azure/.morph/examples/multi-agent/README.md +0 -309
- package/stacks/blazor-azure/.morph/examples/multi-agent/contracts.cs +0 -433
- package/stacks/blazor-azure/.morph/examples/multi-agent/spec.md +0 -479
- package/stacks/blazor-azure/.morph/examples/multi-agent/tasks.md +0 -185
- package/stacks/blazor-azure/.morph/examples/scheduled-reports/decisions.md +0 -158
- package/stacks/blazor-azure/.morph/examples/scheduled-reports/proposal.md +0 -95
- package/stacks/blazor-azure/.morph/examples/scheduled-reports/spec.md +0 -267
- package/stacks/blazor-azure/.morph/examples/state-v3.json +0 -188
- package/stacks/blazor-azure/.morph/features/.gitkeep +0 -25
- package/stacks/blazor-azure/.morph/hooks/README.md +0 -348
- package/stacks/blazor-azure/.morph/hooks/pre-commit-agents.sh +0 -24
- package/stacks/blazor-azure/.morph/hooks/pre-commit-all.sh +0 -48
- package/stacks/blazor-azure/.morph/hooks/pre-commit-specs.sh +0 -49
- package/stacks/blazor-azure/.morph/hooks/task-completed.js +0 -73
- package/stacks/blazor-azure/.morph/hooks/teammate-idle.js +0 -68
- package/stacks/blazor-azure/.morph/schemas/agent.schema.json +0 -296
- package/stacks/blazor-azure/.morph/schemas/tasks.schema.json +0 -220
- package/stacks/blazor-azure/.morph/specs/.gitkeep +0 -20
- package/stacks/blazor-azure/.morph/standards/agent-framework-blazor-ui.md +0 -359
- package/stacks/blazor-azure/.morph/standards/agent-framework-production.md +0 -410
- package/stacks/blazor-azure/.morph/standards/agent-framework-setup.md +0 -413
- package/stacks/blazor-azure/.morph/standards/agent-framework-workflows.md +0 -349
- package/stacks/blazor-azure/.morph/standards/agent-teams-workflow.md +0 -474
- package/stacks/blazor-azure/.morph/standards/architecture.md +0 -325
- package/stacks/blazor-azure/.morph/standards/azure.md +0 -605
- package/stacks/blazor-azure/.morph/standards/coding.md +0 -377
- package/stacks/blazor-azure/.morph/standards/dotnet10-migration.md +0 -520
- package/stacks/blazor-azure/.morph/standards/fluent-ui-setup.md +0 -590
- package/stacks/blazor-azure/.morph/standards/migration-guide.md +0 -514
- package/stacks/blazor-azure/.morph/standards/passkeys-auth.md +0 -423
- package/stacks/blazor-azure/.morph/standards/vector-search-rag.md +0 -536
- package/stacks/blazor-azure/.morph/templates/CONTEXT-FEATURE.md +0 -276
- package/stacks/blazor-azure/.morph/templates/CONTEXT.md +0 -170
- package/stacks/blazor-azure/.morph/templates/FluentDesignTheme.cs +0 -149
- package/stacks/blazor-azure/.morph/templates/MudTheme.cs +0 -281
- package/stacks/blazor-azure/.morph/templates/agent.cs +0 -163
- package/stacks/blazor-azure/.morph/templates/clarify-questions.md +0 -159
- package/stacks/blazor-azure/.morph/templates/component.razor +0 -239
- package/stacks/blazor-azure/.morph/templates/contracts/Commands.cs +0 -74
- package/stacks/blazor-azure/.morph/templates/contracts/Entities.cs +0 -25
- package/stacks/blazor-azure/.morph/templates/contracts/Queries.cs +0 -74
- package/stacks/blazor-azure/.morph/templates/contracts/README.md +0 -74
- package/stacks/blazor-azure/.morph/templates/contracts.cs +0 -217
- package/stacks/blazor-azure/.morph/templates/decisions.md +0 -123
- package/stacks/blazor-azure/.morph/templates/design-system.css +0 -226
- package/stacks/blazor-azure/.morph/templates/infra/.dockerignore.example +0 -89
- package/stacks/blazor-azure/.morph/templates/infra/Dockerfile.example +0 -82
- package/stacks/blazor-azure/.morph/templates/infra/README.md +0 -286
- package/stacks/blazor-azure/.morph/templates/infra/app-insights.bicep +0 -63
- package/stacks/blazor-azure/.morph/templates/infra/app-service.bicep +0 -164
- package/stacks/blazor-azure/.morph/templates/infra/azure-pipelines-deploy.yml +0 -480
- package/stacks/blazor-azure/.morph/templates/infra/container-app-env.bicep +0 -49
- package/stacks/blazor-azure/.morph/templates/infra/container-app.bicep +0 -156
- package/stacks/blazor-azure/.morph/templates/infra/deploy-checklist.md +0 -426
- package/stacks/blazor-azure/.morph/templates/infra/deploy.ps1 +0 -229
- package/stacks/blazor-azure/.morph/templates/infra/deploy.sh +0 -208
- package/stacks/blazor-azure/.morph/templates/infra/key-vault.bicep +0 -91
- package/stacks/blazor-azure/.morph/templates/infra/main.bicep +0 -189
- package/stacks/blazor-azure/.morph/templates/infra/parameters.dev.json +0 -29
- package/stacks/blazor-azure/.morph/templates/infra/parameters.prod.json +0 -29
- package/stacks/blazor-azure/.morph/templates/infra/parameters.staging.json +0 -29
- package/stacks/blazor-azure/.morph/templates/infra/sql-database.bicep +0 -103
- package/stacks/blazor-azure/.morph/templates/infra/storage.bicep +0 -106
- package/stacks/blazor-azure/.morph/templates/integrations/asaas-client.cs +0 -387
- package/stacks/blazor-azure/.morph/templates/integrations/asaas-webhook.cs +0 -351
- package/stacks/blazor-azure/.morph/templates/integrations/azure-identity-config.cs +0 -288
- package/stacks/blazor-azure/.morph/templates/integrations/clerk-config.cs +0 -258
- package/stacks/blazor-azure/.morph/templates/job.cs +0 -171
- package/stacks/blazor-azure/.morph/templates/migration.cs +0 -83
- package/stacks/blazor-azure/.morph/templates/proposal.md +0 -141
- package/stacks/blazor-azure/.morph/templates/recap.md +0 -94
- package/stacks/blazor-azure/.morph/templates/repository.cs +0 -141
- package/stacks/blazor-azure/.morph/templates/saas/subscription.cs +0 -347
- package/stacks/blazor-azure/.morph/templates/saas/tenant.cs +0 -338
- package/stacks/blazor-azure/.morph/templates/service.cs +0 -139
- package/stacks/blazor-azure/.morph/templates/simulation.md +0 -353
- package/stacks/blazor-azure/.morph/templates/spec.md +0 -149
- package/stacks/blazor-azure/.morph/templates/sprint-status.yaml +0 -68
- package/stacks/blazor-azure/.morph/templates/state.template.json +0 -222
- package/stacks/blazor-azure/.morph/templates/story.md +0 -143
- package/stacks/blazor-azure/.morph/templates/tasks.md +0 -257
- package/stacks/blazor-azure/.morph/templates/test.cs +0 -239
- package/stacks/blazor-azure/.morph/templates/ui-components.md +0 -362
- package/stacks/blazor-azure/.morph/templates/ui-design-system.md +0 -286
- package/stacks/blazor-azure/.morph/templates/ui-flows.md +0 -336
- package/stacks/blazor-azure/.morph/templates/ui-mockups.md +0 -133
- package/stacks/blazor-azure/.morph/test-infra/example.bicep +0 -59
- package/stacks/nextjs-supabase/.claude/skills/level-2-domains/backend/dotnet-supabase.md +0 -244
- package/stacks/nextjs-supabase/.claude/skills/level-2-domains/frontend/nextjs-supabase.md +0 -335
- package/stacks/nextjs-supabase/.claude/skills/level-2-domains/infrastructure/easypanel-deployer.md +0 -189
- package/stacks/nextjs-supabase/.claude/skills/level-2-domains/integrations/supabase-expert.md +0 -170
- package/stacks/nextjs-supabase/.morph/docs/easypanel-setup.md +0 -169
- package/stacks/nextjs-supabase/.morph/docs/supabase-mcp-setup.md +0 -247
- package/stacks/nextjs-supabase/.morph/examples/crud-nextjs-supabase/README.md +0 -697
- package/stacks/nextjs-supabase/.morph/examples/crud-nextjs-supabase/spec.md +0 -85
- package/stacks/nextjs-supabase/.morph/examples/crud-nextjs-supabase/tasks.md +0 -86
- package/stacks/nextjs-supabase/.morph/examples/saas-nextjs-supabase/README.md +0 -498
- package/stacks/nextjs-supabase/.morph/examples/saas-nextjs-supabase/decisions.md +0 -121
- package/stacks/nextjs-supabase/.morph/examples/saas-nextjs-supabase/spec.md +0 -138
- package/stacks/nextjs-supabase/.morph/examples/saas-nextjs-supabase/tasks.md +0 -162
- package/stacks/nextjs-supabase/.morph/standards/easypanel-deploy.md +0 -191
- package/stacks/nextjs-supabase/.morph/standards/nextjs-patterns.md +0 -193
- package/stacks/nextjs-supabase/.morph/standards/supabase-auth.md +0 -171
- package/stacks/nextjs-supabase/.morph/standards/supabase-pgvector.md +0 -164
- package/stacks/nextjs-supabase/.morph/standards/supabase-rls.md +0 -179
- package/stacks/nextjs-supabase/.morph/standards/supabase-storage.md +0 -148
- package/stacks/nextjs-supabase/.morph/templates/contracts.cs +0 -173
- package/stacks/nextjs-supabase/.morph/templates/contracts.ts +0 -168
- package/stacks/nextjs-supabase/.morph/templates/decisions.md +0 -115
- package/stacks/nextjs-supabase/.morph/templates/dockerfile-api.dockerfile +0 -38
- package/stacks/nextjs-supabase/.morph/templates/dockerfile-web.dockerfile +0 -48
- package/stacks/nextjs-supabase/.morph/templates/proposal.md +0 -145
- package/stacks/nextjs-supabase/.morph/templates/recap.md +0 -134
- package/stacks/nextjs-supabase/.morph/templates/rls-policy.sql +0 -57
- package/stacks/nextjs-supabase/.morph/templates/spec.md +0 -231
- package/stacks/nextjs-supabase/.morph/templates/supabase-migration.sql +0 -100
- package/stacks/nextjs-supabase/.morph/templates/tasks.md +0 -257
- /package/src/commands/{search-patterns.js → learning/search-patterns.js} +0 -0
- /package/src/{lib → core/templates}/template-data-sources.js +0 -0
- /package/src/lib/{design-system-generator.js → generators/design-system-generator.js} +0 -0
- /package/src/lib/{learning-system.js → learning/learning-system.js} +0 -0
- /package/src/lib/validators/{package-validator.js → packages/package-validator.js} +0 -0
- /package/src/lib/validators/{ui-contrast-validator.js → ui/ui-contrast-validator.js} +0 -0
- /package/{src/generator → stacks/blazor-azure/.morph/templates}/.gitkeep +0 -0
- /package/{src/llm → stacks/nextjs-supabase/.morph/templates}/.gitkeep +0 -0
package/stacks/blazor-azure/.claude/skills/level-2-domains/infrastructure/bicep-architect.md
DELETED
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
# Bicep Architect
|
|
2
|
-
|
|
3
|
-
> **Layer:** 2 | **Load:** on-keyword | **Keywords:** bicep, iac, infrastructure as code, provision, azure resource, deploy
|
|
4
|
-
|
|
5
|
-
Especialista em Infrastructure as Code com Azure Bicep. **Zero Portal** — all infra via code.
|
|
6
|
-
|
|
7
|
-
## Structure
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
infra/
|
|
11
|
-
├── main.bicep # Entry point
|
|
12
|
-
├── main.bicepparam # Parameters (alt to JSON)
|
|
13
|
-
├── parameters.dev.json
|
|
14
|
-
├── parameters.prod.json
|
|
15
|
-
└── modules/
|
|
16
|
-
├── container-app.bicep
|
|
17
|
-
├── container-app-env.bicep
|
|
18
|
-
├── sql-database.bicep
|
|
19
|
-
├── storage.bicep
|
|
20
|
-
├── key-vault.bicep
|
|
21
|
-
├── app-insights.bicep
|
|
22
|
-
├── service-bus.bicep
|
|
23
|
-
└── redis-cache.bicep
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
## Main Template Pattern
|
|
27
|
-
|
|
28
|
-
```bicep
|
|
29
|
-
targetScope = 'resourceGroup'
|
|
30
|
-
|
|
31
|
-
@allowed(['dev', 'staging', 'prod'])
|
|
32
|
-
param environment string = 'dev'
|
|
33
|
-
param location string = resourceGroup().location
|
|
34
|
-
@minLength(3) @maxLength(20) param appName string
|
|
35
|
-
@secure() param sqlAdminPassword string
|
|
36
|
-
|
|
37
|
-
var resourcePrefix = '${appName}-${environment}'
|
|
38
|
-
var tags = { environment: environment, application: appName, managedBy: 'bicep' }
|
|
39
|
-
|
|
40
|
-
resource logAnalytics 'Microsoft.OperationalInsights/workspaces@2022-10-01' = {
|
|
41
|
-
name: '${resourcePrefix}-logs'
|
|
42
|
-
location: location
|
|
43
|
-
tags: tags
|
|
44
|
-
properties: { sku: { name: 'PerGB2018' }, retentionInDays: 30 }
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
module appInsights 'modules/app-insights.bicep' = { name: 'appInsights', params: { ... } }
|
|
48
|
-
module containerAppEnv 'modules/container-app-env.bicep' = { name: 'env', params: { ... } }
|
|
49
|
-
module containerApp 'modules/container-app.bicep' = { name: 'app', params: { ... } }
|
|
50
|
-
module sqlDatabase 'modules/sql-database.bicep' = { name: 'sql', params: { ... } }
|
|
51
|
-
module keyVault 'modules/key-vault.bicep' = { name: 'kv', params: { ... } }
|
|
52
|
-
|
|
53
|
-
output containerAppUrl string = containerApp.outputs.url
|
|
54
|
-
output sqlConnectionString string = sqlDatabase.outputs.connectionString
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
## SQL Database Module (Free Tier)
|
|
58
|
-
|
|
59
|
-
```bicep
|
|
60
|
-
// modules/sql-database.bicep
|
|
61
|
-
param serverName string
|
|
62
|
-
param databaseName string
|
|
63
|
-
param location string
|
|
64
|
-
param tags object = {}
|
|
65
|
-
param adminUsername string = 'sqladmin'
|
|
66
|
-
@secure() param adminPassword string
|
|
67
|
-
param useFree bool = true
|
|
68
|
-
|
|
69
|
-
resource sqlServer 'Microsoft.Sql/servers@2023-05-01-preview' = {
|
|
70
|
-
name: serverName
|
|
71
|
-
location: location
|
|
72
|
-
tags: tags
|
|
73
|
-
properties: { administratorLogin: adminUsername, administratorLoginPassword: adminPassword,
|
|
74
|
-
version: '12.0', minimalTlsVersion: '1.2', publicNetworkAccess: 'Enabled' }
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
resource db 'Microsoft.Sql/servers/databases@2023-05-01-preview' = {
|
|
78
|
-
parent: sqlServer
|
|
79
|
-
name: databaseName
|
|
80
|
-
location: location
|
|
81
|
-
sku: useFree ? { name: 'Free', tier: 'Free' } : { name: 'Basic', tier: 'Basic' }
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
resource firewall 'Microsoft.Sql/servers/firewallRules@2023-05-01-preview' = {
|
|
85
|
-
parent: sqlServer
|
|
86
|
-
name: 'AllowAllAzureIps'
|
|
87
|
-
properties: { startIpAddress: '0.0.0.0', endIpAddress: '0.0.0.0' }
|
|
88
|
-
}
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
> **Container App module:** See `container-specialist.md` for full Container App + ACR Bicep.
|
|
92
|
-
|
|
93
|
-
## Commands
|
|
94
|
-
|
|
95
|
-
```bash
|
|
96
|
-
az bicep build --file infra/main.bicep # Validate
|
|
97
|
-
az deployment group what-if -g rg-app-dev -f infra/main.bicep -p @infra/parameters.dev.json # Preview
|
|
98
|
-
az deployment group create -g rg-app-dev -f infra/main.bicep -p @infra/parameters.dev.json # Deploy
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
## Parameters File
|
|
102
|
-
|
|
103
|
-
```json
|
|
104
|
-
{
|
|
105
|
-
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
|
|
106
|
-
"contentVersion": "1.0.0.0",
|
|
107
|
-
"parameters": {
|
|
108
|
-
"environment": { "value": "dev" },
|
|
109
|
-
"appName": { "value": "myapp" },
|
|
110
|
-
"sqlAdminPassword": { "reference": { "keyVault": { "id": "/subscriptions/.../vaults/{kv}" }, "secretName": "sql-admin-password" } }
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
## Checklist
|
|
116
|
-
- [ ] Bicep valid (`az bicep build`)
|
|
117
|
-
- [ ] Modules for reusable resources
|
|
118
|
-
- [ ] Parameters for dev and prod
|
|
119
|
-
- [ ] Secrets referenced from Key Vault
|
|
120
|
-
- [ ] Tags on all resources
|
|
121
|
-
- [ ] What-if executed before deploy
|
|
122
|
-
- [ ] Outputs for important values
|
|
123
|
-
|
|
124
|
-
---
|
|
125
|
-
|
|
126
|
-
*MORPH-SPEC by Polymorphism Tech*
|
package/stacks/blazor-azure/.claude/skills/level-2-domains/infrastructure/container-specialist.md
DELETED
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
# Container Specialist
|
|
2
|
-
|
|
3
|
-
> **Layer:** 2 | **Load:** on-keyword | **Keywords:** docker, container, containerize, container apps, acr, registry, image
|
|
4
|
-
|
|
5
|
-
Especialista em containerização com Docker e deploy para Azure Container Apps.
|
|
6
|
-
|
|
7
|
-
## Dockerfile (.NET Multi-stage)
|
|
8
|
-
|
|
9
|
-
```dockerfile
|
|
10
|
-
FROM mcr.microsoft.com/dotnet/sdk:10.0-alpine AS build
|
|
11
|
-
WORKDIR /src
|
|
12
|
-
COPY ["src/Web/Web.csproj", "src/Web/"]
|
|
13
|
-
COPY ["src/Application/Application.csproj", "src/Application/"]
|
|
14
|
-
COPY ["src/Domain/Domain.csproj", "src/Domain/"]
|
|
15
|
-
COPY ["src/Infrastructure/Infrastructure.csproj", "src/Infrastructure/"]
|
|
16
|
-
RUN dotnet restore "src/Web/Web.csproj"
|
|
17
|
-
COPY . .
|
|
18
|
-
WORKDIR "/src/src/Web"
|
|
19
|
-
RUN dotnet publish "Web.csproj" -c Release -o /app/publish /p:UseAppHost=false
|
|
20
|
-
|
|
21
|
-
FROM mcr.microsoft.com/dotnet/aspnet:10.0-alpine AS final
|
|
22
|
-
WORKDIR /app
|
|
23
|
-
RUN addgroup -g 1000 appgroup && adduser -u 1000 -G appgroup -D appuser
|
|
24
|
-
COPY --from=publish /app/publish .
|
|
25
|
-
RUN chown -R appuser:appgroup /app
|
|
26
|
-
USER appuser
|
|
27
|
-
EXPOSE 8080
|
|
28
|
-
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
|
29
|
-
CMD wget --quiet --tries=1 --spider http://localhost:8080/health || exit 1
|
|
30
|
-
ENTRYPOINT ["dotnet", "Web.dll"]
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
### Image Sizes
|
|
34
|
-
| Base Image | Size |
|
|
35
|
-
|------------|------|
|
|
36
|
-
| `aspnet:10.0` | ~220MB |
|
|
37
|
-
| `aspnet:10.0-alpine` | ~110MB |
|
|
38
|
-
| `aspnet:10.0-chiseled` | ~80MB (most secure) |
|
|
39
|
-
|
|
40
|
-
## ACR (Azure Container Registry)
|
|
41
|
-
|
|
42
|
-
```bash
|
|
43
|
-
az acr create -g rg-myapp -n myappacr --sku Basic
|
|
44
|
-
az acr login -n myappacr
|
|
45
|
-
az acr build --registry myappacr --image myapp:v1 .
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
## Container App (Bicep)
|
|
49
|
-
|
|
50
|
-
```bicep
|
|
51
|
-
param name string
|
|
52
|
-
param location string
|
|
53
|
-
param tags object = {}
|
|
54
|
-
param environmentId string
|
|
55
|
-
param containerImage string
|
|
56
|
-
param registryServer string
|
|
57
|
-
param registryUsername string
|
|
58
|
-
@secure() param registryPassword string
|
|
59
|
-
|
|
60
|
-
resource containerApp 'Microsoft.App/containerApps@2023-05-01' = {
|
|
61
|
-
name: name
|
|
62
|
-
location: location
|
|
63
|
-
tags: tags
|
|
64
|
-
properties: {
|
|
65
|
-
managedEnvironmentId: environmentId
|
|
66
|
-
configuration: {
|
|
67
|
-
ingress: { external: true, targetPort: 8080, transport: 'http', allowInsecure: false }
|
|
68
|
-
registries: [{ server: registryServer, username: registryUsername, passwordSecretRef: 'reg-pwd' }]
|
|
69
|
-
secrets: [{ name: 'reg-pwd', value: registryPassword }]
|
|
70
|
-
}
|
|
71
|
-
template: {
|
|
72
|
-
containers: [{
|
|
73
|
-
name: name, image: containerImage
|
|
74
|
-
resources: { cpu: json('0.25'), memory: '0.5Gi' }
|
|
75
|
-
probes: [
|
|
76
|
-
{ type: 'Liveness', httpGet: { path: '/health', port: 8080 }, initialDelaySeconds: 10 }
|
|
77
|
-
{ type: 'Readiness', httpGet: { path: '/health/ready', port: 8080 }, initialDelaySeconds: 5 }
|
|
78
|
-
]
|
|
79
|
-
}]
|
|
80
|
-
scale: { minReplicas: 0, maxReplicas: 5
|
|
81
|
-
rules: [{ name: 'http-scale', http: { metadata: { concurrentRequests: '100' } } }]
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
output url string = 'https://${containerApp.properties.configuration.ingress.fqdn}'
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
## Health Checks (ASP.NET)
|
|
90
|
-
|
|
91
|
-
```csharp
|
|
92
|
-
builder.Services.AddHealthChecks()
|
|
93
|
-
.AddSqlServer(connString, name: "database", tags: new[] { "ready" });
|
|
94
|
-
|
|
95
|
-
app.MapHealthChecks("/health");
|
|
96
|
-
app.MapHealthChecks("/health/ready", new() { Predicate = c => c.Tags.Contains("ready") });
|
|
97
|
-
app.MapHealthChecks("/health/live", new() { Predicate = _ => false }); // Always healthy
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
## Docker Compose (Dev)
|
|
101
|
-
|
|
102
|
-
```yaml
|
|
103
|
-
services:
|
|
104
|
-
web:
|
|
105
|
-
build: { context: ., dockerfile: Dockerfile }
|
|
106
|
-
ports: ["8080:8080"]
|
|
107
|
-
environment:
|
|
108
|
-
- ConnectionStrings__Default=Server=db;Database=App;User=sa;Password=Pass!;TrustServerCertificate=true
|
|
109
|
-
depends_on: { db: { condition: service_healthy } }
|
|
110
|
-
db:
|
|
111
|
-
image: mcr.microsoft.com/mssql/server:2022-latest
|
|
112
|
-
environment: [ACCEPT_EULA=Y, SA_PASSWORD=YourStrong!Passw0rd]
|
|
113
|
-
ports: ["1433:1433"]
|
|
114
|
-
volumes: [sqldata:/var/opt/mssql]
|
|
115
|
-
volumes:
|
|
116
|
-
sqldata:
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
## Checklist
|
|
120
|
-
- [ ] Dockerfile multi-stage with alpine/chiseled
|
|
121
|
-
- [ ] .dockerignore configured
|
|
122
|
-
- [ ] Non-root user in container
|
|
123
|
-
- [ ] Health checks (liveness + readiness)
|
|
124
|
-
- [ ] Docker Compose for dev
|
|
125
|
-
- [ ] ACR created and configured
|
|
126
|
-
- [ ] Container App with scale-to-zero
|
|
127
|
-
- [ ] Probes configured
|
|
128
|
-
|
|
129
|
-
---
|
|
130
|
-
|
|
131
|
-
*MORPH-SPEC by Polymorphism Tech*
|
package/stacks/blazor-azure/.claude/skills/level-2-domains/infrastructure/devops-engineer.md
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
# DevOps Engineer
|
|
2
|
-
|
|
3
|
-
> **Layer:** 2 | **Load:** on-keyword | **Keywords:** pipeline, ci/cd, deploy, release, azure devops, github actions, build, automation
|
|
4
|
-
|
|
5
|
-
Especialista em CI/CD, pipelines e automação de deploy.
|
|
6
|
-
|
|
7
|
-
## Azure Pipelines
|
|
8
|
-
|
|
9
|
-
```yaml
|
|
10
|
-
trigger:
|
|
11
|
-
branches: { include: [main, develop] }
|
|
12
|
-
paths: { exclude: ['**/*.md'] }
|
|
13
|
-
|
|
14
|
-
variables:
|
|
15
|
-
buildConfiguration: 'Release'
|
|
16
|
-
dotnetVersion: '10.0.x'
|
|
17
|
-
|
|
18
|
-
stages:
|
|
19
|
-
- stage: Build
|
|
20
|
-
jobs:
|
|
21
|
-
- job: BuildJob
|
|
22
|
-
pool: { vmImage: 'ubuntu-latest' }
|
|
23
|
-
steps:
|
|
24
|
-
- task: UseDotNet@2
|
|
25
|
-
inputs: { version: '$(dotnetVersion)' }
|
|
26
|
-
- task: DotNetCoreCLI@2
|
|
27
|
-
displayName: 'Restore'
|
|
28
|
-
inputs: { command: 'restore', projects: '**/*.csproj' }
|
|
29
|
-
- task: DotNetCoreCLI@2
|
|
30
|
-
displayName: 'Build'
|
|
31
|
-
inputs: { command: 'build', arguments: '-c $(buildConfiguration) --no-restore' }
|
|
32
|
-
- task: DotNetCoreCLI@2
|
|
33
|
-
displayName: 'Test'
|
|
34
|
-
inputs: { command: 'test', projects: '**/tests/**/*.csproj', arguments: '--collect:"XPlat Code Coverage"' }
|
|
35
|
-
- task: DotNetCoreCLI@2
|
|
36
|
-
displayName: 'Publish'
|
|
37
|
-
inputs: { command: 'publish', publishWebProjects: true, arguments: '-c $(buildConfiguration) -o $(Build.ArtifactStagingDirectory)' }
|
|
38
|
-
- task: PublishBuildArtifacts@1
|
|
39
|
-
inputs: { pathToPublish: '$(Build.ArtifactStagingDirectory)', artifactName: 'drop' }
|
|
40
|
-
|
|
41
|
-
- stage: DeployDev
|
|
42
|
-
dependsOn: Build
|
|
43
|
-
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/develop'))
|
|
44
|
-
jobs:
|
|
45
|
-
- deployment: Deploy
|
|
46
|
-
environment: 'development'
|
|
47
|
-
strategy:
|
|
48
|
-
runOnce:
|
|
49
|
-
deploy:
|
|
50
|
-
steps:
|
|
51
|
-
- task: AzureCLI@2
|
|
52
|
-
inputs:
|
|
53
|
-
scriptType: 'bash'
|
|
54
|
-
inlineScript: 'az containerapp update --name app-dev -g rg-dev --image $(image)'
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
## GitHub Actions
|
|
58
|
-
|
|
59
|
-
```yaml
|
|
60
|
-
name: CI/CD
|
|
61
|
-
on:
|
|
62
|
-
push: { branches: [main, develop] }
|
|
63
|
-
pull_request: { branches: [main] }
|
|
64
|
-
|
|
65
|
-
jobs:
|
|
66
|
-
build:
|
|
67
|
-
runs-on: ubuntu-latest
|
|
68
|
-
steps:
|
|
69
|
-
- uses: actions/checkout@v4
|
|
70
|
-
- uses: actions/setup-dotnet@v4
|
|
71
|
-
with: { dotnet-version: '10.0.x' }
|
|
72
|
-
- run: dotnet restore && dotnet build -c Release --no-restore && dotnet test -c Release --no-build
|
|
73
|
-
- run: dotnet publish src/Web/Web.csproj -c Release -o ./publish
|
|
74
|
-
|
|
75
|
-
docker:
|
|
76
|
-
needs: build
|
|
77
|
-
if: github.event_name == 'push'
|
|
78
|
-
runs-on: ubuntu-latest
|
|
79
|
-
permissions: { contents: read, packages: write }
|
|
80
|
-
steps:
|
|
81
|
-
- uses: actions/checkout@v4
|
|
82
|
-
- uses: docker/login-action@v3
|
|
83
|
-
with: { registry: ghcr.io, username: '${{ github.actor }}', password: '${{ secrets.GITHUB_TOKEN }}' }
|
|
84
|
-
- uses: docker/build-push-action@v5
|
|
85
|
-
with: { push: true, tags: 'ghcr.io/${{ github.repository }}:${{ github.sha }}' }
|
|
86
|
-
|
|
87
|
-
deploy:
|
|
88
|
-
needs: docker
|
|
89
|
-
if: github.ref == 'refs/heads/main'
|
|
90
|
-
runs-on: ubuntu-latest
|
|
91
|
-
environment: production
|
|
92
|
-
steps:
|
|
93
|
-
- uses: azure/login@v2
|
|
94
|
-
with: { creds: '${{ secrets.AZURE_CREDENTIALS }}' }
|
|
95
|
-
- uses: azure/container-apps-deploy-action@v1
|
|
96
|
-
with: { resourceGroup: rg-prod, containerAppName: app-prod, imageToDeploy: 'ghcr.io/${{ github.repository }}:${{ github.sha }}' }
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
> **Dockerfile:** See `container-specialist.md` for optimized multi-stage Dockerfile.
|
|
100
|
-
|
|
101
|
-
## Secrets Management
|
|
102
|
-
|
|
103
|
-
| Platform | Method |
|
|
104
|
-
|----------|--------|
|
|
105
|
-
| Azure DevOps | Variable Groups + Key Vault references |
|
|
106
|
-
| GitHub Actions | Repository/Environment Secrets |
|
|
107
|
-
|
|
108
|
-
## Checklist
|
|
109
|
-
- [ ] Trigger configured (branches, paths)
|
|
110
|
-
- [ ] Build: restore, build, test, publish
|
|
111
|
-
- [ ] Code coverage published
|
|
112
|
-
- [ ] Deploy to dev automatic (develop branch)
|
|
113
|
-
- [ ] Deploy to prod with approval (main branch)
|
|
114
|
-
- [ ] Secrets in Key Vault or variable groups
|
|
115
|
-
- [ ] Health check after deploy
|
|
116
|
-
|
|
117
|
-
---
|
|
118
|
-
|
|
119
|
-
*MORPH-SPEC by Polymorphism Tech*
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
# Asaas Financial
|
|
2
|
-
|
|
3
|
-
> **Layer:** 2 | **Load:** on-keyword | **Keywords:** asaas, payment, pix, boleto, cobranca, subscription, billing, pagamento
|
|
4
|
-
|
|
5
|
-
Integração com Asaas para pagamentos no Brasil. API REST, sem SDK .NET oficial. Suporta PIX, Boleto, Cartão.
|
|
6
|
-
|
|
7
|
-
## Setup
|
|
8
|
-
|
|
9
|
-
```csharp
|
|
10
|
-
// appsettings.json
|
|
11
|
-
{ "Asaas": { "BaseUrl": "https://sandbox.asaas.com/api/v3", "ApiKey": "${ASAAS_API_KEY}" } }
|
|
12
|
-
|
|
13
|
-
// Program.cs
|
|
14
|
-
builder.Services.Configure<AsaasOptions>(builder.Configuration.GetSection("Asaas"));
|
|
15
|
-
builder.Services.AddHttpClient<IAsaasClient, AsaasClient>((sp, client) =>
|
|
16
|
-
{
|
|
17
|
-
var options = sp.GetRequiredService<IOptions<AsaasOptions>>().Value;
|
|
18
|
-
client.BaseAddress = new Uri(options.BaseUrl);
|
|
19
|
-
client.DefaultRequestHeaders.Add("access_token", options.ApiKey);
|
|
20
|
-
client.DefaultRequestHeaders.Add("User-Agent", "MyApp/1.0");
|
|
21
|
-
});
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
## Client Interface
|
|
25
|
-
|
|
26
|
-
```csharp
|
|
27
|
-
public interface IAsaasClient
|
|
28
|
-
{
|
|
29
|
-
Task<AsaasCustomer> CreateCustomerAsync(CreateCustomerRequest request);
|
|
30
|
-
Task<AsaasPayment> CreatePaymentAsync(CreatePaymentRequest request);
|
|
31
|
-
Task<AsaasPayment> GetPaymentAsync(string paymentId);
|
|
32
|
-
Task<AsaasSubscription> CreateSubscriptionAsync(CreateSubscriptionRequest request);
|
|
33
|
-
}
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
Implementation: standard `HttpClient.PostAsJsonAsync` / `GetAsync` + `ReadFromJsonAsync` pattern. Log errors, throw `AsaasException` on failure.
|
|
37
|
-
|
|
38
|
-
## DTOs (all use `[JsonPropertyName]`)
|
|
39
|
-
|
|
40
|
-
```csharp
|
|
41
|
-
public record CreateCustomerRequest
|
|
42
|
-
{
|
|
43
|
-
[JsonPropertyName("name")] public required string Name { get; init; }
|
|
44
|
-
[JsonPropertyName("cpfCnpj")] public required string CpfCnpj { get; init; } // REQUIRED even in sandbox
|
|
45
|
-
[JsonPropertyName("email")] public string? Email { get; init; }
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
public record CreatePaymentRequest
|
|
49
|
-
{
|
|
50
|
-
[JsonPropertyName("customer")] public required string Customer { get; init; }
|
|
51
|
-
[JsonPropertyName("billingType")] public required string BillingType { get; init; } // BOLETO, PIX, CREDIT_CARD
|
|
52
|
-
[JsonPropertyName("value")] public required decimal Value { get; init; }
|
|
53
|
-
[JsonPropertyName("dueDate")] public required string DueDate { get; init; } // yyyy-MM-dd
|
|
54
|
-
[JsonPropertyName("description")] public string? Description { get; init; }
|
|
55
|
-
[JsonPropertyName("externalReference")] public string? ExternalReference { get; init; }
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
public record AsaasPayment
|
|
59
|
-
{
|
|
60
|
-
[JsonPropertyName("id")] public string Id { get; init; } = "";
|
|
61
|
-
[JsonPropertyName("status")] public string Status { get; init; } = ""; // PENDING, RECEIVED, CONFIRMED, OVERDUE
|
|
62
|
-
[JsonPropertyName("invoiceUrl")] public string? InvoiceUrl { get; init; }
|
|
63
|
-
[JsonPropertyName("bankSlipUrl")] public string? BankSlipUrl { get; init; }
|
|
64
|
-
[JsonPropertyName("pixQrCode")] public AsaasPixQrCode? PixQrCode { get; init; }
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
public record AsaasPixQrCode
|
|
68
|
-
{
|
|
69
|
-
[JsonPropertyName("encodedImage")] public string? EncodedImage { get; init; } // Base64
|
|
70
|
-
[JsonPropertyName("payload")] public string? Payload { get; init; } // PIX copia-e-cola
|
|
71
|
-
}
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
Follow same pattern for `CreateSubscriptionRequest` (add `cycle`: MONTHLY/WEEKLY/YEARLY, `nextDueDate`).
|
|
75
|
-
|
|
76
|
-
## Webhooks
|
|
77
|
-
|
|
78
|
-
```csharp
|
|
79
|
-
[ApiController, Route("api/webhooks/asaas")]
|
|
80
|
-
public class AsaasWebhookController(IPaymentService payments, ILogger<AsaasWebhookController> logger) : ControllerBase
|
|
81
|
-
{
|
|
82
|
-
[HttpPost]
|
|
83
|
-
public async Task<IActionResult> Handle([FromBody] AsaasWebhookPayload payload)
|
|
84
|
-
{
|
|
85
|
-
logger.LogInformation("Asaas webhook: {Event} payment {Id}", payload.Event, payload.Payment?.Id);
|
|
86
|
-
switch (payload.Event)
|
|
87
|
-
{
|
|
88
|
-
case "PAYMENT_CONFIRMED": case "PAYMENT_RECEIVED":
|
|
89
|
-
await payments.ConfirmPaymentAsync(payload.Payment!.Id); break;
|
|
90
|
-
case "PAYMENT_OVERDUE":
|
|
91
|
-
await payments.MarkOverdueAsync(payload.Payment!.Id); break;
|
|
92
|
-
case "PAYMENT_REFUNDED":
|
|
93
|
-
await payments.RefundPaymentAsync(payload.Payment!.Id); break;
|
|
94
|
-
}
|
|
95
|
-
return Ok();
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
## Environments
|
|
101
|
-
|
|
102
|
-
| Environment | Base URL |
|
|
103
|
-
|-------------|----------|
|
|
104
|
-
| Sandbox | `https://sandbox.asaas.com/api/v3` |
|
|
105
|
-
| Production | `https://www.asaas.com/api/v3` |
|
|
106
|
-
|
|
107
|
-
## Gotchas
|
|
108
|
-
|
|
109
|
-
| Issue | Fix |
|
|
110
|
-
|-------|-----|
|
|
111
|
-
| PIX QR Code returns Base64, NOT URL | `$"data:image/png;base64,{response.EncodedImage}"` |
|
|
112
|
-
| CPF required even in sandbox | Always include `cpfCnpj` in CreateCustomer |
|
|
113
|
-
| Missing `User-Agent` header | Add to HttpClient defaults |
|
|
114
|
-
| Date format must be `yyyy-MM-dd` | `DateTime.Today.AddDays(1).ToString("yyyy-MM-dd")` |
|
|
115
|
-
|
|
116
|
-
## Checklist
|
|
117
|
-
|
|
118
|
-
- [ ] API Key configured (not hardcoded)
|
|
119
|
-
- [ ] HttpClient with retry policy (Polly)
|
|
120
|
-
- [ ] Headers: `access_token` + `User-Agent`
|
|
121
|
-
- [ ] CPF/CNPJ always included for customers
|
|
122
|
-
- [ ] PIX QR Code → data URI conversion
|
|
123
|
-
- [ ] Dates in `yyyy-MM-dd` format
|
|
124
|
-
- [ ] Webhook endpoint + signature validation
|
|
125
|
-
- [ ] ExternalReference for reconciliation
|
|
126
|
-
- [ ] Tests with sandbox
|
|
127
|
-
|
|
128
|
-
---
|
|
129
|
-
|
|
130
|
-
*MORPH-SPEC by Polymorphism Tech*
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
# Azure Identity (Microsoft Identity)
|
|
2
|
-
|
|
3
|
-
> **Layer:** 2 | **Load:** on-keyword | **Keywords:** identity, entra, azure ad, microsoft auth, msal, oauth, oidc, microsoft identity
|
|
4
|
-
|
|
5
|
-
Microsoft Identity Platform for .NET/Blazor. SDK: `Microsoft.Identity.Web`.
|
|
6
|
-
|
|
7
|
-
## Setup
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
dotnet add package Microsoft.Identity.Web
|
|
11
|
-
dotnet add package Microsoft.Identity.Web.UI # For Blazor
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
```json
|
|
15
|
-
// appsettings.json
|
|
16
|
-
{ "AzureAd": {
|
|
17
|
-
"Instance": "https://login.microsoftonline.com/",
|
|
18
|
-
"Domain": "yourdomain.onmicrosoft.com",
|
|
19
|
-
"TenantId": "your-tenant-id",
|
|
20
|
-
"ClientId": "your-client-id",
|
|
21
|
-
"ClientSecret": "${AZURE_AD_CLIENT_SECRET}",
|
|
22
|
-
"CallbackPath": "/signin-oidc"
|
|
23
|
-
} }
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
```csharp
|
|
27
|
-
// Program.cs
|
|
28
|
-
builder.Services.AddAuthentication(OpenIdConnectDefaults.AuthenticationScheme)
|
|
29
|
-
.AddMicrosoftIdentityWebApp(builder.Configuration.GetSection("AzureAd"));
|
|
30
|
-
builder.Services.AddControllersWithViews().AddMicrosoftIdentityUI();
|
|
31
|
-
builder.Services.AddAuthorization();
|
|
32
|
-
app.UseAuthentication();
|
|
33
|
-
app.UseAuthorization();
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
## Blazor Server
|
|
37
|
-
|
|
38
|
-
```csharp
|
|
39
|
-
// Additional setup
|
|
40
|
-
builder.Services.AddServerSideBlazor().AddMicrosoftIdentityConsentHandler();
|
|
41
|
-
|
|
42
|
-
// App.razor
|
|
43
|
-
<CascadingAuthenticationState>
|
|
44
|
-
<Router AppAssembly="@typeof(App).Assembly">
|
|
45
|
-
<Found Context="routeData">
|
|
46
|
-
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)">
|
|
47
|
-
<NotAuthorized>
|
|
48
|
-
@if (!context.User.Identity?.IsAuthenticated ?? true) { <RedirectToLogin /> }
|
|
49
|
-
else { <p>No permission.</p> }
|
|
50
|
-
</NotAuthorized>
|
|
51
|
-
</AuthorizeRouteView>
|
|
52
|
-
</Found>
|
|
53
|
-
</Router>
|
|
54
|
-
</CascadingAuthenticationState>
|
|
55
|
-
|
|
56
|
-
// RedirectToLogin.razor
|
|
57
|
-
@inject NavigationManager Nav
|
|
58
|
-
@code {
|
|
59
|
-
protected override void OnInitialized() =>
|
|
60
|
-
Nav.NavigateTo($"MicrosoftIdentity/Account/SignIn?redirectUri={Uri.EscapeDataString(Nav.Uri)}", forceLoad: true);
|
|
61
|
-
}
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
## Protected Pages
|
|
65
|
-
|
|
66
|
-
```razor
|
|
67
|
-
@page "/secure"
|
|
68
|
-
@attribute [Authorize]
|
|
69
|
-
|
|
70
|
-
<AuthorizeView>
|
|
71
|
-
<Authorized>Welcome, @context.User.Identity?.Name!</Authorized>
|
|
72
|
-
</AuthorizeView>
|
|
73
|
-
|
|
74
|
-
<AuthorizeView Roles="Admin"><Authorized><AdminPanel /></Authorized></AuthorizeView>
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
## API Protection
|
|
78
|
-
|
|
79
|
-
```csharp
|
|
80
|
-
// API Program.cs
|
|
81
|
-
builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
|
|
82
|
-
.AddMicrosoftIdentityWebApi(builder.Configuration.GetSection("AzureAd"));
|
|
83
|
-
|
|
84
|
-
// Controller
|
|
85
|
-
[ApiController, Route("api/[controller]"), Authorize]
|
|
86
|
-
public class ProfileController : ControllerBase
|
|
87
|
-
{
|
|
88
|
-
[HttpGet]
|
|
89
|
-
public IActionResult GetProfile() => Ok(new {
|
|
90
|
-
UserId = User.FindFirst(ClaimTypes.NameIdentifier)?.Value,
|
|
91
|
-
Name = User.Identity?.Name
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
[HttpGet("admin"), Authorize(Roles = "Admin")]
|
|
95
|
-
public IActionResult AdminOnly() => Ok("Admin access");
|
|
96
|
-
}
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
## Downstream APIs (Microsoft Graph)
|
|
100
|
-
|
|
101
|
-
```csharp
|
|
102
|
-
builder.Services.AddAuthentication(OpenIdConnectDefaults.AuthenticationScheme)
|
|
103
|
-
.AddMicrosoftIdentityWebApp(builder.Configuration.GetSection("AzureAd"))
|
|
104
|
-
.EnableTokenAcquisitionToCallDownstreamApi()
|
|
105
|
-
.AddMicrosoftGraph(builder.Configuration.GetSection("Graph"))
|
|
106
|
-
.AddInMemoryTokenCaches();
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
## Authorization Policies
|
|
110
|
-
|
|
111
|
-
```csharp
|
|
112
|
-
builder.Services.AddAuthorization(o => {
|
|
113
|
-
o.AddPolicy("RequireAdmin", p => p.RequireRole("Admin"));
|
|
114
|
-
o.AddPolicy("RequireManager", p => p.RequireAssertion(c =>
|
|
115
|
-
c.User.IsInRole("Admin") || c.User.IsInRole("Manager")));
|
|
116
|
-
});
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
## Multi-tenant & B2C
|
|
120
|
-
|
|
121
|
-
```json
|
|
122
|
-
// Multi-tenant: TenantId = "common" or "organizations"
|
|
123
|
-
// Then validate allowed tenants in TokenValidationParameters.IssuerValidator
|
|
124
|
-
|
|
125
|
-
// B2C: Use "AzureAdB2C" section with SignUpSignInPolicyId, ResetPasswordPolicyId
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
## Checklist
|
|
129
|
-
|
|
130
|
-
- [ ] App registered in Azure Portal
|
|
131
|
-
- [ ] Client ID + Tenant ID configured
|
|
132
|
-
- [ ] Client Secret in Key Vault
|
|
133
|
-
- [ ] Redirect URIs configured
|
|
134
|
-
- [ ] API permissions defined
|
|
135
|
-
- [ ] Token caching configured
|
|
136
|
-
- [ ] Authorization policies created
|
|
137
|
-
- [ ] Logout flow implemented
|
|
138
|
-
- [ ] Token expiry error handling
|
|
139
|
-
|
|
140
|
-
---
|
|
141
|
-
|
|
142
|
-
*MORPH-SPEC by Polymorphism Tech*
|