@polymorphism-tech/morph-spec 4.9.0 → 4.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/bin/morph-spec.js +30 -0
- package/bin/task-manager.js +34 -22
- package/claude-plugin.json +1 -1
- package/docs/CHEATSHEET.md +1 -1
- package/docs/QUICKSTART.md +1 -1
- package/framework/CLAUDE.md +35 -98
- package/framework/agents/backend/api-designer.md +3 -0
- package/framework/agents/backend/dotnet-senior.md +3 -0
- package/framework/agents/backend/ef-modeler.md +2 -0
- package/framework/agents/backend/hangfire-orchestrator.md +2 -0
- package/framework/agents/backend/ms-agent-expert.md +2 -0
- package/framework/agents/frontend/blazor-builder.md +2 -0
- package/framework/agents/frontend/nextjs-expert.md +2 -0
- package/framework/agents/infrastructure/azure-architect.md +2 -0
- package/framework/agents/infrastructure/azure-deploy-specialist.md +2 -0
- package/framework/agents/infrastructure/bicep-architect.md +2 -0
- package/framework/agents/infrastructure/container-specialist.md +2 -0
- package/framework/agents/infrastructure/devops-engineer.md +3 -0
- package/framework/agents/infrastructure/infra-architect.md +3 -0
- package/framework/agents/integrations/asaas-financial.md +2 -0
- package/framework/agents/integrations/azure-identity.md +2 -0
- package/framework/agents/integrations/clerk-auth.md +3 -0
- package/framework/agents/integrations/hangfire-integration.md +2 -0
- package/framework/agents/integrations/resend-email.md +2 -0
- package/framework/agents.json +37 -7
- package/framework/commands/commit.md +166 -0
- package/framework/commands/morph-apply.md +156 -155
- package/framework/commands/morph-archive.md +33 -27
- package/framework/commands/morph-infra.md +83 -77
- package/framework/commands/morph-preflight.md +97 -55
- package/framework/commands/morph-proposal.md +131 -58
- package/framework/commands/morph-status.md +36 -30
- package/framework/commands/morph-troubleshoot.md +68 -59
- package/framework/hooks/claude-code/notification/approval-reminder.js +3 -2
- package/framework/hooks/claude-code/post-tool-use/dispatch.js +154 -31
- package/framework/hooks/claude-code/post-tool-use/skill-reminder.js +7 -84
- 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 +3 -2
- 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 +55 -2
- package/framework/hooks/claude-code/session-start/post-compact-restore.js +41 -0
- 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/shared/compact-restore.js +100 -0
- package/framework/hooks/shared/dispatch-helpers.js +116 -0
- package/framework/hooks/shared/phase-utils.js +9 -5
- package/framework/hooks/shared/state-reader.js +27 -3
- package/framework/phases.json +30 -7
- package/framework/rules/csharp-standards.md +3 -0
- package/framework/rules/frontend-standards.md +2 -0
- package/framework/rules/infrastructure-standards.md +3 -0
- package/framework/rules/morph-workflow.md +143 -86
- package/framework/rules/nextjs-standards.md +2 -0
- package/framework/rules/testing-standards.md +3 -0
- package/framework/skills/level-0-meta/mcp-registry.json +86 -51
- package/framework/skills/level-0-meta/morph-brainstorming/SKILL.md +139 -0
- package/framework/skills/level-0-meta/morph-checklist/SKILL.md +42 -19
- package/framework/skills/level-0-meta/{code-review → morph-code-review}/SKILL.md +8 -5
- package/framework/skills/level-0-meta/{code-review-nextjs → morph-code-review-nextjs}/SKILL.md +8 -6
- package/framework/skills/level-0-meta/morph-frontend-review/SKILL.md +362 -0
- package/framework/skills/level-0-meta/morph-init/SKILL.md +114 -20
- package/framework/skills/level-0-meta/morph-post-implementation/SKILL.md +362 -0
- package/framework/skills/level-0-meta/morph-replicate/SKILL.md +95 -87
- package/framework/skills/level-0-meta/{simulation-checklist → morph-simulation-checklist}/SKILL.md +24 -0
- package/framework/skills/level-0-meta/{tool-usage-guide → morph-tool-usage-guide}/SKILL.md +43 -43
- package/framework/skills/level-0-meta/{tool-usage-guide → morph-tool-usage-guide}/references/tools-per-phase.md +1 -2
- package/framework/skills/level-0-meta/{verification-before-completion → morph-verification-before-completion}/SKILL.md +23 -12
- 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 +247 -0
- package/framework/skills/level-1-workflows/morph-phase-codebase-analysis/SKILL.md +270 -0
- package/framework/skills/level-1-workflows/morph-phase-design/SKILL.md +499 -0
- package/framework/skills/level-1-workflows/morph-phase-implement/.morph/logs/activity.json +38 -0
- package/framework/skills/level-1-workflows/morph-phase-implement/SKILL.md +472 -0
- 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 +246 -0
- package/framework/skills/level-1-workflows/morph-phase-setup/SKILL.md +238 -0
- package/framework/skills/level-1-workflows/morph-phase-tasks/.morph/logs/activity.json +14 -0
- package/framework/skills/level-1-workflows/morph-phase-tasks/SKILL.md +312 -0
- package/framework/skills/level-1-workflows/{phase-tasks → morph-phase-tasks}/scripts/validate-tasks.mjs +3 -3
- package/framework/skills/level-1-workflows/morph-phase-uiux/SKILL.md +324 -0
- package/framework/skills/level-1-workflows/morph-scope-escalation/SKILL.md +146 -0
- package/framework/standards/integration/mcp/mcp-tools.md +25 -7
- package/framework/templates/docs/onboarding.md +2 -2
- package/package.json +3 -4
- package/src/commands/agents/dispatch-agents.js +50 -3
- package/src/commands/mcp/mcp-setup.js +39 -2
- package/src/commands/phase/phase-reset.js +74 -0
- package/src/commands/project/doctor.js +26 -7
- package/src/commands/project/update.js +4 -4
- package/src/commands/scope/escalate.js +215 -0
- package/src/commands/state/advance-phase.js +27 -53
- package/src/commands/state/state.js +1 -1
- package/src/commands/task/expand.js +100 -0
- package/src/core/paths/output-schema.js +4 -3
- package/src/core/state/phase-state-machine.js +7 -4
- package/src/core/state/state-manager.js +4 -3
- 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 +22 -16
- package/src/lib/scope/impact-analyzer.js +106 -0
- package/src/lib/stack-filter.js +58 -0
- package/src/lib/tasks/task-parser.js +1 -1
- package/src/lib/validators/shared/emit-validator-dispatch.js +64 -0
- package/src/scripts/setup-infra.js +68 -18
- package/src/utils/agents-installer.js +51 -17
- package/src/utils/claude-md-injector.js +90 -0
- package/src/utils/file-copier.js +0 -1
- package/src/utils/hooks-installer.js +16 -5
- package/src/utils/skills-installer.js +67 -7
- package/CLAUDE.md +0 -98
- package/framework/memory/patterns-learned.md +0 -766
- package/framework/skills/level-0-meta/brainstorming/SKILL.md +0 -137
- package/framework/skills/level-0-meta/frontend-review/SKILL.md +0 -359
- package/framework/skills/level-0-meta/post-implementation/SKILL.md +0 -362
- package/framework/skills/level-0-meta/terminal-title/SKILL.md +0 -61
- package/framework/skills/level-0-meta/terminal-title/scripts/set_title.sh +0 -65
- package/framework/skills/level-1-workflows/phase-clarify/SKILL.md +0 -216
- package/framework/skills/level-1-workflows/phase-codebase-analysis/SKILL.md +0 -252
- package/framework/skills/level-1-workflows/phase-design/SKILL.md +0 -383
- package/framework/skills/level-1-workflows/phase-implement/SKILL.md +0 -492
- package/framework/skills/level-1-workflows/phase-setup/SKILL.md +0 -195
- package/framework/skills/level-1-workflows/phase-tasks/SKILL.md +0 -271
- package/framework/skills/level-1-workflows/phase-uiux/SKILL.md +0 -286
- package/src/commands/project/index.js +0 -8
- package/src/core/index.js +0 -10
- 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/workflows/index.js +0 -7
- 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/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/sanitizer/context-sanitizer.js +0 -221
- package/src/sanitizer/patterns.js +0 -163
- 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-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
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: morph:brainstorming
|
|
3
|
-
description: Morph-spec-aware brainstorming that loads project context, explores multiple design approaches, asks clarifying questions, and produces proposal.md or decisions.md. Use before designing a feature, when facing architectural decisions with multiple valid approaches, or when a feature needs requirements exploration before committing to a direction.
|
|
4
|
-
user-invocable: true
|
|
5
|
-
argument-hint: "[feature-name or topic]"
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Brainstorming — MORPH-SPEC Integrated
|
|
9
|
-
|
|
10
|
-
> Explore context, ask questions, generate multiple approaches, and produce a design document before committing to implementation.
|
|
11
|
-
>
|
|
12
|
-
> **Example:** `references/proposal-example.md` — filled-in proposal.md showing expected quality.
|
|
13
|
-
|
|
14
|
-
## When to Use
|
|
15
|
-
|
|
16
|
-
- **Phase 0 (Proposal):** Explore the feature request before writing `proposal.md`
|
|
17
|
-
- **Phase 2 (Design):** Explore architectural alternatives before writing `spec.md`
|
|
18
|
-
- **Any phase:** When facing a decision with multiple valid approaches
|
|
19
|
-
|
|
20
|
-
## Prerequisites
|
|
21
|
-
|
|
22
|
-
Before brainstorming, load project context:
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
# Load current state
|
|
26
|
-
npx morph-spec state get {feature-name}
|
|
27
|
-
|
|
28
|
-
# Read project config
|
|
29
|
-
Read: .morph/config/config.json
|
|
30
|
-
|
|
31
|
-
# Read existing proposal (if Phase 2)
|
|
32
|
-
Read: .morph/features/{feature}/0-proposal/proposal.md
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
---
|
|
36
|
-
|
|
37
|
-
## Workflow
|
|
38
|
-
|
|
39
|
-
### Step 1: Explore Context
|
|
40
|
-
|
|
41
|
-
**Gather information before generating ideas:**
|
|
42
|
-
|
|
43
|
-
1. **Read state.json** — current phase, active agents, existing outputs
|
|
44
|
-
2. **Read config.json** — stack, architecture, project name
|
|
45
|
-
3. **Read existing outputs** — proposal.md, spec.md (if they exist)
|
|
46
|
-
4. **Scan codebase** — use Glob/Grep to understand existing patterns
|
|
47
|
-
5. **Check integrations.json** — available MCPs and plugins
|
|
48
|
-
|
|
49
|
-
**Use MCP tools when available:**
|
|
50
|
-
- **Context7** → look up library capabilities relevant to the feature
|
|
51
|
-
- **Supabase** → check existing schema for data-related features
|
|
52
|
-
- **GitHub** → check existing issues/PRs for related work
|
|
53
|
-
|
|
54
|
-
### Step 2: Ask Clarifying Questions
|
|
55
|
-
|
|
56
|
-
Generate **3-5 focused questions** for the user:
|
|
57
|
-
|
|
58
|
-
```markdown
|
|
59
|
-
### Q1: Scope
|
|
60
|
-
What is the minimum viable version of this feature?
|
|
61
|
-
|
|
62
|
-
### Q2: Constraints
|
|
63
|
-
Are there performance/budget/timeline constraints?
|
|
64
|
-
|
|
65
|
-
### Q3: Integration
|
|
66
|
-
Does this need to integrate with existing features?
|
|
67
|
-
|
|
68
|
-
### Q4: Users
|
|
69
|
-
Who are the primary users of this feature?
|
|
70
|
-
|
|
71
|
-
### Q5: Success Criteria
|
|
72
|
-
How will we know this feature is working correctly?
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
**Wait for user responses before proceeding.**
|
|
76
|
-
|
|
77
|
-
### Step 3: Generate 2-3 Approaches
|
|
78
|
-
|
|
79
|
-
For each approach, document:
|
|
80
|
-
|
|
81
|
-
```markdown
|
|
82
|
-
## Approach A: {Name}
|
|
83
|
-
|
|
84
|
-
**Description:** {1-2 sentences}
|
|
85
|
-
|
|
86
|
-
**Pros:**
|
|
87
|
-
- Pro 1
|
|
88
|
-
- Pro 2
|
|
89
|
-
|
|
90
|
-
**Cons:**
|
|
91
|
-
- Con 1
|
|
92
|
-
- Con 2
|
|
93
|
-
|
|
94
|
-
**Complexity:** Low / Medium / High
|
|
95
|
-
**Estimated Tasks:** ~N
|
|
96
|
-
**Key Dependencies:** {list}
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
### Step 4: Recommend and Document
|
|
100
|
-
|
|
101
|
-
1. **Recommend** the best approach with reasoning
|
|
102
|
-
2. **Write output** to the appropriate location:
|
|
103
|
-
- Phase 0 → render `docs/proposal` template → `.morph/features/{feature}/0-proposal/proposal.md`
|
|
104
|
-
- Phase 2 → document in `decisions.md` as an ADR
|
|
105
|
-
|
|
106
|
-
3. **Update state:**
|
|
107
|
-
```bash
|
|
108
|
-
npx morph-spec state mark-output {feature-name} proposal # Phase 0
|
|
109
|
-
npx morph-spec state mark-output {feature-name} decisions # Phase 2
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
---
|
|
113
|
-
|
|
114
|
-
## Integration with Superpowers
|
|
115
|
-
|
|
116
|
-
> Available when the `superpowers` plugin is installed.
|
|
117
|
-
|
|
118
|
-
This skill replaces `superpowers:brainstorming` within morph-spec workflows. It adds:
|
|
119
|
-
- Automatic context loading from `.morph/` state and config
|
|
120
|
-
- Template rendering for outputs (proposal.md, decisions.md)
|
|
121
|
-
- State tracking via `morph-spec state mark-output`
|
|
122
|
-
- MCP integration for research (Context7, Supabase)
|
|
123
|
-
|
|
124
|
-
For brainstorming **outside** morph-spec workflows, the original `superpowers:brainstorming` skill remains available.
|
|
125
|
-
|
|
126
|
-
---
|
|
127
|
-
|
|
128
|
-
## Anti-patterns
|
|
129
|
-
|
|
130
|
-
- Never skip brainstorming for features with multiple valid approaches
|
|
131
|
-
- Never commit to an approach without documenting alternatives
|
|
132
|
-
- Never brainstorm without loading project context first
|
|
133
|
-
- Never write code before completing the brainstorming output
|
|
134
|
-
|
|
135
|
-
---
|
|
136
|
-
|
|
137
|
-
*MORPH-SPEC by Polymorphism Tech*
|
|
@@ -1,359 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: morph:frontend-review
|
|
3
|
-
description: Auditoria completa do frontend — valida design outputs (design-system, contraste WCAG,
|
|
4
|
-
mockups), scan estático de acessibilidade (TSX + Razor), screenshots responsivos em 3
|
|
5
|
-
breakpoints via Playwright, axe-core a11y em runtime, e SEO (Next.js metadata). Cobre Next.js
|
|
6
|
-
e Blazor. Disparado ao final do phase-uiux e pós-implementação.
|
|
7
|
-
argument-hint: "[feature-name]"
|
|
8
|
-
user-invocable: true
|
|
9
|
-
allowed-tools: Read, Write, Edit, Bash, Glob, Grep,
|
|
10
|
-
mcp__playwright__browser_navigate, mcp__playwright__browser_resize,
|
|
11
|
-
mcp__playwright__browser_take_screenshot, mcp__playwright__browser_snapshot,
|
|
12
|
-
mcp__playwright__browser_evaluate, mcp__playwright__browser_console_messages
|
|
13
|
-
cliVersion: "4.8.19"
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
# Frontend Review
|
|
17
|
-
|
|
18
|
-
> Auditoria completa do frontend: design outputs, acessibilidade estática + runtime, screenshots
|
|
19
|
-
> responsivos e SEO. Disparado ao final do `phase-uiux` (valida design) e pós-implementação
|
|
20
|
-
> (valida código implementado).
|
|
21
|
-
|
|
22
|
-
> **Nota sobre MCP:** O prefixo `mcp__playwright__` corresponde ao nome do servidor Playwright
|
|
23
|
-
> conforme configurado no `settings.json` do projeto. Se o servidor tiver nome diferente (ex:
|
|
24
|
-
> `plugin_playwright_playwright`), ajuste o prefixo nos calls abaixo.
|
|
25
|
-
|
|
26
|
-
---
|
|
27
|
-
|
|
28
|
-
## Step 0 — Detectar Contexto e Stack
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
node .claude/skills/post-implementation/scripts/detect-stack.mjs
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
Output JSON: `{ stack: "DOTNET" | "NEXTJS" | "FULLSTACK" | "UNKNOWN", frontendPath, backendPath, startCommand }`
|
|
35
|
-
|
|
36
|
-
Além do stack, determinar o **contexto** examinando o que existe:
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
# Verificar se design outputs existem
|
|
40
|
-
ls .morph/features/$ARGUMENTS/2-ui/ 2>/dev/null
|
|
41
|
-
|
|
42
|
-
# Verificar se arquivos frontend implementados existem
|
|
43
|
-
find . -name "*.tsx" -o -name "*.razor" 2>/dev/null | head -5
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
- Se `.morph/features/$ARGUMENTS/2-ui/ui-design-system.md` existe → contexto inclui **design validation**
|
|
47
|
-
- Se arquivos frontend implementados existem (`.tsx`, `.razor`) → contexto inclui **implementation validation**
|
|
48
|
-
- Ambos podem coexistir
|
|
49
|
-
|
|
50
|
-
Guarde `stack`, `frontendPath`, `startCommand` e o contexto detectado — todos os passos dependem deles.
|
|
51
|
-
|
|
52
|
-
---
|
|
53
|
-
|
|
54
|
-
## Step 1 — Validação de Design Outputs (se contexto inclui design validation)
|
|
55
|
-
|
|
56
|
-
```bash
|
|
57
|
-
npx morph-spec validate-feature $ARGUMENTS --phase uiux
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
Verificar existência e qualidade dos 4 outputs obrigatórios em `.morph/features/$ARGUMENTS/2-ui/`:
|
|
61
|
-
|
|
62
|
-
```
|
|
63
|
-
[ ] ui-design-system.md — paleta de cores, tokens de tipografia, espaçamento
|
|
64
|
-
[ ] ui-mockups.md — wireframes com estados responsivos
|
|
65
|
-
[ ] ui-components.md — specs técnicas dos componentes
|
|
66
|
-
[ ] ui-flows.md — jornadas de usuário e edge cases
|
|
67
|
-
[ ] Contraste WCAG AA: cores primárias e de texto ≥ 4.5:1 (verificar ui-design-system.md)
|
|
68
|
-
[ ] Touch targets documentados: ≥ 44x44px para mobile
|
|
69
|
-
[ ] Estados de loading/error/empty definidos nos mockups
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
**🚫 BLOCK** se `validate-feature` falhar ou outputs obrigatórios ausentes.
|
|
73
|
-
|
|
74
|
-
Leia `ui-design-system.md` e verifique manualmente se as cores primária e de texto têm razão de
|
|
75
|
-
contraste ≥ 4.5:1. Ferramentas de referência: WebAIM Contrast Checker (critérios WCAG 2.1 AA).
|
|
76
|
-
|
|
77
|
-
---
|
|
78
|
-
|
|
79
|
-
## Step 2 — Scan Estático de Acessibilidade
|
|
80
|
-
|
|
81
|
-
```bash
|
|
82
|
-
node .claude/skills/morph:frontend-review/scripts/scan-accessibility.mjs $frontendPath
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
O script detecta automaticamente a extensão dos arquivos para determinar Next.js (`.tsx`) vs
|
|
86
|
-
Blazor (`.razor`). Se `frontendPath` não estiver definido, o script usa `.` (raiz do projeto).
|
|
87
|
-
|
|
88
|
-
**Checks implementados:**
|
|
89
|
-
|
|
90
|
-
| ID | Severidade | Arquivos | Verifica |
|
|
91
|
-
|----|-----------|---------|---------|
|
|
92
|
-
| `IMG_MISSING_ALT` | CRITICAL | .tsx, .razor | `<img` sem atributo `alt=` |
|
|
93
|
-
| `INPUT_MISSING_LABEL` | HIGH | .tsx, .razor | `<input`/`<InputText`/`<FluentTextField` sem `aria-label`, `aria-labelledby`, ou `<label for=` associado |
|
|
94
|
-
| `HEADING_HIERARCHY` | HIGH | .tsx, .razor | Salto de nível em headings (H1→H3 pulando H2) |
|
|
95
|
-
| `LINK_NO_TEXT` | HIGH | .tsx, .razor | `<a` vazio ou com apenas ícone e sem `aria-label` |
|
|
96
|
-
| `BUTTON_NO_TEXT` | HIGH | .tsx, .razor | `<button`/`<FluentButton` sem texto e sem `aria-label` |
|
|
97
|
-
| `AUTOPLAY_MEDIA` | MEDIUM | .tsx, .razor | `<video`/`<audio` com `autoPlay` sem `muted` |
|
|
98
|
-
| `FLUENT_CHECKBOX_NO_LABEL` | MEDIUM | .razor | `<FluentCheckbox` sem `Label=` |
|
|
99
|
-
|
|
100
|
-
**🚫 BLOCK** se qualquer finding CRITICAL ou count de HIGH ≥ 3.
|
|
101
|
-
|
|
102
|
-
Corrija todos os CRITICALs antes de continuar. Para HIGH < 3, registre no resumo como warnings.
|
|
103
|
-
|
|
104
|
-
---
|
|
105
|
-
|
|
106
|
-
## Step 3 — Scan de Código Frontend (se contexto inclui implementation validation)
|
|
107
|
-
|
|
108
|
-
### Se NEXTJS ou FULLSTACK:
|
|
109
|
-
|
|
110
|
-
```bash
|
|
111
|
-
node .claude/skills/code-review-nextjs/scripts/scan-nextjs.mjs $frontendPath
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
> Pular se já executado pelo `post-implementation` na mesma sessão.
|
|
115
|
-
|
|
116
|
-
**🚫 BLOCK** se CRITICAL findings encontrados.
|
|
117
|
-
|
|
118
|
-
### Se DOTNET ou FULLSTACK (Blazor):
|
|
119
|
-
|
|
120
|
-
Verificar manualmente as categorias principais do checklist para o feature implementado:
|
|
121
|
-
|
|
122
|
-
```
|
|
123
|
-
[ ] Componentes Blazor com parâmetros tipados corretamente
|
|
124
|
-
[ ] EventCallback<T> para eventos — sem Action/Func diretos
|
|
125
|
-
[ ] Dispose implementado onde há subscriptions (IDisposable)
|
|
126
|
-
[ ] Sem lógica de negócio nos arquivos .razor (separar em @code ou classes)
|
|
127
|
-
[ ] StateHasChanged() chamado apenas quando necessário
|
|
128
|
-
[ ] Formulários com EditForm e DataAnnotationsValidator
|
|
129
|
-
[ ] Campos obrigatórios com [Required] e mensagens de erro definidas
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
**🚫 BLOCK** se qualquer item CRITICAL for encontrado.
|
|
133
|
-
|
|
134
|
-
---
|
|
135
|
-
|
|
136
|
-
## Step 4 — Screenshots Responsivos (Playwright MCP)
|
|
137
|
-
|
|
138
|
-
### 4a. Detectar Dev Server
|
|
139
|
-
|
|
140
|
-
```bash
|
|
141
|
-
node .claude/skills/post-implementation/scripts/detect-dev-server.mjs "$startCommand"
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
### 4b. Se dev server disponível (exit 0):
|
|
145
|
-
|
|
146
|
-
Extraia as URLs principais da feature lendo `spec.md`:
|
|
147
|
-
|
|
148
|
-
```bash
|
|
149
|
-
Read: .morph/features/$ARGUMENTS/1-design/spec.md
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
Para cada página principal (máximo 3), capture screenshots nos 3 breakpoints:
|
|
153
|
-
|
|
154
|
-
```javascript
|
|
155
|
-
// Mobile (375px)
|
|
156
|
-
await mcp__playwright__browser_resize({ width: 375, height: 812 });
|
|
157
|
-
await mcp__playwright__browser_navigate({ url: '<url-da-feature>' });
|
|
158
|
-
await mcp__playwright__browser_take_screenshot({
|
|
159
|
-
type: 'png',
|
|
160
|
-
filename: `.morph/features/${ARGUMENTS}/visual-screenshots/mobile-<page>.png`
|
|
161
|
-
});
|
|
162
|
-
|
|
163
|
-
// Tablet (768px)
|
|
164
|
-
await mcp__playwright__browser_resize({ width: 768, height: 1024 });
|
|
165
|
-
await mcp__playwright__browser_navigate({ url: '<url-da-feature>' });
|
|
166
|
-
await mcp__playwright__browser_take_screenshot({
|
|
167
|
-
type: 'png',
|
|
168
|
-
filename: `.morph/features/${ARGUMENTS}/visual-screenshots/tablet-<page>.png`
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
// Desktop (1440px)
|
|
172
|
-
await mcp__playwright__browser_resize({ width: 1440, height: 900 });
|
|
173
|
-
await mcp__playwright__browser_navigate({ url: '<url-da-feature>' });
|
|
174
|
-
await mcp__playwright__browser_take_screenshot({
|
|
175
|
-
type: 'png',
|
|
176
|
-
filename: `.morph/features/${ARGUMENTS}/visual-screenshots/desktop-<page>.png`
|
|
177
|
-
});
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
Screenshots salvos em: `.morph/features/$ARGUMENTS/visual-screenshots/`
|
|
181
|
-
(funciona tanto na fase `2-ui` quanto na `4-implement`)
|
|
182
|
-
|
|
183
|
-
### 4c. Se dev server NÃO disponível (exit 1):
|
|
184
|
-
|
|
185
|
-
**⚠️ ATENÇÃO: Dev server não encontrado.**
|
|
186
|
-
|
|
187
|
-
Solicite confirmação explícita ao usuário antes de pular os screenshots:
|
|
188
|
-
|
|
189
|
-
```
|
|
190
|
-
Dev server não detectado. Screenshots responsivos via Playwright não podem ser capturados.
|
|
191
|
-
|
|
192
|
-
Opções:
|
|
193
|
-
1. Inicie manualmente o servidor e re-execute /morph:frontend-review
|
|
194
|
-
2. Confirme explicitamente que deseja pular os screenshots e por quê
|
|
195
|
-
|
|
196
|
-
Não é possível prosseguir para axe-core sem dev server.
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
**Aguarde resposta antes de continuar.**
|
|
200
|
-
|
|
201
|
-
---
|
|
202
|
-
|
|
203
|
-
## Step 5 — axe-core Runtime (Playwright MCP, se dev server ativo)
|
|
204
|
-
|
|
205
|
-
Para cada página da feature (usar as mesmas URLs do Step 4):
|
|
206
|
-
|
|
207
|
-
```javascript
|
|
208
|
-
// Navegar para a página
|
|
209
|
-
await mcp__playwright__browser_navigate({ url: '<url-da-feature>' });
|
|
210
|
-
|
|
211
|
-
// Injetar axe-core via CDN e executar scan WCAG 2.1 AA
|
|
212
|
-
await mcp__playwright__browser_evaluate({
|
|
213
|
-
function: `async () => {
|
|
214
|
-
if (!window.axe) {
|
|
215
|
-
await new Promise((resolve, reject) => {
|
|
216
|
-
const s = document.createElement('script');
|
|
217
|
-
s.src = 'https://cdnjs.cloudflare.com/ajax/libs/axe-core/4.9.1/axe.min.js';
|
|
218
|
-
s.onload = resolve;
|
|
219
|
-
s.onerror = reject;
|
|
220
|
-
document.head.appendChild(s);
|
|
221
|
-
});
|
|
222
|
-
}
|
|
223
|
-
const results = await window.axe.run(document, {
|
|
224
|
-
runOnly: { type: 'tag', values: ['wcag2a', 'wcag2aa'] }
|
|
225
|
-
});
|
|
226
|
-
return results.violations.map(v => ({
|
|
227
|
-
id: v.id,
|
|
228
|
-
impact: v.impact,
|
|
229
|
-
description: v.description,
|
|
230
|
-
nodes: v.nodes.length,
|
|
231
|
-
helpUrl: v.helpUrl
|
|
232
|
-
}));
|
|
233
|
-
}`
|
|
234
|
-
});
|
|
235
|
-
```
|
|
236
|
-
|
|
237
|
-
Agrupar violations por impacto:
|
|
238
|
-
- `critical` / `serious` → **🚫 BLOCK** (não criar PR)
|
|
239
|
-
- `moderate` / `minor` → reportar como warnings no resumo, não bloqueiam
|
|
240
|
-
|
|
241
|
-
Verificar também erros de console relacionados a acessibilidade:
|
|
242
|
-
|
|
243
|
-
```javascript
|
|
244
|
-
await mcp__playwright__browser_console_messages({ level: 'error' });
|
|
245
|
-
```
|
|
246
|
-
|
|
247
|
-
---
|
|
248
|
-
|
|
249
|
-
## Step 6 — SEO Check (Next.js only)
|
|
250
|
-
|
|
251
|
-
Varrer arquivos `page.tsx` da feature para verificar metadata:
|
|
252
|
-
|
|
253
|
-
```bash
|
|
254
|
-
# Buscar páginas da feature
|
|
255
|
-
find . -name "page.tsx" -path "*$ARGUMENTS*" 2>/dev/null
|
|
256
|
-
|
|
257
|
-
# Verificar se têm metadata
|
|
258
|
-
grep -l "export const metadata\|export async function generateMetadata" $(find . -name "page.tsx" -path "*$ARGUMENTS*" 2>/dev/null)
|
|
259
|
-
```
|
|
260
|
-
|
|
261
|
-
Checklist por página:
|
|
262
|
-
|
|
263
|
-
```
|
|
264
|
-
[ ] export const metadata com title e description
|
|
265
|
-
[ ] og:title e og:description (Open Graph)
|
|
266
|
-
[ ] og:image definida (para compartilhamento social)
|
|
267
|
-
[ ] Sem título duplicado entre páginas
|
|
268
|
-
[ ] robots não bloqueia indexação das páginas públicas
|
|
269
|
-
```
|
|
270
|
-
|
|
271
|
-
> SEO não bloqueia PR — reportar como warnings no resumo final.
|
|
272
|
-
|
|
273
|
-
---
|
|
274
|
-
|
|
275
|
-
## Step 7 — Checklist de Design Responsivo
|
|
276
|
-
|
|
277
|
-
Após visualizar os screenshots do Step 4:
|
|
278
|
-
|
|
279
|
-
```
|
|
280
|
-
[ ] Mobile (375px): sem scroll horizontal, botões ≥ 44px, texto legível
|
|
281
|
-
[ ] Tablet (768px): layout adapta (sidebar colapsa, grid ajusta colunas)
|
|
282
|
-
[ ] Desktop (1440px): aproveita espaço disponível, sem conteúdo esticado
|
|
283
|
-
[ ] Navegação funciona em todos os breakpoints
|
|
284
|
-
[ ] Formulários acessíveis em mobile (labels visíveis, inputs grandes o suficiente)
|
|
285
|
-
```
|
|
286
|
-
|
|
287
|
-
Se screenshots não foram capturados (dev server indisponível), marcar como "não verificado" e
|
|
288
|
-
registrar no resumo.
|
|
289
|
-
|
|
290
|
-
---
|
|
291
|
-
|
|
292
|
-
## Step 8 — Resumo e Artefatos
|
|
293
|
-
|
|
294
|
-
Criar arquivo de resumo consolidado:
|
|
295
|
-
|
|
296
|
-
```bash
|
|
297
|
-
mkdir -p ".morph/features/$ARGUMENTS/visual-screenshots"
|
|
298
|
-
```
|
|
299
|
-
|
|
300
|
-
Salvar em `.morph/features/$ARGUMENTS/visual-screenshots/morph:frontend-review-summary.md`:
|
|
301
|
-
|
|
302
|
-
```markdown
|
|
303
|
-
# Frontend Review — {feature}
|
|
304
|
-
|
|
305
|
-
**Data:** {data}
|
|
306
|
-
**Stack:** {stack detectado}
|
|
307
|
-
**Contexto:** design validation | implementation validation | ambos
|
|
308
|
-
|
|
309
|
-
## Resultados
|
|
310
|
-
|
|
311
|
-
### Step 1 — Design Outputs
|
|
312
|
-
- validate-feature: ✅ PASS / 🚫 BLOCK
|
|
313
|
-
- Outputs verificados: ui-design-system.md, ui-mockups.md, ui-components.md, ui-flows.md
|
|
314
|
-
- Contraste WCAG: {resultado}
|
|
315
|
-
|
|
316
|
-
### Step 2 — Scan de Acessibilidade Estática
|
|
317
|
-
- Arquivos escaneados: {N}
|
|
318
|
-
- Findings: {total} ({CRITICAL: N, HIGH: N, MEDIUM: N})
|
|
319
|
-
- Status: ✅ PASS / 🚫 BLOCK
|
|
320
|
-
|
|
321
|
-
### Step 3 — Scan de Código Frontend
|
|
322
|
-
- Status: ✅ PASS / 🚫 BLOCK / ⏭️ pulado (já executado)
|
|
323
|
-
|
|
324
|
-
### Step 4 — Screenshots Responsivos
|
|
325
|
-
- Mobile (375px): {paths ou "não capturado"}
|
|
326
|
-
- Tablet (768px): {paths ou "não capturado"}
|
|
327
|
-
- Desktop (1440px): {paths ou "não capturado"}
|
|
328
|
-
|
|
329
|
-
### Step 5 — axe-core Runtime
|
|
330
|
-
- Violations críticas/sérias: {N} → ✅ / 🚫
|
|
331
|
-
- Warnings (moderate/minor): {N}
|
|
332
|
-
|
|
333
|
-
### Step 6 — SEO (Next.js)
|
|
334
|
-
- Páginas com metadata: {N}/{total}
|
|
335
|
-
- Gaps: {lista ou "nenhum"}
|
|
336
|
-
|
|
337
|
-
## Status Geral
|
|
338
|
-
|
|
339
|
-
**{✅ PASS / 🚫 BLOCK}**
|
|
340
|
-
|
|
341
|
-
{Se BLOCK: motivo(s) listados aqui}
|
|
342
|
-
```
|
|
343
|
-
|
|
344
|
-
---
|
|
345
|
-
|
|
346
|
-
## Resumo dos BLOCKs
|
|
347
|
-
|
|
348
|
-
| Step | Condição de BLOCK |
|
|
349
|
-
|------|-------------------|
|
|
350
|
-
| Step 1 | `validate-feature` falhou ou outputs obrigatórios ausentes |
|
|
351
|
-
| Step 2 | Qualquer finding CRITICAL ou HIGH ≥ 3 no scan estático |
|
|
352
|
-
| Step 3 | Qualquer finding CRITICAL no scan de código |
|
|
353
|
-
| Step 5 | Dev server ativo + axe-core violations `critical` ou `serious` |
|
|
354
|
-
|
|
355
|
-
**Todos os BLOCKs devem ser resolvidos antes de criar o PR (quando executado pós-implementação).**
|
|
356
|
-
|
|
357
|
-
---
|
|
358
|
-
|
|
359
|
-
*MORPH-SPEC by Polymorphism Tech*
|