@polymorphism-tech/morph-spec 4.21.0 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +57 -71
- package/README.md +2 -2
- package/bin/morph-spec.js +224 -491
- package/claude-plugin.json +1 -1
- package/docs/CHEATSHEET.md +1 -1
- package/docs/QUICKSTART.md +1 -1
- package/framework/CLAUDE.md +55 -38
- package/framework/MORPH.md +244 -0
- package/framework/agents.json +127 -1183
- package/framework/commands/morph-apply.md +56 -240
- package/framework/commands/morph-archive.md +48 -85
- package/framework/commands/morph-preflight.md +7 -7
- package/framework/commands/morph-proposal.md +35 -191
- package/framework/commands/morph-status.md +19 -50
- package/framework/commands/morph-troubleshoot.md +2 -2
- package/framework/evals/rubrics/README.md +44 -0
- package/framework/evals/rubrics/architecture.md +46 -0
- package/framework/evals/rubrics/code-quality.md +50 -0
- package/framework/evals/rubrics/contracts.md +47 -0
- package/framework/evals/rubrics/test-coverage.md +50 -0
- package/framework/evals/scenarios/dotnet-crud.yaml +42 -0
- package/framework/evals/scenarios/nextjs-auth.yaml +38 -0
- package/framework/evals/suites/standard.yaml +5 -0
- package/framework/evals/trace-schema.md +67 -0
- package/framework/hooks/claude-code/core/README.md +3 -0
- package/framework/hooks/claude-code/core/denylist.json +14 -0
- package/framework/hooks/claude-code/{pre-tool-use → core}/enforce-phase-writes.js +5 -5
- package/framework/hooks/claude-code/core/post-edit-typecheck.js +69 -0
- package/framework/hooks/claude-code/core/pre-bash-denylist.js +29 -0
- package/framework/hooks/claude-code/{pre-tool-use → core}/protect-spec-files.js +4 -6
- package/framework/hooks/claude-code/{stop → core}/validate-completion.js +13 -82
- package/framework/hooks/shared/phase-utils.js +20 -28
- package/framework/hooks/shared/state-reader.js +4 -5
- package/framework/{skills/level-0-meta/mcp-registry.json → mcp/registry.json} +254 -210
- package/framework/phases.json +40 -114
- package/framework/rubrics/eval-rubric.json +66 -0
- package/framework/skills/README.md +39 -64
- package/framework/skills/core/README.md +3 -0
- package/framework/skills/core/morph-brainstorming/SKILL.md +102 -0
- package/framework/skills/core/morph-eval/SKILL.md +57 -0
- package/framework/skills/core/morph-implement/SKILL.md +83 -0
- package/framework/skills/core/morph-plan/SKILL.md +64 -0
- package/framework/skills/core/morph-review/SKILL.md +62 -0
- package/framework/skills/core/morph-stack-scan/SKILL.md +109 -0
- package/framework/skills/core/morph-standards/SKILL.md +49 -0
- package/framework/standards/STANDARDS.json +32 -0
- package/framework/standards/frontend/design-system/ai-image-generation.md +244 -0
- package/framework/standards/integration/mcp/mcp-tools.md +48 -0
- package/framework/templates/CLAUDE.md.core.guide.md +29 -0
- package/framework/templates/CLAUDE.md.core.template +22 -0
- package/framework/templates/REGISTRY.json +4 -4
- package/framework/workflows/configs/fast-track.json +5 -10
- package/framework/workflows/configs/full.json +4 -8
- package/framework/workflows/configs/quick.json +32 -0
- package/framework/workflows/configs/standard.json +57 -64
- package/package.json +7 -6
- package/src/commands/mcp/mcp-setup.js +58 -31
- package/src/commands/project/doctor.js +69 -70
- package/src/commands/project/init.js +26 -5
- package/src/commands/project/status.js +18 -19
- package/src/commands/state/approve.js +1 -1
- package/src/commands/validation/validate-feature.js +18 -112
- package/src/core/paths/output-schema.js +133 -151
- package/src/core/state/phase-state-machine.js +10 -24
- package/src/core/state/state-manager.js +17 -17
- package/src/core/workflows/workflow-detector.js +214 -31
- package/src/core/workflows/workflow-router.js +204 -0
- package/src/dashboard/app/pages/AgentMap.jsx +32 -33
- package/src/dashboard/app/pages/LiveState.jsx +1 -1
- package/src/dashboard/app/pages/PhasePipeline.jsx +2 -4
- package/src/dashboard/app/pages/SkillsLibrary.jsx +2 -3
- package/src/dashboard/app/pages/Workflows.jsx +2 -2
- package/src/dashboard/scanner/agents-scanner.js +30 -35
- package/src/lib/agents/metrics-aggregator.js +1 -1
- package/src/lib/agents/output-collector.js +7 -8
- package/src/lib/context/context-builder.js +289 -0
- package/src/lib/detectors/claude-config-detector.js +19 -3
- package/src/lib/generators/context-generator.js +20 -42
- package/src/lib/generators/index.js +1 -0
- package/src/lib/generators/mandate-generator.js +512 -0
- package/src/lib/generators/metadata-extractor.js +1 -1
- package/src/lib/generators/recap-generator.js +3 -4
- package/src/lib/installers/mcp-installer.js +300 -92
- package/src/lib/phase-chain/phase-validator.js +36 -40
- package/src/lib/stack/stack-profile.js +74 -91
- package/src/lib/tasks/task-parser.js +1 -1
- package/src/lib/tasks/wave-resolver.js +353 -0
- package/src/lib/validators/checkpoint-persistence.js +2 -2
- package/src/lib/validators/content/cross-phase-validator.js +281 -0
- package/src/lib/validators/content/index.js +1 -0
- package/src/lib/validators/shared/emit-validator-dispatch.js +6 -56
- package/src/scripts/global-install.js +2 -27
- package/src/utils/agents-installer.js +224 -447
- package/src/utils/claude-settings-manager.js +57 -15
- package/src/utils/file-copier.js +1 -0
- package/src/utils/hooks-installer.js +15 -117
- package/src/utils/skills-installer.js +12 -18
- package/bin/detect-agents.js +0 -226
- package/bin/task-manager.js +0 -1036
- package/framework/agents/README.md +0 -13
- package/framework/agents/ai-agents/ai-system-architect.md +0 -194
- package/framework/agents/ai-agents/vector-search-expert.md +0 -247
- package/framework/agents/architecture/architecture-expert.md +0 -98
- package/framework/agents/architecture/morph-spec-architect.md +0 -66
- package/framework/agents/architecture/packages-validator.md +0 -89
- package/framework/agents/architecture/security-expert.md +0 -79
- package/framework/agents/architecture/seo-growth-hacker.md +0 -168
- package/framework/agents/architecture/standards-architect.md +0 -153
- package/framework/agents/backend/dotnet-senior.md +0 -163
- package/framework/agents/backend/ef-modeler.md +0 -119
- package/framework/agents/backend/hangfire-orchestrator.md +0 -133
- package/framework/agents/backend/ms-agent-expert.md +0 -55
- package/framework/agents/backend/neon-expert.md +0 -379
- package/framework/agents/frontend/css-specialist.md +0 -89
- package/framework/agents/frontend/design-system-validator.md +0 -100
- package/framework/agents/frontend/gsap-animator.md +0 -131
- package/framework/agents/frontend/nextjs-component-validator.md +0 -97
- package/framework/agents/frontend/nextjs-expert.md +0 -201
- package/framework/agents/frontend/ui-designer.md +0 -259
- package/framework/agents/infrastructure/infra-architect.md +0 -215
- package/framework/agents/integrations/asaas-financial.md +0 -138
- package/framework/agents/integrations/neon-auth.md +0 -151
- package/framework/agents/integrations/resend-email.md +0 -127
- package/framework/hooks/claude-code/post-tool-use/agent-complete.js +0 -122
- package/framework/hooks/claude-code/post-tool-use/dispatch.js +0 -363
- package/framework/hooks/claude-code/post-tool-use/handle-tool-failure.js +0 -78
- package/framework/hooks/claude-code/post-tool-use/validator-feedback.js +0 -194
- package/framework/hooks/claude-code/pre-compact/save-morph-context.js +0 -199
- package/framework/hooks/claude-code/pre-tool-use/task-tracking-guard.js +0 -55
- package/framework/hooks/claude-code/session-start/inject-morph-context.js +0 -323
- package/framework/hooks/claude-code/session-start/post-compact-restore.js +0 -41
- package/framework/hooks/claude-code/session-start/resume-context.js +0 -77
- package/framework/hooks/claude-code/teammate-idle/teammate-idle.js +0 -90
- package/framework/hooks/claude-code/user-prompt/enrich-prompt.js +0 -114
- package/framework/hooks/shared/compact-restore.js +0 -123
- package/framework/hooks/shared/dispatch-helpers.js +0 -147
- package/framework/hooks/shared/skill-reminder-helpers.js +0 -79
- package/framework/hooks/shared/stale-task-reset.js +0 -57
- package/framework/hooks/shared/worktree-helpers.js +0 -75
- package/framework/skills/level-0-meta/README.md +0 -7
- package/framework/skills/level-0-meta/morph-agent-teams/SKILL.md +0 -472
- package/framework/skills/level-0-meta/morph-brainstorming/SKILL.md +0 -174
- package/framework/skills/level-0-meta/morph-brainstorming/references/proposal-example.md +0 -138
- package/framework/skills/level-0-meta/morph-checklist/SKILL.md +0 -145
- package/framework/skills/level-0-meta/morph-code-review/SKILL.md +0 -250
- package/framework/skills/level-0-meta/morph-code-review/references/review-example.md +0 -164
- package/framework/skills/level-0-meta/morph-code-review/references/review-guidelines.md +0 -100
- package/framework/skills/level-0-meta/morph-code-review/scripts/scan-csharp.mjs +0 -151
- package/framework/skills/level-0-meta/morph-code-review-nextjs/SKILL.md +0 -165
- package/framework/skills/level-0-meta/morph-code-review-nextjs/references/review-example-nextjs.md +0 -254
- package/framework/skills/level-0-meta/morph-code-review-nextjs/scripts/scan-nextjs.mjs +0 -189
- package/framework/skills/level-0-meta/morph-frontend-review/SKILL.md +0 -344
- package/framework/skills/level-0-meta/morph-frontend-review/scripts/scan-accessibility.mjs +0 -376
- package/framework/skills/level-0-meta/morph-init/SKILL.md +0 -537
- package/framework/skills/level-0-meta/morph-parallel-dispatch/SKILL.md +0 -225
- package/framework/skills/level-0-meta/morph-post-implementation/SKILL.md +0 -382
- package/framework/skills/level-0-meta/morph-post-implementation/scripts/detect-dev-server.mjs +0 -153
- package/framework/skills/level-0-meta/morph-post-implementation/scripts/detect-stack.mjs +0 -234
- package/framework/skills/level-0-meta/morph-simulation-checklist/SKILL.md +0 -106
- package/framework/skills/level-0-meta/morph-tool-usage-guide/SKILL.md +0 -243
- package/framework/skills/level-0-meta/morph-tool-usage-guide/references/tools-per-phase.md +0 -169
- package/framework/skills/level-0-meta/morph-verification-before-completion/SKILL.md +0 -148
- package/framework/skills/level-0-meta/morph-verification-before-completion/scripts/check-phase-outputs.mjs +0 -110
- package/framework/skills/level-1-workflows/README.md +0 -7
- package/framework/skills/level-1-workflows/morph-phase-codebase-analysis/SKILL.md +0 -269
- package/framework/skills/level-1-workflows/morph-phase-design/SKILL.md +0 -453
- package/framework/skills/level-1-workflows/morph-phase-design/references/architecture-analysis-guide.md +0 -44
- package/framework/skills/level-1-workflows/morph-phase-design/references/spec-authoring-guide.md +0 -55
- package/framework/skills/level-1-workflows/morph-phase-design/references/spec-example.md +0 -253
- package/framework/skills/level-1-workflows/morph-phase-implement/.morph/logs/activity.json +0 -38
- package/framework/skills/level-1-workflows/morph-phase-implement/SKILL.md +0 -493
- package/framework/skills/level-1-workflows/morph-phase-implement/prompts/code-quality-reviewer-prompt.md +0 -50
- package/framework/skills/level-1-workflows/morph-phase-implement/prompts/implementer-prompt.md +0 -46
- package/framework/skills/level-1-workflows/morph-phase-implement/prompts/spec-reviewer-prompt.md +0 -47
- package/framework/skills/level-1-workflows/morph-phase-implement/references/recap-example.md +0 -132
- package/framework/skills/level-1-workflows/morph-phase-implement/references/vsa-implementation-guide.md +0 -92
- package/framework/skills/level-1-workflows/morph-phase-plan/SKILL.md +0 -257
- package/framework/skills/level-1-workflows/morph-phase-tasks/.morph/logs/activity.json +0 -14
- package/framework/skills/level-1-workflows/morph-phase-tasks/SKILL.md +0 -291
- package/framework/skills/level-1-workflows/morph-phase-tasks/references/task-planning-patterns.md +0 -143
- package/framework/skills/level-1-workflows/morph-phase-tasks/references/tasks-example.md +0 -404
- package/framework/skills/level-1-workflows/morph-phase-tasks/scripts/validate-tasks.mjs +0 -112
- package/framework/skills/level-1-workflows/morph-phase-uiux/SKILL.md +0 -788
- package/framework/skills/level-1-workflows/morph-scope-escalation/SKILL.md +0 -147
- package/framework/squad-templates/backend-only.json +0 -47
- package/framework/squad-templates/frontend-only.json +0 -56
- package/framework/squad-templates/full-stack.json +0 -74
- package/src/commands/agents/agent-metrics.js +0 -174
- package/src/commands/agents/audit-dispatch.js +0 -82
- package/src/commands/agents/detect-agents.js +0 -275
- package/src/commands/agents/dispatch-agents.js +0 -461
- package/src/commands/agents/index.js +0 -13
- package/src/commands/agents/manage-agents.js +0 -352
- package/src/commands/agents/project-metrics.js +0 -74
- package/src/commands/phase/phase-reset.js +0 -74
- package/src/commands/scope/escalate.js +0 -217
- package/src/commands/state/advance-phase.js +0 -600
- package/src/commands/state/phase-runner.js +0 -215
- package/src/commands/state/state.js +0 -444
- package/src/commands/task/expand.js +0 -100
- package/src/commands/tasks/index.js +0 -4
- package/src/commands/tasks/task.js +0 -105
- package/src/commands/templates/index.js +0 -5
- package/src/commands/templates/template-render.js +0 -93
- package/src/commands/trust/trust.js +0 -118
- package/src/lib/agents/agents-manager.js +0 -349
- package/src/lib/build/build-runner.js +0 -99
- package/src/lib/checkpoints/checkpoint-hooks.js +0 -111
- package/src/lib/contracts/sprint-contract-generator.js +0 -137
- package/src/lib/scope/impact-analyzer.js +0 -106
- package/src/lib/trust/trust-manager.js +0 -157
- package/src/utils/tier-helpers.js +0 -24
- /package/framework/hooks/claude-code/{post-tool-use → core}/loop-detect.js +0 -0
|
@@ -1,240 +1,56 @@
|
|
|
1
|
-
---
|
|
2
|
-
description:
|
|
3
|
-
argument-hint: <feature-name>
|
|
4
|
-
allowed-tools: Read, Write, Edit, Bash, Glob, Grep, Agent, AskUserQuestion
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# /morph-apply —
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
##
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
Read all prerequisite files in a single parallel call — every file listed here matters for implementation quality:
|
|
58
|
-
|
|
59
|
-
```
|
|
60
|
-
Read: .morph/features/$ARGUMENTS/2-design/spec.md (→ functional requirements, API contracts)
|
|
61
|
-
+ Read: .morph/features/$ARGUMENTS/2-design/contracts.cs (or contracts.ts / contracts-vsa.cs → C# interfaces)
|
|
62
|
-
+ Read: .morph/features/$ARGUMENTS/2-design/decisions.md (→ ADRs, architectural choices)
|
|
63
|
-
+ Read: .morph/features/$ARGUMENTS/3-plan/plan.md (→ TDD structure, execution strategy)
|
|
64
|
-
+ Read: .morph/features/$ARGUMENTS/4-tasks/tasks.md (→ task breakdown with T### IDs)
|
|
65
|
-
+ Read: .morph/config/config.json (→ architecture.style for VSA routing)
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
**For VSA projects** (`architecture.style: "vertical-slice"`), also read:
|
|
69
|
-
```
|
|
70
|
-
Read: framework/standards/architecture/vertical-slice/vertical-slice.md
|
|
71
|
-
```
|
|
72
|
-
This contains the 9 VSA implementation rules (Handler+Validator+Endpoint per feature folder, no cross-feature imports, etc.).
|
|
73
|
-
|
|
74
|
-
Also read relevant standards:
|
|
75
|
-
- `framework/standards/` — coding standards for the detected stack
|
|
76
|
-
- `.morph/context/` — project-specific patterns and conventions
|
|
77
|
-
|
|
78
|
-
### 3. Detect architecture style
|
|
79
|
-
|
|
80
|
-
```bash
|
|
81
|
-
cat .morph/config/config.json | grep -A3 '"architecture"'
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
- **`"vertical-slice"`** → follow VSA implementation patterns from `framework/standards/architecture/vertical-slice/vertical-slice.md`. Each task is a complete slice (Handler + Validator + Endpoint in one folder).
|
|
85
|
-
|
|
86
|
-
### 4. Get agent dispatch config
|
|
87
|
-
|
|
88
|
-
```bash
|
|
89
|
-
morph-spec dispatch-agents $ARGUMENTS implement --table
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
This shows which agents are active for implementation and how tasks can be grouped. If agent teams are enabled and tasks have no dependencies between groups, consider dispatching parallel agents:
|
|
93
|
-
|
|
94
|
-
```bash
|
|
95
|
-
morph-spec dispatch-agents $ARGUMENTS implement
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
The JSON output includes `shouldDispatch`, `recommended` (agents by group), and `tasks` (task IDs by group) for multi-agent coordination.
|
|
99
|
-
|
|
100
|
-
---
|
|
101
|
-
|
|
102
|
-
## Workflow
|
|
103
|
-
|
|
104
|
-
### Step 1: Advance to implement phase
|
|
105
|
-
|
|
106
|
-
```bash
|
|
107
|
-
morph-spec phase advance $ARGUMENTS
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
This validates phase eligibility and emits a SKILL DISPATCH block listing required skills for implementation (verification-before-completion, morph-checklist, etc.).
|
|
111
|
-
|
|
112
|
-
### Step 1.5: Create pipeline visibility task
|
|
113
|
-
|
|
114
|
-
> **MANDATORY** — Create umbrella task for implementation tracking.
|
|
115
|
-
|
|
116
|
-
```
|
|
117
|
-
TaskCreate: "Implement: {feature-name}"
|
|
118
|
-
→ description: "Execute T001-T00N from tasks.md with checkpoints"
|
|
119
|
-
→ activeForm: "Implementing feature"
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
Mark as `in_progress`. After all tasks complete (Step 5), mark as `completed`.
|
|
123
|
-
|
|
124
|
-
### Step 2: Initialize state tracking
|
|
125
|
-
|
|
126
|
-
```bash
|
|
127
|
-
morph-spec state set $ARGUMENTS tasks.total {N}
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
Where `{N}` is the number of tasks in tasks.md (e.g., 6 for T001-T006).
|
|
131
|
-
|
|
132
|
-
### Step 3: Execute tasks in order
|
|
133
|
-
|
|
134
|
-
For each task in the breakdown, follow this cycle:
|
|
135
|
-
|
|
136
|
-
```bash
|
|
137
|
-
# 1. Start the task (activates task-tracking guard)
|
|
138
|
-
morph-spec task start $ARGUMENTS {task-id}
|
|
139
|
-
|
|
140
|
-
# 2. Implement the task
|
|
141
|
-
# - Follow spec.md and contracts
|
|
142
|
-
# - Follow coding standards from framework/standards/ and .morph/context/
|
|
143
|
-
# - For VSA: create all slice files in one folder (Handler + Validator + Endpoint)
|
|
144
|
-
|
|
145
|
-
# 3. Verify before completing — run validate-feature or check your work
|
|
146
|
-
# matches the spec and contracts before marking done
|
|
147
|
-
|
|
148
|
-
# 4. Complete the task (triggers Tier-4 validators automatically)
|
|
149
|
-
morph-spec task done $ARGUMENTS {task-id}
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
**If validation fails on `task done`:**
|
|
153
|
-
- Read the error messages carefully
|
|
154
|
-
- Fix the violations in your code
|
|
155
|
-
- Re-run `task done` — do NOT use `--skip-validation` unless the user explicitly authorizes it
|
|
156
|
-
- After 3 consecutive failures, escalate to the user
|
|
157
|
-
|
|
158
|
-
**`--skip-validation` budget system:**
|
|
159
|
-
- Budget-limited: `min(5, ceil(totalTasks × 0.20))` — e.g., 5 tasks → 1 skip, 32 tasks → 5 skips
|
|
160
|
-
- Requires `--reason <text>` (minimum 5 characters) for audit trail
|
|
161
|
-
- Skipped tasks don't count as `passed` in validationHistory → degrades pass rate
|
|
162
|
-
- Usage: `morph-spec task done feat T001 --skip-validation --reason "CSS-only change, no logic"`
|
|
163
|
-
- When budget is exhausted, all remaining tasks must pass Tier-4 validation
|
|
164
|
-
|
|
165
|
-
**Parallel execution (agent teams):**
|
|
166
|
-
If `dispatch-agents` identified parallelizable task groups and agent teams are enabled, dispatch independent tasks to separate agents. Each agent still calls `task start` and `task done` for its assigned task.
|
|
167
|
-
|
|
168
|
-
### Step 4: Checkpoint every 3 tasks
|
|
169
|
-
|
|
170
|
-
After every 3 completed tasks, save a checkpoint:
|
|
171
|
-
|
|
172
|
-
```bash
|
|
173
|
-
morph-spec checkpoint-save $ARGUMENTS "after-T003"
|
|
174
|
-
morph-spec state get $ARGUMENTS
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
Checkpoints validate architecture compliance, check package versions, scan for security issues, and save a restorable snapshot. The cadence is every 3 tasks — for 6 tasks: checkpoint after T003 and T006. For 10 tasks: after T003, T006, T009, and at completion.
|
|
178
|
-
|
|
179
|
-
After each checkpoint, check progress:
|
|
180
|
-
|
|
181
|
-
```bash
|
|
182
|
-
morph-spec state list
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
### Step 5: Finalize implementation
|
|
186
|
-
|
|
187
|
-
After all tasks are complete:
|
|
188
|
-
|
|
189
|
-
```bash
|
|
190
|
-
# Final validation
|
|
191
|
-
morph-spec validate-feature $ARGUMENTS
|
|
192
|
-
|
|
193
|
-
# Generate recap (auto-marks 'recap' output in state)
|
|
194
|
-
morph-spec generate recap $ARGUMENTS
|
|
195
|
-
|
|
196
|
-
# Verify final state
|
|
197
|
-
morph-spec state get $ARGUMENTS
|
|
198
|
-
|
|
199
|
-
# Advance to next phase
|
|
200
|
-
morph-spec phase advance $ARGUMENTS
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
### Step 6: Post-implementation review
|
|
204
|
-
|
|
205
|
-
After implementation, present a summary to the user:
|
|
206
|
-
|
|
207
|
-
1. Total tasks completed (X/Y)
|
|
208
|
-
2. Files created/modified
|
|
209
|
-
3. Validation results
|
|
210
|
-
4. Any deviations from spec
|
|
211
|
-
|
|
212
|
-
For Azure projects, remind the user: "Run `/morph-preflight` before deploying to validate packages, migrations, Docker, and secrets."
|
|
213
|
-
|
|
214
|
-
---
|
|
215
|
-
|
|
216
|
-
## Task Output Format
|
|
217
|
-
|
|
218
|
-
After each task completion, show:
|
|
219
|
-
|
|
220
|
-
```
|
|
221
|
-
Task {task-id} complete (X/Y tasks done)
|
|
222
|
-
Files: [list of created/modified files]
|
|
223
|
-
Next: {next-task-id} — {next-task-title}
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
---
|
|
227
|
-
|
|
228
|
-
## Anti-patterns
|
|
229
|
-
|
|
230
|
-
- Using `state set phase` instead of `phase advance` — phase advance validates eligibility first
|
|
231
|
-
- Skipping `task start` before implementing — the task-tracking guard will warn
|
|
232
|
-
- Using `--skip-validation` without user authorization or without `--reason`
|
|
233
|
-
- Exhausting `--skip-validation` budget on trivial tasks — reserve for genuine emergencies
|
|
234
|
-
- Implementing without reading spec.md and contracts first
|
|
235
|
-
- Writing code before `phase advance` to implement — the hook will block writes
|
|
236
|
-
- Skipping checkpoints — they catch integration issues early
|
|
237
|
-
|
|
238
|
-
---
|
|
239
|
-
|
|
240
|
-
**Feature:** $ARGUMENTS
|
|
1
|
+
---
|
|
2
|
+
description: Implementa a feature aprovada no Gate 2. Loop autônomo de tarefas via morph-implement com auto-advance entre tarefas, depois morph-review apresenta o Gate 3.
|
|
3
|
+
argument-hint: <feature-name>
|
|
4
|
+
allowed-tools: Read, Write, Edit, Bash, Glob, Grep, Agent, AskUserQuestion, Skill
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# /morph-apply — NLH Implementation
|
|
8
|
+
|
|
9
|
+
Executa as tarefas do `tasks.md` em sequência sem pausa, depois apresenta o Gate 3.
|
|
10
|
+
|
|
11
|
+
## Argumentos
|
|
12
|
+
|
|
13
|
+
`{feature-name}` — nome da feature já planejada (Gate 2 aprovado).
|
|
14
|
+
|
|
15
|
+
## Pré-requisitos
|
|
16
|
+
|
|
17
|
+
Antes de começar, verifique:
|
|
18
|
+
- `.morph/features/{feature-name}/2-plan/spec.md` existe
|
|
19
|
+
- `.morph/features/{feature-name}/2-plan/mandate.md` existe
|
|
20
|
+
- `.morph/features/{feature-name}/2-plan/tasks.md` existe
|
|
21
|
+
- `.morph/features/{feature-name}/3-implement/recap.md` existe ou pode ser criado
|
|
22
|
+
|
|
23
|
+
Se algum estiver faltando, abortar e pedir ao usuário para rodar `/morph-proposal {feature-name}` primeiro.
|
|
24
|
+
|
|
25
|
+
## Fluxo
|
|
26
|
+
|
|
27
|
+
1. **Loop de tarefas** — para cada tarefa pendente em `tasks.md`:
|
|
28
|
+
- Invocar a skill `morph-implement` em `framework/skills/core/morph-implement/`.
|
|
29
|
+
- A skill executa a tarefa, registra em `recap.md`, atualiza o trace.
|
|
30
|
+
- **Auto-advance:** ao concluir uma tarefa, passar imediatamente para a próxima sem aguardar instrução do usuário.
|
|
31
|
+
- Pausar apenas se encontrar ambiguidade bloqueante não coberta pelo `mandate.md`.
|
|
32
|
+
|
|
33
|
+
2. **Após todas as tarefas concluídas, invocar `morph-review`** (skill em `framework/skills/core/morph-review/`):
|
|
34
|
+
- Lê `mandate.md` e `recap.md`.
|
|
35
|
+
- Aplica `morph-eval` para gerar scores por dimensão.
|
|
36
|
+
- Produz `review-report.md` em `.morph/features/{feature-name}/4-review/`.
|
|
37
|
+
- Apresenta o **Gate 3**.
|
|
38
|
+
|
|
39
|
+
3. **Aguardar aprovação do Gate 3.**
|
|
40
|
+
- Resposta válida: "aprovado", "merge".
|
|
41
|
+
- Se houver itens bloqueantes (score < 6): corrija antes de apresentar o gate.
|
|
42
|
+
|
|
43
|
+
## Anti-padrões
|
|
44
|
+
|
|
45
|
+
- Não pausar entre tarefas para confirmação — o tasks.md já foi aprovado no Gate 2.
|
|
46
|
+
- Não escrever código fora de `3-implement/` ou da source tree do projeto.
|
|
47
|
+
- Não modificar `spec.md` ou `mandate.md` durante a implementação — esses arquivos foram congelados pelo Gate 2.
|
|
48
|
+
|
|
49
|
+
## Referências
|
|
50
|
+
|
|
51
|
+
- `framework/MORPH.md` — charter completo
|
|
52
|
+
- `framework/skills/core/morph-implement/SKILL.md`
|
|
53
|
+
- `framework/skills/core/morph-eval/SKILL.md`
|
|
54
|
+
- `framework/skills/core/morph-review/SKILL.md`
|
|
55
|
+
|
|
56
|
+
**Feature:** $ARGUMENTS
|
|
@@ -1,85 +1,48 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Archive a completed feature
|
|
3
|
-
argument-hint: <feature-name>
|
|
4
|
-
allowed-tools: Read, Write, Edit, Bash
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Archive MORPH Feature
|
|
8
|
-
|
|
9
|
-
Archive a
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
- [ ]
|
|
16
|
-
- [ ] `
|
|
17
|
-
- [ ]
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
-
|
|
33
|
-
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
```
|
|
51
|
-
╔════════════════════════════════════════════╗
|
|
52
|
-
║ FEATURE ARCHIVED ║
|
|
53
|
-
╠════════════════════════════════════════════╣
|
|
54
|
-
║ Feature: {name} ║
|
|
55
|
-
║ Completed: {date} ║
|
|
56
|
-
╠════════════════════════════════════════════╣
|
|
57
|
-
║ METRICS ║
|
|
58
|
-
╠════════════════════════════════════════════╣
|
|
59
|
-
║ Tasks: {X}/{X} completed ║
|
|
60
|
-
║ Time: {X}h (estimated: {Y}h) ║
|
|
61
|
-
║ Cost Impact: +${X}/month ║
|
|
62
|
-
╠════════════════════════════════════════════╣
|
|
63
|
-
║ FILES ║
|
|
64
|
-
╠════════════════════════════════════════════╣
|
|
65
|
-
║ Created: {X} files ║
|
|
66
|
-
║ Modified: {Y} files ║
|
|
67
|
-
║ Tests: {Z} files ({W}% coverage) ║
|
|
68
|
-
╠════════════════════════════════════════════╣
|
|
69
|
-
║ ARCHIVED TO ║
|
|
70
|
-
╠════════════════════════════════════════════╣
|
|
71
|
-
║ .morph/archive/{feature}/ ║
|
|
72
|
-
╚════════════════════════════════════════════╝
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
## Extracted Specs
|
|
76
|
-
|
|
77
|
-
If specs were extracted:
|
|
78
|
-
```
|
|
79
|
-
Specs extracted to .morph/specs/:
|
|
80
|
-
- {domain}/spec.md - {description}
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
---
|
|
84
|
-
|
|
85
|
-
**Feature to archive:** $ARGUMENTS
|
|
1
|
+
---
|
|
2
|
+
description: Archive a completed MORPH-SPEC feature after Gate 3 approval
|
|
3
|
+
argument-hint: <feature-name>
|
|
4
|
+
allowed-tools: Read, Write, Edit, Bash
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Archive MORPH Feature
|
|
8
|
+
|
|
9
|
+
Archive a feature that has cleared Gate 3 (review). Use when the work is shipped and you want the
|
|
10
|
+
feature out of the active set in `.morph/features/`.
|
|
11
|
+
|
|
12
|
+
## Prerequisites
|
|
13
|
+
|
|
14
|
+
Before archiving, verify:
|
|
15
|
+
- [ ] Feature folder exists at `.morph/features/{feature}/`
|
|
16
|
+
- [ ] `4-review/review-report.md` exists and Gate 3 is approved in `state.json`
|
|
17
|
+
- [ ] `3-implement/recap.md` is filled in
|
|
18
|
+
- [ ] Code is merged or otherwise shipped
|
|
19
|
+
|
|
20
|
+
If any precondition fails, stop and report what is missing instead of archiving.
|
|
21
|
+
|
|
22
|
+
## Workflow
|
|
23
|
+
|
|
24
|
+
1. **Validate completion** by reading `state.json`:
|
|
25
|
+
- `features[name].phase === 'review'`
|
|
26
|
+
- `features[name].approvalGates.review.approved === true`
|
|
27
|
+
|
|
28
|
+
2. **Move the folder** from active to archive:
|
|
29
|
+
```
|
|
30
|
+
.morph/features/{feature}/ → .morph/archive/{feature}/
|
|
31
|
+
```
|
|
32
|
+
Use `Bash` (`mv` on POSIX, `Move-Item` on Windows). Preserve all phase subfolders
|
|
33
|
+
(`0-proposal/`, `1-ui/`, `2-plan/`, `3-implement/`, `4-review/`).
|
|
34
|
+
|
|
35
|
+
3. **Update state.json**:
|
|
36
|
+
- Set `features[name].status = 'completed'`
|
|
37
|
+
- Set `features[name].archivedAt = <ISO timestamp>`
|
|
38
|
+
|
|
39
|
+
4. **Confirm with the user** before any destructive step. Show the move plan first.
|
|
40
|
+
|
|
41
|
+
## Output
|
|
42
|
+
|
|
43
|
+
Present a short summary of what moved and the new path. Do not invent metrics that are not
|
|
44
|
+
recorded in state.json or recap.md.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
**Feature to archive:** $ARGUMENTS
|
|
@@ -26,18 +26,18 @@ These checks verify that the morph-spec workflow is complete for the feature bei
|
|
|
26
26
|
|
|
27
27
|
```bash
|
|
28
28
|
# Verify implementation is complete
|
|
29
|
-
morph-spec
|
|
29
|
+
morph-spec status {feature}
|
|
30
30
|
morph-spec approval-status {feature}
|
|
31
|
-
morph-spec validate
|
|
31
|
+
morph-spec validate {feature}
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
| Check | Command | Pass Criteria |
|
|
35
35
|
|-------|---------|---------------|
|
|
36
|
-
| Phase is implement or later | `
|
|
37
|
-
| All gates approved | `approval-status` |
|
|
38
|
-
| Feature validation passes | `validate
|
|
39
|
-
| All tasks complete | `
|
|
40
|
-
| Recap generated | Read `
|
|
36
|
+
| Phase is implement or later | `status` | phase derived as `implement` or `review` |
|
|
37
|
+
| All gates approved | `approval-status` | proposal, plan, review gates all approved |
|
|
38
|
+
| Feature validation passes | `validate` | 100% pass rate |
|
|
39
|
+
| All tasks complete | `status` → tasks | 0 tasks in `pending` or `in_progress` |
|
|
40
|
+
| Recap generated | Read `3-implement/recap.md` | File exists and is non-empty |
|
|
41
41
|
|
|
42
42
|
**If any MORPH check fails:** Show which check failed and recommend: `Run /morph-apply {feature} to complete implementation before deploying.`
|
|
43
43
|
|