@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.
Files changed (71) hide show
  1. package/README.md +2 -2
  2. package/claude-plugin.json +1 -1
  3. package/docs/CHEATSHEET.md +1 -1
  4. package/docs/QUICKSTART.md +1 -1
  5. package/framework/CLAUDE.md +5 -69
  6. package/framework/agents/backend/api-designer.md +3 -0
  7. package/framework/agents/backend/dotnet-senior.md +3 -0
  8. package/framework/agents/backend/ef-modeler.md +2 -0
  9. package/framework/agents/backend/hangfire-orchestrator.md +2 -0
  10. package/framework/agents/backend/ms-agent-expert.md +2 -0
  11. package/framework/agents/frontend/blazor-builder.md +2 -0
  12. package/framework/agents/frontend/nextjs-expert.md +2 -0
  13. package/framework/agents/infrastructure/azure-architect.md +2 -0
  14. package/framework/agents/infrastructure/azure-deploy-specialist.md +2 -0
  15. package/framework/agents/infrastructure/bicep-architect.md +2 -0
  16. package/framework/agents/infrastructure/container-specialist.md +2 -0
  17. package/framework/agents/infrastructure/devops-engineer.md +3 -0
  18. package/framework/agents/infrastructure/infra-architect.md +3 -0
  19. package/framework/agents/integrations/asaas-financial.md +2 -0
  20. package/framework/agents/integrations/azure-identity.md +2 -0
  21. package/framework/agents/integrations/clerk-auth.md +3 -0
  22. package/framework/agents/integrations/hangfire-integration.md +2 -0
  23. package/framework/agents/integrations/resend-email.md +2 -0
  24. package/framework/commands/morph-apply.md +151 -161
  25. package/framework/commands/morph-archive.md +28 -28
  26. package/framework/commands/morph-infra.md +79 -79
  27. package/framework/commands/morph-preflight.md +92 -56
  28. package/framework/commands/morph-proposal.md +94 -70
  29. package/framework/commands/morph-status.md +31 -31
  30. package/framework/commands/morph-troubleshoot.md +63 -60
  31. package/framework/rules/csharp-standards.md +3 -0
  32. package/framework/rules/frontend-standards.md +2 -0
  33. package/framework/rules/infrastructure-standards.md +3 -0
  34. package/framework/rules/morph-workflow.md +57 -2
  35. package/framework/rules/nextjs-standards.md +2 -0
  36. package/framework/rules/testing-standards.md +3 -0
  37. package/framework/skills/level-0-meta/morph-brainstorming/SKILL.md +54 -49
  38. package/framework/skills/level-0-meta/morph-checklist/SKILL.md +42 -19
  39. package/framework/skills/level-0-meta/morph-code-review/SKILL.md +8 -5
  40. package/framework/skills/level-0-meta/morph-code-review-nextjs/SKILL.md +7 -5
  41. package/framework/skills/level-0-meta/morph-frontend-review/SKILL.md +139 -136
  42. package/framework/skills/level-0-meta/morph-init/SKILL.md +42 -13
  43. package/framework/skills/level-0-meta/morph-post-implementation/SKILL.md +130 -130
  44. package/framework/skills/level-0-meta/morph-replicate/SKILL.md +95 -87
  45. package/framework/skills/level-0-meta/morph-simulation-checklist/SKILL.md +24 -0
  46. package/framework/skills/level-0-meta/morph-tool-usage-guide/SKILL.md +42 -41
  47. package/framework/skills/level-0-meta/morph-verification-before-completion/SKILL.md +22 -11
  48. package/framework/skills/level-1-workflows/morph-phase-clarify/SKILL.md +123 -114
  49. package/framework/skills/level-1-workflows/morph-phase-codebase-analysis/SKILL.md +120 -102
  50. package/framework/skills/level-1-workflows/morph-phase-design/SKILL.md +206 -214
  51. package/framework/skills/level-1-workflows/morph-phase-implement/.morph/logs/activity.json +38 -0
  52. package/framework/skills/level-1-workflows/morph-phase-implement/SKILL.md +241 -360
  53. package/framework/skills/level-1-workflows/morph-phase-plan/SKILL.md +107 -115
  54. package/framework/skills/level-1-workflows/morph-phase-setup/SKILL.md +135 -135
  55. package/framework/skills/level-1-workflows/morph-phase-tasks/.morph/logs/activity.json +14 -0
  56. package/framework/skills/level-1-workflows/morph-phase-tasks/SKILL.md +143 -139
  57. package/framework/skills/level-1-workflows/morph-phase-uiux/SKILL.md +168 -165
  58. package/framework/skills/level-1-workflows/morph-scope-escalation/SKILL.md +57 -8
  59. package/package.json +3 -3
  60. package/src/commands/project/doctor.js +7 -2
  61. package/src/commands/project/update.js +4 -4
  62. package/src/lib/stack-filter.js +58 -0
  63. package/src/scripts/setup-infra.js +53 -18
  64. package/src/utils/agents-installer.js +19 -5
  65. package/src/utils/claude-md-injector.js +90 -0
  66. package/src/utils/hooks-installer.js +1 -4
  67. package/src/utils/skills-installer.js +67 -7
  68. package/CLAUDE.md +0 -98
  69. package/framework/memory/patterns-learned.md +0 -766
  70. package/framework/skills/level-0-meta/morph-terminal-title/SKILL.md +0 -61
  71. 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.0"
7
+ allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
8
+ cliVersion: "4.10.2"
9
9
  ---
10
10
 
11
- # MORPH Plan - FASE 4
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
- Gere um plano de implementacao detalhado com paths exatos, codigo TDD e estrategia de execucao.
15
+ Generate a detailed implementation plan with exact paths, TDD code, and execution strategy.
16
16
 
17
- ## Pre-requisitos
17
+ ## Prerequisites
18
18
 
19
- - [ ] FASE 3 (Clarify) concluida
20
- - [ ] `spec.md` atualizado com clarificacoes
21
- - [ ] `contracts.cs` ou `contracts.ts` definidos
19
+ - [ ] Phase 3 (Clarify) completed
20
+ - [ ] `spec.md` updated with clarifications
21
+ - [ ] `contracts.cs` or `contracts.ts` defined
22
22
 
23
- ## Ferramentas Recomendadas
23
+ ## Recommended Tools
24
24
 
25
- > **Ref:** `framework/skills/level-0-meta/morph-tool-usage-guide/SKILL.md` para guia completo.
25
+ > **Ref:** `framework/skills/level-0-meta/morph-tool-usage-guide/SKILL.md` for complete guide.
26
26
 
27
- | Acao | Ferramenta | Alternativa |
28
- |------|------------|-------------|
29
- | Ler spec + contracts + decisions | **Read** todos os outputs | --- |
30
- | Analisar codebase existente | **Glob** + **Grep** padroes | --- |
31
- | Consultar docs de libs | **Context7 MCP** `query_docs()` | **WebSearch** |
32
- | Dispatch agents para analise | **Bash** `npx morph-spec dispatch-agents $ARGUMENTS plan` | --- |
33
- | Atualizar state | **Bash** `npx morph-spec state mark-output $ARGUMENTS plan` | --- |
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-padroes:**
36
- - :x: Gerar plano sem ler contracts.cs (contracts sao a fonte de verdade!)
37
- - :x: Paths genericos ("adicione o arquivo") -- sempre paths exatos
38
- - :x: Codigo incompleto no plano ("adicione validacao") -- sempre codigo completo
39
- - :x: Pular analise de codebase existente (padroes existentes guiam o plano)
40
- - :x: Ignorar `config.architecture.style` -- VSA e DDD tem estruturas diferentes
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
- ## PRE-VOO OBRIGATORIO
44
+ ## Pre-flight
45
45
 
46
- ### 0. Garantir fase plan
46
+ ### 0. Ensure plan phase
47
47
 
48
48
  ```bash
49
49
  npx morph-spec state get $ARGUMENTS
50
50
  ```
51
51
 
52
- Verifique o campo `"phase"` no output:
53
- - `"phase": "plan"` -> fase correta, prossiga
54
- - qualquer outro valor -> execute `npx morph-spec phase advance $ARGUMENTS` e volte a verificar
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
- > **Regra:** Nunca escreva em `3-plan/` enquanto a fase nao for `plan`.
56
+ > **Rule:** Never write to `3-plan/` until the phase is `plan`.
57
57
 
58
- ### 1. Ler todos os prerequisitos em PARALELO
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 (se existir)
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
- ### Passo 1: Analisar Feature para Contexto
73
+ ### Step 1: Analyze Feature for Context
82
74
 
83
- 1. **Ler codebase existente** -- Glob para encontrar arquivos que serao modificados/criados
84
- 2. **Identificar padroes** -- Grep por padroes similares ao que sera implementado
85
- 3. **Verificar libs/frameworks** -- Context7 para docs das dependencias
86
- 4. **Detectar arquitetura:**
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
- | Valor de `config.architecture.style` | Caminho |
93
- |--------------------------------------|---------|
94
- | `"vertical-slice"` | -> Estrutura VSA: `Features/{Entity}Feature/{Op}/` |
95
- | qualquer outro valor | -> Estrutura DDD por layer |
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
- ### Passo 2: Determinar Estrategia de Execucao
89
+ ### Step 2: Determine Execution Strategy
98
90
 
99
- Execute a analise:
91
+ Run the dispatch analysis:
100
92
 
101
93
  ```bash
102
94
  npx morph-spec dispatch-agents $ARGUMENTS plan
103
95
  ```
104
96
 
105
- **Fatores para recomendacao:**
97
+ **Factors for recommendation:**
106
98
 
107
- | Fator | Calculo |
108
- |-------|---------|
109
- | `taskCount` | Numero de requisitos funcionais + componentes tecnicos no spec |
110
- | `domainCount` | Dominios distintos nos activeAgents (backend, frontend, infra) |
111
- | `agentCount` | Total de activeAgents |
112
- | `independence` | % de tasks sem dependencias cross-domain |
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
- **Decisao:**
106
+ **Decision:**
115
107
 
116
- | Cenario | Recomendacao |
117
- |---------|--------------|
118
- | `taskCount < 8` AND `domainCount <= 2` | **Single session** -- implementacao direta |
119
- | `taskCount 8-20` AND `domainCount 2-3` | **Subagent-Driven** -- um subagent morph por grupo |
120
- | `taskCount > 20` OR `domainCount > 3` | **Agent Teams** -- coordenacao multi-dominio |
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
- ### Passo 3: Gerar `plan.md`
114
+ ### Step 3: Generate `plan.md`
123
115
 
124
- Crie `.morph/features/$ARGUMENTS/3-plan/plan.md` com a estrutura:
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:** {Uma frase descrevendo o que sera construido}
123
+ **Goal:** {One sentence describing what will be built}
132
124
 
133
- **Architecture:** {2-3 frases sobre a abordagem}
125
+ **Architecture:** {2-3 sentences about the approach}
134
126
 
135
- **Tech Stack:** {Tecnologias chave}
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} --- {Nome do Grupo}
133
+ ## GROUP {A} {Group Name}
142
134
 
143
- {Padrao e contexto do grupo}
135
+ {Pattern and context for the group}
144
136
 
145
- ### {A1} --- {Nome da task}
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
- (Codigo completo do teste)
146
+ (Complete test code)
155
147
 
156
148
  **Step 2: Run test to verify it fails**
157
149
 
158
- Run: `{comando exato}`
159
- Expected: FAIL with "{mensagem}"
150
+ Run: `{exact command}`
151
+ Expected: FAIL with "{message}"
160
152
 
161
153
  **Step 3: Write minimal implementation**
162
154
 
163
- (Codigo completo da implementacao)
155
+ (Complete implementation code)
164
156
 
165
157
  **Step 4: Run test to verify it passes**
166
158
 
167
- Run: `{comando exato}`
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 "{mensagem}"
165
+ git commit -m "{message}"
174
166
  ```
175
167
 
176
- **Regras obrigatorias:**
177
- - Paths exatos SEMPRE (nunca genericos)
178
- - Codigo COMPLETO no plano (nunca "adicione validacao")
179
- - Comandos exatos com output esperado
180
- - DRY, YAGNI, TDD, commits frequentes
181
- - Cada step e uma acao de 2-5 minutos
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
- ### Passo 4: Atualizar State
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
- ## PAUSA OBRIGATORIA
183
+ ## Mandatory Approval Pause
192
184
 
193
- Use `AskUserQuestion` para capturar aprovacao:
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": "Aprovacao",
200
- "question": "Plano de implementacao gerado. Aprovar para iniciar task breakdown?",
191
+ "header": "Approval",
192
+ "question": "Implementation plan generated. Approve to start task breakdown?",
201
193
  "multiSelect": false,
202
194
  "options": [
203
- { "label": "Aprovar plano", "description": "Avancar para fase de task breakdown" },
204
- { "label": "Tenho feedback", "description": "Digite o que deseja mudar no campo abaixo (Other)" }
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": "Execucao",
209
- "question": "Qual estrategia de execucao para implementacao?",
200
+ "header": "Execution",
201
+ "question": "Which execution strategy for implementation?",
210
202
  "multiSelect": false,
211
203
  "options": [
212
- { "label": "{Recomendacao} (Recommended)", "description": "{Justificativa baseada na analise do Passo 2}" },
213
- { "label": "{Alternativa 1}", "description": "{Descricao}" },
214
- { "label": "{Alternativa 2}", "description": "{Descricao}" }
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
- > A primeira opcao de "Execucao" deve ser a recomendacao context-aware calculada no Passo 2. As alternativas sao as outras estrategias.
213
+ > The first "Execution" option should be the context-aware recommendation from Step 2. Alternatives are the other strategies.
222
214
 
223
- - **"Aprovar plano"** -> execute:
224
- ```bash
225
- npx morph-spec approve $ARGUMENTS plan
226
- npx morph-spec phase advance $ARGUMENTS
227
- ```
228
- - **"Tenho feedback" ou "Other"** -> aplique o feedback recebido e repita esta PAUSA
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 desta Fase
224
+ ## Phase Outputs
233
225
 
234
226
  <!-- morph:outputs:plan -->
235
- | Output | Caminho |
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
- ## Criterios de Avanco
234
+ ## Advancement Criteria
243
235
 
244
- - [x] `plan.md` criado com todos os grupos e tasks
245
- - [x] Paths exatos para todos os arquivos
246
- - [x] Codigo completo em cada step
247
- - [x] Comandos de teste com output esperado
248
- - [x] Estrategia de execucao definida e aprovada
249
- - [x] State atualizado (`mark-output plan`)
250
- - [x] Usuario aprovou plano
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
- Apos aprovacao: prosseguir automaticamente para FASE 5 (Tasks).
246
+ After approval: proceed automatically to Phase 5 (Tasks).