@polymorphism-tech/morph-spec 4.10.0 → 4.10.2
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/claude-plugin.json +1 -1
- package/docs/CHEATSHEET.md +1 -1
- package/docs/QUICKSTART.md +1 -1
- package/framework/CLAUDE.md +5 -69
- 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/commands/morph-apply.md +151 -161
- package/framework/commands/morph-archive.md +28 -28
- package/framework/commands/morph-infra.md +79 -79
- package/framework/commands/morph-preflight.md +92 -56
- package/framework/commands/morph-proposal.md +94 -70
- package/framework/commands/morph-status.md +31 -31
- package/framework/commands/morph-troubleshoot.md +63 -60
- 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 +57 -2
- package/framework/rules/nextjs-standards.md +2 -0
- package/framework/rules/testing-standards.md +3 -0
- package/framework/skills/level-0-meta/morph-brainstorming/SKILL.md +54 -49
- package/framework/skills/level-0-meta/morph-checklist/SKILL.md +42 -19
- package/framework/skills/level-0-meta/morph-code-review/SKILL.md +8 -5
- package/framework/skills/level-0-meta/morph-code-review-nextjs/SKILL.md +7 -5
- package/framework/skills/level-0-meta/morph-frontend-review/SKILL.md +139 -136
- package/framework/skills/level-0-meta/morph-init/SKILL.md +42 -13
- package/framework/skills/level-0-meta/morph-post-implementation/SKILL.md +130 -130
- package/framework/skills/level-0-meta/morph-replicate/SKILL.md +95 -87
- package/framework/skills/level-0-meta/morph-simulation-checklist/SKILL.md +24 -0
- package/framework/skills/level-0-meta/morph-tool-usage-guide/SKILL.md +42 -41
- package/framework/skills/level-0-meta/morph-verification-before-completion/SKILL.md +22 -11
- package/framework/skills/level-1-workflows/morph-phase-clarify/SKILL.md +123 -114
- package/framework/skills/level-1-workflows/morph-phase-codebase-analysis/SKILL.md +120 -102
- package/framework/skills/level-1-workflows/morph-phase-design/SKILL.md +206 -214
- 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 +241 -360
- package/framework/skills/level-1-workflows/morph-phase-plan/SKILL.md +107 -115
- package/framework/skills/level-1-workflows/morph-phase-setup/SKILL.md +135 -135
- 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 +143 -139
- package/framework/skills/level-1-workflows/morph-phase-uiux/SKILL.md +168 -165
- package/framework/skills/level-1-workflows/morph-scope-escalation/SKILL.md +57 -8
- package/package.json +3 -3
- package/src/commands/project/doctor.js +7 -2
- package/src/commands/project/update.js +4 -4
- package/src/lib/stack-filter.js +58 -0
- package/src/scripts/setup-infra.js +53 -18
- package/src/utils/agents-installer.js +19 -5
- package/src/utils/claude-md-injector.js +90 -0
- package/src/utils/hooks-installer.js +1 -4
- 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/morph-terminal-title/SKILL.md +0 -61
- package/framework/skills/level-0-meta/morph-terminal-title/scripts/set_title.sh +0 -65
|
@@ -6,423 +6,304 @@ disable-model-invocation: true
|
|
|
6
6
|
context: fork
|
|
7
7
|
agent: general-purpose
|
|
8
8
|
user-invocable: false
|
|
9
|
-
cliVersion: "4.10.
|
|
10
|
-
allowed-tools: Read, Write, Edit, Bash, Glob, Grep
|
|
9
|
+
cliVersion: "4.10.2"
|
|
10
|
+
allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion, Agent
|
|
11
11
|
---
|
|
12
12
|
|
|
13
|
-
# MORPH Implement
|
|
13
|
+
# MORPH Implement — Phase 5
|
|
14
14
|
|
|
15
15
|
> INTERNAL: Workflow skill used by /morph-apply during automated phase orchestration. Not a user command.
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
Implement the tasks defined in Phase 4, with checkpoints every 3 tasks and a final recap.
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## Prerequisites
|
|
20
20
|
|
|
21
|
-
- [ ]
|
|
22
|
-
- [ ] `tasks.md`
|
|
23
|
-
- [ ] Tasks gate (`morph-spec approve $ARGUMENTS tasks`)
|
|
24
|
-
- [ ]
|
|
21
|
+
- [ ] Phase 4 (Tasks) completed
|
|
22
|
+
- [ ] `tasks.md` approved by user
|
|
23
|
+
- [ ] Tasks gate approved (`morph-spec approve $ARGUMENTS tasks`)
|
|
24
|
+
- [ ] All design outputs exist (spec.md, contracts.cs/.ts, decisions.md)
|
|
25
25
|
|
|
26
|
-
##
|
|
26
|
+
## Step 0: Ensure Implement Phase
|
|
27
27
|
|
|
28
|
-
**
|
|
28
|
+
**Before any reads or writes — verify the current phase:**
|
|
29
29
|
|
|
30
30
|
```bash
|
|
31
31
|
npx morph-spec state get $ARGUMENTS
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
Check the `"phase"` field:
|
|
35
35
|
|
|
36
|
-
**
|
|
36
|
+
**If `"phase": "implement"`** → correct phase, proceed.
|
|
37
37
|
|
|
38
|
-
**
|
|
38
|
+
**If `"phase": "tasks"`** → run in sequence:
|
|
39
39
|
1. `npx morph-spec state mark-output $ARGUMENTS tasks`
|
|
40
40
|
2. `npx morph-spec approve $ARGUMENTS tasks`
|
|
41
41
|
3. `npx morph-spec phase advance $ARGUMENTS` (→ implement)
|
|
42
42
|
|
|
43
|
-
**
|
|
43
|
+
**Any other value** → STOP — inconsistent state, report to user.
|
|
44
44
|
|
|
45
|
-
> **
|
|
45
|
+
> **Rule:** Never write to `5-implement/` until the phase is `implement`. The hook will block writes.
|
|
46
46
|
|
|
47
47
|
---
|
|
48
48
|
|
|
49
|
-
## Pre-flight
|
|
49
|
+
## Pre-flight Validation (MANDATORY)
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
Before any task work, validate that prior phases are truly complete. `state.json` may have been set manually — these commands verify actual filesystem artifacts.
|
|
52
52
|
|
|
53
53
|
```bash
|
|
54
|
-
# 1.
|
|
54
|
+
# 1. Verify mandatory outputs from all prior phases
|
|
55
55
|
npx morph-spec validate-feature $ARGUMENTS
|
|
56
56
|
|
|
57
|
-
# 2.
|
|
57
|
+
# 2. Confirm all approval gates passed
|
|
58
58
|
npx morph-spec approval-status $ARGUMENTS
|
|
59
|
+
|
|
60
|
+
# 3. Verify activeAgents are populated
|
|
61
|
+
npx morph-spec state get $ARGUMENTS | grep -A5 activeAgents
|
|
59
62
|
```
|
|
60
63
|
|
|
61
|
-
|
|
64
|
+
If any check fails → **STOP**. Do not start any task. Report what's missing:
|
|
62
65
|
|
|
63
|
-
|
|
|
64
|
-
|
|
65
|
-
|
|
|
66
|
-
| Gate
|
|
67
|
-
|
|
|
66
|
+
| Problem | Resolution |
|
|
67
|
+
|---------|-----------|
|
|
68
|
+
| Missing output (spec.md, contracts, etc.) | Return to corresponding phase and generate it |
|
|
69
|
+
| Gate not approved (design, plan, tasks) | `npx morph-spec approve $ARGUMENTS <gate>` |
|
|
70
|
+
| Invalid phase | `npx morph-spec phase advance $ARGUMENTS` |
|
|
71
|
+
| Empty activeAgents | Run `/phase-setup $ARGUMENTS` first |
|
|
68
72
|
|
|
69
|
-
**
|
|
73
|
+
**This step is not optional.** Only proceed when all commands return without errors.
|
|
70
74
|
|
|
71
|
-
|
|
75
|
+
---
|
|
72
76
|
|
|
73
|
-
|
|
74
|
-
> **Ref:** `framework/standards/integration/mcp/mcp-tools.md` para referência MCP.
|
|
75
|
-
> **Example:** `references/recap-example.md` — filled-in recap.md showing expected output quality.
|
|
77
|
+
## Pre-flight MCP — Connection Validation
|
|
76
78
|
|
|
77
|
-
|
|
78
|
-
|------|------------|-------------|
|
|
79
|
-
| Verificar modo de execução (single/subagents/agent-teams) | **Bash** `npx morph-spec dispatch-agents $ARGUMENTS implement` | Grupos de tasks + prompts de subagents |
|
|
80
|
-
| **Dispatch implementadores por domínio** (subagents) | **Agent** `subagent_type=<taskGroups[grupo].agentId>` + `prompt=taskPrompt` do dispatch config | Backend + frontend + infra em paralelo |
|
|
81
|
-
| **Criar Agent Team** (features críticas multi-domínio) | Linguagem natural — veja Passo 0.5b | — |
|
|
82
|
-
| Ler task details | **Read** tasks.json, spec.md, contracts.cs | — |
|
|
83
|
-
| Criar novos arquivos | **Write** source files | — |
|
|
84
|
-
| Modificar arquivos existentes | **Edit** source files | — |
|
|
85
|
-
| Consultar API de biblioteca | **Context7 MCP** `query_docs()` | **WebSearch** + **WebFetch** |
|
|
86
|
-
| Executar migrations | **Supabase MCP** `query()` | **Bash** `npx supabase migration ...` |
|
|
87
|
-
| Build do projeto | **Bash** `dotnet build` ou `npm run build` | — |
|
|
88
|
-
| Rodar testes | **Bash** `dotnet test` ou `npm test` | — |
|
|
89
|
-
| Checkpoint validation | **Bash** `npx morph-spec validate-feature ...` | — |
|
|
90
|
-
| Marcar task concluída | **Bash** `npx morph-spec task done $ARGUMENTS T001` | — |
|
|
91
|
-
| Smoke test no browser | **Playwright MCP** `browser_navigate()` + `browser_snapshot()` | Manual |
|
|
92
|
-
| Verificar erros de console | **Playwright MCP** `browser_console_messages()` | — |
|
|
93
|
-
| Screenshot para recap | **Playwright MCP** `browser_take_screenshot()` | — |
|
|
94
|
-
| Deploy e logs Vercel | **Vercel MCP** `list_projects()`, `get_deployments()`, `manage_env_vars()` | **Bash** `vercel deploy` |
|
|
95
|
-
| Criar PR | **Bash** `gh pr create ...` | **GitHub MCP** `create_pull_request()` |
|
|
96
|
-
| Atualizar state | **Bash** `npx morph-spec state set ...` | — |
|
|
97
|
-
|
|
98
|
-
**MCPs desta fase:** Supabase (migrations, RLS), Context7 (API lookup), Playwright (smoke test), GitHub (PRs), Vercel (deploy, logs, env vars).
|
|
99
|
-
|
|
100
|
-
**Anti-padrões:**
|
|
101
|
-
- ❌ Task agent para editar um único arquivo (use Edit direto)
|
|
102
|
-
- ✅ Task agent para implementar service layer em 5+ arquivos (multi-file legítimo)
|
|
103
|
-
- ✅ Task agents paralelos quando `tasks.total ≥ 6` e feature tem 2+ domínios ativos
|
|
104
|
-
- ✅ Agent Teams quando backend e frontend precisam coordenar contratos de API
|
|
105
|
-
- ❌ Agent Teams para features single-domain (subagents são suficientes)
|
|
106
|
-
- ❌ Agent Teams sem plan approval (cria risco de implementações divergentes)
|
|
107
|
-
- ❌ Bash `cat` para criar arquivos (use Write tool)
|
|
108
|
-
- ❌ Bash `sed` para modificar código (use Edit tool)
|
|
109
|
-
- ❌ Implementar sem ler contracts.cs primeiro (contracts são a fonte de verdade!)
|
|
110
|
-
- ❌ Implementar tasks de backend e frontend sequencialmente quando são independentes
|
|
111
|
-
- ❌ **(VSA)** Criar Application Service layer — handler acessa IRepository diretamente
|
|
112
|
-
- ❌ **(VSA)** Registrar handlers/endpoints manualmente no Program.cs — auto-discovery via reflection
|
|
113
|
-
- ❌ **(VSA)** Colocar Request/Response em arquivos separados do Handler
|
|
114
|
-
- ❌ **(VSA)** Usar `Guid.NewGuid()` — use `Guid.CreateVersion7()`
|
|
115
|
-
- ❌ **Tentar corrigir um bug sem invocar `systematic-debugging` primeiro** — "a mudança é pequena" não é justificativa
|
|
116
|
-
- ✅ Ao encontrar bug: `Skill(superpowers:systematic-debugging)` → causa raiz → fix mínimo → verificar
|
|
79
|
+
Before starting tasks, verify that MCPs needed for the implement phase are working.
|
|
117
80
|
|
|
118
|
-
|
|
81
|
+
**1. Collect MCPs for the implement phase:**
|
|
82
|
+
- Read `framework/skills/level-0-meta/mcp-registry.json` → `phaseMatrix.implement`
|
|
83
|
+
- Read `.claude/settings.local.json` → identify configured MCPs
|
|
119
84
|
|
|
120
|
-
|
|
85
|
+
**2. For each CONFIGURED MCP in `phaseMatrix.implement`:**
|
|
86
|
+
1. Look for a tool matching `healthCheck.toolPattern`
|
|
87
|
+
2. If found → run `healthCheck.testCall` with `healthCheck.testParams`
|
|
88
|
+
3. Evaluate:
|
|
121
89
|
|
|
122
|
-
|
|
90
|
+
| Result | Action |
|
|
91
|
+
|--------|--------|
|
|
92
|
+
| **Success** | `✓ {MCP} — ready` |
|
|
93
|
+
| **Tool not found** | `○ {MCP} — needs restart` |
|
|
94
|
+
| **Error** | → **AskUserQuestion** (below) |
|
|
123
95
|
|
|
124
|
-
**
|
|
125
|
-
- Leia `framework/skills/level-0-meta/mcp-registry.json` → campo `phaseMatrix.implement`
|
|
126
|
-
- Leia `.claude/settings.local.json` → identifique quais MCPs estao configurados
|
|
96
|
+
**On error — ask the user:**
|
|
127
97
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
98
|
+
Use `AskUserQuestion` with header `"{MCP}"` and options:
|
|
99
|
+
- **Continue without {MCP}** — Show `fallback` from registry. Implementation will use the fallback automatically.
|
|
100
|
+
- **Reconfigure credentials** — Collect credentials and update `.claude/settings.local.json`. Re-test after reconfiguring.
|
|
101
|
+
- **Stop implementation** — Abort. User must fix the MCP and re-run `/morph-apply`.
|
|
132
102
|
|
|
133
|
-
|
|
134
|
-
|-----------|------|
|
|
135
|
-
| **Sucesso** | `✓ {MCP} — pronto` |
|
|
136
|
-
| **Ferramenta nao encontrada** | `○ {MCP} — precisa restart` |
|
|
137
|
-
| **Erro** | → **AskUserQuestion** (abaixo) |
|
|
103
|
+
> **Design:** This check is fail-open — consistent with morph-spec philosophy. The user gets explicit choice instead of tasks failing silently.
|
|
138
104
|
|
|
139
|
-
|
|
105
|
+
---
|
|
140
106
|
|
|
141
|
-
|
|
142
|
-
- **Continuar sem {MCP}** — Mostre `fallback` do registry (ex: "Bash `gh` CLI" para GitHub). A implementacao usara o fallback automaticamente.
|
|
143
|
-
- **Reconfigurar credenciais** — Colete credenciais e atualize `.claude/settings.local.json`. Re-teste apos reconfigurar.
|
|
144
|
-
- **Parar implementacao** — Aborte. Usuario deve corrigir o MCP e re-rodar `/morph-apply`.
|
|
107
|
+
## Recommended Tools
|
|
145
108
|
|
|
146
|
-
**
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
✓ context7 — pronto
|
|
150
|
-
✓ supabase — pronto
|
|
151
|
-
○ playwright — precisa restart (fallback: manual testing)
|
|
152
|
-
— docker — nao configurado
|
|
153
|
-
```
|
|
109
|
+
> **Ref:** `framework/skills/level-0-meta/morph-tool-usage-guide/SKILL.md` for complete guide.
|
|
110
|
+
> **Ref:** `framework/standards/integration/mcp/mcp-tools.md` for MCP reference.
|
|
111
|
+
> **Example:** `references/recap-example.md` — filled-in recap.md showing expected output quality.
|
|
154
112
|
|
|
155
|
-
|
|
113
|
+
| Action | Tool | Alternative |
|
|
114
|
+
|--------|------|-------------|
|
|
115
|
+
| Check execution mode (single/subagents/agent-teams) | **Bash** `npx morph-spec dispatch-agents $ARGUMENTS implement` | Task groups + subagent prompts |
|
|
116
|
+
| **Dispatch implementers by domain** (subagents) | **Agent** `subagent_type=<taskGroups[group].agentId>` + `prompt=taskPrompt` from dispatch config | Backend + frontend + infra in parallel |
|
|
117
|
+
| **Create Agent Team** (critical multi-domain features) | Natural language — see Step 0.5b | — |
|
|
118
|
+
| Read task details | **Read** tasks.md, spec.md, contracts.cs/.ts | — |
|
|
119
|
+
| Create new files | **Write** source files | — |
|
|
120
|
+
| Modify existing files | **Edit** source files | — |
|
|
121
|
+
| Look up library API | **Context7 MCP** `query_docs()` | **WebSearch** + **WebFetch** |
|
|
122
|
+
| Run migrations | **Supabase MCP** `query()` | **Bash** `npx supabase migration ...` |
|
|
123
|
+
| Build project | **Bash** `dotnet build` or `npm run build` | — |
|
|
124
|
+
| Run tests | **Bash** `dotnet test` or `npm test` | — |
|
|
125
|
+
| Checkpoint validation | **Bash** `npx morph-spec validate-feature ...` | — |
|
|
126
|
+
| Mark task complete | **Bash** `npx morph-spec task done $ARGUMENTS T001` | — |
|
|
127
|
+
| Smoke test in browser | **Playwright MCP** `browser_navigate()` + `browser_snapshot()` | Manual |
|
|
128
|
+
| Check console errors | **Playwright MCP** `browser_console_messages()` | — |
|
|
129
|
+
| Screenshot for recap | **Playwright MCP** `browser_take_screenshot()` | — |
|
|
130
|
+
| Deploy and logs Vercel | **Vercel MCP** `list_projects()`, `get_deployments()`, `manage_env_vars()` | **Bash** `vercel deploy` |
|
|
131
|
+
| Create PR | **Bash** `gh pr create ...` | **GitHub MCP** `create_pull_request()` |
|
|
132
|
+
| Update state | **Bash** `npx morph-spec state set ...` | — |
|
|
133
|
+
|
|
134
|
+
**Phase MCPs:** Supabase (migrations, RLS), Context7 (API lookup), Playwright (smoke test), GitHub (PRs), Vercel (deploy, logs, env vars).
|
|
135
|
+
|
|
136
|
+
**Anti-patterns:**
|
|
137
|
+
- Task agent for editing a single file (use Edit directly)
|
|
138
|
+
- Agent Teams for single-domain features (subagents suffice)
|
|
139
|
+
- Agent Teams without plan approval (creates risk of divergent implementations)
|
|
140
|
+
- `Bash cat` to create files (use Write tool)
|
|
141
|
+
- `Bash sed` to modify code (use Edit tool)
|
|
142
|
+
- Implementing without reading contracts.cs/.ts first (contracts are the source of truth!)
|
|
143
|
+
- Running backend and frontend tasks sequentially when they are independent
|
|
144
|
+
- **(VSA)** Creating Application Service layer — handler accesses IRepository directly
|
|
145
|
+
- **(VSA)** Manually registering handlers/endpoints in Program.cs — use auto-discovery via reflection
|
|
146
|
+
- **(VSA)** Placing Request/Response in separate files from Handler
|
|
147
|
+
- **(VSA)** Using `Guid.NewGuid()` — use `Guid.CreateVersion7()`
|
|
148
|
+
- Trying to fix a bug without invoking `systematic-debugging` first
|
|
156
149
|
|
|
157
150
|
---
|
|
158
151
|
|
|
159
|
-
##
|
|
152
|
+
## Context Loading
|
|
160
153
|
|
|
161
|
-
### 1.
|
|
154
|
+
### 1. Read full context in PARALLEL
|
|
162
155
|
|
|
163
156
|
```
|
|
164
|
-
#
|
|
157
|
+
# Single parallel call, not sequential:
|
|
165
158
|
Read: .morph/features/{feature}/4-tasks/tasks.md
|
|
166
159
|
+ Read: .morph/features/{feature}/1-design/spec.md
|
|
167
|
-
+ Read: .morph/features/{feature}/1-design/contracts.cs
|
|
160
|
+
+ Read: .morph/features/{feature}/1-design/contracts.cs (or contracts.ts for TypeScript projects)
|
|
168
161
|
+ Read: .morph/config/config.json (→ architecture.style)
|
|
169
162
|
+ Read: .morph/features/{feature}/3-plan/plan.md
|
|
170
163
|
```
|
|
171
164
|
|
|
172
|
-
### 2.
|
|
165
|
+
### 2. Create native tasks for each T001-T00N
|
|
173
166
|
|
|
174
|
-
|
|
167
|
+
After reading `tasks.md`, create **one native task per task found**:
|
|
175
168
|
|
|
176
169
|
```
|
|
177
|
-
#
|
|
178
|
-
TaskCreate: "{T001}: {
|
|
179
|
-
TaskCreate: "{T002}: {
|
|
180
|
-
... (
|
|
181
|
-
|
|
182
|
-
# Tarefas orquestrais sempre ao final:
|
|
183
|
-
TaskCreate: "Checkpoints e validação" → activeForm: "Validando checkpoint"
|
|
184
|
-
TaskCreate: "Gerar recap.md" → activeForm: "Gerando recap"
|
|
185
|
-
```
|
|
170
|
+
# For each task in tasks.md (T001, T002, ..., T00N):
|
|
171
|
+
TaskCreate: "{T001}: {task title}" → description: full description → activeForm: "Implementing T001"
|
|
172
|
+
TaskCreate: "{T002}: {task title}" → description: full description → activeForm: "Implementing T002"
|
|
173
|
+
... (one TaskCreate per task)
|
|
186
174
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
TaskUpdate(taskId="<id de T003>", addBlockedBy=["<id de T001>", "<id de T002>"])
|
|
175
|
+
# Orchestral tasks always at the end:
|
|
176
|
+
TaskCreate: "Checkpoints and validation" → activeForm: "Validating checkpoint"
|
|
177
|
+
TaskCreate: "Generate recap.md" → activeForm: "Generating recap"
|
|
191
178
|
```
|
|
192
179
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
---
|
|
196
|
-
|
|
197
|
-
## Workflow
|
|
198
|
-
|
|
199
|
-
### Passo 0.5: Planejar Modo de Execução
|
|
200
|
-
|
|
201
|
-
**Ler estratégia do plano:**
|
|
180
|
+
**After creating all tasks, configure dependencies mirroring `tasks.md`:**
|
|
202
181
|
```
|
|
203
|
-
|
|
182
|
+
# For each task with `dependencies: [T00X, T00Y]` in tasks.md:
|
|
183
|
+
TaskUpdate(taskId="<id of T003>", addBlockedBy=["<id of T001>", "<id of T002>"])
|
|
204
184
|
```
|
|
205
185
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
**O campo `Execution Strategy` determina o caminho de execução:**
|
|
209
|
-
|
|
210
|
-
| Estratégia | Ação |
|
|
211
|
-
|--------|------|
|
|
212
|
-
| `"single"` | → Continue para o workflow sequencial normal (Passo 1) |
|
|
213
|
-
| `"subagents"` | → Dispatch Task subagents em paralelo (abaixo) |
|
|
214
|
-
| `"agent-teams"` | → Crie Agent Team com plan approval (Passo 0.5b) |
|
|
215
|
-
|
|
216
|
-
Se `plan.md` não existir ou o campo não estiver presente, execute como fallback:
|
|
186
|
+
### 3. Detect architecture style
|
|
217
187
|
|
|
218
188
|
```bash
|
|
219
|
-
|
|
189
|
+
cat .morph/config/config.json | grep architecture
|
|
220
190
|
```
|
|
221
191
|
|
|
222
|
-
|
|
192
|
+
If `config.architecture.style === "vertical-slice"` → follow **Step 1.5** before implementing.
|
|
193
|
+
Otherwise → go directly to the task loop.
|
|
223
194
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
#### Modo `"subagents"` (se `mode: "subagents"` no output):
|
|
195
|
+
### Step 1.5: VSA Implementation Guide (only if `style: "vertical-slice"`)
|
|
227
196
|
|
|
228
|
-
|
|
229
|
-
2. Para cada grupo com ≥ 3 tasks e sem dependências cruzadas, use o **Agent tool** com o `subagent_type=<agentId>` do grupo e o `taskPrompt` do dispatch config:
|
|
197
|
+
> For the complete slice structure and VSA rules, see `references/vsa-implementation-guide.md`
|
|
230
198
|
|
|
231
|
-
|
|
232
|
-
> Exemplo: `agentId: "dotnet-senior"` → `Agent(subagent_type=dotnet-senior, prompt=taskPrompt)`.
|
|
233
|
-
|
|
234
|
-
```
|
|
235
|
-
[Task tool — grupo backend, por exemplo]
|
|
236
|
-
Prompt do dispatch config enriquecido:
|
|
237
|
-
|
|
238
|
-
Você é o implementador do grupo BACKEND da feature '$ARGUMENTS'.
|
|
239
|
-
|
|
240
|
-
Contexto completo:
|
|
241
|
-
- Spec: [conteúdo de .morph/features/$ARGUMENTS/1-design/spec.md]
|
|
242
|
-
- Contracts: [conteúdo de .morph/features/$ARGUMENTS/1-design/contracts.cs]
|
|
243
|
-
- Tasks do grupo: [lista de TXXX do grupo backend]
|
|
244
|
-
|
|
245
|
-
# No início deste subagent (grupo BACKEND):
|
|
246
|
-
# 1. Criar native task por task do grupo:
|
|
247
|
-
# TaskCreate: "{T00X}: {título}" → activeForm: "Implementando T00X"
|
|
248
|
-
# 2. Configurar dependências do grupo via TaskUpdate:
|
|
249
|
-
# TaskUpdate(taskId="<id de T003>", addBlockedBy=["<id de T001>", "<id de T002>"])
|
|
250
|
-
# Guarde o mapeamento {T00X → taskId} para usar no loop abaixo.
|
|
251
|
-
|
|
252
|
-
Para cada task do grupo, em ordem:
|
|
253
|
-
1. TaskUpdate(taskId="<native id de T00X>", status="in_progress")
|
|
254
|
-
2. Execute: npx morph-spec task start $ARGUMENTS TXXX
|
|
255
|
-
3. Leia a descrição completa da task
|
|
256
|
-
4. Implemente os arquivos — use Write (novo) ou Edit (existente)
|
|
257
|
-
5. Verifique build: [dotnet build / npm run build]
|
|
258
|
-
5b. Invoke Skill(verification-before-completion) — só prossiga para o passo 6 se passar
|
|
259
|
-
6. Execute: npx morph-spec task done $ARGUMENTS TXXX
|
|
260
|
-
7. Se task done retornar sem erro: TaskUpdate(taskId="<native id de T00X>", status="completed")
|
|
261
|
-
|
|
262
|
-
A cada 3 tasks:
|
|
263
|
-
- Execute: npx morph-spec checkpoint-save $ARGUMENTS
|
|
264
|
-
- Execute: npx morph-spec validate-feature $ARGUMENTS --phase implement
|
|
265
|
-
- Reporte qualquer falha de validação antes de continuar
|
|
266
|
-
|
|
267
|
-
Restrições OBRIGATÓRIAS:
|
|
268
|
-
- Modifique APENAS os arquivos listados nas tasks do grupo BACKEND
|
|
269
|
-
- NÃO toque em arquivos de frontend, UI ou infra
|
|
270
|
-
- Se encontrar dependência em outro grupo, pause e reporte
|
|
271
|
-
```
|
|
272
|
-
|
|
273
|
-
3. Dispare os Task subagents dos grupos em **paralelo** (quando sem dependências entre si)
|
|
274
|
-
4. Após todos completarem, valide integração: `npx morph-spec validate-feature $ARGUMENTS --phase implement`
|
|
275
|
-
|
|
276
|
-
**Se `mode: "single"`** (feature pequena ou single-domain):
|
|
277
|
-
→ Continue para o workflow sequencial normal abaixo.
|
|
199
|
+
Structure: `Features/{Entity}Feature/{Op}/` with Handler (+ Request/Response records) + Validator + Endpoint per slice. Everything `sealed`. `Guid.CreateVersion7()`. `result.Match()` in endpoints. No Application Service layer — handler accesses IRepository directly. Auto-discovery via reflection: do not manually register in Program.cs.
|
|
278
200
|
|
|
279
201
|
---
|
|
280
202
|
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
**Quando usar:** `mode: "agent-teams"` no output de `dispatch-agents`
|
|
284
|
-
**Requisito:** `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` no `.claude/settings.local.json` (instalado pelo morph-spec)
|
|
285
|
-
|
|
286
|
-
**Por que Agent Teams em vez de subagents:**
|
|
287
|
-
Agent Teams têm TaskList compartilhada, mensagens diretas entre teammates e hooks `TeammateIdle`. Subagents são fire-and-forget. Para features onde backend e frontend precisam coordenar contratos de API, Agent Teams garantem que o frontend não implemente chamadas antes do backend estabilizar os DTOs.
|
|
203
|
+
## Workflow
|
|
288
204
|
|
|
289
|
-
|
|
205
|
+
### Step 0.5: Plan Execution Mode
|
|
290
206
|
|
|
207
|
+
**Read the plan's execution strategy:**
|
|
291
208
|
```
|
|
292
|
-
|
|
293
|
-
- Backend teammate (dotnet-senior): Implemente as tasks do grupo backend.
|
|
294
|
-
Contexto: .morph/features/$ARGUMENTS/1-design/spec.md, contracts.cs, standards/coding.md
|
|
295
|
-
Restrição: Modifique APENAS arquivos de backend/domain/application.
|
|
296
|
-
Antes de implementar interfaces compartilhadas, envie mensagem ao frontend teammate.
|
|
297
|
-
- Frontend teammate (blazor-builder OU nextjs-expert): Implemente as tasks do grupo frontend.
|
|
298
|
-
Contexto: .morph/features/$ARGUMENTS/1-design/spec.md, design-system.md, standards/frontend/
|
|
299
|
-
Restrição: Modifique APENAS arquivos de UI/components/pages.
|
|
300
|
-
Aguarde confirmação do backend teammate antes de implementar chamadas de API.
|
|
301
|
-
- Quality teammate (standards-architect): Revise o output de cada teammate e execute validate-feature.
|
|
302
|
-
Exija plan approval antes de cada implementação.
|
|
303
|
-
Só aprove planos que correspondam ao contracts.cs e spec.md.
|
|
209
|
+
Read: .morph/features/{feature}/3-plan/plan.md → extract "Execution Strategy" field
|
|
304
210
|
```
|
|
305
211
|
|
|
306
|
-
|
|
212
|
+
The strategy was defined and approved in the Plan phase. Use it directly:
|
|
307
213
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
214
|
+
| Strategy | Action |
|
|
215
|
+
|----------|--------|
|
|
216
|
+
| `"single"` | → Continue to the sequential task loop (Step 2) |
|
|
217
|
+
| `"subagents"` | → Dispatch Task subagents in parallel (below) |
|
|
218
|
+
| `"agent-teams"` | → Create Agent Team with plan approval (Step 0.5b) |
|
|
312
219
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
- Habilite **plan approval**: "Require plan approval before each teammate implements"
|
|
316
|
-
- Gate de qualidade: "Only approve plans that match contracts.cs and spec.md"
|
|
317
|
-
- Restrição de domínio por teammate: cada um modifica APENAS arquivos do seu domínio
|
|
318
|
-
|
|
319
|
-
**4. Após todos os teammates completarem:**
|
|
220
|
+
If `plan.md` doesn't exist or the field is missing, run as fallback:
|
|
320
221
|
|
|
321
222
|
```bash
|
|
322
|
-
npx morph-spec
|
|
223
|
+
npx morph-spec dispatch-agents $ARGUMENTS implement
|
|
323
224
|
```
|
|
324
225
|
|
|
325
|
-
Sintetize os resultados de todos os teammates no recap.md (Passo 6).
|
|
326
|
-
|
|
327
226
|
---
|
|
328
227
|
|
|
329
|
-
|
|
228
|
+
#### Subagents Mode (if strategy is `"subagents"`):
|
|
330
229
|
|
|
331
|
-
|
|
230
|
+
1. Read `taskGroups` from dispatch config (e.g., `backend`, `frontend`, `infra`)
|
|
231
|
+
2. For each group with >= 3 tasks and no cross-group dependencies, use **Agent tool** with `subagent_type=<agentId>` and `taskPrompt` from dispatch config:
|
|
332
232
|
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
- [ ] `spec.md` atualizado com clarificações?
|
|
336
|
-
- [ ] `contracts.cs` corresponde ao schema real?
|
|
337
|
-
- [ ] Build base do projeto compila sem erros?
|
|
338
|
-
- [ ] `activeAgents` estão populados? (`morph-spec state get $ARGUMENTS` → campo `activeAgents` não vazio)
|
|
233
|
+
> **Mapping:** `taskGroups[group].agentId` = `subagent_type` in Agent tool.
|
|
234
|
+
> Example: `agentId: "dotnet-senior"` → `Agent(subagent_type=dotnet-senior, prompt=taskPrompt)`.
|
|
339
235
|
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
236
|
+
Each subagent receives a prompt with:
|
|
237
|
+
- Full spec.md and contracts.cs/.ts content
|
|
238
|
+
- The group's task list
|
|
239
|
+
- Instructions to create native tasks, follow the task loop (start → implement → verify → done), checkpoint every 3 tasks
|
|
240
|
+
- Domain isolation: modify ONLY files in their domain
|
|
241
|
+
- **MANDATORY verification before every `task done`** (see Step 2, item 6b)
|
|
346
242
|
|
|
347
|
-
|
|
348
|
-
|
|
243
|
+
3. Dispatch subagents for groups in **parallel** (when no cross-group dependencies)
|
|
244
|
+
4. After all complete, validate integration: `npx morph-spec validate-feature $ARGUMENTS --phase implement`
|
|
349
245
|
|
|
350
|
-
|
|
351
|
-
→ Execute o skill `phase-setup` primeiro: `/phase-setup $ARGUMENTS`
|
|
352
|
-
→ Agentes não detectados = standards não carregados = implementação sem contexto correto
|
|
246
|
+
**If strategy is `"single"`** → continue to sequential task loop below.
|
|
353
247
|
|
|
354
248
|
---
|
|
355
249
|
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
Leia todos os outputs antes de implementar:
|
|
250
|
+
#### Step 0.5b: Agent Teams (critical multi-domain features)
|
|
359
251
|
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
3. `.morph/features/$ARGUMENTS/1-design/contracts.cs` — Interfaces e DTOs
|
|
363
|
-
4. `.morph/features/$ARGUMENTS/1-design/decisions.md` — ADRs
|
|
364
|
-
5. `.morph/features/$ARGUMENTS/1-design/schema-analysis.md` — Schema real (se existir)
|
|
365
|
-
6. `.morph/features/$ARGUMENTS/2-ui/design-system.md` — Design tokens (se existir)
|
|
252
|
+
**When:** strategy is `"agent-teams"`
|
|
253
|
+
**Requirement:** `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` in `.claude/settings.local.json`
|
|
366
254
|
|
|
367
|
-
**
|
|
368
|
-
|
|
369
|
-
# Leia config para saber se é VSA ou DDD:
|
|
370
|
-
cat .morph/config/config.json | grep architecture
|
|
371
|
-
```
|
|
255
|
+
**Why Agent Teams over subagents:**
|
|
256
|
+
Agent Teams have a shared TaskList, direct teammate messaging, and `TeammateIdle` hooks. Subagents are fire-and-forget. For features where backend and frontend need to coordinate API contracts, Agent Teams ensure frontend doesn't implement calls before backend stabilizes DTOs.
|
|
372
257
|
|
|
373
|
-
|
|
374
|
-
|
|
258
|
+
Create the team with natural language specifying:
|
|
259
|
+
- Backend teammate (dotnet-senior): backend/domain/application files only
|
|
260
|
+
- Frontend teammate (blazor-builder or nextjs-expert): UI/components/pages files only
|
|
261
|
+
- Quality teammate (standards-architect): review + validate-feature after each implementation
|
|
262
|
+
- Enable **plan approval**: teammates must get plans approved before implementing
|
|
263
|
+
- Gate: only approve plans matching contracts.cs/.ts and spec.md
|
|
375
264
|
|
|
376
|
-
|
|
265
|
+
After all teammates complete: `npx morph-spec validate-feature $ARGUMENTS --phase implement`
|
|
377
266
|
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
Estrutura: `Features/{Entity}Feature/{Op}/` com Handler (+ Request/Response records) + Validator + Endpoint por slice. Tudo `sealed`. `Guid.CreateVersion7()`. `result.Match()` nos endpoints. Sem Application Service layer — handler acessa IRepository diretamente. Auto-discovery via reflection: não registrar manualmente no Program.cs.
|
|
381
|
-
|
|
382
|
-
Após cada slice completo, verificar build:
|
|
383
|
-
```bash
|
|
384
|
-
dotnet build
|
|
385
|
-
```
|
|
267
|
+
---
|
|
386
268
|
|
|
387
|
-
###
|
|
269
|
+
### Step 2: Task Loop
|
|
388
270
|
|
|
389
271
|
```bash
|
|
390
272
|
npx morph-spec task next $ARGUMENTS
|
|
391
273
|
```
|
|
392
274
|
|
|
393
|
-
|
|
275
|
+
For each task (T001 → T00N):
|
|
394
276
|
|
|
395
|
-
1. **
|
|
277
|
+
1. **Mark as in-progress (native task):**
|
|
396
278
|
```
|
|
397
|
-
TaskUpdate(taskId="<native id
|
|
279
|
+
TaskUpdate(taskId="<native id>", status="in_progress")
|
|
398
280
|
```
|
|
399
|
-
2. **
|
|
281
|
+
2. **Start via CLI:**
|
|
400
282
|
```bash
|
|
401
283
|
npx morph-spec task start $ARGUMENTS T001
|
|
402
284
|
```
|
|
403
|
-
3. **
|
|
404
|
-
4. **
|
|
405
|
-
5. **
|
|
406
|
-
6. **
|
|
407
|
-
|
|
408
|
-
Invoke `Skill(verification-before-completion)` ou execute manualmente:
|
|
285
|
+
3. **Read the task description** + contracts.cs/.ts for relevant DTOs/interfaces
|
|
286
|
+
4. **Implement** using Write (new) or Edit (existing)
|
|
287
|
+
5. **Verify** — build, lint, tests
|
|
288
|
+
6. **MANDATORY — Verification before `task done`:**
|
|
289
|
+
Run `validate-feature` before marking ANY task as done. This is non-negotiable — it catches broken code, missing files, and spec violations before they compound across tasks.
|
|
409
290
|
```bash
|
|
410
291
|
npx morph-spec validate-feature $ARGUMENTS --phase implement
|
|
411
292
|
```
|
|
412
|
-
|
|
413
|
-
7. **
|
|
293
|
+
Only proceed to step 7 if verification passes. If it fails → fix before marking `task done`.
|
|
294
|
+
7. **Mark as done via CLI:**
|
|
414
295
|
```bash
|
|
415
296
|
npx morph-spec task done $ARGUMENTS T001
|
|
416
297
|
```
|
|
417
|
-
8. **
|
|
298
|
+
8. **If `task done` returns without error, mark native task as completed:**
|
|
418
299
|
```
|
|
419
|
-
TaskUpdate(taskId="<native id
|
|
300
|
+
TaskUpdate(taskId="<native id>", status="completed")
|
|
420
301
|
```
|
|
421
|
-
>
|
|
302
|
+
> `TaskUpdate(completed)` only happens if `task done` returns without error (validation passed).
|
|
422
303
|
|
|
423
|
-
###
|
|
304
|
+
### Step 3: Checkpoint Every 3 Tasks
|
|
424
305
|
|
|
425
|
-
**
|
|
306
|
+
**After every 3 completed tasks:**
|
|
426
307
|
|
|
427
308
|
```bash
|
|
428
309
|
# Save checkpoint
|
|
@@ -432,21 +313,21 @@ npx morph-spec checkpoint-save $ARGUMENTS
|
|
|
432
313
|
npx morph-spec validate-feature $ARGUMENTS --phase implement
|
|
433
314
|
```
|
|
434
315
|
|
|
435
|
-
**
|
|
436
|
-
1.
|
|
437
|
-
2.
|
|
438
|
-
3. Re-
|
|
439
|
-
4.
|
|
316
|
+
**If validation fails:**
|
|
317
|
+
1. Do NOT advance to the next task
|
|
318
|
+
2. Fix reported issues
|
|
319
|
+
3. Re-run validation
|
|
320
|
+
4. Only then proceed
|
|
440
321
|
|
|
441
|
-
###
|
|
322
|
+
### Step 4: Test-Driven Development (Recommended)
|
|
442
323
|
|
|
443
|
-
|
|
324
|
+
For each implementation task:
|
|
444
325
|
|
|
445
|
-
1. **
|
|
446
|
-
2. **
|
|
447
|
-
3. **
|
|
448
|
-
4. **
|
|
449
|
-
5. **
|
|
326
|
+
1. **Write test first** (unit test for service/domain)
|
|
327
|
+
2. **Run test** — should fail (RED)
|
|
328
|
+
3. **Implement** the minimum to pass
|
|
329
|
+
4. **Run test** — should pass (GREEN)
|
|
330
|
+
5. **Refactor** if needed (REFACTOR)
|
|
450
331
|
|
|
451
332
|
```bash
|
|
452
333
|
# .NET
|
|
@@ -456,136 +337,136 @@ dotnet test --filter "FullyQualifiedName~{TestClass}"
|
|
|
456
337
|
npm test -- test/path/to/test.js
|
|
457
338
|
```
|
|
458
339
|
|
|
459
|
-
###
|
|
340
|
+
### Step 5: Smoke Test with Playwright (if UI)
|
|
460
341
|
|
|
461
|
-
|
|
342
|
+
After implementing visual components:
|
|
462
343
|
|
|
463
344
|
```javascript
|
|
464
|
-
//
|
|
345
|
+
// Navigate to the page
|
|
465
346
|
await mcp__playwright__browser_navigate({ url: 'http://localhost:5000/feature-page' });
|
|
466
347
|
|
|
467
|
-
//
|
|
348
|
+
// Capture page state
|
|
468
349
|
await mcp__playwright__browser_snapshot();
|
|
469
350
|
|
|
470
|
-
//
|
|
351
|
+
// Check console errors
|
|
471
352
|
await mcp__playwright__browser_console_messages({ level: 'error' });
|
|
472
353
|
|
|
473
|
-
// Screenshot
|
|
354
|
+
// Screenshot for recap
|
|
474
355
|
await mcp__playwright__browser_take_screenshot({ type: 'png' });
|
|
475
356
|
```
|
|
476
357
|
|
|
477
|
-
###
|
|
358
|
+
### Step 6: Generate `recap.md`
|
|
478
359
|
|
|
479
|
-
|
|
360
|
+
After ALL tasks completed:
|
|
480
361
|
|
|
481
362
|
```bash
|
|
482
363
|
npx morph-spec generate recap $ARGUMENTS
|
|
483
364
|
```
|
|
484
365
|
|
|
485
|
-
>
|
|
366
|
+
> For the full recap format, see `references/recap-example.md`
|
|
486
367
|
|
|
487
|
-
###
|
|
368
|
+
### Step 7: Update State
|
|
488
369
|
|
|
489
370
|
```bash
|
|
490
371
|
npx morph-spec state set $ARGUMENTS status done
|
|
491
372
|
npx morph-spec state mark-output $ARGUMENTS recap
|
|
492
373
|
```
|
|
493
374
|
|
|
494
|
-
###
|
|
375
|
+
### Step 8: Post-Implementation Review (mandatory before PR)
|
|
495
376
|
|
|
496
377
|
```bash
|
|
497
378
|
/post-implementation $ARGUMENTS
|
|
498
379
|
```
|
|
499
380
|
|
|
500
|
-
|
|
501
|
-
-
|
|
502
|
-
-
|
|
503
|
-
- `validate-feature`
|
|
504
|
-
- Smoke test via Playwright (
|
|
505
|
-
-
|
|
506
|
-
- **`morph-checklist`** — compliance (
|
|
507
|
-
- Checkpoint + recap
|
|
381
|
+
Run the `post-implementation` skill before creating the PR. It orchestrates:
|
|
382
|
+
- Automated scans (CRITICAL findings block PR)
|
|
383
|
+
- Full test suite
|
|
384
|
+
- Final `validate-feature`
|
|
385
|
+
- Smoke test via Playwright (mandatory if dev server active)
|
|
386
|
+
- Code review checklist (CRITICAL + HIGH)
|
|
387
|
+
- **`morph-checklist`** — compliance (security, SEO, performance, accessibility, LGPD)
|
|
388
|
+
- Checkpoint + final recap
|
|
508
389
|
|
|
509
|
-
###
|
|
390
|
+
### Step 9: Frontend Review (NEXTJS/FULLSTACK)
|
|
510
391
|
|
|
511
|
-
|
|
392
|
+
If stack is NEXTJS or FULLSTACK:
|
|
512
393
|
|
|
513
394
|
```bash
|
|
514
395
|
/frontend-review $ARGUMENTS
|
|
515
396
|
```
|
|
516
397
|
|
|
517
|
-
|
|
518
|
-
screenshots
|
|
398
|
+
Complements `post-implementation` with: accessibility scan (static + axe-core runtime),
|
|
399
|
+
responsive screenshots (mobile/tablet/desktop), and SEO metadata verification.
|
|
519
400
|
|
|
520
401
|
---
|
|
521
402
|
|
|
522
|
-
##
|
|
403
|
+
## Morph-Native Dispatch
|
|
523
404
|
|
|
524
|
-
|
|
405
|
+
morph-spec uses its own agents and validators for implementation, dispatch, and review.
|
|
525
406
|
|
|
526
|
-
###
|
|
407
|
+
### Implementation
|
|
527
408
|
|
|
528
|
-
|
|
409
|
+
Implementers are dispatched via `dispatch-agents`:
|
|
529
410
|
```bash
|
|
530
411
|
npx morph-spec dispatch-agents $ARGUMENTS implement
|
|
531
412
|
```
|
|
532
413
|
|
|
533
|
-
Use
|
|
414
|
+
Use the `agentId` from each group as `subagent_type` in the Agent tool:
|
|
534
415
|
```
|
|
535
|
-
Agent(subagent_type=<agentId>, prompt=<
|
|
416
|
+
Agent(subagent_type=<agentId>, prompt=<filled prompts/implementer-prompt.md>)
|
|
536
417
|
```
|
|
537
418
|
|
|
538
419
|
### Review (Two-Stage)
|
|
539
420
|
|
|
540
|
-
**Stage 1 — Spec Compliance (
|
|
421
|
+
**Stage 1 — Spec Compliance (mandatory):**
|
|
541
422
|
```
|
|
542
|
-
Agent(subagent_type=<tier-4 validator>, prompt=<
|
|
423
|
+
Agent(subagent_type=<tier-4 validator>, prompt=<filled prompts/spec-reviewer-prompt.md>)
|
|
543
424
|
```
|
|
544
|
-
Use
|
|
425
|
+
Use validators from `dispatch-agents --mode validate`. Spec compliance MUST pass before proceeding.
|
|
545
426
|
|
|
546
|
-
**Stage 2 — Code Quality (
|
|
427
|
+
**Stage 2 — Code Quality (mandatory):**
|
|
547
428
|
```
|
|
548
|
-
Agent(subagent_type=standards-architect, prompt=<
|
|
429
|
+
Agent(subagent_type=standards-architect, prompt=<filled prompts/code-quality-reviewer-prompt.md>)
|
|
549
430
|
```
|
|
550
|
-
|
|
431
|
+
`critical` issues block. `important` issues must be fixed. `suggestion` is optional.
|
|
551
432
|
|
|
552
433
|
### Prompt Templates
|
|
553
434
|
|
|
554
|
-
| Template |
|
|
555
|
-
|
|
556
|
-
| `prompts/implementer-prompt.md` | Dispatch
|
|
557
|
-
| `prompts/spec-reviewer-prompt.md` |
|
|
558
|
-
| `prompts/code-quality-reviewer-prompt.md` |
|
|
435
|
+
| Template | Usage |
|
|
436
|
+
|----------|-------|
|
|
437
|
+
| `prompts/implementer-prompt.md` | Dispatch to implementer agents |
|
|
438
|
+
| `prompts/spec-reviewer-prompt.md` | Spec compliance review |
|
|
439
|
+
| `prompts/code-quality-reviewer-prompt.md` | Code quality review |
|
|
559
440
|
|
|
560
441
|
---
|
|
561
442
|
|
|
562
|
-
## Outputs
|
|
443
|
+
## Outputs
|
|
563
444
|
|
|
564
|
-
-
|
|
565
|
-
-
|
|
566
|
-
- `.morph/features/$ARGUMENTS/5-implement/recap.md` —
|
|
445
|
+
- Implemented source code (various files)
|
|
446
|
+
- Unit and integration tests
|
|
447
|
+
- `.morph/features/$ARGUMENTS/5-implement/recap.md` — Implementation summary
|
|
567
448
|
|
|
568
|
-
##
|
|
449
|
+
## Completion Criteria
|
|
569
450
|
|
|
570
|
-
- [x]
|
|
571
|
-
- [x] Build
|
|
572
|
-
- [x]
|
|
573
|
-
- [x] Validation pipeline
|
|
574
|
-
- [x] `recap.md`
|
|
575
|
-
- [x] State
|
|
576
|
-
- [x] Checkpoints
|
|
577
|
-
- [x] `/post-implementation`
|
|
451
|
+
- [x] All tasks completed
|
|
452
|
+
- [x] Build compiles without errors
|
|
453
|
+
- [x] Tests passing
|
|
454
|
+
- [x] Validation pipeline passes
|
|
455
|
+
- [x] `recap.md` generated
|
|
456
|
+
- [x] State updated to `status: done`
|
|
457
|
+
- [x] Checkpoints saved every 3 tasks
|
|
458
|
+
- [x] `/post-implementation` executed without BLOCKs
|
|
578
459
|
|
|
579
460
|
---
|
|
580
461
|
|
|
581
|
-
## Outputs
|
|
462
|
+
## Phase Outputs
|
|
582
463
|
|
|
583
464
|
<!-- morph:outputs:implement -->
|
|
584
|
-
| Output |
|
|
585
|
-
|
|
465
|
+
| Output | Path |
|
|
466
|
+
|--------|------|
|
|
586
467
|
| `recap` | `.morph/features/{feature}/5-implement/recap.md` |
|
|
587
468
|
<!-- /morph:outputs -->
|
|
588
469
|
|
|
589
470
|
---
|
|
590
471
|
|
|
591
|
-
Feature
|
|
472
|
+
Feature complete! Consider creating a PR and running `morph-spec generate recap $ARGUMENTS`.
|