@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
package/framework/skills/level-0-meta/{post-implementation → morph-post-implementation}/SKILL.md
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: post-implementation
|
|
2
|
+
name: morph:post-implementation
|
|
3
3
|
description: Orquestra o fluxo completo pós-implementação: detecção de stack,
|
|
4
4
|
scans automáticos (C#/Next.js), testes, validate-feature, smoke test via
|
|
5
5
|
Playwright (obrigatório se dev server ativo), checklist de code review por
|
|
@@ -28,7 +28,7 @@ allowed-tools: Read, Write, Edit, Bash, Glob, Grep, Task,
|
|
|
28
28
|
## Step 1 — Detectar Stack
|
|
29
29
|
|
|
30
30
|
```bash
|
|
31
|
-
node .claude/skills/post-implementation/scripts/detect-stack.mjs
|
|
31
|
+
node .claude/skills/morph-post-implementation/scripts/detect-stack.mjs
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
Output JSON: `{ stack: "DOTNET" | "NEXTJS" | "FULLSTACK" | "UNKNOWN", frontendPath, backendPath, startCommand }`
|
|
@@ -49,20 +49,20 @@ Execute os scans automáticos conforme o stack detectado.
|
|
|
49
49
|
### Se DOTNET ou FULLSTACK:
|
|
50
50
|
|
|
51
51
|
```bash
|
|
52
|
-
node .claude/skills/code-review/scripts/scan-csharp.mjs --diff
|
|
52
|
+
node .claude/skills/morph-code-review/scripts/scan-csharp.mjs --diff
|
|
53
53
|
```
|
|
54
54
|
|
|
55
55
|
### Se NEXTJS ou FULLSTACK:
|
|
56
56
|
|
|
57
57
|
```bash
|
|
58
|
-
node .claude/skills/code-review-nextjs/scripts/scan-nextjs.mjs --diff
|
|
58
|
+
node .claude/skills/morph-code-review-nextjs/scripts/scan-nextjs.mjs --diff
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
**🚫 BLOCK se qualquer finding CRITICAL encontrado.**
|
|
62
62
|
|
|
63
63
|
Corrija todos os CRITICALs antes de continuar. Para revisar a lista completa de checks:
|
|
64
|
-
- .NET: `/code-review`
|
|
65
|
-
- Next.js: `/code-review-nextjs`
|
|
64
|
+
- .NET: `/morph:code-review`
|
|
65
|
+
- Next.js: `/morph:code-review-nextjs`
|
|
66
66
|
|
|
67
67
|
---
|
|
68
68
|
|
|
@@ -109,7 +109,7 @@ Leia o output de validação, corrija os issues reportados e re-execute até pas
|
|
|
109
109
|
### 5a. Detectar Dev Server
|
|
110
110
|
|
|
111
111
|
```bash
|
|
112
|
-
node .claude/skills/post-implementation/scripts/detect-dev-server.mjs "<startCommand>"
|
|
112
|
+
node .claude/skills/morph-post-implementation/scripts/detect-dev-server.mjs "<startCommand>"
|
|
113
113
|
```
|
|
114
114
|
|
|
115
115
|
Passe o `startCommand` retornado pelo detect-stack no Step 1.
|
|
@@ -140,7 +140,7 @@ await mcp__playwright__browser_console_messages({ level: 'error' });
|
|
|
140
140
|
// Screenshot para documentação
|
|
141
141
|
await mcp__playwright__browser_take_screenshot({
|
|
142
142
|
type: 'png',
|
|
143
|
-
filename: '.morph/features/$ARGUMENTS/
|
|
143
|
+
filename: '.morph/features/$ARGUMENTS/5-implement/smoke-screenshots/smoke-<timestamp>.png'
|
|
144
144
|
});
|
|
145
145
|
```
|
|
146
146
|
|
|
@@ -181,7 +181,7 @@ Não é possível prosseguir para criação de PR sem smoke test ou confirmaçã
|
|
|
181
181
|
|
|
182
182
|
## Step 6 — Code Review Checklist (CRITICAL + HIGH)
|
|
183
183
|
|
|
184
|
-
> Antes de revisar, leia: `.claude/skills/code-review/references/review-guidelines.md` — aplique confidence ≥ 75, ignore violações pré-existentes, inclua file:line em cada finding.
|
|
184
|
+
> Antes de revisar, leia: `.claude/skills/morph-code-review/references/review-guidelines.md` — aplique confidence ≥ 75, ignore violações pré-existentes, inclua file:line em cada finding.
|
|
185
185
|
|
|
186
186
|
Revise os itens mais importantes por stack. Para review completo, use os skills dedicados.
|
|
187
187
|
|
|
@@ -191,14 +191,14 @@ Dispatch dois subagents em paralelo (Task tool):
|
|
|
191
191
|
|
|
192
192
|
**Subagent 1 — Backend Review:**
|
|
193
193
|
> Revisor .NET focado. Escopo: APENAS arquivos .cs alterados (git diff main...HEAD).
|
|
194
|
-
> Run: `node .claude/skills/code-review/scripts/scan-csharp.mjs --diff`
|
|
194
|
+
> Run: `node .claude/skills/morph-code-review/scripts/scan-csharp.mjs --diff`
|
|
195
195
|
> Depois revisar manualmente itens CRITICAL+HIGH do checklist .NET.
|
|
196
196
|
> Aplicar review-guidelines.md: confidence ≥ 75, skip pré-existentes.
|
|
197
197
|
> Output: findings com file:line, ou "✅ Sem CRITICAL/HIGH em backend alterado."
|
|
198
198
|
|
|
199
199
|
**Subagent 2 — Frontend Review:**
|
|
200
200
|
> Revisor Next.js focado. Escopo: APENAS arquivos .tsx/.ts alterados (git diff main...HEAD).
|
|
201
|
-
> Run: `node .claude/skills/code-review-nextjs/scripts/scan-nextjs.mjs --diff`
|
|
201
|
+
> Run: `node .claude/skills/morph-code-review-nextjs/scripts/scan-nextjs.mjs --diff`
|
|
202
202
|
> Depois revisar manualmente itens CRITICAL+HIGH do checklist Next.js.
|
|
203
203
|
> Aplicar review-guidelines.md: confidence ≥ 75, skip pré-existentes.
|
|
204
204
|
> Output: findings com file:line, ou "✅ Sem CRITICAL/HIGH em frontend alterado."
|
|
@@ -222,14 +222,14 @@ Aguardar ambos. **🚫 BLOCK se algum retornar CRITICAL não resolvido.**
|
|
|
222
222
|
[ ] DTOs com nomes descritivos + tipos corretos
|
|
223
223
|
```
|
|
224
224
|
|
|
225
|
-
> Para lista completa: `/code-review`
|
|
225
|
+
> Para lista completa: `/morph:code-review`
|
|
226
226
|
|
|
227
227
|
### Se NEXTJS:
|
|
228
228
|
|
|
229
229
|
**Itens CRITICAL e HIGH — Next.js:**
|
|
230
230
|
|
|
231
231
|
```
|
|
232
|
-
[ ] node .claude/skills/code-review-nextjs/scripts/scan-nextjs.mjs --diff → 0 CRITICAL
|
|
232
|
+
[ ] node .claude/skills/morph-code-review-nextjs/scripts/scan-nextjs.mjs --diff → 0 CRITICAL
|
|
233
233
|
[ ] File names em kebab-case (user-card.tsx, não UserCard.tsx)
|
|
234
234
|
[ ] 'use client' apenas em componentes com hooks/event handlers
|
|
235
235
|
[ ] Sem useEffect para data fetching → Server Component ou useQuery
|
|
@@ -241,7 +241,7 @@ Aguardar ambos. **🚫 BLOCK se algum retornar CRITICAL não resolvido.**
|
|
|
241
241
|
[ ] Sem any type annotation
|
|
242
242
|
```
|
|
243
243
|
|
|
244
|
-
> Para lista completa: `/code-review-nextjs`
|
|
244
|
+
> Para lista completa: `/morph:code-review-nextjs`
|
|
245
245
|
|
|
246
246
|
**🚫 BLOCK se qualquer item CRITICAL não estiver resolvido.**
|
|
247
247
|
|
|
@@ -259,7 +259,52 @@ npx morph-spec generate recap $ARGUMENTS
|
|
|
259
259
|
|
|
260
260
|
---
|
|
261
261
|
|
|
262
|
-
## Step 8 —
|
|
262
|
+
## Step 8 — Finish Worktree
|
|
263
|
+
|
|
264
|
+
Implementation is complete. If the feature was developed in a morph worktree, finalize it now.
|
|
265
|
+
|
|
266
|
+
**Check if a worktree exists:**
|
|
267
|
+
```bash
|
|
268
|
+
git worktree list | grep morph/
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
**If a `morph/{feature}` worktree exists:**
|
|
272
|
+
|
|
273
|
+
Invoke the finishing-a-development-branch skill:
|
|
274
|
+
```
|
|
275
|
+
Skill(superpowers:finishing-a-development-branch)
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
This skill will:
|
|
279
|
+
1. Verify tests pass
|
|
280
|
+
2. Present 4 options:
|
|
281
|
+
- **Merge locally** → merge into base branch + delete worktree
|
|
282
|
+
- **Push and create PR** → push branch + create GitHub PR (keeps worktree)
|
|
283
|
+
- **Keep as-is** → no action (worktree preserved for later)
|
|
284
|
+
- **Discard** → delete branch + worktree (requires typed confirmation)
|
|
285
|
+
3. Clean up worktree for options 1 and 4
|
|
286
|
+
|
|
287
|
+
**If NOT in a worktree** (legacy mode): skip this step and proceed to Step 9.
|
|
288
|
+
|
|
289
|
+
> **Note:** If the `superpowers` plugin is not installed, create the PR manually:
|
|
290
|
+
> `gh pr create --title "feat({feature}): <description>" --body "..."`
|
|
291
|
+
|
|
292
|
+
---
|
|
293
|
+
|
|
294
|
+
## Step 9 — Pre-PR Compliance Checklist
|
|
295
|
+
|
|
296
|
+
Antes de criar o PR, invoque o checklist de compliance:
|
|
297
|
+
|
|
298
|
+
```
|
|
299
|
+
Skill(morph:checklist)
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
Este skill verifica: segurança, SEO, performance, acessibilidade e conformidade LGPD.
|
|
303
|
+
**🚫 BLOCK se qualquer item CRITICAL não estiver resolvido.**
|
|
304
|
+
|
|
305
|
+
---
|
|
306
|
+
|
|
307
|
+
## Step 10 — PR Suggestion
|
|
263
308
|
|
|
264
309
|
Quando todos os steps passarem, sugira o PR:
|
|
265
310
|
|
|
@@ -307,6 +352,8 @@ EOF
|
|
|
307
352
|
| Step 5 | Dev server ativo + smoke test com falha |
|
|
308
353
|
| Step 5 | Dev server não detectado sem confirmação explícita do usuário |
|
|
309
354
|
| Step 6 | Qualquer item CRITICAL não resolvido no checklist manual |
|
|
355
|
+
| Step 8 | Tests failing in worktree before merge/PR |
|
|
356
|
+
| Step 9 | Item CRITICAL no `morph:checklist` não resolvido |
|
|
310
357
|
|
|
311
358
|
**Todos os BLOCKs devem ser resolvidos antes de criar o PR.**
|
|
312
359
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: morph
|
|
2
|
+
name: morph:replicate
|
|
3
3
|
description: Simplified workflow for converting HTML prototypes into functional Blazor components, extracting design patterns and mapping HTML elements to Fluent UI/MudBlazor equivalents. Use when an approved HTML prototype exists and needs conversion to Blazor without a full MORPH-SPEC spec pipeline.
|
|
4
4
|
user-invocable: true
|
|
5
5
|
argument-hint: "[feature-name] [prototype-path]"
|
|
@@ -14,12 +14,12 @@ allowed-tools: Read, Write, Edit, Bash, Glob, Grep
|
|
|
14
14
|
## Comando
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
|
-
/morph
|
|
17
|
+
/morph:replicate {feature-name} {prototype-path}
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
**Exemplo:**
|
|
21
21
|
```bash
|
|
22
|
-
/morph
|
|
22
|
+
/morph:replicate ui-redesign prototipo/
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
---
|
|
@@ -154,7 +154,7 @@ Este workflow gera apenas:
|
|
|
154
154
|
## Exemplo de Execucao
|
|
155
155
|
|
|
156
156
|
```markdown
|
|
157
|
-
/morph
|
|
157
|
+
/morph:replicate checkout-redesign prototipo/checkout/
|
|
158
158
|
|
|
159
159
|
📁 Analisando prototipo em prototipo/checkout/...
|
|
160
160
|
|
|
@@ -197,7 +197,7 @@ Mapeamento HTML → Blazor:
|
|
|
197
197
|
|
|
198
198
|
## Quando Usar
|
|
199
199
|
|
|
200
|
-
- ✅ Prototipo HTML pronto (
|
|
200
|
+
- ✅ Prototipo HTML pronto (hand-coded, exported, etc.)
|
|
201
201
|
- ✅ Design ja aprovado pelo cliente
|
|
202
202
|
- ✅ Apenas conversao visual (sem logica de negocio nova)
|
|
203
203
|
- ✅ Codigo Blazor existente para atualizar
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# HTML → Blazor Component Mapping Reference
|
|
2
2
|
|
|
3
3
|
> Reference for converting HTML prototype elements to Fluent UI / MudBlazor equivalents.
|
|
4
|
-
> Used during FASE 1 of the `/morph
|
|
4
|
+
> Used during FASE 1 of the `/morph:replicate` workflow.
|
|
5
5
|
|
|
6
6
|
## Common Component Mappings
|
|
7
7
|
|
package/framework/skills/level-0-meta/{simulation-checklist → morph-simulation-checklist}/SKILL.md
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: simulation-checklist
|
|
2
|
+
name: morph:simulation-checklist
|
|
3
3
|
description: Checklist for implementing mock/simulation clients for external .NET services (AI APIs, payments, email). Use when setting up simulation mode without real API access, when creating fake service implementations for development/testing, or when debugging external service integrations.
|
|
4
4
|
user-invocable: true
|
|
5
5
|
allowed-tools: Read, Write, Edit, Bash, Glob, Grep
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: terminal-title
|
|
2
|
+
name: morph:terminal-title
|
|
3
3
|
description: Manually set the terminal window title for the current task. Use when you need to override the automatic title set by the hook, or to set a specific descriptive title for the current work context.
|
|
4
4
|
argument-hint: "[title]"
|
|
5
5
|
user-invocable: true
|
|
@@ -46,7 +46,7 @@ Fix: Auth Login Bug
|
|
|
46
46
|
Run the title script with the desired title:
|
|
47
47
|
|
|
48
48
|
```bash
|
|
49
|
-
bash .claude/skills/terminal-title/scripts/set_title.sh "Fix: Auth Login Bug"
|
|
49
|
+
bash .claude/skills/morph-terminal-title/scripts/set_title.sh "Fix: Auth Login Bug"
|
|
50
50
|
```
|
|
51
51
|
|
|
52
52
|
No confirmation needed — executes silently in the background.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: tool-usage-guide
|
|
2
|
+
name: morph:tool-usage-guide
|
|
3
3
|
description: Decision flowchart and per-phase reference for selecting the right Claude Code tool (Read, Grep, Glob, Bash, Task) or MCP tool in MORPH-SPEC workflows. Use when unsure which tool to use for a given action, when choosing between native tools and MCPs, or when deciding whether to use a subagent vs direct tools.
|
|
4
4
|
user-invocable: true
|
|
5
5
|
allowed-tools: Read, Write, Edit, Bash, Glob, Grep
|
|
@@ -137,7 +137,7 @@ Critério: se a leitura de arquivo B não depende do CONTEÚDO de arquivo A, lei
|
|
|
137
137
|
|------|----------------|---------------------|
|
|
138
138
|
| Proposal | GitHub (opcional) | Não |
|
|
139
139
|
| Setup | GitHub (opcional) | Não |
|
|
140
|
-
| UI/UX | Playwright,
|
|
140
|
+
| UI/UX | Playwright, Context7 | Não |
|
|
141
141
|
| Design | Supabase, Context7, GitHub | Sim (domain-architect + schema em paralelo) |
|
|
142
142
|
| Clarify | Context7, GitHub | Não |
|
|
143
143
|
| Tasks | Context7, GitHub | Sim (quando spec tem 20+ reqs ou 3+ domínios) |
|
|
@@ -167,7 +167,6 @@ Critério: se a leitura de arquivo B não depende do CONTEÚDO de arquivo A, lei
|
|
|
167
167
|
|-----|-------------|----------|
|
|
168
168
|
| **Supabase** | Schema analysis, migrations, RLS | Grep + Read code files |
|
|
169
169
|
| **GitHub** | Issues, PRs, repo metadata, code search | Bash `gh` CLI |
|
|
170
|
-
| **Figma** | Design tokens, component specs | Read CSS/SCSS files |
|
|
171
170
|
| **Context7** | Library documentation lookups | WebSearch + WebFetch |
|
|
172
171
|
| **Playwright** | Browser automation, screenshots, page inspection, smoke tests | WebFetch (read-only), Manual testing |
|
|
173
172
|
| **Azure** | Cloud resource management | Bash `az` CLI |
|
|
@@ -216,7 +215,7 @@ For the canonical list of MCPs, their tools, phase relevance, and fallbacks, see
|
|
|
216
215
|
|-------|-------------|----------|
|
|
217
216
|
| Proposal | Context7 | WebSearch |
|
|
218
217
|
| Setup | GitHub | `gh` CLI |
|
|
219
|
-
| UI/UX | Playwright,
|
|
218
|
+
| UI/UX | Playwright, Context7 | WebFetch, Read CSS |
|
|
220
219
|
| Design | Supabase, Context7, GitHub | Grep + Read code |
|
|
221
220
|
| Clarify | Context7, GitHub | WebSearch |
|
|
222
221
|
| Tasks | Context7, GitHub | WebSearch, `gh` CLI |
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
| Detect project stack | **Read** `.morph/framework/agents.json` → match keywords → **Bash** `npx morph-spec state add-agent` | agents.json is the source of truth |
|
|
18
18
|
| Research external requirement | **WebSearch** | Current information needed |
|
|
19
19
|
| Render proposal template | **Bash** `npx morph-spec template render docs/proposal ...` | CLI command |
|
|
20
|
-
| Update state | **Bash** `npx morph-spec state mark-output
|
|
20
|
+
| Update state | **Bash** `npx morph-spec state mark-output {feature} proposal` | CLI command |
|
|
21
21
|
|
|
22
22
|
**MCPs used:** None typically. GitHub MCP if feature comes from an issue.
|
|
23
23
|
|
|
@@ -62,7 +62,6 @@
|
|
|
62
62
|
| Read user-provided screenshots | **Read** (image files) | Claude Code reads images natively |
|
|
63
63
|
| Search for existing CSS variables | **Grep** `--root:` or `--color-` in `*.css,*.scss` | Find existing design tokens |
|
|
64
64
|
| Find existing UI components | **Glob** `**/Components/**/*.razor` or `**/components/**/*.tsx` | Existing patterns |
|
|
65
|
-
| Get Figma design tokens | **Figma MCP** `get_file({ fileKey })` | Extract colors, typography from Figma |
|
|
66
65
|
| Look up component library API | **Context7 MCP** `query_docs({ libraryId, query })` | Accurate component props/events |
|
|
67
66
|
| Preview de página existente | **Playwright MCP** `browser_navigate()` + `browser_take_screenshot()` | **WebFetch** URL |
|
|
68
67
|
| Inspecionar estrutura da página | **Playwright MCP** `browser_snapshot()` | **WebFetch** + parse manual |
|
|
@@ -70,9 +69,9 @@
|
|
|
70
69
|
| Search for design references | **WebSearch** + **WebFetch** | External inspiration |
|
|
71
70
|
| Render UI templates | **Bash** `npx morph-spec template render docs/ui-mockups ...` | CLI command |
|
|
72
71
|
| Generate design system from CSS | **Bash** `npx morph-spec generate design-system --scan` | CLI command |
|
|
73
|
-
| Update state | **Bash** `npx morph-spec state mark-output
|
|
72
|
+
| Update state | **Bash** `npx morph-spec state mark-output {feature} uiDesignSystem && npx morph-spec state mark-output {feature} uiMockups && npx morph-spec state mark-output {feature} uiComponents && npx morph-spec state mark-output {feature} uiFlows` | CLI command |
|
|
74
73
|
|
|
75
|
-
**MCPs used:**
|
|
74
|
+
**MCPs used:** Playwright (live preview, page inspection), Context7 (component docs).
|
|
76
75
|
|
|
77
76
|
**Anti-patterns:**
|
|
78
77
|
- ❌ WebSearch for MudBlazor docs (use Context7 MCP — more accurate)
|
|
@@ -104,7 +103,7 @@
|
|
|
104
103
|
| Render spec template | **Bash** `npx morph-spec template render docs/spec ...` | CLI command |
|
|
105
104
|
| Render decisions template | **Bash** `npx morph-spec template render docs/decisions ...` | CLI command |
|
|
106
105
|
| Create schema-analysis.md | **Write** to output directory | Document findings |
|
|
107
|
-
| Update state | **Bash** `npx morph-spec state mark-output
|
|
106
|
+
| Update state | **Bash** `npx morph-spec state mark-output {feature} schemaAnalysis && npx morph-spec state mark-output {feature} spec && npx morph-spec state mark-output {feature} contracts && npx morph-spec state mark-output {feature} decisions` | CLI command |
|
|
108
107
|
|
|
109
108
|
**MCPs used:** Supabase (schema analysis), Context7 (library research), GitHub (code search).
|
|
110
109
|
|
|
@@ -133,7 +132,7 @@
|
|
|
133
132
|
| Research edge case behavior | **WebSearch** | External knowledge for edge cases |
|
|
134
133
|
| Update spec with clarifications | **Edit** spec.md | Preserve existing content, add sections |
|
|
135
134
|
| Create clarifications.md | **Bash** `npx morph-spec template render docs/clarifications ...` | Use template |
|
|
136
|
-
| Update state | **Bash** `npx morph-spec state mark-output
|
|
135
|
+
| Update state | **Bash** `npx morph-spec state mark-output {feature} clarifications` | CLI command |
|
|
137
136
|
|
|
138
137
|
**MCPs used:** Context7 (validate feasibility), GitHub (known issues).
|
|
139
138
|
|
|
@@ -159,6 +158,7 @@
|
|
|
159
158
|
| Create GitHub issues from tasks | **GitHub MCP** `create_issue()` | Sync tasks to project management |
|
|
160
159
|
| **Fallback:** Create issues via CLI | **Bash** `gh issue create ...` | When no GitHub MCP |
|
|
161
160
|
| Render tasks template | **Bash** `npx morph-spec template render docs/tasks ...` | CLI command |
|
|
161
|
+
| Mark tasks output | **Bash** `npx morph-spec state mark-output {feature} tasks` | CLI command |
|
|
162
162
|
| Update state with task count | **Bash** `npx morph-spec state set ... tasks.total N` | CLI command |
|
|
163
163
|
|
|
164
164
|
**MCPs used:** Context7 (complexity estimation), GitHub (issue creation).
|
|
@@ -195,7 +195,7 @@
|
|
|
195
195
|
| Smoke test feature no browser | **Playwright MCP** `browser_navigate()` + `browser_snapshot()` | Manual testing |
|
|
196
196
|
| Verificar erros de console | **Playwright MCP** `browser_console_messages()` | Browser DevTools |
|
|
197
197
|
| Screenshot para recap.md | **Playwright MCP** `browser_take_screenshot()` | Manual screenshot |
|
|
198
|
-
|
|
|
198
|
+
| Mark recap output | **Bash** `npx morph-spec state mark-output {feature} recap` | CLI command |
|
|
199
199
|
|
|
200
200
|
**MCPs used:** Supabase (migrations, RLS), Context7 (API lookup), GitHub (PRs), Playwright (smoke test, verification).
|
|
201
201
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: verification-before-completion
|
|
2
|
+
name: morph:verification-before-completion
|
|
3
3
|
description: Phase-specific verification checklists and morph-spec validation commands for confirming MORPH-SPEC outputs are complete and correct. Use before marking any task done, before advancing to the next phase, before committing, or before creating PRs.
|
|
4
4
|
user-invocable: true
|
|
5
5
|
argument-hint: "[feature-name] [phase?]"
|
|
@@ -9,7 +9,7 @@ argument-hint: "[feature-name] [phase?]"
|
|
|
9
9
|
|
|
10
10
|
> Never claim work is complete without running verification. Evidence before assertions.
|
|
11
11
|
>
|
|
12
|
-
> **Script:** Run `node .claude/skills/verification-before-completion/scripts/check-phase-outputs.mjs <feature> [phase]` to check required output files exist.
|
|
12
|
+
> **Script:** Run `node .claude/skills/morph-verification-before-completion/scripts/check-phase-outputs.mjs <feature> [phase]` to check required output files exist.
|
|
13
13
|
|
|
14
14
|
## When to Use
|
|
15
15
|
|
|
@@ -35,10 +35,10 @@ const PHASE_OUTPUTS = {
|
|
|
35
35
|
{ file: '2-ui/flows.md', required: false },
|
|
36
36
|
],
|
|
37
37
|
tasks: [
|
|
38
|
-
{ file: '
|
|
38
|
+
{ file: '4-tasks/tasks.md', required: true },
|
|
39
39
|
],
|
|
40
40
|
implement: [
|
|
41
|
-
{ file: '
|
|
41
|
+
{ file: '5-implement/recap.md', required: true },
|
|
42
42
|
],
|
|
43
43
|
};
|
|
44
44
|
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: morph:phase-clarify
|
|
3
|
+
description: MORPH-SPEC Phase 3 (Clarify). Iterative clarification loop driven by a satisfaction score (0-100). Generates targeted questions per round, always presents "Encerrar Clarify" as exit option, and stops when score ≥ 85 or user exits. Use after design approval to eliminate spec ambiguities before task breakdown begins.
|
|
4
|
+
argument-hint: "[feature-name]"
|
|
5
|
+
user-invocable: false
|
|
6
|
+
allowed-tools: Read, Write, Edit, Bash, Glob, Grep
|
|
7
|
+
cliVersion: "4.10.0"
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# MORPH Clarify - FASE 3
|
|
11
|
+
|
|
12
|
+
> INTERNAL: Workflow skill used by /morph-proposal during automated phase orchestration. Not a user command.
|
|
13
|
+
|
|
14
|
+
Elimine ambiguidades da especificação através de um loop iterativo de perguntas até que o spec tenha qualidade suficiente para gerar tasks.
|
|
15
|
+
|
|
16
|
+
## Pré-requisitos
|
|
17
|
+
|
|
18
|
+
- [ ] FASE 2 (Design) concluída
|
|
19
|
+
- [ ] `spec.md` aprovado pelo usuário
|
|
20
|
+
- [ ] `contracts.cs` definidos
|
|
21
|
+
|
|
22
|
+
## Ferramentas Recomendadas
|
|
23
|
+
|
|
24
|
+
> **Ref:** `framework/skills/level-0-meta/morph-tool-usage-guide/SKILL.md` para guia completo.
|
|
25
|
+
> **Example:** `references/clarifications-example.md` — filled-in clarifications.md showing expected Q&A format.
|
|
26
|
+
|
|
27
|
+
| Ação | Ferramenta |
|
|
28
|
+
|------|------------|
|
|
29
|
+
| Ler spec.md + contracts.cs | **Read** |
|
|
30
|
+
| Verificar viabilidade técnica | **Context7 MCP** `query_docs()` |
|
|
31
|
+
| Verificar issues/limitações externas | **GitHub MCP** `search_issues()` |
|
|
32
|
+
| Atualizar spec com clarificações | **Edit** spec.md |
|
|
33
|
+
| Criar clarifications.md | **Write** |
|
|
34
|
+
| Atualizar state | **Bash** `npx morph-spec state mark-output $ARGUMENTS clarifications` |
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Sistema de Pontuação de Satisfação
|
|
39
|
+
|
|
40
|
+
Antes de cada round, calcule o **Satisfaction Score (0–100)** avaliando o spec atual:
|
|
41
|
+
|
|
42
|
+
| Dimensão | Pts | Critério de máxima pontuação |
|
|
43
|
+
|----------|-----|------------------------------|
|
|
44
|
+
| **Completude funcional** | 25 | Todos os requisitos têm critérios de aceitação mensuráveis (sem "deve", "pode", "em geral") |
|
|
45
|
+
| **Cobertura de falhas** | 20 | Todos os caminhos de erro têm comportamento definido (invalid input, not found, timeout, unauthorized) |
|
|
46
|
+
| **Edge cases** | 20 | Limites, estados concorrentes, inputs vazios/extremos documentados |
|
|
47
|
+
| **Clareza definitória** | 20 | Nenhum termo crítico sem definição, nenhum "TBD", nenhum "a definir" |
|
|
48
|
+
| **Contratos de integração** | 15 | Dependências externas têm formato de payload, erros e retry policy definidos |
|
|
49
|
+
|
|
50
|
+
**Thresholds:**
|
|
51
|
+
|
|
52
|
+
| Score | Ação |
|
|
53
|
+
|-------|------|
|
|
54
|
+
| ≥ 85 | Claude está satisfeito. Apresentar resultado e oferecer "Encerrar" como opção principal |
|
|
55
|
+
| 70–84 | Continuar. Focar perguntas nas dimensões com menor pontuação |
|
|
56
|
+
| < 70 | Continuar. Perguntas amplas cobrindo as maiores lacunas |
|
|
57
|
+
|
|
58
|
+
> O score sobe conforme as respostas são incorporadas. Não há número máximo fixo de rounds — o loop para quando o score ≥ 85 **ou** quando o usuário escolhe encerrar.
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Workflow
|
|
63
|
+
|
|
64
|
+
### Inicialização
|
|
65
|
+
|
|
66
|
+
**PASSO 0 (ANTES de qualquer escrita) — Garantir fase clarify:**
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
npx morph-spec state get $ARGUMENTS
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Verifique o campo `"phase"` no output:
|
|
73
|
+
|
|
74
|
+
**Se `"phase": "clarify"`** → ✅ fase correta, prossiga.
|
|
75
|
+
|
|
76
|
+
**Se `"phase": "design"`** → execute em sequência:
|
|
77
|
+
1. `npx morph-spec approve $ARGUMENTS design`
|
|
78
|
+
2. `npx morph-spec phase advance $ARGUMENTS` (→ clarify)
|
|
79
|
+
|
|
80
|
+
**Qualquer outro valor** → ⛔ não prossiga — estado inconsistente, reporte ao usuário.
|
|
81
|
+
|
|
82
|
+
> **Regra:** Nunca escreva `clarifications.md` ou atualize `spec.md` enquanto a fase não for `clarify`.
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
Leia os arquivos base:
|
|
87
|
+
- `.morph/features/$ARGUMENTS/1-design/spec.md`
|
|
88
|
+
- `.morph/features/$ARGUMENTS/1-design/contracts.cs`
|
|
89
|
+
- `.morph/features/$ARGUMENTS/1-design/schema-analysis.md` (se existir)
|
|
90
|
+
|
|
91
|
+
Calcule o score inicial. Registre mentalmente as respostas acumuladas de rounds anteriores para não repetir perguntas já respondidas.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
### Loop Principal
|
|
96
|
+
|
|
97
|
+
**Repita até: score ≥ 85 OU usuário escolhe encerrar.**
|
|
98
|
+
|
|
99
|
+
#### A. Calcular Score do Round Atual
|
|
100
|
+
|
|
101
|
+
Pontue cada dimensão com base no spec + respostas acumuladas. Anote quais dimensões estão mais fracas — elas guiam as perguntas deste round.
|
|
102
|
+
|
|
103
|
+
#### B. Identificar Questões Novas
|
|
104
|
+
|
|
105
|
+
Analise apenas o que **ainda não foi respondido**. Categorize por dimensão:
|
|
106
|
+
|
|
107
|
+
| Categoria | Exemplos de questões |
|
|
108
|
+
|-----------|----------------------|
|
|
109
|
+
| **Validação** | Limites de campo, formatos aceitos, regras de negócio |
|
|
110
|
+
| **Comportamento** | O que acontece quando X falha? Estado vazio? Loading? |
|
|
111
|
+
| **Prioridade** | Must-have vs nice-to-have? MVP vs v2? |
|
|
112
|
+
| **Integração** | Webhook vs polling? Retry policy? Timeout? |
|
|
113
|
+
| **Performance** | Volume esperado? SLA de resposta? |
|
|
114
|
+
| **UX** | Mensagem de erro exibida ao usuário? Feedback visual? |
|
|
115
|
+
|
|
116
|
+
#### C. Apresentar Perguntas via `AskUserQuestion`
|
|
117
|
+
|
|
118
|
+
**Regras obrigatórias:**
|
|
119
|
+
|
|
120
|
+
1. Use `AskUserQuestion` — **NUNCA liste perguntas como texto simples**
|
|
121
|
+
2. Máximo **4 perguntas por chamada** (incluindo a opção de encerrar)
|
|
122
|
+
3. Se houver mais de 3 questões novas, faça chamadas sequenciais — mas a **opção de encerrar aparece SEMPRE na última chamada de cada round**
|
|
123
|
+
4. **SEMPRE inclua a seguinte pergunta como última do último batch de cada round:**
|
|
124
|
+
|
|
125
|
+
```json
|
|
126
|
+
{
|
|
127
|
+
"header": "Encerrar?",
|
|
128
|
+
"question": "Deseja encerrar a fase Clarify agora ou continuar refinando o spec?",
|
|
129
|
+
"multiSelect": false,
|
|
130
|
+
"options": [
|
|
131
|
+
{
|
|
132
|
+
"label": "Continuar refinando",
|
|
133
|
+
"description": "Claude identificou mais questões abertas neste round"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"label": "Encerrar Clarify",
|
|
137
|
+
"description": "Prosseguir para fase Tasks com o spec no estado atual"
|
|
138
|
+
}
|
|
139
|
+
]
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
> Se score ≥ 85, ajuste o label da primeira opção para: `"Continuar (opcional)"` com description: `"Score ${score}/100 — spec está satisfatório, mas você pode refinar mais"`
|
|
144
|
+
|
|
145
|
+
#### D. Aguardar e Incorporar Respostas
|
|
146
|
+
|
|
147
|
+
**Não avance antes de receber todas as respostas.**
|
|
148
|
+
|
|
149
|
+
Após receber:
|
|
150
|
+
1. Verifique se a resposta é consistente com `contracts.cs` e `schema-analysis.md`
|
|
151
|
+
2. Se alguma resposta for ambígua ou contraditória → peça esclarecimento antes de atualizar
|
|
152
|
+
3. Atualize `spec.md` com:
|
|
153
|
+
- Seção `## Clarifications (FASE 3)` com Q&A estruturado
|
|
154
|
+
- Atualização das seções funcionais afetadas
|
|
155
|
+
- Novos edge cases em `## Edge Cases`
|
|
156
|
+
|
|
157
|
+
#### E. Verificar Condição de Saída
|
|
158
|
+
|
|
159
|
+
- Usuário escolheu **"Encerrar Clarify"** → sair do loop
|
|
160
|
+
- Score ≥ 85 E nenhuma questão nova identificada → sair do loop
|
|
161
|
+
- Caso contrário → voltar para A
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
### Pós-Loop: Gerar Outputs
|
|
166
|
+
|
|
167
|
+
**Passo 1: Criar `clarifications.md`**
|
|
168
|
+
|
|
169
|
+
Escreva em `.morph/features/$ARGUMENTS/1-design/clarifications.md`:
|
|
170
|
+
|
|
171
|
+
```markdown
|
|
172
|
+
# Clarifications — {Feature Name}
|
|
173
|
+
|
|
174
|
+
**Fase:** CLARIFY (Fase 3)
|
|
175
|
+
**Rounds realizados:** {N}
|
|
176
|
+
**Score final:** {score}/100
|
|
177
|
+
**Status:** Resolvido — incorporado em spec.md
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## Questions & Answers
|
|
182
|
+
|
|
183
|
+
### Q{N}: {Título}
|
|
184
|
+
**Question:** {pergunta}
|
|
185
|
+
**Answer:** {resposta do usuário}
|
|
186
|
+
**Spec Updates:** {quais seções foram atualizadas}
|
|
187
|
+
**Priority:** High/Medium/Low
|
|
188
|
+
**Resolved:** ✅ Yes
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## Edge Cases
|
|
193
|
+
|
|
194
|
+
### EC{N}: {Nome}
|
|
195
|
+
**Scenario:** {quando acontece}
|
|
196
|
+
**Expected Behavior:** {como o sistema reage}
|
|
197
|
+
**Implementation Notes:** {dicas}
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## Summary
|
|
202
|
+
|
|
203
|
+
| | Count |
|
|
204
|
+
|---|---|
|
|
205
|
+
| Questions Answered | {N} |
|
|
206
|
+
| Edge Cases Documented | {N} |
|
|
207
|
+
| Spec Sections Updated | {N} |
|
|
208
|
+
| Score Final | {score}/100 |
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
**Passo 2: Atualizar State**
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
npx morph-spec state mark-output $ARGUMENTS clarifications
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
## Outputs Gerados/Atualizados
|
|
220
|
+
|
|
221
|
+
- `.morph/features/$ARGUMENTS/1-design/spec.md` — Seção "Clarifications", edge cases, requisitos refinados
|
|
222
|
+
- `.morph/features/$ARGUMENTS/1-design/clarifications.md` — Q&A estruturado com score final
|
|
223
|
+
|
|
224
|
+
## Critérios de Avanço
|
|
225
|
+
|
|
226
|
+
- [x] Score de satisfação ≥ 85 OU usuário optou por encerrar
|
|
227
|
+
- [x] Todas as respostas são consistentes com `contracts.cs`
|
|
228
|
+
- [x] `spec.md` atualizado com clarificações e edge cases
|
|
229
|
+
- [x] `clarifications.md` criado com Q&A e score final
|
|
230
|
+
- [x] State atualizado (`mark-output clarifications`)
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
npx morph-spec phase advance $ARGUMENTS
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
Continuar automaticamente para FASE 4 (Plan) após clarifications.md gerado.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: phase-codebase-analysis
|
|
2
|
+
name: morph:phase-codebase-analysis
|
|
3
3
|
description: MORPH-SPEC Design sub-phase that analyzes existing codebase and database schema, producing schema-analysis.md with real column names, types, relationships, and field mismatches. Use at the start of Design phase before generating contracts.cs to prevent incorrect field names or types.
|
|
4
4
|
user-invocable: false
|
|
5
5
|
allowed-tools: Read, Write, Edit, Bash, Glob, Grep
|
|
6
|
-
cliVersion: "4.
|
|
6
|
+
cliVersion: "4.10.0"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# MORPH Codebase Analysis - Sub-fase de DESIGN
|
|
@@ -21,7 +21,7 @@ Automatiza a análise de código existente para gerar `schema-analysis.md` com d
|
|
|
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 |
|