@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,380 @@
|
|
|
1
|
+
import { readFileSync, existsSync } from 'fs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Metadata Extractor - Parse markdown documents into structured JSON
|
|
5
|
+
*
|
|
6
|
+
* Generates quick summaries for LLM to parse, reducing token usage
|
|
7
|
+
* by 60-80% compared to reading full markdown files.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Extract a field value from markdown content (table format)
|
|
12
|
+
* @param {string} content - Markdown content
|
|
13
|
+
* @param {string} fieldName - Field name to extract
|
|
14
|
+
* @returns {string|null} Field value or null
|
|
15
|
+
*/
|
|
16
|
+
function extractField(content, fieldName) {
|
|
17
|
+
// Look for table row: | FieldName | Value |
|
|
18
|
+
const regex = new RegExp(`\\|\\s*${fieldName}\\s*\\|\\s*(.+?)\\s*\\|`, 'i');
|
|
19
|
+
const match = content.match(regex);
|
|
20
|
+
return match ? match[1].trim() : null;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Extract first paragraph from a section
|
|
25
|
+
* @param {string} content - Markdown content
|
|
26
|
+
* @param {string} sectionHeader - Section header (e.g., "## Overview")
|
|
27
|
+
* @returns {string|null} First paragraph or null
|
|
28
|
+
*/
|
|
29
|
+
function extractFirstParagraph(content, sectionHeader) {
|
|
30
|
+
const regex = new RegExp(`${sectionHeader}\\s+([^\\n]+(?:\\n(?!##)[^\\n]+)*)`, 'i');
|
|
31
|
+
const match = content.match(regex);
|
|
32
|
+
|
|
33
|
+
if (!match) return null;
|
|
34
|
+
|
|
35
|
+
// Get first paragraph (up to first blank line or next section)
|
|
36
|
+
const text = match[1].trim();
|
|
37
|
+
const firstPara = text.split('\n\n')[0];
|
|
38
|
+
return firstPara.substring(0, 300); // Limit to 300 chars
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Extract bullet points from a section
|
|
43
|
+
* @param {string} content - Markdown content
|
|
44
|
+
* @param {string} sectionHeader - Section header
|
|
45
|
+
* @returns {string[]} Array of bullet points
|
|
46
|
+
*/
|
|
47
|
+
function extractBulletPoints(content, sectionHeader) {
|
|
48
|
+
const regex = new RegExp(`${sectionHeader}([\\s\\S]*?)(?=\\n## |$)`, 'i');
|
|
49
|
+
const match = content.match(regex);
|
|
50
|
+
|
|
51
|
+
if (!match) return [];
|
|
52
|
+
|
|
53
|
+
const sectionContent = match[1];
|
|
54
|
+
const bullets = [];
|
|
55
|
+
|
|
56
|
+
// Match lines starting with -, *, or numbered list
|
|
57
|
+
const bulletRegex = /^[\s]*[-*][\s]+(.+)$/gm;
|
|
58
|
+
let bulletMatch;
|
|
59
|
+
|
|
60
|
+
while ((bulletMatch = bulletRegex.exec(sectionContent)) !== null) {
|
|
61
|
+
bullets.push(bulletMatch[1].trim());
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return bullets.slice(0, 10); // Limit to 10 items
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Extract table or list from a section
|
|
69
|
+
* @param {string} content - Markdown content
|
|
70
|
+
* @param {string} sectionHeader - Section header
|
|
71
|
+
* @returns {string[]} Array of items
|
|
72
|
+
*/
|
|
73
|
+
function extractTableOrList(content, sectionHeader) {
|
|
74
|
+
const items = extractBulletPoints(content, sectionHeader);
|
|
75
|
+
|
|
76
|
+
if (items.length > 0) return items;
|
|
77
|
+
|
|
78
|
+
// Try extracting table rows
|
|
79
|
+
const regex = new RegExp(`${sectionHeader}([\\s\\S]*?)(?=\\n## |$)`, 'i');
|
|
80
|
+
const match = content.match(regex);
|
|
81
|
+
|
|
82
|
+
if (!match) return [];
|
|
83
|
+
|
|
84
|
+
const sectionContent = match[1];
|
|
85
|
+
const tableRows = [];
|
|
86
|
+
|
|
87
|
+
// Match table rows (| col1 | col2 |)
|
|
88
|
+
const rowRegex = /^\|(.+)\|$/gm;
|
|
89
|
+
let rowMatch;
|
|
90
|
+
|
|
91
|
+
while ((rowMatch = rowRegex.exec(sectionContent)) !== null) {
|
|
92
|
+
const row = rowMatch[1].trim();
|
|
93
|
+
// Skip header separator rows
|
|
94
|
+
if (!row.match(/^[-:|\s]+$/)) {
|
|
95
|
+
tableRows.push(row);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return tableRows.slice(0, 10); // Limit to 10 rows
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Auto-generate tags from content
|
|
104
|
+
* @param {string} content - Markdown content
|
|
105
|
+
* @returns {string[]} Array of tags
|
|
106
|
+
*/
|
|
107
|
+
function autoGenerateTags(content) {
|
|
108
|
+
const tags = new Set();
|
|
109
|
+
const lowerContent = content.toLowerCase();
|
|
110
|
+
|
|
111
|
+
// Technology tags
|
|
112
|
+
const techKeywords = {
|
|
113
|
+
'blazor': 'blazor',
|
|
114
|
+
'react': 'react',
|
|
115
|
+
'nextjs': 'nextjs',
|
|
116
|
+
'next.js': 'nextjs',
|
|
117
|
+
'azure': 'azure',
|
|
118
|
+
'sql': 'database',
|
|
119
|
+
'entity framework': 'ef-core',
|
|
120
|
+
'hangfire': 'background-jobs',
|
|
121
|
+
'signalr': 'realtime',
|
|
122
|
+
'docker': 'container',
|
|
123
|
+
'bicep': 'infrastructure-as-code',
|
|
124
|
+
'api': 'api',
|
|
125
|
+
'rest': 'rest-api',
|
|
126
|
+
'authentication': 'auth',
|
|
127
|
+
'authorization': 'auth'
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
Object.entries(techKeywords).forEach(([keyword, tag]) => {
|
|
131
|
+
if (lowerContent.includes(keyword)) {
|
|
132
|
+
tags.add(tag);
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
return Array.from(tags).slice(0, 8); // Limit to 8 tags
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Extract spec.md metadata
|
|
141
|
+
* @param {string} specPath - Path to spec.md file
|
|
142
|
+
* @returns {Object} Spec metadata
|
|
143
|
+
*/
|
|
144
|
+
export function extractSpecMetadata(specPath) {
|
|
145
|
+
if (!existsSync(specPath)) {
|
|
146
|
+
return {
|
|
147
|
+
error: 'Spec file not found',
|
|
148
|
+
path: specPath
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
try {
|
|
153
|
+
const content = readFileSync(specPath, 'utf8');
|
|
154
|
+
|
|
155
|
+
return {
|
|
156
|
+
id: extractField(content, 'ID') || extractField(content, 'Feature'),
|
|
157
|
+
status: extractField(content, 'Status'),
|
|
158
|
+
complexity: extractField(content, 'Complexity'),
|
|
159
|
+
estimatedCost: extractField(content, 'Estimated Cost') || extractField(content, 'Cost'),
|
|
160
|
+
|
|
161
|
+
summary: {
|
|
162
|
+
problem: extractFirstParagraph(content, '## Overview') ||
|
|
163
|
+
extractFirstParagraph(content, '## Problem Statement'),
|
|
164
|
+
solution: extractFirstParagraph(content, '## Proposed Solution') ||
|
|
165
|
+
extractFirstParagraph(content, '## Solution'),
|
|
166
|
+
tags: autoGenerateTags(content)
|
|
167
|
+
},
|
|
168
|
+
|
|
169
|
+
requirements: extractBulletPoints(content, '## Requirements').slice(0, 5),
|
|
170
|
+
dataModel: extractTableOrList(content, '## Data Model').slice(0, 5),
|
|
171
|
+
apiContracts: extractTableOrList(content, '## API Contracts').slice(0, 5),
|
|
172
|
+
|
|
173
|
+
stats: {
|
|
174
|
+
length: content.length,
|
|
175
|
+
sections: (content.match(/^## /gm) || []).length,
|
|
176
|
+
codeBlocks: (content.match(/```/g) || []).length / 2
|
|
177
|
+
},
|
|
178
|
+
|
|
179
|
+
generatedAt: new Date().toISOString(),
|
|
180
|
+
source: specPath
|
|
181
|
+
};
|
|
182
|
+
} catch (error) {
|
|
183
|
+
return {
|
|
184
|
+
error: error.message,
|
|
185
|
+
path: specPath
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Extract proposal.md metadata
|
|
192
|
+
* @param {string} proposalPath - Path to proposal.md file
|
|
193
|
+
* @returns {Object} Proposal metadata
|
|
194
|
+
*/
|
|
195
|
+
export function extractProposalMetadata(proposalPath) {
|
|
196
|
+
if (!existsSync(proposalPath)) {
|
|
197
|
+
return {
|
|
198
|
+
error: 'Proposal file not found',
|
|
199
|
+
path: proposalPath
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
try {
|
|
204
|
+
const content = readFileSync(proposalPath, 'utf8');
|
|
205
|
+
|
|
206
|
+
return {
|
|
207
|
+
id: extractField(content, 'ID') || extractField(content, 'Feature'),
|
|
208
|
+
status: extractField(content, 'Status'),
|
|
209
|
+
|
|
210
|
+
summary: {
|
|
211
|
+
problem: extractFirstParagraph(content, '## Problem Statement'),
|
|
212
|
+
solution: extractFirstParagraph(content, '## Proposed Solution'),
|
|
213
|
+
tags: autoGenerateTags(content)
|
|
214
|
+
},
|
|
215
|
+
|
|
216
|
+
successMetrics: extractBulletPoints(content, '## Success Metrics').slice(0, 5),
|
|
217
|
+
|
|
218
|
+
generatedAt: new Date().toISOString(),
|
|
219
|
+
source: proposalPath
|
|
220
|
+
};
|
|
221
|
+
} catch (error) {
|
|
222
|
+
return {
|
|
223
|
+
error: error.message,
|
|
224
|
+
path: proposalPath
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Extract decisions.md metadata (ADRs)
|
|
231
|
+
* @param {string} decisionsPath - Path to decisions.md file
|
|
232
|
+
* @returns {Object} Decisions metadata
|
|
233
|
+
*/
|
|
234
|
+
export function extractDecisionsMetadata(decisionsPath) {
|
|
235
|
+
if (!existsSync(decisionsPath)) {
|
|
236
|
+
return {
|
|
237
|
+
error: 'Decisions file not found',
|
|
238
|
+
path: decisionsPath
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
try {
|
|
243
|
+
const content = readFileSync(decisionsPath, 'utf8');
|
|
244
|
+
const decisions = [];
|
|
245
|
+
|
|
246
|
+
// Match ADR pattern: ### ADR-001: Title
|
|
247
|
+
const adrRegex = /### (ADR-\d+): (.+?)\n([\s\S]*?)(?=### ADR-|\n## |$)/g;
|
|
248
|
+
let match;
|
|
249
|
+
|
|
250
|
+
while ((match = adrRegex.exec(content)) !== null) {
|
|
251
|
+
const [, id, title, body] = match;
|
|
252
|
+
|
|
253
|
+
decisions.push({
|
|
254
|
+
id,
|
|
255
|
+
title: title.trim(),
|
|
256
|
+
summary: body.trim().substring(0, 200), // First 200 chars
|
|
257
|
+
fullPath: `${decisionsPath}#${id.toLowerCase()}`
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
return {
|
|
262
|
+
decisions,
|
|
263
|
+
total: decisions.length,
|
|
264
|
+
generatedAt: new Date().toISOString(),
|
|
265
|
+
source: decisionsPath
|
|
266
|
+
};
|
|
267
|
+
} catch (error) {
|
|
268
|
+
return {
|
|
269
|
+
error: error.message,
|
|
270
|
+
path: decisionsPath
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Extract tasks.json metadata (summary only)
|
|
277
|
+
* @param {string} tasksPath - Path to tasks.json file
|
|
278
|
+
* @returns {Object} Tasks metadata
|
|
279
|
+
*/
|
|
280
|
+
export function extractTasksMetadata(tasksPath) {
|
|
281
|
+
if (!existsSync(tasksPath)) {
|
|
282
|
+
return {
|
|
283
|
+
error: 'Tasks file not found',
|
|
284
|
+
path: tasksPath
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
try {
|
|
289
|
+
const content = readFileSync(tasksPath, 'utf8');
|
|
290
|
+
const tasks = JSON.parse(content);
|
|
291
|
+
|
|
292
|
+
const regularTasks = tasks.tasks?.filter(t => t.id?.startsWith('T')) || [];
|
|
293
|
+
const checkpoints = tasks.tasks?.filter(t => t.id?.startsWith('CHECKPOINT')) || [];
|
|
294
|
+
|
|
295
|
+
return {
|
|
296
|
+
total: tasks.tasks?.length || 0,
|
|
297
|
+
regularTasks: regularTasks.length,
|
|
298
|
+
checkpoints: checkpoints.length,
|
|
299
|
+
|
|
300
|
+
categories: tasks.categories || {},
|
|
301
|
+
|
|
302
|
+
byStatus: {
|
|
303
|
+
pending: regularTasks.filter(t => t.status === 'pending').length,
|
|
304
|
+
inProgress: regularTasks.filter(t => t.status === 'in_progress').length,
|
|
305
|
+
done: regularTasks.filter(t => t.status === 'done').length,
|
|
306
|
+
blocked: regularTasks.filter(t => t.status === 'blocked').length
|
|
307
|
+
},
|
|
308
|
+
|
|
309
|
+
estimatedTime: regularTasks.reduce((sum, t) => sum + (t.estimatedMinutes || 0), 0),
|
|
310
|
+
|
|
311
|
+
nextTask: regularTasks.find(t => t.status === 'pending' &&
|
|
312
|
+
(!t.dependencies || t.dependencies.length === 0)),
|
|
313
|
+
|
|
314
|
+
generatedAt: new Date().toISOString(),
|
|
315
|
+
source: tasksPath
|
|
316
|
+
};
|
|
317
|
+
} catch (error) {
|
|
318
|
+
return {
|
|
319
|
+
error: error.message,
|
|
320
|
+
path: tasksPath
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* Extract comprehensive feature metadata
|
|
327
|
+
* @param {Object} featureState - Feature state from state.json
|
|
328
|
+
* @returns {Object} Complete feature metadata
|
|
329
|
+
*/
|
|
330
|
+
export function extractFeatureMetadata(featureState) {
|
|
331
|
+
const metadata = {
|
|
332
|
+
version: "1.0.0",
|
|
333
|
+
feature: featureState.name || 'unknown',
|
|
334
|
+
status: featureState.status,
|
|
335
|
+
phase: featureState.phase,
|
|
336
|
+
workflow: featureState.workflow,
|
|
337
|
+
|
|
338
|
+
agents: featureState.activeAgents || [],
|
|
339
|
+
checkpoints: featureState.checkpoints || [],
|
|
340
|
+
|
|
341
|
+
outputs: {},
|
|
342
|
+
quickLinks: {}
|
|
343
|
+
};
|
|
344
|
+
|
|
345
|
+
// Extract metadata from each output
|
|
346
|
+
if (featureState.outputs?.proposal?.created) {
|
|
347
|
+
metadata.outputs.proposal = extractProposalMetadata(featureState.outputs.proposal.path);
|
|
348
|
+
metadata.quickLinks.proposal = featureState.outputs.proposal.path;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
if (featureState.outputs?.spec?.created) {
|
|
352
|
+
metadata.outputs.spec = extractSpecMetadata(featureState.outputs.spec.path);
|
|
353
|
+
metadata.quickLinks.spec = featureState.outputs.spec.path;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
if (featureState.outputs?.decisions?.created) {
|
|
357
|
+
metadata.outputs.decisions = extractDecisionsMetadata(featureState.outputs.decisions.path);
|
|
358
|
+
metadata.quickLinks.decisions = featureState.outputs.decisions.path;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
if (featureState.outputs?.tasks?.created) {
|
|
362
|
+
metadata.outputs.tasks = extractTasksMetadata(featureState.outputs.tasks.path);
|
|
363
|
+
metadata.quickLinks.tasks = featureState.outputs.tasks.path;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
// Calculate progress
|
|
367
|
+
if (featureState.tasks) {
|
|
368
|
+
metadata.progress = {
|
|
369
|
+
total: featureState.tasks.total || 0,
|
|
370
|
+
completed: featureState.tasks.completed || 0,
|
|
371
|
+
percentage: featureState.tasks.total > 0
|
|
372
|
+
? Math.round((featureState.tasks.completed / featureState.tasks.total) * 100)
|
|
373
|
+
: 0
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
metadata.generatedAt = new Date().toISOString();
|
|
378
|
+
|
|
379
|
+
return metadata;
|
|
380
|
+
}
|