@polymorphism-tech/morph-spec 4.10.10 → 4.11.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.
Files changed (62) hide show
  1. package/CLAUDE.md +106 -2
  2. package/README.md +5 -11
  3. package/bin/morph-spec.js +30 -2
  4. package/bin/task-manager.js +394 -38
  5. package/claude-plugin.json +1 -1
  6. package/docs/CHEATSHEET.md +1 -1
  7. package/docs/QUICKSTART.md +2 -8
  8. package/framework/agents/frontend/css-specialist.md +1 -1
  9. package/framework/agents/infrastructure/azure-deploy-specialist.md +4 -4
  10. package/framework/commands/morph-apply.md +39 -19
  11. package/framework/commands/morph-preflight.md +3 -3
  12. package/framework/commands/morph-proposal.md +59 -16
  13. package/framework/commands/morph-status.md +3 -3
  14. package/framework/commands/morph-troubleshoot.md +1 -1
  15. package/framework/hooks/claude-code/post-tool-use/dispatch.js +47 -2
  16. package/framework/hooks/claude-code/pre-tool-use/task-tracking-guard.js +2 -2
  17. package/framework/hooks/claude-code/session-start/inject-morph-context.js +5 -4
  18. package/framework/hooks/claude-code/teammate-idle/teammate-idle.js +3 -3
  19. package/framework/hooks/claude-code/user-prompt/enrich-prompt.js +2 -2
  20. package/framework/hooks/git/pre-commit/agents.sh +1 -1
  21. package/framework/hooks/shared/dispatch-helpers.js +14 -0
  22. package/framework/hooks/shared/state-reader.js +7 -3
  23. package/framework/rules/morph-task-tracking.md +49 -0
  24. package/framework/skills/level-0-meta/morph-brainstorming/SKILL.md +14 -18
  25. package/framework/skills/level-0-meta/morph-checklist/SKILL.md +3 -3
  26. package/framework/skills/level-0-meta/morph-frontend-review/SKILL.md +1 -1
  27. package/framework/skills/level-0-meta/morph-init/SKILL.md +11 -11
  28. package/framework/skills/level-0-meta/morph-post-implementation/SKILL.md +3 -3
  29. package/framework/skills/level-0-meta/morph-replicate/SKILL.md +1 -1
  30. package/framework/skills/level-0-meta/morph-simulation-checklist/SKILL.md +4 -4
  31. package/framework/skills/level-0-meta/morph-tool-usage-guide/references/tools-per-phase.md +25 -25
  32. package/framework/skills/level-0-meta/morph-verification-before-completion/SKILL.md +8 -8
  33. package/framework/skills/level-1-workflows/morph-phase-clarify/SKILL.md +16 -7
  34. package/framework/skills/level-1-workflows/morph-phase-codebase-analysis/SKILL.md +4 -4
  35. package/framework/skills/level-1-workflows/morph-phase-design/SKILL.md +29 -35
  36. package/framework/skills/level-1-workflows/morph-phase-design/references/architecture-analysis-guide.md +1 -1
  37. package/framework/skills/level-1-workflows/morph-phase-implement/SKILL.md +35 -29
  38. package/framework/skills/level-1-workflows/morph-phase-implement/prompts/implementer-prompt.md +4 -4
  39. package/framework/skills/level-1-workflows/morph-phase-plan/SKILL.md +17 -20
  40. package/framework/skills/level-1-workflows/morph-phase-setup/SKILL.md +23 -26
  41. package/framework/skills/level-1-workflows/morph-phase-tasks/SKILL.md +21 -29
  42. package/framework/skills/level-1-workflows/morph-phase-uiux/SKILL.md +24 -16
  43. package/framework/skills/level-1-workflows/morph-scope-escalation/SKILL.md +5 -5
  44. package/framework/workflows/README.md +18 -18
  45. package/framework/workflows/docs/enforcement-pipeline.md +1 -1
  46. package/framework/workflows/docs/full-morph.md +2 -2
  47. package/package.json +1 -1
  48. package/src/commands/agents/dispatch-agents.js +25 -1
  49. package/src/commands/project/doctor.js +3 -4
  50. package/src/commands/project/status.js +8 -1
  51. package/src/commands/scope/escalate.js +5 -3
  52. package/src/commands/tasks/task.js +54 -0
  53. package/src/commands/validation/validate-feature.js +32 -3
  54. package/src/lib/build/build-runner.js +99 -0
  55. package/src/lib/checkpoints/checkpoint-hooks.js +110 -0
  56. package/src/lib/generators/recap-generator.js +27 -4
  57. package/src/lib/stack/stack-profile.js +3 -0
  58. package/src/lib/tasks/task-parser.js +23 -9
  59. package/src/scripts/global-install.js +57 -3
  60. package/src/utils/file-copier.js +1 -0
  61. package/src/utils/version-checker.js +1 -7
  62. package/framework/hooks/claude-code/pre-tool-use/protect-readonly-files.js +0 -7
@@ -0,0 +1,49 @@
1
+ ---
2
+ stacks:
3
+ - "*"
4
+ ---
5
+
6
+ # MORPH-SPEC Task Tracking
7
+
8
+ > Session tasks are MANDATORY in every MORPH-SPEC phase. They track real progress and must be
9
+ > created BEFORE any phase work begins.
10
+
11
+ ## Rules
12
+
13
+ 1. **Every phase skill MUST create session tasks** using `TaskCreate` before reading files or generating outputs
14
+ 2. **Tasks are dynamic** — analyze the phase workflow and create tasks that reflect YOUR actual planned actions for this session
15
+ 3. **Every task MUST be updated**: `in_progress` before starting, `completed` after finishing
16
+ 4. **Pipeline orchestrators** (`/morph-proposal`, `/morph-apply`) MUST create master tasks for each phase
17
+ 5. **Never skip task creation** — even if resuming mid-phase, create tasks for remaining steps
18
+ 6. **Granularity**: minimum 2, typically 3-7 tasks per phase — adjust to complexity
19
+ 7. **For iterative work** (clarification rounds, quality loops): update task `subject` with round/score progress
20
+
21
+ ## Task Update Pattern
22
+
23
+ ```
24
+ TaskUpdate(taskId, status="in_progress") // before starting the step
25
+ // ... do the work ...
26
+ TaskUpdate(taskId, status="completed") // after step finishes
27
+ ```
28
+
29
+ For iterative tasks:
30
+ ```
31
+ TaskUpdate(taskId, subject="Round 3 — score 82/100")
32
+ ```
33
+
34
+ ## Deviation Tracking
35
+
36
+ When completing a task differently than originally planned, record the reason:
37
+
38
+ ```
39
+ morph-spec task done <feature> <taskId> --note "Reason for deviation"
40
+ ```
41
+
42
+ For after-the-fact annotation (supports multiple types):
43
+ ```
44
+ morph-spec task annotate <feature> <taskId> "Reason" --type deviation
45
+ morph-spec task annotate <feature> <taskId> "Context info" --type context
46
+ morph-spec task annotate <feature> <taskId> "Resolved" --type blocker-resolved
47
+ ```
48
+
49
+ Note types: `deviation` (default), `context`, `blocker-resolved`
@@ -22,38 +22,34 @@ allowed-tools: Read, Bash, Glob, Grep, AskUserQuestion
22
22
 
23
23
  | Action | Tool | Alternative |
24
24
  |--------|------|-------------|
25
- | Load feature state | **Bash** `npx morph-spec state get $ARGUMENTS` | — |
25
+ | Load feature state | **Bash** `morph-spec state get $ARGUMENTS` | — |
26
26
  | Read project config | **Read** `.morph/config/config.json` | — |
27
27
  | Scan existing code | **Glob** / **Grep** | — |
28
28
  | Research libraries | **Context7 MCP** `query_docs()` | **WebSearch** |
29
29
  | Ask clarifying questions | **AskUserQuestion** (never plain text) | — |
30
- | Render proposal template | **Bash** `npx morph-spec template render docs/proposal ...` | — |
30
+ | Render proposal template | **Bash** `morph-spec template render docs/proposal ...` | — |
31
31
 
32
32
  ---
33
33
 
34
34
  ## Workflow
35
35
 
36
- ### Step 0: Create session tasks
36
+ ## MANDATORY: Session Tasks
37
37
 
38
- ```
39
- TaskCreate: "Explore project context" → activeForm: "Exploring context"
40
- TaskCreate: "Ask clarifying questions" → activeForm: "Asking questions"
41
- TaskCreate: "Propose 2-3 approaches" → activeForm: "Analyzing approaches"
42
- TaskCreate: "Present design" → activeForm: "Presenting design"
43
- TaskCreate: "Document recommendation" → activeForm: "Documenting"
44
- ```
45
-
46
- Update each to `in_progress` before its step and `completed` after.
38
+ > **BEFORE starting any brainstorming work**, analyze what you need to do and create session tasks.
39
+ >
40
+ > **Rules:** Minimum 2 tasks, typically 3-5. Mark `in_progress` before starting, `completed` after.
41
+ >
42
+ > **Typical tasks:** context exploration, clarifying questions, approach analysis, recommendation, documentation
47
43
 
48
44
  ### Step 1: Explore Context
49
45
 
50
46
  Gather information before generating ideas. This step is what makes morph-aware brainstorming different from generic brainstorming — it grounds your thinking in the actual project state and constraints.
51
47
 
52
- 1. **Read state** — `npx morph-spec state get $ARGUMENTS` → current phase, active agents, existing outputs, task history
48
+ 1. **Read state** — `morph-spec state get $ARGUMENTS` → current phase, active agents, existing outputs, task history
53
49
  2. **Read config** — `.morph/config/config.json` → stack, architecture style (VSA vs standard), project name, integrations
54
50
  3. **Check architecture** — `cat .morph/config/config.json | grep -A3 architecture` → determines which agents and patterns apply
55
51
  4. **Read existing outputs** — proposal.md, spec.md, decisions.md (if they exist from prior work)
56
- 5. **Check active agents** — `npx morph-spec dispatch-agents $ARGUMENTS design --table` → which specialists are available
52
+ 5. **Check active agents** — `morph-spec dispatch-agents $ARGUMENTS design --table` → which specialists are available
57
53
  6. **Scan codebase** — use Glob/Grep to understand existing patterns, domain models, and service boundaries relevant to the feature
58
54
  7. **Check MCP tools** — if Context7, GitHub, or other MCPs are available, use them for research
59
55
 
@@ -106,7 +102,7 @@ For each approach, document:
106
102
 
107
103
  **Phase 0 (Proposal):**
108
104
  ```bash
109
- npx morph-spec template render docs/proposal ".morph/features/$ARGUMENTS/0-proposal/proposal.md" '{"FEATURE_NAME":"...", "DATE":"..."}'
105
+ morph-spec template render docs/proposal ".morph/features/$ARGUMENTS/0-proposal/proposal.md" '{"FEATURE_NAME":"...", "DATE":"..."}'
110
106
  ```
111
107
  Then edit the rendered file to add the brainstorming results.
112
108
 
@@ -115,12 +111,12 @@ For each approach, document:
115
111
 
116
112
  3. **Update state** (mandatory — do not skip):
117
113
  ```bash
118
- npx morph-spec state mark-output $ARGUMENTS proposal # Phase 0
119
- npx morph-spec state mark-output $ARGUMENTS decisions # Phase 2
114
+ morph-spec state mark-output $ARGUMENTS proposal # Phase 0
115
+ morph-spec state mark-output $ARGUMENTS decisions # Phase 2
120
116
  ```
121
117
  Then verify the output was recorded:
122
118
  ```bash
123
- npx morph-spec state get $ARGUMENTS
119
+ morph-spec state get $ARGUMENTS
124
120
  ```
125
121
 
126
122
  ---
@@ -14,9 +14,9 @@ Types: `deploy`, `security`, `seo`, `performance`, `accessibility`, `legal-brazi
14
14
  ## Deploy
15
15
 
16
16
  ### MORPH-SPEC Validation (run first)
17
- - [ ] `npx morph-spec validate-feature {feature}` — passes with 100% pass rate
18
- - [ ] `npx morph-spec approval-status {feature}` — all gates approved (design, plan, tasks)
19
- - [ ] `npx morph-spec state get {feature}` — phase is `implement`, all tasks `done`
17
+ - [ ] `morph-spec validate-feature {feature}` — passes with 100% pass rate
18
+ - [ ] `morph-spec approval-status {feature}` — all gates approved (design, plan, tasks)
19
+ - [ ] `morph-spec state get {feature}` — phase is `implement`, all tasks `done`
20
20
  - [ ] Recap generated: `.morph/features/{feature}/5-implement/recap.md` exists
21
21
 
22
22
  ### Pre-Deploy
@@ -57,7 +57,7 @@ Store `stack`, `frontendPath`, `startCommand` and the detected context — all s
57
57
  ## Step 1 — Design Outputs Validation (if context includes design validation)
58
58
 
59
59
  ```bash
60
- npx morph-spec validate-feature $ARGUMENTS
60
+ morph-spec validate-feature $ARGUMENTS
61
61
  ```
62
62
 
63
63
  Verify existence and quality of the 4 mandatory outputs in `.morph/features/$ARGUMENTS/2-ui/`:
@@ -25,10 +25,10 @@ Before running any `morph-spec` command, detect how to invoke the CLI:
25
25
 
26
26
  ```bash
27
27
  # Try local first (project dependency), then global
28
- npx morph-spec --version
28
+ morph-spec --version
29
29
  ```
30
30
 
31
- - If `npx morph-spec --version` succeeds → use `npx morph-spec` as the CLI prefix for all commands.
31
+ - If `morph-spec --version` succeeds → use `morph-spec` as the CLI prefix for all commands.
32
32
  - If it fails → try `morph-spec --version` (global install). If that works → use `morph-spec`.
33
33
  - If both fail → **STOP** and show:
34
34
  ```
@@ -36,7 +36,7 @@ npx morph-spec --version
36
36
  npm install @polymorphism-tech/morph-spec
37
37
  ```
38
38
 
39
- Use the resolved CLI prefix (e.g. `npx morph-spec`) for ALL bash commands in the following steps.
39
+ Use the resolved CLI prefix (e.g. `morph-spec`) for ALL bash commands in the following steps.
40
40
 
41
41
  ---
42
42
 
@@ -78,19 +78,19 @@ Check if `.morph/` exists in the current directory.
78
78
 
79
79
  **If MISSING:**
80
80
  ```bash
81
- npx morph-spec setup-infra
81
+ morph-spec setup-infra
82
82
  ```
83
83
  Output confirms: `✓ MORPH-SPEC infrastructure installed.`
84
84
 
85
85
  **If EXISTS and argument is `refresh`:**
86
86
  Re-run setup-infra to update framework files, then continue with context/config refresh:
87
87
  ```bash
88
- npx morph-spec setup-infra
88
+ morph-spec setup-infra
89
89
  ```
90
90
 
91
91
  **If EXISTS and no argument:**
92
92
  Ask: *"MORPH already initialized. Refresh context and config? (y/n)"*
93
- If `y` → re-run `npx morph-spec setup-infra` then continue.
93
+ If `y` → re-run `morph-spec setup-infra` then continue.
94
94
  If `n` → STOP.
95
95
 
96
96
  ---
@@ -359,7 +359,7 @@ And inform the user:
359
359
  To create a new VSA project:
360
360
  dotnet new install https://github.com/polymorphism-tech/Morph_Template_VerticalSliceArchitecture
361
361
  dotnet new vsa -n MyProject
362
- cd MyProject && npx morph-spec init
362
+ cd MyProject && morph-spec init
363
363
  ```
364
364
 
365
365
  ---
@@ -374,7 +374,7 @@ For each detected integration with an available MCP:
374
374
  ```json
375
375
  "supabase": { "type": "http", "url": "https://mcp.supabase.com/mcp" }
376
376
  ```
377
- - NO → show snippet + `npx morph-spec mcp setup supabase`
377
+ - NO → show snippet + `morph-spec mcp setup supabase`
378
378
 
379
379
  **GitHub:**
380
380
  > *"Configure GitHub MCP? Requires Docker + a `GITHUB_PERSONAL_ACCESS_TOKEN`."*
@@ -386,7 +386,7 @@ For each detected integration with an available MCP:
386
386
  "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "<token>" }
387
387
  }
388
388
  ```
389
- - NO → show snippet + `npx morph-spec mcp setup github`
389
+ - NO → show snippet + `morph-spec mcp setup github`
390
390
 
391
391
  **Vercel detected** (vercel.json exists OR stack is nextjs):
392
392
  > *"Configure Vercel MCP? Uses OAuth — no credentials needed."*
@@ -394,7 +394,7 @@ For each detected integration with an available MCP:
394
394
  ```json
395
395
  "vercel": { "type": "http", "url": "https://mcp.vercel.com" }
396
396
  ```
397
- - NO → show snippet + `npx morph-spec mcp setup vercel`
397
+ - NO → show snippet + `morph-spec mcp setup vercel`
398
398
 
399
399
  Only offer Docker, Azure if explicitly detected in `.env.example`.
400
400
 
@@ -462,7 +462,7 @@ Use `AskUserQuestion` with header `"{MCP} failed"` and these options:
462
462
  After all configuration is complete, run the health check to verify everything is properly installed:
463
463
 
464
464
  ```bash
465
- npx morph-spec doctor
465
+ morph-spec doctor
466
466
  ```
467
467
 
468
468
  This validates: config.json integrity, agents.json presence, hooks installation, skills distribution, required command files, and state.json schema version. Fix any reported issues before proceeding.
@@ -95,7 +95,7 @@ Do not proceed while tests are failing. Fix failures and re-run before continuin
95
95
  ## Step 4 — Framework Validation
96
96
 
97
97
  ```bash
98
- npx morph-spec validate-feature $ARGUMENTS
98
+ morph-spec validate-feature $ARGUMENTS
99
99
  ```
100
100
 
101
101
  **🚫 BLOCK if it fails.**
@@ -251,10 +251,10 @@ Wait for both. **🚫 BLOCK if either returns unresolved CRITICAL.**
251
251
 
252
252
  ```bash
253
253
  # Save post-review checkpoint
254
- npx morph-spec checkpoint-save $ARGUMENTS --note "post-implementation review"
254
+ morph-spec checkpoint-save $ARGUMENTS --note "post-implementation review"
255
255
 
256
256
  # Generate final recap
257
- npx morph-spec generate recap $ARGUMENTS
257
+ morph-spec generate recap $ARGUMENTS
258
258
  ```
259
259
 
260
260
  ---
@@ -152,7 +152,7 @@ All outputs go in `.morph/features/{feature-name}/5-implement/`:
152
152
 
153
153
  After completion, mark the output:
154
154
  ```bash
155
- npx morph-spec state mark-output {feature-name} recap
155
+ morph-spec state mark-output {feature-name} recap
156
156
  ```
157
157
 
158
158
  **Does NOT generate:** proposal.md, spec.md, contracts.cs, tasks.md
@@ -60,13 +60,13 @@ When implementing simulation as a morph-spec task:
60
60
 
61
61
  ```bash
62
62
  # Track the simulation setup task
63
- npx morph-spec task start {feature} {task-id}
63
+ morph-spec task start {feature} {task-id}
64
64
 
65
65
  # After implementation, validate the feature
66
- npx morph-spec validate-feature {feature}
66
+ morph-spec validate-feature {feature}
67
67
 
68
68
  # Complete the task (triggers Tier-4 validators)
69
- npx morph-spec task done {feature} {task-id}
69
+ morph-spec task done {feature} {task-id}
70
70
  ```
71
71
 
72
72
  Reference the project's service lifetime patterns:
@@ -80,7 +80,7 @@ grep -r "AddSingleton\|AddScoped\|AddTransient" src/ --include="*.cs" -l
80
80
  - [ ] Validate DI: `dotnet build && dotnet run` + health check
81
81
  - [ ] Test full flow end-to-end (not just unit tests)
82
82
  - [ ] Verify simulation logs — confirm mocks are being called
83
- - [ ] Run `npx morph-spec validate-feature {feature}` to check architecture compliance
83
+ - [ ] Run `morph-spec validate-feature {feature}` to check architecture compliance
84
84
 
85
85
  ## Common Errors
86
86
 
@@ -14,10 +14,10 @@
14
14
  | Read project context | **Read** `.morph/context/README.md` | Single known file |
15
15
  | Read config | **Read** `.morph/config.json` | Single known file |
16
16
  | Find existing features | **Glob** `.morph/features/*/0-proposal/proposal.md` | Pattern search |
17
- | Detect project stack | **Read** `.morph/framework/agents.json` → match keywords → **Bash** `npx morph-spec state add-agent` | agents.json is the source of truth |
17
+ | Detect project stack | **Read** `.morph/framework/agents.json` → match keywords → **Bash** `morph-spec state add-agent` | agents.json is the source of truth |
18
18
  | Research external requirement | **WebSearch** | Current information needed |
19
- | Render proposal template | **Bash** `npx morph-spec template render docs/proposal ...` | CLI command |
20
- | Update state | **Bash** `npx morph-spec state mark-output {feature} proposal` | CLI command |
19
+ | Render proposal template | **Bash** `morph-spec template render docs/proposal ...` | CLI command |
20
+ | Update state | **Bash** `morph-spec state mark-output {feature} proposal` | CLI command |
21
21
 
22
22
  **MCPs used:** None typically. GitHub MCP if feature comes from an issue.
23
23
 
@@ -34,14 +34,14 @@
34
34
 
35
35
  | Action | Tool | Why |
36
36
  |--------|------|-----|
37
- | Verify feature state | **Bash** `npx morph-spec state get {feature}` | CLI command |
38
- | Detect agents + standards | **Read** `.morph/framework/agents.json` → match keywords → **Bash** `npx morph-spec state add-agent {f} {id}` per match | Keyword matching is fast inline |
37
+ | Verify feature state | **Bash** `morph-spec state get {feature}` | CLI command |
38
+ | Detect agents + standards | **Read** `.morph/framework/agents.json` → match keywords → **Bash** `morph-spec state add-agent {f} {id}` per match | Keyword matching is fast inline |
39
39
  | Read project context | **Read** `.morph/context/README.md` | Single file |
40
40
  | Read config | **Read** `.morph/config.json` | Single file |
41
41
  | Scan project structure | **Glob** `src/**/*.{ts,tsx,cs}` | Understand codebase layout |
42
42
  | Get repo metadata | **GitHub MCP** `get_repo()` | Structured repo info (if MCP available) |
43
- | Get dispatch config for next phases | **Bash** `npx morph-spec dispatch-agents {feature} design` | Shows which agents will be dispatched in design phase |
44
- | Update state | **Bash** `npx morph-spec state set ...` | CLI command |
43
+ | Get dispatch config for next phases | **Bash** `morph-spec dispatch-agents {feature} design` | Shows which agents will be dispatched in design phase |
44
+ | Update state | **Bash** `morph-spec state set ...` | CLI command |
45
45
 
46
46
  **MCPs used:** GitHub (optional — for repo metadata).
47
47
 
@@ -67,9 +67,9 @@
67
67
  | Inspecionar estrutura da página | **Playwright MCP** `browser_snapshot()` | **WebFetch** + parse manual |
68
68
  | Testar layout responsivo | **Playwright MCP** `browser_resize()` + `browser_take_screenshot()` | Manual testing |
69
69
  | Search for design references | **WebSearch** + **WebFetch** | External inspiration |
70
- | Render UI templates | **Bash** `npx morph-spec template render docs/ui-mockups ...` | CLI command |
71
- | Generate design system from CSS | **Bash** `npx morph-spec generate design-system --scan` | CLI command |
72
- | Update state | **Bash** `npx morph-spec state mark-output {feature} uiDesignSystem && npx morph-spec state mark-output {feature} uiMockups && npx morph-spec state mark-output {feature} uiComponents && npx morph-spec state mark-output {feature} uiFlows` | CLI command |
70
+ | Render UI templates | **Bash** `morph-spec template render docs/ui-mockups ...` | CLI command |
71
+ | Generate design system from CSS | **Bash** `morph-spec generate design-system --scan` | CLI command |
72
+ | Update state | **Bash** `morph-spec state mark-output {feature} uiDesignSystem && morph-spec state mark-output {feature} uiMockups && morph-spec state mark-output {feature} uiComponents && morph-spec state mark-output {feature} uiFlows` | CLI command |
73
73
 
74
74
  **MCPs used:** Playwright (live preview, page inspection), Context7 (component docs).
75
75
 
@@ -87,7 +87,7 @@
87
87
  | Action | Tool | Why |
88
88
  |--------|------|-----|
89
89
  | Read proposal + UI specs | **Read** output files | Single known files |
90
- | **Get dispatch config** | **Bash** `npx morph-spec dispatch-agents {feature} design` | Which agents to spawn + their task prompts |
90
+ | **Get dispatch config** | **Bash** `morph-spec dispatch-agents {feature} design` | Which agents to spawn + their task prompts |
91
91
  | **Dispatch domain-architect** (parallel) | **Task** subagent with prompt from dispatch config | Analyze DDD complexity independently |
92
92
  | **Dispatch tech leads** (parallel) | **Task** subagents (dotnet-senior, nextjs-expert, etc.) | Validate architecture independently |
93
93
  | Get database schema | **Supabase MCP** `list_tables()`, `get_table_schema()` | **PREFERRED** — real schema data |
@@ -99,11 +99,11 @@
99
99
  | Look up library for ADR | **Context7 MCP** `query_docs()` | Compare library capabilities |
100
100
  | Check existing code patterns | **GitHub MCP** `search_code()` | Find patterns in large repos |
101
101
  | **Fallback:** Search codebase | **Grep** patterns across project | When no GitHub MCP |
102
- | Render contracts template (detected level) | **Bash** `npx morph-spec template render code/dotnet/contracts/contracts-level{N}.cs ...` where N = level detected | CLI command |
103
- | Render spec template | **Bash** `npx morph-spec template render docs/spec ...` | CLI command |
104
- | Render decisions template | **Bash** `npx morph-spec template render docs/decisions ...` | CLI command |
102
+ | Render contracts template (detected level) | **Bash** `morph-spec template render code/dotnet/contracts/contracts-level{N}.cs ...` where N = level detected | CLI command |
103
+ | Render spec template | **Bash** `morph-spec template render docs/spec ...` | CLI command |
104
+ | Render decisions template | **Bash** `morph-spec template render docs/decisions ...` | CLI command |
105
105
  | Create schema-analysis.md | **Write** to output directory | Document findings |
106
- | Update state | **Bash** `npx morph-spec state mark-output {feature} schemaAnalysis && npx morph-spec state mark-output {feature} spec && npx morph-spec state mark-output {feature} contracts && npx morph-spec state mark-output {feature} decisions` | CLI command |
106
+ | Update state | **Bash** `morph-spec state mark-output {feature} schemaAnalysis && morph-spec state mark-output {feature} spec && morph-spec state mark-output {feature} contracts && morph-spec state mark-output {feature} decisions` | CLI command |
107
107
 
108
108
  **MCPs used:** Supabase (schema analysis), Context7 (library research), GitHub (code search).
109
109
 
@@ -131,8 +131,8 @@
131
131
  | Check known issues/limitations | **GitHub MCP** `search_issues()` | Library bugs affecting design |
132
132
  | Research edge case behavior | **WebSearch** | External knowledge for edge cases |
133
133
  | Update spec with clarifications | **Edit** spec.md | Preserve existing content, add sections |
134
- | Create clarifications.md | **Bash** `npx morph-spec template render docs/clarifications ...` | Use template |
135
- | Update state | **Bash** `npx morph-spec state mark-output {feature} clarifications` | CLI command |
134
+ | Create clarifications.md | **Bash** `morph-spec template render docs/clarifications ...` | Use template |
135
+ | Update state | **Bash** `morph-spec state mark-output {feature} clarifications` | CLI command |
136
136
 
137
137
  **MCPs used:** Context7 (validate feasibility), GitHub (known issues).
138
138
 
@@ -150,16 +150,16 @@
150
150
  | Action | Tool | Why |
151
151
  |--------|------|-----|
152
152
  | Read spec + contracts + decisions | **Read** all output files | Full context needed |
153
- | **Get dispatch config** | **Bash** `npx morph-spec dispatch-agents {feature} tasks` | Which domain experts to consult |
153
+ | **Get dispatch config** | **Bash** `morph-spec dispatch-agents {feature} tasks` | Which domain experts to consult |
154
154
  | Analyze implementation complexity | **Grep** patterns in existing code | Estimate effort from codebase size |
155
155
  | Count existing similar patterns | **Glob** `**/Services/**/*.cs` | Understand scope |
156
156
  | **Dispatch domain experts** (when spec is complex) | **Task** subagents per domain | Parallel per-domain task planning |
157
157
  | Look up implementation patterns | **Context7 MCP** `query_docs()` | Estimate task complexity accurately |
158
158
  | Create GitHub issues from tasks | **GitHub MCP** `create_issue()` | Sync tasks to project management |
159
159
  | **Fallback:** Create issues via CLI | **Bash** `gh issue create ...` | When no GitHub MCP |
160
- | Render tasks template | **Bash** `npx morph-spec template render docs/tasks ...` | CLI command |
161
- | Mark tasks output | **Bash** `npx morph-spec state mark-output {feature} tasks` | CLI command |
162
- | Update state with task count | **Bash** `npx morph-spec state set ... tasks.total N` | CLI command |
160
+ | Render tasks template | **Bash** `morph-spec template render docs/tasks ...` | CLI command |
161
+ | Mark tasks output | **Bash** `morph-spec state mark-output {feature} tasks` | CLI command |
162
+ | Update state with task count | **Bash** `morph-spec state set ... tasks.total N` | CLI command |
163
163
 
164
164
  **MCPs used:** Context7 (complexity estimation), GitHub (issue creation).
165
165
 
@@ -178,7 +178,7 @@
178
178
  | Action | Tool | Why |
179
179
  |--------|------|-----|
180
180
  | Read task details | **Read** tasks.json, spec.md, contracts.cs | Implementation reference |
181
- | **Check parallelization viability** | **Bash** `npx morph-spec dispatch-agents {feature} implement` | Whether to dispatch parallel implementers |
181
+ | **Check parallelization viability** | **Bash** `morph-spec dispatch-agents {feature} implement` | Whether to dispatch parallel implementers |
182
182
  | **Dispatch per-domain implementers** (when viable) | **Task** subagents — one per domain group | Backend tasks + frontend tasks run in parallel |
183
183
  | Create new files | **Write** new source files | New entities, services, pages |
184
184
  | Modify existing files | **Edit** existing source files | Add features to existing code |
@@ -187,15 +187,15 @@
187
187
  | **Fallback:** Run migrations | **Bash** `npx supabase migration ...` or `dotnet ef ...` | CLI tools |
188
188
  | Build project | **Bash** `dotnet build` or `npm run build` | Verify compilation |
189
189
  | Run tests | **Bash** `dotnet test` or `npm test` | Verify implementation |
190
- | Checkpoint validation | **Bash** `npx morph-spec checkpoint ...` | Every 3 tasks |
190
+ | Checkpoint validation | **Bash** `morph-spec checkpoint ...` | Every 3 tasks |
191
191
  | Create RLS policies | **Supabase MCP** `query()` | Security policies |
192
192
  | Create infrastructure | **Bash** `az bicep ...` or Bicep files via Write | IaC |
193
193
  | Create PR | **GitHub MCP** `create_pull_request()` or **Bash** `gh pr create` | Ship code |
194
- | Mark task done | **Bash** `npx morph-spec task done T001` | State tracking |
194
+ | Mark task done | **Bash** `morph-spec task done T001` | State tracking |
195
195
  | Smoke test feature no browser | **Playwright MCP** `browser_navigate()` + `browser_snapshot()` | Manual testing |
196
196
  | Verificar erros de console | **Playwright MCP** `browser_console_messages()` | Browser DevTools |
197
197
  | Screenshot para recap.md | **Playwright MCP** `browser_take_screenshot()` | Manual screenshot |
198
- | Mark recap output | **Bash** `npx morph-spec state mark-output {feature} recap` | CLI command |
198
+ | Mark recap output | **Bash** `morph-spec state mark-output {feature} recap` | CLI command |
199
199
 
200
200
  **MCPs used:** Supabase (migrations, RLS), Context7 (API lookup), GitHub (PRs), Playwright (smoke test, verification).
201
201
 
@@ -86,16 +86,16 @@ allowed-tools: Read, Bash, Glob, Grep
86
86
 
87
87
  ```bash
88
88
  # Run full feature validation
89
- npx morph-spec validate-feature {feature-name}
89
+ morph-spec validate-feature {feature-name}
90
90
 
91
91
  # Check feature state and phase
92
- npx morph-spec state get {feature-name}
92
+ morph-spec state get {feature-name}
93
93
 
94
94
  # Check approval gates
95
- npx morph-spec approval-status {feature-name}
95
+ morph-spec approval-status {feature-name}
96
96
 
97
97
  # Check overall project status
98
- npx morph-spec status
98
+ morph-spec status
99
99
  ```
100
100
 
101
101
  ---
@@ -111,8 +111,8 @@ Before running `morph-spec task done`:
111
111
 
112
112
  ```bash
113
113
  # Verify before marking done
114
- npx morph-spec validate-feature {feature}
115
- npx morph-spec task done {feature} T001
114
+ morph-spec validate-feature {feature}
115
+ morph-spec task done {feature} T001
116
116
  ```
117
117
 
118
118
  ---
@@ -122,8 +122,8 @@ npx morph-spec task done {feature} T001
122
122
  Every 3 tasks, run full checkpoint validation:
123
123
 
124
124
  ```bash
125
- npx morph-spec checkpoint-save {feature}
126
- npx morph-spec validate-feature {feature}
125
+ morph-spec checkpoint-save {feature}
126
+ morph-spec validate-feature {feature}
127
127
  ```
128
128
 
129
129
  If validation fails:
@@ -4,7 +4,7 @@ description: MORPH-SPEC Phase 3 (Clarify). Iterative clarification loop driven b
4
4
  argument-hint: "[feature-name]"
5
5
  user-invocable: false
6
6
  allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
7
- cliVersion: "4.10.10"
7
+ cliVersion: "4.11.1"
8
8
  ---
9
9
 
10
10
  # MORPH Clarify — Phase 3
@@ -32,7 +32,7 @@ Eliminate spec ambiguities through an iterative question loop until the spec has
32
32
  | Ask clarifying questions | **AskUserQuestion** (never plain text) | — |
33
33
  | Update spec with clarifications | **Edit** spec.md | — |
34
34
  | Create clarifications.md | **Write** | — |
35
- | Update state | **Bash** `npx morph-spec state mark-output $ARGUMENTS clarifications` | — |
35
+ | Update state | **Bash** `morph-spec state mark-output $ARGUMENTS clarifications` | — |
36
36
 
37
37
  ---
38
38
 
@@ -67,7 +67,7 @@ Before each round, calculate the **Satisfaction Score (0-100)** by evaluating th
67
67
  **Step 0 (BEFORE any writing) — Ensure clarify phase:**
68
68
 
69
69
  ```bash
70
- npx morph-spec state get $ARGUMENTS
70
+ morph-spec state get $ARGUMENTS
71
71
  ```
72
72
 
73
73
  Check the `"phase"` field in the output:
@@ -75,8 +75,8 @@ Check the `"phase"` field in the output:
75
75
  **If `"phase": "clarify"`** → correct phase, proceed.
76
76
 
77
77
  **If `"phase": "design"`** → run in sequence:
78
- 1. `npx morph-spec approve $ARGUMENTS design`
79
- 2. `npx morph-spec phase advance $ARGUMENTS` (→ clarify)
78
+ 1. `morph-spec approve $ARGUMENTS design`
79
+ 2. `morph-spec phase advance $ARGUMENTS` (→ clarify)
80
80
 
81
81
  **Any other value** → STOP — inconsistent state, report to user.
82
82
 
@@ -94,6 +94,15 @@ Read: .morph/features/$ARGUMENTS/1-design/spec.md
94
94
 
95
95
  Calculate the initial score. Track accumulated answers from prior rounds to avoid repeating already-answered questions.
96
96
 
97
+ ## MANDATORY: Session Tasks
98
+
99
+ > **BEFORE starting clarification work**, analyze the spec quality and create session tasks.
100
+ >
101
+ > **Rules:** Minimum 2 tasks, typically 2-4. Mark `in_progress` before starting, `completed` after.
102
+ > For the clarification loop, update the task `subject` with round and score progress.
103
+ >
104
+ > **Typical tasks:** initial score calculation, clarification rounds (iterative), output generation
105
+
97
106
  ---
98
107
 
99
108
  ### Main Loop
@@ -217,7 +226,7 @@ Write to `.morph/features/$ARGUMENTS/1-design/clarifications.md`:
217
226
  **Step 2: Update State**
218
227
 
219
228
  ```bash
220
- npx morph-spec state mark-output $ARGUMENTS clarifications
229
+ morph-spec state mark-output $ARGUMENTS clarifications
221
230
  ```
222
231
 
223
232
  ---
@@ -241,7 +250,7 @@ npx morph-spec state mark-output $ARGUMENTS clarifications
241
250
  ---
242
251
 
243
252
  ```bash
244
- npx morph-spec phase advance $ARGUMENTS
253
+ morph-spec phase advance $ARGUMENTS
245
254
  ```
246
255
 
247
256
  Continue automatically to Phase 4 (Plan) after clarifications.md is generated.
@@ -3,7 +3,7 @@ name: morph-phase-codebase-analysis
3
3
  description: MORPH-SPEC Design sub-phase that analyzes existing codebase and database schema, producing schema-analysis.md with real column names, types, relationships, and field mismatches. Use at the start of Design phase before generating contracts.cs to prevent incorrect field names or types.
4
4
  user-invocable: false
5
5
  allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
6
- cliVersion: "4.10.10"
6
+ cliVersion: "4.11.1"
7
7
  ---
8
8
 
9
9
  # MORPH Codebase Analysis - Design Sub-phase
@@ -154,7 +154,7 @@ This ensures `contracts.cs` can be generated mechanically, without manual interp
154
154
  The template is at `framework/templates/docs/schema-analysis.md`. Use it via:
155
155
 
156
156
  ```bash
157
- npx morph-spec template render docs/schema-analysis \
157
+ morph-spec template render docs/schema-analysis \
158
158
  .morph/features/{feature}/1-design/schema-analysis.md \
159
159
  '{
160
160
  "FEATURE_NAME": "{feature}",
@@ -213,7 +213,7 @@ Create a map of:
213
213
  Use the template at `framework/templates/docs/schema-analysis.md`:
214
214
 
215
215
  ```bash
216
- npx morph-spec template render docs/schema-analysis \
216
+ morph-spec template render docs/schema-analysis \
217
217
  .morph/features/{feature-name}/1-design/schema-analysis.md \
218
218
  '{ "FEATURE_NAME": "{feature-name}", "DATE": "..." }'
219
219
  ```
@@ -223,7 +223,7 @@ OR use **Write** tool to create directly with collected data.
223
223
  ### Step 5: Update State
224
224
 
225
225
  ```bash
226
- npx morph-spec state mark-output {feature-name} schema-analysis
226
+ morph-spec state mark-output {feature-name} schema-analysis
227
227
  ```
228
228
 
229
229
  ---