@polymorphism-tech/morph-spec 8.2.1 → 8.4.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 (55) hide show
  1. package/README.md +73 -102
  2. package/bin/morph-spec.js +36 -1
  3. package/claude-plugin.json +1 -1
  4. package/docs/CHEATSHEET.md +77 -134
  5. package/docs/QUICKSTART.md +47 -57
  6. package/framework/CLAUDE.md +6 -3
  7. package/framework/MORPH.md +2 -2
  8. package/framework/agents.json +3 -1
  9. package/framework/commands/morph-hotfix.md +1 -1
  10. package/framework/hooks/README.md +3 -0
  11. package/framework/hooks/claude-code/core/state-sync.js +41 -9
  12. package/framework/hooks/claude-code/core/telemetry-log.js +102 -0
  13. package/framework/hooks/shared/state-writer.js +14 -3
  14. package/framework/hooks/shared/telemetry-logger.js +75 -0
  15. package/framework/rules/ai-agents-standards.md +1 -0
  16. package/framework/schemas/feature.schema.json +15 -7
  17. package/framework/skills/core/create-umbraco-lp/SKILL.md +1 -1
  18. package/framework/skills/core/migrate-lp-to-umbraco/SKILL.md +1 -1
  19. package/framework/skills/core/morph-apply/SKILL.md +1 -1
  20. package/framework/skills/core/morph-brainstorming/SKILL.md +1 -1
  21. package/framework/skills/core/morph-eval/SKILL.md +1 -1
  22. package/framework/skills/core/morph-hotfix/SKILL.md +3 -3
  23. package/framework/skills/core/morph-implement/SKILL.md +1 -1
  24. package/framework/skills/core/morph-plan/SKILL.md +1 -1
  25. package/framework/skills/core/morph-proposal/SKILL.md +4 -4
  26. package/framework/skills/core/morph-review/SKILL.md +1 -1
  27. package/framework/skills/core/morph-stack-scan/SKILL.md +1 -1
  28. package/framework/skills/core/morph-standards/SKILL.md +1 -1
  29. package/framework/standards/STANDARDS.json +43 -1
  30. package/framework/standards/ai-agents/observability-patterns.md +156 -0
  31. package/framework/standards/ai-agents/production.md +3 -47
  32. package/framework/templates/REGISTRY.json +0 -93
  33. package/package.json +1 -1
  34. package/src/commands/observability/telemetry.js +75 -0
  35. package/src/commands/project/doctor.js +28 -0
  36. package/src/commands/state/advance.js +17 -0
  37. package/src/commands/state/approve.js +13 -0
  38. package/src/commands/state/create.js +21 -1
  39. package/src/commands/state/delete.js +143 -0
  40. package/src/commands/state/list.js +110 -0
  41. package/src/core/state/feature-identity.js +36 -0
  42. package/src/core/state/gate-order.js +51 -0
  43. package/src/core/state/lifecycle-audit.js +79 -0
  44. package/src/core/state/state-manager.js +47 -140
  45. package/src/dashboard/app/pages/LiveState.jsx +0 -43
  46. package/src/lib/detectors/design-system-detector.js +0 -43
  47. package/src/lib/generators/index.js +0 -1
  48. package/src/lib/telemetry/telemetry-reader.js +103 -0
  49. package/src/lib/validators/validation-runner.js +9 -73
  50. package/src/utils/hooks-installer.js +27 -3
  51. package/framework/templates/context/CONTEXT-FEATURE.md +0 -269
  52. package/framework/templates/context/CONTEXT.md +0 -181
  53. package/src/lib/agents/metrics-aggregator.js +0 -56
  54. package/src/lib/agents/metrics-calculator.js +0 -125
  55. package/src/lib/generators/metadata-extractor.js +0 -385
package/README.md CHANGED
@@ -3,14 +3,14 @@
3
3
  > Spec-driven development framework for multi-stack projects. Turns feature requests into implementation-ready code through structured, AI-orchestrated phases.
4
4
 
5
5
  **Package:** `@polymorphism-tech/morph-spec`
6
- **Version:** 8.2.1
6
+ **Version:** 8.4.0
7
7
  **Requires:** Node.js 22+, Claude Code
8
8
 
9
9
  ---
10
10
 
11
11
  ## What it does
12
12
 
13
- morph-spec enforces a spec-first development workflow. When you ask for a feature, it does not write code immediately. It runs through structured phases (proposal, design, tasks) with approval gates before a single line of implementation is generated. Each phase produces traceable output files. Every decision is documented.
13
+ morph-spec enforces a spec-first development workflow. When you ask for a feature, it does not write code immediately. It runs through structured phases (proposal, plan, implement) with approval gates before a single line of implementation is generated. Each phase produces traceable output files. Every decision is documented.
14
14
 
15
15
  It integrates natively with Claude Code: skills become slash commands, agents become native subagents, hooks inject state context automatically, and rules enforce standards based on file paths.
16
16
 
@@ -61,7 +61,7 @@ your-project/
61
61
  │ ├── config/
62
62
  │ │ └── config.json # Project configuration
63
63
  │ ├── framework/
64
- │ │ ├── agents.json # 22 agents in 4 tiers (READ-ONLY)
64
+ │ │ ├── agents.json # 8 domain personas (READ-ONLY)
65
65
  │ │ ├── standards/ # Coding and architecture standards (READ-ONLY)
66
66
  │ │ └── templates/ # Code and IaC templates (READ-ONLY)
67
67
  │ ├── context/ # Project context (README.md, standards.md)
@@ -76,9 +76,9 @@ your-project/
76
76
  └── .claude/
77
77
  ├── commands/ # Slash commands
78
78
  ├── skills/ # Framework skills (flat .md files)
79
- ├── agents/ # Native subagents (22 agents)
80
- ├── rules/ # Path-scoped standards rules
81
- └── settings.local.json # Hooks configuration (10 hooks)
79
+ ├── agents/ # Native subagents (one morph-{id}.md per persona)
80
+ ├── rules/ # Stack-aware, path-scoped standards rules
81
+ └── settings.local.json # Hooks configuration
82
82
  ```
83
83
 
84
84
  ---
@@ -88,10 +88,10 @@ your-project/
88
88
  Features move through structured phases. Some are optional depending on feature type.
89
89
 
90
90
  ```
91
- proposal → [design] → plan → implement → review
91
+ proposal → [uiux] → plan → implement → review
92
92
  ```
93
93
 
94
- `design` is optional — applies only to UI-heavy features.
94
+ `uiux` is optional — applies only to UI-heavy features.
95
95
 
96
96
  ### Phase outputs
97
97
 
@@ -134,13 +134,15 @@ Independent features can also be developed **in parallel, each isolated in its o
134
134
  These commands are available inside Claude Code after init.
135
135
 
136
136
 
137
- | Command | Description |
138
- | --------------------------- | --------------------------------------------------------- |
139
- | `/morph-proposal {feature}` | Full spec pipeline (phases 0-4, pauses at approval gates) |
140
- | `/morph-apply {feature}` | Implement approved feature (phase 5) |
141
- | `/morph-hotfix {feature}` | Surgical hotfix ADW — scout → fix → human Gate 3 → ship |
142
- | `/morph-status` | Feature status dashboard |
143
- | `/morph-preflight` | Pre-implementation validation |
137
+ | Command | Description |
138
+ | ------------------------------ | ---------------------------------------------------------- |
139
+ | `/morph-proposal {feature}` | Business understanding + plan (Gates 1 and 2) |
140
+ | `/morph-apply {feature}` | Autonomous execution + review (Gate 3) |
141
+ | `/morph-hotfix {feature}` | Surgical hotfix ADW — scout → fix → human Gate 3 → ship |
142
+ | `/morph-status [feature]` | Status of the active (or specified) feature |
143
+ | `/morph-archive {feature}` | Archive a completed feature (after Gate 3) |
144
+ | `/morph-preflight` | Pre-deploy validation (specs, contracts, tests, infra) |
145
+ | `/morph-troubleshoot [error]` | Root-cause diagnosis for .NET/Next.js errors |
144
146
 
145
147
 
146
148
  ---
@@ -160,15 +162,16 @@ morph-spec doctor --full # Full health check (all file verificatio
160
162
  ### Feature workflow
161
163
 
162
164
  ```bash
163
- morph-spec state list # List all features and their states
164
- morph-spec state get {feature} # Get feature state
165
- morph-spec state set {feature} {key} {value}
166
- morph-spec phase advance {feature} # Advance to next phase
167
- morph-spec task done {feature} # Mark current task complete
168
- morph-spec task start {feature} # Start next task
169
- morph-spec status {feature} # Feature status dashboard
165
+ morph-spec fleet # Every active feature (root + worktrees): phase, gates, activity
166
+ morph-spec status {feature} # Feature status dashboard
167
+ morph-spec approve {feature} {gate} # Approve a phase gate (proposal, plan, review)
168
+ morph-spec advance {feature} # Approve the current gate and scaffold the next phase folder
169
+ morph-spec approval-status {feature} # Show approval status for all gates
170
+ morph-spec archive {feature} # Archive a completed feature (after Gate 3)
170
171
  ```
171
172
 
173
+ Task progress within a feature is tracked with the native `TaskCreate`/`TaskUpdate` tools, persisted to `tasks.json` — there is no separate CLI command for starting or completing a task.
174
+
172
175
  ### Validation
173
176
 
174
177
  ```bash
@@ -181,8 +184,8 @@ morph-spec verify {feature} [task] # Deterministic build+tests+validators ch
181
184
  ### Work-type routing
182
185
 
183
186
  ```bash
184
- morph-spec create {feature} --type feature|bug|chore|hotfix # Explicit birth: type dimensions the pipeline
185
- morph-spec create {feature} --request "<free text>" # Deterministic detector classifies the type
187
+ morph-spec create {feature} --type feature|bug|chore|hotfix --description "<what/why>" # Explicit birth: type dimensions the pipeline, description is required
188
+ morph-spec create {feature} --request "<free text>" # Detector classifies the type AND seeds the description
186
189
  morph-spec retype {feature} {newType} # Change work type mid-flight (blocked after Gate 3)
187
190
  morph-spec dag {feature} [--mermaid] # DAG dispatch decision; --mermaid emits a flowchart
188
191
  ```
@@ -190,7 +193,7 @@ morph-spec dag {feature} [--mermaid] # DAG dispatch d
190
193
  ### Worktrees (parallel development)
191
194
 
192
195
  ```bash
193
- morph-spec create {feature} --worktree # Birth the feature already isolated in its own worktree
196
+ morph-spec create {feature} --description "<what/why>" --worktree # Birth the feature already isolated in its own worktree
194
197
  morph-spec worktree setup {feature} # Create .worktrees/{feature}/ on branch morph/{feature}
195
198
  morph-spec worktree link [--all] # Relink shared infra (node_modules, .claude, .morph/framework)
196
199
  morph-spec worktree finish {feature} # Merge --no-ff back to the primary root, clean up (requires Gate 3)
@@ -199,92 +202,59 @@ morph-spec worktree list [--json] # List active feature worktrees with ph
199
202
 
200
203
  ---
201
204
 
202
- ## Agent hierarchy
203
-
204
- morph-spec includes 22 agents organized in 4 tiers (2+3+13+4). Tier 1-2 agents are installed as native Claude Code subagents in `.claude/agents/`. Tier 3 domain agents are installed as `.claude/agents/morph-domain-{name}.md`.
205
-
206
- ### Tier 1 — Orchestrators (2)
207
-
208
-
209
- | Agent | Role | Active |
210
- | --------------------- | ------------------------------------------------------ | --------- |
211
- | `standards-architect` | Chief Architect — enforces standards across all phases | Always |
212
- | `ai-system-architect` | AI/Agent system design and orchestration | On-demand |
213
-
214
-
215
- ### Tier 2 — Domain Leaders (3)
216
-
217
-
218
- | Agent | Squad | Active |
219
- | ------------------ | ------------------------- | --------- |
220
- | `dotnet-senior` | Backend squad lead | Always |
221
- | `nextjs-expert` | Frontend squad lead | Always |
222
- | `infra-architect` | Infrastructure squad lead | Always |
205
+ ## Agent model
223
206
 
207
+ morph-spec dispatches 8 flat domain personas — no tiers, no hierarchy — defined in `.morph/framework/agents.json` (single source of truth) and installed identically to `.claude/agents/morph-{id}.md`. Claude picks the right persona per task from the domains/keywords in `agents.json`, then dispatches it via the `Agent` tool.
224
208
 
225
- ### Tier 3 — Specialists (13)
226
-
227
- Organized into squads:
228
-
229
- **Backend (6):** ef-modeler, hangfire-orchestrator, ms-agent-expert, supabase-expert, vector-search-expert, morph-spec-architect
230
-
231
- **Frontend (3):** css-specialist, ui-designer, seo-growth-hacker
232
-
233
- **Integrations (3):** asaas-financial, clerk-auth, resend-email
234
-
235
- **Security (1):** security-expert
236
-
237
- ### Tier 4 — Validators (4)
238
-
239
-
240
- | Agent | Validates |
241
- | ------------------------------ | --------------------------------------- |
242
- | `architecture-expert` | Architectural decisions and constraints |
243
- | `packages-validator` | Package versions and compatibility |
244
- | `design-system-validator` | Design system adherence |
245
- | `nextjs-component-validator` | Next.js component structure and naming |
209
+ | Persona | Domain | Model |
210
+ | ---------------- | -------------------------------------- | ------ |
211
+ | `dotnet-senior` | Backend (.NET, VSA) | sonnet |
212
+ | `ef-modeler` | EF Core / Postgres modeling | sonnet |
213
+ | `maf-expert` | Microsoft Agent Framework | sonnet |
214
+ | `nextjs-expert` | Frontend (Next.js/React) | sonnet |
215
+ | `ui-designer` | UI/UX, design systems | sonnet |
216
+ | `infra-engineer` | Jobs, deployment, observability | sonnet |
217
+ | `evaluator` | Independent code/architecture review (Gate 3) | opus |
218
+ | `scout` | Read-only codebase diagnosis | haiku |
246
219
 
220
+ `morph-spec doctor` detects drift between `agents.json` and the generated `.claude/agents/morph-*.md` files — never hand-edit the generated files.
247
221
 
248
222
  ---
249
223
 
250
224
  ## Hooks
251
225
 
252
- 10 Claude Code hooks are installed into `.claude/settings.local.json` across 8 event types:
226
+ Guardrail hooks are installed into `.claude/settings.local.json` across 7 event bindings. All are **fail-open** — they check that state exists first and silently no-op on missing/corrupt state; they never throw, write state, or orchestrate.
253
227
 
254
228
 
255
- | Event | Hook | Purpose |
256
- | -------------------- | -------------------------- | ----------------------------------------------------------------- |
257
- | `SessionStart` | `inject-morph-context.js` | Injects active feature spec into context (configurable char max) |
258
- | `UserPromptSubmit` | `enrich-prompt.js` | Context-aware prompt enrichment, wrong-phase warnings |
259
- | `PreToolUse` | Bash guard (prompt type) | Detects destructive patterns inline via Claude's reasoning |
260
- | `PreToolUse` | `protect-spec-files.js` | Blocks edits to spec files after approval gate |
261
- | `PreToolUse` | `enforce-phase-writes.js` | Ensures writes go to the correct phase directory |
262
- | `PostToolUse` | `dispatch.js` | Triggers auto-checkpoints on task completion |
263
- | `PostToolUseFailure` | `handle-tool-failure.js` | Logs failures to `.morph/logs/tool-failures.log` |
264
- | `Stop` | `validate-completion.js` | Warns about incomplete tasks/missing outputs/pending gates |
265
- | `PreCompact` | `save-morph-context.js` | Snapshots state to `.morph/memory/` before compaction |
229
+ | Event | Hook(s) | Purpose |
230
+ | --------------------------- | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
231
+ | `SessionStart` | `worktree-context.js` | Injects feature identity (worktree) or active-feature summary (root) |
232
+ | `PreToolUse` (Write\|Edit) | `protect-spec-files.js`, `enforce-phase-writes.js` | Blocks edits to the frozen plan contract post-Gate-2; enforces phase folders |
233
+ | `PreToolUse` (Bash) | `pre-bash-denylist.js` | Detects destructive shell patterns |
234
+ | `PostToolUse` | `post-edit-typecheck.js`, `tasks-json-guard.js`, `trace-autogen.js` | Stack-aware typecheck; guards `tasks.json` plan-contract edits; auto-generates execution traces |
235
+ | `PostToolUse` | `state-sync.js`, `gate-guard.js`, `loop-detect.js` | Syncs feature state; enforces gate ordering; detects repeated-action loops |
236
+ | `Stop` | `validate-completion.js` | Warns about incomplete tasks, missing outputs, or pending approval gates |
266
237
 
267
238
 
268
239
  Protected files (via `permissions.deny`):
269
240
 
270
- - `.morph/state.json` — never edited directly, CLI only
271
- - `.morph/framework/`** — read-only framework content
241
+ - `.morph/state.json` — never edited directly, derived from `feature.json` files
242
+ - `.morph/framework/` — read-only framework content
272
243
 
273
244
  ---
274
245
 
275
246
  ## Rules
276
247
 
277
- Path-scoped rules are installed to `.claude/rules/` and activate automatically based on file patterns:
278
-
248
+ Rules are installed to `.claude/rules/` based on your detected stack (`stacks:` frontmatter, same tagging mechanism as agents and templates) and activate automatically based on file path patterns (`paths:` frontmatter). A subset of the current set:
279
249
 
280
- | Rule file | Applies to |
281
- | ----------------------------- | -------------------------------------------------------- |
282
- | `morph-workflow.md` | Always active — spec-first mandate, phase commands |
283
- | `csharp-standards.md` | `**/*.cs`, `**/*.csproj` |
284
- | `frontend-standards.md` | `**/*.razor`, `**/*.css`, `**/*.scss` |
285
- | `nextjs-standards.md` | `**/*.tsx`, `**/*.ts` |
286
- | `testing-standards.md` | `tests/`**, `**/*.test.*`, `**/*.spec.*`, `**/*Tests.cs` |
287
- | `infrastructure-standards.md` | `**/*.bicep`, `**/Dockerfile`, `**/pipelines/**` |
250
+ | Rule file | Applies to | Stack |
251
+ | ----------------------------- | ------------------------------------------------- | --------- |
252
+ | `morph-workflow.md` | Always active — spec-first mandate | any |
253
+ | `csharp-standards.md` | `**/*.cs`, `**/*.csproj` | dotnet |
254
+ | `frontend-standards.md` | `**/*.tsx`, `**/*.css`, `**/*.scss` | nextjs |
255
+ | `nextjs-standards.md` | Next.js-specific patterns | nextjs |
256
+ | `ai-agents-standards.md` | `**/Agents/**`, `**/*Agent*.cs` | dotnet |
257
+ | `infrastructure-standards.md` | `**/Dockerfile*`, `**/docker-compose*`, `**/.github/**` | docker |
288
258
 
289
259
 
290
260
  ---
@@ -292,11 +262,12 @@ Path-scoped rules are installed to `.claude/rules/` and activate automatically b
292
262
  ## Stack support
293
263
 
294
264
 
295
- | Technology | Support |
296
- | ------------------------------------------- | ------------------------------------------------ |
297
- | .NET 10 / ASP.NET Core | Full — C# contracts, EF Core, CQRS, Minimal API |
298
- | Next.js / React / TypeScript | Full — components, routing, state management |
299
- | Supabase | Supported via CLI (local Docker) |
265
+ | Technology | Support |
266
+ | ------------------------------------------- | ------------------------------------------------------------- |
267
+ | .NET 10 / ASP.NET Core | Full — VSA with direct handlers, result pattern, Minimal API |
268
+ | EF Core / Neon (Postgres) | Full — migrations, Neon Auth (Better Auth) |
269
+ | Next.js / React / TypeScript | Full — components, routing, state management |
270
+ | Microsoft Agent Framework (MAF) | Full — single-agent + structured output + tools + RAG |
300
271
 
301
272
 
302
273
  TypeScript strict mode is enforced by default. See `.morph/framework/standards/` for all coding standards.
@@ -323,12 +294,12 @@ After updating, run `morph-spec doctor` to confirm the installation is healthy.
323
294
 
324
295
  **Never edit protected files directly:**
325
296
 
326
- - `.morph/state.json` — use `morph-spec state set`
327
- - `.morph/framework/`** — read-only, updated by `morph-spec update`
297
+ - `.morph/state.json` — derived automatically from `feature.json`; use `morph-spec approve`/`advance`/`score`/`gate-decision` to change feature state
298
+ - `.morph/framework/` — read-only, updated by `morph-spec update`
328
299
 
329
- **Always document decisions.** Each feature has a `2-design/decisions.md`. Architectural choices go there, not in commit messages.
300
+ **Always document decisions.** Each feature can have a `2-plan/decisions.md`. Architectural choices go there, not in commit messages.
330
301
 
331
- **Checkpoints every 3 tasks.** The framework auto-validates architecture compliance, package versions, and security after every third completed task.
302
+ **Validators run after every task.** `morph-spec verify` runs the build + test + validator chain relevant to your stack; `morph-eval` scores the result — a score below 9 triggers an autonomous correction loop rather than a pause.
332
303
 
333
304
  ---
334
305
 
@@ -382,7 +353,7 @@ Ensure `.claude/settings.local.json` is not gitignored in your project. The file
382
353
 
383
354
  ## Standards
384
355
 
385
- The framework ships 82 registered standards across 11 categories, stored in `.morph/framework/standards/STANDARDS.json`. Standards are enforced via path-scoped rules installed to `.claude/rules/` during `morph-spec init`.
356
+ The framework ships 60 registered standards across 7 categories (`ai-agents`, `architecture`, `backend`, `data`, `frontend`, `infrastructure`, `integration`), stored in `.morph/framework/standards/STANDARDS.json`. Standards are looked up on demand (by keyword/alias) rather than preloaded wholesale into context, and enforced via stack-aware, path-scoped rules installed to `.claude/rules/` during `morph-spec init`.
386
357
 
387
358
  ---
388
359
 
@@ -394,4 +365,4 @@ Code generated by morph-spec (contracts, templates, implementation output) belon
394
365
 
395
366
  ---
396
367
 
397
- *morph-spec v8.2.1 by [Polymorphism Tech](https://polymorphism.tech)*
368
+ *morph-spec v8.4.0 by [Polymorphism Tech](https://polymorphism.tech)*
package/bin/morph-spec.js CHANGED
@@ -35,6 +35,8 @@ import { gateDecisionCommand } from '../src/commands/state/gate-decision.js';
35
35
  import { createCommand } from '../src/commands/state/create.js';
36
36
  import { retypeCommand } from '../src/commands/state/retype.js';
37
37
  import { handoffCommand } from '../src/commands/state/handoff.js';
38
+ import { listCommand } from '../src/commands/state/list.js';
39
+ import { deleteCommand } from '../src/commands/state/delete.js';
38
40
 
39
41
  // === Tasks ===
40
42
  import { dagCommand } from '../src/commands/tasks/dag.js';
@@ -56,6 +58,9 @@ import { contextRefreshCommand } from '../src/commands/context/context-refresh.j
56
58
  // === Dashboard ===
57
59
  import { dashboardCommand } from '../src/commands/dashboard/dashboard.js';
58
60
 
61
+ // === Observability ===
62
+ import { telemetryCommand } from '../src/commands/observability/telemetry.js';
63
+
59
64
  const __dirname = dirname(fileURLToPath(import.meta.url));
60
65
  const pkg = JSON.parse(readFileSync(join(__dirname, '..', 'package.json'), 'utf8'));
61
66
 
@@ -123,13 +128,22 @@ program
123
128
  .option('-v, --verbose', 'Show detailed output')
124
129
  .action(statusCommand);
125
130
 
131
+ program
132
+ .command('list')
133
+ .description('List every feature × status × gates (G1/G2/G3) × workType — the audit board')
134
+ .option('--all', 'Include archived features (.morph/archive)')
135
+ .option('--archived', 'Include archived features (alias of --all)')
136
+ .option('--json', 'Output as JSON')
137
+ .action((options) => listCommand(options));
138
+
126
139
  // ─── Approval gates (dev-only) ────────────────────────────────────────────
127
140
  program
128
141
  .command('approve <feature> <gate>')
129
- .description('Approve a phase gate (proposal, plan, review)')
142
+ .description('Approve a phase gate (proposal, plan, review). Enforces gate order (N requires N-1)')
130
143
  .option('--approver <name>', 'Name of approver (default: current user when interactive, "auto" otherwise)')
131
144
  .option('--mode <mode>', 'Approval mode: "user" or "auto" (default: detected from TTY)')
132
145
  .option('--notes <notes>', 'Approval notes')
146
+ .option('--force', 'Approve out of order (bypass the gate-monotonicity check)')
133
147
  .action((feature, gate, options) => approveCommand(feature, gate, options));
134
148
 
135
149
  program
@@ -139,6 +153,7 @@ program
139
153
  .option('--mode <mode>', 'Approval mode: "user" or "auto" (default: detected from TTY)')
140
154
  .option('--design', 'From proposal, advance into the optional design (uiux) phase instead of plan')
141
155
  .option('--notes <notes>', 'Approval notes')
156
+ .option('--force', 'Advance even if a prerequisite gate is unapproved (out-of-order recovery)')
142
157
  .action((feature, options) => advanceCommand(feature, options));
143
158
 
144
159
  program
@@ -148,6 +163,15 @@ program
148
163
  .option('--force', 'Archive even if Gate 3 (review) is not approved')
149
164
  .action((feature, options) => archiveCommand(feature, options));
150
165
 
166
+ program
167
+ .command('delete <feature>')
168
+ .description('Delete a feature (hard by default; --archive marks it abandoned). Refuses if a gate is approved unless --force')
169
+ .option('--archive', 'Soft delete: move to .morph/archive with status "abandoned" instead of removing')
170
+ .option('--force', 'Delete even when a gate is approved')
171
+ .option('--no-git', 'Skip git staging of the removal')
172
+ .option('--json', 'Output as JSON')
173
+ .action((feature, options) => deleteCommand(feature, options));
174
+
151
175
  program
152
176
  .command('approval-status <feature>')
153
177
  .description('Show approval status for all gates')
@@ -175,6 +199,8 @@ program
175
199
  program
176
200
  .command('create <feature>')
177
201
  .description('Classify work type (--type/--request), scaffold + stamp policy gates, and create the canonical feature.json (explicit birth — see framework/schemas/feature.schema.json)')
202
+ .option('--name <name>', 'Human-readable feature name (default: the slug)')
203
+ .option('--description <text>', 'What/why of the feature — required at birth unless --request is given (it seeds the description)')
178
204
  .option('--status <status>', 'Initial feature status (default: in_progress)')
179
205
  .option('--type <type>', 'Work type: feature|bug|chore|hotfix (default: feature) — see src/core/work-types.js')
180
206
  .option('--request <text>', 'Free-text request classified by the deterministic detector; tie/none exits 2 with candidates for an LLM/user decision (feature NOT created)')
@@ -344,4 +370,13 @@ program
344
370
  .option('--no-open', 'Don\'t auto-open browser')
345
371
  .action(dashboardCommand);
346
372
 
373
+ // ─── Observability ────────────────────────────────────────────────────────
374
+ program
375
+ .command('telemetry')
376
+ .description('Summarize the harness execution path from .morph/logs/events.jsonl (skills, personas, standards read, tool mix, prompts)')
377
+ .option('--json', 'Output the aggregate as JSON')
378
+ .option('--feature <name>', 'Narrow the summary to a single feature')
379
+ .option('--limit <n>', 'How many recent prompts to show (default 10)', (v) => parseInt(v, 10))
380
+ .action((options) => telemetryCommand(options));
381
+
347
382
  program.parse();
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "morph-spec",
3
- "version": "8.2.1",
3
+ "version": "8.4.0",
4
4
  "displayName": "MORPH-SPEC Framework",
5
5
  "description": "Spec-driven development with 38 agents and 8-phase workflow for .NET/Blazor/Next.js/Azure",
6
6
  "publisher": "polymorphism-tech",