@polymorphism-tech/morph-spec 4.10.0 → 4.10.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/README.md +2 -2
- package/claude-plugin.json +1 -1
- package/docs/CHEATSHEET.md +1 -1
- package/docs/QUICKSTART.md +1 -1
- package/framework/CLAUDE.md +5 -69
- package/framework/agents/backend/api-designer.md +3 -0
- package/framework/agents/backend/dotnet-senior.md +3 -0
- package/framework/agents/backend/ef-modeler.md +2 -0
- package/framework/agents/backend/hangfire-orchestrator.md +2 -0
- package/framework/agents/backend/ms-agent-expert.md +2 -0
- package/framework/agents/frontend/blazor-builder.md +2 -0
- package/framework/agents/frontend/nextjs-expert.md +2 -0
- package/framework/agents/infrastructure/azure-architect.md +2 -0
- package/framework/agents/infrastructure/azure-deploy-specialist.md +2 -0
- package/framework/agents/infrastructure/bicep-architect.md +2 -0
- package/framework/agents/infrastructure/container-specialist.md +2 -0
- package/framework/agents/infrastructure/devops-engineer.md +3 -0
- package/framework/agents/infrastructure/infra-architect.md +3 -0
- package/framework/agents/integrations/asaas-financial.md +2 -0
- package/framework/agents/integrations/azure-identity.md +2 -0
- package/framework/agents/integrations/clerk-auth.md +3 -0
- package/framework/agents/integrations/hangfire-integration.md +2 -0
- package/framework/agents/integrations/resend-email.md +2 -0
- package/framework/commands/morph-apply.md +151 -161
- package/framework/commands/morph-archive.md +28 -28
- package/framework/commands/morph-infra.md +79 -79
- package/framework/commands/morph-preflight.md +92 -56
- package/framework/commands/morph-proposal.md +94 -70
- package/framework/commands/morph-status.md +31 -31
- package/framework/commands/morph-troubleshoot.md +63 -60
- package/framework/rules/csharp-standards.md +3 -0
- package/framework/rules/frontend-standards.md +2 -0
- package/framework/rules/infrastructure-standards.md +3 -0
- package/framework/rules/morph-workflow.md +57 -2
- package/framework/rules/nextjs-standards.md +2 -0
- package/framework/rules/testing-standards.md +3 -0
- package/framework/skills/level-0-meta/morph-brainstorming/SKILL.md +54 -49
- package/framework/skills/level-0-meta/morph-checklist/SKILL.md +42 -19
- package/framework/skills/level-0-meta/morph-code-review/SKILL.md +8 -5
- package/framework/skills/level-0-meta/morph-code-review-nextjs/SKILL.md +7 -5
- package/framework/skills/level-0-meta/morph-frontend-review/SKILL.md +139 -136
- package/framework/skills/level-0-meta/morph-init/SKILL.md +42 -13
- package/framework/skills/level-0-meta/morph-post-implementation/SKILL.md +130 -130
- package/framework/skills/level-0-meta/morph-replicate/SKILL.md +95 -87
- package/framework/skills/level-0-meta/morph-simulation-checklist/SKILL.md +24 -0
- package/framework/skills/level-0-meta/morph-tool-usage-guide/SKILL.md +42 -41
- package/framework/skills/level-0-meta/morph-verification-before-completion/SKILL.md +22 -11
- package/framework/skills/level-1-workflows/morph-phase-clarify/SKILL.md +123 -114
- package/framework/skills/level-1-workflows/morph-phase-codebase-analysis/SKILL.md +120 -102
- package/framework/skills/level-1-workflows/morph-phase-design/SKILL.md +206 -214
- package/framework/skills/level-1-workflows/morph-phase-implement/.morph/logs/activity.json +38 -0
- package/framework/skills/level-1-workflows/morph-phase-implement/SKILL.md +241 -360
- package/framework/skills/level-1-workflows/morph-phase-plan/SKILL.md +107 -115
- package/framework/skills/level-1-workflows/morph-phase-setup/SKILL.md +135 -135
- package/framework/skills/level-1-workflows/morph-phase-tasks/.morph/logs/activity.json +14 -0
- package/framework/skills/level-1-workflows/morph-phase-tasks/SKILL.md +143 -139
- package/framework/skills/level-1-workflows/morph-phase-uiux/SKILL.md +168 -165
- package/framework/skills/level-1-workflows/morph-scope-escalation/SKILL.md +57 -8
- package/package.json +3 -3
- package/src/commands/project/doctor.js +7 -2
- package/src/commands/project/update.js +4 -4
- package/src/lib/stack-filter.js +58 -0
- package/src/scripts/setup-infra.js +53 -18
- package/src/utils/agents-installer.js +19 -5
- package/src/utils/claude-md-injector.js +90 -0
- package/src/utils/hooks-installer.js +1 -4
- package/src/utils/skills-installer.js +67 -7
- package/CLAUDE.md +0 -98
- package/framework/memory/patterns-learned.md +0 -766
- package/framework/skills/level-0-meta/morph-terminal-title/SKILL.md +0 -61
- package/framework/skills/level-0-meta/morph-terminal-title/scripts/set_title.sh +0 -65
|
@@ -4,145 +4,137 @@ description: MORPH-SPEC Phase 4 (Plan). Generates a detailed implementation plan
|
|
|
4
4
|
argument-hint: "[feature-name]"
|
|
5
5
|
disable-model-invocation: true
|
|
6
6
|
user-invocable: false
|
|
7
|
-
allowed-tools: Read, Write, Edit, Bash, Glob, Grep
|
|
8
|
-
cliVersion: "4.10.
|
|
7
|
+
allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
|
|
8
|
+
cliVersion: "4.10.1"
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
-
# MORPH Plan
|
|
11
|
+
# MORPH Plan — Phase 4
|
|
12
12
|
|
|
13
13
|
> INTERNAL: Workflow skill used by /morph-proposal during automated phase orchestration. Not a user command.
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
Generate a detailed implementation plan with exact paths, TDD code, and execution strategy.
|
|
16
16
|
|
|
17
|
-
##
|
|
17
|
+
## Prerequisites
|
|
18
18
|
|
|
19
|
-
- [ ]
|
|
20
|
-
- [ ] `spec.md`
|
|
21
|
-
- [ ] `contracts.cs`
|
|
19
|
+
- [ ] Phase 3 (Clarify) completed
|
|
20
|
+
- [ ] `spec.md` updated with clarifications
|
|
21
|
+
- [ ] `contracts.cs` or `contracts.ts` defined
|
|
22
22
|
|
|
23
|
-
##
|
|
23
|
+
## Recommended Tools
|
|
24
24
|
|
|
25
|
-
> **Ref:** `framework/skills/level-0-meta/morph-tool-usage-guide/SKILL.md`
|
|
25
|
+
> **Ref:** `framework/skills/level-0-meta/morph-tool-usage-guide/SKILL.md` for complete guide.
|
|
26
26
|
|
|
27
|
-
|
|
|
28
|
-
|
|
29
|
-
|
|
|
30
|
-
|
|
|
31
|
-
|
|
|
32
|
-
| Dispatch agents
|
|
33
|
-
|
|
|
27
|
+
| Action | Tool | Alternative |
|
|
28
|
+
|--------|------|-------------|
|
|
29
|
+
| Read spec + contracts + decisions | **Read** all outputs | — |
|
|
30
|
+
| Analyze existing codebase | **Glob** + **Grep** patterns | — |
|
|
31
|
+
| Look up library docs | **Context7 MCP** `query_docs()` | **WebSearch** |
|
|
32
|
+
| Dispatch agents for analysis | **Bash** `npx morph-spec dispatch-agents $ARGUMENTS plan` | — |
|
|
33
|
+
| Update state | **Bash** `npx morph-spec state mark-output $ARGUMENTS plan` | — |
|
|
34
34
|
|
|
35
|
-
**Anti-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
35
|
+
**Anti-patterns:**
|
|
36
|
+
- Generating plan without reading contracts (contracts are the source of truth!)
|
|
37
|
+
- Generic paths ("add the file") — always use exact paths
|
|
38
|
+
- Incomplete code in plan ("add validation") — always include complete code
|
|
39
|
+
- Skipping existing codebase analysis (existing patterns guide the plan)
|
|
40
|
+
- Ignoring `config.architecture.style` — VSA and DDD have different structures
|
|
41
41
|
|
|
42
42
|
---
|
|
43
43
|
|
|
44
|
-
##
|
|
44
|
+
## Pre-flight
|
|
45
45
|
|
|
46
|
-
### 0.
|
|
46
|
+
### 0. Ensure plan phase
|
|
47
47
|
|
|
48
48
|
```bash
|
|
49
49
|
npx morph-spec state get $ARGUMENTS
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
- `"phase": "plan"`
|
|
54
|
-
-
|
|
52
|
+
Check the `"phase"` field:
|
|
53
|
+
- `"phase": "plan"` → correct phase, proceed
|
|
54
|
+
- any other value → run `npx morph-spec phase advance $ARGUMENTS` and re-check
|
|
55
55
|
|
|
56
|
-
> **
|
|
56
|
+
> **Rule:** Never write to `3-plan/` until the phase is `plan`.
|
|
57
57
|
|
|
58
|
-
### 1.
|
|
58
|
+
### 1. Read all prerequisites in PARALLEL
|
|
59
59
|
|
|
60
60
|
```
|
|
61
61
|
Read: .morph/features/{feature}/1-design/spec.md
|
|
62
|
-
+ Read: .morph/features/{feature}/1-design/contracts.cs
|
|
62
|
+
+ Read: .morph/features/{feature}/1-design/contracts.cs (or contracts.ts)
|
|
63
63
|
+ Read: .morph/features/{feature}/1-design/decisions.md
|
|
64
64
|
+ Read: .morph/features/{feature}/1-design/clarifications.md
|
|
65
|
-
+ Read: .morph/features/{feature}/1-design/schema-analysis.md (
|
|
65
|
+
+ Read: .morph/features/{feature}/1-design/schema-analysis.md (if exists)
|
|
66
66
|
+ Read: .morph/config/config.json
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
-
### 2. Criar tasks de sessao
|
|
70
|
-
|
|
71
|
-
```
|
|
72
|
-
TaskCreate: "Analisar spec e planejar" -> activeForm: "Analisando spec"
|
|
73
|
-
TaskCreate: "Gerar plan.md" -> activeForm: "Gerando plano"
|
|
74
|
-
TaskCreate: "Avanco de fase" -> activeForm: "Avancando fase"
|
|
75
|
-
```
|
|
76
|
-
|
|
77
69
|
---
|
|
78
70
|
|
|
79
71
|
## Workflow
|
|
80
72
|
|
|
81
|
-
###
|
|
73
|
+
### Step 1: Analyze Feature for Context
|
|
82
74
|
|
|
83
|
-
1. **
|
|
84
|
-
2. **
|
|
85
|
-
3. **
|
|
86
|
-
4. **
|
|
75
|
+
1. **Scan existing codebase** — Glob to find files that will be modified/created
|
|
76
|
+
2. **Identify patterns** — Grep for patterns similar to what will be implemented
|
|
77
|
+
3. **Check library docs** — Context7 for dependency documentation
|
|
78
|
+
4. **Detect architecture:**
|
|
87
79
|
|
|
88
80
|
```bash
|
|
89
81
|
cat .morph/config/config.json | grep -A3 '"architecture"'
|
|
90
82
|
```
|
|
91
83
|
|
|
92
|
-
|
|
|
93
|
-
|
|
94
|
-
| `"vertical-slice"` |
|
|
95
|
-
|
|
|
84
|
+
| `config.architecture.style` value | Path structure |
|
|
85
|
+
|------------------------------------|---------------|
|
|
86
|
+
| `"vertical-slice"` | VSA: `Features/{Entity}Feature/{Operation}/` |
|
|
87
|
+
| any other value | DDD by layer |
|
|
96
88
|
|
|
97
|
-
###
|
|
89
|
+
### Step 2: Determine Execution Strategy
|
|
98
90
|
|
|
99
|
-
|
|
91
|
+
Run the dispatch analysis:
|
|
100
92
|
|
|
101
93
|
```bash
|
|
102
94
|
npx morph-spec dispatch-agents $ARGUMENTS plan
|
|
103
95
|
```
|
|
104
96
|
|
|
105
|
-
**
|
|
97
|
+
**Factors for recommendation:**
|
|
106
98
|
|
|
107
|
-
|
|
|
108
|
-
|
|
109
|
-
| `taskCount` |
|
|
110
|
-
| `domainCount` |
|
|
111
|
-
| `agentCount` | Total
|
|
112
|
-
| `independence` | %
|
|
99
|
+
| Factor | Calculation |
|
|
100
|
+
|--------|-------------|
|
|
101
|
+
| `taskCount` | Number of functional requirements + technical components in spec |
|
|
102
|
+
| `domainCount` | Distinct domains in activeAgents (backend, frontend, infra) |
|
|
103
|
+
| `agentCount` | Total activeAgents |
|
|
104
|
+
| `independence` | % of tasks without cross-domain dependencies |
|
|
113
105
|
|
|
114
|
-
**
|
|
106
|
+
**Decision:**
|
|
115
107
|
|
|
116
|
-
|
|
|
117
|
-
|
|
118
|
-
| `taskCount < 8` AND `domainCount <= 2` | **Single session**
|
|
119
|
-
| `taskCount 8-20` AND `domainCount 2-3` | **Subagent-Driven**
|
|
120
|
-
| `taskCount > 20` OR `domainCount > 3` | **Agent Teams**
|
|
108
|
+
| Scenario | Recommendation |
|
|
109
|
+
|----------|----------------|
|
|
110
|
+
| `taskCount < 8` AND `domainCount <= 2` | **Single session** — direct sequential implementation |
|
|
111
|
+
| `taskCount 8-20` AND `domainCount 2-3` | **Subagent-Driven** — one subagent per task group |
|
|
112
|
+
| `taskCount > 20` OR `domainCount > 3` | **Agent Teams** — multi-domain coordination |
|
|
121
113
|
|
|
122
|
-
###
|
|
114
|
+
### Step 3: Generate `plan.md`
|
|
123
115
|
|
|
124
|
-
|
|
116
|
+
Create `.morph/features/$ARGUMENTS/3-plan/plan.md` with this structure:
|
|
125
117
|
|
|
126
118
|
```markdown
|
|
127
119
|
# {Feature Name} Implementation Plan
|
|
128
120
|
|
|
129
121
|
> **For Claude:** Use morph:phase-implement to execute this plan.
|
|
130
122
|
|
|
131
|
-
**Goal:** {
|
|
123
|
+
**Goal:** {One sentence describing what will be built}
|
|
132
124
|
|
|
133
|
-
**Architecture:** {2-3
|
|
125
|
+
**Architecture:** {2-3 sentences about the approach}
|
|
134
126
|
|
|
135
|
-
**Tech Stack:** {
|
|
127
|
+
**Tech Stack:** {Key technologies}
|
|
136
128
|
|
|
137
129
|
**Execution Strategy:** {single | subagents | agent-teams} (Recommended)
|
|
138
130
|
|
|
139
131
|
---
|
|
140
132
|
|
|
141
|
-
## GROUP {A}
|
|
133
|
+
## GROUP {A} — {Group Name}
|
|
142
134
|
|
|
143
|
-
{
|
|
135
|
+
{Pattern and context for the group}
|
|
144
136
|
|
|
145
|
-
### {A1}
|
|
137
|
+
### {A1} — {Task Name}
|
|
146
138
|
|
|
147
139
|
**Files:**
|
|
148
140
|
- Create: `exact/path/to/file.cs`
|
|
@@ -151,36 +143,36 @@ Crie `.morph/features/$ARGUMENTS/3-plan/plan.md` com a estrutura:
|
|
|
151
143
|
|
|
152
144
|
**Step 1: Write the failing test**
|
|
153
145
|
|
|
154
|
-
(
|
|
146
|
+
(Complete test code)
|
|
155
147
|
|
|
156
148
|
**Step 2: Run test to verify it fails**
|
|
157
149
|
|
|
158
|
-
Run: `{
|
|
159
|
-
Expected: FAIL with "{
|
|
150
|
+
Run: `{exact command}`
|
|
151
|
+
Expected: FAIL with "{message}"
|
|
160
152
|
|
|
161
153
|
**Step 3: Write minimal implementation**
|
|
162
154
|
|
|
163
|
-
(
|
|
155
|
+
(Complete implementation code)
|
|
164
156
|
|
|
165
157
|
**Step 4: Run test to verify it passes**
|
|
166
158
|
|
|
167
|
-
Run: `{
|
|
159
|
+
Run: `{exact command}`
|
|
168
160
|
Expected: PASS
|
|
169
161
|
|
|
170
162
|
**Step 5: Commit**
|
|
171
163
|
|
|
172
164
|
git add {files}
|
|
173
|
-
git commit -m "{
|
|
165
|
+
git commit -m "{message}"
|
|
174
166
|
```
|
|
175
167
|
|
|
176
|
-
**
|
|
177
|
-
-
|
|
178
|
-
-
|
|
179
|
-
-
|
|
180
|
-
-
|
|
181
|
-
-
|
|
168
|
+
**Mandatory rules:**
|
|
169
|
+
- Exact paths ALWAYS (never "add the file somewhere")
|
|
170
|
+
- COMPLETE code in each step (never "add validation later" or "implement here")
|
|
171
|
+
- Exact test commands with expected output (pass/fail message)
|
|
172
|
+
- Each task follows the TDD 5-step cycle above — this is what makes the plan actionable
|
|
173
|
+
- Keep each step to a 2-5 minute action
|
|
182
174
|
|
|
183
|
-
###
|
|
175
|
+
### Step 4: Update State
|
|
184
176
|
|
|
185
177
|
```bash
|
|
186
178
|
npx morph-spec state mark-output $ARGUMENTS plan
|
|
@@ -188,67 +180,67 @@ npx morph-spec state mark-output $ARGUMENTS plan
|
|
|
188
180
|
|
|
189
181
|
---
|
|
190
182
|
|
|
191
|
-
##
|
|
183
|
+
## Mandatory Approval Pause
|
|
192
184
|
|
|
193
|
-
Use `AskUserQuestion`
|
|
185
|
+
Use `AskUserQuestion` to capture approval before advancing. This gate prevents task breakdown from starting with an unapproved plan.
|
|
194
186
|
|
|
195
187
|
```json
|
|
196
188
|
{
|
|
197
189
|
"questions": [
|
|
198
190
|
{
|
|
199
|
-
"header": "
|
|
200
|
-
"question": "
|
|
191
|
+
"header": "Approval",
|
|
192
|
+
"question": "Implementation plan generated. Approve to start task breakdown?",
|
|
201
193
|
"multiSelect": false,
|
|
202
194
|
"options": [
|
|
203
|
-
{ "label": "
|
|
204
|
-
{ "label": "
|
|
195
|
+
{ "label": "Approve plan", "description": "Advance to task breakdown phase" },
|
|
196
|
+
{ "label": "I have feedback", "description": "Type what you want to change" }
|
|
205
197
|
]
|
|
206
198
|
},
|
|
207
199
|
{
|
|
208
|
-
"header": "
|
|
209
|
-
"question": "
|
|
200
|
+
"header": "Execution",
|
|
201
|
+
"question": "Which execution strategy for implementation?",
|
|
210
202
|
"multiSelect": false,
|
|
211
203
|
"options": [
|
|
212
|
-
{ "label": "{
|
|
213
|
-
{ "label": "{
|
|
214
|
-
{ "label": "{
|
|
204
|
+
{ "label": "{Recommendation} (Recommended)", "description": "{Justification from Step 2 analysis}" },
|
|
205
|
+
{ "label": "{Alternative 1}", "description": "{Description}" },
|
|
206
|
+
{ "label": "{Alternative 2}", "description": "{Description}" }
|
|
215
207
|
]
|
|
216
208
|
}
|
|
217
209
|
]
|
|
218
210
|
}
|
|
219
211
|
```
|
|
220
212
|
|
|
221
|
-
>
|
|
213
|
+
> The first "Execution" option should be the context-aware recommendation from Step 2. Alternatives are the other strategies.
|
|
222
214
|
|
|
223
|
-
- **"
|
|
224
|
-
```bash
|
|
225
|
-
npx morph-spec approve $ARGUMENTS plan
|
|
226
|
-
npx morph-spec phase advance $ARGUMENTS
|
|
227
|
-
```
|
|
228
|
-
- **"
|
|
215
|
+
- **"Approve plan"** →
|
|
216
|
+
```bash
|
|
217
|
+
npx morph-spec approve $ARGUMENTS plan
|
|
218
|
+
npx morph-spec phase advance $ARGUMENTS
|
|
219
|
+
```
|
|
220
|
+
- **"I have feedback" or "Other"** → apply the feedback and repeat this PAUSE
|
|
229
221
|
|
|
230
222
|
---
|
|
231
223
|
|
|
232
|
-
## Outputs
|
|
224
|
+
## Phase Outputs
|
|
233
225
|
|
|
234
226
|
<!-- morph:outputs:plan -->
|
|
235
|
-
| Output |
|
|
236
|
-
|
|
227
|
+
| Output | Path |
|
|
228
|
+
|--------|------|
|
|
237
229
|
| `plan` | `.morph/features/{feature}/3-plan/plan.md` |
|
|
238
230
|
<!-- /morph:outputs -->
|
|
239
231
|
|
|
240
232
|
---
|
|
241
233
|
|
|
242
|
-
##
|
|
234
|
+
## Advancement Criteria
|
|
243
235
|
|
|
244
|
-
- [x] `plan.md`
|
|
245
|
-
- [x]
|
|
246
|
-
- [x]
|
|
247
|
-
- [x]
|
|
248
|
-
- [x]
|
|
249
|
-
- [x] State
|
|
250
|
-
- [x]
|
|
236
|
+
- [x] `plan.md` created with all groups and tasks
|
|
237
|
+
- [x] Exact paths for all files
|
|
238
|
+
- [x] Complete code in each step
|
|
239
|
+
- [x] Test commands with expected output
|
|
240
|
+
- [x] Execution strategy defined and approved
|
|
241
|
+
- [x] State updated (`mark-output plan`)
|
|
242
|
+
- [x] User approved plan via `AskUserQuestion`
|
|
251
243
|
|
|
252
244
|
---
|
|
253
245
|
|
|
254
|
-
|
|
246
|
+
After approval: proceed automatically to Phase 5 (Tasks).
|