@polymorphism-tech/morph-spec 3.0.1 → 3.2.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/CLAUDE.md +561 -63
- package/LICENSE +72 -72
- package/README.md +275 -79
- package/bin/detect-agents.js +3 -1
- package/bin/morph-spec.js +60 -1
- package/bin/render-template.js +61 -14
- package/bin/semantic-detect-agents.js +2 -1
- package/bin/{task-manager.js → task-manager.cjs} +113 -8
- package/bin/validate-agents-skills.js +10 -4
- package/bin/validate-agents.js +4 -3
- package/docs/api/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +977 -977
- package/docs/api/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +1048 -1048
- package/docs/api/scripts/collapse.js +38 -38
- package/docs/api/scripts/commonNav.js +28 -28
- package/docs/api/scripts/linenumber.js +25 -25
- package/docs/api/scripts/nav.js +12 -12
- package/docs/api/scripts/polyfill.js +3 -3
- package/docs/api/scripts/prettify/Apache-License-2.0.txt +202 -202
- package/docs/api/scripts/prettify/lang-css.js +2 -2
- package/docs/api/scripts/prettify/prettify.js +28 -28
- package/docs/api/scripts/search.js +98 -98
- package/docs/api/styles/jsdoc.css +776 -776
- package/docs/api/styles/prettify.css +80 -80
- package/docs/cli-auto-detection.md +219 -0
- package/docs/examples.md +328 -328
- package/docs/getting-started.md +3 -3
- package/docs/llm-interaction-config.md +735 -0
- package/docs/templates.md +418 -418
- package/docs/troubleshooting.md +269 -0
- package/package.json +7 -3
- package/scripts/postinstall.js +132 -132
- package/scripts/reorganize-skills.cjs +1 -1
- package/scripts/validate-agents-structure.cjs +1 -1
- package/scripts/validate-skills.cjs +2 -2
- package/src/commands/advance-phase.js +93 -2
- package/src/commands/analyze-blazor-concurrency.js +193 -193
- package/src/commands/approve.js +221 -0
- package/src/commands/capture-pattern.js +121 -0
- package/src/commands/create-story.js +5 -2
- package/src/commands/deploy.js +780 -780
- package/src/commands/detect-agents.js +4 -2
- package/src/commands/generate.js +276 -149
- package/src/commands/init.js +37 -0
- package/src/commands/lint-fluent.js +352 -352
- package/src/commands/migrate-state.js +158 -0
- package/src/commands/rollback-phase.js +185 -185
- package/src/commands/search-patterns.js +126 -0
- package/src/commands/session-summary.js +291 -291
- package/src/commands/shard-spec.js +224 -224
- package/src/commands/spawn-team.js +172 -0
- package/src/commands/sprint-status.js +250 -250
- package/src/commands/task.js +3 -3
- package/src/commands/troubleshoot.js +222 -222
- package/src/commands/update.js +36 -0
- package/src/commands/upgrade.js +346 -0
- package/src/commands/validate-blazor-state.js +210 -210
- package/src/commands/validate-blazor.js +156 -156
- package/src/commands/validate-css.js +84 -84
- package/src/commands/validate-phase.js +221 -221
- package/src/generator/.gitkeep +0 -0
- package/src/generator/config-generator.js +206 -0
- package/src/generator/templates/config.json.template +40 -0
- package/src/generator/templates/project.md.template +67 -0
- package/src/lib/blazor-concurrency-analyzer.js +288 -288
- package/src/lib/blazor-state-validator.js +291 -291
- package/src/lib/blazor-validator.js +374 -374
- package/src/lib/checkpoint-hooks.js +258 -0
- package/src/lib/context-generator.js +7 -4
- package/src/lib/css-validator.js +352 -352
- package/src/lib/design-system-generator.js +298 -298
- package/src/lib/hook-executor.js +2 -1
- package/src/lib/learning-system.js +520 -520
- package/src/lib/metadata-extractor.js +380 -0
- package/src/lib/mockup-generator.js +366 -366
- package/src/lib/phase-state-machine.js +214 -0
- package/src/lib/stack-resolver.js +148 -0
- package/src/lib/standards-context-injector.js +4 -3
- package/src/lib/state-manager.js +120 -0
- package/src/lib/team-orchestrator.js +2 -1
- package/src/lib/template-data-sources.js +325 -0
- package/src/lib/troubleshoot-grep.js +204 -194
- package/src/lib/troubleshoot-index.js +144 -144
- package/src/lib/ui-detector.js +350 -350
- package/src/lib/validation-runner.js +2 -1
- package/src/lib/validators/architecture-validator.js +387 -387
- package/src/lib/validators/content-validator.js +351 -0
- package/src/lib/validators/package-validator.js +360 -360
- package/src/lib/validators/ui-contrast-validator.js +422 -422
- package/src/llm/.gitkeep +0 -0
- package/src/llm/analyzer.js +215 -0
- package/src/llm/environment-detector.js +43 -0
- package/src/llm/few-shot-examples.js +216 -0
- package/src/llm/project-config-schema.json +188 -0
- package/src/llm/prompt-builder.js +96 -0
- package/src/llm/schema-validator.js +121 -0
- package/src/orchestrator.js +206 -0
- package/src/sanitizer/.gitkeep +0 -0
- package/src/sanitizer/context-sanitizer.js +221 -0
- package/src/sanitizer/patterns.js +163 -0
- package/src/scanner/.gitkeep +0 -0
- package/src/scanner/project-scanner.js +242 -0
- package/src/types/index.js +477 -0
- package/src/ui/.gitkeep +0 -0
- package/src/ui/diff-display.js +91 -0
- package/src/ui/interactive-wizard.js +96 -0
- package/src/ui/user-review.js +211 -0
- package/src/ui/wizard-questions.js +190 -0
- package/src/utils/file-copier.js +3 -1
- package/src/utils/logger.js +32 -32
- package/src/utils/version-checker.js +175 -175
- package/src/writer/.gitkeep +0 -0
- package/src/writer/file-writer.js +86 -0
- package/{content → stacks/blazor-azure}/.azure/README.md +2 -2
- package/{content → stacks/blazor-azure}/.azure/pipelines/pipeline-variables.yml +1 -1
- package/{content → stacks/blazor-azure}/.azure/pipelines/prod-pipeline.yml +1 -1
- package/{content → stacks/blazor-azure}/.azure/pipelines/staging-pipeline.yml +1 -1
- package/{content → stacks/blazor-azure}/.claude/commands/morph-preflight.md +227 -227
- package/{content → stacks/blazor-azure}/.claude/commands/morph-troubleshoot.md +122 -122
- package/{content → stacks/blazor-azure}/.claude/skills/level-1-workflows/phase-setup.md +1 -1
- package/{content → stacks/blazor-azure}/.morph/docs/workflows/enforcement-pipeline.md +3 -3
- package/{content → stacks/blazor-azure}/.morph/hooks/README.md +12 -12
- package/{content → stacks/blazor-azure}/.morph/standards/agent-teams-workflow.md +2 -2
- package/{content → stacks/blazor-azure}/.morph/standards/migration-guide.md +2 -2
- package/{content → stacks/blazor-azure}/.morph/templates/infra/deploy-checklist.md +426 -426
- package/stacks/nextjs-supabase/.claude/skills/level-2-domains/backend/dotnet-supabase.md +244 -0
- package/stacks/nextjs-supabase/.claude/skills/level-2-domains/frontend/nextjs-supabase.md +335 -0
- package/stacks/nextjs-supabase/.claude/skills/level-2-domains/infrastructure/easypanel-deployer.md +189 -0
- package/stacks/nextjs-supabase/.claude/skills/level-2-domains/integrations/supabase-expert.md +170 -0
- package/stacks/nextjs-supabase/.morph/config/agents.json +345 -0
- package/stacks/nextjs-supabase/.morph/config/config.template.json +92 -0
- package/stacks/nextjs-supabase/.morph/docs/easypanel-setup.md +169 -0
- package/stacks/nextjs-supabase/.morph/docs/supabase-mcp-setup.md +247 -0
- package/stacks/nextjs-supabase/.morph/examples/crud-nextjs-supabase/README.md +697 -0
- package/stacks/nextjs-supabase/.morph/examples/crud-nextjs-supabase/spec.md +85 -0
- package/stacks/nextjs-supabase/.morph/examples/crud-nextjs-supabase/tasks.md +86 -0
- package/stacks/nextjs-supabase/.morph/examples/saas-nextjs-supabase/README.md +498 -0
- package/stacks/nextjs-supabase/.morph/examples/saas-nextjs-supabase/decisions.md +121 -0
- package/stacks/nextjs-supabase/.morph/examples/saas-nextjs-supabase/spec.md +138 -0
- package/stacks/nextjs-supabase/.morph/examples/saas-nextjs-supabase/tasks.md +162 -0
- package/stacks/nextjs-supabase/.morph/project.md +168 -0
- package/stacks/nextjs-supabase/.morph/standards/easypanel-deploy.md +191 -0
- package/stacks/nextjs-supabase/.morph/standards/nextjs-patterns.md +193 -0
- package/stacks/nextjs-supabase/.morph/standards/supabase-auth.md +171 -0
- package/stacks/nextjs-supabase/.morph/standards/supabase-pgvector.md +164 -0
- package/stacks/nextjs-supabase/.morph/standards/supabase-rls.md +179 -0
- package/stacks/nextjs-supabase/.morph/standards/supabase-storage.md +148 -0
- package/stacks/nextjs-supabase/.morph/templates/contracts.cs +173 -0
- package/stacks/nextjs-supabase/.morph/templates/contracts.ts +168 -0
- package/stacks/nextjs-supabase/.morph/templates/decisions.md +115 -0
- package/stacks/nextjs-supabase/.morph/templates/dockerfile-api.dockerfile +38 -0
- package/stacks/nextjs-supabase/.morph/templates/dockerfile-web.dockerfile +48 -0
- package/stacks/nextjs-supabase/.morph/templates/proposal.md +145 -0
- package/stacks/nextjs-supabase/.morph/templates/recap.md +134 -0
- package/stacks/nextjs-supabase/.morph/templates/rls-policy.sql +57 -0
- package/stacks/nextjs-supabase/.morph/templates/spec.md +231 -0
- package/stacks/nextjs-supabase/.morph/templates/supabase-migration.sql +100 -0
- package/stacks/nextjs-supabase/.morph/templates/tasks.md +257 -0
- package/stacks/nextjs-supabase/CLAUDE.md +149 -0
- package/stacks/nextjs-supabase/README.md +112 -0
- /package/{content → stacks/blazor-azure}/.azure/docs/azure-devops-setup.md +0 -0
- /package/{content → stacks/blazor-azure}/.azure/docs/branch-strategy.md +0 -0
- /package/{content → stacks/blazor-azure}/.azure/docs/local-development.md +0 -0
- /package/{content → stacks/blazor-azure}/.azure/pipelines/templates/build-dotnet.yml +0 -0
- /package/{content → stacks/blazor-azure}/.azure/pipelines/templates/deploy-app-service.yml +0 -0
- /package/{content → stacks/blazor-azure}/.azure/pipelines/templates/deploy-container-app.yml +0 -0
- /package/{content → stacks/blazor-azure}/.azure/pipelines/templates/infra-deploy.yml +0 -0
- /package/{content → stacks/blazor-azure}/.claude/commands/morph-apply.md +0 -0
- /package/{content → stacks/blazor-azure}/.claude/commands/morph-archive.md +0 -0
- /package/{content → stacks/blazor-azure}/.claude/commands/morph-deploy.md +0 -0
- /package/{content → stacks/blazor-azure}/.claude/commands/morph-infra.md +0 -0
- /package/{content → stacks/blazor-azure}/.claude/commands/morph-proposal.md +0 -0
- /package/{content → stacks/blazor-azure}/.claude/commands/morph-status.md +0 -0
- /package/{content → stacks/blazor-azure}/.claude/settings.local.json +0 -0
- /package/{content → stacks/blazor-azure}/.claude/skills/level-0-meta/README.md +0 -0
- /package/{content → stacks/blazor-azure}/.claude/skills/level-0-meta/code-review.md +0 -0
- /package/{content → stacks/blazor-azure}/.claude/skills/level-0-meta/morph-checklist.md +0 -0
- /package/{content → stacks/blazor-azure}/.claude/skills/level-0-meta/simulation-checklist.md +0 -0
- /package/{content → stacks/blazor-azure}/.claude/skills/level-1-workflows/README.md +0 -0
- /package/{content → stacks/blazor-azure}/.claude/skills/level-1-workflows/morph-replicate.md +0 -0
- /package/{content → stacks/blazor-azure}/.claude/skills/level-1-workflows/phase-clarify.md +0 -0
- /package/{content → stacks/blazor-azure}/.claude/skills/level-1-workflows/phase-design.md +0 -0
- /package/{content → stacks/blazor-azure}/.claude/skills/level-1-workflows/phase-tasks.md +0 -0
- /package/{content → stacks/blazor-azure}/.claude/skills/level-1-workflows/phase-uiux.md +0 -0
- /package/{content → stacks/blazor-azure}/.claude/skills/level-2-domains/README.md +0 -0
- /package/{content → stacks/blazor-azure}/.claude/skills/level-2-domains/ai-agents/ai-system-architect.md +0 -0
- /package/{content → stacks/blazor-azure}/.claude/skills/level-2-domains/architecture/po-pm-advisor.md +0 -0
- /package/{content → stacks/blazor-azure}/.claude/skills/level-2-domains/architecture/prompt-engineer.md +0 -0
- /package/{content → stacks/blazor-azure}/.claude/skills/level-2-domains/architecture/seo-growth-hacker.md +0 -0
- /package/{content → stacks/blazor-azure}/.claude/skills/level-2-domains/architecture/standards-architect.md +0 -0
- /package/{content → stacks/blazor-azure}/.claude/skills/level-2-domains/backend/dotnet-senior.md +0 -0
- /package/{content → stacks/blazor-azure}/.claude/skills/level-2-domains/backend/ef-modeler.md +0 -0
- /package/{content → stacks/blazor-azure}/.claude/skills/level-2-domains/backend/hangfire-orchestrator.md +0 -0
- /package/{content → stacks/blazor-azure}/.claude/skills/level-2-domains/backend/ms-agent-expert.md +0 -0
- /package/{content → stacks/blazor-azure}/.claude/skills/level-2-domains/frontend/blazor-builder.md +0 -0
- /package/{content → stacks/blazor-azure}/.claude/skills/level-2-domains/frontend/nextjs-expert.md +0 -0
- /package/{content → stacks/blazor-azure}/.claude/skills/level-2-domains/frontend/ui-ux-designer.md +0 -0
- /package/{content → stacks/blazor-azure}/.claude/skills/level-2-domains/infrastructure/azure-architect.md +0 -0
- /package/{content → stacks/blazor-azure}/.claude/skills/level-2-domains/infrastructure/azure-deploy-specialist.md +0 -0
- /package/{content → stacks/blazor-azure}/.claude/skills/level-2-domains/infrastructure/bicep-architect.md +0 -0
- /package/{content → stacks/blazor-azure}/.claude/skills/level-2-domains/infrastructure/container-specialist.md +0 -0
- /package/{content → stacks/blazor-azure}/.claude/skills/level-2-domains/infrastructure/devops-engineer.md +0 -0
- /package/{content → stacks/blazor-azure}/.claude/skills/level-2-domains/integrations/asaas-financial.md +0 -0
- /package/{content → stacks/blazor-azure}/.claude/skills/level-2-domains/integrations/azure-identity.md +0 -0
- /package/{content → stacks/blazor-azure}/.claude/skills/level-2-domains/integrations/clerk-auth.md +0 -0
- /package/{content → stacks/blazor-azure}/.claude/skills/level-2-domains/integrations/resend-email.md +0 -0
- /package/{content → stacks/blazor-azure}/.claude/skills/level-2-domains/quality/code-analyzer.md +0 -0
- /package/{content → stacks/blazor-azure}/.claude/skills/level-2-domains/quality/testing-specialist.md +0 -0
- /package/{content → stacks/blazor-azure}/.claude/skills/level-3-technologies/README.md +0 -0
- /package/{content → stacks/blazor-azure}/.claude/skills/level-4-patterns/README.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/.morphversion +0 -0
- /package/{content → stacks/blazor-azure}/.morph/archive/.gitkeep +0 -0
- /package/{content → stacks/blazor-azure}/.morph/config/agents.json +0 -0
- /package/{content → stacks/blazor-azure}/.morph/config/config.template.json +0 -0
- /package/{content → stacks/blazor-azure}/.morph/docs/STORY-DRIVEN-DEVELOPMENT.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/docs/workflows/design-impl.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/docs/workflows/fast-track.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/docs/workflows/full-morph.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/docs/workflows/standard.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/docs/workflows/ui-refresh.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/examples/api-nextjs/README.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/examples/api-nextjs/contracts.ts +0 -0
- /package/{content → stacks/blazor-azure}/.morph/examples/api-nextjs/spec.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/examples/api-nextjs/tasks.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/examples/micro-saas/README.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/examples/micro-saas/contracts.cs +0 -0
- /package/{content → stacks/blazor-azure}/.morph/examples/micro-saas/decisions.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/examples/micro-saas/spec.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/examples/micro-saas/tasks.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/examples/multi-agent/README.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/examples/multi-agent/contracts.cs +0 -0
- /package/{content → stacks/blazor-azure}/.morph/examples/multi-agent/spec.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/examples/multi-agent/tasks.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/examples/scheduled-reports/decisions.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/examples/scheduled-reports/proposal.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/examples/scheduled-reports/spec.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/examples/state-v3.json +0 -0
- /package/{content → stacks/blazor-azure}/.morph/features/.gitkeep +0 -0
- /package/{content → stacks/blazor-azure}/.morph/hooks/pre-commit-agents.sh +0 -0
- /package/{content → stacks/blazor-azure}/.morph/hooks/pre-commit-all.sh +0 -0
- /package/{content → stacks/blazor-azure}/.morph/hooks/pre-commit-specs.sh +0 -0
- /package/{content → stacks/blazor-azure}/.morph/hooks/pre-commit-tests.sh +0 -0
- /package/{content → stacks/blazor-azure}/.morph/hooks/task-completed.js +0 -0
- /package/{content → stacks/blazor-azure}/.morph/hooks/teammate-idle.js +0 -0
- /package/{content → stacks/blazor-azure}/.morph/project.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/schemas/agent.schema.json +0 -0
- /package/{content → stacks/blazor-azure}/.morph/schemas/tasks.schema.json +0 -0
- /package/{content → stacks/blazor-azure}/.morph/specs/.gitkeep +0 -0
- /package/{content → stacks/blazor-azure}/.morph/standards/agent-framework-blazor-ui.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/standards/agent-framework-production.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/standards/agent-framework-setup.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/standards/agent-framework-workflows.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/standards/architecture.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/standards/azure.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/standards/coding.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/standards/dotnet10-migration.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/standards/fluent-ui-setup.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/standards/passkeys-auth.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/standards/vector-search-rag.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/state.json +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/CONTEXT-FEATURE.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/CONTEXT.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/FluentDesignTheme.cs +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/MudTheme.cs +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/agent.cs +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/clarify-questions.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/component.razor +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/contracts/Commands.cs +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/contracts/Entities.cs +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/contracts/Queries.cs +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/contracts/README.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/contracts.cs +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/decisions.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/design-system.css +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/infra/.dockerignore.example +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/infra/Dockerfile.example +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/infra/README.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/infra/app-insights.bicep +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/infra/app-service.bicep +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/infra/azure-pipelines-deploy.yml +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/infra/container-app-env.bicep +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/infra/container-app.bicep +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/infra/deploy.ps1 +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/infra/deploy.sh +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/infra/key-vault.bicep +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/infra/main.bicep +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/infra/parameters.dev.json +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/infra/parameters.prod.json +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/infra/parameters.staging.json +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/infra/sql-database.bicep +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/infra/storage.bicep +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/integrations/asaas-client.cs +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/integrations/asaas-webhook.cs +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/integrations/azure-identity-config.cs +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/integrations/clerk-config.cs +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/job.cs +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/migration.cs +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/proposal.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/recap.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/repository.cs +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/saas/subscription.cs +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/saas/tenant.cs +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/service.cs +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/simulation.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/spec.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/sprint-status.yaml +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/state.template.json +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/story.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/tasks.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/test.cs +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/ui-components.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/ui-design-system.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/ui-flows.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/templates/ui-mockups.md +0 -0
- /package/{content → stacks/blazor-azure}/.morph/test-infra/example.bicep +0 -0
- /package/{content → stacks/blazor-azure}/CLAUDE.md +0 -0
- /package/{content → stacks/blazor-azure}/README.md +0 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Sanitization patterns - Whitelists, Blacklists, Secret patterns
|
|
3
|
+
* @module morph-spec/sanitizer/patterns
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Whitelist: Files explicitly allowed to be read and sent to LLM
|
|
8
|
+
*/
|
|
9
|
+
export const WHITELIST_FILES = [
|
|
10
|
+
'package.json',
|
|
11
|
+
'package-lock.json',
|
|
12
|
+
'yarn.lock',
|
|
13
|
+
'pnpm-lock.yaml',
|
|
14
|
+
'*.csproj',
|
|
15
|
+
'*.sln',
|
|
16
|
+
'README.md',
|
|
17
|
+
'CLAUDE.md',
|
|
18
|
+
'Dockerfile',
|
|
19
|
+
'docker-compose.yml',
|
|
20
|
+
'docker-compose.*.yml',
|
|
21
|
+
'*.bicep',
|
|
22
|
+
'azure-pipelines.yml',
|
|
23
|
+
'.github/workflows/*.yml',
|
|
24
|
+
'.gitlab-ci.yml',
|
|
25
|
+
'tsconfig.json',
|
|
26
|
+
'jsconfig.json',
|
|
27
|
+
'.eslintrc*',
|
|
28
|
+
'.prettierrc*',
|
|
29
|
+
'vite.config.*',
|
|
30
|
+
'next.config.*',
|
|
31
|
+
'nuxt.config.*'
|
|
32
|
+
];
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Blacklist: Directories to NEVER scan or read
|
|
36
|
+
*/
|
|
37
|
+
export const BLACKLIST_DIRECTORIES = [
|
|
38
|
+
'node_modules',
|
|
39
|
+
'.git',
|
|
40
|
+
'.svn',
|
|
41
|
+
'.hg',
|
|
42
|
+
'bin',
|
|
43
|
+
'obj',
|
|
44
|
+
'dist',
|
|
45
|
+
'build',
|
|
46
|
+
'out',
|
|
47
|
+
'.next',
|
|
48
|
+
'.nuxt',
|
|
49
|
+
'coverage',
|
|
50
|
+
'__pycache__',
|
|
51
|
+
'.pytest_cache',
|
|
52
|
+
'venv',
|
|
53
|
+
'env',
|
|
54
|
+
'.venv',
|
|
55
|
+
'.env.*',
|
|
56
|
+
'temp',
|
|
57
|
+
'tmp',
|
|
58
|
+
'.cache'
|
|
59
|
+
];
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Blacklist: File patterns to NEVER read (even if matched by whitelist)
|
|
63
|
+
*/
|
|
64
|
+
export const BLACKLIST_FILES = [
|
|
65
|
+
'.env',
|
|
66
|
+
'.env.local',
|
|
67
|
+
'.env.*.local',
|
|
68
|
+
'.env.production',
|
|
69
|
+
'*.key',
|
|
70
|
+
'*.pem',
|
|
71
|
+
'*.pfx',
|
|
72
|
+
'*.p12',
|
|
73
|
+
'*.cert',
|
|
74
|
+
'*.crt',
|
|
75
|
+
'*secret*',
|
|
76
|
+
'*password*',
|
|
77
|
+
'*credentials*',
|
|
78
|
+
'*token*',
|
|
79
|
+
'secrets.json',
|
|
80
|
+
'appsettings.Production.json',
|
|
81
|
+
'appsettings.Staging.json',
|
|
82
|
+
'*.log',
|
|
83
|
+
'*.sqlite',
|
|
84
|
+
'*.db'
|
|
85
|
+
];
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Secret patterns to redact from file contents
|
|
89
|
+
* Each pattern has: regex, replacement text, description
|
|
90
|
+
*/
|
|
91
|
+
export const SECRET_PATTERNS = [
|
|
92
|
+
{
|
|
93
|
+
name: 'api-key',
|
|
94
|
+
regex: /(?:api[_-]?key|apikey|api[_-]?secret)[\s:=]+["']?([a-zA-Z0-9_\-]{20,})["']?/gi,
|
|
95
|
+
replacement: 'API_KEY=***REDACTED***',
|
|
96
|
+
description: 'API keys'
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
name: 'bearer-token',
|
|
100
|
+
regex: /(?:bearer|authorization)[\s:=]+["']?([a-zA-Z0-9_\-\.]{20,})["']?/gi,
|
|
101
|
+
replacement: 'Bearer ***REDACTED***',
|
|
102
|
+
description: 'Bearer tokens'
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
name: 'connection-string',
|
|
106
|
+
regex: /(?:connection[_-]?string|connectionstring)[\s:=]+["']?([^"'\n]{30,})["']?/gi,
|
|
107
|
+
replacement: 'ConnectionString=***REDACTED***',
|
|
108
|
+
description: 'Connection strings'
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: 'sql-password',
|
|
112
|
+
regex: /(?:password|pwd)=([^;"\s]{6,})/gi,
|
|
113
|
+
replacement: 'Password=***REDACTED***',
|
|
114
|
+
description: 'SQL passwords in connection strings'
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
name: 'azure-key',
|
|
118
|
+
regex: /(?:account[_-]?key|accountkey)[\s:=]+["']?([a-zA-Z0-9+/=]{40,})["']?/gi,
|
|
119
|
+
replacement: 'AccountKey=***REDACTED***',
|
|
120
|
+
description: 'Azure Storage Account Keys'
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: 'jwt-secret',
|
|
124
|
+
regex: /(?:jwt[_-]?secret|jwtsecret)[\s:=]+["']?([a-zA-Z0-9_\-]{16,})["']?/gi,
|
|
125
|
+
replacement: 'JwtSecret=***REDACTED***',
|
|
126
|
+
description: 'JWT secrets'
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
name: 'private-key',
|
|
130
|
+
regex: /-----BEGIN (?:RSA |EC )?PRIVATE KEY-----[\s\S]+?-----END (?:RSA |EC )?PRIVATE KEY-----/gi,
|
|
131
|
+
replacement: '-----BEGIN PRIVATE KEY-----\n***REDACTED***\n-----END PRIVATE KEY-----',
|
|
132
|
+
description: 'Private keys (PEM format)'
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
name: 'github-token',
|
|
136
|
+
regex: /gh[pousr]_[a-zA-Z0-9]{36,}/gi,
|
|
137
|
+
replacement: 'ghp_***REDACTED***',
|
|
138
|
+
description: 'GitHub personal access tokens'
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
name: 'npm-token',
|
|
142
|
+
regex: /npm_[a-zA-Z0-9]{36,}/gi,
|
|
143
|
+
replacement: 'npm_***REDACTED***',
|
|
144
|
+
description: 'NPM tokens'
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
name: 'generic-secret',
|
|
148
|
+
regex: /(?:secret|password|pwd|pass|token)[\s:=]+["']([^"'\n]{8,})["']/gi,
|
|
149
|
+
replacement: 'secret=***REDACTED***',
|
|
150
|
+
description: 'Generic secrets'
|
|
151
|
+
}
|
|
152
|
+
];
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Maximum file size to include (50KB)
|
|
156
|
+
* Files larger than this are truncated with a summary
|
|
157
|
+
*/
|
|
158
|
+
export const MAX_FILE_SIZE = 50 * 1024; // 50KB
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Maximum content length for README/CLAUDE.md summaries
|
|
162
|
+
*/
|
|
163
|
+
export const MAX_SUMMARY_LENGTH = 500; // 500 chars
|
|
File without changes
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview ProjectScanner - Scans project directory and collects context
|
|
3
|
+
* @module morph-spec/scanner/project-scanner
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { readFile, access } from 'fs/promises';
|
|
7
|
+
import { join, dirname, relative } from 'path';
|
|
8
|
+
import { readdir, stat } from 'fs/promises';
|
|
9
|
+
import { execSync } from 'child_process';
|
|
10
|
+
import { glob } from 'glob';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @typedef {import('../types/index.js').ProjectContext} ProjectContext
|
|
14
|
+
* @typedef {import('../types/index.js').PackageJson} PackageJson
|
|
15
|
+
* @typedef {import('../types/index.js').DirectoryStructure} DirectoryStructure
|
|
16
|
+
* @typedef {import('../types/index.js').InfraFiles} InfraFiles
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* ProjectScanner - Scans project directory and collects context for LLM analysis
|
|
21
|
+
* @class
|
|
22
|
+
*/
|
|
23
|
+
export class ProjectScanner {
|
|
24
|
+
/**
|
|
25
|
+
* Scan the project directory and collect complete context
|
|
26
|
+
* @param {string} cwd - Current working directory (absolute path)
|
|
27
|
+
* @returns {Promise<ProjectContext>}
|
|
28
|
+
*/
|
|
29
|
+
async scan(cwd) {
|
|
30
|
+
const [
|
|
31
|
+
packageJson,
|
|
32
|
+
csprojFiles,
|
|
33
|
+
solutionFile,
|
|
34
|
+
readme,
|
|
35
|
+
claudeMd,
|
|
36
|
+
structure,
|
|
37
|
+
infraFiles,
|
|
38
|
+
gitRemote
|
|
39
|
+
] = await Promise.all([
|
|
40
|
+
this.readPackageJson(cwd),
|
|
41
|
+
this.findCsprojFiles(cwd),
|
|
42
|
+
this.findSolutionFile(cwd),
|
|
43
|
+
this.readFileIfExists(join(cwd, 'README.md')),
|
|
44
|
+
this.readFileIfExists(join(cwd, 'CLAUDE.md')),
|
|
45
|
+
this.detectDirectoryStructure(cwd),
|
|
46
|
+
this.findInfraFiles(cwd),
|
|
47
|
+
this.getGitRemote(cwd)
|
|
48
|
+
]);
|
|
49
|
+
|
|
50
|
+
return {
|
|
51
|
+
cwd,
|
|
52
|
+
packageJson,
|
|
53
|
+
csprojFiles,
|
|
54
|
+
solutionFile,
|
|
55
|
+
readme,
|
|
56
|
+
claudeMd,
|
|
57
|
+
structure,
|
|
58
|
+
infraFiles,
|
|
59
|
+
gitRemote,
|
|
60
|
+
scannedAt: new Date()
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Read and parse package.json
|
|
66
|
+
* @param {string} cwd - Current working directory
|
|
67
|
+
* @returns {Promise<PackageJson|null>}
|
|
68
|
+
*/
|
|
69
|
+
async readPackageJson(cwd) {
|
|
70
|
+
try {
|
|
71
|
+
const packageJsonPath = join(cwd, 'package.json');
|
|
72
|
+
const content = await readFile(packageJsonPath, 'utf-8');
|
|
73
|
+
return JSON.parse(content);
|
|
74
|
+
} catch (error) {
|
|
75
|
+
// No package.json or parse error
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Find all .csproj files recursively
|
|
82
|
+
* @param {string} cwd - Current working directory
|
|
83
|
+
* @returns {Promise<string[]>}
|
|
84
|
+
*/
|
|
85
|
+
async findCsprojFiles(cwd) {
|
|
86
|
+
try {
|
|
87
|
+
const pattern = '**/*.csproj';
|
|
88
|
+
const options = {
|
|
89
|
+
cwd,
|
|
90
|
+
ignore: ['**/node_modules/**', '**/bin/**', '**/obj/**', '**/.git/**'],
|
|
91
|
+
absolute: false
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
const files = await glob(pattern, options);
|
|
95
|
+
return files;
|
|
96
|
+
} catch (error) {
|
|
97
|
+
return [];
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Find solution file (.sln)
|
|
103
|
+
* @param {string} cwd - Current working directory
|
|
104
|
+
* @returns {Promise<string|null>}
|
|
105
|
+
*/
|
|
106
|
+
async findSolutionFile(cwd) {
|
|
107
|
+
try {
|
|
108
|
+
const pattern = '**/*.sln';
|
|
109
|
+
const options = {
|
|
110
|
+
cwd,
|
|
111
|
+
ignore: ['**/node_modules/**', '**/.git/**'],
|
|
112
|
+
absolute: false
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
const files = await glob(pattern, options);
|
|
116
|
+
return files.length > 0 ? files[0] : null;
|
|
117
|
+
} catch (error) {
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Detect directory structure and patterns
|
|
124
|
+
* @param {string} cwd - Current working directory
|
|
125
|
+
* @returns {Promise<DirectoryStructure>}
|
|
126
|
+
*/
|
|
127
|
+
async detectDirectoryStructure(cwd) {
|
|
128
|
+
try {
|
|
129
|
+
const entries = await readdir(cwd, { withFileTypes: true });
|
|
130
|
+
const dirs = entries
|
|
131
|
+
.filter(entry => entry.isDirectory())
|
|
132
|
+
.map(entry => entry.name)
|
|
133
|
+
.filter(name => !name.startsWith('.') && name !== 'node_modules');
|
|
134
|
+
|
|
135
|
+
const hasSrc = dirs.includes('src');
|
|
136
|
+
const hasBackend = dirs.some(d => ['backend', 'server', 'api'].includes(d.toLowerCase()));
|
|
137
|
+
const hasFrontend = dirs.some(d => ['frontend', 'client', 'web', 'app'].includes(d.toLowerCase()));
|
|
138
|
+
const hasTests = dirs.some(d => ['test', 'tests', '__tests__'].includes(d.toLowerCase()));
|
|
139
|
+
|
|
140
|
+
// Detect pattern
|
|
141
|
+
let pattern = 'single-project';
|
|
142
|
+
if (hasBackend && hasFrontend) {
|
|
143
|
+
pattern = 'multi-stack';
|
|
144
|
+
} else if (dirs.length > 5 && dirs.some(d => d.includes('packages') || d.includes('apps'))) {
|
|
145
|
+
pattern = 'monorepo';
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
return {
|
|
149
|
+
hasSrc,
|
|
150
|
+
hasBackend,
|
|
151
|
+
hasFrontend,
|
|
152
|
+
hasTests,
|
|
153
|
+
topLevelDirs: dirs,
|
|
154
|
+
pattern
|
|
155
|
+
};
|
|
156
|
+
} catch (error) {
|
|
157
|
+
return {
|
|
158
|
+
hasSrc: false,
|
|
159
|
+
hasBackend: false,
|
|
160
|
+
hasFrontend: false,
|
|
161
|
+
hasTests: false,
|
|
162
|
+
topLevelDirs: [],
|
|
163
|
+
pattern: 'single-project'
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Find infrastructure files (Docker, Bicep, pipelines)
|
|
170
|
+
* @param {string} cwd - Current working directory
|
|
171
|
+
* @returns {Promise<InfraFiles>}
|
|
172
|
+
*/
|
|
173
|
+
async findInfraFiles(cwd) {
|
|
174
|
+
try {
|
|
175
|
+
const [dockerfiles, dockerComposeFiles, bicepFiles, pipelines] = await Promise.all([
|
|
176
|
+
glob('**/Dockerfile*', { cwd, ignore: ['**/node_modules/**', '**/.git/**'], absolute: false }),
|
|
177
|
+
glob('**/docker-compose*.yml', { cwd, ignore: ['**/node_modules/**', '**/.git/**'], absolute: false }),
|
|
178
|
+
glob('**/*.bicep', { cwd, ignore: ['**/node_modules/**', '**/.git/**'], absolute: false }),
|
|
179
|
+
glob('**/{azure-pipelines.yml,.github/workflows/*.yml,.gitlab-ci.yml}', {
|
|
180
|
+
cwd,
|
|
181
|
+
ignore: ['**/node_modules/**'],
|
|
182
|
+
absolute: false
|
|
183
|
+
})
|
|
184
|
+
]);
|
|
185
|
+
|
|
186
|
+
return {
|
|
187
|
+
dockerfiles,
|
|
188
|
+
dockerComposeFiles,
|
|
189
|
+
bicepFiles,
|
|
190
|
+
pipelines,
|
|
191
|
+
hasAzure: bicepFiles.length > 0 || pipelines.some(p => p.includes('azure')),
|
|
192
|
+
hasDocker: dockerfiles.length > 0 || dockerComposeFiles.length > 0,
|
|
193
|
+
hasDevOps: pipelines.length > 0
|
|
194
|
+
};
|
|
195
|
+
} catch (error) {
|
|
196
|
+
return {
|
|
197
|
+
dockerfiles: [],
|
|
198
|
+
dockerComposeFiles: [],
|
|
199
|
+
bicepFiles: [],
|
|
200
|
+
pipelines: [],
|
|
201
|
+
hasAzure: false,
|
|
202
|
+
hasDocker: false,
|
|
203
|
+
hasDevOps: false
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Get git remote URL
|
|
210
|
+
* @param {string} cwd - Current working directory
|
|
211
|
+
* @returns {Promise<string|null>}
|
|
212
|
+
*/
|
|
213
|
+
async getGitRemote(cwd) {
|
|
214
|
+
try {
|
|
215
|
+
const remote = execSync('git remote get-url origin', {
|
|
216
|
+
cwd,
|
|
217
|
+
encoding: 'utf-8',
|
|
218
|
+
stdio: ['pipe', 'pipe', 'ignore']
|
|
219
|
+
}).trim();
|
|
220
|
+
|
|
221
|
+
return remote || null;
|
|
222
|
+
} catch (error) {
|
|
223
|
+
// Not a git repo or no remote
|
|
224
|
+
return null;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Helper: Read file if it exists
|
|
230
|
+
* @param {string} filepath - Absolute file path
|
|
231
|
+
* @returns {Promise<string|null>}
|
|
232
|
+
*/
|
|
233
|
+
async readFileIfExists(filepath) {
|
|
234
|
+
try {
|
|
235
|
+
await access(filepath);
|
|
236
|
+
const content = await readFile(filepath, 'utf-8');
|
|
237
|
+
return content;
|
|
238
|
+
} catch (error) {
|
|
239
|
+
return null;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|