@polymorphism-tech/morph-spec 4.10.10 → 4.11.1
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 +106 -2
- package/README.md +5 -11
- package/bin/morph-spec.js +30 -2
- package/bin/task-manager.js +394 -38
- package/claude-plugin.json +1 -1
- package/docs/CHEATSHEET.md +1 -1
- package/docs/QUICKSTART.md +2 -8
- package/framework/agents/frontend/css-specialist.md +1 -1
- package/framework/agents/infrastructure/azure-deploy-specialist.md +4 -4
- package/framework/commands/morph-apply.md +39 -19
- package/framework/commands/morph-preflight.md +3 -3
- package/framework/commands/morph-proposal.md +59 -16
- package/framework/commands/morph-status.md +3 -3
- package/framework/commands/morph-troubleshoot.md +1 -1
- package/framework/hooks/claude-code/post-tool-use/dispatch.js +47 -2
- package/framework/hooks/claude-code/pre-tool-use/task-tracking-guard.js +2 -2
- package/framework/hooks/claude-code/session-start/inject-morph-context.js +5 -4
- package/framework/hooks/claude-code/teammate-idle/teammate-idle.js +3 -3
- package/framework/hooks/claude-code/user-prompt/enrich-prompt.js +2 -2
- package/framework/hooks/git/pre-commit/agents.sh +1 -1
- package/framework/hooks/shared/dispatch-helpers.js +14 -0
- package/framework/hooks/shared/state-reader.js +7 -3
- package/framework/rules/morph-task-tracking.md +49 -0
- package/framework/skills/level-0-meta/morph-brainstorming/SKILL.md +14 -18
- package/framework/skills/level-0-meta/morph-checklist/SKILL.md +3 -3
- package/framework/skills/level-0-meta/morph-frontend-review/SKILL.md +1 -1
- package/framework/skills/level-0-meta/morph-init/SKILL.md +11 -11
- package/framework/skills/level-0-meta/morph-post-implementation/SKILL.md +3 -3
- package/framework/skills/level-0-meta/morph-replicate/SKILL.md +1 -1
- package/framework/skills/level-0-meta/morph-simulation-checklist/SKILL.md +4 -4
- package/framework/skills/level-0-meta/morph-tool-usage-guide/references/tools-per-phase.md +25 -25
- package/framework/skills/level-0-meta/morph-verification-before-completion/SKILL.md +8 -8
- package/framework/skills/level-1-workflows/morph-phase-clarify/SKILL.md +16 -7
- package/framework/skills/level-1-workflows/morph-phase-codebase-analysis/SKILL.md +4 -4
- package/framework/skills/level-1-workflows/morph-phase-design/SKILL.md +29 -35
- package/framework/skills/level-1-workflows/morph-phase-design/references/architecture-analysis-guide.md +1 -1
- package/framework/skills/level-1-workflows/morph-phase-implement/SKILL.md +35 -29
- package/framework/skills/level-1-workflows/morph-phase-implement/prompts/implementer-prompt.md +4 -4
- package/framework/skills/level-1-workflows/morph-phase-plan/SKILL.md +17 -20
- package/framework/skills/level-1-workflows/morph-phase-setup/SKILL.md +23 -26
- package/framework/skills/level-1-workflows/morph-phase-tasks/SKILL.md +21 -29
- package/framework/skills/level-1-workflows/morph-phase-uiux/SKILL.md +24 -16
- package/framework/skills/level-1-workflows/morph-scope-escalation/SKILL.md +5 -5
- package/framework/workflows/README.md +18 -18
- package/framework/workflows/docs/enforcement-pipeline.md +1 -1
- package/framework/workflows/docs/full-morph.md +2 -2
- package/package.json +1 -1
- package/src/commands/agents/dispatch-agents.js +25 -1
- package/src/commands/project/doctor.js +3 -4
- package/src/commands/project/status.js +8 -1
- package/src/commands/scope/escalate.js +5 -3
- package/src/commands/tasks/task.js +54 -0
- package/src/commands/validation/validate-feature.js +32 -3
- package/src/lib/build/build-runner.js +99 -0
- package/src/lib/checkpoints/checkpoint-hooks.js +110 -0
- package/src/lib/generators/recap-generator.js +27 -4
- package/src/lib/stack/stack-profile.js +3 -0
- package/src/lib/tasks/task-parser.js +23 -9
- package/src/scripts/global-install.js +57 -3
- package/src/utils/file-copier.js +1 -0
- package/src/utils/version-checker.js +1 -7
- package/framework/hooks/claude-code/pre-tool-use/protect-readonly-files.js +0 -7
|
@@ -4,7 +4,7 @@ description: MORPH-SPEC Phase 2 (Design). Schema-first interactive design: reads
|
|
|
4
4
|
argument-hint: "[feature-name]"
|
|
5
5
|
user-invocable: false
|
|
6
6
|
allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion, Agent
|
|
7
|
-
cliVersion: "4.
|
|
7
|
+
cliVersion: "4.11.1"
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
# MORPH Design — Phase 2
|
|
@@ -37,11 +37,11 @@ Schema-first interactive design: read the real schema, validate with user, gener
|
|
|
37
37
|
| Dispatch domain-architect | **Agent** `subagent_type=domain-architect` + `prompt=agent.taskPrompt` | — |
|
|
38
38
|
| Dispatch tech leads | **Agent** for each active agent from dispatch config | — |
|
|
39
39
|
| Research library | **Context7 MCP** `query_docs()` | **WebSearch** + **WebFetch** |
|
|
40
|
-
| Render contracts VSA | **Bash** `
|
|
41
|
-
| Render contracts DDD | **Bash** `
|
|
42
|
-
| Render spec.md | **Bash** `
|
|
43
|
-
| Render decisions.md | **Bash** `
|
|
44
|
-
| Update state | **Bash** `
|
|
40
|
+
| Render contracts VSA | **Bash** `morph-spec template render dotnet-contracts-vsa ...` | — |
|
|
41
|
+
| Render contracts DDD | **Bash** `morph-spec template render dotnet-contracts-level{N} ...` | — |
|
|
42
|
+
| Render spec.md | **Bash** `morph-spec template render docs/spec ...` | — |
|
|
43
|
+
| Render decisions.md | **Bash** `morph-spec template render docs/decisions ...` | — |
|
|
44
|
+
| Update state | **Bash** `morph-spec state mark-output $ARGUMENTS <type>` | — |
|
|
45
45
|
|
|
46
46
|
**Anti-patterns:**
|
|
47
47
|
- Do not generate contracts before reading the real schema — guessed field names corrupt the entire design
|
|
@@ -53,26 +53,20 @@ Schema-first interactive design: read the real schema, validate with user, gener
|
|
|
53
53
|
|
|
54
54
|
## PRE-FLIGHT
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
## MANDATORY: Session Tasks
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
TaskCreate: "Generate contracts" → activeForm: "Writing contracts"
|
|
64
|
-
TaskCreate: "Generate decisions.md" → activeForm: "Documenting decisions"
|
|
65
|
-
TaskCreate: "Design approval" → activeForm: "Awaiting design approval"
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
Update each to `in_progress` before starting and `completed` after finishing.
|
|
58
|
+
> **BEFORE starting any design work**, analyze the workflow below and create session tasks.
|
|
59
|
+
>
|
|
60
|
+
> **Rules:** Minimum 3 tasks, typically 5-7. Mark `in_progress` before starting, `completed` after.
|
|
61
|
+
>
|
|
62
|
+
> **Typical tasks:** pre-flight validation, schema analysis, architecture blueprint, spec generation, contracts generation, decisions documentation, design approval
|
|
69
63
|
|
|
70
64
|
---
|
|
71
65
|
|
|
72
66
|
**STEP 0 (BEFORE any reads or writes) — Ensure phase is design:**
|
|
73
67
|
|
|
74
68
|
```bash
|
|
75
|
-
|
|
69
|
+
morph-spec state get $ARGUMENTS
|
|
76
70
|
```
|
|
77
71
|
|
|
78
72
|
Check the `"phase"` field in the output:
|
|
@@ -80,12 +74,12 @@ Check the `"phase"` field in the output:
|
|
|
80
74
|
**If `"phase": "design"`** → phase is correct, proceed.
|
|
81
75
|
|
|
82
76
|
**If `"phase": "proposal"`** → execute in sequence:
|
|
83
|
-
1. `
|
|
84
|
-
2. `
|
|
85
|
-
3. `
|
|
77
|
+
1. `morph-spec state mark-output $ARGUMENTS proposal`
|
|
78
|
+
2. `morph-spec phase advance $ARGUMENTS` (→ setup)
|
|
79
|
+
3. `morph-spec phase advance $ARGUMENTS` (→ design)
|
|
86
80
|
|
|
87
81
|
**If `"phase": "setup"`** → execute:
|
|
88
|
-
1. `
|
|
82
|
+
1. `morph-spec phase advance $ARGUMENTS` (→ design)
|
|
89
83
|
|
|
90
84
|
**Any other value** → do not proceed — inconsistent state, report to user.
|
|
91
85
|
|
|
@@ -197,7 +191,7 @@ Use `AskUserQuestion`:
|
|
|
197
191
|
#### 2-VSA.1 Dispatch vsa-architect
|
|
198
192
|
|
|
199
193
|
```bash
|
|
200
|
-
|
|
194
|
+
morph-spec dispatch-agents $ARGUMENTS design
|
|
201
195
|
```
|
|
202
196
|
|
|
203
197
|
Use the `taskPrompt` from the `vsa-architect` agent in the result. Call:
|
|
@@ -255,7 +249,7 @@ Read the proposal and evaluate using the 5 detection questions in `framework/sta
|
|
|
255
249
|
#### 2-DDD.2 Dispatch domain-architect
|
|
256
250
|
|
|
257
251
|
```bash
|
|
258
|
-
|
|
252
|
+
morph-spec dispatch-agents $ARGUMENTS design
|
|
259
253
|
```
|
|
260
254
|
|
|
261
255
|
Use the `taskPrompt` from the `domain-architect` agent in the result. Call:
|
|
@@ -314,7 +308,7 @@ Read the spec-authoring-guide first, then create `.morph/features/$ARGUMENTS/1-d
|
|
|
314
308
|
**Mandatory source:** fields from `schema-analysis.md` + operations from the VSA Blueprint.
|
|
315
309
|
|
|
316
310
|
```bash
|
|
317
|
-
|
|
311
|
+
morph-spec template render \
|
|
318
312
|
dotnet-contracts-vsa \
|
|
319
313
|
.morph/features/$ARGUMENTS/1-design/contracts.cs \
|
|
320
314
|
'{
|
|
@@ -340,7 +334,7 @@ After rendering, fill in the `// placeholder:` sections with real fields from sc
|
|
|
340
334
|
|
|
341
335
|
```bash
|
|
342
336
|
# Replace {N} with the detected level (1, 2, or 3):
|
|
343
|
-
|
|
337
|
+
morph-spec template render \
|
|
344
338
|
dotnet-contracts-level{N} \
|
|
345
339
|
.morph/features/$ARGUMENTS/1-design/contracts.cs \
|
|
346
340
|
'{
|
|
@@ -364,7 +358,7 @@ For TypeScript/Next.js projects, generate `contracts.ts` instead of `contracts.c
|
|
|
364
358
|
### Generate decisions.md
|
|
365
359
|
|
|
366
360
|
```bash
|
|
367
|
-
|
|
361
|
+
morph-spec template render docs/decisions \
|
|
368
362
|
.morph/features/$ARGUMENTS/1-design/decisions.md \
|
|
369
363
|
'{"FEATURE_NAME": "$ARGUMENTS", "DATE": "{{TODAY}}", "decisions": []}'
|
|
370
364
|
```
|
|
@@ -448,15 +442,15 @@ Update spec.md, contracts, and decisions.md with the answers received. Recalcula
|
|
|
448
442
|
## Post-Loop: Update State
|
|
449
443
|
|
|
450
444
|
```bash
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
445
|
+
morph-spec state mark-output $ARGUMENTS schema-analysis
|
|
446
|
+
morph-spec state mark-output $ARGUMENTS spec
|
|
447
|
+
morph-spec state mark-output $ARGUMENTS contracts
|
|
448
|
+
morph-spec state mark-output $ARGUMENTS decisions
|
|
455
449
|
```
|
|
456
450
|
|
|
457
451
|
If Azure costs were estimated:
|
|
458
452
|
```bash
|
|
459
|
-
|
|
453
|
+
morph-spec state set $ARGUMENTS costs.estimated {X.XX}
|
|
460
454
|
```
|
|
461
455
|
|
|
462
456
|
## MANDATORY PAUSE
|
|
@@ -477,8 +471,8 @@ npx morph-spec state set $ARGUMENTS costs.estimated {X.XX}
|
|
|
477
471
|
|
|
478
472
|
- **"Approve and continue"** →
|
|
479
473
|
```bash
|
|
480
|
-
|
|
481
|
-
|
|
474
|
+
morph-spec approve $ARGUMENTS design
|
|
475
|
+
morph-spec phase advance $ARGUMENTS
|
|
482
476
|
```
|
|
483
477
|
- **"I have feedback" / Other** → apply feedback and repeat PAUSE
|
|
484
478
|
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
**Ref:** `framework/standards/architecture/ddd/complexity-levels.md`
|
|
13
13
|
|
|
14
|
-
**Obtenha o taskPrompt do dispatch config** (`
|
|
14
|
+
**Obtenha o taskPrompt do dispatch config** (`morph-spec dispatch-agents $ARGUMENTS design`) e use o Task tool:
|
|
15
15
|
|
|
16
16
|
```
|
|
17
17
|
[Task tool — domain-architect]
|
|
@@ -5,7 +5,7 @@ argument-hint: "[feature-name]"
|
|
|
5
5
|
context: fork
|
|
6
6
|
agent: general-purpose
|
|
7
7
|
user-invocable: false
|
|
8
|
-
cliVersion: "4.
|
|
8
|
+
cliVersion: "4.11.1"
|
|
9
9
|
allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion, Agent
|
|
10
10
|
---
|
|
11
11
|
|
|
@@ -27,7 +27,7 @@ Implement the tasks defined in Phase 4, with checkpoints every 3 tasks and a fin
|
|
|
27
27
|
**Before any reads or writes — verify the current phase:**
|
|
28
28
|
|
|
29
29
|
```bash
|
|
30
|
-
|
|
30
|
+
morph-spec state get $ARGUMENTS
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
Check the `"phase"` field:
|
|
@@ -35,9 +35,9 @@ Check the `"phase"` field:
|
|
|
35
35
|
**If `"phase": "implement"`** → correct phase, proceed.
|
|
36
36
|
|
|
37
37
|
**If `"phase": "tasks"`** → run in sequence:
|
|
38
|
-
1. `
|
|
39
|
-
2. `
|
|
40
|
-
3. `
|
|
38
|
+
1. `morph-spec state mark-output $ARGUMENTS tasks`
|
|
39
|
+
2. `morph-spec approve $ARGUMENTS tasks`
|
|
40
|
+
3. `morph-spec phase advance $ARGUMENTS` (→ implement)
|
|
41
41
|
|
|
42
42
|
**Any other value** → STOP — inconsistent state, report to user.
|
|
43
43
|
|
|
@@ -51,13 +51,13 @@ Before any task work, validate that prior phases are truly complete. `state.json
|
|
|
51
51
|
|
|
52
52
|
```bash
|
|
53
53
|
# 1. Verify mandatory outputs from all prior phases
|
|
54
|
-
|
|
54
|
+
morph-spec validate-feature $ARGUMENTS
|
|
55
55
|
|
|
56
56
|
# 2. Confirm all approval gates passed
|
|
57
|
-
|
|
57
|
+
morph-spec approval-status $ARGUMENTS
|
|
58
58
|
|
|
59
59
|
# 3. Verify activeAgents are populated
|
|
60
|
-
|
|
60
|
+
morph-spec state get $ARGUMENTS | grep -A5 activeAgents
|
|
61
61
|
```
|
|
62
62
|
|
|
63
63
|
If any check fails → **STOP**. Do not start any task. Report what's missing:
|
|
@@ -65,8 +65,8 @@ If any check fails → **STOP**. Do not start any task. Report what's missing:
|
|
|
65
65
|
| Problem | Resolution |
|
|
66
66
|
|---------|-----------|
|
|
67
67
|
| Missing output (spec.md, contracts, etc.) | Return to corresponding phase and generate it |
|
|
68
|
-
| Gate not approved (design, plan, tasks) | `
|
|
69
|
-
| Invalid phase | `
|
|
68
|
+
| Gate not approved (design, plan, tasks) | `morph-spec approve $ARGUMENTS <gate>` |
|
|
69
|
+
| Invalid phase | `morph-spec phase advance $ARGUMENTS` |
|
|
70
70
|
| Empty activeAgents | Run `/phase-setup $ARGUMENTS` first |
|
|
71
71
|
|
|
72
72
|
**This step is not optional.** Only proceed when all commands return without errors.
|
|
@@ -111,7 +111,7 @@ Use `AskUserQuestion` with header `"{MCP}"` and options:
|
|
|
111
111
|
|
|
112
112
|
| Action | Tool | Alternative |
|
|
113
113
|
|--------|------|-------------|
|
|
114
|
-
| Check execution mode (single/subagents/agent-teams) | **Bash** `
|
|
114
|
+
| Check execution mode (single/subagents/agent-teams) | **Bash** `morph-spec dispatch-agents $ARGUMENTS implement` | Task groups + subagent prompts |
|
|
115
115
|
| **Dispatch implementers by domain** (subagents) | **Agent** `subagent_type=<taskGroups[group].subagentType>` + `prompt=taskPrompt` from dispatch config | Backend + frontend + infra in parallel |
|
|
116
116
|
| **Create Agent Team** (critical multi-domain features) | Natural language — see Step 0.5b | — |
|
|
117
117
|
| Read task details | **Read** tasks.md, spec.md, contracts.cs/.ts | — |
|
|
@@ -121,14 +121,14 @@ Use `AskUserQuestion` with header `"{MCP}"` and options:
|
|
|
121
121
|
| Run migrations | **Supabase MCP** `query()` | **Bash** `npx supabase migration ...` |
|
|
122
122
|
| Build project | **Bash** `dotnet build` or `npm run build` | — |
|
|
123
123
|
| Run tests | **Bash** `dotnet test` or `npm test` | — |
|
|
124
|
-
| Checkpoint validation | **Bash** `
|
|
125
|
-
| Mark task complete | **Bash** `
|
|
124
|
+
| Checkpoint validation | **Bash** `morph-spec validate-feature ...` | — |
|
|
125
|
+
| Mark task complete | **Bash** `morph-spec task done $ARGUMENTS T001` | — |
|
|
126
126
|
| Smoke test in browser | **Playwright MCP** `browser_navigate()` + `browser_snapshot()` | Manual |
|
|
127
127
|
| Check console errors | **Playwright MCP** `browser_console_messages()` | — |
|
|
128
128
|
| Screenshot for recap | **Playwright MCP** `browser_take_screenshot()` | — |
|
|
129
129
|
| Deploy and logs Vercel | **Vercel MCP** `list_projects()`, `get_deployments()`, `manage_env_vars()` | **Bash** `vercel deploy` |
|
|
130
130
|
| Create PR | **Bash** `gh pr create ...` | **GitHub MCP** `create_pull_request()` |
|
|
131
|
-
| Update state | **Bash** `
|
|
131
|
+
| Update state | **Bash** `morph-spec state set ...` | — |
|
|
132
132
|
|
|
133
133
|
**Phase MCPs:** Supabase (migrations, RLS), Context7 (API lookup), Playwright (smoke test), GitHub (PRs), Vercel (deploy, logs, env vars).
|
|
134
134
|
|
|
@@ -150,6 +150,12 @@ Use `AskUserQuestion` with header `"{MCP}"` and options:
|
|
|
150
150
|
|
|
151
151
|
## Context Loading
|
|
152
152
|
|
|
153
|
+
## MANDATORY: Session Tasks
|
|
154
|
+
|
|
155
|
+
> **You MUST create one native task per T001-T00N from tasks.md BEFORE starting implementation.**
|
|
156
|
+
> After creating all tasks, wire dependencies using `addBlockedBy`.
|
|
157
|
+
> Update each to `in_progress` before starting and `completed` after `task done` succeeds.
|
|
158
|
+
|
|
153
159
|
### 1. Read full context in PARALLEL
|
|
154
160
|
|
|
155
161
|
```
|
|
@@ -227,7 +233,7 @@ The strategy was defined and approved in the Plan phase. Use it directly:
|
|
|
227
233
|
If `plan.md` doesn't exist or the field is missing, auto-detect via dispatch-agents:
|
|
228
234
|
|
|
229
235
|
```bash
|
|
230
|
-
|
|
236
|
+
morph-spec dispatch-agents $ARGUMENTS implement
|
|
231
237
|
```
|
|
232
238
|
|
|
233
239
|
Check the `mode` field in the JSON output to determine the execution strategy.
|
|
@@ -239,7 +245,7 @@ Check the `mode` field in the JSON output to determine the execution strategy.
|
|
|
239
245
|
**Step 0.5a: Get dispatch config:**
|
|
240
246
|
|
|
241
247
|
```bash
|
|
242
|
-
|
|
248
|
+
morph-spec dispatch-agents $ARGUMENTS implement
|
|
243
249
|
```
|
|
244
250
|
|
|
245
251
|
Parse the JSON output. Extract `taskGroups` and each group's `subagentType`.
|
|
@@ -252,7 +258,7 @@ For each group, verify `.claude/agents/{subagentType}.md` exists:
|
|
|
252
258
|
ls .claude/agents/{subagentType}.md
|
|
253
259
|
```
|
|
254
260
|
|
|
255
|
-
If missing → **STOP** with: `"Agent file .claude/agents/{subagentType}.md not found. Run:
|
|
261
|
+
If missing → **STOP** with: `"Agent file .claude/agents/{subagentType}.md not found. Run: morph-spec setup-infra"`. Do NOT fall back to general-purpose agents for missing files.
|
|
256
262
|
|
|
257
263
|
**Step 0.5c: Dispatch subagents:**
|
|
258
264
|
|
|
@@ -271,7 +277,7 @@ Each subagent receives a prompt with:
|
|
|
271
277
|
- **MANDATORY verification before every `task done`** (see Step 2, item 6b)
|
|
272
278
|
|
|
273
279
|
2. Dispatch subagents for groups in **parallel** (when no cross-group dependencies)
|
|
274
|
-
3. After all complete, validate integration: `
|
|
280
|
+
3. After all complete, validate integration: `morph-spec validate-feature $ARGUMENTS --phase implement`
|
|
275
281
|
|
|
276
282
|
**Fallback:** If `dispatch-agents` fails (non-zero exit or invalid JSON), log a warning and fall back to sequential single-agent mode (Step 2).
|
|
277
283
|
|
|
@@ -294,14 +300,14 @@ Create the team with natural language specifying:
|
|
|
294
300
|
- Enable **plan approval**: teammates must get plans approved before implementing
|
|
295
301
|
- Gate: only approve plans matching contracts.cs/.ts and spec.md
|
|
296
302
|
|
|
297
|
-
After all teammates complete: `
|
|
303
|
+
After all teammates complete: `morph-spec validate-feature $ARGUMENTS --phase implement`
|
|
298
304
|
|
|
299
305
|
---
|
|
300
306
|
|
|
301
307
|
### Step 2: Task Loop
|
|
302
308
|
|
|
303
309
|
```bash
|
|
304
|
-
|
|
310
|
+
morph-spec task next $ARGUMENTS
|
|
305
311
|
```
|
|
306
312
|
|
|
307
313
|
For each task (T001 → T00N):
|
|
@@ -312,7 +318,7 @@ For each task (T001 → T00N):
|
|
|
312
318
|
```
|
|
313
319
|
2. **Start via CLI:**
|
|
314
320
|
```bash
|
|
315
|
-
|
|
321
|
+
morph-spec task start $ARGUMENTS T001
|
|
316
322
|
```
|
|
317
323
|
3. **Read the task description** + contracts.cs/.ts for relevant DTOs/interfaces
|
|
318
324
|
4. **Implement** using Write (new) or Edit (existing)
|
|
@@ -320,12 +326,12 @@ For each task (T001 → T00N):
|
|
|
320
326
|
6. **MANDATORY — Verification before `task done`:**
|
|
321
327
|
Run `validate-feature` before marking ANY task as done. This is non-negotiable — it catches broken code, missing files, and spec violations before they compound across tasks.
|
|
322
328
|
```bash
|
|
323
|
-
|
|
329
|
+
morph-spec validate-feature $ARGUMENTS --phase implement
|
|
324
330
|
```
|
|
325
331
|
Only proceed to step 7 if verification passes. If it fails → fix before marking `task done`.
|
|
326
332
|
7. **Mark as done via CLI:**
|
|
327
333
|
```bash
|
|
328
|
-
|
|
334
|
+
morph-spec task done $ARGUMENTS T001
|
|
329
335
|
```
|
|
330
336
|
8. **If `task done` returns without error, update group task progress:**
|
|
331
337
|
- Increment completed count for the task's group
|
|
@@ -339,10 +345,10 @@ For each task (T001 → T00N):
|
|
|
339
345
|
|
|
340
346
|
```bash
|
|
341
347
|
# Save checkpoint
|
|
342
|
-
|
|
348
|
+
morph-spec checkpoint-save $ARGUMENTS
|
|
343
349
|
|
|
344
350
|
# Run validation
|
|
345
|
-
|
|
351
|
+
morph-spec validate-feature $ARGUMENTS --phase implement
|
|
346
352
|
```
|
|
347
353
|
|
|
348
354
|
**If validation fails:**
|
|
@@ -392,7 +398,7 @@ await mcp__playwright__browser_take_screenshot({ type: 'png' });
|
|
|
392
398
|
After ALL tasks completed:
|
|
393
399
|
|
|
394
400
|
```bash
|
|
395
|
-
|
|
401
|
+
morph-spec generate recap $ARGUMENTS
|
|
396
402
|
```
|
|
397
403
|
|
|
398
404
|
> For the full recap format, see `references/recap-example.md`
|
|
@@ -400,8 +406,8 @@ npx morph-spec generate recap $ARGUMENTS
|
|
|
400
406
|
### Step 7: Update State
|
|
401
407
|
|
|
402
408
|
```bash
|
|
403
|
-
|
|
404
|
-
|
|
409
|
+
morph-spec state set $ARGUMENTS status done
|
|
410
|
+
morph-spec state mark-output $ARGUMENTS recap
|
|
405
411
|
```
|
|
406
412
|
|
|
407
413
|
### Step 8: Post-Implementation Review (mandatory before PR)
|
|
@@ -440,7 +446,7 @@ morph-spec uses its own agents and validators for implementation, dispatch, and
|
|
|
440
446
|
|
|
441
447
|
Implementers are dispatched via `dispatch-agents`:
|
|
442
448
|
```bash
|
|
443
|
-
|
|
449
|
+
morph-spec dispatch-agents $ARGUMENTS implement
|
|
444
450
|
```
|
|
445
451
|
|
|
446
452
|
Use the `subagentType` from each group in the Agent tool:
|
package/framework/skills/level-1-workflows/morph-phase-implement/prompts/implementer-prompt.md
CHANGED
|
@@ -20,7 +20,7 @@ You are implementing tasks for the feature '{{FEATURE_NAME}}' as agent '{{AGENT_
|
|
|
20
20
|
## Execution Rules
|
|
21
21
|
|
|
22
22
|
1. Before starting each task:
|
|
23
|
-
- Execute: `
|
|
23
|
+
- Execute: `morph-spec task start {{FEATURE_NAME}} {{TASK_ID}}`
|
|
24
24
|
|
|
25
25
|
2. For each task, follow TDD:
|
|
26
26
|
- Write the failing test first
|
|
@@ -32,11 +32,11 @@ You are implementing tasks for the feature '{{FEATURE_NAME}}' as agent '{{AGENT_
|
|
|
32
32
|
3. Before marking any task done:
|
|
33
33
|
- Verify build compiles: `dotnet build` or `npm run build`
|
|
34
34
|
- Run relevant tests
|
|
35
|
-
- Execute: `
|
|
35
|
+
- Execute: `morph-spec task done {{FEATURE_NAME}} {{TASK_ID}}`
|
|
36
36
|
|
|
37
37
|
4. Every 3 tasks:
|
|
38
|
-
- Execute: `
|
|
39
|
-
- Execute: `
|
|
38
|
+
- Execute: `morph-spec checkpoint-save {{FEATURE_NAME}}`
|
|
39
|
+
- Execute: `morph-spec validate-feature {{FEATURE_NAME}} --phase implement`
|
|
40
40
|
|
|
41
41
|
5. Contracts are the source of truth — all DTOs, interfaces, and types MUST match `contracts.cs` exactly
|
|
42
42
|
|
|
@@ -4,7 +4,7 @@ description: MORPH-SPEC Phase 4 (Plan). Generates a detailed implementation plan
|
|
|
4
4
|
argument-hint: "[feature-name]"
|
|
5
5
|
user-invocable: false
|
|
6
6
|
allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
|
|
7
|
-
cliVersion: "4.
|
|
7
|
+
cliVersion: "4.11.1"
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
# MORPH Plan — Phase 4
|
|
@@ -28,8 +28,8 @@ Generate a detailed implementation plan with exact paths, TDD code, and executio
|
|
|
28
28
|
| Read spec + contracts + decisions | **Read** all outputs | — |
|
|
29
29
|
| Analyze existing codebase | **Glob** + **Grep** patterns | — |
|
|
30
30
|
| Look up library docs | **Context7 MCP** `query_docs()` | **WebSearch** |
|
|
31
|
-
| Dispatch agents for analysis | **Bash** `
|
|
32
|
-
| Update state | **Bash** `
|
|
31
|
+
| Dispatch agents for analysis | **Bash** `morph-spec dispatch-agents $ARGUMENTS plan` | — |
|
|
32
|
+
| Update state | **Bash** `morph-spec state mark-output $ARGUMENTS plan` | — |
|
|
33
33
|
|
|
34
34
|
**Anti-patterns:**
|
|
35
35
|
- Generating plan without reading contracts (contracts are the source of truth!)
|
|
@@ -45,15 +45,23 @@ Generate a detailed implementation plan with exact paths, TDD code, and executio
|
|
|
45
45
|
### 0. Ensure plan phase
|
|
46
46
|
|
|
47
47
|
```bash
|
|
48
|
-
|
|
48
|
+
morph-spec state get $ARGUMENTS
|
|
49
49
|
```
|
|
50
50
|
|
|
51
51
|
Check the `"phase"` field:
|
|
52
52
|
- `"phase": "plan"` → correct phase, proceed
|
|
53
|
-
- any other value → run `
|
|
53
|
+
- any other value → run `morph-spec phase advance $ARGUMENTS` and re-check
|
|
54
54
|
|
|
55
55
|
> **Rule:** Never write to `3-plan/` until the phase is `plan`.
|
|
56
56
|
|
|
57
|
+
## MANDATORY: Session Tasks
|
|
58
|
+
|
|
59
|
+
> **BEFORE reading any files**, analyze the planning workflow and create session tasks.
|
|
60
|
+
>
|
|
61
|
+
> **Rules:** Minimum 2 tasks, typically 3-5. Mark `in_progress` before starting, `completed` after.
|
|
62
|
+
>
|
|
63
|
+
> **Typical tasks:** feature analysis, execution strategy, plan.md generation, plan approval
|
|
64
|
+
|
|
57
65
|
### 1. Read all prerequisites in PARALLEL
|
|
58
66
|
|
|
59
67
|
```
|
|
@@ -65,17 +73,6 @@ Read: .morph/features/{feature}/1-design/spec.md
|
|
|
65
73
|
+ Read: .morph/config/config.json
|
|
66
74
|
```
|
|
67
75
|
|
|
68
|
-
### 1.5 Create session tasks for visibility
|
|
69
|
-
|
|
70
|
-
```
|
|
71
|
-
TaskCreate: "Analyze feature for execution strategy" → activeForm: "Analyzing feature"
|
|
72
|
-
TaskCreate: "Determine execution strategy" → activeForm: "Planning strategy"
|
|
73
|
-
TaskCreate: "Generate plan.md" → activeForm: "Writing plan"
|
|
74
|
-
TaskCreate: "Plan approval" → activeForm: "Awaiting plan approval"
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
Update each to `in_progress` before starting and `completed` after finishing.
|
|
78
|
-
|
|
79
76
|
---
|
|
80
77
|
|
|
81
78
|
## Workflow
|
|
@@ -101,7 +98,7 @@ cat .morph/config/config.json | grep -A3 '"architecture"'
|
|
|
101
98
|
Run the dispatch analysis:
|
|
102
99
|
|
|
103
100
|
```bash
|
|
104
|
-
|
|
101
|
+
morph-spec dispatch-agents $ARGUMENTS plan
|
|
105
102
|
```
|
|
106
103
|
|
|
107
104
|
**Factors for recommendation:**
|
|
@@ -185,7 +182,7 @@ git commit -m "{message}"
|
|
|
185
182
|
### Step 4: Update State
|
|
186
183
|
|
|
187
184
|
```bash
|
|
188
|
-
|
|
185
|
+
morph-spec state mark-output $ARGUMENTS plan
|
|
189
186
|
```
|
|
190
187
|
|
|
191
188
|
---
|
|
@@ -224,8 +221,8 @@ Use `AskUserQuestion` to capture approval before advancing. This gate prevents t
|
|
|
224
221
|
|
|
225
222
|
- **"Approve plan"** →
|
|
226
223
|
```bash
|
|
227
|
-
|
|
228
|
-
|
|
224
|
+
morph-spec approve $ARGUMENTS plan
|
|
225
|
+
morph-spec phase advance $ARGUMENTS
|
|
229
226
|
```
|
|
230
227
|
- **"I have feedback" or "Other"** → apply the feedback and repeat this PAUSE
|
|
231
228
|
|
|
@@ -4,7 +4,7 @@ description: MORPH-SPEC Phase 1 (Setup). Reads project context, detects tech sta
|
|
|
4
4
|
argument-hint: "[feature-name]"
|
|
5
5
|
user-invocable: false
|
|
6
6
|
allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
|
|
7
|
-
cliVersion: "4.
|
|
7
|
+
cliVersion: "4.11.1"
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
# MORPH Setup — Phase 1
|
|
@@ -26,19 +26,19 @@ Initialize the context and prepare the environment for an approved feature.
|
|
|
26
26
|
|
|
27
27
|
| Action | Tool | Alternative |
|
|
28
28
|
|--------|------|-------------|
|
|
29
|
-
| Verify state | **Bash** `
|
|
30
|
-
| Detect agents + standards | **Bash** `
|
|
29
|
+
| Verify state | **Bash** `morph-spec state get` | — |
|
|
30
|
+
| Detect agents + standards | **Bash** `morph-spec detect-agents $ARGUMENTS --json` → parse → **Bash** `morph-spec state add-agent` | **Read** agents.json manually |
|
|
31
31
|
| Read project context | **Read** `.morph/context/README.md` | — |
|
|
32
32
|
| Read config | **Read** `.morph/config/config.json` | — |
|
|
33
33
|
| Detect VSA architecture | **Read** `.morph/config/config.json` → check `config.architecture.style` | — |
|
|
34
34
|
| Scan project structure | **Glob** `src/**/*.{ts,tsx,cs}` | — |
|
|
35
35
|
| Repository metadata | **GitHub MCP** `get_repo()` | **Bash** `gh repo view --json` |
|
|
36
|
-
| Update state | **Bash** `
|
|
36
|
+
| Update state | **Bash** `morph-spec state set` | — |
|
|
37
37
|
|
|
38
38
|
**MCPs for this phase:** GitHub (optional — repo metadata).
|
|
39
39
|
|
|
40
40
|
**Anti-patterns:**
|
|
41
|
-
- Do not read agents.json manually for keyword matching — use `
|
|
41
|
+
- Do not read agents.json manually for keyword matching — use `morph-spec detect-agents` CLI
|
|
42
42
|
- Do not use a Task agent for agent detection (CLI is faster and consistent)
|
|
43
43
|
- Do not use WebSearch for local project info (use Read/Glob)
|
|
44
44
|
|
|
@@ -58,16 +58,13 @@ If any checkbox is NOT checked → go back to Phase 0 (Proposal).
|
|
|
58
58
|
|
|
59
59
|
---
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
## MANDATORY: Session Tasks
|
|
62
62
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
Update each task to `in_progress` before its step and `completed` after.
|
|
63
|
+
> **BEFORE starting any setup work**, analyze the steps below and create session tasks.
|
|
64
|
+
>
|
|
65
|
+
> **Rules:** Minimum 2 tasks, typically 3-5. Mark `in_progress` before starting, `completed` after.
|
|
66
|
+
>
|
|
67
|
+
> **Typical tasks:** agent detection, MCP validation, stack confirmation, state configuration
|
|
71
68
|
|
|
72
69
|
---
|
|
73
70
|
|
|
@@ -76,7 +73,7 @@ Update each task to `in_progress` before its step and `completed` after.
|
|
|
76
73
|
Read these files first — they inform all subsequent decisions:
|
|
77
74
|
|
|
78
75
|
```bash
|
|
79
|
-
|
|
76
|
+
morph-spec state get $ARGUMENTS
|
|
80
77
|
```
|
|
81
78
|
|
|
82
79
|
If the feature doesn't exist in state, go back to Phase 0.
|
|
@@ -93,8 +90,8 @@ Read `.morph/config/config.json` and check `config.architecture.style`:
|
|
|
93
90
|
|
|
94
91
|
| Value | Action |
|
|
95
92
|
|-------|--------|
|
|
96
|
-
| `"vertical-slice"` | `
|
|
97
|
-
| absent / any other value | `
|
|
93
|
+
| `"vertical-slice"` | `morph-spec state add-agent $ARGUMENTS vsa-architect` |
|
|
94
|
+
| absent / any other value | `morph-spec state add-agent $ARGUMENTS domain-architect` |
|
|
98
95
|
|
|
99
96
|
Proceed with normal keyword detection for all other agents. The architect was already added above — skip it during keyword matching to avoid duplication.
|
|
100
97
|
|
|
@@ -103,7 +100,7 @@ Proceed with normal keyword detection for all other agents. The architect was al
|
|
|
103
100
|
Use the `detect-agents` CLI to match agent keywords against the proposal (excludes architects already handled in Step 2.0):
|
|
104
101
|
|
|
105
102
|
```bash
|
|
106
|
-
|
|
103
|
+
morph-spec detect-agents $ARGUMENTS --exclude domain-architect,vsa-architect --json
|
|
107
104
|
```
|
|
108
105
|
|
|
109
106
|
This reads the proposal from `.morph/features/$ARGUMENTS/0-proposal/proposal.md` and agents.json, returning JSON with `detected[]` and `skipped[]` arrays. Agents with `active_phases: ['*']` are always included.
|
|
@@ -111,7 +108,7 @@ This reads the proposal from `.morph/features/$ARGUMENTS/0-proposal/proposal.md`
|
|
|
111
108
|
Parse the JSON output and add each detected agent to state:
|
|
112
109
|
|
|
113
110
|
```bash
|
|
114
|
-
|
|
111
|
+
morph-spec state add-agent $ARGUMENTS {agent-id}
|
|
115
112
|
```
|
|
116
113
|
|
|
117
114
|
Run `add-agent` once per detected agent ID from the `detected[]` array.
|
|
@@ -156,7 +153,7 @@ Use `AskUserQuestion` with header `"{MCP}"` and options:
|
|
|
156
153
|
|
|
157
154
|
**4. For MCPs RECOMMENDED but NOT CONFIGURED:**
|
|
158
155
|
- Print `△ {MCP} — not configured (fallback: {registry.fallback})`
|
|
159
|
-
- Suggestion: `Tip: configure with /morph-init refresh or
|
|
156
|
+
- Suggestion: `Tip: configure with /morph-init refresh or morph-spec mcp setup`
|
|
160
157
|
|
|
161
158
|
**Summary:** Show a status table for each MCP before proceeding:
|
|
162
159
|
```
|
|
@@ -173,15 +170,15 @@ MCP Readiness:
|
|
|
173
170
|
Run a quick check to verify all expected agents are installed for this project's stack:
|
|
174
171
|
|
|
175
172
|
```bash
|
|
176
|
-
|
|
173
|
+
morph-spec doctor 2>&1 | grep -A 1 "agents completeness"
|
|
177
174
|
```
|
|
178
175
|
|
|
179
176
|
If the output shows **missing agents**, inform the user:
|
|
180
177
|
|
|
181
|
-
> ⚠ Some agents for your stack are not installed. Run `
|
|
178
|
+
> ⚠ Some agents for your stack are not installed. Run `morph-spec setup-infra` to install them.
|
|
182
179
|
|
|
183
180
|
Use `AskUserQuestion` with header `"Agents"` and options:
|
|
184
|
-
- **Install now** — run `
|
|
181
|
+
- **Install now** — run `morph-spec setup-infra` to reinstall with current stack tags
|
|
185
182
|
- **Continue without** — proceed with available agents (may lack specialized support)
|
|
186
183
|
|
|
187
184
|
If "Install now" is selected, run the command and continue.
|
|
@@ -200,7 +197,7 @@ Based on the proposal and context, confirm:
|
|
|
200
197
|
Show the agents detected from the proposal:
|
|
201
198
|
|
|
202
199
|
```bash
|
|
203
|
-
|
|
200
|
+
morph-spec state get $ARGUMENTS
|
|
204
201
|
```
|
|
205
202
|
|
|
206
203
|
Parse the JSON and list `activeAgents` with their emojis/icons and responsibilities (look up each agent in `.morph/framework/agents.json` for the `icon` field).
|
|
@@ -208,7 +205,7 @@ Parse the JSON and list `activeAgents` with their emojis/icons and responsibilit
|
|
|
208
205
|
**If there are 2+ specialist agents active**, show the dispatch plan for the next phase:
|
|
209
206
|
|
|
210
207
|
```bash
|
|
211
|
-
|
|
208
|
+
morph-spec dispatch-agents $ARGUMENTS design
|
|
212
209
|
```
|
|
213
210
|
|
|
214
211
|
This shows which agents will be dispatched in parallel during the design phase and which tasks they'll execute.
|
|
@@ -222,7 +219,7 @@ This shows which agents will be dispatched in parallel during the design phase a
|
|
|
222
219
|
Update the feature state:
|
|
223
220
|
|
|
224
221
|
```bash
|
|
225
|
-
|
|
222
|
+
morph-spec state set $ARGUMENTS status in_progress
|
|
226
223
|
```
|
|
227
224
|
|
|
228
225
|
**Determine the next phase** based on active agents:
|