@polymorphism-tech/morph-spec 9.8.0 → 10.1.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 (202) hide show
  1. package/CLAUDE.md +12 -10
  2. package/README.md +4 -4
  3. package/bin/morph-spec.js +40 -43
  4. package/claude-plugin.json +1 -1
  5. package/docs/CHEATSHEET.md +28 -36
  6. package/docs/QUICKSTART.md +31 -191
  7. package/framework/CLAUDE.md +24 -30
  8. package/framework/MORPH.md +47 -123
  9. package/framework/agents.json +6 -374
  10. package/framework/commands/morph-apply.md +1 -1
  11. package/framework/commands/morph-archive.md +4 -3
  12. package/framework/commands/morph-hotfix.md +8 -30
  13. package/framework/commands/morph-infra.md +2 -2
  14. package/framework/commands/morph-media.md +10 -9
  15. package/framework/commands/morph-preflight.md +3 -3
  16. package/framework/commands/morph-review.md +15 -0
  17. package/framework/commands/morph-status.md +1 -1
  18. package/framework/docs/CLI.md +84 -95
  19. package/framework/evals/review-checklist.md +45 -53
  20. package/framework/hooks/README.md +4 -4
  21. package/framework/hooks/claude-code/core/README.md +1 -1
  22. package/framework/hooks/claude-code/core/denylist.json +4 -4
  23. package/framework/hooks/claude-code/core/gate-guard.js +9 -0
  24. package/framework/hooks/claude-code/core/masked-exit.js +49 -0
  25. package/framework/hooks/claude-code/core/state-sync.js +4 -1
  26. package/framework/hooks/claude-code/core/telemetry-log.js +1 -2
  27. package/framework/hooks/claude-code/core/test-budget.js +10 -70
  28. package/framework/hooks/claude-code/core/validate-completion.js +11 -24
  29. package/framework/hooks/claude-code/core/worktree-context.js +5 -22
  30. package/framework/hooks/claude-code/core/worktree-create.js +6 -45
  31. package/framework/hooks/claude-code/core/worktree-env-inject.js +2 -10
  32. package/framework/hooks/shared/e2e-check.js +0 -0
  33. package/framework/hooks/shared/gate-event.js +2 -2
  34. package/framework/hooks/shared/graph-refresh.js +20 -3
  35. package/framework/hooks/shared/heavy-command.js +32 -1
  36. package/framework/hooks/shared/heavy-config.js +1 -1
  37. package/framework/hooks/shared/next-step.js +63 -24
  38. package/framework/hooks/shared/phase-utils.js +6 -9
  39. package/framework/hooks/shared/report-progress.js +86 -0
  40. package/framework/hooks/shared/state-reader.js +3 -2
  41. package/framework/hooks/statusline.js +332 -0
  42. package/framework/mcp/registry.json +4 -4
  43. package/framework/phases.json +32 -10
  44. package/framework/rules/ai-agents-standards.md +10 -2
  45. package/framework/rules/csharp-standards.md +4 -0
  46. package/framework/rules/data-standards.md +1 -1
  47. package/framework/rules/ef-standards.md +20 -0
  48. package/framework/rules/frontend-standards.md +1 -1
  49. package/framework/rules/hangfire-standards.md +1 -1
  50. package/framework/rules/implement-report.md +25 -0
  51. package/framework/rules/infrastructure-standards.md +2 -0
  52. package/framework/rules/neon-auth-standards.md +1 -1
  53. package/framework/rules/neon-standards.md +3 -3
  54. package/framework/rules/nextjs-standards.md +7 -0
  55. package/framework/rules/plan-grammar.md +53 -0
  56. package/framework/rules/ui-design.md +27 -0
  57. package/framework/schemas/config.schema.json +11 -18
  58. package/framework/schemas/feature.schema.json +7 -1
  59. package/framework/skills/core/create-umbraco-lp/SKILL.md +1 -1
  60. package/framework/skills/core/create-umbraco-lp/references/umbraco-lp-patterns.md +1 -1
  61. package/framework/skills/core/migrate-lp-to-umbraco/SKILL.md +2 -2
  62. package/framework/skills/core/morph-apply/SKILL.md +39 -166
  63. package/framework/skills/core/morph-apply/references/debugging.md +8 -0
  64. package/framework/skills/core/morph-apply/references/hotfix.md +42 -0
  65. package/framework/skills/core/morph-apply/references/machine.md +29 -0
  66. package/framework/skills/core/{morph-media/SKILL.md → morph-apply/references/media.md} +11 -74
  67. package/framework/skills/core/morph-apply/references/review.md +65 -0
  68. package/framework/skills/core/morph-plan/SKILL.md +49 -109
  69. package/framework/skills/core/morph-plan/references/critique.md +43 -0
  70. package/framework/skills/core/morph-plan/references/interview.md +37 -0
  71. package/framework/skills/core/morph-uiux/SKILL.md +47 -64
  72. package/framework/skills/core/morph-uiux/surfaces.json +32 -0
  73. package/framework/standards/STANDARDS.json +51 -28
  74. package/framework/standards/STANDARDS.meta.json +16 -19
  75. package/framework/standards/ai-agents/agent-session.md +2 -3
  76. package/framework/standards/ai-agents/context-providers.md +2 -2
  77. package/framework/standards/ai-agents/durable-workflows-hitl.md +2 -2
  78. package/framework/standards/ai-agents/providers/model-registry.md +2 -2
  79. package/framework/standards/ai-agents/rag-custom-pgvector.md +7 -6
  80. package/framework/standards/ai-agents/setup.md +1 -1
  81. package/framework/standards/ai-agents/tool-adapters.md +2 -2
  82. package/framework/standards/architecture/stack-baseline.md +70 -0
  83. package/framework/standards/backend/database/postgresql/database.md +22 -1
  84. package/framework/standards/backend/dotnet/vsa-handler-patterns.md +33 -1
  85. package/framework/standards/backend/integrations/hangfire/hangfire-jobs.md +2 -1
  86. package/framework/standards/backend/integrations/neon-auth/neon-auth.md +12 -13
  87. package/framework/standards/frontend/design-system/ai-image-generation.md +51 -12
  88. package/framework/standards/frontend/design-system/ai-video-generation.md +50 -4
  89. package/framework/standards/frontend/design-system/art-direction.md +2 -2
  90. package/framework/standards/frontend/scroll-driven/frame-scrub.md +12 -2
  91. package/framework/standards/frontend/scroll-driven/scroll-components.md +76 -4
  92. package/framework/standards/infrastructure/docker/local-compose-isolation.md +2 -2
  93. package/framework/standards/infrastructure/neon/neon-pgvector.md +62 -20
  94. package/framework/standards/infrastructure/neon/neon-platform.md +61 -0
  95. package/framework/standards/infrastructure/neon/neon-setup.md +14 -13
  96. package/framework/standards/integration/mcp/mcp-tools.md +20 -20
  97. package/framework/templates/REGISTRY.json +1 -2
  98. package/framework/templates/context/ARCHITECTURE.md +1 -1
  99. package/framework/templates/docs/plan.md +15 -12
  100. package/framework/templates/docs/ui-mockups.md +17 -105
  101. package/framework/templates/infrastructure/docker/docker-compose.template.yml +1 -1
  102. package/package.json +1 -1
  103. package/src/commands/e2e/e2e.js +88 -23
  104. package/src/commands/graph/diff.js +74 -0
  105. package/src/commands/graph/status.js +1 -1
  106. package/src/commands/observability/cost.js +2 -4
  107. package/src/commands/observability/telemetry.js +1 -1
  108. package/src/commands/project/doctor.js +23 -39
  109. package/src/commands/project/fleet.js +5 -6
  110. package/src/commands/project/init.js +63 -36
  111. package/src/commands/project/stack-scan.js +3 -42
  112. package/src/commands/project/stack-set.js +26 -0
  113. package/src/commands/project/status.js +12 -13
  114. package/src/commands/project/update.js +39 -3
  115. package/src/commands/project/worktree.js +3 -14
  116. package/src/commands/state/advance.js +17 -17
  117. package/src/commands/state/approve.js +0 -6
  118. package/src/commands/state/archive.js +27 -1
  119. package/src/commands/state/auto-approval.js +2 -2
  120. package/src/commands/state/create.js +1 -6
  121. package/src/commands/state/gate-check.js +38 -31
  122. package/src/commands/state/gate-decision.js +3 -2
  123. package/src/commands/state/next.js +1 -0
  124. package/src/commands/state/recap.js +67 -0
  125. package/src/commands/state/report-check.js +36 -178
  126. package/src/commands/validation/plan-check.js +16 -11
  127. package/src/commands/validation/validate-feature.js +3 -3
  128. package/src/commands/validation/verify.js +3 -6
  129. package/src/core/paths/output-schema.js +3 -3
  130. package/src/core/state/state-manager.js +2 -4
  131. package/src/dashboard/app/components/CommandPalette.jsx +2 -5
  132. package/src/dashboard/app/components/GatePauses.jsx +116 -0
  133. package/src/dashboard/app/components/SessionMap.jsx +77 -0
  134. package/src/dashboard/app/pages/Activity.jsx +4 -0
  135. package/src/dashboard/app/pages/AgentMap.jsx +1 -2
  136. package/src/dashboard/app/pages/FeatureDetail.jsx +129 -186
  137. package/src/dashboard/app/pages/Features.jsx +7 -7
  138. package/src/dashboard/app/pages/PhasePipeline.jsx +1 -1
  139. package/src/dashboard/app/pages/Portfolio.jsx +40 -5
  140. package/src/dashboard/scanner/activity-scanner.js +29 -0
  141. package/src/dashboard/scanner/agents-scanner.js +11 -14
  142. package/src/dashboard/scanner/features-scanner.js +45 -24
  143. package/src/dashboard/scanner/project-api.js +11 -2
  144. package/src/dashboard/scanner/skills-scanner.js +11 -1
  145. package/src/lib/detectors/index.js +1 -1
  146. package/src/lib/e2e/applicability.js +3 -1
  147. package/src/lib/git/tree-state.js +1 -16
  148. package/src/lib/graph/diff-tree.js +127 -0
  149. package/src/lib/graph/graphify-runtime.js +12 -5
  150. package/src/lib/installers/memory-installer.js +3 -3
  151. package/src/lib/installers/rules-installer.js +57 -0
  152. package/src/lib/installers/stack-assets.js +17 -0
  153. package/src/lib/installers/stack-sync.js +219 -0
  154. package/src/lib/plan/checks.js +61 -109
  155. package/src/lib/plan/critique.js +28 -0
  156. package/src/lib/plan/media.js +42 -0
  157. package/src/lib/plan/plan-html.js +125 -0
  158. package/src/lib/plan/plan-parser.js +34 -45
  159. package/src/lib/recap/piper.js +36 -0
  160. package/src/lib/recap/recap.js +232 -0
  161. package/src/lib/review-reports.js +28 -4
  162. package/src/lib/risk-detector.js +90 -11
  163. package/src/lib/specs/screen-checklist.js +33 -48
  164. package/src/lib/stack/dotnet-build-ignores.js +8 -9
  165. package/src/lib/telemetry/metrics.js +27 -29
  166. package/src/lib/validators/reuse/reuse-validator.js +1 -9
  167. package/src/lib/validators/verify-runner.js +0 -7
  168. package/src/lib/worktree/fleet-scanner.js +7 -20
  169. package/src/lib/worktree/worktree-audit.js +0 -37
  170. package/src/scripts/setup-infra.js +15 -50
  171. package/src/utils/agents-installer.js +27 -201
  172. package/src/utils/hooks-installer.js +11 -95
  173. package/framework/hooks/claude-code/core/warn-bash-source-write.js +0 -23
  174. package/framework/hooks/claude-code/statusline.py +0 -699
  175. package/framework/hooks/claude-code/statusline.sh +0 -11
  176. package/framework/hooks/shared/agent-reap.js +0 -74
  177. package/framework/hooks/shared/slice-progress.js +0 -110
  178. package/framework/skills/core/morph-hotfix/SKILL.md +0 -133
  179. package/framework/skills/core/morph-machine/SKILL.md +0 -46
  180. package/framework/skills/core/morph-review/SKILL.md +0 -129
  181. package/framework/skills/core/morph-standards/SKILL.md +0 -52
  182. package/framework/standards/PROVENANCE.json +0 -119
  183. package/framework/standards/infrastructure/neon/neon-pgrag.md +0 -243
  184. package/src/commands/project/worktree-reap.js +0 -34
  185. package/src/commands/state/handoff.js +0 -65
  186. package/src/commands/validation/mutate.js +0 -263
  187. package/src/commands/validation/scout-check.js +0 -28
  188. package/src/lib/generators/handoff-generator.js +0 -172
  189. package/src/lib/mutation/adapters.js +0 -79
  190. package/src/lib/mutation/commands.js +0 -61
  191. package/src/lib/mutation/dotnet-introspection.js +0 -281
  192. package/src/lib/mutation/manifest.js +0 -144
  193. package/src/lib/mutation/plan.js +0 -44
  194. package/src/lib/mutation/report.js +0 -68
  195. package/src/lib/mutation/runner.js +0 -301
  196. package/src/lib/mutation/schemata.js +0 -60
  197. package/src/lib/mutation/snapshot.js +0 -65
  198. package/src/lib/mutation/subset.js +0 -109
  199. package/src/lib/mutation/trx.js +0 -50
  200. package/src/lib/scout/scout-check.js +0 -293
  201. package/src/lib/validators/traceability-check.js +0 -103
  202. package/src/lib/worktree/agent-reaper.js +0 -247
@@ -1,82 +1,47 @@
1
1
  # morph-spec Quick Start
2
2
 
3
+ One page: install, run `doctor`, paste the issue, open the PR.
4
+
3
5
  ## Install
4
6
 
5
7
  ```bash
6
8
  npm install -g @polymorphism-tech/morph-spec@latest --prefer-online
7
9
  ```
8
10
 
9
- > The installer automatically configures your PowerShell PATH on Windows. If `morph-spec` is not found, open a new terminal window.
10
-
11
- ---
11
+ If `morph-spec` is not found on Windows, open a new terminal window.
12
12
 
13
- ## Initialize a project
13
+ ## Set up the project
14
14
 
15
- Navigate to your project root and run:
15
+ From the project root:
16
16
 
17
17
  ```bash
18
18
  morph-spec init
19
- ```
20
-
21
- `init` does the following:
22
- - Auto-detects your stack (.NET, Next.js, Node.js, monorepo)
23
- - Creates `.morph/` with framework files, standards, and templates
24
- - Creates `.morph/context/` with inferred project context
25
- - Installs `.claude/skills/`, `.claude/agents/`, `.claude/rules/`
26
- - Writes `.claude/settings.local.json` with the fail-open Claude Code hooks (see `docs/ARCHITECTURE.md`)
27
- - Copies `CLAUDE.md` with runtime instructions
28
-
29
- Verify the installation:
30
-
31
- ```bash
32
19
  morph-spec doctor
33
20
  ```
34
21
 
35
- ---
22
+ `init` installs the harness into `.morph/` and `.claude/`. `doctor` is your first debugging step: it reports version mismatches, missing files and hook problems.
36
23
 
37
- ## Your first feature
24
+ ## Paste the issue
38
25
 
39
- Open your project in Claude Code and run:
26
+ Open the project in Claude Code and paste the link:
40
27
 
41
28
  ```
42
- /morph-proposal my-feature
29
+ /morph-plan https://github.com/your-org/your-repo/issues/123
43
30
  ```
44
31
 
45
- Replace `my-feature` with a short kebab-case name for your feature (e.g., `user-notifications`, `payment-flow`).
46
-
47
- The proposal pipeline runs the `proposal` and `plan` phases (plus the optional `uiux` phase), with an approval gate at each:
48
-
49
- ### Proposal (Gate 1)
32
+ A free-text request works too: `/morph-plan user-notifications`, then describe what you want.
50
33
 
51
- Claude analyzes your request, detects the relevant stack and standards, and produces `0-proposal/proposal.md`. You review it and approve (or request changes).
34
+ Claude reads the issue, checks it against the code and opens with a thesis: "asks for X; the code shows Y; I propose Z". There is no process question. How much it asks depends on what is at stake:
52
35
 
53
- ### UI/UX — optional (Gate)
36
+ | The request is | What happens |
37
+ |---|---|
38
+ | clear and matches the code | a one-line thesis, then it moves on |
39
+ | missing something, or contradicts the code | up to 3 challenges, each with evidence |
40
+ | unclear about the outcome, or high risk | a full interview with you |
54
41
 
55
- Only runs for UI-heavy features. Claude generates, under `1-design/`:
56
- - `design-system.md` — colors, typography, spacing
57
- - `mockups.md` — ASCII wireframes
58
- - `components.md` — component specs
59
- - `flows.md` — user flows and edge cases
42
+ The result is `2-plan/plan.md`: the problem, the outcome sought, what is out of scope, and the scenarios `C1..Cn` that define done. Read `## Padrões assumidos` at the end: to veto a default, tell Claude its number before implementing.
60
43
 
61
- You approve the UI design before moving on.
62
-
63
- ### Plan (Gate 2)
64
-
65
- Claude produces, under `2-plan/`:
66
- - `usecases/UC-*.md` — the behavior, with postconditions observable in a test
67
- - `spec.md` — architecture, contracts and the `## Contrato de implementação` section (standards, runtime verification)
68
- - `tasks.json` — ordered task breakdown (`T001`, `T002`, …)
69
- - `decisions.md` — architectural decision records (optional)
70
-
71
- Claude identifies ambiguities in the spec and resolves them with you before finalizing. You review and approve the use cases, spec and task list together.
72
-
73
- At this point, planning is complete:
74
-
75
- ```
76
- ✅ Planning complete — run /morph-apply my-feature to implement
77
- ```
78
-
79
- ---
44
+ You approve the gates yourself. If you have a question about the issue, ask the person who wrote it.
80
45
 
81
46
  ## Implement
82
47
 
@@ -84,169 +49,44 @@ At this point, planning is complete:
84
49
  /morph-apply my-feature
85
50
  ```
86
51
 
87
- Claude reads the use cases, `spec.md` and `tasks.json`, then implements task by task with auto-advance (no pause between tasks unless there's a blocking ambiguity):
88
- - Records task progress in `tasks.json`, writing the mutable `status`/`outputs`/`notes` fields
89
- - Runs the validators relevant to your stack after each task (e.g. `architecture`/`packages`/`contract-compliance` for .NET, `nextjs-component`/`css`/`design-system` for Next.js) via `morph-spec verify`
90
- - Closes each task when `verify` is green and every `doneCriteria` has the evidence that proves it — red triggers an autonomous correction loop, not a pause
91
- - Generates `3-implement/recap.md` on completion, then Gate 3 review (`4-review/`)
92
-
93
- ---
94
-
95
- ## During development
96
-
97
- Check feature state:
98
-
99
- ```bash
100
- morph-spec status my-feature
101
- ```
102
-
103
- Approve the current gate and scaffold the next phase folder in one step:
104
-
105
- ```bash
106
- morph-spec advance my-feature
107
- ```
108
-
109
- Task progress is recorded in `tasks.json` — Claude writes the mutable `status`/`outputs`/`notes` fields directly, and there is no separate CLI command for marking a task done.
110
-
111
- Run validators at any time:
52
+ Claude implements the whole plan in one session, tracks each scenario in `3-implement/report.md`, runs `verify`, and dispatches the Gate 3 reviewers in fresh context. If a discovery makes the outcome sought false, it stops and asks you.
112
53
 
113
- ```bash
114
- morph-spec validate # all validators
115
- morph-spec validate architecture # specific validator
116
- morph-spec validate packages
117
- ```
54
+ ## Open the PR
118
55
 
119
- Run the deterministic verification chain (build + tests + validators) before trusting an LLM judge score:
56
+ When Gate 3 passes, Claude asks how to integrate. You can also run it yourself:
120
57
 
121
58
  ```bash
122
- morph-spec verify my-feature # whole feature
123
- morph-spec verify my-feature T001 # scoped to one task
59
+ morph-spec finish my-feature --pr
124
60
  ```
125
61
 
126
- ---
127
-
128
- ## Work-type routing
129
-
130
- Not every change needs the full pipeline walked above. Every feature is born with a **work type** that dimensions its pipeline:
62
+ `finish` archives the feature, pushes `morph/my-feature` and opens the PR.
131
63
 
132
- Every feature is also born with an **identity** — a `--description` (the one field a human must supply; `create` refuses a nameless scaffold without it) and a `name` (defaults to the slug):
64
+ ## Along the way
133
65
 
134
66
  ```bash
135
- # full: proposal → [uiux] → plan → implement → review
136
- morph-spec create my-feature --type feature --description "what & why"
137
- # bug: lean proposal/plan
138
- morph-spec create my-fix --type bug --description "what broke"
139
- # chore: skips straight to implement (Gates 1/2 stamped by policy)
140
- morph-spec create my-chore --type chore --description "the tidy-up"
141
- # hotfix: scout → surgical fix → test loop; Gate 3 always pauses for a human
142
- morph-spec create my-hotfix --type hotfix --description "the incident"
67
+ morph-spec next my-feature # what happens next, read from disk
68
+ morph-spec status my-feature # phase, gates and progress
69
+ morph-spec fleet # every active feature
143
70
  ```
144
71
 
145
- You can also let the deterministic detector classify a free-text request instead of picking a type by hand (`--request` doubles as the description):
72
+ Picked up a session mid-feature? Run `/morph-apply my-feature`. It resumes from `3-implement/report.md`.
146
73
 
147
- ```bash
148
- morph-spec create my-feature --request "produção caiu, corrigir urgente"
149
- ```
150
-
151
- Change the type later if it turns out to be wrong (blocked after Gate 3):
152
-
153
- ```bash
154
- morph-spec retype my-feature hotfix --reason "escalated to production incident"
155
- ```
156
-
157
- Production incidents run through the dedicated `/morph-hotfix my-feature` slash command instead of `/morph-proposal`.
158
-
159
- ---
160
-
161
- ## Parallel development with worktrees
162
-
163
- Independent features can be developed in parallel, each isolated in its own git worktree — one feature, one worktree, one Claude Code instance:
164
-
165
- ```bash
166
- morph-spec create my-feature --description "what & why" --worktree # birth the feature already isolated
167
- # or, for an existing feature:
168
- morph-spec worktree setup my-feature # creates worktrees/my-feature/ on branch morph/my-feature
169
- ```
170
-
171
- Open the new worktree directory in its own Claude Code instance and work normally — a SessionStart hook injects the worktree's feature identity into context automatically. When the feature is done (Gate 3 approved), close it in one step:
172
-
173
- ```bash
174
- morph-spec finish my-feature --merge # archive + merge --no-ff into the default branch (local), tear down the worktree
175
- # or, to open a PR instead of merging locally:
176
- morph-spec finish my-feature --pr # archive + push morph/my-feature + gh pr create (keeps the branch the PR needs)
177
- ```
178
-
179
- `finish` archives the feature (committing the move inside `morph/my-feature`) *and* integrates *and* tears down the worktree in one step — it replaces the old `worktree finish` + separate `archive`. The same command closes features developed **without** a worktree (they're born on `morph/{feature}` too).
180
-
181
- List every active worktree with its phase and gate status:
182
-
183
- ```bash
184
- morph-spec worktree list
185
- ```
186
-
187
- ---
188
-
189
- ## Multiple features
190
-
191
- You can have multiple features in progress simultaneously. Each has its own directory under `.morph/features/`, with its own committed `feature.json`:
192
-
193
- ```
194
- .morph/features/
195
- ├── user-notifications/
196
- │ ├── feature.json
197
- │ ├── 0-proposal/
198
- │ └── 2-plan/
199
- └── payment-flow/
200
- ├── feature.json
201
- └── 0-proposal/
202
- ```
203
-
204
- See every active feature — root and worktrees — with phase, gates, and activity:
205
-
206
- ```bash
207
- morph-spec fleet
208
- ```
209
-
210
- ---
74
+ Not everything needs the full flow. `/morph-plan` routes by work type: `feature` and `bug` run the whole flow, `chore` writes a short plan and goes straight to implementation. For a production incident, use `/morph-hotfix my-feature`: Gate 3 always stops for a human.
211
75
 
212
76
  ## Keeping up to date
213
77
 
214
- When a new version of `@polymorphism-tech/morph-spec` is published:
215
-
216
78
  ```bash
217
- # Update the CLI (--prefer-online bypasses the ~5 min local packument cache)
218
79
  npm install -g @polymorphism-tech/morph-spec@latest --prefer-online
219
-
220
- # Update framework files in your project
221
80
  morph-spec update
222
-
223
- # Verify
224
81
  morph-spec doctor
225
82
  ```
226
83
 
227
- `morph-spec update` re-syncs `.morph/framework/`, `.claude/skills/`, `.claude/agents/`, `.claude/rules/`, and `CLAUDE.md`. It does not touch your config, context, or feature outputs.
228
-
229
- ---
230
-
231
- ## Tips
232
-
233
- **Use `/morph-proposal` even for small features.** The proposal phase catches scope creep, identifies the right agents, and generates contracts early — before implementation makes it expensive to change direction.
234
-
235
- **Approve explicitly at each gate.** The design gate exists to prevent implementing the wrong thing. If something in `spec.md` or `contracts.cs` looks off, say so before approving.
236
-
237
- **ADRs belong in `decisions.md`.** When Claude makes an architectural choice, it documents it there. Read it after Design completes. Decisions drive the validators that run during implementation.
238
-
239
- **`morph-spec doctor` is your first debugging step.** If something is behaving unexpectedly, doctor will surface version mismatches, missing files, and hook configuration issues.
240
-
241
- ---
242
-
243
84
  ## Next steps
244
85
 
245
86
  - [CHEATSHEET.md](CHEATSHEET.md) — command reference
246
- - [ARCHITECTURE.md](ARCHITECTURE.md) — system design and agent hierarchy
87
+ - `.morph/framework/CLI.md` — every command in detail
247
88
  - [CHANGELOG.md](../CHANGELOG.md) — release history
248
- - `.morph/framework/standards/` — all coding and architecture standards
249
89
 
250
90
  ---
251
91
 
252
- *morph-spec v9.8.0 by Polymorphism Tech*
92
+ *morph-spec v10.1.1 by Polymorphism Tech*
@@ -4,47 +4,41 @@
4
4
 
5
5
  ## Início de cada sessão
6
6
 
7
- 1. Leia `.morph/framework/MORPH.md` uma vez (de novo após `/compact`): papéis, fases, gates, dispatch.
8
- 2. O SessionStart injeta a feature ativa e `▶ próximo:`; sem ele, `morph-spec next <f>`. Estado autoritativo: `.morph/features/{f}/feature.json` (`state.json` é índice — nunca edite).
9
- 3. Feature em andamento → faça o que o `next` manda, entre gates, sem esperar instrução. Nenhuma ativa → pergunte qual trabalhar.
7
+ 1. Leia `.morph/framework/MORPH.md` uma vez (de novo após `/compact`).
8
+ 2. O SessionStart injeta a feature ativa e `▶ próximo:`; sem ele, `morph-spec next <f>`. Estado autoritativo: `.morph/features/{f}/feature.json` — só pela CLI.
9
+ 3. Feature em andamento → faça o que o `next` manda, sem esperar instrução. Nenhuma → pergunte qual.
10
10
 
11
11
  ## Regras
12
12
 
13
- - Perguntas ao usuário só por `AskUserQuestion` (1-4 por chamada), nunca em texto solto. Na entrevista da `morph-plan`, **uma pergunta por chamada**: lote impede que uma resposta pode os ramos seguintes. Única exceção: ferramenta indisponível ou negada (headless) — texto numerado com a resposta recomendada e gate pausado (`morph-plan` §3).
14
- - A pergunta de gate nomeia a feature ("Gate do plano — Plano de {feature} aprovado?"): é por esse nome que o hook `state-sync` grava a aprovação no `feature.json` certo; sem nome, com mais de uma feature, ele recusa e você aprova por `morph-spec approve <feature> <gate>`.
15
- - Estado só pela CLI, nunca à mão: `feature.json`, `gateDecisions`, `checks.json` (escrito só por `plan-check`) e o corpo do `plan.md` depois do gate (fato errado → `## Errata` no fim; escopo mudou → `unapprove`).
16
- - SessionStart avisou claim vivo de outra sessão na mesma feature → confirme com o usuário antes de `finish`/`archive`/`delete`.
17
- - Depois de um dispatch, leia o arquivo de relatório da fatia, não a mensagem final, que pode não chegar.
13
+ - Perguntas só por `AskUserQuestion`; na entrevista do plano, uma por chamada. Headless: texto numerado com a recomendada e gate pausado.
14
+ - A pergunta de gate nomeia a feature ("Gate do plano — Plano de {f} aprovado?"): é por ela que o hook `state-sync` grava a aprovação.
15
+ - "Não li" ou "não entendi" depois de uma saída longa → refaça do zero, sem supor que a anterior foi lida: até 5 passos numerados, uma frase cada, o primeiro sendo o que mudou para o usuário.
16
+ - Plano aprovado congela: fato errado → `## Errata` no fim; escopo mudou → `unapprove`.
17
+ - SessionStart avisou claim de outra sessão na feature → confirme antes de `finish`/`archive`/`delete`.
18
18
 
19
19
  ## CLI do loop
20
20
 
21
- Prefixo `morph-spec`; flags e porquês em `.morph/framework/CLI.md` (um `###` por comando).
21
+ Prefixo `morph-spec`; detalhe em `.morph/framework/CLI.md`.
22
22
 
23
23
  | Comando | Para quê |
24
24
  |---|---|
25
- | `create <f> --description "…" --type <t> [--worktree]` | nasce a feature; exit 2 = você escolhe o tipo |
26
- | `next <f>` | o próximo passo, decidido do disco |
27
- | `stack-scan [f]` | desvios do código contra `project.stack` |
28
- | `tests-audit` | candidatos a apagar/fundir na suíte (só lê) |
29
- | `plan-check <f>` | valida `plan.md`, grava `checks.json`, imprime as ondas |
30
- | `gate-check <f> <gate>` | decide a pausa pelos sinais do disco |
31
- | `approve <f> <gate> --mode auto` / `advance <f>` | aprova (advance também abre a próxima fase) |
25
+ | `create <f> --request '…' [--worktree]` | nasce a feature |
26
+ | `next <f>` | o próximo passo, do disco |
27
+ | `plan-check <f>` | valida o plano, grava `checks.json` |
28
+ | `gate-check <f> <gate>` / `approve` / `advance` | decide e aprova gates |
32
29
  | `verify <f> [--ci]` | build + testes + validadores + e2e, sem filtro |
33
- | `report-check <f> [F1 …]` | audita o relatório de cada fatia e diz a ação |
34
- | `mutate <f>` | mutação dirigida do Gate 3 (até 3 mutantes) |
35
- | `finish <f> --pr\|--merge` | encerra; só o `--merge` integra |
36
- | `standards --find "<tema>"` / `--show <id>#<âncora>` | digest do standard / uma seção |
37
- | `heavy status\|run -- <cmd>` | fila de build/teste; exit 3 = fila cheia |
38
- | `worktree setup\|provision\|link\|remove\|list\|reap` | ciclo da worktree; `remove` é a única remoção segura |
39
- | `graph affected\|explain <sym>` | blast radius; sem grafo, caia para grep |
30
+ | `report-check <f> [--before-eval]` | estado dos relatórios do Gate 3 |
31
+ | `e2e up\|status\|reset\|down <f>` | stack da feature |
32
+ | `finish <f> --pr\|--merge` | encerra; grava o recap animado no archive |
33
+ | `standards --find "<tema>"` | digest do standard |
34
+ | `heavy run -- <cmd>` | build/teste pesado na fila |
35
+ | `worktree setup\|provision\|link\|remove\|list` | ciclo da worktree; `remove` é a única remoção segura |
36
+ | `graph affected\|explain <sym>` | blast radius; sem grafo, grep |
37
+ | `graph diff [--base <ref>]` | árvore de chamadas do que mudou; recusa grafo velho |
40
38
 
41
- ## Slash commands
39
+ ## Gate 3 (sub-agents)
42
40
 
43
- `/morph-plan {f}` (plano), `/morph-apply {f}` (execução + Gate 3), `/morph-hotfix {f}`, `/morph-status [f]`.
44
-
45
- ## Personas (em `.claude/agents/`)
46
-
47
- Despache fatias com `subagent_type: "morph-{id}"` — a persona, gerada de `agents.json`, é o system prompt. Tipo não registrado: `general-purpose` com o `persona` colado, registrado no relatório da fatia. Nunca edite `.claude/agents/morph-*.md` à mão (`morph-spec doctor` acusa o drift).
41
+ `morph-verifier`, `morph-reviewer`, `morph-security` em `.claude/agents/`, gerados de `agents.json` — nunca edite à mão. Com a crítica do plano (`Plan` nativo, `morph-plan`), são os únicos sub-agents do fluxo; o resto é feito nesta sessão. Do Gate 3, leia o relatório que gravam, não a mensagem final.
48
42
 
49
43
  <!-- morph-agents:start -->
50
44
  _Lista derivada na instalação. Bloco vazio → `morph-spec setup-infra --reinstall`._
@@ -52,4 +46,4 @@ _Lista derivada na instalação. Bloco vazio → `morph-spec setup-infra --reins
52
46
 
53
47
  ## Precedência de skills
54
48
 
55
- Com o plugin superpowers ativo, `morph-*` vence o equivalente genérico (aplica os gates e os paths de `.morph/`), e `using-git-worktrees`→`morph-spec worktree setup|provision`.
49
+ `morph-*` vence o equivalente genérico; `using-git-worktrees` → `morph-spec worktree setup|provision`.