@polymorphism-tech/morph-spec 4.9.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.
Files changed (164) hide show
  1. package/README.md +2 -2
  2. package/bin/morph-spec.js +30 -0
  3. package/bin/task-manager.js +34 -22
  4. package/claude-plugin.json +1 -1
  5. package/docs/CHEATSHEET.md +1 -1
  6. package/docs/QUICKSTART.md +1 -1
  7. package/framework/CLAUDE.md +35 -98
  8. package/framework/agents/backend/api-designer.md +3 -0
  9. package/framework/agents/backend/dotnet-senior.md +3 -0
  10. package/framework/agents/backend/ef-modeler.md +2 -0
  11. package/framework/agents/backend/hangfire-orchestrator.md +2 -0
  12. package/framework/agents/backend/ms-agent-expert.md +2 -0
  13. package/framework/agents/frontend/blazor-builder.md +2 -0
  14. package/framework/agents/frontend/nextjs-expert.md +2 -0
  15. package/framework/agents/infrastructure/azure-architect.md +2 -0
  16. package/framework/agents/infrastructure/azure-deploy-specialist.md +2 -0
  17. package/framework/agents/infrastructure/bicep-architect.md +2 -0
  18. package/framework/agents/infrastructure/container-specialist.md +2 -0
  19. package/framework/agents/infrastructure/devops-engineer.md +3 -0
  20. package/framework/agents/infrastructure/infra-architect.md +3 -0
  21. package/framework/agents/integrations/asaas-financial.md +2 -0
  22. package/framework/agents/integrations/azure-identity.md +2 -0
  23. package/framework/agents/integrations/clerk-auth.md +3 -0
  24. package/framework/agents/integrations/hangfire-integration.md +2 -0
  25. package/framework/agents/integrations/resend-email.md +2 -0
  26. package/framework/agents.json +37 -7
  27. package/framework/commands/commit.md +166 -0
  28. package/framework/commands/morph-apply.md +156 -155
  29. package/framework/commands/morph-archive.md +33 -27
  30. package/framework/commands/morph-infra.md +83 -77
  31. package/framework/commands/morph-preflight.md +97 -55
  32. package/framework/commands/morph-proposal.md +131 -58
  33. package/framework/commands/morph-status.md +36 -30
  34. package/framework/commands/morph-troubleshoot.md +68 -59
  35. package/framework/hooks/claude-code/notification/approval-reminder.js +3 -2
  36. package/framework/hooks/claude-code/post-tool-use/dispatch.js +154 -31
  37. package/framework/hooks/claude-code/post-tool-use/skill-reminder.js +7 -84
  38. package/framework/hooks/claude-code/post-tool-use/validator-feedback.js +8 -17
  39. package/framework/hooks/claude-code/pre-compact/save-morph-context.js +16 -3
  40. package/framework/hooks/claude-code/pre-tool-use/enforce-phase-writes.js +4 -3
  41. package/framework/hooks/claude-code/pre-tool-use/protect-spec-files.js +3 -2
  42. package/framework/hooks/claude-code/pre-tool-use/task-tracking-guard.js +60 -0
  43. package/framework/hooks/claude-code/session-start/inject-morph-context.js +55 -2
  44. package/framework/hooks/claude-code/session-start/post-compact-restore.js +41 -0
  45. package/framework/hooks/claude-code/stop/validate-completion.js +2 -15
  46. package/framework/hooks/claude-code/user-prompt/enrich-prompt.js +23 -5
  47. package/framework/hooks/shared/compact-restore.js +100 -0
  48. package/framework/hooks/shared/dispatch-helpers.js +116 -0
  49. package/framework/hooks/shared/phase-utils.js +9 -5
  50. package/framework/hooks/shared/state-reader.js +27 -3
  51. package/framework/phases.json +30 -7
  52. package/framework/rules/csharp-standards.md +3 -0
  53. package/framework/rules/frontend-standards.md +2 -0
  54. package/framework/rules/infrastructure-standards.md +3 -0
  55. package/framework/rules/morph-workflow.md +143 -86
  56. package/framework/rules/nextjs-standards.md +2 -0
  57. package/framework/rules/testing-standards.md +3 -0
  58. package/framework/skills/level-0-meta/mcp-registry.json +86 -51
  59. package/framework/skills/level-0-meta/morph-brainstorming/SKILL.md +139 -0
  60. package/framework/skills/level-0-meta/morph-checklist/SKILL.md +42 -19
  61. package/framework/skills/level-0-meta/{code-review → morph-code-review}/SKILL.md +8 -5
  62. package/framework/skills/level-0-meta/{code-review-nextjs → morph-code-review-nextjs}/SKILL.md +8 -6
  63. package/framework/skills/level-0-meta/morph-frontend-review/SKILL.md +362 -0
  64. package/framework/skills/level-0-meta/morph-init/SKILL.md +114 -20
  65. package/framework/skills/level-0-meta/morph-post-implementation/SKILL.md +362 -0
  66. package/framework/skills/level-0-meta/morph-replicate/SKILL.md +95 -87
  67. package/framework/skills/level-0-meta/{simulation-checklist → morph-simulation-checklist}/SKILL.md +24 -0
  68. package/framework/skills/level-0-meta/{tool-usage-guide → morph-tool-usage-guide}/SKILL.md +43 -43
  69. package/framework/skills/level-0-meta/{tool-usage-guide → morph-tool-usage-guide}/references/tools-per-phase.md +1 -2
  70. package/framework/skills/level-0-meta/{verification-before-completion → morph-verification-before-completion}/SKILL.md +23 -12
  71. package/framework/skills/level-0-meta/{verification-before-completion → morph-verification-before-completion}/scripts/check-phase-outputs.mjs +2 -2
  72. package/framework/skills/level-1-workflows/morph-phase-clarify/SKILL.md +247 -0
  73. package/framework/skills/level-1-workflows/morph-phase-codebase-analysis/SKILL.md +270 -0
  74. package/framework/skills/level-1-workflows/morph-phase-design/SKILL.md +499 -0
  75. package/framework/skills/level-1-workflows/morph-phase-implement/.morph/logs/activity.json +38 -0
  76. package/framework/skills/level-1-workflows/morph-phase-implement/SKILL.md +472 -0
  77. package/framework/skills/level-1-workflows/morph-phase-implement/prompts/code-quality-reviewer-prompt.md +50 -0
  78. package/framework/skills/level-1-workflows/morph-phase-implement/prompts/implementer-prompt.md +45 -0
  79. package/framework/skills/level-1-workflows/morph-phase-implement/prompts/spec-reviewer-prompt.md +47 -0
  80. package/framework/skills/level-1-workflows/morph-phase-plan/SKILL.md +246 -0
  81. package/framework/skills/level-1-workflows/morph-phase-setup/SKILL.md +238 -0
  82. package/framework/skills/level-1-workflows/morph-phase-tasks/.morph/logs/activity.json +14 -0
  83. package/framework/skills/level-1-workflows/morph-phase-tasks/SKILL.md +312 -0
  84. package/framework/skills/level-1-workflows/{phase-tasks → morph-phase-tasks}/scripts/validate-tasks.mjs +3 -3
  85. package/framework/skills/level-1-workflows/morph-phase-uiux/SKILL.md +324 -0
  86. package/framework/skills/level-1-workflows/morph-scope-escalation/SKILL.md +146 -0
  87. package/framework/standards/integration/mcp/mcp-tools.md +25 -7
  88. package/framework/templates/docs/onboarding.md +2 -2
  89. package/package.json +3 -4
  90. package/src/commands/agents/dispatch-agents.js +50 -3
  91. package/src/commands/mcp/mcp-setup.js +39 -2
  92. package/src/commands/phase/phase-reset.js +74 -0
  93. package/src/commands/project/doctor.js +26 -7
  94. package/src/commands/project/update.js +4 -4
  95. package/src/commands/scope/escalate.js +215 -0
  96. package/src/commands/state/advance-phase.js +27 -53
  97. package/src/commands/state/state.js +1 -1
  98. package/src/commands/task/expand.js +100 -0
  99. package/src/core/paths/output-schema.js +4 -3
  100. package/src/core/state/phase-state-machine.js +7 -4
  101. package/src/core/state/state-manager.js +4 -3
  102. package/src/lib/detectors/claude-config-detector.js +93 -347
  103. package/src/lib/detectors/design-system-detector.js +189 -189
  104. package/src/lib/detectors/index.js +155 -57
  105. package/src/lib/generators/context-generator.js +2 -2
  106. package/src/lib/installers/mcp-installer.js +37 -5
  107. package/src/lib/phase-chain/phase-validator.js +22 -16
  108. package/src/lib/scope/impact-analyzer.js +106 -0
  109. package/src/lib/stack-filter.js +58 -0
  110. package/src/lib/tasks/task-parser.js +1 -1
  111. package/src/lib/validators/shared/emit-validator-dispatch.js +64 -0
  112. package/src/scripts/setup-infra.js +68 -18
  113. package/src/utils/agents-installer.js +51 -17
  114. package/src/utils/claude-md-injector.js +90 -0
  115. package/src/utils/file-copier.js +0 -1
  116. package/src/utils/hooks-installer.js +16 -5
  117. package/src/utils/skills-installer.js +67 -7
  118. package/CLAUDE.md +0 -98
  119. package/framework/memory/patterns-learned.md +0 -766
  120. package/framework/skills/level-0-meta/brainstorming/SKILL.md +0 -137
  121. package/framework/skills/level-0-meta/frontend-review/SKILL.md +0 -359
  122. package/framework/skills/level-0-meta/post-implementation/SKILL.md +0 -362
  123. package/framework/skills/level-0-meta/terminal-title/SKILL.md +0 -61
  124. package/framework/skills/level-0-meta/terminal-title/scripts/set_title.sh +0 -65
  125. package/framework/skills/level-1-workflows/phase-clarify/SKILL.md +0 -216
  126. package/framework/skills/level-1-workflows/phase-codebase-analysis/SKILL.md +0 -252
  127. package/framework/skills/level-1-workflows/phase-design/SKILL.md +0 -383
  128. package/framework/skills/level-1-workflows/phase-implement/SKILL.md +0 -492
  129. package/framework/skills/level-1-workflows/phase-setup/SKILL.md +0 -195
  130. package/framework/skills/level-1-workflows/phase-tasks/SKILL.md +0 -271
  131. package/framework/skills/level-1-workflows/phase-uiux/SKILL.md +0 -286
  132. package/src/commands/project/index.js +0 -8
  133. package/src/core/index.js +0 -10
  134. package/src/core/state/index.js +0 -8
  135. package/src/core/templates/index.js +0 -9
  136. package/src/core/templates/template-data-sources.js +0 -325
  137. package/src/core/workflows/index.js +0 -7
  138. package/src/lib/detectors/config-detector.js +0 -223
  139. package/src/lib/detectors/standards-generator.js +0 -335
  140. package/src/lib/detectors/structure-detector.js +0 -275
  141. package/src/lib/monitor/agent-resolver.js +0 -144
  142. package/src/lib/monitor/renderer.js +0 -230
  143. package/src/lib/orchestration/index.js +0 -7
  144. package/src/lib/orchestration/team-orchestrator.js +0 -404
  145. package/src/sanitizer/context-sanitizer.js +0 -221
  146. package/src/sanitizer/patterns.js +0 -163
  147. package/src/writer/file-writer.js +0 -86
  148. /package/framework/skills/level-0-meta/{brainstorming → morph-brainstorming}/references/proposal-example.md +0 -0
  149. /package/framework/skills/level-0-meta/{code-review → morph-code-review}/references/review-example.md +0 -0
  150. /package/framework/skills/level-0-meta/{code-review → morph-code-review}/references/review-guidelines.md +0 -0
  151. /package/framework/skills/level-0-meta/{code-review → morph-code-review}/scripts/scan-csharp.mjs +0 -0
  152. /package/framework/skills/level-0-meta/{code-review-nextjs → morph-code-review-nextjs}/references/review-example-nextjs.md +0 -0
  153. /package/framework/skills/level-0-meta/{code-review-nextjs → morph-code-review-nextjs}/scripts/scan-nextjs.mjs +0 -0
  154. /package/framework/skills/level-0-meta/{frontend-review → morph-frontend-review}/scripts/scan-accessibility.mjs +0 -0
  155. /package/framework/skills/level-0-meta/{post-implementation → morph-post-implementation}/scripts/detect-dev-server.mjs +0 -0
  156. /package/framework/skills/level-0-meta/{post-implementation → morph-post-implementation}/scripts/detect-stack.mjs +0 -0
  157. /package/framework/skills/level-1-workflows/{phase-clarify → morph-phase-clarify}/references/clarifications-example.md +0 -0
  158. /package/framework/skills/level-1-workflows/{phase-design → morph-phase-design}/references/architecture-analysis-guide.md +0 -0
  159. /package/framework/skills/level-1-workflows/{phase-design → morph-phase-design}/references/spec-authoring-guide.md +0 -0
  160. /package/framework/skills/level-1-workflows/{phase-design → morph-phase-design}/references/spec-example.md +0 -0
  161. /package/framework/skills/level-1-workflows/{phase-implement → morph-phase-implement}/references/recap-example.md +0 -0
  162. /package/framework/skills/level-1-workflows/{phase-implement → morph-phase-implement}/references/vsa-implementation-guide.md +0 -0
  163. /package/framework/skills/level-1-workflows/{phase-tasks → morph-phase-tasks}/references/task-planning-patterns.md +0 -0
  164. /package/framework/skills/level-1-workflows/{phase-tasks → morph-phase-tasks}/references/tasks-example.md +0 -0
@@ -1,122 +1,195 @@
1
+ ---
2
+ description: MORPH Spec Pipeline — creates or resumes feature planning through phases 0-6 with mandatory approval pauses. Use whenever the user wants to plan, spec, or design a new feature, or when they say /morph-proposal. This is the primary entry point for all MORPH-SPEC feature work.
3
+ argument-hint: <feature-name>
4
+ allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
5
+ ---
6
+
1
7
  # MORPH Spec Pipeline
2
8
 
3
- Crie ou retome o planejamento de uma feature, guiando automaticamente pelas fases 0→4 com pausas obrigatórias.
9
+ Guide a feature through the full planning pipeline (proposal through tasks) with mandatory approval pauses at each gate.
4
10
 
5
11
  ---
6
12
 
7
13
  ## 1. Resume Logic
8
14
 
9
- Primeiro, verifique se a feature existe:
15
+ Check if the feature already has state:
10
16
 
11
17
  ```bash
12
18
  npx morph-spec state get {feature-name}
13
19
  ```
14
20
 
15
- - **Se existe:** Identifique a fase atual e retome de onde parou (pular fases já concluídas)
16
- - **Se não existe:** Iniciar do zero (FASE 0)
21
+ - **Exists:** Read the current phase and resume from where it stopped (skip completed phases)
22
+ - **Does not exist:** Start from scratch (PHASE 0)
17
23
 
18
24
  ---
19
25
 
20
- ## 2. FASE 0: PROPOSAL
26
+ ## 2. PHASE 0: PROPOSAL
27
+
28
+ ### Step 1: Load project context
29
+
30
+ Read these files to understand the project before writing anything:
31
+ - `.morph/context/README.md` — project overview, tech stack, architecture
32
+ - `.morph/config/config.json` — project configuration (language, workflow, architecture style)
33
+
34
+ ### Step 2: Detect agents
35
+
36
+ Read `framework/agents.json` (or `.morph/framework/agents.json` in client projects). For each agent:
37
+ 1. Check if `always_active: true` — include automatically
38
+ 2. Compare agent `keywords[]` and `domains[]` against the feature description — include on match
39
+ 3. **Document false-positive exclusions**: for agents that match on keywords but are irrelevant to this feature, note why they were excluded (this helps audit agent selection later)
40
+
41
+ Register each selected agent:
42
+ ```bash
43
+ npx morph-spec state add-agent {feature-name} {agent-id}
44
+ ```
45
+
46
+ ### Step 3: Determine if UI/UX phase is needed
47
+
48
+ If `ui-designer` is among the selected agents, the feature will trigger the UI/UX phase later. Note this decision — it affects the pipeline path.
49
+
50
+ ### Step 4: Create proposal
21
51
 
22
- ### Workflow
52
+ Read the proposal template at `framework/templates/docs/proposal.md` first, then create:
53
+
54
+ ```
55
+ .morph/features/{feature-name}/
56
+ 0-proposal/proposal.md
57
+ ```
23
58
 
24
- 1. **Detecte agentes automaticamente:**
25
- - Read `.morph/framework/agents.json`
26
- - Para cada agente, compare `domains` e `keywords` com a feature solicitada
27
- - Registre os agentes relevantes: `npx morph-spec state add-agent {feature-name} {agent-id}`
59
+ Fill every section of the template. In particular:
60
+ - **Metadata table**: date, author, status, priority, stack
61
+ - **Problem Statement**: use the What/Who/Impact structure from the template
62
+ - **Proposed Solution**: technical approach, key features, user journey
63
+ - **Success Metrics**: quantified current vs target values
64
+ - **Scope**: explicit In Scope, Out of Scope, and Future Considerations
65
+ - **Risks**: table with likelihood, impact, mitigation
66
+ - **Dependencies**: checklist of prerequisites
67
+ - **Estimated Effort**: broken down by phase (in hours)
68
+ - **Questions & Clarifications**: seed 3-6 questions for the clarify phase — these become input for phase 3
28
69
 
29
- 2. **Invoque skills dos agentes detectados:**
30
- - Para agentes com `skillPath` em agents.json, consulte o Skill correspondente
31
- - Use conhecimento dos skills para enriquecer a proposta
70
+ ### Step 5: Register state
32
71
 
33
- 3. **Analise a solicitação** e identifique: problema, usuários afetados, impacto
72
+ ```bash
73
+ npx morph-spec state init {feature-name}
74
+ npx morph-spec state set {feature-name} status draft
75
+ npx morph-spec state mark-output {feature-name} proposal
76
+ ```
34
77
 
35
- 4. **Crie a estrutura:**
36
- ```
37
- .morph/features/{feature-name}/
38
- ├── 0-proposal/proposal.md
39
- ├── 1-design/spec.md (iniciar)
40
- └── 3-tasks/tasks.md (iniciar)
41
- ```
78
+ ### MANDATORY PAUSE
42
79
 
43
- 5. **Preencha `proposal.md`** baseado em `framework/templates/proposal.md`
80
+ Use `AskUserQuestion` to present the approval gate with these elements:
44
81
 
45
- 6. **Registre no state:**
46
- ```bash
47
- npx morph-spec state set {feature-name} status draft
48
- npx morph-spec state set {feature-name} phase proposal
49
- npx morph-spec state mark-output {feature-name} proposal
50
- # Adicionar cada agente detectado:
51
- npx morph-spec state add-agent {feature-name} {agent-id}
52
- ```
82
+ 1. **Proposal summary** — 3-4 sentence overview of what was proposed
83
+ 2. **Agents activated** — table showing agent ID, tier, role, and why selected
84
+ 3. **Effort estimate** total hours from the proposal
85
+ 4. **Key decisions pending** — 2-3 design decisions that will be resolved in the design phase
53
86
 
54
- ### PAUSA OBRIGATORIA
87
+ Options: Approve proposal / Request changes / Reject
55
88
 
56
- Apresente: resumo da proposta, agentes ativados, custo estimado, 3 itens de pausa.
89
+ After approval:
90
+ ```bash
91
+ npx morph-spec approve {feature-name} proposal
92
+ npx morph-spec phase advance {feature-name}
93
+ ```
57
94
 
58
95
  ---
59
96
 
60
- ## 3. Após Aprovação do Proposal → FASE 1: SETUP (auto, sem pausa)
97
+ ## 3. PHASE 1: SETUP (automatic, no pause)
61
98
 
62
- **Ler:** `.claude/skills/level-1-workflows/phase-setup.md` para instruções detalhadas.
99
+ Invoke the `morph-phase-setup` skill.
63
100
 
64
- Resumo: carregar contexto do projeto, confirmar stack, listar agentes ativos, atualizar state.
101
+ Summary: load project context, confirm stack, list active agents, update state.
65
102
 
66
- **Não pausa aqui.** Continuar automaticamente.
103
+ **No pause here.** Continue automatically to the next phase.
67
104
 
68
105
  ---
69
106
 
70
- ## 4. FASE 1.5: UI/UX (condicional)
107
+ ## 4. PHASE 1.5: UI/UX (conditional)
71
108
 
72
- Verificar se `uiux-designer` está nos `activeAgents`:
73
- - **Se SIM:** Ler `.claude/skills/level-1-workflows/phase-uiux.md` e executar. **PAUSA OBRIGATORIA** após gerar deliverables UI.
74
- - **Se NÃO:** Pular para FASE 2.
109
+ Check if `ui-designer` is in `activeAgents`:
110
+ - **Yes:** Invoke the `morph-phase-uiux` skill. **MANDATORY PAUSE** after generating UI deliverables.
111
+ - **No:** Skip to PHASE 2.
112
+
113
+ After approval:
114
+ ```bash
115
+ npx morph-spec approve {feature-name} uiux
116
+ npx morph-spec phase advance {feature-name}
117
+ ```
75
118
 
76
119
  ---
77
120
 
78
- ## 5. FASE 2: DESIGN
121
+ ## 5. PHASE 2: DESIGN
79
122
 
80
- **Ler:** `.claude/skills/level-1-workflows/phase-design.md` para instruções detalhadas.
123
+ Invoke the `morph-phase-design` skill.
81
124
 
82
- Resumo: gerar spec.md, contracts.cs, decisions.md com ADRs, estimar custos.
125
+ Summary: generate spec.md, contracts.cs (or contracts-vsa.cs for VSA), decisions.md with ADRs.
83
126
 
84
- ### PAUSA OBRIGATORIA
127
+ ### MANDATORY PAUSE
85
128
 
86
- Apresente: spec, contracts, decisions, custos. 3 itens de pausa (aprovar, ajustar escopo, modificar contracts).
129
+ Present: spec, contracts, decisions, effort estimate. Use `AskUserQuestion` with options: Approve design / Adjust scope / Modify contracts.
130
+
131
+ After approval:
132
+ ```bash
133
+ npx morph-spec approve {feature-name} design
134
+ npx morph-spec phase advance {feature-name}
135
+ ```
87
136
 
88
137
  ---
89
138
 
90
- ## 6. Após Aprovação do Design → FASE 3: CLARIFY (interativo)
139
+ ## 6. PHASE 3: CLARIFY (interactive)
91
140
 
92
- **Ler:** `.claude/skills/level-1-workflows/phase-clarify.md` para instruções detalhadas.
141
+ Invoke the `morph-phase-clarify` skill.
93
142
 
94
- Resumo: identificar ambiguidades, gerar 3-7 perguntas, aguardar respostas, atualizar spec com clarificações e edge cases.
143
+ Summary: identify ambiguities in spec.md, generate 3-7 targeted questions (building on the questions seeded in the proposal), wait for user answers, update spec with clarifications and edge cases.
95
144
 
96
- **Aguardar respostas do usuário antes de continuar.**
145
+ **Wait for user responses before continuing.**
97
146
 
98
147
  ---
99
148
 
100
- ## 7. FASE 4: TASKS
149
+ ## 7. PHASE 4: PLAN
150
+
151
+ Invoke the `morph-phase-plan` skill.
152
+
153
+ Summary: generate a detailed implementation plan with exact file paths, TDD structure, and context-aware execution strategy.
101
154
 
102
- **Ler:** `.claude/skills/level-1-workflows/phase-tasks.md` para instruções detalhadas.
155
+ ### MANDATORY PAUSE
103
156
 
104
- Resumo: quebrar spec em tasks T001-TXXX, definir dependências, checkpoints, estimativas.
157
+ Present: implementation plan with recommended strategy. Use `AskUserQuestion` with options: Approve plan / Adjust strategy / Modify plan.
105
158
 
106
- ### PAUSA OBRIGATORIA
159
+ After approval:
160
+ ```bash
161
+ npx morph-spec approve {feature-name} plan
162
+ npx morph-spec phase advance {feature-name}
163
+ ```
107
164
 
108
- Apresente: breakdown de tasks, ordem de execução, estimativa total. 3 itens de pausa (aprovar, repriorizar, adicionar/remover).
165
+ ---
166
+
167
+ ## 8. PHASE 5: TASKS
168
+
169
+ Invoke the `morph-phase-tasks` skill.
170
+
171
+ Summary: break spec into tasks T001-TXXX with dependencies, checkpoints, estimates.
172
+
173
+ ### MANDATORY PAUSE
174
+
175
+ Present: task breakdown, execution order, total estimate. Use `AskUserQuestion` with options: Approve tasks / Reprioritize / Add or remove tasks.
176
+
177
+ After approval:
178
+ ```bash
179
+ npx morph-spec approve {feature-name} tasks
180
+ npx morph-spec phase advance {feature-name}
181
+ ```
109
182
 
110
183
  ---
111
184
 
112
- ## 8. Planejamento Completo
185
+ ## 9. Planning Complete
113
186
 
114
- Após aprovação das tasks:
187
+ After task approval:
115
188
 
116
189
  ```
117
- Planejamento completo! Execute /morph-apply {feature-name} para iniciar implementação.
190
+ Planning complete! Run /morph-apply {feature-name} to start implementation.
118
191
  ```
119
192
 
120
193
  ---
121
194
 
122
- **Feature solicitada:** $ARGUMENTS
195
+ **Feature requested:** $ARGUMENTS
@@ -1,51 +1,57 @@
1
+ ---
2
+ description: Show current MORPH project status and all features in development with their phases and approvals
3
+ argument-hint: [feature-name]
4
+ allowed-tools: Read, Bash
5
+ ---
6
+
1
7
  # MORPH Project Status
2
8
 
3
- Mostre o status atual do projeto MORPH e features em desenvolvimento.
9
+ Show the current MORPH project status and features in development.
4
10
 
5
- ## Como Usar
11
+ ## Usage
6
12
 
7
- **SEMPRE** use o state-manager CLI para obter status:
13
+ **ALWAYS** use the state-manager CLI to get status:
8
14
 
9
15
  ```bash
10
16
  npx morph-spec state list
11
17
  ```
12
18
 
13
- Este comando automaticamente mostra:
14
- - Todas as features ativas
15
- - Fase atual de cada feature
16
- - Progresso de tasks (X/Y)
17
- - Agentes ativos
18
- - Custos estimados
19
+ This command automatically shows:
20
+ - All active features
21
+ - Current phase of each feature
22
+ - Task progress (X/Y)
23
+ - Active agents
24
+ - Estimated costs
19
25
 
20
- ## Verificações Adicionais
26
+ ## Additional Checks
21
27
 
22
- ### 1. Configuração MORPH
23
- - [ ] `.morph/project.md` existe e está preenchido
24
- - [ ] `.morph/config/config.json` configurado
25
- - [ ] `.morph/framework/standards/` presentes
28
+ ### 1. MORPH Configuration
29
+ - [ ] `.morph/project.md` exists and is filled in
30
+ - [ ] `.morph/config/config.json` configured
31
+ - [ ] `.morph/framework/standards/` present
26
32
 
27
- ### 2. Detalhes de Feature Específica
33
+ ### 2. Specific Feature Details
28
34
 
29
- Para obter JSON detalhado de uma feature:
35
+ To get detailed JSON for a feature:
30
36
 
31
37
  ```bash
32
38
  npx morph-spec state get {feature-name}
33
39
  ```
34
40
 
35
- ### 3. Features Arquivadas
41
+ ### 3. Archived Features
36
42
 
37
- Verifique `.morph/archive/` manualmente se necessário:
38
- - Quantas features concluídas
39
- - Tempo total gasto
40
- - Custo acumulado
43
+ Check `.morph/archive/` manually if needed:
44
+ - How many features completed
45
+ - Total time spent
46
+ - Accumulated cost
41
47
 
42
- ### 4. Specs Ativas
48
+ ### 4. Active Specs
43
49
 
44
- Verifique `.morph/specs/` para specs consolidadas.
50
+ Check `.morph/specs/` for consolidated specs.
45
51
 
46
52
  ## Output
47
53
 
48
- O comando `npx morph-spec state list` automaticamente gera um dashboard formatado:
54
+ The `npx morph-spec state list` command automatically generates a formatted dashboard:
49
55
 
50
56
  ```
51
57
  ╔════════════════════════════════════════════════════════════════╗
@@ -72,14 +78,14 @@ O comando `npx morph-spec state list` automaticamente gera um dashboard formatad
72
78
  ╚════════════════════════════════════════════════════════════════╝
73
79
  ```
74
80
 
75
- **Simplesmente execute o comando e mostre o resultado ao usuário.**
81
+ **Simply run the command and show the result to the user.**
76
82
 
77
- ## Ações Disponíveis
83
+ ## Available Actions
78
84
 
79
- Sugira próximas ações:
80
- - `/morph-proposal {feature}` - Criar nova feature
81
- - `/morph-apply {feature}` - Implementar feature
82
- - `/morph-archive {feature}` - Arquivar feature concluída
85
+ Suggest next actions:
86
+ - `/morph-proposal {feature}` - Create a new feature
87
+ - `/morph-apply {feature}` - Implement a feature
88
+ - `/morph-archive {feature}` - Archive a completed feature
83
89
 
84
90
  ---
85
91
 
@@ -1,121 +1,130 @@
1
- # Troubleshoot - Buscar Soluções para Erros
1
+ ---
2
+ description: Find solutions for common .NET/Blazor/Azure development errors with root-cause analysis
3
+ argument-hint: "[error-message]"
4
+ allowed-tools: Read, Bash, Glob, Grep
5
+ ---
6
+
7
+ # Troubleshoot - Find Solutions for Errors
2
8
 
3
- Busca soluções para erros e problemas comuns no desenvolvimento .NET/Blazor/Azure.
9
+ Find solutions for common .NET/Blazor/Azure development errors and problems.
4
10
 
5
- ## Uso
11
+ ## Usage
6
12
 
7
13
  ```
8
- /morph-troubleshoot <descrição do erro ou keywords>
14
+ /morph-troubleshoot <error description or keywords>
9
15
  ```
10
16
 
11
- ## Exemplos
17
+ ## Examples
12
18
 
13
19
  ```bash
14
20
  /morph-troubleshoot blazor.web.js 404
15
21
  /morph-troubleshoot DbContext second operation
16
22
  /morph-troubleshoot Azure.Identity NU1605
17
- /morph-troubleshoot Include retorna vazio
23
+ /morph-troubleshoot Include returns empty
18
24
  /morph-troubleshoot PendingModelChanges
19
25
  ```
20
26
 
21
- ## Workflow de 3 Níveis
27
+ ## 3-Level Workflow
22
28
 
23
- ### Nível 1: Índice JSON (Primário)
29
+ ### Level 1: Search Standards (Primary)
24
30
 
25
- Primeiro, execute o comando CLI para buscar no índice de problemas conhecidos:
31
+ Search the known problems and standards files for matching patterns:
26
32
 
27
33
  ```bash
28
- npx morph-spec troubleshoot {keywords}
29
-
30
- # Opções
31
- --category <cat> # Filtrar por categoria (blazor, efcore, azure)
32
- --verbose # Mostrar conteúdo completo da solução
33
- --list-categories # Listar categorias disponíveis
34
+ # Search in framework standards
35
+ Grep: "{keywords}" in framework/standards/ (glob: "*.md")
36
+ Grep: "{keywords}" in .morph/framework/standards/ (glob: "*.md")
34
37
  ```
35
38
 
36
- ### Nível 2: Grep nos Standards (Automático)
39
+ Read matching files and extract the relevant solution sections.
40
+
41
+ ### Level 2: Search Codebase (Automatic)
42
+
43
+ If standards don't cover the issue, search the codebase for the error pattern:
44
+
45
+ ```bash
46
+ Grep: "{error pattern}" in src/ (glob: "*.cs,*.tsx,*.ts")
47
+ ```
37
48
 
38
- Se o índice retornar poucos resultados, o CLI automaticamente busca nos arquivos:
39
- - `framework/standards/*.md`
40
- - `.morph/framework/standards/*.md`
49
+ Check if similar patterns exist elsewhere in the codebase that work correctly.
41
50
 
42
- ### Nível 3: Web Search (Se necessário)
51
+ ### Level 3: Web Search (If needed)
43
52
 
44
- **IMPORTANTE:** Se os níveis 1 e 2 não encontrarem solução, use o tool **WebSearch** nativo do Claude Code para buscar nas seguintes fontes:
53
+ **IMPORTANT:** If levels 1 and 2 don't find a solution, use Claude Code's native **WebSearch** tool to search the following sources:
45
54
 
46
- **Queries recomendadas:**
55
+ **Recommended queries:**
47
56
 
48
57
  ```
49
58
  # GitHub Issues (.NET)
50
- site:github.com/dotnet/aspnetcore {erro}
51
- site:github.com/dotnet/efcore {erro}
59
+ site:github.com/dotnet/aspnetcore {error}
60
+ site:github.com/dotnet/efcore {error}
52
61
 
53
62
  # Stack Overflow
54
- site:stackoverflow.com [blazor] {erro}
55
- site:stackoverflow.com [entity-framework-core] {erro}
56
- site:stackoverflow.com [azure] {erro}
63
+ site:stackoverflow.com [blazor] {error}
64
+ site:stackoverflow.com [entity-framework-core] {error}
65
+ site:stackoverflow.com [azure] {error}
57
66
 
58
- # Documentação Microsoft
59
- site:learn.microsoft.com {erro}
60
- site:learn.microsoft.com/azure {erro}
67
+ # Microsoft Documentation
68
+ site:learn.microsoft.com {error}
69
+ site:learn.microsoft.com/azure {error}
61
70
  ```
62
71
 
63
- **Exemplo de uso do WebSearch:**
72
+ **WebSearch usage example:**
64
73
 
65
- Se o usuário perguntar sobre um erro de SignalR:
66
- 1. Primeiro: `npx morph-spec troubleshoot SignalR connection`
67
- 2. Se não encontrar: WebSearch com `site:github.com/dotnet/aspnetcore SignalR connection closed`
68
- 3. Retornar links relevantes formatados
74
+ If the user asks about a SignalR error:
75
+ 1. First: `npx morph-spec troubleshoot SignalR connection`
76
+ 2. If not found: WebSearch with `site:github.com/dotnet/aspnetcore SignalR connection closed`
77
+ 3. Return formatted relevant links
69
78
 
70
- ## Categorias Disponíveis
79
+ ## Available Categories
71
80
 
72
- | Categoria | Descrição |
81
+ | Category | Description |
73
82
  |-----------|-----------|
74
- | `blazor` | Blazor Server/WASM, componentes, lifecycle, renderização |
83
+ | `blazor` | Blazor Server/WASM, components, lifecycle, rendering |
75
84
  | `efcore` | Entity Framework Core, DbContext, migrations, queries |
76
85
  | `azure` | Azure services, deploy, identity, Key Vault |
77
86
  | `auth` | Authentication, authorization, tokens, claims |
78
87
  | `deploy` | Deployment, CI/CD, pipelines, containers |
79
88
 
80
- ## Formato de Output
89
+ ## Output Format
81
90
 
82
- Ao encontrar uma solução, apresente no seguinte formato:
91
+ When finding a solution, present in the following format:
83
92
 
84
93
  ```
85
94
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
86
95
 
87
- 🔴 CRITICAL: {título do problema}
96
+ 🔴 CRITICAL: {problem title}
88
97
 
89
- 📁 Arquivo: {caminho do arquivo com solução}
90
- 📂 Seção: {seção específica}
98
+ 📁 File: {path to file with solution}
99
+ 📂 Section: {specific section}
91
100
 
92
- Erro:
93
- {padrão de erro que identifica o problema}
101
+ Error:
102
+ {error pattern that identifies the problem}
94
103
 
95
- 💡 Causa:
96
- {explicação da causa raiz}
104
+ 💡 Cause:
105
+ {root cause explanation}
97
106
 
98
- Solução:
99
- {código ou passos para resolver}
107
+ Solution:
108
+ {code or steps to resolve}
100
109
 
101
- 📚 Ver completo: morph-spec read {arquivo}
110
+ 📚 See full: morph-spec read {file}
102
111
 
103
112
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
104
113
  ```
105
114
 
106
- ## Troubleshooting Rápido
115
+ ## Quick Troubleshooting
107
116
 
108
- ### Problemas Mais Comuns
117
+ ### Most Common Problems
109
118
 
110
- | Erro | Solução Rápida |
119
+ | Error | Quick Fix |
111
120
  |------|----------------|
112
121
  | `blazor.web.js 404` | `<RequiresAspNetWebAssets>true</RequiresAspNetWebAssets>` |
113
- | `PendingModelChangesWarning` | `dotnet ef migrations add <Name>` antes de update |
114
- | `DbContext second operation` | Usar `IDbContextFactory` para background tasks |
115
- | `Include() vazio` | Usar `HasMany(x => x.Nav)` em vez de `HasMany<T>()` |
116
- | `Azure.Identity NU1605` | Especificar versão explícita no .csproj |
117
- | `Key Vault não carrega` | Não condicionar ao ambiente (IsDevelopment) |
118
- | `DefaultAzureCredential lento` | Desabilitar credenciais não usadas |
122
+ | `PendingModelChangesWarning` | `dotnet ef migrations add <Name>` before update |
123
+ | `DbContext second operation` | Use `IDbContextFactory` for background tasks |
124
+ | `Include()` empty | Use `HasMany(x => x.Nav)` instead of `HasMany<T>()` |
125
+ | `Azure.Identity NU1605` | Specify explicit version in .csproj |
126
+ | `Key Vault won't load` | Don't condition on environment (IsDevelopment) |
127
+ | `DefaultAzureCredential slow` | Disable unused credentials |
119
128
 
120
129
  ---
121
130
 
@@ -10,7 +10,7 @@
10
10
  * Fail-open: exits 0 on any error.
11
11
  */
12
12
 
13
- import { stateExists, getActiveFeature, getPendingGates } from '../../shared/state-reader.js';
13
+ import { stateExists, getActiveFeature, getPendingGates, derivePhaseForFeature } from '../../shared/state-reader.js';
14
14
  import { injectContext, pass } from '../../shared/hook-response.js';
15
15
  import { logHookActivity } from '../../shared/activity-logger.js';
16
16
 
@@ -36,7 +36,8 @@ try {
36
36
  implement: ['design', 'tasks']
37
37
  };
38
38
 
39
- const relevantGates = phaseGateRelevance[feature.phase] || [];
39
+ const currentPhase = feature.phase || derivePhaseForFeature(name);
40
+ const relevantGates = phaseGateRelevance[currentPhase] || [];
40
41
  const pendingRelevant = pending.filter(g => relevantGates.includes(g));
41
42
 
42
43
  if (pendingRelevant.length === 0) pass();