@polymorphism-tech/morph-spec 4.7.2 → 4.8.4
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/LICENSE +1 -2
- package/README.md +379 -414
- package/bin/morph-spec.js +57 -394
- package/bin/validate.js +2 -26
- package/claude-plugin.json +2 -2
- package/docs/CHEATSHEET.md +203 -221
- package/docs/QUICKSTART.md +2 -8
- package/framework/CLAUDE.md +1 -1
- package/framework/commands/morph-proposal.md +3 -3
- package/framework/hooks/README.md +2 -5
- package/framework/hooks/claude-code/pre-tool-use/protect-readonly-files.js +4 -55
- package/framework/hooks/claude-code/session-start/inject-morph-context.js +20 -5
- package/framework/hooks/claude-code/statusline.py +6 -1
- package/framework/hooks/dev/check-sync-health.js +117 -0
- package/framework/hooks/dev/guard-version-numbers.js +57 -0
- package/framework/hooks/dev/sync-standards-registry.js +60 -0
- package/framework/hooks/dev/sync-template-registry.js +60 -0
- package/framework/hooks/dev/validate-skill-format.js +70 -0
- package/framework/hooks/dev/validate-standard-format.js +73 -0
- package/framework/hooks/shared/payload-utils.js +39 -0
- package/framework/hooks/shared/state-reader.js +25 -1
- package/framework/rules/morph-workflow.md +1 -1
- package/framework/skills/level-0-meta/morph-init/SKILL.md +216 -0
- package/framework/skills/level-0-meta/morph-replicate/SKILL.md +4 -4
- package/framework/skills/level-0-meta/tool-usage-guide/SKILL.md +4 -4
- package/framework/skills/level-0-meta/verification-before-completion/SKILL.md +1 -1
- package/framework/skills/level-1-workflows/phase-clarify/SKILL.md +192 -191
- package/framework/skills/level-1-workflows/phase-codebase-analysis/SKILL.md +181 -180
- package/framework/skills/level-1-workflows/phase-design/SKILL.md +339 -338
- package/framework/skills/level-1-workflows/phase-implement/SKILL.md +254 -253
- package/framework/skills/level-1-workflows/phase-setup/SKILL.md +168 -170
- package/framework/skills/level-1-workflows/phase-tasks/SKILL.md +284 -283
- package/framework/skills/level-1-workflows/phase-uiux/SKILL.md +246 -245
- package/framework/templates/examples/design-system-examples.md +1 -1
- package/framework/templates/ui/FluentDesignTheme.cs +1 -1
- package/framework/templates/ui/MudTheme.cs +1 -1
- package/framework/templates/ui/design-system.css +1 -1
- package/package.json +7 -5
- package/src/commands/agents/index.js +1 -2
- package/src/commands/index.js +13 -16
- package/src/commands/project/doctor.js +100 -14
- package/src/commands/project/index.js +7 -10
- package/src/commands/project/init.js +398 -528
- package/src/commands/project/install-plugin-cmd.js +28 -0
- package/src/commands/project/setup-infra-cmd.js +12 -0
- package/src/commands/project/tutorial.js +115 -0
- package/src/commands/state/approve.js +213 -221
- package/src/commands/state/index.js +0 -1
- package/src/commands/state/state.js +337 -365
- package/src/commands/templates/index.js +0 -4
- package/src/commands/trust/trust.js +1 -93
- package/src/commands/utils/index.js +1 -5
- package/src/commands/validation/index.js +1 -5
- package/src/core/registry/command-registry.js +11 -285
- package/src/core/state/state-manager.js +5 -2
- package/src/lib/detectors/index.js +81 -87
- package/src/lib/detectors/structure-detector.js +275 -273
- package/src/lib/generators/recap-generator.js +232 -225
- package/src/scripts/global-install.js +34 -0
- package/src/scripts/install-plugin.js +126 -0
- package/src/scripts/setup-infra.js +203 -0
- package/src/utils/agents-installer.js +10 -1
- package/src/utils/hooks-installer.js +66 -3
- package/.morph/.morphversion +0 -5
- package/.morph/analytics/threads-log.jsonl +0 -5
- package/.morph/config/config.json +0 -8
- package/.morph/framework/agents.json +0 -1815
- package/.morph/framework/hooks/README.md +0 -205
- package/.morph/framework/hooks/claude-code/notification/approval-reminder.js +0 -54
- package/.morph/framework/hooks/claude-code/post-tool-use/dispatch.js +0 -83
- package/.morph/framework/hooks/claude-code/post-tool-use/handle-tool-failure.js +0 -42
- package/.morph/framework/hooks/claude-code/pre-compact/save-morph-context.js +0 -61
- package/.morph/framework/hooks/claude-code/pre-tool-use/enforce-phase-writes.js +0 -71
- package/.morph/framework/hooks/claude-code/pre-tool-use/protect-readonly-files.js +0 -58
- package/.morph/framework/hooks/claude-code/pre-tool-use/protect-spec-files.js +0 -64
- package/.morph/framework/hooks/claude-code/session-start/inject-morph-context.js +0 -94
- package/.morph/framework/hooks/claude-code/statusline.py +0 -538
- package/.morph/framework/hooks/claude-code/statusline.sh +0 -7
- package/.morph/framework/hooks/claude-code/stop/validate-completion.js +0 -88
- package/.morph/framework/hooks/claude-code/user-prompt/enrich-prompt.js +0 -91
- package/.morph/framework/hooks/git/commit-msg/conventional-commits.sh +0 -33
- package/.morph/framework/hooks/git/pre-commit/agents.sh +0 -25
- package/.morph/framework/hooks/git/pre-commit/orchestrator.sh +0 -64
- package/.morph/framework/hooks/git/pre-commit/specs.sh +0 -50
- package/.morph/framework/hooks/git/pre-push/run-tests.sh +0 -44
- package/.morph/framework/hooks/shared/hook-response.js +0 -45
- package/.morph/framework/hooks/shared/phase-utils.js +0 -129
- package/.morph/framework/hooks/shared/state-reader.js +0 -138
- package/.morph/framework/hooks/shared/stdin-reader.js +0 -26
- package/.morph/framework/standards/STANDARDS.json +0 -933
- package/.morph/framework/standards/ai-agents/blazor-ui.md +0 -364
- package/.morph/framework/standards/ai-agents/production.md +0 -415
- package/.morph/framework/standards/ai-agents/setup.md +0 -418
- package/.morph/framework/standards/ai-agents/team-orchestration.md +0 -479
- package/.morph/framework/standards/ai-agents/workflows.md +0 -354
- package/.morph/framework/standards/architecture/ddd/aggregates.md +0 -120
- package/.morph/framework/standards/architecture/ddd/bounded-contexts.md +0 -105
- package/.morph/framework/standards/architecture/ddd/complexity-levels.md +0 -108
- package/.morph/framework/standards/architecture/ddd/entities.md +0 -99
- package/.morph/framework/standards/architecture/ddd/ubiquitous-language.md +0 -58
- package/.morph/framework/standards/architecture/ddd/value-objects.md +0 -124
- package/.morph/framework/standards/backend/api/minimal-api.md +0 -494
- package/.morph/framework/standards/backend/api/rest.md +0 -492
- package/.morph/framework/standards/backend/api/validation.md +0 -88
- package/.morph/framework/standards/backend/authentication/passkeys.md +0 -428
- package/.morph/framework/standards/backend/database/ef-core.md +0 -199
- package/.morph/framework/standards/backend/database/migrations.md +0 -393
- package/.morph/framework/standards/backend/database/postgresql/database.md +0 -352
- package/.morph/framework/standards/backend/database/repository-patterns.md +0 -528
- package/.morph/framework/standards/backend/database/vector-search-rag.md +0 -541
- package/.morph/framework/standards/backend/dotnet/async.md +0 -366
- package/.morph/framework/standards/backend/dotnet/core.md +0 -117
- package/.morph/framework/standards/backend/dotnet/di.md +0 -439
- package/.morph/framework/standards/backend/dotnet/program-cs-checklist.md +0 -92
- package/.morph/framework/standards/backend/integrations/asaas/asaas-api.md +0 -216
- package/.morph/framework/standards/backend/integrations/clerk/clerk-auth.md +0 -290
- package/.morph/framework/standards/backend/integrations/hangfire/hangfire-jobs.md +0 -350
- package/.morph/framework/standards/backend/integrations/resend/resend-email.md +0 -385
- package/.morph/framework/standards/context/analytics.md +0 -96
- package/.morph/framework/standards/context/bundles.md +0 -110
- package/.morph/framework/standards/context/priming.md +0 -78
- package/.morph/framework/standards/core/architecture.md +0 -185
- package/.morph/framework/standards/core/coding.md +0 -214
- package/.morph/framework/standards/core/git-branching-strategy.md +0 -403
- package/.morph/framework/standards/core/git.md +0 -185
- package/.morph/framework/standards/core/testing.md +0 -295
- package/.morph/framework/standards/data/nosql/blob-storage.md +0 -102
- package/.morph/framework/standards/data/nosql/cache/redis.md +0 -97
- package/.morph/framework/standards/data/nosql/cosmos-db.md +0 -118
- package/.morph/framework/standards/data/vector-search/azure-ai-search.md +0 -121
- package/.morph/framework/standards/data/vector-search/rag-chunking.md +0 -104
- package/.morph/framework/standards/frontend/blazor/design-checklist.md +0 -222
- package/.morph/framework/standards/frontend/blazor/fluent-ui-setup.md +0 -595
- package/.morph/framework/standards/frontend/blazor/fluent-ui.md +0 -137
- package/.morph/framework/standards/frontend/blazor/html-conversion.md +0 -184
- package/.morph/framework/standards/frontend/blazor/lifecycle.md +0 -195
- package/.morph/framework/standards/frontend/blazor/pitfalls.md +0 -198
- package/.morph/framework/standards/frontend/blazor/state.md +0 -191
- package/.morph/framework/standards/frontend/design-system/animations.md +0 -151
- package/.morph/framework/standards/frontend/design-system/naming.md +0 -64
- package/.morph/framework/standards/frontend/nextjs/app-router.md +0 -123
- package/.morph/framework/standards/frontend/nextjs/components.md +0 -132
- package/.morph/framework/standards/frontend/nextjs/data-fetching.md +0 -126
- package/.morph/framework/standards/frontend/nextjs/forms.md +0 -128
- package/.morph/framework/standards/frontend/nextjs/naming-conventions.md +0 -67
- package/.morph/framework/standards/frontend/nextjs/nextjs-patterns.md +0 -215
- package/.morph/framework/standards/frontend/nextjs/project-structure.md +0 -102
- package/.morph/framework/standards/frontend/nextjs/state-management.md +0 -72
- package/.morph/framework/standards/frontend/nextjs/testing.md +0 -111
- package/.morph/framework/standards/infrastructure/azure/azure.md +0 -624
- package/.morph/framework/standards/infrastructure/azure/bicep/bicep-patterns.md +0 -422
- package/.morph/framework/standards/infrastructure/azure/devops/azure-devops-setup.md +0 -516
- package/.morph/framework/standards/infrastructure/azure/devops/local-development.md +0 -520
- package/.morph/framework/standards/infrastructure/azure/services/functions.md +0 -486
- package/.morph/framework/standards/infrastructure/azure/services/service-bus.md +0 -459
- package/.morph/framework/standards/infrastructure/azure/services/storage.md +0 -407
- package/.morph/framework/standards/infrastructure/docker/easypanel-deploy.md +0 -196
- package/.morph/framework/standards/infrastructure/supabase/mcp-setup.md +0 -252
- package/.morph/framework/standards/infrastructure/supabase/supabase-auth.md +0 -176
- package/.morph/framework/standards/infrastructure/supabase/supabase-pgvector.md +0 -169
- package/.morph/framework/standards/infrastructure/supabase/supabase-rls.md +0 -184
- package/.morph/framework/standards/infrastructure/supabase/supabase-storage.md +0 -153
- package/.morph/framework/standards/integration/api/graphql.md +0 -91
- package/.morph/framework/standards/integration/api/grpc.md +0 -114
- package/.morph/framework/standards/integration/api/rest-design.md +0 -95
- package/.morph/framework/standards/integration/event-driven/cqrs.md +0 -101
- package/.morph/framework/standards/integration/event-driven/event-sourcing.md +0 -124
- package/.morph/framework/standards/integration/event-driven/service-bus.md +0 -95
- package/.morph/framework/standards/integration/mcp/mcp-tools.md +0 -384
- package/.morph/framework/standards/observability/logging.md +0 -131
- package/.morph/framework/standards/observability/metrics.md +0 -121
- package/.morph/framework/standards/observability/monitoring.md +0 -114
- package/.morph/framework/standards/observability/tracing.md +0 -132
- package/.morph/framework/standards/workflows/parallel-execution.md +0 -112
- package/.morph/framework/standards/workflows/thread-management.md +0 -113
- package/.morph/framework/templates/.idea/morph-templates.xml +0 -92
- package/.morph/framework/templates/.vscode/morph-templates.code-snippets +0 -186
- package/.morph/framework/templates/IDE-SNIPPETS.md +0 -266
- package/.morph/framework/templates/README.md +0 -814
- package/.morph/framework/templates/REGISTRY.json +0 -1888
- package/.morph/framework/templates/code/dotnet/backend/repository.cs +0 -141
- package/.morph/framework/templates/code/dotnet/backend/service.cs +0 -139
- package/.morph/framework/templates/code/dotnet/contracts/Commands.cs +0 -74
- package/.morph/framework/templates/code/dotnet/contracts/Entities.cs +0 -25
- package/.morph/framework/templates/code/dotnet/contracts/Queries.cs +0 -74
- package/.morph/framework/templates/code/dotnet/contracts/README.md +0 -74
- package/.morph/framework/templates/code/dotnet/contracts/api-contracts.cs +0 -173
- package/.morph/framework/templates/code/dotnet/contracts/contracts-level1.cs +0 -69
- package/.morph/framework/templates/code/dotnet/contracts/contracts-level2.cs +0 -86
- package/.morph/framework/templates/code/dotnet/contracts/contracts-level3.cs +0 -41
- package/.morph/framework/templates/code/dotnet/database/migration.cs +0 -83
- package/.morph/framework/templates/code/dotnet/frontend/component.razor +0 -239
- package/.morph/framework/templates/code/dotnet/jobs/agent.cs +0 -163
- package/.morph/framework/templates/code/dotnet/jobs/job.cs +0 -171
- package/.morph/framework/templates/code/dotnet/test.cs +0 -239
- package/.morph/framework/templates/code/sql/rls-policy.sql +0 -57
- package/.morph/framework/templates/code/sql/supabase-migration.sql +0 -100
- package/.morph/framework/templates/code/sql/supabase-migration.template.sql +0 -113
- package/.morph/framework/templates/code/typescript/contracts.ts +0 -168
- package/.morph/framework/templates/context/CONTEXT-FEATURE.md +0 -276
- package/.morph/framework/templates/context/CONTEXT.md +0 -181
- package/.morph/framework/templates/docs/clarifications.md +0 -253
- package/.morph/framework/templates/docs/onboarding.md +0 -123
- package/.morph/framework/templates/docs/proposal.md +0 -182
- package/.morph/framework/templates/docs/schema-analysis.md +0 -119
- package/.morph/framework/templates/docs/spec.md +0 -198
- package/.morph/framework/templates/docs/ui-components.md +0 -124
- package/.morph/framework/templates/docs/ui-design-system.md +0 -76
- package/.morph/framework/templates/docs/ui-flows.md +0 -167
- package/.morph/framework/templates/docs/ui-mockups.md +0 -98
- package/.morph/framework/templates/docs/user-stories.md +0 -34
- package/.morph/framework/templates/examples/design-system-examples.md +0 -357
- package/.morph/framework/templates/examples/spec-examples.md +0 -90
- package/.morph/framework/templates/feature/decisions.md +0 -187
- package/.morph/framework/templates/feature/recap.md +0 -146
- package/.morph/framework/templates/feature/tasks.md +0 -199
- package/.morph/framework/templates/frontend/nextjs/Dockerfile.nextjs.hbs +0 -43
- package/.morph/framework/templates/frontend/nextjs/client-component.tsx.hbs +0 -26
- package/.morph/framework/templates/frontend/nextjs/env.mjs.hbs +0 -32
- package/.morph/framework/templates/frontend/nextjs/feature-form.tsx.hbs +0 -56
- package/.morph/framework/templates/frontend/nextjs/page.tsx.hbs +0 -22
- package/.morph/framework/templates/frontend/nextjs/tsconfig.json.hbs +0 -26
- package/.morph/framework/templates/frontend/nextjs/use-feature.ts.hbs +0 -54
- package/.morph/framework/templates/infrastructure/azure/Dockerfile.example +0 -82
- package/.morph/framework/templates/infrastructure/azure/README.md +0 -286
- package/.morph/framework/templates/infrastructure/azure/app-insights.bicep +0 -63
- package/.morph/framework/templates/infrastructure/azure/app-service.bicep +0 -164
- package/.morph/framework/templates/infrastructure/azure/container-app-env.bicep +0 -49
- package/.morph/framework/templates/infrastructure/azure/container-app.bicep +0 -156
- package/.morph/framework/templates/infrastructure/azure/deploy-checklist.md +0 -426
- package/.morph/framework/templates/infrastructure/azure/deploy.ps1 +0 -229
- package/.morph/framework/templates/infrastructure/azure/deploy.sh +0 -208
- package/.morph/framework/templates/infrastructure/azure/key-vault.bicep +0 -91
- package/.morph/framework/templates/infrastructure/azure/main.bicep +0 -189
- package/.morph/framework/templates/infrastructure/azure/parameters.dev.json +0 -29
- package/.morph/framework/templates/infrastructure/azure/parameters.prod.json +0 -29
- package/.morph/framework/templates/infrastructure/azure/parameters.staging.json +0 -29
- package/.morph/framework/templates/infrastructure/azure/sql-database.bicep +0 -103
- package/.morph/framework/templates/infrastructure/azure/storage.bicep +0 -106
- package/.morph/framework/templates/infrastructure/docker/Dockerfile.template +0 -58
- package/.morph/framework/templates/infrastructure/docker/docker-compose.template.yml +0 -67
- package/.morph/framework/templates/infrastructure/docker/dockerfile-api.dockerfile +0 -38
- package/.morph/framework/templates/infrastructure/docker/dockerfile-web.dockerfile +0 -48
- package/.morph/framework/templates/infrastructure/docker/easypanel.template.json +0 -54
- package/.morph/framework/templates/infrastructure/github/README.md +0 -593
- package/.morph/framework/templates/infrastructure/github/actions/azure-auth/action.yml.hbs +0 -22
- package/.morph/framework/templates/infrastructure/github/actions/docker-build-push/action.yml.hbs +0 -45
- package/.morph/framework/templates/infrastructure/github/actions/health-check/action.yml.hbs +0 -27
- package/.morph/framework/templates/infrastructure/github/workflows/deploy-azure-app-service.yml.hbs +0 -61
- package/.morph/framework/templates/infrastructure/github/workflows/deploy-easypanel.yml.hbs +0 -31
- package/.morph/framework/templates/infrastructure/github/workflows/docker-build-push.yml.hbs +0 -59
- package/.morph/framework/templates/infrastructure/github/workflows/dotnet-build.yml.hbs +0 -39
- package/.morph/framework/templates/integrations/asaas-client.cs +0 -387
- package/.morph/framework/templates/integrations/asaas-webhook.cs +0 -351
- package/.morph/framework/templates/integrations/azure-identity-config.cs +0 -288
- package/.morph/framework/templates/integrations/clerk-config.cs +0 -258
- package/.morph/framework/templates/meta-prompts/fusion/fusion-agent.md +0 -76
- package/.morph/framework/templates/meta-prompts/fusion/fusion-aggregator.md +0 -100
- package/.morph/framework/templates/meta-prompts/hops/hop-retry.md +0 -78
- package/.morph/framework/templates/meta-prompts/hops/hop-validation.md +0 -97
- package/.morph/framework/templates/meta-prompts/hops/hop-wrapper.md +0 -36
- package/.morph/framework/templates/meta-prompts/parallel-workers/parallel-coordinator.md +0 -113
- package/.morph/framework/templates/meta-prompts/parallel-workers/parallel-worker.md +0 -80
- package/.morph/framework/templates/meta-prompts/squad-leaders/backend-squad.md +0 -90
- package/.morph/framework/templates/meta-prompts/squad-leaders/frontend-squad.md +0 -126
- package/.morph/framework/templates/meta-prompts/squad-leaders/squad-leader.md +0 -43
- package/.morph/framework/templates/meta-prompts/validators/checkpoint-validator.md +0 -107
- package/.morph/framework/templates/meta-prompts/validators/pre-commit-validator.md +0 -95
- package/.morph/framework/templates/project-structure/dotnet-ddd.md +0 -70
- package/.morph/framework/templates/saas/subscription.cs +0 -347
- package/.morph/framework/templates/saas/tenant.cs +0 -338
- package/.morph/framework/templates/state.template.json +0 -17
- package/.morph/framework/templates/ui/FluentDesignTheme.cs +0 -149
- package/.morph/framework/templates/ui/MudTheme.cs +0 -281
- package/.morph/framework/templates/ui/design-system.css +0 -226
- package/.morph/logs/tool-failures.log +0 -17
- package/.morph/memory/pre-compact-2026-02-24T17-43-30-049Z.json +0 -16
- package/.morph/plans/eager-watching-bunny.md +0 -105
- package/.morph/plans/temporal-seeking-nebula.md +0 -45
- package/.morph/state.json +0 -48
- package/CLAUDE.md +0 -77
- package/docs/ARCHITECTURE.md +0 -331
- package/docs/COMMAND-FLOWS.md +0 -368
- package/docs/claude-alignment-report.md +0 -137
- package/docs/examples/order-management/contracts.cs +0 -84
- package/docs/examples/order-management/proposal.md +0 -24
- package/docs/examples/order-management/spec.md +0 -162
- package/docs/plans/2026-02-22-claude-docs-morph-alignment-analysis.md +0 -512
- package/docs/plans/2026-02-22-claude-settings.md +0 -515
- package/docs/plans/2026-02-22-morph-cc-alignment-impl.md +0 -728
- package/docs/plans/2026-02-22-morph-spec-next.md +0 -478
- package/docs/plans/2026-02-22-native-alignment-design.md +0 -199
- package/docs/plans/2026-02-22-native-alignment-impl.md +0 -925
- package/docs/plans/2026-02-22-native-enrichment-design.md +0 -244
- package/docs/plans/2026-02-22-native-enrichment.md +0 -735
- package/docs/plans/2026-02-23-ddd-architecture-refactor.md +0 -1153
- package/docs/plans/2026-02-23-ddd-nextsteps.md +0 -682
- package/docs/plans/2026-02-23-infra-architect-refactor.md +0 -437
- package/docs/plans/2026-02-23-nextjs-code-review-design.md +0 -156
- package/docs/plans/2026-02-23-nextjs-code-review-impl.md +0 -1254
- package/docs/plans/2026-02-23-nextjs-standards-design.md +0 -149
- package/docs/plans/2026-02-23-nextjs-standards-impl.md +0 -1846
- package/scripts/generate-refs.js +0 -336
- package/scripts/generate-standards-registry.js +0 -44
- package/scripts/scan-nextjs.mjs +0 -169
- package/scripts/validate-real.mjs +0 -255
- package/src/commands/feature/create-story.js +0 -362
- package/src/commands/feature/index.js +0 -6
- package/src/commands/feature/shard-spec.js +0 -225
- package/src/commands/feature/sprint-status.js +0 -250
- package/src/commands/generation/generate-onboarding.js +0 -169
- package/src/commands/generation/generate.js +0 -276
- package/src/commands/generation/index.js +0 -5
- package/src/commands/learning/capture-pattern.js +0 -121
- package/src/commands/learning/index.js +0 -5
- package/src/commands/learning/search-patterns.js +0 -126
- package/src/commands/mcp/mcp.js +0 -102
- package/src/commands/project/changes.js +0 -66
- package/src/commands/project/cost.js +0 -179
- package/src/commands/project/diff.js +0 -278
- package/src/commands/project/revert.js +0 -173
- package/src/commands/project/standards.js +0 -80
- package/src/commands/project/sync.js +0 -167
- package/src/commands/project/update-agents.js +0 -23
- package/src/commands/state/rollback-phase.js +0 -185
- package/src/commands/templates/template-customize.js +0 -87
- package/src/commands/templates/template-list.js +0 -114
- package/src/commands/templates/template-show.js +0 -129
- package/src/commands/templates/template-validate.js +0 -91
- package/src/commands/utils/troubleshoot.js +0 -222
- package/src/commands/validation/analyze-blazor-concurrency.js +0 -193
- package/src/commands/validation/lint-fluent.js +0 -352
- package/src/commands/validation/validate-blazor-state.js +0 -210
- package/src/commands/validation/validate-blazor.js +0 -156
- package/src/commands/validation/validate-css.js +0 -84
- package/src/lib/detectors/conversation-analyzer.js +0 -163
- package/src/lib/learning/index.js +0 -7
- package/src/lib/learning/learning-system.js +0 -520
- package/src/lib/troubleshooting/index.js +0 -8
- package/src/lib/troubleshooting/troubleshoot-grep.js +0 -198
- package/src/lib/troubleshooting/troubleshoot-index.js +0 -144
- package/src/llm/environment-detector.js +0 -43
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
# Plan: Fix Statusline Not Being Installed
|
|
2
|
-
|
|
3
|
-
## Context
|
|
4
|
-
|
|
5
|
-
`morph-spec init` is supposed to install the global statusline to `~/.claude/` so
|
|
6
|
-
it appears in every Claude Code session. Two bugs exist:
|
|
7
|
-
|
|
8
|
-
1. **`update.js` never calls `installGlobalStatusline`** — running `morph-spec update`
|
|
9
|
-
leaves the statusline missing or stale, and there is no path for existing users to
|
|
10
|
-
get it without running `init` from scratch.
|
|
11
|
-
2. **No success confirmation in `init.js` output** — after a successful installation the
|
|
12
|
-
"Files installed:" list never mentions `~/.claude/statusline.sh`, so users assume
|
|
13
|
-
it was skipped (especially since failures are silently swallowed by a bare `catch {}`).
|
|
14
|
-
|
|
15
|
-
Root cause confirmed by: reading `update.js` (no `installGlobalStatusline` import or call)
|
|
16
|
-
and `init.js` lines 462–505 (success block omits statusline entry). Tests for
|
|
17
|
-
`installGlobalStatusline` in isolation pass; there is no integration test covering the
|
|
18
|
-
init/update flow.
|
|
19
|
-
|
|
20
|
-
---
|
|
21
|
-
|
|
22
|
-
## Critical Files
|
|
23
|
-
|
|
24
|
-
| File | Change |
|
|
25
|
-
|------|--------|
|
|
26
|
-
| `src/commands/project/update.js` | Add `installGlobalStatusline` import + call |
|
|
27
|
-
| `src/commands/project/init.js` | Add `✓ ~/.claude/statusline.sh` to success output |
|
|
28
|
-
| `test/hooks/hooks-installer.test.js` | Already has good coverage — no change needed |
|
|
29
|
-
| `test/commands/init.test.js` | Add `statusline-installation` describe suite |
|
|
30
|
-
|
|
31
|
-
---
|
|
32
|
-
|
|
33
|
-
## Implementation Steps
|
|
34
|
-
|
|
35
|
-
### 1. `update.js` — Add statusline installation
|
|
36
|
-
|
|
37
|
-
**File:** `src/commands/project/update.js`
|
|
38
|
-
|
|
39
|
-
**Import change** (line 27 — extend existing destructure):
|
|
40
|
-
```js
|
|
41
|
-
import { installClaudeHooks, installGlobalStatusline } from '../../utils/claude-settings-manager.js';
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
**Call** — insert after the CLAUDE.md sync block (after line 280, before "Update Claude
|
|
45
|
-
Code hooks" at line 282):
|
|
46
|
-
```js
|
|
47
|
-
// Sync statusline globally to ~/.claude/
|
|
48
|
-
updateSpinner.text = 'Syncing statusline to ~/.claude/...';
|
|
49
|
-
const HOOKS_SRC = join(__dirname, '..', '..', '..', 'framework', 'hooks', 'claude-code');
|
|
50
|
-
try {
|
|
51
|
-
await installGlobalStatusline(HOOKS_SRC);
|
|
52
|
-
} catch {
|
|
53
|
-
// Non-critical: global dir may not be writable in all environments
|
|
54
|
-
logger.dim(' ⚠ Could not install statusline globally (non-critical)');
|
|
55
|
-
}
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
**Success output** — add line after `.claude/CLAUDE.md` entry (around line 324):
|
|
59
|
-
```js
|
|
60
|
-
logger.dim(' ✓ ~/.claude/statusline.sh (global statusline synced)');
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
Note: `update.js` already uses `__dirname` (defined at line 6 via `fileURLToPath`),
|
|
64
|
-
so use `__dirname` instead of `import.meta.dirname` to stay consistent with the file.
|
|
65
|
-
|
|
66
|
-
---
|
|
67
|
-
|
|
68
|
-
### 2. `init.js` — Add statusline to success output
|
|
69
|
-
|
|
70
|
-
**File:** `src/commands/project/init.js`
|
|
71
|
-
|
|
72
|
-
After line 505 (`logger.dim(' ✓ .claude/agents/...')`), add:
|
|
73
|
-
```js
|
|
74
|
-
logger.dim(' ✓ ~/.claude/statusline.sh (global statusline installed)');
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
This line is unconditional — the installation is always attempted and the message
|
|
78
|
-
reflects the intent (mirrors how skills/agents are always listed even without a flag).
|
|
79
|
-
|
|
80
|
-
---
|
|
81
|
-
|
|
82
|
-
### 3. `test/commands/init.test.js` — Add statusline integration test suite
|
|
83
|
-
|
|
84
|
-
Add a new `describe('statusline-installation')` block that:
|
|
85
|
-
- Calls `installGlobalStatusline` directly with a `globalClaudeDirOverride` temp dir
|
|
86
|
-
and the real `framework/hooks/claude-code` source path
|
|
87
|
-
- Asserts `statusline.sh` and `statusline.py` were copied
|
|
88
|
-
- Asserts `settings.json` has a `statusLine` key pointing to `statusline.sh`
|
|
89
|
-
|
|
90
|
-
This mirrors the pattern used by the `rules-installation` suite.
|
|
91
|
-
|
|
92
|
-
---
|
|
93
|
-
|
|
94
|
-
## Verification
|
|
95
|
-
|
|
96
|
-
```bash
|
|
97
|
-
# Run full test suite — must stay green (678+ pass, 0 fail)
|
|
98
|
-
node --test --test-concurrency=1
|
|
99
|
-
|
|
100
|
-
# Smoke test update path
|
|
101
|
-
node bin/morph-spec.js update --skip-detection --skip-mcp 2>&1 | grep -i statusline
|
|
102
|
-
|
|
103
|
-
# Manually verify ~/.claude/statusline.sh exists and settings.json has statusLine key
|
|
104
|
-
node -e "const s = require('fs').readFileSync(require('os').homedir()+'/.claude/settings.json','utf8'); console.log(JSON.parse(s).statusLine)"
|
|
105
|
-
```
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
# Plan: Remove `detect` command and fix `init` for PowerShell execution
|
|
2
|
-
|
|
3
|
-
## Context
|
|
4
|
-
|
|
5
|
-
`morph-spec init` is run from PowerShell (not inside Claude Code), so `detectClaudeCode()` always returns false, making step 13 a dead code branch that shows a confusing warning. `morph-spec detect` is registered but provides no additional value beyond what `init` already does with `detectProject()`. `--wizard` is referenced in messages but was never registered as a CLI option. This plan removes the dead code and makes `init` self-sufficient.
|
|
6
|
-
|
|
7
|
-
## What changes
|
|
8
|
-
|
|
9
|
-
### 1. Delete `src/commands/project/detect.js`
|
|
10
|
-
The command is obsolete — its functionality (stack/arch detection + saving to `.morph/project/context/`) is superseded by the `detectProject()` call already inside `init` at step 11c.
|
|
11
|
-
|
|
12
|
-
### 2. `bin/morph-spec.js`
|
|
13
|
-
- Remove `import { detectCommand }` (line 14)
|
|
14
|
-
- Remove the `.command('detect')` block (lines 131–136)
|
|
15
|
-
|
|
16
|
-
### 3. `src/commands/project/init.js`
|
|
17
|
-
- Remove imports: `AutoContextOrchestrator` (line 21), `detectClaudeCode` (line 22)
|
|
18
|
-
- **Remove step 13 entirely** (lines 509–540) — the entire `if (!options.skipDetection && detectClaudeCode())` / `else if` / `else` block
|
|
19
|
-
- Fix context README.md template (line 110): remove `Run \`morph-spec detect\`` sentence, replace with `Edit this file to describe your project context.`
|
|
20
|
-
- Fix Next Steps (line 470): remove `logger.step(1, 'Run detection: morph-spec detect')`, renumber remaining steps (step 1 → "Review .morph/config/config.json", step 2 → "Open project in VS Code with Claude Code", step 3 → "Start your first feature:")
|
|
21
|
-
|
|
22
|
-
### 4. `src/commands/project/update.js`
|
|
23
|
-
- Remove imports: `AutoContextOrchestrator`, `detectClaudeCode` (lines ~3–4 in that file)
|
|
24
|
-
- Remove the `if (!options.skipDetection && detectClaudeCode())` / `else if` / `else` block (lines 331–363)
|
|
25
|
-
|
|
26
|
-
## Files to modify
|
|
27
|
-
- `bin/morph-spec.js`
|
|
28
|
-
- `src/commands/project/init.js`
|
|
29
|
-
- `src/commands/project/update.js`
|
|
30
|
-
|
|
31
|
-
## Files to delete
|
|
32
|
-
- `src/commands/project/detect.js`
|
|
33
|
-
|
|
34
|
-
## Files NOT changed
|
|
35
|
-
- `test/integration/wizard-fallback.test.js` — tests `mapAnswersToConfig()` from `wizard-questions.js`, unrelated to detect command; still passes
|
|
36
|
-
- `test/commands/init.test.js` — no references to detect/wizard/detectClaudeCode; unaffected
|
|
37
|
-
- `src/core/orchestrator.js`, `src/ui/wizard-questions.js`, `src/llm/environment-detector.js` — left in place (may be used elsewhere); just remove imports/usage from init+update
|
|
38
|
-
- `src/lib/detectors/index.js` + `detectProject()` — **kept** in init (step 11c); this is the static file-based stack detection that works without Claude Code
|
|
39
|
-
|
|
40
|
-
## Verification
|
|
41
|
-
1. `node bin/morph-spec.js --help` — `detect` command should no longer appear
|
|
42
|
-
2. `node bin/morph-spec.js init --help` — no `--skip-detection` or `--wizard` references
|
|
43
|
-
3. `node bin/morph-spec.js update --help` — same
|
|
44
|
-
4. Run test suite: `npm test` — should still pass 678 tests (no tests reference detect/wizard in init.test.js)
|
|
45
|
-
5. Manual: run `morph-spec init` from PowerShell in a test project — should complete without the "Claude Code not detected" warning
|
package/.morph/state.json
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": "4.0.0",
|
|
3
|
-
"features": {
|
|
4
|
-
"override-feature": {
|
|
5
|
-
"status": "in_progress",
|
|
6
|
-
"phase": "implement",
|
|
7
|
-
"tasks": {
|
|
8
|
-
"total": 20,
|
|
9
|
-
"completed": 30
|
|
10
|
-
},
|
|
11
|
-
"checkpoints": [
|
|
12
|
-
{
|
|
13
|
-
"passed": true
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"passed": true
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"passed": false
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"passed": false
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"passed": false
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"passed": false
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
"passed": false
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"passed": false
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
"passed": false
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
"passed": false
|
|
41
|
-
}
|
|
42
|
-
],
|
|
43
|
-
"trustConfig": {}
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
"threads": {},
|
|
47
|
-
"metadata": {}
|
|
48
|
-
}
|
package/CLAUDE.md
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
# MORPH-SPEC Runtime Instructions
|
|
2
|
-
|
|
3
|
-
> by Polymorphism Tech — Spec-driven development for .NET/Blazor/Next.js/Azure
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Project Context
|
|
8
|
-
|
|
9
|
-
@.morph/context/README.md
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
## Critical Rules
|
|
14
|
-
|
|
15
|
-
**NEVER:**
|
|
16
|
-
- Skip to code without a specification
|
|
17
|
-
- Implement without design approval
|
|
18
|
-
- Ignore standards in `.morph/framework/standards/`
|
|
19
|
-
- Create infrastructure manually
|
|
20
|
-
- Generate code without defined contracts
|
|
21
|
-
|
|
22
|
-
**ALWAYS:**
|
|
23
|
-
- Follow the mandatory phases
|
|
24
|
-
- Generate outputs in `.morph/features/{feature}/`
|
|
25
|
-
- Document decisions in `decisions.md`
|
|
26
|
-
- Checkpoint every 3 implemented tasks
|
|
27
|
-
- Use Infrastructure as Code
|
|
28
|
-
|
|
29
|
-
---
|
|
30
|
-
|
|
31
|
-
## Quick Reference
|
|
32
|
-
|
|
33
|
-
| Command | Purpose |
|
|
34
|
-
|---------|---------|
|
|
35
|
-
| `/morph-proposal {feature}` | Full spec pipeline (phases 1–4, pauses for approval) |
|
|
36
|
-
| `/morph-apply {feature}` | Implement feature (phase 5) |
|
|
37
|
-
| `/morph-status` | Feature status dashboard |
|
|
38
|
-
| `/morph-preflight` | Pre-implementation validation |
|
|
39
|
-
|
|
40
|
-
---
|
|
41
|
-
|
|
42
|
-
## State & Outputs
|
|
43
|
-
|
|
44
|
-
| Path | Notes |
|
|
45
|
-
|------|-------|
|
|
46
|
-
| `.morph/state.json` | **READ-ONLY** — use `morph-spec` CLI to update |
|
|
47
|
-
| `.morph/features/{feature}/{phase}/` | Feature outputs organized by phase |
|
|
48
|
-
| `.morph/framework/` | **READ-ONLY** — framework files managed by morph-spec |
|
|
49
|
-
| `.morph/config/config.json` | Project configuration (editable) |
|
|
50
|
-
|
|
51
|
-
---
|
|
52
|
-
|
|
53
|
-
## Phase Sequence
|
|
54
|
-
|
|
55
|
-
```
|
|
56
|
-
proposal → setup → [uiux] → design → clarify → tasks → implement → [sync]
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
Use `morph-spec status {feature}` to see current phase and pending approval gates.
|
|
60
|
-
|
|
61
|
-
---
|
|
62
|
-
|
|
63
|
-
## Agents
|
|
64
|
-
|
|
65
|
-
Tier-1 and tier-2 MORPH agents are available as native subagents in `.claude/agents/`.
|
|
66
|
-
They can be invoked directly by Claude Code during multi-agent workflows.
|
|
67
|
-
|
|
68
|
-
---
|
|
69
|
-
|
|
70
|
-
## Context Window Tip
|
|
71
|
-
|
|
72
|
-
When using 3+ MCPs, add `"experimental": { "mcpCliMode": true }` to `.claude/settings.json`.
|
|
73
|
-
MCP tools load on-demand instead of all at startup — keeps context clean for actual work.
|
|
74
|
-
|
|
75
|
-
---
|
|
76
|
-
|
|
77
|
-
*MORPH-SPEC v4.5.0 by Polymorphism Tech*
|
package/docs/ARCHITECTURE.md
DELETED
|
@@ -1,331 +0,0 @@
|
|
|
1
|
-
# morph-spec Architecture
|
|
2
|
-
|
|
3
|
-
> System design reference for morph-spec v4.6.0
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Overview
|
|
8
|
-
|
|
9
|
-
morph-spec is a CLI tool that scaffolds a spec-driven development workflow on top of Claude Code. It installs a structured set of files into `.morph/` and `.claude/`, then lets the AI orchestrate feature development through well-defined phases with approval gates.
|
|
10
|
-
|
|
11
|
-
The framework has three main concerns:
|
|
12
|
-
|
|
13
|
-
1. **State** — tracking features, phases, and outputs in `.morph/state.json`
|
|
14
|
-
2. **Agents** — 37 specialized agents organized in 4 tiers, installed as native Claude Code subagents
|
|
15
|
-
3. **Workflow** — 8 phases from proposal through implementation, enforced via hooks and guards
|
|
16
|
-
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
## Agent hierarchy
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
Tier 1 — Orchestrators (3)
|
|
23
|
-
standards-architect always active — Chief Architect, enforces standards
|
|
24
|
-
ai-system-architect on-demand — multi-agent / AI system design
|
|
25
|
-
po-pm-advisor on-demand — requirements, business value
|
|
26
|
-
|
|
27
|
-
Tier 2 — Domain Leaders (3)
|
|
28
|
-
dotnet-senior always active — Backend Squad lead
|
|
29
|
-
infra-architect always active — Infrastructure Squad Leader (cloud-agnostic)
|
|
30
|
-
ui-designer on-demand — UI/UX Squad lead
|
|
31
|
-
|
|
32
|
-
Tier 3 — Specialists (27)
|
|
33
|
-
Backend (10) ef-modeler, event-architect, api-designer, nosql-cache-expert,
|
|
34
|
-
ddd-expert, hangfire-orchestrator, ms-agent-expert,
|
|
35
|
-
asaas-financial, clerk-auth, resend-email
|
|
36
|
-
Frontend (3) blazor-builder, nextjs-expert, css-specialist
|
|
37
|
-
Infrastructure (6) azure-architect, bicep-architect, devops-engineer,
|
|
38
|
-
container-specialist, observability-expert, azure-identity
|
|
39
|
-
Quality/Cross (8) testing-specialist, code-analyzer, troubleshooting-expert,
|
|
40
|
-
load-testing-expert, documentation-specialist,
|
|
41
|
-
migration-specialist, integration-specialist, data-modeler
|
|
42
|
-
|
|
43
|
-
Tier 4 — Validators (5)
|
|
44
|
-
security-expert SQL injection, XSS, hardcoded secrets
|
|
45
|
-
architecture-expert DbContext, async/await, DI order
|
|
46
|
-
packages-validator NuGet conflicts, .NET 10 compatibility
|
|
47
|
-
design-system-validator CSS palette, spacing, typography
|
|
48
|
-
blazor-concurrency-validator DbContext lifecycle, async void, JSInterop
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
### Agent installation
|
|
52
|
-
|
|
53
|
-
Tier 1–2 agents are installed to `.claude/agents/morph-{id}.md` with YAML frontmatter:
|
|
54
|
-
|
|
55
|
-
```yaml
|
|
56
|
-
---
|
|
57
|
-
name: morph-standards-architect
|
|
58
|
-
description: Chief Architect...
|
|
59
|
-
model: sonnet
|
|
60
|
-
---
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
Tier 3 domain agents are installed to `.claude/agents/morph-domain-{name}.md` with:
|
|
64
|
-
|
|
65
|
-
```yaml
|
|
66
|
-
---
|
|
67
|
-
model: sonnet
|
|
68
|
-
memory: project
|
|
69
|
-
maxTurns: 20
|
|
70
|
-
---
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
Both sets are updated by `morph-spec update` and `morph-spec update-agents`.
|
|
74
|
-
|
|
75
|
-
### Agent detection
|
|
76
|
-
|
|
77
|
-
When a feature is created, `detect-agents` matches keywords in the feature description against `agents.json` keyword lists. Matched agents are stored in `state.json` under the feature's `activeAgents` array. The active agent set determines which standards are loaded and which validators run.
|
|
78
|
-
|
|
79
|
-
---
|
|
80
|
-
|
|
81
|
-
## Phase pipeline
|
|
82
|
-
|
|
83
|
-
```
|
|
84
|
-
0-proposal → 1-setup → [1.5-uiux] → 2-design → 3-clarify → 4-tasks → 5-implement → [6-sync]
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
| Phase | ID | Optional | Approval gate | Output directory |
|
|
88
|
-
|-------|-----|----------|--------------|-----------------|
|
|
89
|
-
| Proposal | `proposal` | No | Yes | `0-proposal/` |
|
|
90
|
-
| Setup | `setup` | No | No | — |
|
|
91
|
-
| UI/UX | `uiux` | Yes | Yes | `2-ui/` |
|
|
92
|
-
| Design | `design` | No | Yes | `1-design/` |
|
|
93
|
-
| Clarify | `clarify` | No | No | `1-design/` (updates) |
|
|
94
|
-
| Tasks | `tasks` | No | Yes | `3-tasks/` |
|
|
95
|
-
| Implement | `implement` | No | No | `4-implement/` |
|
|
96
|
-
| Sync | `sync` | Yes | No | `.morph/context/` |
|
|
97
|
-
|
|
98
|
-
Phase transitions are controlled by the state machine in `src/lib/state/`. Advancing to a phase with an approval gate is blocked until the gate is explicitly passed. `protect-spec-files.js` (hook) guards spec/contracts from edits after the design gate is passed.
|
|
99
|
-
|
|
100
|
-
Canonical phase definitions live in `framework/phases.json`.
|
|
101
|
-
|
|
102
|
-
---
|
|
103
|
-
|
|
104
|
-
## File structure
|
|
105
|
-
|
|
106
|
-
### Framework source (this repo)
|
|
107
|
-
|
|
108
|
-
```
|
|
109
|
-
framework/
|
|
110
|
-
├── agents.json # 37 agents definition (v3.1.0)
|
|
111
|
-
├── phases.json # 8 phase definitions
|
|
112
|
-
├── CLAUDE_runtime.md # copied to .claude/CLAUDE.md on init
|
|
113
|
-
├── agents/ # tier 1-2 agent markdown files
|
|
114
|
-
├── hooks/
|
|
115
|
-
│ ├── claude-code/ # 11 Claude Code hook scripts
|
|
116
|
-
│ │ └── shared/ # state-reader, phase-utils, hook-response, stdin-reader
|
|
117
|
-
│ └── git/ # pre-commit, commit-msg, pre-push
|
|
118
|
-
├── rules/ # 5 rule files (copied to .claude/rules/)
|
|
119
|
-
├── skills/
|
|
120
|
-
│ ├── README.md
|
|
121
|
-
│ ├── level-0-meta/ # 7 meta skills (brainstorming, code-review, etc.)
|
|
122
|
-
│ │ └── {skill}/
|
|
123
|
-
│ │ ├── SKILL.md # skill content
|
|
124
|
-
│ │ ├── scripts/ # optional helper scripts
|
|
125
|
-
│ │ └── references/ # optional reference materials
|
|
126
|
-
│ └── level-1-workflows/ # 8 workflow skills (phase-proposal, phase-design, etc.)
|
|
127
|
-
│ └── {skill}/
|
|
128
|
-
│ └── SKILL.md
|
|
129
|
-
├── standards/ # 74 standards, 11 categories
|
|
130
|
-
│ ├── STANDARDS.json # registry (regenerate: node scripts/generate-standards-registry.js)
|
|
131
|
-
│ ├── core/
|
|
132
|
-
│ ├── backend/
|
|
133
|
-
│ ├── frontend/
|
|
134
|
-
│ ├── infrastructure/
|
|
135
|
-
│ └── integration/
|
|
136
|
-
├── templates/ # Handlebars v2.0 code and IaC templates
|
|
137
|
-
│ ├── infrastructure/ # Bicep, Docker, GitHub Actions
|
|
138
|
-
│ └── ...
|
|
139
|
-
└── workflows/
|
|
140
|
-
└── configs/ # 10 workflow configs (express, spec-only, zero-touch, fusion, ...)
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
### Installed into a project (after init)
|
|
144
|
-
|
|
145
|
-
```
|
|
146
|
-
.morph/
|
|
147
|
-
├── config/config.json # editable project config
|
|
148
|
-
├── framework/ # READ-ONLY copy from package
|
|
149
|
-
│ ├── agents.json
|
|
150
|
-
│ ├── standards/
|
|
151
|
-
│ └── templates/
|
|
152
|
-
├── context/ # editable project context
|
|
153
|
-
│ ├── README.md # loaded at every SessionStart
|
|
154
|
-
│ └── standards.md
|
|
155
|
-
├── features/{feature}/ # feature outputs
|
|
156
|
-
│ ├── 0-proposal/
|
|
157
|
-
│ ├── 1-design/
|
|
158
|
-
│ ├── 2-ui/
|
|
159
|
-
│ ├── 3-tasks/
|
|
160
|
-
│ └── 4-implement/
|
|
161
|
-
├── checkpoints/
|
|
162
|
-
├── logs/tool-failures.log
|
|
163
|
-
└── state.json # READ-ONLY
|
|
164
|
-
|
|
165
|
-
.claude/
|
|
166
|
-
├── CLAUDE.md # runtime instructions
|
|
167
|
-
├── commands/ # slash command .md files
|
|
168
|
-
├── skills/ # flat install of framework/skills/
|
|
169
|
-
│ └── {skill-name}/
|
|
170
|
-
│ └── SKILL.md
|
|
171
|
-
├── agents/ # native subagents
|
|
172
|
-
│ ├── morph-{id}.md # tier 1-2 (from framework/agents/)
|
|
173
|
-
│ └── morph-domain-{name}.md # tier 3 (from framework/skills/level-2-domains/)
|
|
174
|
-
├── rules/ # path-scoped rules (from framework/rules/)
|
|
175
|
-
│ ├── morph-workflow.md # always active
|
|
176
|
-
│ ├── csharp-standards.md
|
|
177
|
-
│ ├── frontend-standards.md
|
|
178
|
-
│ ├── testing-standards.md
|
|
179
|
-
│ └── infrastructure-standards.md
|
|
180
|
-
└── settings.local.json # hooks, permissions.deny, env vars
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
---
|
|
184
|
-
|
|
185
|
-
## Skills system
|
|
186
|
-
|
|
187
|
-
Skills are Markdown files that provide Claude Code with domain knowledge and procedures. They are invoked via the `Skill` tool inside Claude Code.
|
|
188
|
-
|
|
189
|
-
### Directory structure
|
|
190
|
-
|
|
191
|
-
Each skill lives in its own directory under `framework/skills/{level}/{skill-name}/`:
|
|
192
|
-
|
|
193
|
-
```
|
|
194
|
-
{skill-name}/
|
|
195
|
-
├── SKILL.md # required — main content
|
|
196
|
-
├── scripts/ # optional — helper scripts (.mjs)
|
|
197
|
-
└── references/ # optional — reference documents
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
### Levels
|
|
201
|
-
|
|
202
|
-
| Level | Directory | Count | Purpose |
|
|
203
|
-
|-------|-----------|-------|---------|
|
|
204
|
-
| 0 | `level-0-meta/` | 7 | Cross-cutting: brainstorming, code review, verification, tool usage |
|
|
205
|
-
| 1 | `level-1-workflows/` | 8 | Phase workflows: phase-proposal, phase-setup, phase-uiux, phase-design, phase-clarify, phase-tasks, phase-implement, phase-sync |
|
|
206
|
-
|
|
207
|
-
### Installation
|
|
208
|
-
|
|
209
|
-
`installSkills()` in `src/utils/skills-installer.js` flattens all skills to `.claude/skills/{name}/SKILL.md`. Skills become available as `/{name}` slash commands in Claude Code.
|
|
210
|
-
|
|
211
|
-
---
|
|
212
|
-
|
|
213
|
-
## Hooks system
|
|
214
|
-
|
|
215
|
-
11 Claude Code hooks are configured in `.claude/settings.local.json`. All hooks fail-open (catch + exit 0) to prevent blocking Claude Code on errors.
|
|
216
|
-
|
|
217
|
-
| Event | Hook | Function |
|
|
218
|
-
|-------|------|----------|
|
|
219
|
-
| `SessionStart` | `inject-morph-context.js` | Injects active feature `1-design/spec.md` (3000 char max) into context |
|
|
220
|
-
| `UserPromptSubmit` | `protect-spec-files.js` | Guards spec files after design gate approval |
|
|
221
|
-
| `PreToolUse` (Bash) | Prompt-type inline guard | Detects destructive shell patterns in Claude's reasoning |
|
|
222
|
-
| `PreToolUse` (Write/Edit) | `validate-feature-phase.js` | Validates write targets against current phase |
|
|
223
|
-
| `PostToolUse` (Write) | `track-output-creation.js` | Detects when feature output files are created; updates state directly via JSON I/O (no subprocess) |
|
|
224
|
-
| `PostToolUse` (any) | `checkpoint-trigger.js` | Triggers auto-checkpoint every 3 completed tasks |
|
|
225
|
-
| `PostToolUseFailure` | `handle-tool-failure.js` | Appends failure details to `.morph/logs/tool-failures.log` |
|
|
226
|
-
| `Stop` | `session-summary.js` | Writes session summary |
|
|
227
|
-
| `PreCompact` | `compact-context.js` | Preserves critical state before context compaction |
|
|
228
|
-
| `Notification` | `morph-notify.js` | Routes approval gate notifications |
|
|
229
|
-
|
|
230
|
-
Shared utilities live in `framework/hooks/claude-code/shared/`:
|
|
231
|
-
- `state-reader.js` — reads `.morph/state.json` without subprocess
|
|
232
|
-
- `phase-utils.js` — phase validation helpers
|
|
233
|
-
- `hook-response.js` — standardized hook response formatting
|
|
234
|
-
- `stdin-reader.js` — reads hook event data from stdin
|
|
235
|
-
|
|
236
|
-
Git hooks (`framework/hooks/git/`): `pre-commit`, `commit-msg` (Conventional Commits), `pre-push` (runs tests).
|
|
237
|
-
|
|
238
|
-
### Protected files
|
|
239
|
-
|
|
240
|
-
`permissions.deny` in `settings.local.json` blocks direct edits:
|
|
241
|
-
|
|
242
|
-
```json
|
|
243
|
-
"permissions": {
|
|
244
|
-
"deny": [
|
|
245
|
-
"Write(.morph/state.json)",
|
|
246
|
-
"Edit(.morph/state.json)",
|
|
247
|
-
"Write(.morph/framework/**)",
|
|
248
|
-
"Edit(.morph/framework/**)"
|
|
249
|
-
]
|
|
250
|
-
}
|
|
251
|
-
```
|
|
252
|
-
|
|
253
|
-
---
|
|
254
|
-
|
|
255
|
-
## State machine
|
|
256
|
-
|
|
257
|
-
`.morph/state.json` tracks the state of all features. It is managed exclusively by the CLI — never edited directly.
|
|
258
|
-
|
|
259
|
-
```json
|
|
260
|
-
{
|
|
261
|
-
"version": "4.0.0",
|
|
262
|
-
"features": {
|
|
263
|
-
"my-feature": {
|
|
264
|
-
"phase": "design",
|
|
265
|
-
"status": "in_progress",
|
|
266
|
-
"activeAgents": ["dotnet-senior", "ef-modeler", "testing-specialist"],
|
|
267
|
-
"approvals": {
|
|
268
|
-
"proposal": true,
|
|
269
|
-
"design": false,
|
|
270
|
-
"tasks": false
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
```
|
|
276
|
-
|
|
277
|
-
State auto-migrates from v3.0.0 to v4.0.0 on first CLI access.
|
|
278
|
-
|
|
279
|
-
Feature outputs (spec.md, contracts.cs, tasks.md, etc.) are tracked by scanning the filesystem at runtime — not stored in state. This keeps state lean and avoids the circular tracking bug of earlier versions.
|
|
280
|
-
|
|
281
|
-
---
|
|
282
|
-
|
|
283
|
-
## Standards registry
|
|
284
|
-
|
|
285
|
-
74 standards across 11 categories are registered in `framework/standards/STANDARDS.json`. Each entry has an `id`, `name`, `path`, `scope`, `layer`, and `keywords`.
|
|
286
|
-
|
|
287
|
-
Regenerate the registry after adding standards:
|
|
288
|
-
|
|
289
|
-
```bash
|
|
290
|
-
node scripts/generate-standards-registry.js
|
|
291
|
-
```
|
|
292
|
-
|
|
293
|
-
Browse via CLI:
|
|
294
|
-
|
|
295
|
-
```bash
|
|
296
|
-
morph-spec standards --list
|
|
297
|
-
morph-spec standards --list --category backend
|
|
298
|
-
morph-spec standards --search "async"
|
|
299
|
-
morph-spec standards --show csharp-naming
|
|
300
|
-
```
|
|
301
|
-
|
|
302
|
-
---
|
|
303
|
-
|
|
304
|
-
## Workflow configs
|
|
305
|
-
|
|
306
|
-
`framework/workflows/configs/` contains 10 workflow configurations that customize how the phase pipeline runs:
|
|
307
|
-
|
|
308
|
-
| Config | Description |
|
|
309
|
-
|--------|-------------|
|
|
310
|
-
| `default` | Full pipeline with all phases |
|
|
311
|
-
| `express` | Condensed pipeline for small features |
|
|
312
|
-
| `spec-only` | Proposal through tasks, no implementation |
|
|
313
|
-
| `zero-touch` | Fully automated (maximum trust level) |
|
|
314
|
-
| `fusion` | Combines setup + design into single phase |
|
|
315
|
-
| ... | + 5 more |
|
|
316
|
-
|
|
317
|
-
Trust levels (`low`, `medium`, `high`, `maximum`) control how many approval gates are enforced automatically vs manually.
|
|
318
|
-
|
|
319
|
-
---
|
|
320
|
-
|
|
321
|
-
## CLI internals
|
|
322
|
-
|
|
323
|
-
- **Entry point:** `bin/morph-spec.js` — Commander.js, 110+ commands
|
|
324
|
-
- **Commands:** `src/commands/` — organized into subdirectories by domain
|
|
325
|
-
- **Libraries:** `src/lib/` — state, validators, templates, agents, detection
|
|
326
|
-
- **Templates engine:** Handlebars v2.0 with helpers (pascalCase, camelCase, snakeCase, pluralize)
|
|
327
|
-
- **Test suite:** `test/` — Node.js built-in test runner, 625+ tests
|
|
328
|
-
|
|
329
|
-
---
|
|
330
|
-
|
|
331
|
-
*morph-spec v4.6.0 by Polymorphism Tech*
|