@polymorphism-tech/morph-spec 8.44.0 → 8.45.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 +10 -9
- package/README.md +10 -10
- package/bin/morph-spec.js +10 -13
- package/bin/validate.js +379 -379
- package/claude-plugin.json +1 -1
- package/docs/CHEATSHEET.md +2 -4
- package/docs/QUICKSTART.md +6 -6
- package/framework/CLAUDE.md +6 -8
- package/framework/MORPH.md +39 -45
- package/framework/agents.json +8 -9
- package/framework/commands/morph-apply.md +1 -3
- package/framework/commands/morph-hotfix.md +1 -1
- package/framework/commands/morph-proposal.md +2 -2
- package/framework/docs/CLI.md +10 -10
- package/framework/evals/review-checklist.md +90 -0
- package/framework/evals/trace-schema.md +2 -12
- package/framework/hooks/README.md +2 -3
- package/framework/hooks/claude-code/core/heavy-gate.js +1 -1
- package/framework/hooks/claude-code/core/protect-spec-files.js +2 -2
- package/framework/hooks/claude-code/core/telemetry-log.js +2 -2
- package/framework/hooks/claude-code/core/trace-autogen.js +1 -22
- package/framework/hooks/claude-code/core/validate-completion.js +3 -56
- package/framework/hooks/claude-code/statusline.sh +11 -11
- package/framework/hooks/git/commit-msg/conventional-commits.sh +33 -33
- package/framework/hooks/git/pre-commit/agents.sh +25 -25
- package/framework/hooks/git/pre-commit/orchestrator.sh +64 -64
- package/framework/hooks/git/pre-commit/specs.sh +50 -50
- package/framework/hooks/git/pre-push/run-tests.sh +44 -44
- package/framework/hooks/shared/build-check.js +1 -1
- package/framework/hooks/shared/comment-scanner.js +1 -1
- package/framework/hooks/shared/phase-utils.js +0 -5
- package/framework/hooks/shared/stdin-reader.js +26 -26
- package/framework/phases.json +4 -6
- package/framework/rubrics/backend.json +1 -1
- package/framework/rubrics/default.json +1 -1
- package/framework/rubrics/frontend.json +1 -1
- package/framework/rules/morph-workflow.md +6 -6
- package/framework/schemas/feature.schema.json +2 -28
- package/framework/schemas/tasks.schema.json +6 -2
- package/framework/skills/README.md +1 -2
- package/framework/skills/core/create-umbraco-lp/SKILL.md +1 -1
- package/framework/skills/core/migrate-lp-to-umbraco/SKILL.md +1 -1
- package/framework/skills/core/morph-apply/SKILL.md +145 -246
- package/framework/skills/core/morph-brainstorming/SKILL.md +1 -1
- package/framework/skills/core/morph-hotfix/SKILL.md +5 -3
- package/framework/skills/core/morph-implement/SKILL.md +101 -201
- package/framework/skills/core/morph-machine/SKILL.md +3 -3
- package/framework/skills/core/morph-media/SKILL.md +1 -1
- package/framework/skills/core/morph-plan/SKILL.md +171 -287
- package/framework/skills/core/morph-proposal/SKILL.md +4 -5
- package/framework/skills/core/morph-review/SKILL.md +109 -430
- package/framework/skills/core/morph-stack-scan/SKILL.md +1 -1
- package/framework/skills/core/morph-standards/SKILL.md +2 -2
- package/framework/skills/core/morph-uiux/SKILL.md +2 -3
- package/framework/standards/STANDARDS.json +10 -10
- package/framework/standards/ai-agents/agent-archetypes.md +1 -1
- package/framework/standards/ai-agents/agent-session.md +1 -1
- package/framework/standards/ai-agents/agent-spec.md +1 -1
- package/framework/standards/ai-agents/batching.md +1 -1
- package/framework/standards/ai-agents/context-providers.md +1 -1
- package/framework/standards/ai-agents/conversational-agent-with-phases.md +1 -1
- package/framework/standards/ai-agents/cost-and-budget.md +1 -1
- package/framework/standards/ai-agents/durable-workflows-hitl.md +1 -1
- package/framework/standards/ai-agents/guardrails.md +1 -1
- package/framework/standards/ai-agents/llm-runtime-defaults.md +1 -1
- package/framework/standards/ai-agents/mcp-server.md +1 -1
- package/framework/standards/ai-agents/mcp-tools.md +1 -1
- package/framework/standards/ai-agents/media-pipeline.md +1 -1
- package/framework/standards/ai-agents/media-video.md +1 -1
- package/framework/standards/ai-agents/middleware-patterns.md +1 -1
- package/framework/standards/ai-agents/modalities-image-gen.md +1 -1
- package/framework/standards/ai-agents/modalities-speech-to-text.md +1 -1
- package/framework/standards/ai-agents/modalities-text-to-speech.md +1 -1
- package/framework/standards/ai-agents/modalities-vision.md +1 -1
- package/framework/standards/ai-agents/multi-agent-patterns.md +1 -1
- package/framework/standards/ai-agents/observability-patterns.md +3 -3
- package/framework/standards/ai-agents/production.md +2 -2
- package/framework/standards/ai-agents/prompt-sources.md +1 -1
- package/framework/standards/ai-agents/providers/model-registry.md +1 -1
- package/framework/standards/ai-agents/rag-custom-pgvector.md +1 -1
- package/framework/standards/ai-agents/service-tier-flex.md +1 -1
- package/framework/standards/ai-agents/setup.md +1 -1
- package/framework/standards/ai-agents/structured-output.md +1 -1
- package/framework/standards/ai-agents/sweet-spot.md +1 -1
- package/framework/standards/ai-agents/testing-ai.md +1 -1
- package/framework/standards/ai-agents/tool-adapters.md +1 -1
- package/framework/standards/ai-agents/vector-data-extensions.md +1 -1
- package/framework/standards/ai-agents/workflows.md +1 -1
- package/framework/templates/CLAUDE.md.core.template +1 -1
- package/framework/templates/IDE-SNIPPETS.md +262 -262
- package/framework/templates/README.md +1 -1
- package/framework/templates/REGISTRY.json +0 -81
- package/framework/templates/code/dotnet/abstractions/api-endpoint.cs +7 -7
- package/framework/templates/code/dotnet/feature/endpoint.cs.hbs +21 -21
- package/framework/templates/code/dotnet/feature/request.cs.hbs +4 -4
- package/framework/templates/code/dotnet/feature/response.cs.hbs +4 -4
- package/framework/templates/code/sql/ai-agents/pgvector-embeddings-migration.sql.template +91 -91
- package/framework/templates/docs/spec.md +19 -205
- package/framework/templates/docs/ui-components.md +52 -52
- package/framework/templates/docs/ui-design-system.md +76 -76
- package/framework/templates/docs/ui-flows.md +167 -167
- package/framework/templates/frontend/nextjs/client-component.tsx.hbs +26 -26
- package/framework/templates/frontend/nextjs/feature-form.tsx.hbs +56 -56
- package/framework/templates/frontend/nextjs/tsconfig.json.hbs +26 -26
- package/framework/templates/infrastructure/docker/Dockerfile.template +58 -58
- package/framework/templates/infrastructure/docker/dockerfile-api.dockerfile +38 -38
- package/framework/templates/infrastructure/docker/dockerfile-web.dockerfile +48 -48
- package/framework/templates/infrastructure/github/README.md +56 -56
- package/framework/templates/infrastructure/github/actions/docker-build-push/action.yml.hbs +45 -45
- package/framework/templates/infrastructure/github/actions/health-check/action.yml.hbs +27 -27
- package/framework/templates/infrastructure/github/workflows/docker-build-push.yml.hbs +59 -59
- package/framework/templates/infrastructure/github/workflows/dotnet-build.yml.hbs +39 -39
- package/framework/templates/meta-prompts/fusion/fusion-agent.md +76 -76
- package/framework/templates/meta-prompts/fusion/fusion-aggregator.md +100 -100
- package/framework/templates/meta-prompts/validators/pre-commit-validator.md +95 -95
- package/framework/templates/state.template.json +17 -17
- package/framework/templates/ui/design-system.css +226 -226
- package/package.json +2 -2
- package/src/commands/e2e/e2e.js +1 -1
- package/src/commands/project/heavy.js +1 -1
- package/src/commands/project/status.js +3 -3
- package/src/commands/state/approve.js +7 -49
- package/src/commands/state/gate-check.js +16 -106
- package/src/commands/state/gate-decision.js +1 -1
- package/src/commands/state/report-check.js +42 -17
- package/src/commands/validation/mutate.js +1 -1
- package/src/commands/validation/scout-check.js +28 -0
- package/src/commands/validation/validate-feature.js +5 -32
- package/src/commands/validation/verify.js +3 -4
- package/src/core/paths/output-schema.js +0 -2
- package/src/core/state/state-manager.js +1 -2
- package/src/core/templates/template-renderer.js +477 -477
- package/src/dashboard/app/lib/format.js +5 -0
- package/src/dashboard/app/main.jsx +13 -13
- package/src/dashboard/app/pages/FeatureDetail.jsx +16 -22
- package/src/dashboard/app/pages/Features.jsx +7 -7
- package/src/dashboard/app/pages/PhasePipeline.jsx +1 -1
- package/src/dashboard/app/pages/Rubrics.jsx +7 -11
- package/src/dashboard/scanner/docs-scanner.js +1 -2
- package/src/dashboard/scanner/features-scanner.js +3 -4
- package/src/dashboard/scanner/rubrics-scanner.js +12 -12
- package/src/dashboard/vite.config.js +24 -24
- package/src/lib/agents/output-collector.js +0 -1
- package/src/lib/detectors/design-system-detector.js +188 -188
- package/src/lib/evaluator-report.js +52 -334
- package/src/lib/generators/design-system-generator.js +508 -508
- package/src/lib/generators/handoff-generator.js +4 -5
- package/src/lib/installers/memory-installer.js +2 -2
- package/src/lib/mutation/manifest.js +8 -2
- package/src/lib/mutation/report.js +5 -3
- package/src/lib/mutation/runner.js +9 -7
- package/src/lib/risk-detector.js +60 -122
- package/src/lib/scout/scout-check.js +293 -0
- package/src/lib/tasks/task-classifier.js +30 -30
- package/src/lib/tasks/task-parser.js +209 -209
- package/src/lib/tasks/tasks-json-parser.js +7 -5
- package/src/lib/tasks/test-nodes.js +1 -1
- package/src/lib/tasks/test-runner.js +1 -1
- package/src/lib/validators/css/css-validator.js +340 -340
- package/src/lib/validators/reuse/reuse-validator.js +6 -8
- package/src/lib/validators/verify-runner.js +1 -1
- package/src/scripts/setup-infra.js +1 -1
- package/src/utils/agent-id-mapper.js +11 -11
- package/src/utils/agents-installer.js +5 -9
- package/src/utils/claude-settings-manager.js +300 -300
- package/src/utils/hooks-installer.js +3 -10
- package/src/utils/skills-installer.js +1 -1
- package/framework/evals/proof-rubrics/README.md +0 -76
- package/framework/evals/proof-rubrics/eval-de-modelo.md +0 -80
- package/framework/evals/proof-rubrics/fiacao.md +0 -54
- package/framework/evals/proof-rubrics/guard-cego.md +0 -52
- package/framework/evals/proof-rubrics/media-claims.md +0 -109
- package/framework/evals/proof-rubrics/mutation-proof.md +0 -107
- package/framework/evals/proof-rubrics/observabilidade-genai.md +0 -119
- package/framework/evals/proof-rubrics/verde-nao-e-coberto.md +0 -48
- package/framework/evals/rubrics/README.md +0 -45
- package/framework/evals/rubrics/architecture.md +0 -103
- package/framework/evals/rubrics/code-quality.md +0 -98
- package/framework/evals/rubrics/condensed.md +0 -57
- package/framework/evals/rubrics/contracts.md +0 -67
- package/framework/evals/rubrics/test-coverage.md +0 -99
- package/framework/evals/scenarios/dotnet-crud.yaml +0 -42
- package/framework/evals/scenarios/nextjs-auth.yaml +0 -38
- package/framework/evals/suites/standard.yaml +0 -5
- package/framework/hooks/claude-code/core/post-edit-typecheck.js +0 -127
- package/framework/skills/core/morph-eval/SKILL.md +0 -64
- package/framework/templates/.idea/morph-templates.xml +0 -92
- package/framework/templates/.vscode/morph-templates.code-snippets +0 -186
- package/framework/templates/docs/clarifications.md +0 -253
- package/framework/templates/docs/onboarding.md +0 -122
- package/framework/templates/docs/schema-analysis.md +0 -119
- package/framework/templates/docs/user-stories.md +0 -34
- package/src/commands/state/score.js +0 -147
|
@@ -1,253 +0,0 @@
|
|
|
1
|
-
# Clarifications - {{FEATURE_NAME_TITLE}}
|
|
2
|
-
|
|
3
|
-
**Feature**: {{FEATURE_NAME}}
|
|
4
|
-
**Date**: {{DATE}}
|
|
5
|
-
**Phase**: CLARIFY (Phase 3)
|
|
6
|
-
**Status**: {{#if status}}{{status}}{{else}}In Progress{{/if}}
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
## Purpose
|
|
11
|
-
|
|
12
|
-
This document addresses ambiguities, edge cases, and questions identified during the design review. All clarifications should be incorporated back into `spec.md` after approval.
|
|
13
|
-
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
## Questions & Answers
|
|
17
|
-
|
|
18
|
-
{{#each questions}}
|
|
19
|
-
### Q{{this.id}}: {{this.category}} - {{this.title}}
|
|
20
|
-
|
|
21
|
-
**Question:**
|
|
22
|
-
{{this.question}}
|
|
23
|
-
|
|
24
|
-
**Context:**
|
|
25
|
-
{{this.context}}
|
|
26
|
-
|
|
27
|
-
**Answer:**
|
|
28
|
-
{{this.answer}}
|
|
29
|
-
|
|
30
|
-
**Impact:**
|
|
31
|
-
{{this.impact}}
|
|
32
|
-
|
|
33
|
-
**Spec Updates Required:**
|
|
34
|
-
{{#each this.specUpdates}}
|
|
35
|
-
- {{this}}
|
|
36
|
-
{{/each}}
|
|
37
|
-
|
|
38
|
-
**Priority:** {{this.priority}}
|
|
39
|
-
**Resolved:** {{#if this.resolved}}✅ Yes{{else}}❌ No{{/if}}
|
|
40
|
-
**Resolved By:** {{#if this.resolvedBy}}{{this.resolvedBy}}{{else}}_Pending_{{/if}}
|
|
41
|
-
|
|
42
|
-
---
|
|
43
|
-
{{/each}}
|
|
44
|
-
|
|
45
|
-
## Edge Cases Identified
|
|
46
|
-
|
|
47
|
-
{{#each edgeCases}}
|
|
48
|
-
### EC{{@index}}: {{this.title}}
|
|
49
|
-
|
|
50
|
-
**Scenario:**
|
|
51
|
-
{{this.scenario}}
|
|
52
|
-
|
|
53
|
-
**Current Behavior:**
|
|
54
|
-
{{this.currentBehavior}}
|
|
55
|
-
|
|
56
|
-
**Expected Behavior:**
|
|
57
|
-
{{this.expectedBehavior}}
|
|
58
|
-
|
|
59
|
-
**Proposed Solution:**
|
|
60
|
-
{{this.proposedSolution}}
|
|
61
|
-
|
|
62
|
-
**Acceptance Criteria:**
|
|
63
|
-
{{#each this.acceptanceCriteria}}
|
|
64
|
-
- [ ] {{this}}
|
|
65
|
-
{{/each}}
|
|
66
|
-
|
|
67
|
-
**Affected Components:**
|
|
68
|
-
{{#each this.affectedComponents}}
|
|
69
|
-
- {{this}}
|
|
70
|
-
{{/each}}
|
|
71
|
-
|
|
72
|
-
---
|
|
73
|
-
{{/each}}
|
|
74
|
-
|
|
75
|
-
## Assumptions Validated
|
|
76
|
-
|
|
77
|
-
{{#each assumptions}}
|
|
78
|
-
### A{{@index}}: {{this.title}}
|
|
79
|
-
|
|
80
|
-
**Assumption:**
|
|
81
|
-
{{this.description}}
|
|
82
|
-
|
|
83
|
-
**Validation:**
|
|
84
|
-
{{#if this.validated}}✅ Confirmed{{else}}❌ Invalid{{/if}}
|
|
85
|
-
|
|
86
|
-
**Notes:**
|
|
87
|
-
{{this.notes}}
|
|
88
|
-
|
|
89
|
-
**Action Required:**
|
|
90
|
-
{{#if this.action}}{{this.action}}{{else}}_None_{{/if}}
|
|
91
|
-
|
|
92
|
-
---
|
|
93
|
-
{{/each}}
|
|
94
|
-
|
|
95
|
-
## Business Rules Clarified
|
|
96
|
-
|
|
97
|
-
{{#each businessRules}}
|
|
98
|
-
### BR{{@index}}: {{this.title}}
|
|
99
|
-
|
|
100
|
-
**Rule:**
|
|
101
|
-
{{this.rule}}
|
|
102
|
-
|
|
103
|
-
**Rationale:**
|
|
104
|
-
{{this.rationale}}
|
|
105
|
-
|
|
106
|
-
**Examples:**
|
|
107
|
-
{{#each this.examples}}
|
|
108
|
-
- {{this}}
|
|
109
|
-
{{/each}}
|
|
110
|
-
|
|
111
|
-
**Exceptions:**
|
|
112
|
-
{{#if this.exceptions}}
|
|
113
|
-
{{#each this.exceptions}}
|
|
114
|
-
- {{this}}
|
|
115
|
-
{{/each}}
|
|
116
|
-
{{else}}
|
|
117
|
-
_None_
|
|
118
|
-
{{/if}}
|
|
119
|
-
|
|
120
|
-
---
|
|
121
|
-
{{/each}}
|
|
122
|
-
|
|
123
|
-
## Data Validation Rules
|
|
124
|
-
|
|
125
|
-
{{#each dataValidations}}
|
|
126
|
-
### DV{{@index}}: {{this.field}} Validation
|
|
127
|
-
|
|
128
|
-
**Field:** {{this.field}}
|
|
129
|
-
**Entity:** {{this.entity}}
|
|
130
|
-
|
|
131
|
-
**Validation Rules:**
|
|
132
|
-
{{#each this.rules}}
|
|
133
|
-
- {{this}}
|
|
134
|
-
{{/each}}
|
|
135
|
-
|
|
136
|
-
**Error Messages:**
|
|
137
|
-
{{#each this.errorMessages}}
|
|
138
|
-
- {{this.condition}}: "{{this.message}}"
|
|
139
|
-
{{/each}}
|
|
140
|
-
|
|
141
|
-
**Impact on UX:**
|
|
142
|
-
{{this.uxImpact}}
|
|
143
|
-
|
|
144
|
-
---
|
|
145
|
-
{{/each}}
|
|
146
|
-
|
|
147
|
-
## Performance & Scalability Clarifications
|
|
148
|
-
|
|
149
|
-
{{#each performanceClarifications}}
|
|
150
|
-
### PC{{@index}}: {{this.title}}
|
|
151
|
-
|
|
152
|
-
**Concern:**
|
|
153
|
-
{{this.concern}}
|
|
154
|
-
|
|
155
|
-
**Clarification:**
|
|
156
|
-
{{this.clarification}}
|
|
157
|
-
|
|
158
|
-
**Solution:**
|
|
159
|
-
{{this.solution}}
|
|
160
|
-
|
|
161
|
-
**Performance Target:**
|
|
162
|
-
{{this.target}}
|
|
163
|
-
|
|
164
|
-
---
|
|
165
|
-
{{/each}}
|
|
166
|
-
|
|
167
|
-
## Security & Authorization Clarifications
|
|
168
|
-
|
|
169
|
-
{{#each securityClarifications}}
|
|
170
|
-
### SC{{@index}}: {{this.title}}
|
|
171
|
-
|
|
172
|
-
**Security Concern:**
|
|
173
|
-
{{this.concern}}
|
|
174
|
-
|
|
175
|
-
**Clarification:**
|
|
176
|
-
{{this.clarification}}
|
|
177
|
-
|
|
178
|
-
**Implementation:**
|
|
179
|
-
{{this.implementation}}
|
|
180
|
-
|
|
181
|
-
**Affected Roles:**
|
|
182
|
-
{{#each this.affectedRoles}}
|
|
183
|
-
- {{this}}
|
|
184
|
-
{{/each}}
|
|
185
|
-
|
|
186
|
-
---
|
|
187
|
-
{{/each}}
|
|
188
|
-
|
|
189
|
-
## Integration & External Dependencies
|
|
190
|
-
|
|
191
|
-
{{#each integrationClarifications}}
|
|
192
|
-
### IC{{@index}}: {{this.title}}
|
|
193
|
-
|
|
194
|
-
**External System:**
|
|
195
|
-
{{this.externalSystem}}
|
|
196
|
-
|
|
197
|
-
**Question:**
|
|
198
|
-
{{this.question}}
|
|
199
|
-
|
|
200
|
-
**Clarification:**
|
|
201
|
-
{{this.clarification}}
|
|
202
|
-
|
|
203
|
-
**API Endpoint/Method:**
|
|
204
|
-
{{this.apiDetails}}
|
|
205
|
-
|
|
206
|
-
**Error Handling:**
|
|
207
|
-
{{this.errorHandling}}
|
|
208
|
-
|
|
209
|
-
---
|
|
210
|
-
{{/each}}
|
|
211
|
-
|
|
212
|
-
## Summary
|
|
213
|
-
|
|
214
|
-
**Total Questions:** {{#if totalQuestions}}{{totalQuestions}}{{else}}0{{/if}}
|
|
215
|
-
**Resolved:** {{#if resolvedCount}}{{resolvedCount}}{{else}}0{{/if}}
|
|
216
|
-
**Pending:** {{#if pendingCount}}{{pendingCount}}{{else}}0{{/if}}
|
|
217
|
-
|
|
218
|
-
**Edge Cases Identified:** {{#if edgeCaseCount}}{{edgeCaseCount}}{{else}}0{{/if}}
|
|
219
|
-
**Business Rules Documented:** {{#if businessRuleCount}}{{businessRuleCount}}{{else}}0{{/if}}
|
|
220
|
-
**Assumptions Validated:** {{#if assumptionCount}}{{assumptionCount}}{{else}}0{{/if}}
|
|
221
|
-
|
|
222
|
-
---
|
|
223
|
-
|
|
224
|
-
## Next Steps
|
|
225
|
-
|
|
226
|
-
1. [ ] Resolve all pending questions
|
|
227
|
-
2. [ ] Update `spec.md` with all clarifications
|
|
228
|
-
3. [ ] Update `contracts.cs` if data model changes are needed
|
|
229
|
-
4. [ ] Document breaking changes in `decisions.md`
|
|
230
|
-
5. [ ] Get stakeholder approval on all clarifications
|
|
231
|
-
6. [ ] Advance to Phase 4 (Tasks)
|
|
232
|
-
|
|
233
|
-
---
|
|
234
|
-
|
|
235
|
-
## Spec Updates Log
|
|
236
|
-
|
|
237
|
-
**Changes to be made to `spec.md`:**
|
|
238
|
-
|
|
239
|
-
{{#each specUpdates}}
|
|
240
|
-
### Update {{@index}}
|
|
241
|
-
|
|
242
|
-
**Section:** {{this.section}}
|
|
243
|
-
**Type:** {{this.type}}
|
|
244
|
-
**Description:** {{this.description}}
|
|
245
|
-
**From Clarification:** {{this.clarificationId}}
|
|
246
|
-
|
|
247
|
-
---
|
|
248
|
-
{{/each}}
|
|
249
|
-
|
|
250
|
-
---
|
|
251
|
-
|
|
252
|
-
*Generated by MORPH-SPEC v{{FRAMEWORK_VERSION}}*
|
|
253
|
-
*All clarifications must be incorporated into spec.md before advancing to Phase 4*
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
# Onboarding Guide — {{PROJECT_NAME}}
|
|
2
|
-
|
|
3
|
-
> Generated by MORPH-SPEC on {{DATE}}
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Project Overview
|
|
8
|
-
|
|
9
|
-
- **Project:** {{PROJECT_NAME}}
|
|
10
|
-
- **Stack:** {{STACK}}
|
|
11
|
-
- **Architecture:** {{ARCHITECTURE}}
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## Active Agents
|
|
16
|
-
|
|
17
|
-
The following agents are configured for this project:
|
|
18
|
-
|
|
19
|
-
{{AGENTS_LIST}}
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
## Available MCPs & Plugins
|
|
24
|
-
|
|
25
|
-
{{AVAILABLE_MCPS}}
|
|
26
|
-
|
|
27
|
-
---
|
|
28
|
-
|
|
29
|
-
## Standards
|
|
30
|
-
|
|
31
|
-
The following standards are enforced in this project:
|
|
32
|
-
|
|
33
|
-
{{STANDARDS_SUMMARY}}
|
|
34
|
-
|
|
35
|
-
Standards are located in:
|
|
36
|
-
- `.morph/framework/standards/` — Framework standards (universal)
|
|
37
|
-
- `.morph/context/` — Project-specific overrides
|
|
38
|
-
|
|
39
|
-
---
|
|
40
|
-
|
|
41
|
-
## Configured Workflow
|
|
42
|
-
|
|
43
|
-
{{WORKFLOW_SUMMARY}}
|
|
44
|
-
|
|
45
|
-
### Available Workflows
|
|
46
|
-
|
|
47
|
-
| Workflow | Description | Phases |
|
|
48
|
-
|----------|-------------|--------|
|
|
49
|
-
| fast-track | Simple, well-defined features | 0→1→2→4→5 |
|
|
50
|
-
| standard | Most features | 0→1→(1.5)→2→3→4→5 |
|
|
51
|
-
| full-morph | Complex features with sync | 0→1→1.5→2→3→4→5→6 |
|
|
52
|
-
| design-impl | Pre-planned work | 2→4→5 |
|
|
53
|
-
| ui-refresh | Visual redesigns | 1.5→2→5 |
|
|
54
|
-
|
|
55
|
-
---
|
|
56
|
-
|
|
57
|
-
## Key Commands
|
|
58
|
-
|
|
59
|
-
```bash
|
|
60
|
-
# Start a feature
|
|
61
|
-
# Just ask Claude Code to implement something
|
|
62
|
-
|
|
63
|
-
# Check feature progress
|
|
64
|
-
morph-spec status <feature>
|
|
65
|
-
|
|
66
|
-
# Validate feature outputs
|
|
67
|
-
morph-spec validate-feature <feature>
|
|
68
|
-
|
|
69
|
-
# Approve the current gate and scaffold the next phase folder
|
|
70
|
-
morph-spec advance <feature>
|
|
71
|
-
|
|
72
|
-
# Archive a finished feature (after Gate 3)
|
|
73
|
-
morph-spec archive <feature>
|
|
74
|
-
|
|
75
|
-
# Health check
|
|
76
|
-
morph-spec doctor
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
> **Task tracking lives in `tasks.json`.** During the implement phase Claude records
|
|
80
|
-
> progress by writing `tasks.json` directly (only the `status`, `outputs`, and `notes`
|
|
81
|
-
> fields). State is synced automatically by the `state-sync` hook — there is no CLI
|
|
82
|
-
> command to mark a task done.
|
|
83
|
-
|
|
84
|
-
---
|
|
85
|
-
|
|
86
|
-
## Project Structure
|
|
87
|
-
|
|
88
|
-
```
|
|
89
|
-
{{PROJECT_NAME}}/
|
|
90
|
-
├── CLAUDE.md # Claude Code instructions
|
|
91
|
-
├── .morph/
|
|
92
|
-
│ ├── config/
|
|
93
|
-
│ │ └── config.json # Project configuration
|
|
94
|
-
│ ├── framework/
|
|
95
|
-
│ │ ├── agents.json # Agent definitions
|
|
96
|
-
│ │ ├── standards/ # Framework standards
|
|
97
|
-
│ │ └── templates/ # Output templates
|
|
98
|
-
│ ├── context/ # Project context & overrides
|
|
99
|
-
│ └── features/{feature}/ # Feature outputs
|
|
100
|
-
│ ├── 0-proposal/
|
|
101
|
-
│ ├── 1-design/ # optional (UI-heavy features)
|
|
102
|
-
│ ├── 2-plan/
|
|
103
|
-
│ ├── 3-implement/
|
|
104
|
-
│ └── 4-review/
|
|
105
|
-
└── .claude/
|
|
106
|
-
├── commands/ # Slash commands
|
|
107
|
-
├── skills/ # Workflow skills
|
|
108
|
-
└── settings.local.json # Hooks & permissions
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
---
|
|
112
|
-
|
|
113
|
-
## Getting Started
|
|
114
|
-
|
|
115
|
-
1. **Ask Claude Code** to implement a feature
|
|
116
|
-
2. **Follow the phases** — the framework guides you automatically
|
|
117
|
-
3. **Approve at pauses** — design and task breakdowns need your approval
|
|
118
|
-
4. **Check progress** with `morph-spec status <feature>`
|
|
119
|
-
|
|
120
|
-
---
|
|
121
|
-
|
|
122
|
-
*Generated by MORPH-SPEC v{{VERSION}} — Polymorphism Tech*
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
# Schema Analysis - {{FEATURE_NAME_TITLE}}
|
|
2
|
-
|
|
3
|
-
**Feature**: {{FEATURE_NAME}}
|
|
4
|
-
**Date**: {{DATE}}
|
|
5
|
-
**Method**: {{#if method}}{{method}}{{else}}Manual Code Analysis{{/if}}
|
|
6
|
-
**Analyzed By**: {{AUTHOR}}
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
## Summary
|
|
11
|
-
|
|
12
|
-
**Tables Analyzed**: {{#if tableCount}}{{tableCount}}{{else}}0{{/if}}
|
|
13
|
-
**Code Files Scanned**: {{#if fileCount}}{{fileCount}}{{else}}0{{/if}}
|
|
14
|
-
**MCP Tools Used**: {{#if mcpUsed}}{{mcpUsed}}{{else}}No (manual analysis){{/if}}
|
|
15
|
-
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
## Tables Analyzed
|
|
19
|
-
|
|
20
|
-
{{#each tables}}
|
|
21
|
-
### Table: {{this.name}}
|
|
22
|
-
|
|
23
|
-
**Source:**
|
|
24
|
-
{{#if this.mcpSource}}- MCP: {{this.mcpSource}}{{/if}}
|
|
25
|
-
{{#if this.codeSource}}- Code: {{this.codeSource}}{{/if}}
|
|
26
|
-
|
|
27
|
-
**Columns:**
|
|
28
|
-
| Column Name | Type | Nullable | Default | Notes |
|
|
29
|
-
|------------|------|----------|---------|-------|
|
|
30
|
-
{{#each this.columns}}
|
|
31
|
-
| {{this.name}} | {{this.type}} | {{#if this.nullable}}YES{{else}}NO{{/if}} | {{#if this.default}}{{this.default}}{{else}}-{{/if}} | {{#if this.notes}}{{this.notes}}{{else}}-{{/if}} |
|
|
32
|
-
{{/each}}
|
|
33
|
-
|
|
34
|
-
**Relationships:**
|
|
35
|
-
{{#each this.relationships}}
|
|
36
|
-
- {{this.description}}
|
|
37
|
-
{{/each}}
|
|
38
|
-
|
|
39
|
-
**Indexes:**
|
|
40
|
-
{{#each this.indexes}}
|
|
41
|
-
- {{this.description}}
|
|
42
|
-
{{/each}}
|
|
43
|
-
|
|
44
|
-
---
|
|
45
|
-
{{/each}}
|
|
46
|
-
|
|
47
|
-
## ⚠️ CRITICAL FINDINGS
|
|
48
|
-
|
|
49
|
-
### Field Name Mismatches (MUST FIX)
|
|
50
|
-
|
|
51
|
-
{{#if fieldMismatches}}
|
|
52
|
-
{{#each fieldMismatches}}
|
|
53
|
-
- ❌ {{this.description}}
|
|
54
|
-
{{/each}}
|
|
55
|
-
{{else}}
|
|
56
|
-
✅ No field name mismatches found
|
|
57
|
-
{{/if}}
|
|
58
|
-
|
|
59
|
-
### Type Mismatches
|
|
60
|
-
|
|
61
|
-
{{#if typeMismatches}}
|
|
62
|
-
{{#each typeMismatches}}
|
|
63
|
-
- ⚠️ {{this.description}}
|
|
64
|
-
{{/each}}
|
|
65
|
-
{{else}}
|
|
66
|
-
✅ No type mismatches found
|
|
67
|
-
{{/if}}
|
|
68
|
-
|
|
69
|
-
### Relationship Corrections
|
|
70
|
-
|
|
71
|
-
{{#if relationshipIssues}}
|
|
72
|
-
{{#each relationshipIssues}}
|
|
73
|
-
- ⚠️ {{this.description}}
|
|
74
|
-
{{/each}}
|
|
75
|
-
{{else}}
|
|
76
|
-
✅ All relationships correctly identified
|
|
77
|
-
{{/if}}
|
|
78
|
-
|
|
79
|
-
---
|
|
80
|
-
|
|
81
|
-
## Recommendations for contracts.cs
|
|
82
|
-
|
|
83
|
-
Based on real schema analysis:
|
|
84
|
-
|
|
85
|
-
\`\`\`csharp
|
|
86
|
-
{{#each dtoRecommendations}}
|
|
87
|
-
// {{this.tableName}} → {{this.dtoName}}
|
|
88
|
-
public record {{this.dtoName}}(
|
|
89
|
-
{{#each this.fields}}
|
|
90
|
-
{{this.type}} {{this.name}}{{#if this.nullable}}?{{/if}}{{#unless @last}},{{/unless}} // {{#if this.comment}}{{this.comment}}{{/if}}
|
|
91
|
-
{{/each}}
|
|
92
|
-
);
|
|
93
|
-
|
|
94
|
-
{{/each}}
|
|
95
|
-
\`\`\`
|
|
96
|
-
|
|
97
|
-
---
|
|
98
|
-
|
|
99
|
-
## Analysis Notes
|
|
100
|
-
|
|
101
|
-
{{#if notes}}
|
|
102
|
-
{{notes}}
|
|
103
|
-
{{else}}
|
|
104
|
-
_No additional notes._
|
|
105
|
-
{{/if}}
|
|
106
|
-
|
|
107
|
-
---
|
|
108
|
-
|
|
109
|
-
## Next Steps
|
|
110
|
-
|
|
111
|
-
- [ ] Verify schema analysis with stakeholders
|
|
112
|
-
- [ ] Generate `contracts.cs` using real field names
|
|
113
|
-
- [ ] Update `spec.md` data model section with findings
|
|
114
|
-
- [ ] Document any schema migrations needed in `decisions.md`
|
|
115
|
-
|
|
116
|
-
---
|
|
117
|
-
|
|
118
|
-
*Generated by MORPH-SPEC v{{FRAMEWORK_VERSION}}*
|
|
119
|
-
*Schema analysis helps prevent DTO field name mismatches and ensures contracts match real database schema*
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# User Stories: {{featureName}}
|
|
2
|
-
|
|
3
|
-
> Generated: {{date}} | Feature: {{featureName}} | Status: Draft
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Story 1: [Actor] [Action]
|
|
8
|
-
|
|
9
|
-
**Feature:** {{featureName}}
|
|
10
|
-
**Priority:** High / Medium / Low
|
|
11
|
-
|
|
12
|
-
### Optimal Path
|
|
13
|
-
1. [Step 1]
|
|
14
|
-
2. [Step 2]
|
|
15
|
-
3. [Step 3 — success state]
|
|
16
|
-
|
|
17
|
-
### Edge Cases
|
|
18
|
-
- [Edge case] → [Expected behavior]
|
|
19
|
-
- [Error condition] → [Expected error handling]
|
|
20
|
-
|
|
21
|
-
### Acceptance Criteria
|
|
22
|
-
- [ ] [Measurable criterion 1]
|
|
23
|
-
- [ ] [Measurable criterion 2]
|
|
24
|
-
- [ ] Edge: [edge case criterion]
|
|
25
|
-
|
|
26
|
-
---
|
|
27
|
-
|
|
28
|
-
## Story 2: [Actor] [Action]
|
|
29
|
-
|
|
30
|
-
[Repeat structure above]
|
|
31
|
-
|
|
32
|
-
---
|
|
33
|
-
|
|
34
|
-
*Generated by MORPH-SPEC — complete before implementation begins*
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
import { existsSync, readFileSync } from 'fs';
|
|
3
|
-
import { join } from 'path';
|
|
4
|
-
import { getFeature, updateFeature } from '../../core/state/state-manager.js';
|
|
5
|
-
import { assertOwnerTree, ownerTreeRefusalLines } from '../../lib/worktree/feature-truth.js';
|
|
6
|
-
|
|
7
|
-
/** Fixed --dims order: a,c,q,t (mirrors the morph-eval dimension weights). */
|
|
8
|
-
const DIM_KEYS = ['architecture', 'contracts', 'codeQuality', 'testCoverage'];
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* taskScores keys are pinned to `^T\d+$` by feature.schema.json, and tasks.schema.json
|
|
12
|
-
* pins the same shape for the task ids themselves. Anything else — a dotted `T3.2`
|
|
13
|
-
* above all — is split on the dot by `updateFeature` and lands as a NESTED key that
|
|
14
|
-
* neither the schema nor the gate-check proxy can see.
|
|
15
|
-
*/
|
|
16
|
-
const TASK_ID_PATTERN = /^T\d+$/;
|
|
17
|
-
|
|
18
|
-
const USAGE_LINE = 'Usage: morph-spec score <feature> <task> <score> [--dims a,c,q,t] e.g. morph-spec score my-feature T1 9.2 --dims "9,10,9,9"';
|
|
19
|
-
|
|
20
|
-
function parseScoreValue(raw, label) {
|
|
21
|
-
// `Number('')` and `Number(' ')` are 0 — finite and inside 0-10, so the range check
|
|
22
|
-
// below waves them through and a blank value gets recorded as a real zero. Refuse the
|
|
23
|
-
// empty shape BEFORE Number() so no score can ever be fabricated.
|
|
24
|
-
const text = raw === undefined || raw === null ? '' : String(raw).trim();
|
|
25
|
-
if (text === '') {
|
|
26
|
-
const got = raw === undefined ? 'no value was passed' : `got "${raw}"`;
|
|
27
|
-
console.error(chalk.red(`\n❌ Missing ${label}: ${got} — a blank value is refused, never recorded as 0`));
|
|
28
|
-
console.error(chalk.gray(` ${USAGE_LINE}\n`));
|
|
29
|
-
process.exit(1);
|
|
30
|
-
}
|
|
31
|
-
const value = Number(text);
|
|
32
|
-
if (!Number.isFinite(value) || value < 0 || value > 10) {
|
|
33
|
-
console.error(chalk.red(`\n❌ Invalid ${label}: "${raw}" — expected a number between 0 and 10\n`));
|
|
34
|
-
process.exit(1);
|
|
35
|
-
}
|
|
36
|
-
return value;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function assertTaskIdShape(taskId) {
|
|
40
|
-
const id = taskId === undefined || taskId === null ? '' : String(taskId);
|
|
41
|
-
if (TASK_ID_PATTERN.test(id)) return;
|
|
42
|
-
console.error(chalk.red(`\n❌ Invalid task id: "${id}" — expected the pattern T<n> (T1, T7, T12)`));
|
|
43
|
-
console.error(chalk.gray(
|
|
44
|
-
` taskScores keys are pinned by feature.schema.json (propertyNames.pattern "^T\\d+$").\n` +
|
|
45
|
-
` A dotted id is split on the "." and written as a nested key, invisible to the gate-check proxy.\n` +
|
|
46
|
-
` ${USAGE_LINE}\n`
|
|
47
|
-
));
|
|
48
|
-
process.exit(1);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* `morph-spec score <feature> <task> <score> [--dims a,c,q,t]` — record a
|
|
53
|
-
* task eval score under `taskScores` in the authoritative feature.json.
|
|
54
|
-
*
|
|
55
|
-
* The timestamp is stamped server-side (`updatedAt`), the write is atomic
|
|
56
|
-
* (state-manager), attempts auto-increment and bestScore is kept — this
|
|
57
|
-
* replaces the fragile manual Edit of feature.json from the skills.
|
|
58
|
-
*/
|
|
59
|
-
export async function scoreCommand(featureName, taskId, scoreArg, options = {}) {
|
|
60
|
-
try {
|
|
61
|
-
// Argument validation runs before any state read or write: a refusal must never
|
|
62
|
-
// leave a fabricated or nested taskScores entry behind.
|
|
63
|
-
assertTaskIdShape(taskId);
|
|
64
|
-
const score = parseScoreValue(scoreArg, 'score');
|
|
65
|
-
|
|
66
|
-
const feature = getFeature(featureName);
|
|
67
|
-
if (!feature) {
|
|
68
|
-
console.error(chalk.red(`\n❌ Feature not found: ${featureName}\n`));
|
|
69
|
-
process.exit(1);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
const owner = assertOwnerTree(featureName, process.cwd());
|
|
73
|
-
if (owner.blocked) {
|
|
74
|
-
for (const { tone, text } of ownerTreeRefusalLines(featureName, owner.tree, owner.branch, `morph-spec score ${featureName} ${taskId} ${scoreArg}`)) {
|
|
75
|
-
console.error(chalk[tone](text));
|
|
76
|
-
}
|
|
77
|
-
process.exit(1);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
if (feature.taskVerifications?.[taskId]?.status === 'fail') {
|
|
81
|
-
console.error(chalk.yellow(`⚠️ Último verify de ${taskId} está VERMELHO — score sendo gravado sobre código que não passou no verify determinístico`));
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
let dimensions;
|
|
85
|
-
if (options.dims) {
|
|
86
|
-
// Commander captures --dims as variadic (`<dims...>`), so an UNQUOTED
|
|
87
|
-
// comma list typed in PowerShell — `--dims 9.5,9,9,9` — that arrives as
|
|
88
|
-
// 4 separate argv tokens (confirmed: Commander binds only the first
|
|
89
|
-
// token to a non-variadic option and silently drops the rest) is not
|
|
90
|
-
// lost. Accept either shape: one comma-joined string (the documented,
|
|
91
|
-
// quoted form) or N separate tokens — split on both separators so a
|
|
92
|
-
// mix of the two never matters either.
|
|
93
|
-
const raw = Array.isArray(options.dims) ? options.dims.join(' ') : String(options.dims);
|
|
94
|
-
const parts = raw.split(/[,\s]+/).filter(Boolean);
|
|
95
|
-
if (parts.length !== DIM_KEYS.length) {
|
|
96
|
-
console.error(chalk.red(
|
|
97
|
-
`\n❌ --dims expects ${DIM_KEYS.length} values in order a,c,q,t (architecture,contracts,code-quality,test-coverage) — got ${parts.length} (${JSON.stringify(parts)}).\n` +
|
|
98
|
-
` Quote the value under PowerShell to keep it as one argument: --dims "9.5,9,9,9"\n`
|
|
99
|
-
));
|
|
100
|
-
process.exit(1);
|
|
101
|
-
}
|
|
102
|
-
dimensions = {};
|
|
103
|
-
DIM_KEYS.forEach((key, i) => {
|
|
104
|
-
dimensions[key] = parseScoreValue(parts[i], `--dims ${key}`);
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
// Non-fatal sanity check: warn when the task id is unknown to tasks.json.
|
|
109
|
-
const tasksPath = join(process.cwd(), '.morph', 'features', featureName, '2-plan', 'tasks.json');
|
|
110
|
-
if (existsSync(tasksPath)) {
|
|
111
|
-
try {
|
|
112
|
-
const tasks = JSON.parse(readFileSync(tasksPath, 'utf8')).tasks || [];
|
|
113
|
-
if (!tasks.some(t => t.id === taskId)) {
|
|
114
|
-
console.error(chalk.yellow(`⚠️ Task "${taskId}" not found in tasks.json — recording anyway`));
|
|
115
|
-
}
|
|
116
|
-
} catch {
|
|
117
|
-
// unreadable tasks.json — the score is still worth recording
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
const prev = feature.taskScores?.[taskId];
|
|
122
|
-
const entry = {
|
|
123
|
-
lastScore: score,
|
|
124
|
-
bestScore: prev?.bestScore != null ? Math.max(prev.bestScore, score) : score,
|
|
125
|
-
attempts: (prev?.attempts ?? 0) + 1,
|
|
126
|
-
...(dimensions ? { dimensions } : {}),
|
|
127
|
-
updatedAt: new Date().toISOString(),
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
await updateFeature(featureName, `taskScores.${taskId}`, entry);
|
|
131
|
-
|
|
132
|
-
if (options.json) {
|
|
133
|
-
console.log(JSON.stringify({ feature: featureName, task: taskId, ...entry }, null, 2));
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
console.log(chalk.green(`\n✅ Score recorded: ${featureName}/${taskId} → ${entry.lastScore}`));
|
|
138
|
-
console.log(chalk.gray(` best: ${entry.bestScore} | attempts: ${entry.attempts} | updatedAt: ${entry.updatedAt}`));
|
|
139
|
-
if (dimensions) {
|
|
140
|
-
console.log(chalk.gray(` dims: arch=${dimensions.architecture} contracts=${dimensions.contracts} quality=${dimensions.codeQuality} tests=${dimensions.testCoverage}`));
|
|
141
|
-
}
|
|
142
|
-
console.log('');
|
|
143
|
-
} catch (error) {
|
|
144
|
-
console.error(chalk.red(`\n❌ Error recording score: ${error.message}\n`));
|
|
145
|
-
process.exit(1);
|
|
146
|
-
}
|
|
147
|
-
}
|