@polymorphism-tech/morph-spec 4.8.19 → 4.9.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 +21 -0
- package/README.md +2 -2
- package/bin/morph-spec.js +15 -56
- package/bin/task-manager.js +115 -14
- package/bin/validate.js +67 -33
- package/claude-plugin.json +1 -1
- package/docs/CHEATSHEET.md +201 -203
- package/docs/QUICKSTART.md +2 -2
- package/framework/CLAUDE.md +21 -0
- package/framework/agents.json +698 -176
- package/framework/hooks/claude-code/post-tool-use/context-refresh.js +1 -1
- package/framework/hooks/claude-code/post-tool-use/dispatch.js +2 -2
- package/framework/hooks/claude-code/post-tool-use/skill-reminder.js +155 -0
- package/framework/hooks/claude-code/pre-tool-use/protect-spec-files.js +1 -1
- package/framework/hooks/claude-code/session-start/inject-morph-context.js +71 -2
- package/framework/hooks/claude-code/statusline.py +76 -30
- package/framework/hooks/claude-code/user-prompt/set-terminal-title.js +14 -6
- package/framework/hooks/shared/activity-logger.js +0 -24
- package/framework/hooks/shared/phase-utils.js +3 -0
- package/framework/hooks/shared/skill-reminder-helpers.js +79 -0
- package/framework/hooks/shared/stale-task-reset.js +57 -0
- package/framework/hooks/shared/state-reader.js +2 -2
- package/framework/hooks/shared/worktree-helpers.js +53 -0
- package/framework/phases.json +40 -8
- package/framework/skills/level-0-meta/brainstorming/SKILL.md +1 -1
- package/framework/skills/level-0-meta/code-review/SKILL.md +1 -1
- package/framework/skills/level-0-meta/code-review-nextjs/SKILL.md +163 -163
- package/framework/skills/level-0-meta/frontend-review/SKILL.md +5 -5
- package/framework/skills/level-0-meta/morph-checklist/SKILL.md +2 -2
- package/framework/skills/level-0-meta/morph-init/SKILL.md +5 -5
- package/framework/skills/level-0-meta/morph-replicate/SKILL.md +4 -4
- package/framework/skills/level-0-meta/morph-replicate/references/blazor-html-mapping.md +1 -1
- package/framework/skills/level-0-meta/post-implementation/SKILL.md +59 -12
- package/framework/skills/level-0-meta/simulation-checklist/SKILL.md +1 -1
- package/framework/skills/level-0-meta/terminal-title/SKILL.md +1 -1
- package/framework/skills/level-0-meta/tool-usage-guide/SKILL.md +1 -1
- package/framework/skills/level-0-meta/tool-usage-guide/references/tools-per-phase.md +6 -5
- package/framework/skills/level-0-meta/verification-before-completion/SKILL.md +1 -1
- package/framework/skills/level-1-workflows/phase-clarify/SKILL.md +215 -189
- package/framework/skills/level-1-workflows/phase-codebase-analysis/SKILL.md +251 -251
- package/framework/skills/level-1-workflows/phase-design/SKILL.md +382 -365
- package/framework/skills/level-1-workflows/phase-implement/SKILL.md +492 -450
- package/framework/skills/level-1-workflows/phase-setup/SKILL.md +194 -190
- package/framework/skills/level-1-workflows/phase-tasks/SKILL.md +270 -270
- package/framework/skills/level-1-workflows/phase-uiux/SKILL.md +285 -285
- package/framework/standards/STANDARDS.json +640 -88
- package/framework/standards/infrastructure/vercel/vercel-database.md +106 -0
- package/framework/templates/REGISTRY.json +1825 -1909
- package/framework/templates/context/CONTEXT-FEATURE.md +276 -276
- package/framework/templates/docs/onboarding.md +1 -5
- package/package.json +2 -6
- package/src/commands/agents/dispatch-agents.js +55 -4
- package/src/commands/project/doctor.js +16 -47
- package/src/commands/project/init.js +1 -1
- package/src/commands/project/status.js +2 -2
- package/src/commands/project/update.js +381 -365
- package/src/commands/project/worktree.js +154 -0
- package/src/commands/state/advance-phase.js +120 -30
- package/src/commands/state/approve.js +2 -2
- package/src/commands/state/index.js +7 -8
- package/src/commands/state/phase-runner.js +1 -1
- package/src/commands/state/state.js +61 -6
- package/src/commands/tasks/task.js +78 -99
- package/src/commands/templates/template-render.js +93 -173
- package/src/commands/trust/trust.js +26 -21
- package/src/core/paths/output-schema.js +15 -0
- package/src/core/state/state-manager.js +28 -54
- package/src/core/workflows/workflow-detector.js +9 -87
- package/src/lib/phase-chain/phase-validator.js +330 -0
- package/src/lib/stack/stack-profile.js +88 -0
- package/src/lib/tasks/task-classifier.js +16 -0
- package/src/lib/tasks/test-runner.js +77 -0
- package/src/lib/trust/trust-manager.js +32 -144
- package/src/lib/validators/spec-validator.js +58 -4
- package/src/lib/validators/validation-runner.js +23 -11
- package/src/scripts/setup-infra.js +240 -224
- package/src/utils/agents-installer.js +2 -2
- package/src/utils/banner.js +1 -1
- package/src/utils/claude-settings-manager.js +1 -1
- package/src/utils/file-copier.js +1 -0
- package/src/utils/hooks-installer.js +258 -8
- package/framework/hooks/dev/check-sync-health.js +0 -117
- package/framework/hooks/dev/guard-version-numbers.js +0 -57
- package/framework/hooks/dev/sync-standards-registry.js +0 -60
- package/framework/hooks/dev/sync-template-registry.js +0 -60
- package/framework/hooks/dev/validate-skill-format.js +0 -70
- package/framework/hooks/dev/validate-standard-format.js +0 -73
- package/framework/templates/meta-prompts/hops/hop-retry.md +0 -78
- package/framework/templates/meta-prompts/hops/hop-validation.md +0 -97
- package/framework/templates/meta-prompts/hops/hop-wrapper.md +0 -36
- package/framework/workflows/configs/design-impl.json +0 -49
- package/framework/workflows/configs/express.json +0 -45
- package/framework/workflows/configs/fast-track.json +0 -42
- package/framework/workflows/configs/full-morph.json +0 -79
- package/framework/workflows/configs/fusion.json +0 -39
- package/framework/workflows/configs/long-running.json +0 -33
- package/framework/workflows/configs/spec-only.json +0 -43
- package/framework/workflows/configs/ui-refresh.json +0 -49
- package/framework/workflows/configs/zero-touch.json +0 -82
- package/src/commands/project/monitor.js +0 -295
- package/src/commands/project/tutorial.js +0 -115
- package/src/commands/state/validate-phase.js +0 -238
- package/src/commands/templates/generate-contracts.js +0 -445
- package/src/core/orchestrator.js +0 -171
- package/src/core/registry/command-registry.js +0 -28
- package/src/core/registry/index.js +0 -8
- package/src/core/registry/validator-registry.js +0 -204
- package/src/core/templates/template-validator.js +0 -296
- package/src/generator/config-generator.js +0 -206
- package/src/generator/templates/config.json.template +0 -40
- package/src/generator/templates/project.md.template +0 -67
- package/src/lib/agents/micro-agent-factory.js +0 -161
- package/src/lib/analysis/complexity-analyzer.js +0 -441
- package/src/lib/analysis/index.js +0 -7
- package/src/lib/analytics/analytics-engine.js +0 -345
- package/src/lib/checkpoints/checkpoint-hooks.js +0 -298
- package/src/lib/checkpoints/index.js +0 -7
- package/src/lib/context/context-bundler.js +0 -241
- package/src/lib/context/context-optimizer.js +0 -212
- package/src/lib/context/context-tracker.js +0 -273
- package/src/lib/context/core-four-tracker.js +0 -201
- package/src/lib/context/mcp-optimizer.js +0 -200
- package/src/lib/execution/fusion-executor.js +0 -304
- package/src/lib/execution/parallel-executor.js +0 -270
- package/src/lib/hooks/stop-hook-executor.js +0 -286
- package/src/lib/hops/hop-composer.js +0 -221
- package/src/lib/phase-chain/eligibility-checker.js +0 -243
- package/src/lib/threads/thread-coordinator.js +0 -238
- package/src/lib/threads/thread-manager.js +0 -317
- package/src/lib/tracking/artifact-trail.js +0 -202
- package/src/scanner/project-scanner.js +0 -242
- package/src/ui/diff-display.js +0 -91
- package/src/ui/interactive-wizard.js +0 -96
- package/src/ui/user-review.js +0 -211
- package/src/ui/wizard-questions.js +0 -188
- package/src/utils/color-utils.js +0 -70
- package/src/utils/process-handler.js +0 -97
|
@@ -1,276 +1,276 @@
|
|
|
1
|
-
# {{FEATURE_NAME}} - Feature Context
|
|
2
|
-
|
|
3
|
-
> Auto-generated by MORPH-SPEC Framework
|
|
4
|
-
> Last updated: {{TIMESTAMP}}
|
|
5
|
-
|
|
6
|
-
## Feature Overview
|
|
7
|
-
|
|
8
|
-
**Name:** {{FEATURE_NAME}}
|
|
9
|
-
**Phase:** {{PHASE}} ({{WORKFLOW_TYPE}})
|
|
10
|
-
**Status:** {{STATUS}}
|
|
11
|
-
**Complexity:** {{COMPLEXITY}}
|
|
12
|
-
|
|
13
|
-
{{#if DESCRIPTION}}
|
|
14
|
-
{{DESCRIPTION}}
|
|
15
|
-
{{/if}}
|
|
16
|
-
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
## Progress Tracking
|
|
20
|
-
|
|
21
|
-
### Current Phase: {{PHASE}}
|
|
22
|
-
|
|
23
|
-
{{PHASE_DESCRIPTION}}
|
|
24
|
-
|
|
25
|
-
**Completed Phases:**
|
|
26
|
-
{{#each COMPLETED_PHASES}}
|
|
27
|
-
- ✅ {{name}} - {{completedAt}}
|
|
28
|
-
{{/each}}
|
|
29
|
-
|
|
30
|
-
**Next Phases:**
|
|
31
|
-
{{#each UPCOMING_PHASES}}
|
|
32
|
-
- ⏭️ {{name}}
|
|
33
|
-
{{/each}}
|
|
34
|
-
|
|
35
|
-
### Task Progress
|
|
36
|
-
|
|
37
|
-
**Total Tasks:** {{TASKS_TOTAL}}
|
|
38
|
-
**Completed:** {{TASKS_COMPLETED}} ({{TASKS_PROGRESS}}%)
|
|
39
|
-
**In Progress:** {{TASKS_IN_PROGRESS}}
|
|
40
|
-
**Blocked:** {{TASKS_BLOCKED}}
|
|
41
|
-
|
|
42
|
-
{{#if CURRENT_TASK}}
|
|
43
|
-
**Current Task:** {{CURRENT_TASK.id}} - {{CURRENT_TASK.title}}
|
|
44
|
-
{{/if}}
|
|
45
|
-
|
|
46
|
-
---
|
|
47
|
-
|
|
48
|
-
## Active Agents ({{ACTIVE_AGENTS_COUNT}})
|
|
49
|
-
|
|
50
|
-
### Team Structure
|
|
51
|
-
|
|
52
|
-
{{#if TEAM_LEAD}}
|
|
53
|
-
**Team Lead:** {{TEAM_LEAD.title}} (`{{TEAM_LEAD.id}}`)
|
|
54
|
-
{{/if}}
|
|
55
|
-
|
|
56
|
-
{{#each SQUADS}}
|
|
57
|
-
### {{leader.title}} Squad
|
|
58
|
-
**Leader:** `{{leader.id}}`
|
|
59
|
-
**Members ({{members.length}}):**
|
|
60
|
-
{{#each members}}
|
|
61
|
-
- {{title}} (`{{id}}`) {{#if status}}[{{status}}]{{/if}}
|
|
62
|
-
{{/each}}
|
|
63
|
-
{{/each}}
|
|
64
|
-
|
|
65
|
-
### Validators (Run in Hooks)
|
|
66
|
-
{{#each VALIDATORS}}
|
|
67
|
-
- {{title}} (`{{id}}`)
|
|
68
|
-
{{/each}}
|
|
69
|
-
|
|
70
|
-
---
|
|
71
|
-
|
|
72
|
-
## Agent Teams
|
|
73
|
-
|
|
74
|
-
{{#if AGENT_TEAMS_DECISION}}
|
|
75
|
-
{{#if AGENT_TEAMS_DECISION.useAgentTeams}}
|
|
76
|
-
✅ **Agent Teams Recommended**
|
|
77
|
-
|
|
78
|
-
**Reason:** {{AGENT_TEAMS_DECISION.reason}}
|
|
79
|
-
**Display Mode:** {{AGENT_TEAMS_DECISION.displayMode}}
|
|
80
|
-
**Total Teammates:** {{AGENT_TEAMS_DECISION.totalTeammates}}
|
|
81
|
-
|
|
82
|
-
**Team Composition:**
|
|
83
|
-
- Team Lead: {{AGENT_TEAMS_DECISION.teamLead}}
|
|
84
|
-
- Domain Leaders: {{AGENT_TEAMS_DECISION.squads}}
|
|
85
|
-
- Validators (hooks): {{AGENT_TEAMS_DECISION.validators}}
|
|
86
|
-
|
|
87
|
-
{{else}}
|
|
88
|
-
❌ **Single Session Recommended**
|
|
89
|
-
|
|
90
|
-
**Reason:** {{AGENT_TEAMS_DECISION.reason}}
|
|
91
|
-
**Recommendation:** {{AGENT_TEAMS_DECISION.recommendation}}
|
|
92
|
-
{{/if}}
|
|
93
|
-
{{/if}}
|
|
94
|
-
|
|
95
|
-
---
|
|
96
|
-
|
|
97
|
-
## Outputs Generated
|
|
98
|
-
|
|
99
|
-
{{#each OUTPUTS}}
|
|
100
|
-
### {{type}}
|
|
101
|
-
**Status:** {{#if generated}}✅ Generated{{else}}⏳ Pending{{/if}}
|
|
102
|
-
{{#if path}}**Path:** `{{path}}`{{/if}}
|
|
103
|
-
{{#if generatedAt}}**Generated:** {{generatedAt}}{{/if}}
|
|
104
|
-
{{/each}}
|
|
105
|
-
|
|
106
|
-
---
|
|
107
|
-
|
|
108
|
-
## Decisions Log
|
|
109
|
-
|
|
110
|
-
{{#each DECISIONS}}
|
|
111
|
-
### ADR-{{id}}: {{title}}
|
|
112
|
-
|
|
113
|
-
**Status:** {{status}}
|
|
114
|
-
**Date:** {{date}}
|
|
115
|
-
**Decided By:** {{decidedBy}}
|
|
116
|
-
|
|
117
|
-
**Context:** {{context}}
|
|
118
|
-
|
|
119
|
-
**Decision:** {{decision}}
|
|
120
|
-
|
|
121
|
-
{{#if constraints}}
|
|
122
|
-
**Constraints for Validators:**
|
|
123
|
-
```json
|
|
124
|
-
{{constraints}}
|
|
125
|
-
```
|
|
126
|
-
{{/if}}
|
|
127
|
-
|
|
128
|
-
{{#if alternatives}}
|
|
129
|
-
**Alternatives Considered:**
|
|
130
|
-
{{#each alternatives}}
|
|
131
|
-
- {{name}}: {{rationale}}
|
|
132
|
-
{{/each}}
|
|
133
|
-
{{/if}}
|
|
134
|
-
|
|
135
|
-
---
|
|
136
|
-
{{/each}}
|
|
137
|
-
|
|
138
|
-
{{#unless DECISIONS}}
|
|
139
|
-
No decisions documented yet. Decisions will be logged in `decisions.md` during Design phase.
|
|
140
|
-
{{/unless}}
|
|
141
|
-
|
|
142
|
-
---
|
|
143
|
-
|
|
144
|
-
## Validation Status
|
|
145
|
-
|
|
146
|
-
{{#if VALIDATION_RESULTS}}
|
|
147
|
-
### Latest Validation ({{VALIDATION_TIMESTAMP}})
|
|
148
|
-
|
|
149
|
-
**Overall:** {{#if VALIDATION_PASSED}}✅ PASSED{{else}}❌ FAILED{{/if}}
|
|
150
|
-
|
|
151
|
-
{{#each VALIDATION_RESULTS}}
|
|
152
|
-
#### {{validator}}
|
|
153
|
-
**Status:** {{#if passed}}✅ PASSED{{else}}❌ FAILED{{/if}}
|
|
154
|
-
{{#if issues}}
|
|
155
|
-
**Issues ({{issues.length}}):**
|
|
156
|
-
{{#each issues}}
|
|
157
|
-
- [{{severity}}] {{message}} ({{file}}:{{line}})
|
|
158
|
-
{{/each}}
|
|
159
|
-
{{/if}}
|
|
160
|
-
{{/each}}
|
|
161
|
-
|
|
162
|
-
{{else}}
|
|
163
|
-
No validation runs yet. Validators run automatically via checkpoints.
|
|
164
|
-
{{/if}}
|
|
165
|
-
|
|
166
|
-
---
|
|
167
|
-
|
|
168
|
-
## Tasks Breakdown
|
|
169
|
-
|
|
170
|
-
{{#each TASKS}}
|
|
171
|
-
### {{id}}: {{title}}
|
|
172
|
-
|
|
173
|
-
**Status:** {{status}}
|
|
174
|
-
{{#if priority}}**Priority:** {{priority}}{{/if}}
|
|
175
|
-
{{#if estimatedFiles}}**Estimated Files:** {{estimatedFiles}}{{/if}}
|
|
176
|
-
{{#if dependencies}}**Dependencies:** {{dependencies}}{{/if}}
|
|
177
|
-
|
|
178
|
-
{{#if description}}
|
|
179
|
-
{{description}}
|
|
180
|
-
{{/if}}
|
|
181
|
-
|
|
182
|
-
{{#if agent}}**Assigned Agent:** `{{agent}}`{{/if}}
|
|
183
|
-
|
|
184
|
-
{{#if checkpointAfter}}🔖 **Checkpoint after this task**{{/if}}
|
|
185
|
-
|
|
186
|
-
{{#if completedAt}}✅ Completed: {{completedAt}}{{/if}}
|
|
187
|
-
{{#if blockedReason}}❌ Blocked: {{blockedReason}}{{/if}}
|
|
188
|
-
|
|
189
|
-
---
|
|
190
|
-
{{/each}}
|
|
191
|
-
|
|
192
|
-
---
|
|
193
|
-
|
|
194
|
-
## Checkpoints
|
|
195
|
-
|
|
196
|
-
{{#each CHECKPOINTS}}
|
|
197
|
-
### {{timestamp}}
|
|
198
|
-
**Phase:** {{phase}}
|
|
199
|
-
**Tasks Completed:** {{tasksCompleted}}/{{tasksTotal}}
|
|
200
|
-
|
|
201
|
-
{{#if note}}
|
|
202
|
-
**Note:** {{note}}
|
|
203
|
-
{{/if}}
|
|
204
|
-
|
|
205
|
-
{{#if validation}}
|
|
206
|
-
**Validation:** {{validation.passed}}/{{validation.total}} checks passed
|
|
207
|
-
{{#if validation.issues}}
|
|
208
|
-
- Issues: {{validation.issues}}
|
|
209
|
-
{{/if}}
|
|
210
|
-
{{/if}}
|
|
211
|
-
|
|
212
|
-
---
|
|
213
|
-
{{/each}}
|
|
214
|
-
|
|
215
|
-
---
|
|
216
|
-
|
|
217
|
-
## Related Standards
|
|
218
|
-
|
|
219
|
-
{{#each RELATED_STANDARDS}}
|
|
220
|
-
### {{name}}
|
|
221
|
-
**Path:** `{{path}}`
|
|
222
|
-
{{#if relevantSections}}
|
|
223
|
-
**Relevant Sections:** {{relevantSections}}
|
|
224
|
-
{{/if}}
|
|
225
|
-
{{/each}}
|
|
226
|
-
|
|
227
|
-
---
|
|
228
|
-
|
|
229
|
-
## Quick Actions
|
|
230
|
-
|
|
231
|
-
### Continue Implementation
|
|
232
|
-
```bash
|
|
233
|
-
# Start next task
|
|
234
|
-
morph-spec task next {{FEATURE_NAME}}
|
|
235
|
-
|
|
236
|
-
# Complete current task (runs validators)
|
|
237
|
-
morph-spec task done {{FEATURE_NAME}} {{CURRENT_TASK_ID}}
|
|
238
|
-
|
|
239
|
-
# Generate recap after task completion
|
|
240
|
-
morph-spec generate recap {{FEATURE_NAME}}
|
|
241
|
-
```
|
|
242
|
-
|
|
243
|
-
### Advance Phase
|
|
244
|
-
```bash
|
|
245
|
-
# Check prerequisites and advance
|
|
246
|
-
morph-spec phase advance {{FEATURE_NAME}}
|
|
247
|
-
|
|
248
|
-
# Validate
|
|
249
|
-
morph-spec validate-
|
|
250
|
-
```
|
|
251
|
-
|
|
252
|
-
### Validation
|
|
253
|
-
```bash
|
|
254
|
-
# Run all validators for active agents
|
|
255
|
-
morph-spec validate {{FEATURE_NAME}}
|
|
256
|
-
|
|
257
|
-
# Run specific validator
|
|
258
|
-
morph-spec validate-{{VALIDATOR}} {{FEATURE_NAME}}
|
|
259
|
-
```
|
|
260
|
-
|
|
261
|
-
---
|
|
262
|
-
|
|
263
|
-
## File Paths
|
|
264
|
-
|
|
265
|
-
- **Outputs Directory:** `.morph/features/{{FEATURE_NAME}}/`
|
|
266
|
-
- **Proposal:** `{{PROPOSAL_PATH}}`
|
|
267
|
-
- **Spec:** `{{SPEC_PATH}}`
|
|
268
|
-
- **Contracts:** `{{CONTRACTS_PATH}}`
|
|
269
|
-
- **Tasks:** `{{TASKS_PATH}}`
|
|
270
|
-
- **Decisions:** `{{DECISIONS_PATH}}`
|
|
271
|
-
- **Recap:** `{{RECAP_PATH}}`
|
|
272
|
-
|
|
273
|
-
---
|
|
274
|
-
|
|
275
|
-
*Generated by MORPH-SPEC Framework v{{MORPH_VERSION}}*
|
|
276
|
-
*Feature ID: {{FEATURE_ID}}*
|
|
1
|
+
# {{FEATURE_NAME}} - Feature Context
|
|
2
|
+
|
|
3
|
+
> Auto-generated by MORPH-SPEC Framework
|
|
4
|
+
> Last updated: {{TIMESTAMP}}
|
|
5
|
+
|
|
6
|
+
## Feature Overview
|
|
7
|
+
|
|
8
|
+
**Name:** {{FEATURE_NAME}}
|
|
9
|
+
**Phase:** {{PHASE}} ({{WORKFLOW_TYPE}})
|
|
10
|
+
**Status:** {{STATUS}}
|
|
11
|
+
**Complexity:** {{COMPLEXITY}}
|
|
12
|
+
|
|
13
|
+
{{#if DESCRIPTION}}
|
|
14
|
+
{{DESCRIPTION}}
|
|
15
|
+
{{/if}}
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Progress Tracking
|
|
20
|
+
|
|
21
|
+
### Current Phase: {{PHASE}}
|
|
22
|
+
|
|
23
|
+
{{PHASE_DESCRIPTION}}
|
|
24
|
+
|
|
25
|
+
**Completed Phases:**
|
|
26
|
+
{{#each COMPLETED_PHASES}}
|
|
27
|
+
- ✅ {{name}} - {{completedAt}}
|
|
28
|
+
{{/each}}
|
|
29
|
+
|
|
30
|
+
**Next Phases:**
|
|
31
|
+
{{#each UPCOMING_PHASES}}
|
|
32
|
+
- ⏭️ {{name}}
|
|
33
|
+
{{/each}}
|
|
34
|
+
|
|
35
|
+
### Task Progress
|
|
36
|
+
|
|
37
|
+
**Total Tasks:** {{TASKS_TOTAL}}
|
|
38
|
+
**Completed:** {{TASKS_COMPLETED}} ({{TASKS_PROGRESS}}%)
|
|
39
|
+
**In Progress:** {{TASKS_IN_PROGRESS}}
|
|
40
|
+
**Blocked:** {{TASKS_BLOCKED}}
|
|
41
|
+
|
|
42
|
+
{{#if CURRENT_TASK}}
|
|
43
|
+
**Current Task:** {{CURRENT_TASK.id}} - {{CURRENT_TASK.title}}
|
|
44
|
+
{{/if}}
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Active Agents ({{ACTIVE_AGENTS_COUNT}})
|
|
49
|
+
|
|
50
|
+
### Team Structure
|
|
51
|
+
|
|
52
|
+
{{#if TEAM_LEAD}}
|
|
53
|
+
**Team Lead:** {{TEAM_LEAD.title}} (`{{TEAM_LEAD.id}}`)
|
|
54
|
+
{{/if}}
|
|
55
|
+
|
|
56
|
+
{{#each SQUADS}}
|
|
57
|
+
### {{leader.title}} Squad
|
|
58
|
+
**Leader:** `{{leader.id}}`
|
|
59
|
+
**Members ({{members.length}}):**
|
|
60
|
+
{{#each members}}
|
|
61
|
+
- {{title}} (`{{id}}`) {{#if status}}[{{status}}]{{/if}}
|
|
62
|
+
{{/each}}
|
|
63
|
+
{{/each}}
|
|
64
|
+
|
|
65
|
+
### Validators (Run in Hooks)
|
|
66
|
+
{{#each VALIDATORS}}
|
|
67
|
+
- {{title}} (`{{id}}`)
|
|
68
|
+
{{/each}}
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Agent Teams
|
|
73
|
+
|
|
74
|
+
{{#if AGENT_TEAMS_DECISION}}
|
|
75
|
+
{{#if AGENT_TEAMS_DECISION.useAgentTeams}}
|
|
76
|
+
✅ **Agent Teams Recommended**
|
|
77
|
+
|
|
78
|
+
**Reason:** {{AGENT_TEAMS_DECISION.reason}}
|
|
79
|
+
**Display Mode:** {{AGENT_TEAMS_DECISION.displayMode}}
|
|
80
|
+
**Total Teammates:** {{AGENT_TEAMS_DECISION.totalTeammates}}
|
|
81
|
+
|
|
82
|
+
**Team Composition:**
|
|
83
|
+
- Team Lead: {{AGENT_TEAMS_DECISION.teamLead}}
|
|
84
|
+
- Domain Leaders: {{AGENT_TEAMS_DECISION.squads}}
|
|
85
|
+
- Validators (hooks): {{AGENT_TEAMS_DECISION.validators}}
|
|
86
|
+
|
|
87
|
+
{{else}}
|
|
88
|
+
❌ **Single Session Recommended**
|
|
89
|
+
|
|
90
|
+
**Reason:** {{AGENT_TEAMS_DECISION.reason}}
|
|
91
|
+
**Recommendation:** {{AGENT_TEAMS_DECISION.recommendation}}
|
|
92
|
+
{{/if}}
|
|
93
|
+
{{/if}}
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Outputs Generated
|
|
98
|
+
|
|
99
|
+
{{#each OUTPUTS}}
|
|
100
|
+
### {{type}}
|
|
101
|
+
**Status:** {{#if generated}}✅ Generated{{else}}⏳ Pending{{/if}}
|
|
102
|
+
{{#if path}}**Path:** `{{path}}`{{/if}}
|
|
103
|
+
{{#if generatedAt}}**Generated:** {{generatedAt}}{{/if}}
|
|
104
|
+
{{/each}}
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Decisions Log
|
|
109
|
+
|
|
110
|
+
{{#each DECISIONS}}
|
|
111
|
+
### ADR-{{id}}: {{title}}
|
|
112
|
+
|
|
113
|
+
**Status:** {{status}}
|
|
114
|
+
**Date:** {{date}}
|
|
115
|
+
**Decided By:** {{decidedBy}}
|
|
116
|
+
|
|
117
|
+
**Context:** {{context}}
|
|
118
|
+
|
|
119
|
+
**Decision:** {{decision}}
|
|
120
|
+
|
|
121
|
+
{{#if constraints}}
|
|
122
|
+
**Constraints for Validators:**
|
|
123
|
+
```json
|
|
124
|
+
{{constraints}}
|
|
125
|
+
```
|
|
126
|
+
{{/if}}
|
|
127
|
+
|
|
128
|
+
{{#if alternatives}}
|
|
129
|
+
**Alternatives Considered:**
|
|
130
|
+
{{#each alternatives}}
|
|
131
|
+
- {{name}}: {{rationale}}
|
|
132
|
+
{{/each}}
|
|
133
|
+
{{/if}}
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
{{/each}}
|
|
137
|
+
|
|
138
|
+
{{#unless DECISIONS}}
|
|
139
|
+
No decisions documented yet. Decisions will be logged in `decisions.md` during Design phase.
|
|
140
|
+
{{/unless}}
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## Validation Status
|
|
145
|
+
|
|
146
|
+
{{#if VALIDATION_RESULTS}}
|
|
147
|
+
### Latest Validation ({{VALIDATION_TIMESTAMP}})
|
|
148
|
+
|
|
149
|
+
**Overall:** {{#if VALIDATION_PASSED}}✅ PASSED{{else}}❌ FAILED{{/if}}
|
|
150
|
+
|
|
151
|
+
{{#each VALIDATION_RESULTS}}
|
|
152
|
+
#### {{validator}}
|
|
153
|
+
**Status:** {{#if passed}}✅ PASSED{{else}}❌ FAILED{{/if}}
|
|
154
|
+
{{#if issues}}
|
|
155
|
+
**Issues ({{issues.length}}):**
|
|
156
|
+
{{#each issues}}
|
|
157
|
+
- [{{severity}}] {{message}} ({{file}}:{{line}})
|
|
158
|
+
{{/each}}
|
|
159
|
+
{{/if}}
|
|
160
|
+
{{/each}}
|
|
161
|
+
|
|
162
|
+
{{else}}
|
|
163
|
+
No validation runs yet. Validators run automatically via checkpoints.
|
|
164
|
+
{{/if}}
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## Tasks Breakdown
|
|
169
|
+
|
|
170
|
+
{{#each TASKS}}
|
|
171
|
+
### {{id}}: {{title}}
|
|
172
|
+
|
|
173
|
+
**Status:** {{status}}
|
|
174
|
+
{{#if priority}}**Priority:** {{priority}}{{/if}}
|
|
175
|
+
{{#if estimatedFiles}}**Estimated Files:** {{estimatedFiles}}{{/if}}
|
|
176
|
+
{{#if dependencies}}**Dependencies:** {{dependencies}}{{/if}}
|
|
177
|
+
|
|
178
|
+
{{#if description}}
|
|
179
|
+
{{description}}
|
|
180
|
+
{{/if}}
|
|
181
|
+
|
|
182
|
+
{{#if agent}}**Assigned Agent:** `{{agent}}`{{/if}}
|
|
183
|
+
|
|
184
|
+
{{#if checkpointAfter}}🔖 **Checkpoint after this task**{{/if}}
|
|
185
|
+
|
|
186
|
+
{{#if completedAt}}✅ Completed: {{completedAt}}{{/if}}
|
|
187
|
+
{{#if blockedReason}}❌ Blocked: {{blockedReason}}{{/if}}
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
{{/each}}
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## Checkpoints
|
|
195
|
+
|
|
196
|
+
{{#each CHECKPOINTS}}
|
|
197
|
+
### {{timestamp}}
|
|
198
|
+
**Phase:** {{phase}}
|
|
199
|
+
**Tasks Completed:** {{tasksCompleted}}/{{tasksTotal}}
|
|
200
|
+
|
|
201
|
+
{{#if note}}
|
|
202
|
+
**Note:** {{note}}
|
|
203
|
+
{{/if}}
|
|
204
|
+
|
|
205
|
+
{{#if validation}}
|
|
206
|
+
**Validation:** {{validation.passed}}/{{validation.total}} checks passed
|
|
207
|
+
{{#if validation.issues}}
|
|
208
|
+
- Issues: {{validation.issues}}
|
|
209
|
+
{{/if}}
|
|
210
|
+
{{/if}}
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
{{/each}}
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
## Related Standards
|
|
218
|
+
|
|
219
|
+
{{#each RELATED_STANDARDS}}
|
|
220
|
+
### {{name}}
|
|
221
|
+
**Path:** `{{path}}`
|
|
222
|
+
{{#if relevantSections}}
|
|
223
|
+
**Relevant Sections:** {{relevantSections}}
|
|
224
|
+
{{/if}}
|
|
225
|
+
{{/each}}
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
## Quick Actions
|
|
230
|
+
|
|
231
|
+
### Continue Implementation
|
|
232
|
+
```bash
|
|
233
|
+
# Start next task
|
|
234
|
+
morph-spec task next {{FEATURE_NAME}}
|
|
235
|
+
|
|
236
|
+
# Complete current task (runs validators)
|
|
237
|
+
morph-spec task done {{FEATURE_NAME}} {{CURRENT_TASK_ID}}
|
|
238
|
+
|
|
239
|
+
# Generate recap after task completion
|
|
240
|
+
morph-spec generate recap {{FEATURE_NAME}}
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
### Advance Phase
|
|
244
|
+
```bash
|
|
245
|
+
# Check prerequisites and advance
|
|
246
|
+
morph-spec phase advance {{FEATURE_NAME}}
|
|
247
|
+
|
|
248
|
+
# Validate feature outputs
|
|
249
|
+
morph-spec validate-feature {{FEATURE_NAME}}
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
### Validation
|
|
253
|
+
```bash
|
|
254
|
+
# Run all validators for active agents
|
|
255
|
+
morph-spec validate {{FEATURE_NAME}}
|
|
256
|
+
|
|
257
|
+
# Run specific validator
|
|
258
|
+
morph-spec validate-{{VALIDATOR}} {{FEATURE_NAME}}
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
---
|
|
262
|
+
|
|
263
|
+
## File Paths
|
|
264
|
+
|
|
265
|
+
- **Outputs Directory:** `.morph/features/{{FEATURE_NAME}}/`
|
|
266
|
+
- **Proposal:** `{{PROPOSAL_PATH}}`
|
|
267
|
+
- **Spec:** `{{SPEC_PATH}}`
|
|
268
|
+
- **Contracts:** `{{CONTRACTS_PATH}}`
|
|
269
|
+
- **Tasks:** `{{TASKS_PATH}}`
|
|
270
|
+
- **Decisions:** `{{DECISIONS_PATH}}`
|
|
271
|
+
- **Recap:** `{{RECAP_PATH}}`
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
275
|
+
*Generated by MORPH-SPEC Framework v{{MORPH_VERSION}}*
|
|
276
|
+
*Feature ID: {{FEATURE_ID}}*
|
|
@@ -71,12 +71,8 @@ morph-spec task next <feature>
|
|
|
71
71
|
morph-spec task start <feature> <task-id>
|
|
72
72
|
morph-spec task done <feature> <task-id>
|
|
73
73
|
|
|
74
|
-
# Save
|
|
74
|
+
# Save a checkpoint
|
|
75
75
|
morph-spec checkpoint-save <feature>
|
|
76
|
-
morph-spec checkpoint-list <feature>
|
|
77
|
-
|
|
78
|
-
# View changes since last snapshot
|
|
79
|
-
morph-spec diff <feature>
|
|
80
76
|
|
|
81
77
|
# Health check
|
|
82
78
|
morph-spec doctor
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@polymorphism-tech/morph-spec",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.9.0",
|
|
4
4
|
"description": "MORPH-SPEC: AI-First development framework with validation pipeline and multi-stack support",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"claude-code",
|
|
@@ -52,18 +52,14 @@
|
|
|
52
52
|
"postinstall": "node src/scripts/global-install.js"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"ajv": "^8.12.0",
|
|
56
|
-
"ajv-formats": "^3.0.1",
|
|
57
55
|
"chalk": "^5.3.0",
|
|
58
56
|
"commander": "^12.0.0",
|
|
59
|
-
"diff": "^5.2.0",
|
|
60
57
|
"fs-extra": "^11.2.0",
|
|
61
58
|
"glob": "^10.3.0",
|
|
62
59
|
"handlebars": "^4.7.8",
|
|
63
60
|
"inquirer": "^9.2.0",
|
|
64
61
|
"minimatch": "^9.0.5",
|
|
65
|
-
"ora": "^8.0.0"
|
|
66
|
-
"yaml": "^2.3.4"
|
|
62
|
+
"ora": "^8.0.0"
|
|
67
63
|
},
|
|
68
64
|
"repository": {
|
|
69
65
|
"type": "git",
|
|
@@ -28,6 +28,9 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
|
28
28
|
/** Path to agents.json in the installed package */
|
|
29
29
|
const AGENTS_JSON_PATH = join(__dirname, '../../../framework/agents.json');
|
|
30
30
|
|
|
31
|
+
/** Path to phases.json in the installed package */
|
|
32
|
+
const PHASES_JSON_PATH = join(__dirname, '../../../framework/phases.json');
|
|
33
|
+
|
|
31
34
|
/** Phases where agent dispatch is meaningful */
|
|
32
35
|
const DISPATCHABLE_PHASES = ['design', 'tasks', 'implement'];
|
|
33
36
|
|
|
@@ -87,6 +90,40 @@ const TASK_CATEGORY_TO_GROUP = {
|
|
|
87
90
|
'docs': 'docs',
|
|
88
91
|
};
|
|
89
92
|
|
|
93
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
94
|
+
// Required Skills Injection
|
|
95
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Build a mandatory skills block for the given phase.
|
|
99
|
+
* Reads requiredSkills from phases.json data and formats them as instructions for subagents.
|
|
100
|
+
* Returns null if no required skills for this phase.
|
|
101
|
+
*
|
|
102
|
+
* @param {string} phase - Phase id (e.g. 'implement')
|
|
103
|
+
* @param {Object|null} phasesData - Parsed phases.json content
|
|
104
|
+
* @returns {string|null}
|
|
105
|
+
*/
|
|
106
|
+
export function buildSkillsBlock(phase, phasesData) {
|
|
107
|
+
try {
|
|
108
|
+
const skills = phasesData?.phases?.[phase]?.requiredSkills;
|
|
109
|
+
if (!skills || skills.length === 0) return null;
|
|
110
|
+
|
|
111
|
+
const triggerLabel = trigger =>
|
|
112
|
+
trigger.replace(/([A-Z])/g, ' $1').toUpperCase().trim();
|
|
113
|
+
|
|
114
|
+
const lines = skills.map(s => `- ${triggerLabel(s.trigger)}: Invoke Skill(${s.skill})`);
|
|
115
|
+
|
|
116
|
+
return [
|
|
117
|
+
'Mandatory Skills (non-negotiable — invoke at the specified trigger points):',
|
|
118
|
+
...lines,
|
|
119
|
+
'',
|
|
120
|
+
'Do NOT skip these skills. They are required by MORPH-SPEC for this phase.',
|
|
121
|
+
].join('\n');
|
|
122
|
+
} catch {
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
90
127
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
91
128
|
// Helpers
|
|
92
129
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
@@ -248,6 +285,17 @@ export async function buildDispatchConfig(projectPath, featureName, phase, opts
|
|
|
248
285
|
const agentsData = JSON.parse(readFileSync(agentsPath, 'utf8'));
|
|
249
286
|
const allAgents = agentsData.agents || {};
|
|
250
287
|
|
|
288
|
+
// Load phases.json for required skills injection (opts.phasesJsonPath allows override for testing)
|
|
289
|
+
const phasesPath = opts.phasesJsonPath || PHASES_JSON_PATH;
|
|
290
|
+
let phasesData = null;
|
|
291
|
+
try {
|
|
292
|
+
if (existsSync(phasesPath)) {
|
|
293
|
+
phasesData = JSON.parse(readFileSync(phasesPath, 'utf8'));
|
|
294
|
+
}
|
|
295
|
+
} catch {
|
|
296
|
+
// Non-blocking — fail silent, skills block will be omitted
|
|
297
|
+
}
|
|
298
|
+
|
|
251
299
|
// Active agents from state (keyword-detected during setup phase)
|
|
252
300
|
const activeAgentIds = new Set(feature.activeAgents || []);
|
|
253
301
|
|
|
@@ -296,11 +344,14 @@ export async function buildDispatchConfig(projectPath, featureName, phase, opts
|
|
|
296
344
|
rawPrompt = agentData.teammate.spawn_prompt;
|
|
297
345
|
}
|
|
298
346
|
|
|
299
|
-
// Append standards digest as Constraints block
|
|
347
|
+
// Append standards digest as Constraints block, then required skills block
|
|
300
348
|
const briefing = buildAgentBriefing(agentId, phase);
|
|
301
|
-
const
|
|
302
|
-
|
|
303
|
-
|
|
349
|
+
const skillsBlock = buildSkillsBlock(phase, phasesData);
|
|
350
|
+
const fullTaskPrompt = [
|
|
351
|
+
rawPrompt,
|
|
352
|
+
briefing ? `\n\nConstraints:\n${briefing}` : '',
|
|
353
|
+
skillsBlock ? `\n\n${skillsBlock}` : '',
|
|
354
|
+
].join('');
|
|
304
355
|
|
|
305
356
|
dispatchableAgents.push({
|
|
306
357
|
id: agentId,
|