@polymorphism-tech/morph-spec 4.21.0 → 5.0.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.
- package/CLAUDE.md +57 -71
- package/README.md +2 -2
- package/bin/morph-spec.js +224 -491
- package/claude-plugin.json +1 -1
- package/docs/CHEATSHEET.md +1 -1
- package/docs/QUICKSTART.md +1 -1
- package/framework/CLAUDE.md +55 -38
- package/framework/MORPH.md +244 -0
- package/framework/agents.json +127 -1183
- package/framework/commands/morph-apply.md +56 -240
- package/framework/commands/morph-archive.md +48 -85
- package/framework/commands/morph-preflight.md +7 -7
- package/framework/commands/morph-proposal.md +35 -191
- package/framework/commands/morph-status.md +19 -50
- package/framework/commands/morph-troubleshoot.md +2 -2
- package/framework/evals/rubrics/README.md +44 -0
- package/framework/evals/rubrics/architecture.md +46 -0
- package/framework/evals/rubrics/code-quality.md +50 -0
- package/framework/evals/rubrics/contracts.md +47 -0
- package/framework/evals/rubrics/test-coverage.md +50 -0
- package/framework/evals/scenarios/dotnet-crud.yaml +42 -0
- package/framework/evals/scenarios/nextjs-auth.yaml +38 -0
- package/framework/evals/suites/standard.yaml +5 -0
- package/framework/evals/trace-schema.md +67 -0
- package/framework/hooks/claude-code/core/README.md +3 -0
- package/framework/hooks/claude-code/core/denylist.json +14 -0
- package/framework/hooks/claude-code/{pre-tool-use → core}/enforce-phase-writes.js +5 -5
- package/framework/hooks/claude-code/core/post-edit-typecheck.js +69 -0
- package/framework/hooks/claude-code/core/pre-bash-denylist.js +29 -0
- package/framework/hooks/claude-code/{pre-tool-use → core}/protect-spec-files.js +4 -6
- package/framework/hooks/claude-code/{stop → core}/validate-completion.js +13 -82
- package/framework/hooks/shared/phase-utils.js +20 -28
- package/framework/hooks/shared/state-reader.js +4 -5
- package/framework/{skills/level-0-meta/mcp-registry.json → mcp/registry.json} +254 -210
- package/framework/phases.json +40 -114
- package/framework/rubrics/eval-rubric.json +66 -0
- package/framework/skills/README.md +39 -64
- package/framework/skills/core/README.md +3 -0
- package/framework/skills/core/morph-brainstorming/SKILL.md +102 -0
- package/framework/skills/core/morph-eval/SKILL.md +57 -0
- package/framework/skills/core/morph-implement/SKILL.md +83 -0
- package/framework/skills/core/morph-plan/SKILL.md +64 -0
- package/framework/skills/core/morph-review/SKILL.md +62 -0
- package/framework/skills/core/morph-stack-scan/SKILL.md +109 -0
- package/framework/skills/core/morph-standards/SKILL.md +49 -0
- package/framework/standards/STANDARDS.json +32 -0
- package/framework/standards/frontend/design-system/ai-image-generation.md +244 -0
- package/framework/standards/integration/mcp/mcp-tools.md +48 -0
- package/framework/templates/CLAUDE.md.core.guide.md +29 -0
- package/framework/templates/CLAUDE.md.core.template +22 -0
- package/framework/templates/REGISTRY.json +4 -4
- package/framework/workflows/configs/fast-track.json +5 -10
- package/framework/workflows/configs/full.json +4 -8
- package/framework/workflows/configs/quick.json +32 -0
- package/framework/workflows/configs/standard.json +57 -64
- package/package.json +7 -6
- package/src/commands/mcp/mcp-setup.js +58 -31
- package/src/commands/project/doctor.js +69 -70
- package/src/commands/project/init.js +26 -5
- package/src/commands/project/status.js +18 -19
- package/src/commands/state/approve.js +1 -1
- package/src/commands/validation/validate-feature.js +18 -112
- package/src/core/paths/output-schema.js +133 -151
- package/src/core/state/phase-state-machine.js +10 -24
- package/src/core/state/state-manager.js +17 -17
- package/src/core/workflows/workflow-detector.js +214 -31
- package/src/core/workflows/workflow-router.js +204 -0
- package/src/dashboard/app/pages/AgentMap.jsx +32 -33
- package/src/dashboard/app/pages/LiveState.jsx +1 -1
- package/src/dashboard/app/pages/PhasePipeline.jsx +2 -4
- package/src/dashboard/app/pages/SkillsLibrary.jsx +2 -3
- package/src/dashboard/app/pages/Workflows.jsx +2 -2
- package/src/dashboard/scanner/agents-scanner.js +30 -35
- package/src/lib/agents/metrics-aggregator.js +1 -1
- package/src/lib/agents/output-collector.js +7 -8
- package/src/lib/context/context-builder.js +289 -0
- package/src/lib/detectors/claude-config-detector.js +19 -3
- package/src/lib/generators/context-generator.js +20 -42
- package/src/lib/generators/index.js +1 -0
- package/src/lib/generators/mandate-generator.js +512 -0
- package/src/lib/generators/metadata-extractor.js +1 -1
- package/src/lib/generators/recap-generator.js +3 -4
- package/src/lib/installers/mcp-installer.js +300 -92
- package/src/lib/phase-chain/phase-validator.js +36 -40
- package/src/lib/stack/stack-profile.js +74 -91
- package/src/lib/tasks/task-parser.js +1 -1
- package/src/lib/tasks/wave-resolver.js +353 -0
- package/src/lib/validators/checkpoint-persistence.js +2 -2
- package/src/lib/validators/content/cross-phase-validator.js +281 -0
- package/src/lib/validators/content/index.js +1 -0
- package/src/lib/validators/shared/emit-validator-dispatch.js +6 -56
- package/src/scripts/global-install.js +2 -27
- package/src/utils/agents-installer.js +224 -447
- package/src/utils/claude-settings-manager.js +57 -15
- package/src/utils/file-copier.js +1 -0
- package/src/utils/hooks-installer.js +15 -117
- package/src/utils/skills-installer.js +12 -18
- package/bin/detect-agents.js +0 -226
- package/bin/task-manager.js +0 -1036
- package/framework/agents/README.md +0 -13
- package/framework/agents/ai-agents/ai-system-architect.md +0 -194
- package/framework/agents/ai-agents/vector-search-expert.md +0 -247
- package/framework/agents/architecture/architecture-expert.md +0 -98
- package/framework/agents/architecture/morph-spec-architect.md +0 -66
- package/framework/agents/architecture/packages-validator.md +0 -89
- package/framework/agents/architecture/security-expert.md +0 -79
- package/framework/agents/architecture/seo-growth-hacker.md +0 -168
- package/framework/agents/architecture/standards-architect.md +0 -153
- package/framework/agents/backend/dotnet-senior.md +0 -163
- package/framework/agents/backend/ef-modeler.md +0 -119
- package/framework/agents/backend/hangfire-orchestrator.md +0 -133
- package/framework/agents/backend/ms-agent-expert.md +0 -55
- package/framework/agents/backend/neon-expert.md +0 -379
- package/framework/agents/frontend/css-specialist.md +0 -89
- package/framework/agents/frontend/design-system-validator.md +0 -100
- package/framework/agents/frontend/gsap-animator.md +0 -131
- package/framework/agents/frontend/nextjs-component-validator.md +0 -97
- package/framework/agents/frontend/nextjs-expert.md +0 -201
- package/framework/agents/frontend/ui-designer.md +0 -259
- package/framework/agents/infrastructure/infra-architect.md +0 -215
- package/framework/agents/integrations/asaas-financial.md +0 -138
- package/framework/agents/integrations/neon-auth.md +0 -151
- package/framework/agents/integrations/resend-email.md +0 -127
- package/framework/hooks/claude-code/post-tool-use/agent-complete.js +0 -122
- package/framework/hooks/claude-code/post-tool-use/dispatch.js +0 -363
- package/framework/hooks/claude-code/post-tool-use/handle-tool-failure.js +0 -78
- package/framework/hooks/claude-code/post-tool-use/validator-feedback.js +0 -194
- package/framework/hooks/claude-code/pre-compact/save-morph-context.js +0 -199
- package/framework/hooks/claude-code/pre-tool-use/task-tracking-guard.js +0 -55
- package/framework/hooks/claude-code/session-start/inject-morph-context.js +0 -323
- package/framework/hooks/claude-code/session-start/post-compact-restore.js +0 -41
- package/framework/hooks/claude-code/session-start/resume-context.js +0 -77
- package/framework/hooks/claude-code/teammate-idle/teammate-idle.js +0 -90
- package/framework/hooks/claude-code/user-prompt/enrich-prompt.js +0 -114
- package/framework/hooks/shared/compact-restore.js +0 -123
- package/framework/hooks/shared/dispatch-helpers.js +0 -147
- package/framework/hooks/shared/skill-reminder-helpers.js +0 -79
- package/framework/hooks/shared/stale-task-reset.js +0 -57
- package/framework/hooks/shared/worktree-helpers.js +0 -75
- package/framework/skills/level-0-meta/README.md +0 -7
- package/framework/skills/level-0-meta/morph-agent-teams/SKILL.md +0 -472
- package/framework/skills/level-0-meta/morph-brainstorming/SKILL.md +0 -174
- package/framework/skills/level-0-meta/morph-brainstorming/references/proposal-example.md +0 -138
- package/framework/skills/level-0-meta/morph-checklist/SKILL.md +0 -145
- package/framework/skills/level-0-meta/morph-code-review/SKILL.md +0 -250
- package/framework/skills/level-0-meta/morph-code-review/references/review-example.md +0 -164
- package/framework/skills/level-0-meta/morph-code-review/references/review-guidelines.md +0 -100
- package/framework/skills/level-0-meta/morph-code-review/scripts/scan-csharp.mjs +0 -151
- package/framework/skills/level-0-meta/morph-code-review-nextjs/SKILL.md +0 -165
- package/framework/skills/level-0-meta/morph-code-review-nextjs/references/review-example-nextjs.md +0 -254
- package/framework/skills/level-0-meta/morph-code-review-nextjs/scripts/scan-nextjs.mjs +0 -189
- package/framework/skills/level-0-meta/morph-frontend-review/SKILL.md +0 -344
- package/framework/skills/level-0-meta/morph-frontend-review/scripts/scan-accessibility.mjs +0 -376
- package/framework/skills/level-0-meta/morph-init/SKILL.md +0 -537
- package/framework/skills/level-0-meta/morph-parallel-dispatch/SKILL.md +0 -225
- package/framework/skills/level-0-meta/morph-post-implementation/SKILL.md +0 -382
- package/framework/skills/level-0-meta/morph-post-implementation/scripts/detect-dev-server.mjs +0 -153
- package/framework/skills/level-0-meta/morph-post-implementation/scripts/detect-stack.mjs +0 -234
- package/framework/skills/level-0-meta/morph-simulation-checklist/SKILL.md +0 -106
- package/framework/skills/level-0-meta/morph-tool-usage-guide/SKILL.md +0 -243
- package/framework/skills/level-0-meta/morph-tool-usage-guide/references/tools-per-phase.md +0 -169
- package/framework/skills/level-0-meta/morph-verification-before-completion/SKILL.md +0 -148
- package/framework/skills/level-0-meta/morph-verification-before-completion/scripts/check-phase-outputs.mjs +0 -110
- package/framework/skills/level-1-workflows/README.md +0 -7
- package/framework/skills/level-1-workflows/morph-phase-codebase-analysis/SKILL.md +0 -269
- package/framework/skills/level-1-workflows/morph-phase-design/SKILL.md +0 -453
- package/framework/skills/level-1-workflows/morph-phase-design/references/architecture-analysis-guide.md +0 -44
- package/framework/skills/level-1-workflows/morph-phase-design/references/spec-authoring-guide.md +0 -55
- package/framework/skills/level-1-workflows/morph-phase-design/references/spec-example.md +0 -253
- package/framework/skills/level-1-workflows/morph-phase-implement/.morph/logs/activity.json +0 -38
- package/framework/skills/level-1-workflows/morph-phase-implement/SKILL.md +0 -493
- package/framework/skills/level-1-workflows/morph-phase-implement/prompts/code-quality-reviewer-prompt.md +0 -50
- package/framework/skills/level-1-workflows/morph-phase-implement/prompts/implementer-prompt.md +0 -46
- package/framework/skills/level-1-workflows/morph-phase-implement/prompts/spec-reviewer-prompt.md +0 -47
- package/framework/skills/level-1-workflows/morph-phase-implement/references/recap-example.md +0 -132
- package/framework/skills/level-1-workflows/morph-phase-implement/references/vsa-implementation-guide.md +0 -92
- package/framework/skills/level-1-workflows/morph-phase-plan/SKILL.md +0 -257
- package/framework/skills/level-1-workflows/morph-phase-tasks/.morph/logs/activity.json +0 -14
- package/framework/skills/level-1-workflows/morph-phase-tasks/SKILL.md +0 -291
- package/framework/skills/level-1-workflows/morph-phase-tasks/references/task-planning-patterns.md +0 -143
- package/framework/skills/level-1-workflows/morph-phase-tasks/references/tasks-example.md +0 -404
- package/framework/skills/level-1-workflows/morph-phase-tasks/scripts/validate-tasks.mjs +0 -112
- package/framework/skills/level-1-workflows/morph-phase-uiux/SKILL.md +0 -788
- package/framework/skills/level-1-workflows/morph-scope-escalation/SKILL.md +0 -147
- package/framework/squad-templates/backend-only.json +0 -47
- package/framework/squad-templates/frontend-only.json +0 -56
- package/framework/squad-templates/full-stack.json +0 -74
- package/src/commands/agents/agent-metrics.js +0 -174
- package/src/commands/agents/audit-dispatch.js +0 -82
- package/src/commands/agents/detect-agents.js +0 -275
- package/src/commands/agents/dispatch-agents.js +0 -461
- package/src/commands/agents/index.js +0 -13
- package/src/commands/agents/manage-agents.js +0 -352
- package/src/commands/agents/project-metrics.js +0 -74
- package/src/commands/phase/phase-reset.js +0 -74
- package/src/commands/scope/escalate.js +0 -217
- package/src/commands/state/advance-phase.js +0 -600
- package/src/commands/state/phase-runner.js +0 -215
- package/src/commands/state/state.js +0 -444
- package/src/commands/task/expand.js +0 -100
- package/src/commands/tasks/index.js +0 -4
- package/src/commands/tasks/task.js +0 -105
- package/src/commands/templates/index.js +0 -5
- package/src/commands/templates/template-render.js +0 -93
- package/src/commands/trust/trust.js +0 -118
- package/src/lib/agents/agents-manager.js +0 -349
- package/src/lib/build/build-runner.js +0 -99
- package/src/lib/checkpoints/checkpoint-hooks.js +0 -111
- package/src/lib/contracts/sprint-contract-generator.js +0 -137
- package/src/lib/scope/impact-analyzer.js +0 -106
- package/src/lib/trust/trust-manager.js +0 -157
- package/src/utils/tier-helpers.js +0 -24
- /package/framework/hooks/claude-code/{post-tool-use → core}/loop-detect.js +0 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: morph-plan
|
|
3
|
+
description: Guia a produção dos três artefatos de planejamento de uma feature
|
|
4
|
+
version: core
|
|
5
|
+
when-to-invoke: ao iniciar a fase plan de uma feature, após o gate 1 (proposal aprovado)
|
|
6
|
+
user-invokable: true
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# morph-plan
|
|
10
|
+
|
|
11
|
+
## Objetivo
|
|
12
|
+
Produzir spec.md, mandate.md e tasks.md com qualidade suficiente para abrir o Gate 2.
|
|
13
|
+
Os três artefatos juntos definem o quê, o como e o quanto da feature.
|
|
14
|
+
|
|
15
|
+
## Quando invocar
|
|
16
|
+
Ao iniciar a fase plan — após o proposal.md ser aprovado e antes de qualquer implementação.
|
|
17
|
+
|
|
18
|
+
## O que fazer
|
|
19
|
+
|
|
20
|
+
1. Leia o `proposal.md` em `.morph/features/{feature}/0-proposal/` para entender escopo e critérios de aceite.
|
|
21
|
+
2. Produza `spec.md` em `.morph/features/{feature}/2-plan/`:
|
|
22
|
+
- Arquitetura da solução: quais componentes, como se conectam, fluxos de dados principais.
|
|
23
|
+
- Edge cases identificados e como serão tratados.
|
|
24
|
+
- Integrações externas e contratos esperados.
|
|
25
|
+
3. Produza `mandate.md` em `.morph/features/{feature}/2-plan/`:
|
|
26
|
+
- Stack exata do projeto (leia do CLAUDE.md → campo Stack).
|
|
27
|
+
- Standards obrigatórios: liste os IDs relevantes de `framework/standards/STANDARDS.json`.
|
|
28
|
+
- Patterns proibidos — inclua sempre os defaults abaixo mais qualquer específico da feature:
|
|
29
|
+
- `Guid.NewGuid()` → usar `Guid.CreateVersion7()`
|
|
30
|
+
- Classes não-sealed sem justificativa documentada
|
|
31
|
+
- Exceptions como fluxo de controle → usar result pattern com `result.Match()`
|
|
32
|
+
- Repository pattern / `IRepository<T>` → handlers VSA acessam DbContext diretamente
|
|
33
|
+
- Checklist de done com critérios verificáveis por tarefa.
|
|
34
|
+
4. Produza `tasks.md` em `.morph/features/{feature}/2-plan/`:
|
|
35
|
+
- Liste cada tarefa com ID único (T1, T2...).
|
|
36
|
+
- Para cada tarefa: descrição, dependências, estimativa de esforço, critério de done.
|
|
37
|
+
- Ordene por dependências — tarefas sem dependências primeiro.
|
|
38
|
+
5. Apresente o Gate 2 ao usuário usando exatamente este formato:
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
## Gate 2 — Plano pronto para revisão
|
|
42
|
+
|
|
43
|
+
**Spec:** {1 frase do problema} → {1 frase da solução técnica}
|
|
44
|
+
**Mandate:** Stack: {stack} | Standards: {N obrigatórios} | Proibido: {padrões proibidos listados}
|
|
45
|
+
**Tasks:** {N tarefas} | Estimativa: {X horas/dias} | Caminho crítico: {IDs das tarefas sem dependências paralelas}
|
|
46
|
+
|
|
47
|
+
Decisões de arquitetura:
|
|
48
|
+
- {decisão 1} — alternativa descartada: {alternativa}
|
|
49
|
+
{adicione apenas se houver decisões não triviais}
|
|
50
|
+
|
|
51
|
+
Aprovado? Responda "pode implementar" para avançar.
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Aguarde resposta explícita. Se o usuário pedir ajustes, aplique e reapresente o gate completo antes de avançar.
|
|
55
|
+
|
|
56
|
+
## Output esperado
|
|
57
|
+
- `.morph/features/{feature}/2-plan/spec.md` — especificação técnica completa
|
|
58
|
+
- `.morph/features/{feature}/2-plan/mandate.md` — contrato de implementação
|
|
59
|
+
- `.morph/features/{feature}/2-plan/tasks.md` — lista de tarefas ordenada
|
|
60
|
+
|
|
61
|
+
## Referências
|
|
62
|
+
- `framework/MORPH.md` — seções 2 (Fases), 3 (Contratos de Output), 5 (Gates)
|
|
63
|
+
- `framework/standards/STANDARDS.json` — para identificar standards relevantes ao mandate
|
|
64
|
+
- `.morph/features/{feature}/0-proposal/proposal.md` — escopo da feature
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: morph-review
|
|
3
|
+
description: Conduz a fase de revisão e produz o review-report.md para o Gate 3
|
|
4
|
+
version: core
|
|
5
|
+
when-to-invoke: ao iniciar a fase review, após todas as tarefas de implementação serem concluídas
|
|
6
|
+
user-invokable: true
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# morph-review
|
|
10
|
+
|
|
11
|
+
## Objetivo
|
|
12
|
+
Verificar se a implementação atende ao mandate.md e produzir um review-report.md
|
|
13
|
+
claro o suficiente para que o usuário tome a decisão de aprovação ou rejeição.
|
|
14
|
+
|
|
15
|
+
## Quando invocar
|
|
16
|
+
Ao iniciar a fase review — após todas as tarefas do tasks.md estarem com status Done
|
|
17
|
+
e o recap.md estar atualizado.
|
|
18
|
+
|
|
19
|
+
## O que fazer
|
|
20
|
+
|
|
21
|
+
1. Leia o mandate.md em `.morph/features/{feature}/2-plan/mandate.md`.
|
|
22
|
+
Liste os critérios de done, standards obrigatórios e patterns proibidos.
|
|
23
|
+
|
|
24
|
+
2. Leia o recap.md em `.morph/features/{feature}/3-implement/recap.md`.
|
|
25
|
+
Verifique se todas as tarefas têm entrada e se os problemas foram resolvidos.
|
|
26
|
+
|
|
27
|
+
3. Para cada critério do mandate.md, verifique se foi atendido:
|
|
28
|
+
- Se atendido: registre como "aprovado" com evidência (arquivo ou comportamento).
|
|
29
|
+
- Se não atendido: registre como "bloqueante" com descrição do gap.
|
|
30
|
+
- Se parcialmente atendido: registre como "pendência" com o que falta.
|
|
31
|
+
|
|
32
|
+
4. Execute morph-eval na implementação completa (fase, não tarefa) para obter scores por dimensão.
|
|
33
|
+
|
|
34
|
+
5. Produza `review-report.md` em `.morph/features/{feature}/4-review/` com:
|
|
35
|
+
- Scores por dimensão (arquitetura, contratos, qualidade, cobertura)
|
|
36
|
+
- Score composto final
|
|
37
|
+
- Lista de itens bloqueantes (se houver) — com descrição e critério de resolução
|
|
38
|
+
- Lista de melhorias recomendadas (não bloqueantes)
|
|
39
|
+
- Recomendação final: Aprovado / Rejeitar com condições / Reprovar
|
|
40
|
+
|
|
41
|
+
6. Se houver itens bloqueantes (score < 6 em qualquer dimensão bloqueante), corrija antes
|
|
42
|
+
de apresentar o review-report.md ao usuário. Não abra o Gate 3 com bloqueantes em aberto.
|
|
43
|
+
|
|
44
|
+
7. Finalize o trace de execução em `.morph/traces/YYYY-MM-DD-{feature}-implement.json`:
|
|
45
|
+
- Preencha `phase_summary.tasks_completed`, `tasks_failed`, `avg_eval_score`
|
|
46
|
+
- Calcule `standards_most_used` a partir das entradas em `tasks[].standards_consulted`
|
|
47
|
+
- Preencha `sub_agents_dispatched` com a contagem de tasks onde `sub_agent_dispatched: true`
|
|
48
|
+
- Preencha `completed_at` com o timestamp atual
|
|
49
|
+
|
|
50
|
+
8. Apresente o relatório ao usuário e aguarde o Gate 3.
|
|
51
|
+
|
|
52
|
+
## Output esperado
|
|
53
|
+
- `.morph/features/{feature}/4-review/review-report.md` com scores e recomendação
|
|
54
|
+
- Trace da fase com `phase_summary` preenchido
|
|
55
|
+
- Gate 3 apresentado ao usuário para aprovação
|
|
56
|
+
|
|
57
|
+
## Referências
|
|
58
|
+
- `framework/MORPH.md` — seção 5 (Gate 3) e seção 1 (papel Evaluator)
|
|
59
|
+
- `framework/skills/core/morph-eval/SKILL.md` — para calcular scores por dimensão
|
|
60
|
+
- `framework/evals/trace-schema.md` — formato canônico do trace
|
|
61
|
+
- `.morph/features/{feature}/2-plan/mandate.md` — critérios de done da feature
|
|
62
|
+
- `.morph/features/{feature}/3-implement/recap.md` — registro de execução
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: morph-stack-scan
|
|
3
|
+
description: Varre o codebase existente, detecta stack atual, compara com o stack padrão e gera migration-plan.md se houver desvios
|
|
4
|
+
version: core
|
|
5
|
+
when-to-invoke: ao iniciar uma feature em projeto brownfield (codebase já existente)
|
|
6
|
+
user-invokable: true
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# morph-stack-scan
|
|
10
|
+
|
|
11
|
+
## Objetivo
|
|
12
|
+
Identificar o estado real do codebase antes de planejar qualquer feature — garantindo que a implementação não adicione inconsistência a um projeto já existente.
|
|
13
|
+
|
|
14
|
+
## Quando invocar
|
|
15
|
+
Quando o projeto já tem código existente e você precisa entender o estado atual antes de propor uma feature. Normalmente invocado pelo morph-brainstorming, mas pode ser invocado diretamente.
|
|
16
|
+
|
|
17
|
+
## Stack padrão de referência
|
|
18
|
+
|
|
19
|
+
| Camada | Esperado |
|
|
20
|
+
|--------|----------|
|
|
21
|
+
| Runtime | .NET 10 |
|
|
22
|
+
| Arquitetura | VSA — feature-folder: `{Feature}/` com Handler, Validator, Endpoint, Errors, Tests |
|
|
23
|
+
| ORM | EF Core + Neon (Postgres) |
|
|
24
|
+
| IDs | `Guid.CreateVersion7()` |
|
|
25
|
+
| Classes | `sealed` por padrão |
|
|
26
|
+
| Erros | Result pattern (`result.Match()`), não exceptions não tratadas |
|
|
27
|
+
| IA | Microsoft Agent Framework (MAF) |
|
|
28
|
+
| Frontend | Next.js App Router + Tailwind + Framer Motion + Shadcn |
|
|
29
|
+
| Jobs | Hangfire (apenas quando necessário) |
|
|
30
|
+
|
|
31
|
+
**Padrões proibidos:** `Guid.NewGuid()`, classes não-sealed sem justificativa, exceptions como fluxo de controle, Repository pattern, `IRepository<T>`.
|
|
32
|
+
|
|
33
|
+
## O que fazer
|
|
34
|
+
|
|
35
|
+
1. Despache um `Explore` subagent para varrer o codebase:
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
Varredura de stack compliance — morph-stack-scan.
|
|
39
|
+
|
|
40
|
+
Leia os seguintes arquivos/pastas e reporte o que encontrar:
|
|
41
|
+
|
|
42
|
+
BACKEND:
|
|
43
|
+
- Todos os .csproj: qual TargetFramework? Quais PackageReferences relevantes?
|
|
44
|
+
- Procure por: Guid.NewGuid() vs Guid.CreateVersion7(), sealed classes, result pattern vs exceptions
|
|
45
|
+
- Estrutura de src/: segue feature-folder (VSA)? Tem Controllers? Tem IRepository<T>?
|
|
46
|
+
- Migrations/: qual ORM? Neon/Postgres ou outro banco?
|
|
47
|
+
- Microsoft.Agents.* ou Microsoft.Extensions.AI nos PackageReferences?
|
|
48
|
+
|
|
49
|
+
FRONTEND:
|
|
50
|
+
- package.json: Next.js? Tailwind? Framer Motion? Shadcn/ui?
|
|
51
|
+
- Estrutura de app/ ou pages/: App Router ou Pages Router?
|
|
52
|
+
|
|
53
|
+
JOBS:
|
|
54
|
+
- Hangfire nos PackageReferences?
|
|
55
|
+
|
|
56
|
+
Para cada item acima, responda: presente/ausente, e se presente qual versão ou padrão.
|
|
57
|
+
Não faça sugestões — apenas reporte o que existe.
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
2. Com os resultados da varredura, compare com o stack padrão item por item e classifique cada desvio:
|
|
61
|
+
|
|
62
|
+
| Severidade | Critério |
|
|
63
|
+
|------------|---------|
|
|
64
|
+
| **Bloqueante** | Runtime diferente (.NET 8 ou anterior), ORM diferente (Dapper puro sem EF Core), banco diferente (MySQL, SQL Server) |
|
|
65
|
+
| **Alto** | `Guid.NewGuid()` generalizado, Repository pattern em toda a codebase, exceptions como fluxo de controle |
|
|
66
|
+
| **Médio** | Classes não-sealed, Pages Router em vez de App Router, biblioteca de UI diferente |
|
|
67
|
+
| **Baixo** | Versões de pacotes desatualizadas mas compatíveis |
|
|
68
|
+
|
|
69
|
+
3. Produza `stack-scan.md` em `.morph/features/{feature}/0-proposal/`:
|
|
70
|
+
|
|
71
|
+
```markdown
|
|
72
|
+
# Stack Scan — {feature}
|
|
73
|
+
|
|
74
|
+
## Resultado
|
|
75
|
+
{Em compliance / Desvios detectados}
|
|
76
|
+
|
|
77
|
+
## Stack detectado
|
|
78
|
+
| Camada | Detectado | Esperado | Status |
|
|
79
|
+
|--------|-----------|----------|--------|
|
|
80
|
+
| Runtime | .NET X | .NET 10 | ✓ / ✗ |
|
|
81
|
+
...
|
|
82
|
+
|
|
83
|
+
## Desvios
|
|
84
|
+
### Bloqueantes
|
|
85
|
+
- {desvio}: {onde foi encontrado} — impacto: {o que quebra se não migrar}
|
|
86
|
+
|
|
87
|
+
### Não bloqueantes
|
|
88
|
+
- {desvio}: {onde foi encontrado} — migração: {como resolver}
|
|
89
|
+
|
|
90
|
+
## Recomendação
|
|
91
|
+
{Em compliance — prosseguir para morph-brainstorming}
|
|
92
|
+
{ou: Migração necessária antes de prosseguir — veja migration-plan.md}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
4. Se houver desvios bloqueantes ou altos, produza `migration-plan.md` em `.morph/features/{feature}/0-proposal/` com:
|
|
96
|
+
- Lista de desvios ordenados por severidade
|
|
97
|
+
- Para cada desvio: o que migrar, como migrar, estimativa de esforço, ordem sugerida
|
|
98
|
+
- Pergunta única via `AskUserQuestion`: "Esta migração deve ser incluída na feature atual ou tratada numa feature separada?"
|
|
99
|
+
|
|
100
|
+
5. Se não houver desvios (ou apenas baixos): informe "codebase em compliance com o stack padrão" e prossiga para morph-brainstorming ou morph-plan conforme o contexto.
|
|
101
|
+
|
|
102
|
+
## Output esperado
|
|
103
|
+
- `.morph/features/{feature}/0-proposal/stack-scan.md` — resultado da varredura
|
|
104
|
+
- `.morph/features/{feature}/0-proposal/migration-plan.md` — apenas se houver desvios altos/bloqueantes
|
|
105
|
+
- Decisão documentada: incluir migração nesta feature ou separar
|
|
106
|
+
|
|
107
|
+
## Referências
|
|
108
|
+
- `framework/MORPH.md` — seção 4 (Standards), seção 2 (Fases)
|
|
109
|
+
- `framework/skills/core/morph-brainstorming/SKILL.md` — fluxo greenfield/brownfield
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: morph-standards
|
|
3
|
+
description: Localiza e carrega um standard específico do STANDARDS.json sob demanda
|
|
4
|
+
version: core
|
|
5
|
+
when-to-invoke: quando precisar consultar um standard específico durante a implementação
|
|
6
|
+
user-invokable: true
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# morph-standards
|
|
10
|
+
|
|
11
|
+
## Objetivo
|
|
12
|
+
Encontrar o standard certo para a situação atual e carregar apenas esse arquivo no contexto.
|
|
13
|
+
Nunca carregue todos os standards — o custo de token não compensa.
|
|
14
|
+
|
|
15
|
+
## Quando invocar
|
|
16
|
+
Quando durante a implementação surgir uma dúvida de padrão arquitetural, de contrato, de qualidade
|
|
17
|
+
ou de teste — e o mandate.md não for suficiente para resolver.
|
|
18
|
+
|
|
19
|
+
## O que fazer
|
|
20
|
+
|
|
21
|
+
1. Abra `framework/standards/STANDARDS.json`.
|
|
22
|
+
|
|
23
|
+
2. Filtre por `category` primeiro (valores típicos: "architecture", "contracts", "testing", "frontend", "backend").
|
|
24
|
+
|
|
25
|
+
3. Dentro da categoria, filtre por `tags` que correspondam ao stack do projeto
|
|
26
|
+
(ex: "dotnet", "nextjs", "blazor", "typescript").
|
|
27
|
+
|
|
28
|
+
4. Se dois standards parecerem relevantes e houver conflito, adote o mais específico ao stack.
|
|
29
|
+
Registre o conflito no `decisions.md` da feature.
|
|
30
|
+
|
|
31
|
+
5. Leia o arquivo `.md` do standard selecionado — o path está no campo `path` do JSON.
|
|
32
|
+
|
|
33
|
+
6. Aplique o standard na tarefa atual.
|
|
34
|
+
|
|
35
|
+
7. Registre no `recap.md`: qual standard foi consultado e como foi aplicado.
|
|
36
|
+
|
|
37
|
+
## Quando não há standard adequado
|
|
38
|
+
Registre no `decisions.md` que nenhum standard cobre o caso.
|
|
39
|
+
Descreva o critério adotado e sinalize para revisão futura.
|
|
40
|
+
Não invente um standard — padrões não documentados são dívida técnica.
|
|
41
|
+
|
|
42
|
+
## Output esperado
|
|
43
|
+
- Standard identificado e lido no contexto
|
|
44
|
+
- Critério de implementação claro para a tarefa atual
|
|
45
|
+
- Entrada no recap.md registrando o standard consultado
|
|
46
|
+
|
|
47
|
+
## Referências
|
|
48
|
+
- `framework/standards/STANDARDS.json` — índice completo com id, name, path, category, tags
|
|
49
|
+
- `framework/MORPH.md` — seção 4 (Como consultar Standards)
|
|
@@ -1097,6 +1097,38 @@
|
|
|
1097
1097
|
"stacks": [
|
|
1098
1098
|
"*"
|
|
1099
1099
|
]
|
|
1100
|
+
},
|
|
1101
|
+
{
|
|
1102
|
+
"id": "frontend-design-system-ai-image-generation",
|
|
1103
|
+
"name": "AI Image Generation",
|
|
1104
|
+
"path": "frontend/design-system/ai-image-generation.md",
|
|
1105
|
+
"category": "frontend",
|
|
1106
|
+
"subcategory": "design-system",
|
|
1107
|
+
"tags": [
|
|
1108
|
+
"image",
|
|
1109
|
+
"gemini",
|
|
1110
|
+
"asset",
|
|
1111
|
+
"ai-generation",
|
|
1112
|
+
"placeholder",
|
|
1113
|
+
"mcp"
|
|
1114
|
+
],
|
|
1115
|
+
"aliases": [
|
|
1116
|
+
"Image Generation",
|
|
1117
|
+
"AI Assets",
|
|
1118
|
+
"Gemini Images"
|
|
1119
|
+
],
|
|
1120
|
+
"anchors": {
|
|
1121
|
+
"when-to-use": "#when-to-use-ai-generated-images",
|
|
1122
|
+
"prompt-patterns": "#prompt-engineering-patterns",
|
|
1123
|
+
"aspect-ratios": "#aspect-ratio-guide",
|
|
1124
|
+
"assets-md": "#assetsmd-format",
|
|
1125
|
+
"edit-workflows": "#iterative-editing-workflows"
|
|
1126
|
+
},
|
|
1127
|
+
"digest": "Guidelines for generating project images with Gemini Image MCP — prompt patterns, aspect ratios, design-system-aware prompts, iterative editing, and assets.md format.",
|
|
1128
|
+
"stacks": [
|
|
1129
|
+
"nextjs",
|
|
1130
|
+
"next"
|
|
1131
|
+
]
|
|
1100
1132
|
}
|
|
1101
1133
|
]
|
|
1102
1134
|
}
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
# AI Image Generation
|
|
2
|
+
|
|
3
|
+
> **Scope:** nextjs
|
|
4
|
+
> **Layer:** 1 (load when relevant)
|
|
5
|
+
> **Keywords:** image, gemini, asset, ai-generation, placeholder, mcp, next/image
|
|
6
|
+
> **Load When:** feature has UI components requiring image assets
|
|
7
|
+
|
|
8
|
+
## When to Use AI-Generated Images
|
|
9
|
+
|
|
10
|
+
| Use Case | Approach | Examples |
|
|
11
|
+
|----------|----------|---------|
|
|
12
|
+
| **AI generation** | Gemini Image MCP | Hero images, brand illustrations, feature-specific visuals, empty states, background panels |
|
|
13
|
+
| **Stock photos** | External sources | Generic content (people in offices, nature scenes, stock portraits) |
|
|
14
|
+
| **SVG/CSS** | Code-based | Icons, patterns, gradients, geometric shapes, loading animations |
|
|
15
|
+
| **Skip** | Other tools | Screenshots (Playwright), diagrams (Mermaid), logos (vector tools) |
|
|
16
|
+
|
|
17
|
+
**Decision rule:** If the image is unique to the project's brand/aesthetic and doesn't exist as stock, use AI generation. If it's generic and widely available, use stock. If it's geometric or icon-based, use SVG/CSS.
|
|
18
|
+
|
|
19
|
+
## Gemini Image MCP API
|
|
20
|
+
|
|
21
|
+
```javascript
|
|
22
|
+
// Generate a new image
|
|
23
|
+
mcp__gemini_image_mcp__generate_image({
|
|
24
|
+
prompt: string, // Text description (max 5000 chars, narrative style)
|
|
25
|
+
aspectRatio?: "1:1" | "2:3" | "3:2" | "3:4" | "4:3" | "9:16" | "16:9",
|
|
26
|
+
outputPath?: string, // File path to save (e.g., "public/images/feature/hero.png")
|
|
27
|
+
model?: string, // Default: gemini-2.5-flash-image
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
// Edit an existing image
|
|
31
|
+
mcp__gemini_image_mcp__edit_image({
|
|
32
|
+
imageSource: string, // Path to image or image ID
|
|
33
|
+
prompt: string, // Short, targeted edit instructions (1-2 sentences)
|
|
34
|
+
outputPath?: string,
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
// Continue editing last image
|
|
38
|
+
mcp__gemini_image_mcp__continue_editing({
|
|
39
|
+
prompt: string, // One adjustment at a time
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
// List generated images
|
|
43
|
+
mcp__gemini_image_mcp__list_images({
|
|
44
|
+
type?: "generated" | "edited" | "all",
|
|
45
|
+
limit?: number,
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
// Get image details
|
|
49
|
+
mcp__gemini_image_mcp__get_image_info({
|
|
50
|
+
imageId?: string, // Defaults to last image
|
|
51
|
+
})
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Prompt Engineering Patterns
|
|
55
|
+
|
|
56
|
+
### Design-System-Aware Prompts
|
|
57
|
+
|
|
58
|
+
Read `design-system.md` or `globals.css` to extract project tokens. Inject into prompts:
|
|
59
|
+
|
|
60
|
+
- **Background color** → use as image background
|
|
61
|
+
- **Primary/accent colors** → use as highlight colors
|
|
62
|
+
- **Font pair** → mention for text elements
|
|
63
|
+
- **Aesthetic direction** → "Modern Luxury", "Kinetic Atelier", etc.
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
"{subject description}. Dark charcoal background (#10131a) with copper (#D2802D)
|
|
67
|
+
and gold (#FFB779) accent colors. {style modifiers}. Premium luxury aesthetic.
|
|
68
|
+
{composition rules}."
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Component-Contextual Prompts
|
|
72
|
+
|
|
73
|
+
Describe what the image will BE in the UI, not just the subject:
|
|
74
|
+
|
|
75
|
+
- **Hero image** → "floating tablet showing app dashboard on dark background" (not just "fitness dashboard")
|
|
76
|
+
- **Auth background** → "gym equipment with moody lighting" (matches brand feel)
|
|
77
|
+
- **Empty state** → "artistic wireframe body silhouette" (matches feature context)
|
|
78
|
+
|
|
79
|
+
### Narrative Style
|
|
80
|
+
|
|
81
|
+
Gemini responds best to coherent paragraphs. Build prompts by layering:
|
|
82
|
+
|
|
83
|
+
1. **Subject** — hyper-specific description
|
|
84
|
+
2. **Environment** — foreground, mid-ground, background (layered for depth)
|
|
85
|
+
3. **Lighting** — multiple sources with different colors/directions
|
|
86
|
+
4. **Style** — photography terms ("85mm portrait lens") or art style ("cel-shaded")
|
|
87
|
+
5. **Color palette** — dominant colors and contrast relationships
|
|
88
|
+
6. **Composition** — camera angle, framing, negative space
|
|
89
|
+
|
|
90
|
+
**Never:** keyword spam ("beautiful, stunning, 4k, masterpiece"), JSON prompts, negative prompts ("no cars").
|
|
91
|
+
|
|
92
|
+
## Iterative Editing Workflows
|
|
93
|
+
|
|
94
|
+
**Cardinal rule: generation demands depth; editing demands restraint.**
|
|
95
|
+
|
|
96
|
+
### Adding / Removing Elements
|
|
97
|
+
One sentence. Don't describe how to integrate — the model handles that.
|
|
98
|
+
```
|
|
99
|
+
"Add a knitted wizard hat to the cat."
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Background Replacement
|
|
103
|
+
State the new background simply. Don't over-describe.
|
|
104
|
+
```
|
|
105
|
+
"Replace the background with a tropical beach at sunset."
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Inpainting (Targeted Changes)
|
|
109
|
+
Name what changes and what stays in one line.
|
|
110
|
+
```
|
|
111
|
+
"Change the blue sofa to a brown leather chesterfield. Keep everything else."
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Style Transfer
|
|
115
|
+
Name the target style.
|
|
116
|
+
```
|
|
117
|
+
"Transform this into Van Gogh's Starry Night style."
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Iterative Refinement with `continue_editing`
|
|
121
|
+
One change at a time:
|
|
122
|
+
- "Make the lighting warmer"
|
|
123
|
+
- "More contrast in the shadows"
|
|
124
|
+
- "Zoom out a bit"
|
|
125
|
+
- "More serious expression"
|
|
126
|
+
|
|
127
|
+
### Text Rendering
|
|
128
|
+
The model frequently misspells words. After generating any image with text:
|
|
129
|
+
1. View the result
|
|
130
|
+
2. If text is wrong: `continue_editing` with "Fix the text — it should read '{correct text}' exactly. Keep everything else."
|
|
131
|
+
3. Expect 2-3 iterations for correct text
|
|
132
|
+
|
|
133
|
+
## Aspect Ratio Guide
|
|
134
|
+
|
|
135
|
+
| Use Case | Ratio | Examples |
|
|
136
|
+
|----------|-------|---------|
|
|
137
|
+
| Hero / banner | `16:9` | Landing page hero, YouTube thumbnail, desktop wallpaper |
|
|
138
|
+
| Card / blog header | `3:2` | Feature cards, blog post headers, landscape photo |
|
|
139
|
+
| Avatar / icon | `1:1` | Profile pictures, social media posts, square icons |
|
|
140
|
+
| Auth panel / sidebar | `3:4` | Login brand image, Pinterest-style, portrait poster |
|
|
141
|
+
| Portrait | `2:3` | Book cover, tall illustration, portrait photo |
|
|
142
|
+
| Story / reel | `9:16` | Mobile wallpaper, social story, vertical banner |
|
|
143
|
+
| Standard display | `4:3` | Documentation, slides, standard display |
|
|
144
|
+
|
|
145
|
+
## File Naming & Directory
|
|
146
|
+
|
|
147
|
+
**Convention:** `public/images/{feature}/{purpose}.png`
|
|
148
|
+
|
|
149
|
+
- Lowercase, kebab-case, descriptive names
|
|
150
|
+
- Group by feature, not by type
|
|
151
|
+
- Examples:
|
|
152
|
+
- `public/images/ui-redesign/hero-mockup.png`
|
|
153
|
+
- `public/images/ui-redesign/gym-equipment.png`
|
|
154
|
+
- `public/images/ui-redesign/body-analysis.png`
|
|
155
|
+
|
|
156
|
+
## Next.js Image Integration
|
|
157
|
+
|
|
158
|
+
```tsx
|
|
159
|
+
import Image from 'next/image';
|
|
160
|
+
|
|
161
|
+
// Above-the-fold hero image (priority for LCP)
|
|
162
|
+
<Image
|
|
163
|
+
src="/images/{feature}/hero-mockup.png"
|
|
164
|
+
alt="AI fitness analysis dashboard"
|
|
165
|
+
width={1440}
|
|
166
|
+
height={810}
|
|
167
|
+
priority
|
|
168
|
+
sizes="100vw"
|
|
169
|
+
/>
|
|
170
|
+
|
|
171
|
+
// Card image with responsive sizing
|
|
172
|
+
<Image
|
|
173
|
+
src="/images/{feature}/card-image.png"
|
|
174
|
+
alt="Feature card illustration"
|
|
175
|
+
width={600}
|
|
176
|
+
height={400}
|
|
177
|
+
sizes="(max-width: 768px) 100vw, 50vw"
|
|
178
|
+
className="rounded-lg"
|
|
179
|
+
/>
|
|
180
|
+
|
|
181
|
+
// Background image with fill
|
|
182
|
+
<div className="relative h-full">
|
|
183
|
+
<Image
|
|
184
|
+
src="/images/{feature}/auth-background.png"
|
|
185
|
+
alt=""
|
|
186
|
+
fill
|
|
187
|
+
className="object-cover"
|
|
188
|
+
priority={false}
|
|
189
|
+
/>
|
|
190
|
+
</div>
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## `assets.md` Format
|
|
194
|
+
|
|
195
|
+
The `assets.md` file is created during the UI/UX phase (Step 4.5) and consumed by the implement phase.
|
|
196
|
+
|
|
197
|
+
```markdown
|
|
198
|
+
# Image Assets — {feature}
|
|
199
|
+
|
|
200
|
+
## Design Context
|
|
201
|
+
- Aesthetic: {from design-system.md}
|
|
202
|
+
- Primary: {--color-primary value}
|
|
203
|
+
- Background: {--color-background value}
|
|
204
|
+
- Accent: {--color-accent value}
|
|
205
|
+
- Font pair: {display + body fonts}
|
|
206
|
+
|
|
207
|
+
## Assets
|
|
208
|
+
|
|
209
|
+
### IMG-001: {Descriptive Name}
|
|
210
|
+
- **Purpose:** {What this image represents in the UI}
|
|
211
|
+
- **Route:** {App route where it appears}
|
|
212
|
+
- **Component:** {React component name}
|
|
213
|
+
- **Aspect Ratio:** {1:1 | 3:2 | 16:9 | etc.}
|
|
214
|
+
- **Output Path:** `public/images/{feature}/{kebab-name}.png`
|
|
215
|
+
- **Prompt:** "{Narrative prompt with design system colors and aesthetic direction injected}"
|
|
216
|
+
- **Priority:** {high | medium | low}
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
**Example entry:**
|
|
220
|
+
|
|
221
|
+
```markdown
|
|
222
|
+
### IMG-001: Hero Mockup
|
|
223
|
+
- **Purpose:** App dashboard floating on dark background for landing page hero
|
|
224
|
+
- **Route:** /
|
|
225
|
+
- **Component:** HeroSection
|
|
226
|
+
- **Aspect Ratio:** 16:9
|
|
227
|
+
- **Output Path:** `public/images/ui-redesign/hero-mockup.png`
|
|
228
|
+
- **Prompt:** "A floating tablet showing a modern AI fitness analysis dashboard on a dark charcoal background (#10131a). Copper (#D2802D) and gold (#FFB779) accent lighting creates warm rim highlights around the device edges. The screen displays body metrics with glassmorphism cards. Premium luxury aesthetic, photorealistic, cinematic lighting with a key light from the left and cool blue fill from the right."
|
|
229
|
+
- **Priority:** high
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
## Quality Checklist
|
|
233
|
+
|
|
234
|
+
- [ ] Colors match design system tokens (no random colors in prompts)
|
|
235
|
+
- [ ] No text artifacts or misspellings (if text in image)
|
|
236
|
+
- [ ] Correct aspect ratio for intended use
|
|
237
|
+
- [ ] Appropriate file size (< 500KB for web, < 200KB for cards)
|
|
238
|
+
- [ ] Descriptive alt text written for accessibility
|
|
239
|
+
- [ ] `<Image>` component with proper width/height dimensions
|
|
240
|
+
- [ ] `priority` prop set for above-the-fold images
|
|
241
|
+
- [ ] Build compiles after integration (`npm run build`)
|
|
242
|
+
- [ ] Image visible in dev server at correct route
|
|
243
|
+
|
|
244
|
+
*MORPH-SPEC by Polymorphism Tech*
|
|
@@ -81,6 +81,53 @@ const docs = await mcp__context7__query_docs({
|
|
|
81
81
|
// WebFetch for specific component API pages
|
|
82
82
|
```
|
|
83
83
|
|
|
84
|
+
### Gemini Image MCP — AI Image Generation
|
|
85
|
+
|
|
86
|
+
> Available in: **UI/UX** (preview generation), **Implement** (production assets)
|
|
87
|
+
|
|
88
|
+
| Tool | Use Case | Example |
|
|
89
|
+
|------|----------|---------|
|
|
90
|
+
| `generate_image` | Create new image from text prompt | `mcp__gemini-image-mcp__generate_image({ prompt, aspectRatio, outputPath })` |
|
|
91
|
+
| `edit_image` | Modify existing image | `mcp__gemini-image-mcp__edit_image({ imageSource, prompt })` |
|
|
92
|
+
| `continue_editing` | Iterate on last generated/edited image | `mcp__gemini-image-mcp__continue_editing({ prompt })` |
|
|
93
|
+
| `list_images` | Browse image generation history | `mcp__gemini-image-mcp__list_images({ type: "all" })` |
|
|
94
|
+
| `get_image_info` | Get metadata about a specific image | `mcp__gemini-image-mcp__get_image_info({ imageId })` |
|
|
95
|
+
|
|
96
|
+
```javascript
|
|
97
|
+
// Generate a hero image using design system tokens
|
|
98
|
+
// Read design-system.md first to get project colors and aesthetic direction
|
|
99
|
+
const image = await mcp__gemini_image_mcp__generate_image({
|
|
100
|
+
prompt: "A floating tablet showing a modern dashboard interface on a dark charcoal background with copper and gold accent lighting. Premium luxury aesthetic, photorealistic, cinematic lighting with warm rim light.",
|
|
101
|
+
aspectRatio: "16:9",
|
|
102
|
+
outputPath: "public/images/my-feature/hero-mockup.png"
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
// Edit an existing image (keep edits short and targeted)
|
|
106
|
+
await mcp__gemini_image_mcp__edit_image({
|
|
107
|
+
imageSource: "public/images/my-feature/hero-mockup.png",
|
|
108
|
+
prompt: "Make the lighting warmer and add a subtle copper glow around the tablet edges."
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
// Iterate with continue_editing (one change at a time)
|
|
112
|
+
await mcp__gemini_image_mcp__continue_editing({
|
|
113
|
+
prompt: "More contrast in the shadows."
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
// Fallback: Manual image creation, stock photos, or placeholder divs
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
**Use cases by phase:**
|
|
120
|
+
|
|
121
|
+
| Phase | Use Case | Tool |
|
|
122
|
+
|-------|----------|------|
|
|
123
|
+
| UI/UX (2) | Generate preview images for design approval | `generate_image` |
|
|
124
|
+
| Implement (7) | Generate production assets from assets.md specs | `generate_image` + `edit_image` |
|
|
125
|
+
| Implement (7) | Iterate on generated images for quality | `continue_editing` |
|
|
126
|
+
|
|
127
|
+
> **Standard:** See `frontend/design-system/ai-image-generation.md` for prompt engineering patterns, aspect ratio guide, and `assets.md` format.
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
84
131
|
### Phase 3 (Design) — Schema & Architecture
|
|
85
132
|
|
|
86
133
|
| Tool | Use Case | Example |
|
|
@@ -246,6 +293,7 @@ await mcp__vercel__manage_env_vars({
|
|
|
246
293
|
| Container ops | Docker CLI (`docker ps`, `docker logs`, `docker compose`) | — |
|
|
247
294
|
| Cloud resources | Azure CLI (`az resource`, `az deployment`) | — |
|
|
248
295
|
| Vercel deployments | Vercel MCP | Bash `vercel` CLI |
|
|
296
|
+
| AI image generation | Gemini Image MCP | Manual creation or stock photos |
|
|
249
297
|
|
|
250
298
|
**Rule:** MCP tools provide structured data (JSON responses). Native tools require manual parsing. **Always prefer MCP when available** — fall back to native when not. **Exceptions:** Neon, Docker, and Azure always use their respective CLIs directly — never MCP.
|
|
251
299
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Guia de uso — CLAUDE.md.core.template
|
|
2
|
+
|
|
3
|
+
Este template é o ponto de entrada do harness para um projeto morph-spec.
|
|
4
|
+
Preencha cada campo uma vez, no setup. Não modifique a estrutura.
|
|
5
|
+
|
|
6
|
+
## Campos
|
|
7
|
+
|
|
8
|
+
**Nome do Projeto** — nome curto e identificável do sistema.
|
|
9
|
+
|
|
10
|
+
**Domínio** — 1-2 frases. O que o sistema faz, para quem, e qual o principal constraint (ex: multi-tenant, LGPD, tempo real).
|
|
11
|
+
|
|
12
|
+
**Stack** — não alterar. O harness assume o stack padrão. Se o projeto desvia (ex: Blazor em vez de Next.js), edite e documente o desvio aqui.
|
|
13
|
+
|
|
14
|
+
**Harness** — não alterar. Esta seção instrui o modelo a:
|
|
15
|
+
1. Ler `MORPH.md` ao iniciar a sessão
|
|
16
|
+
2. Ler `state.json` para identificar feature ativa
|
|
17
|
+
3. Assumir o papel correspondente sem aguardar instrução
|
|
18
|
+
|
|
19
|
+
**Standards do projeto** — opcional. Apenas se algum standard específico do projeto desvia do default do stack. Default já injetado pelo morph-plan.
|
|
20
|
+
|
|
21
|
+
**Slash commands** — não alterar. Os dois entry points oficiais.
|
|
22
|
+
|
|
23
|
+
## Regras
|
|
24
|
+
|
|
25
|
+
- Mantenha < 60 linhas — conteúdo acima não cabe em contexto comprimido.
|
|
26
|
+
- Não adicione regras condicionais (sem "se dotnet, então...").
|
|
27
|
+
- Não inline conteúdo de standards — aponte por ID, nunca copie.
|
|
28
|
+
- Não adicione campo "Feature ativa" estático — Claude lê state.json.
|
|
29
|
+
- Este arquivo pertence ao projeto. Versione no git.
|