@polymorphism-tech/morph-spec 4.10.10 → 4.11.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/README.md +5 -11
- package/bin/morph-spec.js +1 -1
- package/bin/task-manager.js +5 -5
- 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 +18 -18
- package/framework/commands/morph-preflight.md +3 -3
- package/framework/commands/morph-proposal.md +15 -15
- package/framework/commands/morph-status.md +3 -3
- package/framework/commands/morph-troubleshoot.md +1 -1
- 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 +1 -1
- 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/skills/level-0-meta/morph-brainstorming/SKILL.md +8 -8
- 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 +7 -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 +23 -23
- 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 +29 -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 +9 -9
- package/framework/skills/level-1-workflows/morph-phase-setup/SKILL.md +17 -17
- package/framework/skills/level-1-workflows/morph-phase-tasks/SKILL.md +12 -12
- package/framework/skills/level-1-workflows/morph-phase-uiux/SKILL.md +16 -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/project/doctor.js +3 -4
- package/src/commands/project/status.js +8 -1
- package/src/commands/scope/escalate.js +5 -3
- package/src/commands/validation/validate-feature.js +32 -3
- package/src/scripts/global-install.js +57 -3
- package/src/utils/version-checker.js +1 -7
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.0"
|
|
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,12 +45,12 @@ 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
|
|
|
@@ -101,7 +101,7 @@ cat .morph/config/config.json | grep -A3 '"architecture"'
|
|
|
101
101
|
Run the dispatch analysis:
|
|
102
102
|
|
|
103
103
|
```bash
|
|
104
|
-
|
|
104
|
+
morph-spec dispatch-agents $ARGUMENTS plan
|
|
105
105
|
```
|
|
106
106
|
|
|
107
107
|
**Factors for recommendation:**
|
|
@@ -185,7 +185,7 @@ git commit -m "{message}"
|
|
|
185
185
|
### Step 4: Update State
|
|
186
186
|
|
|
187
187
|
```bash
|
|
188
|
-
|
|
188
|
+
morph-spec state mark-output $ARGUMENTS plan
|
|
189
189
|
```
|
|
190
190
|
|
|
191
191
|
---
|
|
@@ -224,8 +224,8 @@ Use `AskUserQuestion` to capture approval before advancing. This gate prevents t
|
|
|
224
224
|
|
|
225
225
|
- **"Approve plan"** →
|
|
226
226
|
```bash
|
|
227
|
-
|
|
228
|
-
|
|
227
|
+
morph-spec approve $ARGUMENTS plan
|
|
228
|
+
morph-spec phase advance $ARGUMENTS
|
|
229
229
|
```
|
|
230
230
|
- **"I have feedback" or "Other"** → apply the feedback and repeat this PAUSE
|
|
231
231
|
|
|
@@ -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.0"
|
|
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
|
|
|
@@ -76,7 +76,7 @@ Update each task to `in_progress` before its step and `completed` after.
|
|
|
76
76
|
Read these files first — they inform all subsequent decisions:
|
|
77
77
|
|
|
78
78
|
```bash
|
|
79
|
-
|
|
79
|
+
morph-spec state get $ARGUMENTS
|
|
80
80
|
```
|
|
81
81
|
|
|
82
82
|
If the feature doesn't exist in state, go back to Phase 0.
|
|
@@ -93,8 +93,8 @@ Read `.morph/config/config.json` and check `config.architecture.style`:
|
|
|
93
93
|
|
|
94
94
|
| Value | Action |
|
|
95
95
|
|-------|--------|
|
|
96
|
-
| `"vertical-slice"` | `
|
|
97
|
-
| absent / any other value | `
|
|
96
|
+
| `"vertical-slice"` | `morph-spec state add-agent $ARGUMENTS vsa-architect` |
|
|
97
|
+
| absent / any other value | `morph-spec state add-agent $ARGUMENTS domain-architect` |
|
|
98
98
|
|
|
99
99
|
Proceed with normal keyword detection for all other agents. The architect was already added above — skip it during keyword matching to avoid duplication.
|
|
100
100
|
|
|
@@ -103,7 +103,7 @@ Proceed with normal keyword detection for all other agents. The architect was al
|
|
|
103
103
|
Use the `detect-agents` CLI to match agent keywords against the proposal (excludes architects already handled in Step 2.0):
|
|
104
104
|
|
|
105
105
|
```bash
|
|
106
|
-
|
|
106
|
+
morph-spec detect-agents $ARGUMENTS --exclude domain-architect,vsa-architect --json
|
|
107
107
|
```
|
|
108
108
|
|
|
109
109
|
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 +111,7 @@ This reads the proposal from `.morph/features/$ARGUMENTS/0-proposal/proposal.md`
|
|
|
111
111
|
Parse the JSON output and add each detected agent to state:
|
|
112
112
|
|
|
113
113
|
```bash
|
|
114
|
-
|
|
114
|
+
morph-spec state add-agent $ARGUMENTS {agent-id}
|
|
115
115
|
```
|
|
116
116
|
|
|
117
117
|
Run `add-agent` once per detected agent ID from the `detected[]` array.
|
|
@@ -156,7 +156,7 @@ Use `AskUserQuestion` with header `"{MCP}"` and options:
|
|
|
156
156
|
|
|
157
157
|
**4. For MCPs RECOMMENDED but NOT CONFIGURED:**
|
|
158
158
|
- Print `△ {MCP} — not configured (fallback: {registry.fallback})`
|
|
159
|
-
- Suggestion: `Tip: configure with /morph-init refresh or
|
|
159
|
+
- Suggestion: `Tip: configure with /morph-init refresh or morph-spec mcp setup`
|
|
160
160
|
|
|
161
161
|
**Summary:** Show a status table for each MCP before proceeding:
|
|
162
162
|
```
|
|
@@ -173,15 +173,15 @@ MCP Readiness:
|
|
|
173
173
|
Run a quick check to verify all expected agents are installed for this project's stack:
|
|
174
174
|
|
|
175
175
|
```bash
|
|
176
|
-
|
|
176
|
+
morph-spec doctor 2>&1 | grep -A 1 "agents completeness"
|
|
177
177
|
```
|
|
178
178
|
|
|
179
179
|
If the output shows **missing agents**, inform the user:
|
|
180
180
|
|
|
181
|
-
> ⚠ Some agents for your stack are not installed. Run `
|
|
181
|
+
> ⚠ Some agents for your stack are not installed. Run `morph-spec setup-infra` to install them.
|
|
182
182
|
|
|
183
183
|
Use `AskUserQuestion` with header `"Agents"` and options:
|
|
184
|
-
- **Install now** — run `
|
|
184
|
+
- **Install now** — run `morph-spec setup-infra` to reinstall with current stack tags
|
|
185
185
|
- **Continue without** — proceed with available agents (may lack specialized support)
|
|
186
186
|
|
|
187
187
|
If "Install now" is selected, run the command and continue.
|
|
@@ -200,7 +200,7 @@ Based on the proposal and context, confirm:
|
|
|
200
200
|
Show the agents detected from the proposal:
|
|
201
201
|
|
|
202
202
|
```bash
|
|
203
|
-
|
|
203
|
+
morph-spec state get $ARGUMENTS
|
|
204
204
|
```
|
|
205
205
|
|
|
206
206
|
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 +208,7 @@ Parse the JSON and list `activeAgents` with their emojis/icons and responsibilit
|
|
|
208
208
|
**If there are 2+ specialist agents active**, show the dispatch plan for the next phase:
|
|
209
209
|
|
|
210
210
|
```bash
|
|
211
|
-
|
|
211
|
+
morph-spec dispatch-agents $ARGUMENTS design
|
|
212
212
|
```
|
|
213
213
|
|
|
214
214
|
This shows which agents will be dispatched in parallel during the design phase and which tasks they'll execute.
|
|
@@ -222,7 +222,7 @@ This shows which agents will be dispatched in parallel during the design phase a
|
|
|
222
222
|
Update the feature state:
|
|
223
223
|
|
|
224
224
|
```bash
|
|
225
|
-
|
|
225
|
+
morph-spec state set $ARGUMENTS status in_progress
|
|
226
226
|
```
|
|
227
227
|
|
|
228
228
|
**Determine the next phase** based on active agents:
|
|
@@ -4,7 +4,7 @@ description: MORPH-SPEC Phase 4 (Tasks). Breaks approved spec into bottom-up ord
|
|
|
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.0"
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
# MORPH Tasks — Phase 4
|
|
@@ -33,8 +33,8 @@ Break the approved specification into executable tasks, define execution order,
|
|
|
33
33
|
| Count similar existing patterns | **Glob** `**/Services/**/*.cs` | — |
|
|
34
34
|
| Look up implementation patterns | **Context7 MCP** `query_docs()` | **WebSearch** |
|
|
35
35
|
| Create GitHub issues from tasks | **GitHub MCP** `create_issue()` | **Bash** `gh issue create ...` |
|
|
36
|
-
| Render tasks template | **Bash** `
|
|
37
|
-
| Update state with task count | **Bash** `
|
|
36
|
+
| Render tasks template | **Bash** `morph-spec template render docs/tasks ...` | — |
|
|
37
|
+
| Update state with task count | **Bash** `morph-spec state set ... tasks.total N` | — |
|
|
38
38
|
|
|
39
39
|
**Phase MCPs:** Context7 (estimate complexity), GitHub (create issues).
|
|
40
40
|
|
|
@@ -54,7 +54,7 @@ Break the approved specification into executable tasks, define execution order,
|
|
|
54
54
|
### 0. Ensure tasks phase
|
|
55
55
|
|
|
56
56
|
```bash
|
|
57
|
-
|
|
57
|
+
morph-spec state get $ARGUMENTS
|
|
58
58
|
```
|
|
59
59
|
|
|
60
60
|
Check the `"phase"` field:
|
|
@@ -62,8 +62,8 @@ Check the `"phase"` field:
|
|
|
62
62
|
**If `"phase": "tasks"`** → correct phase, proceed.
|
|
63
63
|
|
|
64
64
|
**If `"phase": "clarify"`** → run in sequence:
|
|
65
|
-
1. `
|
|
66
|
-
2. `
|
|
65
|
+
1. `morph-spec state mark-output $ARGUMENTS clarifications`
|
|
66
|
+
2. `morph-spec phase advance $ARGUMENTS` (→ tasks)
|
|
67
67
|
|
|
68
68
|
**Any other value** → STOP — inconsistent state, report to user.
|
|
69
69
|
|
|
@@ -114,8 +114,8 @@ Before starting the breakdown:
|
|
|
114
114
|
If any checkbox is NOT checked → return to corresponding phase and resolve.
|
|
115
115
|
|
|
116
116
|
```bash
|
|
117
|
-
|
|
118
|
-
|
|
117
|
+
morph-spec state get $ARGUMENTS
|
|
118
|
+
morph-spec approval-status $ARGUMENTS
|
|
119
119
|
```
|
|
120
120
|
|
|
121
121
|
---
|
|
@@ -245,8 +245,8 @@ If there are Azure resources, add Bicep and migration tasks.
|
|
|
245
245
|
### Step 8: Update State
|
|
246
246
|
|
|
247
247
|
```bash
|
|
248
|
-
|
|
249
|
-
|
|
248
|
+
morph-spec state set $ARGUMENTS tasks.total {N}
|
|
249
|
+
morph-spec state mark-output $ARGUMENTS tasks
|
|
250
250
|
```
|
|
251
251
|
|
|
252
252
|
## Outputs
|
|
@@ -273,8 +273,8 @@ Use `AskUserQuestion` to capture explicit approval before advancing. This gate p
|
|
|
273
273
|
|
|
274
274
|
- **"Approve and implement"** →
|
|
275
275
|
```bash
|
|
276
|
-
|
|
277
|
-
|
|
276
|
+
morph-spec approve $ARGUMENTS tasks
|
|
277
|
+
morph-spec phase advance $ARGUMENTS
|
|
278
278
|
```
|
|
279
279
|
- **"I have feedback" or "Other"** → apply the feedback and repeat this PAUSE
|
|
280
280
|
|
|
@@ -4,7 +4,7 @@ description: MORPH-SPEC Phase 1.5 (UI/UX). Creates design-system.md, mockups.md,
|
|
|
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.0"
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
# MORPH UI/UX Design - Phase 1.5
|
|
@@ -36,9 +36,9 @@ Conditional phase for features with front-end. Collects UI/UX requirements, gene
|
|
|
36
36
|
| Inspect page structure | **Playwright MCP** `browser_snapshot()` | **WebFetch** + manual parse |
|
|
37
37
|
| Test responsive layout | **Playwright MCP** `browser_resize()` + `browser_take_screenshot()` | Manual testing |
|
|
38
38
|
| External design references | **WebSearch** + **WebFetch** | — |
|
|
39
|
-
| Render UI templates | **Bash** `
|
|
40
|
-
| Generate design system from existing CSS | **Bash** `
|
|
41
|
-
| Update state | **Bash** `
|
|
39
|
+
| Render UI templates | **Bash** `morph-spec template render docs/ui-mockups ...` | — |
|
|
40
|
+
| Generate design system from existing CSS | **Bash** `morph-spec generate design-system --scan` | — |
|
|
41
|
+
| Update state | **Bash** `morph-spec state mark-output ...` | — |
|
|
42
42
|
|
|
43
43
|
**MCPs for this phase:** Playwright (preview, inspection, responsiveness), Context7 (component docs).
|
|
44
44
|
|
|
@@ -54,7 +54,7 @@ Conditional phase for features with front-end. Collects UI/UX requirements, gene
|
|
|
54
54
|
### Step 0: Ensure uiux phase
|
|
55
55
|
|
|
56
56
|
```bash
|
|
57
|
-
|
|
57
|
+
morph-spec state get $ARGUMENTS
|
|
58
58
|
```
|
|
59
59
|
|
|
60
60
|
Check the `"phase"` field in the output:
|
|
@@ -62,7 +62,7 @@ Check the `"phase"` field in the output:
|
|
|
62
62
|
**If `"phase": "uiux"`** → correct phase, proceed.
|
|
63
63
|
|
|
64
64
|
**If `"phase": "setup"`** → execute:
|
|
65
|
-
1. `
|
|
65
|
+
1. `morph-spec phase advance $ARGUMENTS` (→ uiux)
|
|
66
66
|
|
|
67
67
|
**Any other value** → do not proceed — inconsistent state, report to user.
|
|
68
68
|
|
|
@@ -134,7 +134,7 @@ Print: `✓ Design system generated from [N] tokens — .morph/context/design-sy
|
|
|
134
134
|
Check if active agents include `ui-designer`:
|
|
135
135
|
|
|
136
136
|
```bash
|
|
137
|
-
|
|
137
|
+
morph-spec state get $ARGUMENTS
|
|
138
138
|
```
|
|
139
139
|
|
|
140
140
|
If `ui-designer` is NOT in `activeAgents`, skip this phase and continue to Phase 2 (Design).
|
|
@@ -290,7 +290,7 @@ mcp__plugin_playwright_playwright__browser_take_screenshot({}) → save as .morp
|
|
|
290
290
|
|
|
291
291
|
Create the following files in `.morph/features/$ARGUMENTS/`:
|
|
292
292
|
|
|
293
|
-
> **Use templates:** Use `
|
|
293
|
+
> **Use templates:** Use `morph-spec template render` to generate files from templates in `.morph/framework/templates/docs/`. Available templates: `ui-design-system`, `ui-mockups`, `ui-components`, `ui-flows`.
|
|
294
294
|
|
|
295
295
|
#### 4.1. `ui-design-system.md`
|
|
296
296
|
|
|
@@ -367,17 +367,17 @@ Document in UI files:
|
|
|
367
367
|
### Step 6: Update State
|
|
368
368
|
|
|
369
369
|
```bash
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
370
|
+
morph-spec state mark-output $ARGUMENTS ui-design-system
|
|
371
|
+
morph-spec state mark-output $ARGUMENTS ui-mockups
|
|
372
|
+
morph-spec state mark-output $ARGUMENTS ui-components
|
|
373
|
+
morph-spec state mark-output $ARGUMENTS ui-flows
|
|
374
374
|
```
|
|
375
375
|
|
|
376
376
|
> **Format note:** The `mark-output` commands accept BOTH kebab-case (`ui-design-system`)
|
|
377
377
|
> AND camelCase (`uiDesignSystem`). Both formats work equally! Use whichever is more
|
|
378
378
|
> comfortable for you. Examples:
|
|
379
|
-
> - `
|
|
380
|
-
> - `
|
|
379
|
+
> - `morph-spec state mark-output my-feature uiDesignSystem`
|
|
380
|
+
> - `morph-spec state mark-output my-feature ui-design-system`
|
|
381
381
|
|
|
382
382
|
## Generated Outputs
|
|
383
383
|
|
|
@@ -421,8 +421,8 @@ Use `AskUserQuestion` to capture explicit approval before advancing:
|
|
|
421
421
|
|
|
422
422
|
- **"Approve UI/UX"** →
|
|
423
423
|
```bash
|
|
424
|
-
|
|
425
|
-
|
|
424
|
+
morph-spec approve $ARGUMENTS uiux
|
|
425
|
+
morph-spec phase advance $ARGUMENTS
|
|
426
426
|
```
|
|
427
427
|
- **"I have feedback" or "Other"** → apply the received feedback and repeat this PAUSE
|
|
428
428
|
|
|
@@ -4,7 +4,7 @@ description: Guided workflow for mid-implementation scope escalation — analyze
|
|
|
4
4
|
user-invocable: true
|
|
5
5
|
argument-hint: "[feature-name]"
|
|
6
6
|
allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
|
|
7
|
-
cliVersion: "4.
|
|
7
|
+
cliVersion: "4.11.0"
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
# Scope Escalation Workflow
|
|
@@ -57,7 +57,7 @@ Use `AskUserQuestion` to gather the details:
|
|
|
57
57
|
Run dry-run analysis:
|
|
58
58
|
|
|
59
59
|
```bash
|
|
60
|
-
|
|
60
|
+
morph-spec scope escalate <feature> --task <id> --reason "<reason>" --dry-run
|
|
61
61
|
```
|
|
62
62
|
|
|
63
63
|
Read the recommendation output. Additionally:
|
|
@@ -116,17 +116,17 @@ Based on approved action:
|
|
|
116
116
|
|
|
117
117
|
**For expansion (low impact):**
|
|
118
118
|
```bash
|
|
119
|
-
|
|
119
|
+
morph-spec task expand <feature> <task-id> --into "T017a: <title>" "T017b: <title>" ...
|
|
120
120
|
```
|
|
121
121
|
|
|
122
122
|
**For regression (medium/high impact):**
|
|
123
123
|
```bash
|
|
124
|
-
|
|
124
|
+
morph-spec scope escalate <feature> --task <id> --reason "<reason>"
|
|
125
125
|
```
|
|
126
126
|
|
|
127
127
|
Or with target override:
|
|
128
128
|
```bash
|
|
129
|
-
|
|
129
|
+
morph-spec scope escalate <feature> --task <id> --reason "<reason>" --target design
|
|
130
130
|
```
|
|
131
131
|
|
|
132
132
|
### Step 6: GUIDE Next Steps
|
|
@@ -371,7 +371,7 @@ Keywords like: `bicep`, `azure`, `deploy`, `docker`, `kubernetes`, `infrastructu
|
|
|
371
371
|
|
|
372
372
|
```bash
|
|
373
373
|
# When creating a feature
|
|
374
|
-
|
|
374
|
+
morph-spec feature create user-pagination \
|
|
375
375
|
--request "add pagination to users table"
|
|
376
376
|
|
|
377
377
|
# System automatically:
|
|
@@ -385,7 +385,7 @@ npx morph-spec feature create user-pagination \
|
|
|
385
385
|
|
|
386
386
|
```bash
|
|
387
387
|
# Analyze request without creating feature
|
|
388
|
-
|
|
388
|
+
morph-spec detect-workflow "implement complete authentication system"
|
|
389
389
|
|
|
390
390
|
# Output:
|
|
391
391
|
Detected Workflow: full-morph (92% confidence)
|
|
@@ -407,7 +407,7 @@ Alternative Workflows:
|
|
|
407
407
|
### JSON Output (for automation)
|
|
408
408
|
|
|
409
409
|
```bash
|
|
410
|
-
|
|
410
|
+
morph-spec detect-workflow "add pagination" --json
|
|
411
411
|
|
|
412
412
|
# Output:
|
|
413
413
|
{
|
|
@@ -435,17 +435,17 @@ npx morph-spec detect-workflow "add pagination" --json
|
|
|
435
435
|
|
|
436
436
|
```bash
|
|
437
437
|
# Force specific workflow
|
|
438
|
-
|
|
438
|
+
morph-spec state set user-auth workflow full-morph
|
|
439
439
|
|
|
440
440
|
# Re-detect after request changes
|
|
441
|
-
|
|
441
|
+
morph-spec state detect-workflow user-auth \
|
|
442
442
|
"implement basic login only (no OAuth)"
|
|
443
443
|
```
|
|
444
444
|
|
|
445
445
|
### View Current Workflow
|
|
446
446
|
|
|
447
447
|
```bash
|
|
448
|
-
|
|
448
|
+
morph-spec state get user-auth workflow
|
|
449
449
|
|
|
450
450
|
# Output:
|
|
451
451
|
Workflow: standard
|
|
@@ -594,7 +594,7 @@ Create `framework/workflows/docs/my-workflow.md` explaining the workflow.
|
|
|
594
594
|
**3. Test Detection:**
|
|
595
595
|
|
|
596
596
|
```bash
|
|
597
|
-
|
|
597
|
+
morph-spec detect-workflow "request with custom-keyword"
|
|
598
598
|
```
|
|
599
599
|
|
|
600
600
|
### Modifying Existing Workflows
|
|
@@ -675,7 +675,7 @@ Phases: Quick Analysis → Implement
|
|
|
675
675
|
|
|
676
676
|
**User Experience:**
|
|
677
677
|
```bash
|
|
678
|
-
|
|
678
|
+
morph-spec feature create login-typo --request "fix typo in login button"
|
|
679
679
|
|
|
680
680
|
# Output:
|
|
681
681
|
✓ Detected workflow: fast-track
|
|
@@ -683,7 +683,7 @@ npx morph-spec feature create login-typo --request "fix typo in login button"
|
|
|
683
683
|
📝 Write quick analysis (1 paragraph) and implement
|
|
684
684
|
|
|
685
685
|
# User writes quick analysis, then:
|
|
686
|
-
|
|
686
|
+
morph-spec phase advance login-typo
|
|
687
687
|
|
|
688
688
|
# Output:
|
|
689
689
|
⏩ Skipping: setup, uiux, design, clarify, tasks, sync
|
|
@@ -704,7 +704,7 @@ Phases: PROPOSAL → DESIGN → TASKS → IMPLEMENT
|
|
|
704
704
|
|
|
705
705
|
**User Experience:**
|
|
706
706
|
```bash
|
|
707
|
-
|
|
707
|
+
morph-spec feature create user-pagination \
|
|
708
708
|
--request "add pagination to users table"
|
|
709
709
|
|
|
710
710
|
# Output:
|
|
@@ -727,7 +727,7 @@ Phases: ALL (9 phases mandatory)
|
|
|
727
727
|
|
|
728
728
|
**User Experience:**
|
|
729
729
|
```bash
|
|
730
|
-
|
|
730
|
+
morph-spec feature create user-auth \
|
|
731
731
|
--request "implement complete authentication system with OAuth"
|
|
732
732
|
|
|
733
733
|
# Output:
|
|
@@ -750,7 +750,7 @@ Phases: PROTOTYPE ANALYSIS → TASKS → IMPLEMENT
|
|
|
750
750
|
|
|
751
751
|
**User Experience:**
|
|
752
752
|
```bash
|
|
753
|
-
|
|
753
|
+
morph-spec feature create dashboard-screens \
|
|
754
754
|
--request "implement screens from Figma design"
|
|
755
755
|
|
|
756
756
|
# Output:
|
|
@@ -774,7 +774,7 @@ Phases: VISUAL ANALYSIS → DESIGN SYSTEM → IMPLEMENT
|
|
|
774
774
|
|
|
775
775
|
**User Experience:**
|
|
776
776
|
```bash
|
|
777
|
-
|
|
777
|
+
morph-spec feature create dashboard-redesign \
|
|
778
778
|
--request "redesign dashboard to look more modern"
|
|
779
779
|
|
|
780
780
|
# Output:
|
|
@@ -794,13 +794,13 @@ npx morph-spec feature create dashboard-redesign \
|
|
|
794
794
|
|
|
795
795
|
**Solution 1: Provide more context**
|
|
796
796
|
```bash
|
|
797
|
-
|
|
797
|
+
morph-spec feature create simple-fix \
|
|
798
798
|
--request "add pagination (simple, already have paginator component)"
|
|
799
799
|
```
|
|
800
800
|
|
|
801
801
|
**Solution 2: Manual override**
|
|
802
802
|
```bash
|
|
803
|
-
|
|
803
|
+
morph-spec state set my-feature workflow standard
|
|
804
804
|
```
|
|
805
805
|
|
|
806
806
|
**Solution 3: Improve keywords**
|
|
@@ -849,7 +849,7 @@ If this happens often, add keywords to workflow config:
|
|
|
849
849
|
**Alternative:**
|
|
850
850
|
Use `detect-workflow` first to see both options:
|
|
851
851
|
```bash
|
|
852
|
-
|
|
852
|
+
morph-spec detect-workflow "add authentication"
|
|
853
853
|
|
|
854
854
|
# Review both workflows
|
|
855
855
|
# Decide based on:
|
|
@@ -891,13 +891,13 @@ Create `framework/workflows/configs/blazor-standard.json`:
|
|
|
891
891
|
**Solution 1: Force phase**
|
|
892
892
|
```bash
|
|
893
893
|
# Manually go to UIUX phase
|
|
894
|
-
|
|
894
|
+
morph-spec phase set my-feature uiux
|
|
895
895
|
```
|
|
896
896
|
|
|
897
897
|
**Solution 2: Override workflow**
|
|
898
898
|
```bash
|
|
899
899
|
# Use full-morph (includes all phases)
|
|
900
|
-
|
|
900
|
+
morph-spec state set my-feature workflow full-morph
|
|
901
901
|
```
|
|
902
902
|
|
|
903
903
|
**Solution 3: Document in decisions.md**
|
|
@@ -113,7 +113,7 @@ export function loadStandardsForAgent(agentId, projectPath) {
|
|
|
113
113
|
|
|
114
114
|
```bash
|
|
115
115
|
# Standards auto-injected when running detect-agents with --json
|
|
116
|
-
|
|
116
|
+
morph-spec detect-agents --json "create blazor dashboard"
|
|
117
117
|
|
|
118
118
|
# Output includes standardsSummary for each agent:
|
|
119
119
|
{
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
6. Ativar agentes baseado em stack + keywords
|
|
19
19
|
|
|
20
20
|
### FASE 0: PROPOSAL
|
|
21
|
-
1. `
|
|
21
|
+
1. `morph-spec detect "{user-request}"`
|
|
22
22
|
2. Analisar solicitação, identificar stack, estimar complexidade
|
|
23
23
|
3. Gerar proposal.md, registrar agentes no state.json
|
|
24
24
|
- **⛔ PAUSA:** 3 itens (1 ação + 1 pergunta + 1 sugestão)
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
|
|
56
56
|
### FASE 5: IMPLEMENT
|
|
57
57
|
1. Implementar task por task
|
|
58
|
-
2. `
|
|
58
|
+
2. `morph-spec task done {feature} {task-id}` após cada task
|
|
59
59
|
3. Framework gerencia checkpoints automaticamente (a cada 3 tasks)
|
|
60
60
|
4. Gerar recap.md ao final
|
|
61
61
|
|
package/package.json
CHANGED
|
@@ -947,13 +947,12 @@ export async function doctorCommand(options = {}) {
|
|
|
947
947
|
logger.dim(' PowerShell (as Administrator):');
|
|
948
948
|
console.log(chalk.gray(` [Environment]::SetEnvironmentVariable("Path", [Environment]::GetEnvironmentVariable("Path", "User") + ";${prefix}", "User")`));
|
|
949
949
|
logger.blank();
|
|
950
|
-
logger.dim('
|
|
951
|
-
logger.dim(' npx @polymorphism-tech/morph-spec init');
|
|
950
|
+
logger.dim(' Then open a new terminal.');
|
|
952
951
|
logger.blank();
|
|
953
952
|
} else if (!inPath) {
|
|
954
953
|
logger.info('morph-spec not in PATH:');
|
|
955
|
-
logger.dim('
|
|
956
|
-
logger.dim('
|
|
954
|
+
logger.dim(' Open a new terminal — the installer adds npm global to $PROFILE automatically.');
|
|
955
|
+
logger.dim(' If it persists, add manually: npm config get prefix → add to PATH');
|
|
957
956
|
logger.blank();
|
|
958
957
|
}
|
|
959
958
|
}
|
|
@@ -236,7 +236,14 @@ export async function statusCommand(featureName, options = {}) {
|
|
|
236
236
|
process.exit(1);
|
|
237
237
|
}
|
|
238
238
|
|
|
239
|
-
|
|
239
|
+
let feature;
|
|
240
|
+
try {
|
|
241
|
+
feature = getFeature(featureName);
|
|
242
|
+
} catch (err) {
|
|
243
|
+
console.error(chalk.red(`✗ Error: ${err.message}`));
|
|
244
|
+
console.error(chalk.gray('Run \'morph-spec doctor\' to diagnose or fix your state.json'));
|
|
245
|
+
process.exit(1);
|
|
246
|
+
}
|
|
240
247
|
if (!feature) {
|
|
241
248
|
console.error(chalk.red(`✗ Error: Feature '${featureName}' not found`));
|
|
242
249
|
console.error(chalk.gray(`Run 'morph-spec state get ${featureName}' to check if feature exists`));
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import chalk from 'chalk';
|
|
14
14
|
import { readFileSync, writeFileSync, existsSync, mkdirSync } from 'fs';
|
|
15
15
|
import { join } from 'path';
|
|
16
|
-
import { loadState, saveState } from '../../core/state/state-manager.js';
|
|
16
|
+
import { loadState, saveState, derivePhase } from '../../core/state/state-manager.js';
|
|
17
17
|
import { analyzeImpact } from '../../lib/scope/impact-analyzer.js';
|
|
18
18
|
|
|
19
19
|
/**
|
|
@@ -35,8 +35,10 @@ export async function escalateScope(featureName, options) {
|
|
|
35
35
|
return { success: false, error: `Feature "${featureName}" not found in state.json` };
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
const featurePath = join(process.cwd(), '.morph', 'features', featureName);
|
|
39
|
+
const currentPhase = feature.phase || derivePhase(featurePath);
|
|
40
|
+
if (currentPhase !== 'implement') {
|
|
41
|
+
return { success: false, error: `Scope escalation only available during implement phase (current: ${currentPhase})` };
|
|
40
42
|
}
|
|
41
43
|
|
|
42
44
|
// Read tasks.md
|