@polymorphism-tech/morph-spec 4.10.0 → 4.10.2
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
|
@@ -3,236 +3,236 @@ name: morph:phase-setup
|
|
|
3
3
|
description: MORPH-SPEC Phase 1 (Setup). Reads project context, detects tech stack, activates relevant agents by reading agents.json, and confirms the feature environment. Use at the start of every MORPH-SPEC feature workflow after proposal approval to load standards and initialize the context.
|
|
4
4
|
argument-hint: "[feature-name]"
|
|
5
5
|
user-invocable: false
|
|
6
|
-
allowed-tools: Read, Write, Edit, Bash, Glob, Grep
|
|
7
|
-
cliVersion: "4.10.
|
|
6
|
+
allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
|
|
7
|
+
cliVersion: "4.10.2"
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
-
# MORPH Setup
|
|
10
|
+
# MORPH Setup — Phase 1
|
|
11
11
|
|
|
12
12
|
> INTERNAL: Workflow skill used by /morph-proposal during automated phase orchestration. Not a user command.
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
Initialize the context and prepare the environment for an approved feature.
|
|
15
15
|
|
|
16
|
-
##
|
|
16
|
+
## Prerequisites
|
|
17
17
|
|
|
18
|
-
- [ ] Feature
|
|
19
|
-
- [ ] Proposal
|
|
20
|
-
- [ ]
|
|
18
|
+
- [ ] Feature has `proposal.md` created (Phase 0 complete)
|
|
19
|
+
- [ ] Proposal was approved by the user
|
|
20
|
+
- [ ] Agents were detected and registered in state
|
|
21
21
|
|
|
22
|
-
##
|
|
22
|
+
## Recommended Tools
|
|
23
23
|
|
|
24
|
-
> **Ref:** `framework/skills/level-0-meta/morph-tool-usage-guide/SKILL.md`
|
|
25
|
-
> **Ref:** `framework/standards/integration/mcp/mcp-tools.md`
|
|
24
|
+
> **Ref:** `framework/skills/level-0-meta/morph-tool-usage-guide/SKILL.md` for full guide.
|
|
25
|
+
> **Ref:** `framework/standards/integration/mcp/mcp-tools.md` for MCP reference.
|
|
26
26
|
|
|
27
|
-
|
|
|
28
|
-
|
|
29
|
-
|
|
|
30
|
-
|
|
|
31
|
-
|
|
|
32
|
-
|
|
|
33
|
-
|
|
|
34
|
-
|
|
|
35
|
-
|
|
|
36
|
-
|
|
|
27
|
+
| Action | Tool | Alternative |
|
|
28
|
+
|--------|------|-------------|
|
|
29
|
+
| Verify state | **Bash** `npx morph-spec state get` | — |
|
|
30
|
+
| Detect agents + standards | **Read** `.morph/framework/agents.json` → match keywords → **Bash** `npx morph-spec state add-agent` | — |
|
|
31
|
+
| Read project context | **Read** `.morph/context/README.md` | — |
|
|
32
|
+
| Read config | **Read** `.morph/config/config.json` | — |
|
|
33
|
+
| Detect VSA architecture | **Read** `.morph/config/config.json` → check `config.architecture.style` | — |
|
|
34
|
+
| Scan project structure | **Glob** `src/**/*.{ts,tsx,cs}` | — |
|
|
35
|
+
| Repository metadata | **GitHub MCP** `get_repo()` | **Bash** `gh repo view --json` |
|
|
36
|
+
| Update state | **Bash** `npx morph-spec state set` | — |
|
|
37
37
|
|
|
38
|
-
**MCPs
|
|
38
|
+
**MCPs for this phase:** GitHub (optional — repo metadata).
|
|
39
39
|
|
|
40
|
-
**Anti-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
-
|
|
40
|
+
**Anti-patterns:**
|
|
41
|
+
- Do not call a `detect-agents` CLI command (it doesn't exist — read `.morph/framework/agents.json` directly)
|
|
42
|
+
- Do not use a Task agent for inline keyword matching (fast enough to do directly)
|
|
43
|
+
- Do not use WebSearch for local project info (use Read/Glob)
|
|
44
44
|
|
|
45
45
|
---
|
|
46
46
|
|
|
47
47
|
## Workflow
|
|
48
48
|
|
|
49
|
-
### CHECKPOINT
|
|
49
|
+
### ENTRY CHECKPOINT: Verify Prerequisites
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
Before proceeding with setup:
|
|
52
52
|
|
|
53
|
-
- [ ] `proposal.md`
|
|
54
|
-
- [ ]
|
|
55
|
-
- [ ]
|
|
53
|
+
- [ ] Does `proposal.md` exist in `.morph/features/$ARGUMENTS/0-proposal/`?
|
|
54
|
+
- [ ] Was the proposal presented and approved by the user?
|
|
55
|
+
- [ ] Is the feature registered in state?
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
→ Voltar para FASE 0 (Proposal)
|
|
57
|
+
If any checkbox is NOT checked → go back to Phase 0 (Proposal).
|
|
59
58
|
|
|
60
59
|
---
|
|
61
60
|
|
|
62
|
-
###
|
|
61
|
+
### Step 1: Load Project Context
|
|
63
62
|
|
|
64
|
-
|
|
63
|
+
Read these files first — they inform all subsequent decisions:
|
|
65
64
|
|
|
66
65
|
```bash
|
|
67
66
|
npx morph-spec state get $ARGUMENTS
|
|
68
67
|
```
|
|
69
68
|
|
|
70
|
-
|
|
69
|
+
If the feature doesn't exist in state, go back to Phase 0.
|
|
71
70
|
|
|
72
|
-
|
|
71
|
+
Then read:
|
|
72
|
+
- `.morph/context/README.md` — project overview, tech stack, architecture
|
|
73
|
+
- `.morph/config/config.json` — project configuration
|
|
73
74
|
|
|
74
|
-
|
|
75
|
+
### Step 2: Detect Agents and Load Standards
|
|
75
76
|
|
|
76
|
-
|
|
77
|
+
#### Step 2.0: Detect Architecture Style and Activate Architect
|
|
77
78
|
|
|
78
|
-
|
|
79
|
-
|
|
79
|
+
Read `.morph/config/config.json` and check `config.architecture.style`:
|
|
80
|
+
|
|
81
|
+
| Value | Action |
|
|
82
|
+
|-------|--------|
|
|
80
83
|
| `"vertical-slice"` | `npx morph-spec state add-agent $ARGUMENTS vsa-architect` |
|
|
81
|
-
|
|
|
84
|
+
| absent / any other value | `npx morph-spec state add-agent $ARGUMENTS domain-architect` |
|
|
82
85
|
|
|
83
|
-
|
|
84
|
-
O arquiteto já foi adicionado acima — **ignore-o no keyword matching** para evitar duplicação.
|
|
86
|
+
Proceed with normal keyword detection for all other agents. The architect was already added above — skip it during keyword matching to avoid duplication.
|
|
85
87
|
|
|
86
|
-
####
|
|
88
|
+
#### Step 2.1: Keyword Detection
|
|
87
89
|
|
|
88
|
-
|
|
90
|
+
Read agents.json and match keywords (except `domain-architect` and `vsa-architect` which were handled in Step 2.0):
|
|
89
91
|
|
|
90
|
-
1.
|
|
91
|
-
2.
|
|
92
|
-
3.
|
|
93
|
-
4.
|
|
92
|
+
1. Read `.morph/framework/agents.json` (or `framework/agents.json` in the framework project itself)
|
|
93
|
+
2. Extract the feature title and description from `0-proposal/proposal.md`
|
|
94
|
+
3. For each agent in the JSON (except architects), check if any keyword from the `keywords[]` field appears in the proposal text
|
|
95
|
+
4. Include all agents with `always_active: true` automatically
|
|
96
|
+
5. Add matched agents to state:
|
|
94
97
|
|
|
95
98
|
```bash
|
|
96
99
|
npx morph-spec state add-agent $ARGUMENTS {agent-id}
|
|
97
|
-
# Exemplo:
|
|
98
|
-
npx morph-spec state add-agent $ARGUMENTS dotnet-senior
|
|
99
|
-
npx morph-spec state add-agent $ARGUMENTS ef-modeler
|
|
100
100
|
```
|
|
101
101
|
|
|
102
|
-
**
|
|
103
|
-
-
|
|
104
|
-
-
|
|
105
|
-
|
|
106
|
-
**Standards resolution order** (manual):
|
|
107
|
-
1. `.morph/context/*.md` — project overrides (maior prioridade)
|
|
108
|
-
2. `.morph/framework/standards/` — standards instalados pelo morph-spec
|
|
109
|
-
3. `framework/standards/` — standards do pacote npm (fallback)
|
|
102
|
+
**To load standards for detected agents:**
|
|
103
|
+
- For each active agent, read the standards referenced by the `standards[]` field in `agents.json`
|
|
104
|
+
- Standard files are located at `.morph/framework/standards/{path}`
|
|
110
105
|
|
|
111
|
-
**
|
|
112
|
-
|
|
113
|
-
|
|
106
|
+
**Standards resolution order:**
|
|
107
|
+
1. `.morph/context/*.md` — project overrides (highest priority)
|
|
108
|
+
2. `.morph/framework/standards/` — standards installed by morph-spec
|
|
109
|
+
3. `framework/standards/` — npm package standards (fallback)
|
|
114
110
|
|
|
115
|
-
###
|
|
111
|
+
### Step 2.5: Validate MCP Connections
|
|
116
112
|
|
|
117
|
-
|
|
113
|
+
Check that configured MCPs are working before proceeding.
|
|
118
114
|
|
|
119
|
-
**1.
|
|
120
|
-
-
|
|
121
|
-
-
|
|
115
|
+
**1. Collect recommended MCPs:**
|
|
116
|
+
- Read `framework/phases.json` → for each phase in the feature's workflow, collect `recommendedMCPs[]`
|
|
117
|
+
- Read `framework/skills/level-0-meta/mcp-registry.json` → get `healthCheck` for each MCP
|
|
122
118
|
|
|
123
|
-
**2.
|
|
124
|
-
-
|
|
119
|
+
**2. Identify configured MCPs:**
|
|
120
|
+
- Read `.claude/settings.local.json` → identify which MCPs are in `mcpServers`
|
|
125
121
|
|
|
126
|
-
**3.
|
|
127
|
-
1.
|
|
128
|
-
2.
|
|
129
|
-
3.
|
|
122
|
+
**3. For each MCP that is CONFIGURED AND RECOMMENDED:**
|
|
123
|
+
1. Search your available tools for one containing `healthCheck.toolPattern` in the name
|
|
124
|
+
2. If the tool exists → execute the `healthCheck.testCall` with `healthCheck.testParams`
|
|
125
|
+
3. Evaluate the result:
|
|
130
126
|
|
|
131
|
-
|
|
|
132
|
-
|
|
133
|
-
| **
|
|
134
|
-
| **
|
|
135
|
-
| **
|
|
127
|
+
| Result | Action |
|
|
128
|
+
|--------|--------|
|
|
129
|
+
| **Success** | `✓ {MCP} — connection verified` |
|
|
130
|
+
| **Tool not found** | `○ {MCP} — needs restart to activate` |
|
|
131
|
+
| **Error** | → Use `AskUserQuestion` with 3 options (below) |
|
|
136
132
|
|
|
137
|
-
**
|
|
133
|
+
**On error — ask the user:**
|
|
138
134
|
|
|
139
|
-
Use `AskUserQuestion`
|
|
140
|
-
- **
|
|
141
|
-
- **
|
|
142
|
-
- **
|
|
135
|
+
Use `AskUserQuestion` with header `"{MCP}"` and options:
|
|
136
|
+
- **Continue without {MCP}** — show the `fallback` field from the registry and proceed
|
|
137
|
+
- **Reconfigure credentials** — collect new credentials and update `.claude/settings.local.json`
|
|
138
|
+
- **Stop setup** — abort and report what needs to be fixed
|
|
143
139
|
|
|
144
|
-
**4.
|
|
145
|
-
- Print `△ {MCP} —
|
|
146
|
-
-
|
|
140
|
+
**4. For MCPs RECOMMENDED but NOT CONFIGURED:**
|
|
141
|
+
- Print `△ {MCP} — not configured (fallback: {registry.fallback})`
|
|
142
|
+
- Suggestion: `Tip: configure with /morph:init refresh or npx morph-spec mcp setup`
|
|
147
143
|
|
|
148
|
-
**
|
|
144
|
+
**Summary:** Show a status table for each MCP before proceeding:
|
|
149
145
|
```
|
|
150
146
|
MCP Readiness:
|
|
151
|
-
✓ context7 —
|
|
152
|
-
○ playwright —
|
|
153
|
-
△ supabase —
|
|
147
|
+
✓ context7 — connection verified
|
|
148
|
+
○ playwright — needs restart
|
|
149
|
+
△ supabase — not configured (fallback: Grep + Read for schema)
|
|
154
150
|
```
|
|
155
151
|
|
|
156
152
|
---
|
|
157
153
|
|
|
158
|
-
###
|
|
154
|
+
### Step 3: Confirm Stack
|
|
159
155
|
|
|
160
|
-
|
|
161
|
-
-
|
|
162
|
-
-
|
|
163
|
-
-
|
|
156
|
+
Based on the proposal and context, confirm:
|
|
157
|
+
- Tech stack (Blazor Server, Next.js, .NET API, Node.js CLI, etc.)
|
|
158
|
+
- Applicable architectural patterns
|
|
159
|
+
- Existing reusable components
|
|
164
160
|
|
|
165
|
-
###
|
|
161
|
+
### Step 4: List Active Agents and Dispatch Preview
|
|
166
162
|
|
|
167
|
-
|
|
163
|
+
Show the agents detected from the proposal:
|
|
168
164
|
|
|
169
165
|
```bash
|
|
170
166
|
npx morph-spec state get $ARGUMENTS
|
|
171
167
|
```
|
|
172
168
|
|
|
173
|
-
Parse
|
|
169
|
+
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).
|
|
174
170
|
|
|
175
|
-
**
|
|
171
|
+
**If there are 2+ specialist agents active**, show the dispatch plan for the next phase:
|
|
176
172
|
|
|
177
173
|
```bash
|
|
178
174
|
npx morph-spec dispatch-agents $ARGUMENTS design
|
|
179
175
|
```
|
|
180
176
|
|
|
181
|
-
|
|
177
|
+
This shows which agents will be dispatched in parallel during the design phase and which tasks they'll execute.
|
|
182
178
|
|
|
183
|
-
> **
|
|
184
|
-
>
|
|
185
|
-
>
|
|
179
|
+
> **Important mapping:** `agents[].id` from the dispatch config = `subagent_type` in the `Agent` tool.
|
|
180
|
+
> Example: `id: "nextjs-expert"` → `Agent(subagent_type=nextjs-expert, prompt=agent.taskPrompt)`.
|
|
181
|
+
> Each `id` corresponds to the `name:` field in the frontmatter of the file in `.claude/agents/`.
|
|
186
182
|
|
|
187
|
-
###
|
|
183
|
+
### Step 5: Update State and Determine Next Phase
|
|
188
184
|
|
|
189
|
-
|
|
185
|
+
Update the feature state:
|
|
190
186
|
|
|
191
187
|
```bash
|
|
192
188
|
npx morph-spec state set $ARGUMENTS status in_progress
|
|
193
189
|
```
|
|
194
190
|
|
|
195
|
-
|
|
191
|
+
**Determine the next phase** based on active agents:
|
|
196
192
|
|
|
197
|
-
|
|
193
|
+
| Condition | Next Phase |
|
|
194
|
+
|-----------|------------|
|
|
195
|
+
| `ui-designer` is in activeAgents | **uiux** (UI/UX phase) |
|
|
196
|
+
| `ui-designer` is NOT in activeAgents | **design** (skip uiux) |
|
|
198
197
|
|
|
199
|
-
|
|
200
|
-
- Nome do projeto
|
|
201
|
-
- Stack confirmado
|
|
202
|
-
- Standards aplicáveis
|
|
198
|
+
Announce the next phase clearly to the user.
|
|
203
199
|
|
|
204
|
-
|
|
205
|
-
- Lista de agentes com emojis
|
|
206
|
-
- Responsabilidades de cada um
|
|
200
|
+
## Outputs
|
|
207
201
|
|
|
208
|
-
|
|
202
|
+
Present to the user:
|
|
209
203
|
|
|
210
|
-
|
|
211
|
-
-
|
|
212
|
-
-
|
|
213
|
-
-
|
|
214
|
-
- [x] State atualizado para phase: setup
|
|
204
|
+
1. **Context loaded**:
|
|
205
|
+
- Project name
|
|
206
|
+
- Confirmed stack
|
|
207
|
+
- Applicable standards
|
|
215
208
|
|
|
216
|
-
|
|
209
|
+
2. **Active agents**:
|
|
210
|
+
- Agent list with emojis/icons and tier
|
|
211
|
+
- Responsibilities of each agent
|
|
217
212
|
|
|
218
|
-
|
|
213
|
+
3. **Next phase**:
|
|
214
|
+
- Which phase comes next (uiux or design)
|
|
215
|
+
- Why (ui-designer presence or absence)
|
|
219
216
|
|
|
220
|
-
|
|
217
|
+
## Advancement Criteria
|
|
221
218
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
219
|
+
- [x] Project context loaded
|
|
220
|
+
- [x] Standards identified (framework + project)
|
|
221
|
+
- [x] Stack confirmed
|
|
222
|
+
- [x] Agents listed with icons
|
|
223
|
+
- [x] State updated to in_progress
|
|
224
|
+
- [x] Next phase determined
|
|
225
225
|
|
|
226
226
|
---
|
|
227
227
|
|
|
228
|
-
##
|
|
228
|
+
## Superpowers Integration
|
|
229
229
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
230
|
+
> Available when the `superpowers` plugin is installed.
|
|
231
|
+
|
|
232
|
+
| Skill | When to Use | Invocation |
|
|
233
|
+
|-------|-------------|-----------|
|
|
234
|
+
| `using-git-worktrees` | If the feature requires workspace isolation | `Skill(superpowers:using-git-worktrees)` |
|
|
235
235
|
|
|
236
236
|
---
|
|
237
237
|
|
|
238
|
-
|
|
238
|
+
Continue automatically to the next phase (UI/UX if ui-designer detected, otherwise Design).
|