@polymorphism-tech/morph-spec 4.8.19 → 4.10.0

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 (214) hide show
  1. package/CLAUDE.md +21 -0
  2. package/README.md +2 -2
  3. package/bin/morph-spec.js +44 -55
  4. package/bin/task-manager.js +133 -20
  5. package/bin/validate.js +67 -33
  6. package/claude-plugin.json +1 -1
  7. package/docs/CHEATSHEET.md +201 -203
  8. package/docs/QUICKSTART.md +2 -2
  9. package/framework/CLAUDE.md +99 -77
  10. package/framework/agents.json +734 -182
  11. package/framework/commands/commit.md +166 -0
  12. package/framework/commands/morph-apply.md +13 -2
  13. package/framework/commands/morph-archive.md +8 -2
  14. package/framework/commands/morph-infra.md +6 -0
  15. package/framework/commands/morph-preflight.md +6 -0
  16. package/framework/commands/morph-proposal.md +56 -7
  17. package/framework/commands/morph-status.md +6 -0
  18. package/framework/commands/morph-troubleshoot.md +6 -0
  19. package/framework/hooks/claude-code/notification/approval-reminder.js +3 -2
  20. package/framework/hooks/claude-code/post-tool-use/context-refresh.js +1 -1
  21. package/framework/hooks/claude-code/post-tool-use/dispatch.js +155 -32
  22. package/framework/hooks/claude-code/post-tool-use/skill-reminder.js +78 -0
  23. package/framework/hooks/claude-code/post-tool-use/validator-feedback.js +8 -17
  24. package/framework/hooks/claude-code/pre-compact/save-morph-context.js +16 -3
  25. package/framework/hooks/claude-code/pre-tool-use/enforce-phase-writes.js +4 -3
  26. package/framework/hooks/claude-code/pre-tool-use/protect-spec-files.js +4 -3
  27. package/framework/hooks/claude-code/pre-tool-use/task-tracking-guard.js +60 -0
  28. package/framework/hooks/claude-code/session-start/inject-morph-context.js +124 -2
  29. package/framework/hooks/claude-code/session-start/post-compact-restore.js +41 -0
  30. package/framework/hooks/claude-code/statusline.py +76 -30
  31. package/framework/hooks/claude-code/stop/validate-completion.js +2 -15
  32. package/framework/hooks/claude-code/user-prompt/enrich-prompt.js +23 -5
  33. package/framework/hooks/claude-code/user-prompt/set-terminal-title.js +14 -6
  34. package/framework/hooks/shared/activity-logger.js +0 -24
  35. package/framework/hooks/shared/compact-restore.js +100 -0
  36. package/framework/hooks/shared/dispatch-helpers.js +116 -0
  37. package/framework/hooks/shared/phase-utils.js +12 -5
  38. package/framework/hooks/shared/skill-reminder-helpers.js +79 -0
  39. package/framework/hooks/shared/stale-task-reset.js +57 -0
  40. package/framework/hooks/shared/state-reader.js +29 -5
  41. package/framework/hooks/shared/worktree-helpers.js +53 -0
  42. package/framework/phases.json +69 -14
  43. package/framework/rules/morph-workflow.md +88 -86
  44. package/framework/skills/level-0-meta/mcp-registry.json +86 -51
  45. package/framework/skills/level-0-meta/{brainstorming → morph-brainstorming}/SKILL.md +14 -17
  46. package/framework/skills/level-0-meta/morph-checklist/SKILL.md +2 -2
  47. package/framework/skills/level-0-meta/{code-review → morph-code-review}/SKILL.md +2 -2
  48. package/framework/skills/level-0-meta/{code-review-nextjs → morph-code-review-nextjs}/SKILL.md +163 -163
  49. package/framework/skills/level-0-meta/{frontend-review → morph-frontend-review}/SKILL.md +9 -9
  50. package/framework/skills/level-0-meta/morph-init/SKILL.md +77 -12
  51. package/framework/skills/level-0-meta/{post-implementation → morph-post-implementation}/SKILL.md +62 -15
  52. package/framework/skills/level-0-meta/morph-replicate/SKILL.md +5 -5
  53. package/framework/skills/level-0-meta/morph-replicate/references/blazor-html-mapping.md +1 -1
  54. package/framework/skills/level-0-meta/{simulation-checklist → morph-simulation-checklist}/SKILL.md +1 -1
  55. package/framework/skills/level-0-meta/{terminal-title → morph-terminal-title}/SKILL.md +2 -2
  56. package/framework/skills/level-0-meta/{tool-usage-guide → morph-tool-usage-guide}/SKILL.md +3 -4
  57. package/framework/skills/level-0-meta/{tool-usage-guide → morph-tool-usage-guide}/references/tools-per-phase.md +7 -7
  58. package/framework/skills/level-0-meta/{verification-before-completion → morph-verification-before-completion}/SKILL.md +2 -2
  59. package/framework/skills/level-0-meta/{verification-before-completion → morph-verification-before-completion}/scripts/check-phase-outputs.mjs +2 -2
  60. package/framework/skills/level-1-workflows/morph-phase-clarify/SKILL.md +238 -0
  61. package/framework/skills/level-1-workflows/{phase-codebase-analysis → morph-phase-codebase-analysis}/SKILL.md +3 -3
  62. package/framework/skills/level-1-workflows/morph-phase-design/SKILL.md +507 -0
  63. package/framework/skills/level-1-workflows/{phase-implement → morph-phase-implement}/SKILL.md +168 -27
  64. package/framework/skills/level-1-workflows/morph-phase-implement/prompts/code-quality-reviewer-prompt.md +50 -0
  65. package/framework/skills/level-1-workflows/morph-phase-implement/prompts/implementer-prompt.md +45 -0
  66. package/framework/skills/level-1-workflows/morph-phase-implement/prompts/spec-reviewer-prompt.md +47 -0
  67. package/framework/skills/level-1-workflows/morph-phase-plan/SKILL.md +254 -0
  68. package/framework/skills/level-1-workflows/{phase-setup → morph-phase-setup}/SKILL.md +50 -3
  69. package/framework/skills/level-1-workflows/{phase-tasks → morph-phase-tasks}/SKILL.md +48 -11
  70. package/framework/skills/level-1-workflows/{phase-tasks → morph-phase-tasks}/scripts/validate-tasks.mjs +3 -3
  71. package/framework/skills/level-1-workflows/{phase-uiux → morph-phase-uiux}/SKILL.md +46 -11
  72. package/framework/skills/level-1-workflows/morph-scope-escalation/SKILL.md +97 -0
  73. package/framework/standards/STANDARDS.json +640 -88
  74. package/framework/standards/infrastructure/vercel/vercel-database.md +106 -0
  75. package/framework/standards/integration/mcp/mcp-tools.md +25 -7
  76. package/framework/templates/REGISTRY.json +1825 -1909
  77. package/framework/templates/context/CONTEXT-FEATURE.md +276 -276
  78. package/framework/templates/docs/onboarding.md +3 -7
  79. package/package.json +2 -7
  80. package/src/commands/agents/dispatch-agents.js +104 -6
  81. package/src/commands/mcp/mcp-setup.js +39 -2
  82. package/src/commands/phase/phase-reset.js +74 -0
  83. package/src/commands/project/doctor.js +34 -51
  84. package/src/commands/project/init.js +1 -1
  85. package/src/commands/project/status.js +2 -2
  86. package/src/commands/project/update.js +381 -365
  87. package/src/commands/project/worktree.js +154 -0
  88. package/src/commands/scope/escalate.js +215 -0
  89. package/src/commands/state/advance-phase.js +132 -68
  90. package/src/commands/state/approve.js +2 -2
  91. package/src/commands/state/index.js +7 -8
  92. package/src/commands/state/phase-runner.js +1 -1
  93. package/src/commands/state/state.js +61 -6
  94. package/src/commands/task/expand.js +100 -0
  95. package/src/commands/tasks/task.js +78 -99
  96. package/src/commands/templates/template-render.js +93 -173
  97. package/src/commands/trust/trust.js +26 -21
  98. package/src/core/paths/output-schema.js +19 -3
  99. package/src/core/state/phase-state-machine.js +7 -4
  100. package/src/core/state/state-manager.js +32 -57
  101. package/src/core/workflows/workflow-detector.js +9 -87
  102. package/src/lib/detectors/claude-config-detector.js +93 -347
  103. package/src/lib/detectors/design-system-detector.js +189 -189
  104. package/src/lib/detectors/index.js +155 -57
  105. package/src/lib/generators/context-generator.js +2 -2
  106. package/src/lib/installers/mcp-installer.js +37 -5
  107. package/src/lib/phase-chain/phase-validator.js +336 -0
  108. package/src/lib/scope/impact-analyzer.js +106 -0
  109. package/src/lib/stack/stack-profile.js +88 -0
  110. package/src/lib/tasks/task-classifier.js +16 -0
  111. package/src/lib/tasks/task-parser.js +1 -1
  112. package/src/lib/tasks/test-runner.js +77 -0
  113. package/src/lib/trust/trust-manager.js +32 -144
  114. package/src/lib/validators/shared/emit-validator-dispatch.js +64 -0
  115. package/src/lib/validators/spec-validator.js +58 -4
  116. package/src/lib/validators/validation-runner.js +23 -11
  117. package/src/scripts/setup-infra.js +255 -224
  118. package/src/utils/agents-installer.js +34 -14
  119. package/src/utils/banner.js +1 -1
  120. package/src/utils/claude-settings-manager.js +1 -1
  121. package/src/utils/file-copier.js +1 -1
  122. package/src/utils/hooks-installer.js +272 -8
  123. package/framework/hooks/dev/check-sync-health.js +0 -117
  124. package/framework/hooks/dev/guard-version-numbers.js +0 -57
  125. package/framework/hooks/dev/sync-standards-registry.js +0 -60
  126. package/framework/hooks/dev/sync-template-registry.js +0 -60
  127. package/framework/hooks/dev/validate-skill-format.js +0 -70
  128. package/framework/hooks/dev/validate-standard-format.js +0 -73
  129. package/framework/skills/level-1-workflows/phase-clarify/SKILL.md +0 -190
  130. package/framework/skills/level-1-workflows/phase-design/SKILL.md +0 -366
  131. package/framework/templates/meta-prompts/hops/hop-retry.md +0 -78
  132. package/framework/templates/meta-prompts/hops/hop-validation.md +0 -97
  133. package/framework/templates/meta-prompts/hops/hop-wrapper.md +0 -36
  134. package/framework/workflows/configs/design-impl.json +0 -49
  135. package/framework/workflows/configs/express.json +0 -45
  136. package/framework/workflows/configs/fast-track.json +0 -42
  137. package/framework/workflows/configs/full-morph.json +0 -79
  138. package/framework/workflows/configs/fusion.json +0 -39
  139. package/framework/workflows/configs/long-running.json +0 -33
  140. package/framework/workflows/configs/spec-only.json +0 -43
  141. package/framework/workflows/configs/ui-refresh.json +0 -49
  142. package/framework/workflows/configs/zero-touch.json +0 -82
  143. package/src/commands/project/index.js +0 -8
  144. package/src/commands/project/monitor.js +0 -295
  145. package/src/commands/project/tutorial.js +0 -115
  146. package/src/commands/state/validate-phase.js +0 -238
  147. package/src/commands/templates/generate-contracts.js +0 -445
  148. package/src/core/index.js +0 -10
  149. package/src/core/orchestrator.js +0 -171
  150. package/src/core/registry/command-registry.js +0 -28
  151. package/src/core/registry/index.js +0 -8
  152. package/src/core/registry/validator-registry.js +0 -204
  153. package/src/core/state/index.js +0 -8
  154. package/src/core/templates/index.js +0 -9
  155. package/src/core/templates/template-data-sources.js +0 -325
  156. package/src/core/templates/template-validator.js +0 -296
  157. package/src/core/workflows/index.js +0 -7
  158. package/src/generator/config-generator.js +0 -206
  159. package/src/generator/templates/config.json.template +0 -40
  160. package/src/generator/templates/project.md.template +0 -67
  161. package/src/lib/agents/micro-agent-factory.js +0 -161
  162. package/src/lib/analysis/complexity-analyzer.js +0 -441
  163. package/src/lib/analysis/index.js +0 -7
  164. package/src/lib/analytics/analytics-engine.js +0 -345
  165. package/src/lib/checkpoints/checkpoint-hooks.js +0 -298
  166. package/src/lib/checkpoints/index.js +0 -7
  167. package/src/lib/context/context-bundler.js +0 -241
  168. package/src/lib/context/context-optimizer.js +0 -212
  169. package/src/lib/context/context-tracker.js +0 -273
  170. package/src/lib/context/core-four-tracker.js +0 -201
  171. package/src/lib/context/mcp-optimizer.js +0 -200
  172. package/src/lib/detectors/config-detector.js +0 -223
  173. package/src/lib/detectors/standards-generator.js +0 -335
  174. package/src/lib/detectors/structure-detector.js +0 -275
  175. package/src/lib/execution/fusion-executor.js +0 -304
  176. package/src/lib/execution/parallel-executor.js +0 -270
  177. package/src/lib/hooks/stop-hook-executor.js +0 -286
  178. package/src/lib/hops/hop-composer.js +0 -221
  179. package/src/lib/monitor/agent-resolver.js +0 -144
  180. package/src/lib/monitor/renderer.js +0 -230
  181. package/src/lib/orchestration/index.js +0 -7
  182. package/src/lib/orchestration/team-orchestrator.js +0 -404
  183. package/src/lib/phase-chain/eligibility-checker.js +0 -243
  184. package/src/lib/threads/thread-coordinator.js +0 -238
  185. package/src/lib/threads/thread-manager.js +0 -317
  186. package/src/lib/tracking/artifact-trail.js +0 -202
  187. package/src/sanitizer/context-sanitizer.js +0 -221
  188. package/src/sanitizer/patterns.js +0 -163
  189. package/src/scanner/project-scanner.js +0 -242
  190. package/src/ui/diff-display.js +0 -91
  191. package/src/ui/interactive-wizard.js +0 -96
  192. package/src/ui/user-review.js +0 -211
  193. package/src/ui/wizard-questions.js +0 -188
  194. package/src/utils/color-utils.js +0 -70
  195. package/src/utils/process-handler.js +0 -97
  196. package/src/writer/file-writer.js +0 -86
  197. /package/framework/skills/level-0-meta/{brainstorming → morph-brainstorming}/references/proposal-example.md +0 -0
  198. /package/framework/skills/level-0-meta/{code-review → morph-code-review}/references/review-example.md +0 -0
  199. /package/framework/skills/level-0-meta/{code-review → morph-code-review}/references/review-guidelines.md +0 -0
  200. /package/framework/skills/level-0-meta/{code-review → morph-code-review}/scripts/scan-csharp.mjs +0 -0
  201. /package/framework/skills/level-0-meta/{code-review-nextjs → morph-code-review-nextjs}/references/review-example-nextjs.md +0 -0
  202. /package/framework/skills/level-0-meta/{code-review-nextjs → morph-code-review-nextjs}/scripts/scan-nextjs.mjs +0 -0
  203. /package/framework/skills/level-0-meta/{frontend-review → morph-frontend-review}/scripts/scan-accessibility.mjs +0 -0
  204. /package/framework/skills/level-0-meta/{post-implementation → morph-post-implementation}/scripts/detect-dev-server.mjs +0 -0
  205. /package/framework/skills/level-0-meta/{post-implementation → morph-post-implementation}/scripts/detect-stack.mjs +0 -0
  206. /package/framework/skills/level-0-meta/{terminal-title → morph-terminal-title}/scripts/set_title.sh +0 -0
  207. /package/framework/skills/level-1-workflows/{phase-clarify → morph-phase-clarify}/references/clarifications-example.md +0 -0
  208. /package/framework/skills/level-1-workflows/{phase-design → morph-phase-design}/references/architecture-analysis-guide.md +0 -0
  209. /package/framework/skills/level-1-workflows/{phase-design → morph-phase-design}/references/spec-authoring-guide.md +0 -0
  210. /package/framework/skills/level-1-workflows/{phase-design → morph-phase-design}/references/spec-example.md +0 -0
  211. /package/framework/skills/level-1-workflows/{phase-implement → morph-phase-implement}/references/recap-example.md +0 -0
  212. /package/framework/skills/level-1-workflows/{phase-implement → morph-phase-implement}/references/vsa-implementation-guide.md +0 -0
  213. /package/framework/skills/level-1-workflows/{phase-tasks → morph-phase-tasks}/references/task-planning-patterns.md +0 -0
  214. /package/framework/skills/level-1-workflows/{phase-tasks → morph-phase-tasks}/references/tasks-example.md +0 -0
@@ -1,203 +1,201 @@
1
- # morph-spec Cheat Sheet
2
-
3
- ## Setup
4
-
5
- ```bash
6
- npm install -g @polymorphism-tech/morph-spec # install globally
7
- morph-spec init # initialize project
8
- morph-spec init --wizard # interactive wizard
9
- morph-spec init --force # overwrite existing
10
- morph-spec update # sync framework files
11
- morph-spec doctor # health check
12
- morph-spec --version
13
- ```
14
-
15
- ---
16
-
17
- ## Phase workflow
18
-
19
- ```
20
- proposal → setup → [uiux] → design → clarify → tasks → implement → [sync]
21
- ```
22
-
23
- Phases in brackets are optional.
24
-
25
- | Phase | Directory | Output files | Gate |
26
- |-------|-----------|--------------|------|
27
- | proposal | `0-proposal/` | `proposal.md` | ✅ Approval |
28
- | setup | *(no output)* | context loaded | — |
29
- | uiux *(optional)* | `2-ui/` | `design-system.md`, `mockups.md`, `components.md`, `flows.md` | ✅ Approval |
30
- | design | `1-design/` | `spec.md`, `contracts.cs`, `decisions.md` | ✅ Approval |
31
- | clarify | `1-design/` | spec updated | — |
32
- | tasks | `3-tasks/` | `tasks.md` | ✅ Approval |
33
- | implement | `4-implement/` | code + `recap.md` | — |
34
- | sync *(optional)* | `.morph/context/` | standards updated | — |
35
-
36
- ---
37
-
38
- ## Slash commands (Claude Code)
39
-
40
- | Command | Description |
41
- |---------|-------------|
42
- | `/morph-proposal {feature}` | Full spec pipeline — phases 0–4 with approval gates |
43
- | `/morph-apply {feature}` | Implement approved feature — phase 5 |
44
- | `/morph-status` | Project-wide feature status dashboard |
45
- | `/morph-preflight` | Pre-implementation validation (7 checks) |
46
-
47
- ---
48
-
49
- ## CLI — project management
50
-
51
- ```bash
52
- morph-spec init [--force] [--skip-mcp]
53
- morph-spec update [--templates] [--standards]
54
- morph-spec doctor
55
- ```
56
-
57
- ---
58
-
59
- ## CLI — feature workflow
60
-
61
- ```bash
62
- morph-spec state list # all features
63
- morph-spec state get {feature} [--json] # feature detail
64
- morph-spec state set {feature} {key} {value} # update property
65
- morph-spec phase advance {feature} # advance to next phase
66
- morph-spec status {feature} [--json] [--verbose]
67
- morph-spec task done {feature} # mark task complete
68
- morph-spec task start {feature} # start next task
69
- morph-spec task next {feature} # preview next task
70
- ```
71
-
72
- ---
73
-
74
- ## CLI — validation
75
-
76
- ```bash
77
- morph-spec validate # all validators
78
- morph-spec validate architecture
79
- morph-spec validate packages
80
- morph-spec validate contrast [--wcag-aaa]
81
- morph-spec validate-feature {feature} [--phase {phase}] [--json]
82
- ```
83
-
84
- ---
85
-
86
- ## CLI — utilities
87
-
88
- ```bash
89
- morph-spec generate recap {feature} # auto-generate recap.md
90
- morph-spec template render {id} {output} {vars-json}
91
- morph-spec trust status [feature]
92
- morph-spec trust set {feature} {level} [reason]
93
- morph-spec mcp setup [name] [--list] [--auto]
94
- ```
95
-
96
- ---
97
-
98
- ## State — mark-output
99
-
100
- ```bash
101
- morph-spec state mark-output {feature} proposal
102
- morph-spec state mark-output {feature} spec
103
- morph-spec state mark-output {feature} contracts
104
- morph-spec state mark-output {feature} decisions
105
- morph-spec state mark-output {feature} tasks
106
- morph-spec state mark-output {feature} recap
107
-
108
- # UI outputs (camelCase or kebab-case both work)
109
- morph-spec state mark-output {feature} uiDesignSystem
110
- morph-spec state mark-output {feature} uiMockups
111
- morph-spec state mark-output {feature} uiComponents
112
- morph-spec state mark-output {feature} uiFlows
113
- ```
114
-
115
- ---
116
-
117
- ## State — agents
118
-
119
- ```bash
120
- morph-spec state add-agent {feature} {agent-id}
121
- morph-spec state remove-agent {feature} {agent-id}
122
- ```
123
-
124
- ---
125
-
126
- ## Checkpoints
127
-
128
- ```bash
129
- morph-spec checkpoint-save {feature}
130
- morph-spec checkpoint-restore {feature}
131
- morph-spec checkpoint-list {feature}
132
- ```
133
-
134
- ---
135
-
136
- ## Approvals
137
-
138
- ```bash
139
- morph-spec approve {feature} {gate} # approve a gate
140
- morph-spec approval-status {feature} # show gate status
141
- ```
142
-
143
- ---
144
-
145
- ## Directory structure
146
-
147
- ```
148
- .morph/
149
- ├── config/
150
- └── config.json # project config (editable)
151
- ├── framework/ # READ-ONLY
152
- ├── agents.json # 38 agents, 4 tiers
153
- ├── standards/ # 82 standards across 11 categories
154
- └── templates/ # code and IaC templates
155
- ├── context/ # project context (editable)
156
- ├── README.md
157
- │ └── standards.md
158
- ├── features/
159
- └── {feature}/
160
- │ ├── 0-proposal/proposal.md
161
- │ ├── 1-design/spec.md, contracts.cs, decisions.md
162
- ├── 2-ui/design-system.md, mockups.md, components.md, flows.md
163
- ├── 3-tasks/tasks.md
164
- │ └── 4-implement/recap.md
165
- ├── checkpoints/
166
- ├── logs/
167
- └── state.json # READ-ONLY — CLI managed
168
-
169
- .claude/
170
- ├── commands/ # slash commands
171
- ├── skills/ # framework skills (SKILL.md per dir)
172
- ├── agents/ # native subagents (38)
173
- ├── morph-{id}.md # tier 1-2 agents
174
- └── morph-domain-{name}.md # tier 3 domain agents
175
- ├── rules/ # path-scoped rules (6 files)
176
- └── settings.local.json # hooks (11)
177
- ```
178
-
179
- ---
180
-
181
- ## Protected files
182
-
183
- These files are never edited directly. Use CLI commands or `morph-spec update` instead:
184
-
185
- | Path | Protected by |
186
- |------|-------------|
187
- | `.morph/state.json` | `permissions.deny` |
188
- | `.morph/framework/**` | `permissions.deny` |
189
- | Approved spec/contracts | `protect-spec-files.js` hook |
190
-
191
- ---
192
-
193
- ## Links
194
-
195
- - [QUICKSTART.md](QUICKSTART.md) — step-by-step guide
196
- - [ARCHITECTURE.md](ARCHITECTURE.md) — system design
197
- - [CHANGELOG.md](../CHANGELOG.md) — release history
198
- - [npm](https://www.npmjs.com/package/@polymorphism-tech/morph-spec)
199
- - support@polymorphism.com.br
200
-
201
- ---
202
-
203
- *morph-spec v4.8.19 by Polymorphism Tech*
1
+ # morph-spec Cheat Sheet
2
+
3
+ ## Setup
4
+
5
+ ```bash
6
+ npm install -g @polymorphism-tech/morph-spec # install globally
7
+ morph-spec init # initialize project
8
+ morph-spec init --wizard # interactive wizard
9
+ morph-spec init --force # overwrite existing
10
+ morph-spec update # sync framework files
11
+ morph-spec doctor # health check
12
+ morph-spec --version
13
+ ```
14
+
15
+ ---
16
+
17
+ ## Phase workflow
18
+
19
+ ```
20
+ proposal → setup → [uiux] → design → clarify → tasks → implement → [sync]
21
+ ```
22
+
23
+ Phases in brackets are optional.
24
+
25
+ | Phase | Directory | Output files | Gate |
26
+ |-------|-----------|--------------|------|
27
+ | proposal | `0-proposal/` | `proposal.md` | ✅ Approval |
28
+ | setup | *(no output)* | context loaded | — |
29
+ | uiux *(optional)* | `2-ui/` | `design-system.md`, `mockups.md`, `components.md`, `flows.md` | ✅ Approval |
30
+ | design | `1-design/` | `spec.md`, `contracts.cs`, `decisions.md` | ✅ Approval |
31
+ | clarify | `1-design/` | spec updated | — |
32
+ | tasks | `3-tasks/` | `tasks.md` | ✅ Approval |
33
+ | implement | `4-implement/` | code + `recap.md` | — |
34
+ | sync *(optional)* | `.morph/context/` | standards updated | — |
35
+
36
+ ---
37
+
38
+ ## Slash commands (Claude Code)
39
+
40
+ | Command | Description |
41
+ |---------|-------------|
42
+ | `/morph-proposal {feature}` | Full spec pipeline — phases 0–4 with approval gates |
43
+ | `/morph-apply {feature}` | Implement approved feature — phase 5 |
44
+ | `/morph-status` | Project-wide feature status dashboard |
45
+ | `/morph-preflight` | Pre-implementation validation (7 checks) |
46
+
47
+ ---
48
+
49
+ ## CLI — project management
50
+
51
+ ```bash
52
+ morph-spec init [--force] [--skip-mcp]
53
+ morph-spec update [--templates] [--standards]
54
+ morph-spec doctor
55
+ ```
56
+
57
+ ---
58
+
59
+ ## CLI — feature workflow
60
+
61
+ ```bash
62
+ morph-spec state list # all features
63
+ morph-spec state get {feature} [--json] # feature detail
64
+ morph-spec state set {feature} {key} {value} # update property
65
+ morph-spec phase advance {feature} # advance to next phase
66
+ morph-spec status {feature} [--json] [--verbose]
67
+ morph-spec task done {feature} {task-id} # mark task complete
68
+ morph-spec task start {feature} {task-id} # start a task
69
+ morph-spec task next {feature} # preview next task
70
+ ```
71
+
72
+ ---
73
+
74
+ ## CLI — validation
75
+
76
+ ```bash
77
+ morph-spec validate # all validators
78
+ morph-spec validate architecture
79
+ morph-spec validate packages
80
+ morph-spec validate contrast [--wcag-aaa]
81
+ morph-spec validate-feature {feature} [--phase {phase}] [--json]
82
+ ```
83
+
84
+ ---
85
+
86
+ ## CLI — utilities
87
+
88
+ ```bash
89
+ morph-spec generate recap {feature} # auto-generate recap.md
90
+ morph-spec template render {id} {output} {vars-json}
91
+ morph-spec trust status [feature]
92
+ morph-spec trust set {feature} {level} [reason] # level: manual|high|auto
93
+ morph-spec mcp setup [name] [--list] [--auto]
94
+ ```
95
+
96
+ ---
97
+
98
+ ## State — mark-output
99
+
100
+ ```bash
101
+ morph-spec state mark-output {feature} proposal
102
+ morph-spec state mark-output {feature} spec
103
+ morph-spec state mark-output {feature} contracts
104
+ morph-spec state mark-output {feature} decisions
105
+ morph-spec state mark-output {feature} tasks
106
+ morph-spec state mark-output {feature} recap
107
+
108
+ # UI outputs (camelCase or kebab-case both work)
109
+ morph-spec state mark-output {feature} uiDesignSystem
110
+ morph-spec state mark-output {feature} uiMockups
111
+ morph-spec state mark-output {feature} uiComponents
112
+ morph-spec state mark-output {feature} uiFlows
113
+ ```
114
+
115
+ ---
116
+
117
+ ## State — agents
118
+
119
+ ```bash
120
+ morph-spec state add-agent {feature} {agent-id}
121
+ morph-spec state remove-agent {feature} {agent-id}
122
+ ```
123
+
124
+ ---
125
+
126
+ ## Checkpoints
127
+
128
+ ```bash
129
+ morph-spec checkpoint-save {feature}
130
+ ```
131
+
132
+ ---
133
+
134
+ ## Approvals
135
+
136
+ ```bash
137
+ morph-spec approve {feature} {gate} # approve a gate
138
+ morph-spec approval-status {feature} # show gate status
139
+ ```
140
+
141
+ ---
142
+
143
+ ## Directory structure
144
+
145
+ ```
146
+ .morph/
147
+ ├── config/
148
+ │ └── config.json # project config (editable)
149
+ ├── framework/ # READ-ONLY
150
+ ├── agents.json # 42 agents, 4 tiers
151
+ ├── standards/ # 82 standards across 11 categories
152
+ └── templates/ # code and IaC templates
153
+ ├── context/ # project context (editable)
154
+ ├── README.md
155
+ │ └── standards.md
156
+ ├── features/
157
+ │ └── {feature}/
158
+ ├── 0-proposal/proposal.md
159
+ ├── 1-design/spec.md, contracts.cs, decisions.md
160
+ │ ├── 2-ui/design-system.md, mockups.md, components.md, flows.md
161
+ │ ├── 3-tasks/tasks.md
162
+ └── 4-implement/recap.md
163
+ ├── checkpoints/
164
+ ├── logs/
165
+ └── state.json # READ-ONLY — CLI managed
166
+
167
+ .claude/
168
+ ├── commands/ # slash commands
169
+ ├── skills/ # framework skills (SKILL.md per dir)
170
+ ├── agents/ # native subagents (38)
171
+ ├── morph-{id}.md # tier 1-2 agents
172
+ │ └── morph-domain-{name}.md # tier 3 domain agents
173
+ ├── rules/ # path-scoped rules (6 files)
174
+ └── settings.local.json # hooks (11)
175
+ ```
176
+
177
+ ---
178
+
179
+ ## Protected files
180
+
181
+ These files are never edited directly. Use CLI commands or `morph-spec update` instead:
182
+
183
+ | Path | Protected by |
184
+ |------|-------------|
185
+ | `.morph/state.json` | `permissions.deny` |
186
+ | `.morph/framework/**` | `permissions.deny` |
187
+ | Approved spec/contracts | `protect-spec-files.js` hook |
188
+
189
+ ---
190
+
191
+ ## Links
192
+
193
+ - [QUICKSTART.md](QUICKSTART.md) — step-by-step guide
194
+ - [ARCHITECTURE.md](ARCHITECTURE.md) — system design
195
+ - [CHANGELOG.md](../CHANGELOG.md) — release history
196
+ - [npm](https://www.npmjs.com/package/@polymorphism-tech/morph-spec)
197
+ - support@polymorphism.com.br
198
+
199
+ ---
200
+
201
+ *morph-spec v4.10.0 by Polymorphism Tech*
@@ -127,7 +127,7 @@ morph-spec phase advance my-feature
127
127
  Mark a task complete:
128
128
 
129
129
  ```bash
130
- morph-spec task done my-feature
130
+ morph-spec task done my-feature T001
131
131
  ```
132
132
 
133
133
  Run validators at any time:
@@ -203,4 +203,4 @@ morph-spec doctor
203
203
 
204
204
  ---
205
205
 
206
- *morph-spec v4.8.19 by Polymorphism Tech*
206
+ *morph-spec v4.10.0 by Polymorphism Tech*
@@ -1,77 +1,99 @@
1
- # MORPH-SPEC Runtime Instructions
2
-
3
- > by Polymorphism Tech — Spec-driven development for .NET/Blazor/Next.js/Azure
4
-
5
- ---
6
-
7
- ## Project Context
8
-
9
- @.morph/context/README.md
10
-
11
- ---
12
-
13
- ## Critical Rules
14
-
15
- **NEVER:**
16
- - Skip to code without a specification
17
- - Implement without design approval
18
- - Ignore standards in `.morph/framework/standards/`
19
- - Create infrastructure manually
20
- - Generate code without defined contracts
21
-
22
- **ALWAYS:**
23
- - Follow the mandatory phases
24
- - Generate outputs in `.morph/features/{feature}/`
25
- - Document decisions in `decisions.md`
26
- - Checkpoint every 3 implemented tasks
27
- - Use Infrastructure as Code
28
-
29
- ---
30
-
31
- ## Quick Reference
32
-
33
- | Command | Purpose |
34
- |---------|---------|
35
- | `/morph-proposal {feature}` | Full spec pipeline (phases 1–4, pauses for approval) |
36
- | `/morph-apply {feature}` | Implement feature (phase 5) |
37
- | `/morph-status` | Feature status dashboard |
38
- | `/morph-preflight` | Pre-implementation validation |
39
-
40
- ---
41
-
42
- ## State & Outputs
43
-
44
- | Path | Notes |
45
- |------|-------|
46
- | `.morph/state.json` | **READ-ONLY** — use `morph-spec` CLI to update |
47
- | `.morph/features/{feature}/{phase}/` | Feature outputs organized by phase |
48
- | `.morph/framework/` | **READ-ONLY** — framework files managed by morph-spec |
49
- | `.morph/config/config.json` | Project configuration (editable) |
50
-
51
- ---
52
-
53
- ## Phase Sequence
54
-
55
- ```
56
- proposal → setup → [uiux] → design → clarify → tasks → implement → [sync]
57
- ```
58
-
59
- Use `morph-spec status {feature}` to see current phase and pending approval gates.
60
-
61
- ---
62
-
63
- ## Agents
64
-
65
- Tier-1 and tier-2 MORPH agents are available as native subagents in `.claude/agents/`.
66
- They can be invoked directly by Claude Code during multi-agent workflows.
67
-
68
- ---
69
-
70
- ## Context Window Tip
71
-
72
- When using 3+ MCPs, add `"experimental": { "mcpCliMode": true }` to `.claude/settings.json`.
73
- MCP tools load on-demand instead of all at startup — keeps context clean for actual work.
74
-
75
- ---
76
-
77
- *MORPH-SPEC by Polymorphism Tech*
1
+ # MORPH-SPEC Runtime Instructions
2
+
3
+ > by Polymorphism Tech — Spec-driven development for .NET/Blazor/Next.js/Azure
4
+
5
+ ---
6
+
7
+ ## Project Context
8
+
9
+ @.morph/context/README.md
10
+
11
+ ---
12
+
13
+ ## Critical Rules
14
+
15
+ **NEVER:**
16
+ - Skip to code without a specification
17
+ - Implement without design approval
18
+ - Ignore standards in `.morph/framework/standards/`
19
+ - Create infrastructure manually
20
+ - Generate code without defined contracts
21
+ - List questions as plain text — always use the `AskUserQuestion` tool
22
+
23
+ **ALWAYS:**
24
+ - Follow the mandatory phases
25
+ - Generate outputs in `.morph/features/{feature}/`
26
+ - Document decisions in `decisions.md`
27
+ - Checkpoint every 3 implemented tasks
28
+ - Use Infrastructure as Code
29
+ - Use `AskUserQuestion` tool whenever asking the user anything (1–4 questions per call; split into sequential calls if more)
30
+
31
+ ---
32
+
33
+ ## Quick Reference
34
+
35
+ | Command | Purpose |
36
+ |---------|---------|
37
+ | `/morph-proposal {feature}` | Full spec pipeline (phases 1–4, pauses for approval) |
38
+ | `/morph-apply {feature}` | Implement feature (phase 5) |
39
+ | `/morph-status` | Feature status dashboard |
40
+ | `/morph-preflight` | Pre-implementation validation |
41
+
42
+ ---
43
+
44
+ ## State & Outputs
45
+
46
+ | Path | Notes |
47
+ |------|-------|
48
+ | `.morph/state.json` | **READ-ONLY** — use `morph-spec` CLI to update |
49
+ | `.morph/features/{feature}/{phase}/` | Feature outputs organized by phase |
50
+ | `.morph/framework/` | **READ-ONLY** — framework files managed by morph-spec |
51
+ | `.morph/config/config.json` | Project configuration (editable) |
52
+
53
+ ### mark-output types
54
+
55
+ Use `morph-spec state mark-output <feature> <type>` with one of these exact type names:
56
+
57
+ | Type | Phase | kebab alias |
58
+ |------|-------|-------------|
59
+ | `proposal` | proposal | |
60
+ | `schemaAnalysis` | design | `schema-analysis` |
61
+ | `spec` | design | — |
62
+ | `contracts` | design | — |
63
+ | `contractsVsa` | design | `contracts-vsa` |
64
+ | `decisions` | design | — |
65
+ | `clarifications` | clarify | |
66
+ | `plan` | plan | |
67
+ | `tasks` | tasks | — |
68
+ | `uiDesignSystem` | uiux | `ui-design-system` |
69
+ | `uiMockups` | uiux | `ui-mockups` |
70
+ | `uiComponents` | uiux | `ui-components` |
71
+ | `uiFlows` | uiux | `ui-flows` |
72
+ | `recap` | implement | |
73
+ ---
74
+
75
+ ## Phase Sequence
76
+
77
+ ```
78
+ proposal → setup → [uiux] → design → clarify → plan → tasks → implement → [sync]
79
+ ```
80
+
81
+ Use `morph-spec status {feature}` to see current phase and pending approval gates.
82
+
83
+ ---
84
+
85
+ ## Agents
86
+
87
+ Tier-1 and tier-2 MORPH agents are available as native subagents in `.claude/agents/`.
88
+ They can be invoked directly by Claude Code during multi-agent workflows.
89
+
90
+ ---
91
+
92
+ ## Context Window Tip
93
+
94
+ When using 3+ MCPs, add `"experimental": { "mcpCliMode": true }` to `.claude/settings.json`.
95
+ MCP tools load on-demand instead of all at startup — keeps context clean for actual work.
96
+
97
+ ---
98
+
99
+ *MORPH-SPEC by Polymorphism Tech*