@polymorphism-tech/morph-spec 4.8.19 → 4.10.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/CLAUDE.md +21 -0
- package/README.md +2 -2
- package/bin/morph-spec.js +44 -55
- package/bin/task-manager.js +133 -20
- package/bin/validate.js +67 -33
- package/claude-plugin.json +1 -1
- package/docs/CHEATSHEET.md +201 -203
- package/docs/QUICKSTART.md +2 -2
- package/framework/CLAUDE.md +99 -77
- package/framework/agents.json +734 -182
- package/framework/commands/commit.md +166 -0
- package/framework/commands/morph-apply.md +13 -2
- package/framework/commands/morph-archive.md +8 -2
- package/framework/commands/morph-infra.md +6 -0
- package/framework/commands/morph-preflight.md +6 -0
- package/framework/commands/morph-proposal.md +56 -7
- package/framework/commands/morph-status.md +6 -0
- package/framework/commands/morph-troubleshoot.md +6 -0
- package/framework/hooks/claude-code/notification/approval-reminder.js +3 -2
- package/framework/hooks/claude-code/post-tool-use/context-refresh.js +1 -1
- package/framework/hooks/claude-code/post-tool-use/dispatch.js +155 -32
- package/framework/hooks/claude-code/post-tool-use/skill-reminder.js +78 -0
- package/framework/hooks/claude-code/post-tool-use/validator-feedback.js +8 -17
- package/framework/hooks/claude-code/pre-compact/save-morph-context.js +16 -3
- package/framework/hooks/claude-code/pre-tool-use/enforce-phase-writes.js +4 -3
- package/framework/hooks/claude-code/pre-tool-use/protect-spec-files.js +4 -3
- package/framework/hooks/claude-code/pre-tool-use/task-tracking-guard.js +60 -0
- package/framework/hooks/claude-code/session-start/inject-morph-context.js +124 -2
- package/framework/hooks/claude-code/session-start/post-compact-restore.js +41 -0
- package/framework/hooks/claude-code/statusline.py +76 -30
- package/framework/hooks/claude-code/stop/validate-completion.js +2 -15
- package/framework/hooks/claude-code/user-prompt/enrich-prompt.js +23 -5
- package/framework/hooks/claude-code/user-prompt/set-terminal-title.js +14 -6
- package/framework/hooks/shared/activity-logger.js +0 -24
- package/framework/hooks/shared/compact-restore.js +100 -0
- package/framework/hooks/shared/dispatch-helpers.js +116 -0
- package/framework/hooks/shared/phase-utils.js +12 -5
- package/framework/hooks/shared/skill-reminder-helpers.js +79 -0
- package/framework/hooks/shared/stale-task-reset.js +57 -0
- package/framework/hooks/shared/state-reader.js +29 -5
- package/framework/hooks/shared/worktree-helpers.js +53 -0
- package/framework/phases.json +69 -14
- package/framework/rules/morph-workflow.md +88 -86
- package/framework/skills/level-0-meta/mcp-registry.json +86 -51
- package/framework/skills/level-0-meta/{brainstorming → morph-brainstorming}/SKILL.md +14 -17
- package/framework/skills/level-0-meta/morph-checklist/SKILL.md +2 -2
- package/framework/skills/level-0-meta/{code-review → morph-code-review}/SKILL.md +2 -2
- package/framework/skills/level-0-meta/{code-review-nextjs → morph-code-review-nextjs}/SKILL.md +163 -163
- package/framework/skills/level-0-meta/{frontend-review → morph-frontend-review}/SKILL.md +9 -9
- package/framework/skills/level-0-meta/morph-init/SKILL.md +77 -12
- package/framework/skills/level-0-meta/{post-implementation → morph-post-implementation}/SKILL.md +62 -15
- package/framework/skills/level-0-meta/morph-replicate/SKILL.md +5 -5
- package/framework/skills/level-0-meta/morph-replicate/references/blazor-html-mapping.md +1 -1
- package/framework/skills/level-0-meta/{simulation-checklist → morph-simulation-checklist}/SKILL.md +1 -1
- package/framework/skills/level-0-meta/{terminal-title → morph-terminal-title}/SKILL.md +2 -2
- package/framework/skills/level-0-meta/{tool-usage-guide → morph-tool-usage-guide}/SKILL.md +3 -4
- package/framework/skills/level-0-meta/{tool-usage-guide → morph-tool-usage-guide}/references/tools-per-phase.md +7 -7
- package/framework/skills/level-0-meta/{verification-before-completion → morph-verification-before-completion}/SKILL.md +2 -2
- package/framework/skills/level-0-meta/{verification-before-completion → morph-verification-before-completion}/scripts/check-phase-outputs.mjs +2 -2
- package/framework/skills/level-1-workflows/morph-phase-clarify/SKILL.md +238 -0
- package/framework/skills/level-1-workflows/{phase-codebase-analysis → morph-phase-codebase-analysis}/SKILL.md +3 -3
- package/framework/skills/level-1-workflows/morph-phase-design/SKILL.md +507 -0
- package/framework/skills/level-1-workflows/{phase-implement → morph-phase-implement}/SKILL.md +168 -27
- package/framework/skills/level-1-workflows/morph-phase-implement/prompts/code-quality-reviewer-prompt.md +50 -0
- package/framework/skills/level-1-workflows/morph-phase-implement/prompts/implementer-prompt.md +45 -0
- package/framework/skills/level-1-workflows/morph-phase-implement/prompts/spec-reviewer-prompt.md +47 -0
- package/framework/skills/level-1-workflows/morph-phase-plan/SKILL.md +254 -0
- package/framework/skills/level-1-workflows/{phase-setup → morph-phase-setup}/SKILL.md +50 -3
- package/framework/skills/level-1-workflows/{phase-tasks → morph-phase-tasks}/SKILL.md +48 -11
- package/framework/skills/level-1-workflows/{phase-tasks → morph-phase-tasks}/scripts/validate-tasks.mjs +3 -3
- package/framework/skills/level-1-workflows/{phase-uiux → morph-phase-uiux}/SKILL.md +46 -11
- package/framework/skills/level-1-workflows/morph-scope-escalation/SKILL.md +97 -0
- package/framework/standards/STANDARDS.json +640 -88
- package/framework/standards/infrastructure/vercel/vercel-database.md +106 -0
- package/framework/standards/integration/mcp/mcp-tools.md +25 -7
- package/framework/templates/REGISTRY.json +1825 -1909
- package/framework/templates/context/CONTEXT-FEATURE.md +276 -276
- package/framework/templates/docs/onboarding.md +3 -7
- package/package.json +2 -7
- package/src/commands/agents/dispatch-agents.js +104 -6
- package/src/commands/mcp/mcp-setup.js +39 -2
- package/src/commands/phase/phase-reset.js +74 -0
- package/src/commands/project/doctor.js +34 -51
- package/src/commands/project/init.js +1 -1
- package/src/commands/project/status.js +2 -2
- package/src/commands/project/update.js +381 -365
- package/src/commands/project/worktree.js +154 -0
- package/src/commands/scope/escalate.js +215 -0
- package/src/commands/state/advance-phase.js +132 -68
- package/src/commands/state/approve.js +2 -2
- package/src/commands/state/index.js +7 -8
- package/src/commands/state/phase-runner.js +1 -1
- package/src/commands/state/state.js +61 -6
- package/src/commands/task/expand.js +100 -0
- package/src/commands/tasks/task.js +78 -99
- package/src/commands/templates/template-render.js +93 -173
- package/src/commands/trust/trust.js +26 -21
- package/src/core/paths/output-schema.js +19 -3
- package/src/core/state/phase-state-machine.js +7 -4
- package/src/core/state/state-manager.js +32 -57
- package/src/core/workflows/workflow-detector.js +9 -87
- package/src/lib/detectors/claude-config-detector.js +93 -347
- package/src/lib/detectors/design-system-detector.js +189 -189
- package/src/lib/detectors/index.js +155 -57
- package/src/lib/generators/context-generator.js +2 -2
- package/src/lib/installers/mcp-installer.js +37 -5
- package/src/lib/phase-chain/phase-validator.js +336 -0
- package/src/lib/scope/impact-analyzer.js +106 -0
- package/src/lib/stack/stack-profile.js +88 -0
- package/src/lib/tasks/task-classifier.js +16 -0
- package/src/lib/tasks/task-parser.js +1 -1
- package/src/lib/tasks/test-runner.js +77 -0
- package/src/lib/trust/trust-manager.js +32 -144
- package/src/lib/validators/shared/emit-validator-dispatch.js +64 -0
- package/src/lib/validators/spec-validator.js +58 -4
- package/src/lib/validators/validation-runner.js +23 -11
- package/src/scripts/setup-infra.js +255 -224
- package/src/utils/agents-installer.js +34 -14
- package/src/utils/banner.js +1 -1
- package/src/utils/claude-settings-manager.js +1 -1
- package/src/utils/file-copier.js +1 -1
- package/src/utils/hooks-installer.js +272 -8
- package/framework/hooks/dev/check-sync-health.js +0 -117
- package/framework/hooks/dev/guard-version-numbers.js +0 -57
- package/framework/hooks/dev/sync-standards-registry.js +0 -60
- package/framework/hooks/dev/sync-template-registry.js +0 -60
- package/framework/hooks/dev/validate-skill-format.js +0 -70
- package/framework/hooks/dev/validate-standard-format.js +0 -73
- package/framework/skills/level-1-workflows/phase-clarify/SKILL.md +0 -190
- package/framework/skills/level-1-workflows/phase-design/SKILL.md +0 -366
- package/framework/templates/meta-prompts/hops/hop-retry.md +0 -78
- package/framework/templates/meta-prompts/hops/hop-validation.md +0 -97
- package/framework/templates/meta-prompts/hops/hop-wrapper.md +0 -36
- package/framework/workflows/configs/design-impl.json +0 -49
- package/framework/workflows/configs/express.json +0 -45
- package/framework/workflows/configs/fast-track.json +0 -42
- package/framework/workflows/configs/full-morph.json +0 -79
- package/framework/workflows/configs/fusion.json +0 -39
- package/framework/workflows/configs/long-running.json +0 -33
- package/framework/workflows/configs/spec-only.json +0 -43
- package/framework/workflows/configs/ui-refresh.json +0 -49
- package/framework/workflows/configs/zero-touch.json +0 -82
- package/src/commands/project/index.js +0 -8
- package/src/commands/project/monitor.js +0 -295
- package/src/commands/project/tutorial.js +0 -115
- package/src/commands/state/validate-phase.js +0 -238
- package/src/commands/templates/generate-contracts.js +0 -445
- package/src/core/index.js +0 -10
- package/src/core/orchestrator.js +0 -171
- package/src/core/registry/command-registry.js +0 -28
- package/src/core/registry/index.js +0 -8
- package/src/core/registry/validator-registry.js +0 -204
- package/src/core/state/index.js +0 -8
- package/src/core/templates/index.js +0 -9
- package/src/core/templates/template-data-sources.js +0 -325
- package/src/core/templates/template-validator.js +0 -296
- package/src/core/workflows/index.js +0 -7
- package/src/generator/config-generator.js +0 -206
- package/src/generator/templates/config.json.template +0 -40
- package/src/generator/templates/project.md.template +0 -67
- package/src/lib/agents/micro-agent-factory.js +0 -161
- package/src/lib/analysis/complexity-analyzer.js +0 -441
- package/src/lib/analysis/index.js +0 -7
- package/src/lib/analytics/analytics-engine.js +0 -345
- package/src/lib/checkpoints/checkpoint-hooks.js +0 -298
- package/src/lib/checkpoints/index.js +0 -7
- package/src/lib/context/context-bundler.js +0 -241
- package/src/lib/context/context-optimizer.js +0 -212
- package/src/lib/context/context-tracker.js +0 -273
- package/src/lib/context/core-four-tracker.js +0 -201
- package/src/lib/context/mcp-optimizer.js +0 -200
- package/src/lib/detectors/config-detector.js +0 -223
- package/src/lib/detectors/standards-generator.js +0 -335
- package/src/lib/detectors/structure-detector.js +0 -275
- package/src/lib/execution/fusion-executor.js +0 -304
- package/src/lib/execution/parallel-executor.js +0 -270
- package/src/lib/hooks/stop-hook-executor.js +0 -286
- package/src/lib/hops/hop-composer.js +0 -221
- package/src/lib/monitor/agent-resolver.js +0 -144
- package/src/lib/monitor/renderer.js +0 -230
- package/src/lib/orchestration/index.js +0 -7
- package/src/lib/orchestration/team-orchestrator.js +0 -404
- package/src/lib/phase-chain/eligibility-checker.js +0 -243
- package/src/lib/threads/thread-coordinator.js +0 -238
- package/src/lib/threads/thread-manager.js +0 -317
- package/src/lib/tracking/artifact-trail.js +0 -202
- package/src/sanitizer/context-sanitizer.js +0 -221
- package/src/sanitizer/patterns.js +0 -163
- package/src/scanner/project-scanner.js +0 -242
- package/src/ui/diff-display.js +0 -91
- package/src/ui/interactive-wizard.js +0 -96
- package/src/ui/user-review.js +0 -211
- package/src/ui/wizard-questions.js +0 -188
- package/src/utils/color-utils.js +0 -70
- package/src/utils/process-handler.js +0 -97
- package/src/writer/file-writer.js +0 -86
- /package/framework/skills/level-0-meta/{brainstorming → morph-brainstorming}/references/proposal-example.md +0 -0
- /package/framework/skills/level-0-meta/{code-review → morph-code-review}/references/review-example.md +0 -0
- /package/framework/skills/level-0-meta/{code-review → morph-code-review}/references/review-guidelines.md +0 -0
- /package/framework/skills/level-0-meta/{code-review → morph-code-review}/scripts/scan-csharp.mjs +0 -0
- /package/framework/skills/level-0-meta/{code-review-nextjs → morph-code-review-nextjs}/references/review-example-nextjs.md +0 -0
- /package/framework/skills/level-0-meta/{code-review-nextjs → morph-code-review-nextjs}/scripts/scan-nextjs.mjs +0 -0
- /package/framework/skills/level-0-meta/{frontend-review → morph-frontend-review}/scripts/scan-accessibility.mjs +0 -0
- /package/framework/skills/level-0-meta/{post-implementation → morph-post-implementation}/scripts/detect-dev-server.mjs +0 -0
- /package/framework/skills/level-0-meta/{post-implementation → morph-post-implementation}/scripts/detect-stack.mjs +0 -0
- /package/framework/skills/level-0-meta/{terminal-title → morph-terminal-title}/scripts/set_title.sh +0 -0
- /package/framework/skills/level-1-workflows/{phase-clarify → morph-phase-clarify}/references/clarifications-example.md +0 -0
- /package/framework/skills/level-1-workflows/{phase-design → morph-phase-design}/references/architecture-analysis-guide.md +0 -0
- /package/framework/skills/level-1-workflows/{phase-design → morph-phase-design}/references/spec-authoring-guide.md +0 -0
- /package/framework/skills/level-1-workflows/{phase-design → morph-phase-design}/references/spec-example.md +0 -0
- /package/framework/skills/level-1-workflows/{phase-implement → morph-phase-implement}/references/recap-example.md +0 -0
- /package/framework/skills/level-1-workflows/{phase-implement → morph-phase-implement}/references/vsa-implementation-guide.md +0 -0
- /package/framework/skills/level-1-workflows/{phase-tasks → morph-phase-tasks}/references/task-planning-patterns.md +0 -0
- /package/framework/skills/level-1-workflows/{phase-tasks → morph-phase-tasks}/references/tasks-example.md +0 -0
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: morph:phase-plan
|
|
3
|
+
description: MORPH-SPEC Phase 4 (Plan). Generates a detailed implementation plan with exact file paths, TDD code blocks, and execution strategy analysis. Produces plan.md in 3-plan/. Use after clarify phase to create an actionable implementation plan before task breakdown.
|
|
4
|
+
argument-hint: "[feature-name]"
|
|
5
|
+
disable-model-invocation: true
|
|
6
|
+
user-invocable: false
|
|
7
|
+
allowed-tools: Read, Write, Edit, Bash, Glob, Grep
|
|
8
|
+
cliVersion: "4.10.0"
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# MORPH Plan - FASE 4
|
|
12
|
+
|
|
13
|
+
> INTERNAL: Workflow skill used by /morph-proposal during automated phase orchestration. Not a user command.
|
|
14
|
+
|
|
15
|
+
Gere um plano de implementacao detalhado com paths exatos, codigo TDD e estrategia de execucao.
|
|
16
|
+
|
|
17
|
+
## Pre-requisitos
|
|
18
|
+
|
|
19
|
+
- [ ] FASE 3 (Clarify) concluida
|
|
20
|
+
- [ ] `spec.md` atualizado com clarificacoes
|
|
21
|
+
- [ ] `contracts.cs` ou `contracts.ts` definidos
|
|
22
|
+
|
|
23
|
+
## Ferramentas Recomendadas
|
|
24
|
+
|
|
25
|
+
> **Ref:** `framework/skills/level-0-meta/morph-tool-usage-guide/SKILL.md` para guia completo.
|
|
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` | --- |
|
|
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
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## PRE-VOO OBRIGATORIO
|
|
45
|
+
|
|
46
|
+
### 0. Garantir fase plan
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
npx morph-spec state get $ARGUMENTS
|
|
50
|
+
```
|
|
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
|
|
55
|
+
|
|
56
|
+
> **Regra:** Nunca escreva em `3-plan/` enquanto a fase nao for `plan`.
|
|
57
|
+
|
|
58
|
+
### 1. Ler todos os prerequisitos em PARALELO
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
Read: .morph/features/{feature}/1-design/spec.md
|
|
62
|
+
+ Read: .morph/features/{feature}/1-design/contracts.cs
|
|
63
|
+
+ Read: .morph/features/{feature}/1-design/decisions.md
|
|
64
|
+
+ Read: .morph/features/{feature}/1-design/clarifications.md
|
|
65
|
+
+ Read: .morph/features/{feature}/1-design/schema-analysis.md (se existir)
|
|
66
|
+
+ Read: .morph/config/config.json
|
|
67
|
+
```
|
|
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
|
+
---
|
|
78
|
+
|
|
79
|
+
## Workflow
|
|
80
|
+
|
|
81
|
+
### Passo 1: Analisar Feature para Contexto
|
|
82
|
+
|
|
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:**
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
cat .morph/config/config.json | grep -A3 '"architecture"'
|
|
90
|
+
```
|
|
91
|
+
|
|
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 |
|
|
96
|
+
|
|
97
|
+
### Passo 2: Determinar Estrategia de Execucao
|
|
98
|
+
|
|
99
|
+
Execute a analise:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
npx morph-spec dispatch-agents $ARGUMENTS plan
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
**Fatores para recomendacao:**
|
|
106
|
+
|
|
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 |
|
|
113
|
+
|
|
114
|
+
**Decisao:**
|
|
115
|
+
|
|
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 |
|
|
121
|
+
|
|
122
|
+
### Passo 3: Gerar `plan.md`
|
|
123
|
+
|
|
124
|
+
Crie `.morph/features/$ARGUMENTS/3-plan/plan.md` com a estrutura:
|
|
125
|
+
|
|
126
|
+
```markdown
|
|
127
|
+
# {Feature Name} Implementation Plan
|
|
128
|
+
|
|
129
|
+
> **For Claude:** Use morph:phase-implement to execute this plan.
|
|
130
|
+
|
|
131
|
+
**Goal:** {Uma frase descrevendo o que sera construido}
|
|
132
|
+
|
|
133
|
+
**Architecture:** {2-3 frases sobre a abordagem}
|
|
134
|
+
|
|
135
|
+
**Tech Stack:** {Tecnologias chave}
|
|
136
|
+
|
|
137
|
+
**Execution Strategy:** {single | subagents | agent-teams} (Recommended)
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## GROUP {A} --- {Nome do Grupo}
|
|
142
|
+
|
|
143
|
+
{Padrao e contexto do grupo}
|
|
144
|
+
|
|
145
|
+
### {A1} --- {Nome da task}
|
|
146
|
+
|
|
147
|
+
**Files:**
|
|
148
|
+
- Create: `exact/path/to/file.cs`
|
|
149
|
+
- Modify: `exact/path/to/existing.cs:123-145`
|
|
150
|
+
- Test: `tests/exact/path/to/test.cs`
|
|
151
|
+
|
|
152
|
+
**Step 1: Write the failing test**
|
|
153
|
+
|
|
154
|
+
(Codigo completo do teste)
|
|
155
|
+
|
|
156
|
+
**Step 2: Run test to verify it fails**
|
|
157
|
+
|
|
158
|
+
Run: `{comando exato}`
|
|
159
|
+
Expected: FAIL with "{mensagem}"
|
|
160
|
+
|
|
161
|
+
**Step 3: Write minimal implementation**
|
|
162
|
+
|
|
163
|
+
(Codigo completo da implementacao)
|
|
164
|
+
|
|
165
|
+
**Step 4: Run test to verify it passes**
|
|
166
|
+
|
|
167
|
+
Run: `{comando exato}`
|
|
168
|
+
Expected: PASS
|
|
169
|
+
|
|
170
|
+
**Step 5: Commit**
|
|
171
|
+
|
|
172
|
+
git add {files}
|
|
173
|
+
git commit -m "{mensagem}"
|
|
174
|
+
```
|
|
175
|
+
|
|
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
|
|
182
|
+
|
|
183
|
+
### Passo 4: Atualizar State
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
npx morph-spec state mark-output $ARGUMENTS plan
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## PAUSA OBRIGATORIA
|
|
192
|
+
|
|
193
|
+
Use `AskUserQuestion` para capturar aprovacao:
|
|
194
|
+
|
|
195
|
+
```json
|
|
196
|
+
{
|
|
197
|
+
"questions": [
|
|
198
|
+
{
|
|
199
|
+
"header": "Aprovacao",
|
|
200
|
+
"question": "Plano de implementacao gerado. Aprovar para iniciar task breakdown?",
|
|
201
|
+
"multiSelect": false,
|
|
202
|
+
"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)" }
|
|
205
|
+
]
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"header": "Execucao",
|
|
209
|
+
"question": "Qual estrategia de execucao para implementacao?",
|
|
210
|
+
"multiSelect": false,
|
|
211
|
+
"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}" }
|
|
215
|
+
]
|
|
216
|
+
}
|
|
217
|
+
]
|
|
218
|
+
}
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
> A primeira opcao de "Execucao" deve ser a recomendacao context-aware calculada no Passo 2. As alternativas sao as outras estrategias.
|
|
222
|
+
|
|
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
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
## Outputs desta Fase
|
|
233
|
+
|
|
234
|
+
<!-- morph:outputs:plan -->
|
|
235
|
+
| Output | Caminho |
|
|
236
|
+
|--------|---------|
|
|
237
|
+
| `plan` | `.morph/features/{feature}/3-plan/plan.md` |
|
|
238
|
+
<!-- /morph:outputs -->
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## Criterios de Avanco
|
|
243
|
+
|
|
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
|
|
251
|
+
|
|
252
|
+
---
|
|
253
|
+
|
|
254
|
+
Apos aprovacao: prosseguir automaticamente para FASE 5 (Tasks).
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: phase-setup
|
|
2
|
+
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
6
|
allowed-tools: Read, Write, Edit, Bash, Glob, Grep
|
|
7
|
-
cliVersion: "4.
|
|
7
|
+
cliVersion: "4.10.0"
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
# MORPH Setup - FASE 1
|
|
@@ -21,7 +21,7 @@ Inicialize o contexto e prepare o ambiente para uma feature aprovada.
|
|
|
21
21
|
|
|
22
22
|
## Ferramentas Recomendadas
|
|
23
23
|
|
|
24
|
-
> **Ref:** `framework/skills/level-0-meta/tool-usage-guide/SKILL.md` para guia completo.
|
|
24
|
+
> **Ref:** `framework/skills/level-0-meta/morph-tool-usage-guide/SKILL.md` para guia completo.
|
|
25
25
|
> **Ref:** `framework/standards/integration/mcp/mcp-tools.md` para referência MCP.
|
|
26
26
|
|
|
27
27
|
| Ação | Ferramenta | Alternativa |
|
|
@@ -112,6 +112,49 @@ npx morph-spec state add-agent $ARGUMENTS ef-modeler
|
|
|
112
112
|
- `.morph/context/README.md` — Overview do projeto
|
|
113
113
|
- `.morph/config/config.json` — Configurações
|
|
114
114
|
|
|
115
|
+
### Passo 2.5: Validar Conexoes MCP
|
|
116
|
+
|
|
117
|
+
Verifique se os MCPs configurados estao funcionando antes de prosseguir.
|
|
118
|
+
|
|
119
|
+
**1. Coletar MCPs recomendados:**
|
|
120
|
+
- Leia `framework/phases.json` → para cada fase no workflow da feature, colete os `recommendedMCPs[]`
|
|
121
|
+
- Leia `framework/skills/level-0-meta/mcp-registry.json` → obtenha os `healthCheck` de cada MCP
|
|
122
|
+
|
|
123
|
+
**2. Identificar MCPs configurados:**
|
|
124
|
+
- Leia `.claude/settings.local.json` → identifique quais MCPs estao em `mcpServers`
|
|
125
|
+
|
|
126
|
+
**3. Para cada MCP que esta CONFIGURADO E RECOMENDADO:**
|
|
127
|
+
1. Procure nas suas ferramentas disponiveis por uma que contenha `healthCheck.toolPattern` no nome
|
|
128
|
+
2. Se a ferramenta existir → execute o `healthCheck.testCall` com `healthCheck.testParams`
|
|
129
|
+
3. Avalie o resultado:
|
|
130
|
+
|
|
131
|
+
| Resultado | Acao |
|
|
132
|
+
|-----------|------|
|
|
133
|
+
| **Sucesso** | `✓ {MCP} — conexao verificada` |
|
|
134
|
+
| **Ferramenta nao encontrada** | `○ {MCP} — precisa restart para ativar` |
|
|
135
|
+
| **Erro** | → **AskUserQuestion** com 3 opcoes (abaixo) |
|
|
136
|
+
|
|
137
|
+
**Em caso de erro — pergunte ao usuario:**
|
|
138
|
+
|
|
139
|
+
Use `AskUserQuestion` com header `"{MCP}"` e opcoes:
|
|
140
|
+
- **Continuar sem {MCP}** — Mostre o campo `fallback` do registry e prossiga
|
|
141
|
+
- **Reconfigurar credenciais** — Colete novas credenciais e atualize `.claude/settings.local.json`
|
|
142
|
+
- **Parar setup** — Aborte e reporte o que precisa ser corrigido
|
|
143
|
+
|
|
144
|
+
**4. Para MCPs RECOMENDADOS mas NAO CONFIGURADOS:**
|
|
145
|
+
- Print `△ {MCP} — nao configurado (fallback: {registry.fallback})`
|
|
146
|
+
- Sugestao: `Tip: configure com /morph:init refresh ou npx morph-spec mcp setup`
|
|
147
|
+
|
|
148
|
+
**Resumo:** Mostre uma tabela com status de cada MCP antes de prosseguir:
|
|
149
|
+
```
|
|
150
|
+
MCP Readiness:
|
|
151
|
+
✓ context7 — conexao verificada
|
|
152
|
+
○ playwright — precisa restart
|
|
153
|
+
△ supabase — nao configurado (fallback: Grep + Read para schema)
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
115
158
|
### Passo 3: Confirmar Stack
|
|
116
159
|
|
|
117
160
|
Baseado no proposal e contexto, confirme:
|
|
@@ -137,6 +180,10 @@ npx morph-spec dispatch-agents $ARGUMENTS design
|
|
|
137
180
|
|
|
138
181
|
Isso informa quais agentes serão disparados em paralelo na fase de design e quais tasks eles executarão.
|
|
139
182
|
|
|
183
|
+
> **Mapeamento importante:** `agents[].id` do dispatch config = `subagent_type` no `Agent` tool.
|
|
184
|
+
> Exemplo: `id: "nextjs-expert"` → `Agent(subagent_type=nextjs-expert, prompt=agent.taskPrompt)`.
|
|
185
|
+
> Cada `id` corresponde ao campo `name:` no frontmatter do arquivo em `.claude/agents/`.
|
|
186
|
+
|
|
140
187
|
### Passo 5: Atualizar State
|
|
141
188
|
|
|
142
189
|
Marque a feature como na fase SETUP:
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: phase-tasks
|
|
2
|
+
name: morph:phase-tasks
|
|
3
3
|
description: MORPH-SPEC Phase 4 (Tasks). Breaks approved spec into bottom-up ordered implementation tasks (T001...TXXX) with dependencies, checkpoints every 3 tasks, and effort estimates, producing tasks.md. Use after design and clarification phases to create a structured implementation plan before coding starts.
|
|
4
4
|
argument-hint: "[feature-name]"
|
|
5
5
|
disable-model-invocation: true
|
|
6
6
|
user-invocable: false
|
|
7
7
|
allowed-tools: Read, Write, Edit, Bash, Glob, Grep
|
|
8
|
-
cliVersion: "4.
|
|
8
|
+
cliVersion: "4.10.0"
|
|
9
9
|
---
|
|
10
10
|
|
|
11
11
|
# MORPH Tasks - FASE 4
|
|
@@ -22,7 +22,7 @@ Quebre a especificação em tasks executáveis, defina ordem de execução e est
|
|
|
22
22
|
|
|
23
23
|
## Ferramentas Recomendadas
|
|
24
24
|
|
|
25
|
-
> **Ref:** `framework/skills/level-0-meta/tool-usage-guide/SKILL.md` para guia completo.
|
|
25
|
+
> **Ref:** `framework/skills/level-0-meta/morph-tool-usage-guide/SKILL.md` para guia completo.
|
|
26
26
|
> **Ref:** `framework/standards/integration/mcp/mcp-tools.md` para referência MCP.
|
|
27
27
|
> **Example:** `references/tasks-example.md` — filled-in tasks.md showing expected granularity and format.
|
|
28
28
|
> **Script:** `scripts/validate-tasks.mjs` — validates tasks.md structure, T### IDs, and required fields.
|
|
@@ -52,6 +52,26 @@ Quebre a especificação em tasks executáveis, defina ordem de execução e est
|
|
|
52
52
|
|
|
53
53
|
## ✅ PRÉ-VOO OBRIGATÓRIO (antes de iniciar breakdown de tasks)
|
|
54
54
|
|
|
55
|
+
### 0. Garantir fase tasks
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
npx morph-spec state get $ARGUMENTS
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Verifique o campo `"phase"` no output:
|
|
62
|
+
|
|
63
|
+
**Se `"phase": "tasks"`** → ✅ fase correta, prossiga.
|
|
64
|
+
|
|
65
|
+
**Se `"phase": "clarify"`** → execute em sequência:
|
|
66
|
+
1. `npx morph-spec state mark-output $ARGUMENTS clarifications`
|
|
67
|
+
2. `npx morph-spec phase advance $ARGUMENTS` (→ tasks)
|
|
68
|
+
|
|
69
|
+
**Qualquer outro valor** → ⛔ não prossiga — estado inconsistente, reporte ao usuário.
|
|
70
|
+
|
|
71
|
+
> **Regra:** Nunca escreva em `4-tasks/` enquanto a fase não for `tasks`. O hook bloqueará a escrita.
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
55
75
|
### 1. Ler todos os prerequisitos em PARALELO
|
|
56
76
|
|
|
57
77
|
```
|
|
@@ -98,7 +118,7 @@ TaskCreate: "Avanço de fase" → activeForm: "Avançando fase"
|
|
|
98
118
|
# Verificar estado atual:
|
|
99
119
|
npx morph-spec state get $ARGUMENTS
|
|
100
120
|
# Verificar se design foi aprovado:
|
|
101
|
-
npx morph-spec approval
|
|
121
|
+
npx morph-spec approval-status $ARGUMENTS
|
|
102
122
|
```
|
|
103
123
|
|
|
104
124
|
---
|
|
@@ -208,7 +228,7 @@ Para cada task, estime tempo em minutos:
|
|
|
208
228
|
|
|
209
229
|
### Passo 6: Gerar `tasks.md`
|
|
210
230
|
|
|
211
|
-
Crie `.morph/features/$ARGUMENTS/
|
|
231
|
+
Crie `.morph/features/$ARGUMENTS/4-tasks/tasks.md` com a estrutura completa de tasks, checkpoints e estimativas.
|
|
212
232
|
|
|
213
233
|
### Passo 7: Incluir Tasks de IaC (se necessário)
|
|
214
234
|
|
|
@@ -223,15 +243,32 @@ npx morph-spec state mark-output $ARGUMENTS tasks
|
|
|
223
243
|
|
|
224
244
|
## Outputs Gerados
|
|
225
245
|
|
|
226
|
-
- `.morph/features/$ARGUMENTS/
|
|
246
|
+
- `.morph/features/$ARGUMENTS/4-tasks/tasks.md` - Breakdown completo de tasks
|
|
227
247
|
|
|
228
248
|
## PAUSA OBRIGATÓRIA
|
|
229
249
|
|
|
230
|
-
|
|
250
|
+
Use `AskUserQuestion` para capturar aprovação explícita antes de avançar:
|
|
251
|
+
|
|
252
|
+
```json
|
|
253
|
+
{
|
|
254
|
+
"questions": [{
|
|
255
|
+
"header": "Aprovação",
|
|
256
|
+
"question": "Tasks geradas. Aprovar para iniciar implementação?",
|
|
257
|
+
"multiSelect": false,
|
|
258
|
+
"options": [
|
|
259
|
+
{ "label": "Aprovar e implementar", "description": "Avançar para fase de implementação" },
|
|
260
|
+
{ "label": "Tenho feedback", "description": "Digite o que deseja mudar no campo abaixo (Other)" }
|
|
261
|
+
]
|
|
262
|
+
}]
|
|
263
|
+
}
|
|
264
|
+
```
|
|
231
265
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
266
|
+
- **"Aprovar e implementar"** →
|
|
267
|
+
```bash
|
|
268
|
+
npx morph-spec approve $ARGUMENTS tasks
|
|
269
|
+
npx morph-spec phase advance $ARGUMENTS
|
|
270
|
+
```
|
|
271
|
+
- **"Tenho feedback" ou "Other"** → aplique o feedback recebido e repita esta PAUSA
|
|
235
272
|
|
|
236
273
|
## Critérios de Avanço
|
|
237
274
|
|
|
@@ -263,7 +300,7 @@ Apresente ao usuário 3 ações sugeridas:
|
|
|
263
300
|
<!-- morph:outputs:tasks -->
|
|
264
301
|
| Output | Caminho |
|
|
265
302
|
|--------|---------|
|
|
266
|
-
| `tasks` | `.morph/features/{feature}/
|
|
303
|
+
| `tasks` | `.morph/features/{feature}/4-tasks/tasks.md` |
|
|
267
304
|
<!-- /morph:outputs -->
|
|
268
305
|
|
|
269
306
|
---
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Usage:
|
|
9
9
|
* node validate-tasks.mjs <tasks-file>
|
|
10
|
-
* node validate-tasks.mjs .morph/features/my-feature/
|
|
10
|
+
* node validate-tasks.mjs .morph/features/my-feature/4-tasks/tasks.md
|
|
11
11
|
*
|
|
12
12
|
* Checks:
|
|
13
13
|
* - Summary table exists with T### IDs and valid statuses
|
|
@@ -57,9 +57,9 @@ if (summaryTasks.length === 0) {
|
|
|
57
57
|
errors.push('No summary table found — expected rows matching | T### | Type | Title | Status |');
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
// 2. Parse task headers (### T001: Title)
|
|
60
|
+
// 2. Parse task headers (### T001: Title or ### T001 — Title or ### T001 - Title)
|
|
61
61
|
const taskHeaders = lines
|
|
62
|
-
.map((l, i) => ({ line: i + 1, match: l.match(/^###\s+(T\d{3})
|
|
62
|
+
.map((l, i) => ({ line: i + 1, match: l.match(/^###\s+(T\d{3})\s*[—–:\-]\s+(.+)/) }))
|
|
63
63
|
.filter(r => r.match);
|
|
64
64
|
|
|
65
65
|
// Check sequential IDs
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: phase-uiux
|
|
3
|
-
description: MORPH-SPEC Phase 1.5 (UI/UX). Creates design-system.md, mockups.md, components.md, and flows.md using
|
|
2
|
+
name: morph:phase-uiux
|
|
3
|
+
description: MORPH-SPEC Phase 1.5 (UI/UX). Creates design-system.md, mockups.md, components.md, and flows.md using Playwright/Context7 MCPs. Use after setup for features with frontend UI components, pages, dashboards, forms, wizards, or visual interactions requiring design documentation.
|
|
4
4
|
argument-hint: "[feature-name]"
|
|
5
5
|
user-invocable: false
|
|
6
6
|
allowed-tools: Read, Write, Edit, Bash, Glob, Grep
|
|
7
|
-
cliVersion: "4.
|
|
7
|
+
cliVersion: "4.10.0"
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
# MORPH UI/UX Design - FASE 1.5
|
|
@@ -21,7 +21,7 @@ Fase condicional para features com front-end. Coleta requisitos de UI/UX, gera w
|
|
|
21
21
|
|
|
22
22
|
## Ferramentas Recomendadas
|
|
23
23
|
|
|
24
|
-
> **Ref:** `framework/skills/level-0-meta/tool-usage-guide/SKILL.md` para guia completo.
|
|
24
|
+
> **Ref:** `framework/skills/level-0-meta/morph-tool-usage-guide/SKILL.md` para guia completo.
|
|
25
25
|
> **Ref:** `framework/standards/integration/mcp/mcp-tools.md` para referência MCP.
|
|
26
26
|
|
|
27
27
|
| Ação | Ferramenta | Alternativa |
|
|
@@ -30,7 +30,6 @@ Fase condicional para features com front-end. Coleta requisitos de UI/UX, gera w
|
|
|
30
30
|
| Ler screenshots do usuário | **Read** (arquivo de imagem) | — |
|
|
31
31
|
| Buscar variáveis CSS existentes | **Grep** `--root:` em `*.css,*.scss` | — |
|
|
32
32
|
| Encontrar componentes existentes | **Glob** `**/Components/**/*.razor` ou `**/components/**/*.tsx` | — |
|
|
33
|
-
| Extrair design tokens do Figma | **Figma MCP** `get_file({ fileKey })` | Read CSS/SCSS variables |
|
|
34
33
|
| Documentação de componentes UI | **Context7 MCP** `query_docs({ libraryId, query })` | **WebSearch** + **WebFetch** |
|
|
35
34
|
| Preview de página existente | **Playwright MCP** `browser_navigate()` + `browser_take_screenshot()` | **WebFetch** URL |
|
|
36
35
|
| Inspecionar estrutura da página | **Playwright MCP** `browser_snapshot()` | **WebFetch** + parse manual |
|
|
@@ -40,7 +39,7 @@ Fase condicional para features com front-end. Coleta requisitos de UI/UX, gera w
|
|
|
40
39
|
| Gerar design system de CSS existente | **Bash** `npx morph-spec generate design-system --scan` | — |
|
|
41
40
|
| Atualizar state | **Bash** `npx morph-spec state mark-output ...` | — |
|
|
42
41
|
|
|
43
|
-
**MCPs desta fase:**
|
|
42
|
+
**MCPs desta fase:** Playwright (preview, inspeção, responsividade), Context7 (docs de componentes).
|
|
44
43
|
|
|
45
44
|
**Anti-padrões:**
|
|
46
45
|
- ❌ WebSearch para docs MudBlazor (use Context7 MCP — mais preciso)
|
|
@@ -51,7 +50,26 @@ Fase condicional para features com front-end. Coleta requisitos de UI/UX, gera w
|
|
|
51
50
|
|
|
52
51
|
## Workflow
|
|
53
52
|
|
|
54
|
-
### Passo 0:
|
|
53
|
+
### Passo 0: Garantir fase uiux
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
npx morph-spec state get $ARGUMENTS
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Verifique o campo `"phase"` no output:
|
|
60
|
+
|
|
61
|
+
**Se `"phase": "uiux"`** → ✅ fase correta, prossiga.
|
|
62
|
+
|
|
63
|
+
**Se `"phase": "setup"`** → execute:
|
|
64
|
+
1. `npx morph-spec phase advance $ARGUMENTS` (→ uiux)
|
|
65
|
+
|
|
66
|
+
**Qualquer outro valor** → ⛔ não prossiga — estado inconsistente, reporte ao usuário.
|
|
67
|
+
|
|
68
|
+
> **Regra:** Nunca escreva em `2-ui/` enquanto a fase não for `uiux`. O hook bloqueará a escrita.
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
### Passo 0.5: Verificar Design System Existe
|
|
55
73
|
|
|
56
74
|
**CRITICAL:** Antes de iniciar a FASE UI/UX, verifique se um design system existe:
|
|
57
75
|
|
|
@@ -252,11 +270,28 @@ estática no design, e gera screenshots dos mockups se dev server disponível.
|
|
|
252
270
|
|
|
253
271
|
## PAUSA OBRIGATÓRIA
|
|
254
272
|
|
|
255
|
-
|
|
273
|
+
Use `AskUserQuestion` para capturar aprovação explícita antes de avançar:
|
|
274
|
+
|
|
275
|
+
```json
|
|
276
|
+
{
|
|
277
|
+
"questions": [{
|
|
278
|
+
"header": "Aprovação",
|
|
279
|
+
"question": "UI/UX gerado. Aprovar para avançar para design técnico?",
|
|
280
|
+
"multiSelect": false,
|
|
281
|
+
"options": [
|
|
282
|
+
{ "label": "Aprovar UI/UX", "description": "Avançar para fase de design técnico" },
|
|
283
|
+
{ "label": "Tenho feedback", "description": "Digite o que deseja ajustar no campo abaixo (Other)" }
|
|
284
|
+
]
|
|
285
|
+
}]
|
|
286
|
+
}
|
|
287
|
+
```
|
|
256
288
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
289
|
+
- **"Aprovar UI/UX"** →
|
|
290
|
+
```bash
|
|
291
|
+
npx morph-spec approve $ARGUMENTS uiux
|
|
292
|
+
npx morph-spec phase advance $ARGUMENTS
|
|
293
|
+
```
|
|
294
|
+
- **"Tenho feedback" ou "Other"** → aplique o feedback recebido e repita esta PAUSA
|
|
260
295
|
|
|
261
296
|
## Critérios de Avanço
|
|
262
297
|
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: morph:scope-escalation
|
|
3
|
+
description: Guided workflow for mid-implementation scope escalation — analyzes complexity discovery, recommends action, and executes phase regression or task expansion
|
|
4
|
+
user-invocable: true
|
|
5
|
+
argument-hint: "[feature-name]"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Scope Escalation Workflow
|
|
9
|
+
|
|
10
|
+
Use this skill when a task during implementation reveals significantly more complexity than estimated.
|
|
11
|
+
|
|
12
|
+
## Prerequisites
|
|
13
|
+
|
|
14
|
+
- Feature must be in `implement` phase
|
|
15
|
+
- You must have identified a specific task that triggered the discovery
|
|
16
|
+
|
|
17
|
+
## Workflow
|
|
18
|
+
|
|
19
|
+
### Step 1: COLLECT Evidence
|
|
20
|
+
|
|
21
|
+
Ask the user (using `AskUserQuestion`):
|
|
22
|
+
|
|
23
|
+
1. **Which task triggered the discovery?** (task ID from tasks.md)
|
|
24
|
+
2. **What did you discover?** (specific complexity: hidden dependencies, wrong assumptions, missing abstractions)
|
|
25
|
+
3. **Show evidence** — read the relevant code files to understand the actual complexity
|
|
26
|
+
|
|
27
|
+
### Step 2: ANALYZE Impact
|
|
28
|
+
|
|
29
|
+
Run dry-run analysis:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npx morph-spec scope escalate <feature> --task <id> --reason "<reason>" --dry-run
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Read the recommendation output. Additionally:
|
|
36
|
+
|
|
37
|
+
- Read `tasks.md` to understand which tasks are affected
|
|
38
|
+
- Read `spec.md` to check if the spec assumed simpler architecture
|
|
39
|
+
- Check completed tasks for potential impact
|
|
40
|
+
|
|
41
|
+
### Step 3: CLASSIFY and PROPOSE
|
|
42
|
+
|
|
43
|
+
Present the recommendation to the user:
|
|
44
|
+
|
|
45
|
+
| Impact | Action | When |
|
|
46
|
+
|--------|--------|------|
|
|
47
|
+
| **Low** (1-3 tasks) | Task Expansion | The task is bigger than expected, but scope is contained |
|
|
48
|
+
| **Medium** (4+ tasks, spec ok) | Regress to tasks | Multiple tasks need rewriting, but the spec is correct |
|
|
49
|
+
| **High** (spec wrong) | Regress to design | The spec made incorrect assumptions about the codebase |
|
|
50
|
+
|
|
51
|
+
Explain WHY you recommend this classification based on the evidence.
|
|
52
|
+
|
|
53
|
+
### Step 4: APPROVE
|
|
54
|
+
|
|
55
|
+
Pause and wait for user confirmation using `AskUserQuestion`:
|
|
56
|
+
|
|
57
|
+
- "Do you agree with the [impact] classification?"
|
|
58
|
+
- "Should we proceed with [action]?"
|
|
59
|
+
- Allow override: "Or would you prefer a different target phase?"
|
|
60
|
+
|
|
61
|
+
**DO NOT proceed without explicit user approval.**
|
|
62
|
+
|
|
63
|
+
### Step 5: EXECUTE
|
|
64
|
+
|
|
65
|
+
Based on approved action:
|
|
66
|
+
|
|
67
|
+
**For expansion (low impact):**
|
|
68
|
+
```bash
|
|
69
|
+
npx morph-spec task expand <feature> <task-id> --into "T017a: <title>" "T017b: <title>" ...
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
**For regression (medium/high impact):**
|
|
73
|
+
```bash
|
|
74
|
+
npx morph-spec scope escalate <feature> --task <id> --reason "<reason>"
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Or with target override:
|
|
78
|
+
```bash
|
|
79
|
+
npx morph-spec scope escalate <feature> --task <id> --reason "<reason>" --target design
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Step 6: GUIDE Next Steps
|
|
83
|
+
|
|
84
|
+
After escalation:
|
|
85
|
+
|
|
86
|
+
- **If regressed to tasks:** "Re-analyze the affected tasks. Rewrite tasks.md with accurate scope. Run `/morph-proposal <feature>` to continue from the tasks phase."
|
|
87
|
+
- **If regressed to design:** "Re-analyze the spec. Update spec.md with the discovered architecture. Then regenerate tasks."
|
|
88
|
+
- **If expanded:** "Continue implementing. Use `morph-spec task start <feature> <sub-task-id>` to start the first sub-task."
|
|
89
|
+
|
|
90
|
+
Always remind: "Completed tasks flagged with `needsReview` should be checked for compatibility with the new scope."
|
|
91
|
+
|
|
92
|
+
## Anti-Patterns
|
|
93
|
+
|
|
94
|
+
- **DO NOT** skip the approval step
|
|
95
|
+
- **DO NOT** escalate without evidence — read the actual code first
|
|
96
|
+
- **DO NOT** regress to design when only tasks need rewriting
|
|
97
|
+
- **DO NOT** expand when 4+ tasks are affected — regress instead
|