@uoyo/mvtt 2.0.0-beta.3 → 2.0.0-beta.6

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 (96) hide show
  1. package/README.md +299 -64
  2. package/README.zh-CN.md +419 -0
  3. package/dist/commands/install.d.ts.map +1 -1
  4. package/dist/commands/install.js +27 -2
  5. package/dist/commands/install.js.map +1 -1
  6. package/dist/commands/uninstall.d.ts.map +1 -1
  7. package/dist/commands/uninstall.js +19 -7
  8. package/dist/commands/uninstall.js.map +1 -1
  9. package/dist/commands/update.d.ts.map +1 -1
  10. package/dist/commands/update.js +4 -2
  11. package/dist/commands/update.js.map +1 -1
  12. package/dist/fs/install-manifest.d.ts +4 -1
  13. package/dist/fs/install-manifest.d.ts.map +1 -1
  14. package/dist/fs/install-manifest.js +13 -1
  15. package/dist/fs/install-manifest.js.map +1 -1
  16. package/dist/fs/materialize.d.ts +2 -0
  17. package/dist/fs/materialize.d.ts.map +1 -1
  18. package/dist/fs/materialize.js +46 -13
  19. package/dist/fs/materialize.js.map +1 -1
  20. package/dist/fs/registry-merge.d.ts +19 -0
  21. package/dist/fs/registry-merge.d.ts.map +1 -0
  22. package/dist/fs/registry-merge.js +220 -0
  23. package/dist/fs/registry-merge.js.map +1 -0
  24. package/dist/scripts/epic-update.cjs +7670 -0
  25. package/dist/scripts/plan-update.cjs +7736 -0
  26. package/dist/scripts/session-update.cjs +84 -6
  27. package/dist/types/platform.d.ts +12 -0
  28. package/dist/types/platform.d.ts.map +1 -0
  29. package/dist/types/platform.js +24 -0
  30. package/dist/types/platform.js.map +1 -0
  31. package/dist/types/registry.d.ts +3 -24
  32. package/dist/types/registry.d.ts.map +1 -1
  33. package/install-manifest.yaml +10 -2
  34. package/package.json +1 -1
  35. package/registry.yaml +72 -198
  36. package/sources/defaults/config.yaml +8 -13
  37. package/sources/defaults/project-context.yaml +2 -5
  38. package/sources/defaults/session.yaml +14 -2
  39. package/sources/knowledge/core/manifest.yaml +1 -4
  40. package/sources/scripts/epic-update.js +512 -0
  41. package/sources/scripts/plan-update.js +614 -0
  42. package/sources/scripts/session-update.js +102 -2
  43. package/sources/sections/activation-load-config.md +1 -1
  44. package/sources/sections/activation-load-context.md +42 -13
  45. package/sources/sections/activation-preflight.md +1 -1
  46. package/sources/sections/footer-next-steps.md +3 -2
  47. package/sources/sections/output-format-constraint.md +14 -0
  48. package/sources/sections/project-context-profile.md +29 -0
  49. package/sources/sections/session-update.md +41 -1
  50. package/sources/skills/mvt-analyze/business.md +46 -8
  51. package/sources/skills/mvt-analyze/manifest.yaml +8 -1
  52. package/sources/skills/mvt-analyze-code/business.md +18 -17
  53. package/sources/skills/mvt-analyze-code/manifest.yaml +9 -6
  54. package/sources/skills/mvt-check-context/business.md +13 -6
  55. package/sources/skills/mvt-check-context/manifest.yaml +0 -5
  56. package/sources/skills/mvt-cleanup/business.md +17 -2
  57. package/sources/skills/mvt-cleanup/manifest.yaml +3 -0
  58. package/sources/skills/mvt-config/business.md +5 -5
  59. package/sources/skills/mvt-config/manifest.yaml +3 -6
  60. package/sources/skills/mvt-create-skill/business.md +2 -14
  61. package/sources/skills/mvt-create-skill/manifest.yaml +2 -4
  62. package/sources/skills/mvt-decompose/business.md +94 -0
  63. package/sources/skills/mvt-decompose/manifest.yaml +121 -0
  64. package/sources/skills/mvt-design/manifest.yaml +3 -0
  65. package/sources/skills/mvt-fix/business.md +21 -6
  66. package/sources/skills/mvt-fix/manifest.yaml +4 -1
  67. package/sources/skills/mvt-help/business.md +11 -9
  68. package/sources/skills/mvt-help/manifest.yaml +0 -5
  69. package/sources/skills/mvt-implement/business.md +57 -10
  70. package/sources/skills/mvt-implement/manifest.yaml +3 -0
  71. package/sources/skills/mvt-init/business.md +23 -13
  72. package/sources/skills/mvt-init/manifest.yaml +4 -2
  73. package/sources/skills/mvt-manage-context/business.md +41 -14
  74. package/sources/skills/mvt-manage-context/manifest.yaml +7 -5
  75. package/sources/skills/mvt-plan-dev/business.md +17 -9
  76. package/sources/skills/mvt-plan-dev/manifest.yaml +3 -0
  77. package/sources/skills/mvt-quick-dev/business.md +22 -7
  78. package/sources/skills/mvt-quick-dev/manifest.yaml +3 -1
  79. package/sources/skills/mvt-refactor/business.md +32 -17
  80. package/sources/skills/mvt-refactor/manifest.yaml +2 -4
  81. package/sources/skills/mvt-resume/business.md +32 -12
  82. package/sources/skills/mvt-resume/manifest.yaml +3 -3
  83. package/sources/skills/mvt-review/business.md +24 -9
  84. package/sources/skills/mvt-review/manifest.yaml +3 -0
  85. package/sources/skills/mvt-status/business.md +37 -9
  86. package/sources/skills/mvt-status/manifest.yaml +2 -2
  87. package/sources/skills/mvt-sync-context/business.md +77 -34
  88. package/sources/skills/mvt-sync-context/manifest.yaml +6 -0
  89. package/sources/skills/mvt-template/business.md +1 -1
  90. package/sources/skills/mvt-template/manifest.yaml +0 -5
  91. package/sources/skills/mvt-test/business.md +30 -15
  92. package/sources/skills/mvt-test/manifest.yaml +3 -0
  93. package/sources/skills/mvt-update-plan/business.md +64 -33
  94. package/sources/skills/mvt-update-plan/manifest.yaml +10 -7
  95. package/sources/templates/decompose-output/body.md +13 -0
  96. package/sources/templates/decompose-output/manifest.yaml +11 -0
@@ -10,9 +10,9 @@ This skill measures only files the **user** can reduce or relocate. Framework-fi
10
10
 
11
11
  **In scope (user-actionable):**
12
12
  - Index: `.ai-agents/workspace/project-context.yaml`.
13
- - Semantic context: `.ai-agents/knowledge/project/_generated/project-context.md`.
14
- - Shared knowledge: every entry in `registry.yaml > knowledge.shared`. For the `core` entry, scan only files marked as user-origin per `core/manifest.yaml` (or whose path begins with `user/`); skip files under `core/_framework/`.
15
- - Per-skill knowledge: every entry in `registry.yaml > skills.*.knowledge`, grouped by skill.
13
+ - Semantic context: `.ai-agents/knowledge/project/_generated/project-context.md` (always the flat path, regardless of project count).
14
+ - Shared knowledge: every entry in `registry.yaml > knowledge._all` and `knowledge.{projectName}` (map-aware -- traverse ALL project keys in the knowledge map). For the `core` entry, scan only files marked as user-origin per `core/manifest.yaml` (or whose path begins with `user/`); skip files under `core/_framework/`.
15
+ - Per-skill knowledge: every entry in `registry.yaml > skills.*.knowledge._all` and `skills.*.knowledge.{projectName}` (map-aware -- traverse ALL project keys for each skill), grouped by skill.
16
16
  - Artifacts: all files under `.ai-agents/workspace/artifacts/` recursively. **Exclude the `_archived/` subdirectory** — it contains completed changes archived by `/mvt-cleanup` and should not count toward the active workspace token budget.
17
17
 
18
18
  **Out of scope (do NOT scan):**
@@ -21,13 +21,19 @@ This skill measures only files the **user** can reduce or relocate. Framework-fi
21
21
  - `.ai-agents/config.yaml`, `.ai-agents/workspace/session.yaml`, `.ai-agents/registry.yaml` -- small, required, and addressed via `/mvt-config` or `/mvt-manage-context`, not here.
22
22
 
23
23
  ### Step 3: Estimate Token Consumption
24
- - **What**: produce a per-file tokens estimate and per-category subtotals.
24
+ - **What**: produce a per-file tokens estimate and per-category subtotals, with **per-project breakdown**.
25
25
  - **How**:
26
26
  1. For each in-scope file: tokens ~= `characters / 4`.
27
27
  2. Group by category: `Index`, `Semantic Context`, `Shared Knowledge`, `Per-Skill Knowledge`, `Artifacts`.
28
28
  3. For Shared Knowledge, compute total once -- this is per-skill overhead (loaded by every skill invocation).
29
29
  4. For Per-Skill Knowledge, compute totals per skill so users can see which skill is heaviest.
30
30
  5. Identify the Top 5 largest single files across the whole in-scope set.
31
+ 6. **Per-project breakdown**: for multi-project workspaces, also compute token costs per project:
32
+ - `knowledge._all` = shared across all projects
33
+ - `knowledge.{projectName}` = project-specific overhead
34
+ - `skills.*.knowledge.{projectName}` = per-skill per-project overhead
35
+ Display as a separate table: `project | knowledge tokens | per-skill tokens | total`.
36
+ 7. **Global summary**: total tokens across all projects + `_all` overhead loaded every time.
31
37
 
32
38
  ### Step 4: Apply Thresholds and Health Status
33
39
  - **What**: assign each file/category a status of `healthy | borderline | oversized`.
@@ -70,8 +76,9 @@ This skill measures only files the **user** can reduce or relocate. Framework-fi
70
76
  2. **Per-Category Breakdown** -- table: `category | files | tokens | status`.
71
77
  3. **Top 5 Largest Files** -- table: `path | tokens | category | status`.
72
78
  4. **Per-Skill Knowledge Cost** -- table: `skill | tokens` (sorted desc); include shared knowledge as a separate row labeled `(shared, loaded every time)`.
73
- 5. **Recommendations** -- numbered list from Step 5; if empty, render the healthy line.
74
- 6. **Excluded Scope Note** -- one paragraph reminding the user that framework files (`_framework/`, `mvt-*/SKILL.md`, `config.yaml`, `session.yaml`, `registry.yaml`) were not measured here.
79
+ 5. **Per-Project Token Accounting** -- table: `project | knowledge tokens | per-skill tokens | total` (only for multi-project workspaces; for single-project, omit this section).
80
+ 6. **Recommendations** -- numbered list from Step 5; if empty, render the healthy line.
81
+ 7. **Excluded Scope Note** -- one paragraph reminding the user that framework files (`_framework/`, `mvt-*/SKILL.md`, `config.yaml`, `session.yaml`, `registry.yaml`) were not measured here.
75
82
  - The report is conversation output; this skill does NOT write any artifact.
76
83
 
77
84
  ## Edge Cases & Errors
@@ -40,11 +40,6 @@ sections:
40
40
  - type: shared
41
41
  source: sections/activation-load-config.md
42
42
 
43
- - type: inline
44
- content: |
45
- ### Step 4: Pre-flight Checks
46
- - No blocking checks required.
47
-
48
43
  - type: file
49
44
  source: ./business.md
50
45
 
@@ -7,7 +7,7 @@
7
7
 
8
8
  For each `changes[]` entry with `status: done`:
9
9
  1. Compare `session.last_synced_at` with the change's `updated_at`.
10
- 2. If `last_synced_at` is empty OR `last_synced_at` < `updated_at`, mark the change as **⚠️ unsynced**.
10
+ 2. If `last_synced_at` is empty OR `last_synced_at` < `updated_at`, mark the change as **WARNING: unsynced**.
11
11
  3. Collect all unsynced change-ids into a warning list for display in Step 6.
12
12
 
13
13
  This check ensures `/mvt-sync-context` has processed a change's knowledge before cleanup archives it. Once archived, the original artifact files (`analysis.md`, `design.md`, `implementation.md`) are no longer accessible to sync-context.
@@ -31,6 +31,8 @@ This check ensures `/mvt-sync-context` has processed a change's knowledge before
31
31
  | Source | Rule | Proposed action |
32
32
  |--------|------|-----------------|
33
33
  | `changes[]` entry with `status: done` AND any task in plan is older than the active change's start | Summarize: generate a `summary.md` from the change's artifacts, then move the **entire** `artifacts/{id}/` directory (including `summary.md`) to `artifacts/_archived/{id}/` |
34
+ | `changes[]` entry with `status: done` AND `epic_id` non-empty AND parent epic status is NOT `done` | **Epic integrity warning**: mark the candidate as `epic-unsafe` -- archiving a sub-change whose parent epic is still in-progress may leave the epic in an inconsistent state. Default to `n` (skip) in the cleanup plan. User may override to force-archive. |
35
+ | Artifact directory under `artifacts/` whose id starts with `epic-` AND contains `epic.yaml` with `status: done` | **Batch archive candidate**: mark for batch suggestion in Step 7 -- read `epic.yaml.children[]` for child change-ids to offer as batch archive options alongside the epic |
34
36
  | Change-id directory marked `unindexed` | List for user review (do NOT auto-archive -- could be in-flight work the user just hasn't registered) |
35
37
  | `history` entries beyond the most recent N (from `config.yaml > preferences.history_limits.history`, default 20) | Truncate via `session-update.cjs --truncate-history <N>` |
36
38
  | Directory `knowledge/patterns/` exists | Flag for deletion (legacy pattern data; no replacement) |
@@ -55,7 +57,7 @@ This check ensures `/mvt-sync-context` has processed a change's knowledge before
55
57
  - `summarize` action (collapses multi-file content).
56
58
  - `archive` action (moves entire change-id directory into `artifacts/_archived/`).
57
59
  - If the Step 2 warning list is non-empty, prepend it to the confirmation prompt:
58
- > ⚠️ The following changes have NOT been synced by `/mvt-sync-context`. Archiving them will permanently lose their knowledge for aggregation:
60
+ > WARNING: The following changes have NOT been synced by `/mvt-sync-context`. Archiving them will permanently lose their knowledge for aggregation:
59
61
  > - {change-id}: {title}
60
62
  > Options: `y` = archive anyway, `n` = cancel, `sync-first` = abort and run `/mvt-sync-context` first, `show-details` = per-file breakdown.
61
63
  - If no unsynced warnings, use the standard prompt: `Apply cleanup plan? (y / n / show-details)`. `show-details` prints the per-file actions, then re-asks.
@@ -67,6 +69,16 @@ This check ensures `/mvt-sync-context` has processed a change's knowledge before
67
69
  - **How**:
68
70
  1. **Summarize action**: read the full set of files in the change-id directory; produce a `summary.md` with: title, change-id, status, key decisions (list each ADR/decision title), final outcomes, list of original files. Write `summary.md` into the change-id directory, then move the **entire** `artifacts/{id}/` directory to `artifacts/_archived/{id}/` (summary.md travels with it).
69
71
  2. **Archive action** (no summarize): move the **entire** `artifacts/{id}/` directory to `artifacts/_archived/{id}/`. No internal path restructuring needed.
72
+ 2a. **Batch archive action** (epic with children): when archiving a completed epic (the change-id is an epic directory containing `epic.yaml` with `status: done`), read `epic.yaml.children` and present the user with three options before proceeding:
73
+
74
+ | Option | Description |
75
+ |--------|-------------|
76
+ | Epic only | Archive only the epic directory (leave child change directories in place) |
77
+ | All children | Archive the epic directory AND move all child change directories (`artifacts/{child_id}/`) to `artifacts/_archived/{child_id}/` |
78
+ | Selective | User picks which children to include alongside the epic |
79
+
80
+ Per ADR-8: archive = abandon references; no post-archive `epic_id` integrity maintenance. Child changes that are also `status: done` are eligible for batch archiving; in-progress or pending children are excluded with a note.
81
+
70
82
  3. **Delete action**: remove only the items explicitly marked for deletion in the confirmed plan; never recurse beyond what was listed.
71
83
  4. **Stale history truncation**: call `session-update.cjs --truncate-history <N>` where N is from `config.yaml > preferences.history_limits.history` (default 20).
72
84
  5. All file mutations atomic where possible (write-temp + rename, copy-then-delete for moves).
@@ -104,3 +116,6 @@ Apply the State Update rules defined in the **State Update** section below.
104
116
  | File targeted for action no longer exists (concurrent removal) | Skip with a note; do not error out the whole run |
105
117
  | Unindexed change-id directory contains only `plan.yaml` | List as review-only; suggest user runs `/mvt-update-plan` or registers it via `/mvt-plan-dev` instead of cleaning |
106
118
  | `session.yaml.bak` present from a previous failed run | Overwrite during Step 7 collapse (only the most recent backup is useful) |
119
+ | Change with `epic_id` is a cleanup candidate but parent epic is still `in_progress` | Mark as `epic-unsafe`; default to skip. User may override to force-archive. Warn: "This change belongs to in-progress epic '{title}'. Archiving it separately may leave the epic in an inconsistent state." |
120
+ | Epic directory marked for batch archive but `epic.yaml` is missing or unreadable | Skip batch suggestion; treat as a regular archive candidate |
121
+ | Batch archive includes a child that is still `in_progress` | Exclude that child from the batch with a note: "Child {id} is in_progress and cannot be archived." |
@@ -54,6 +54,9 @@ sections:
54
54
  - type: shared
55
55
  source: sections/output-language-constraint.md
56
56
 
57
+ - type: shared
58
+ source: sections/output-format-constraint.md
59
+
57
60
  - type: shared
58
61
  source: sections/activation-preflight.md
59
62
  params:
@@ -38,10 +38,10 @@
38
38
 
39
39
  | Type | Validation |
40
40
  |------|------------|
41
- | `enum` | Value MUST be in the allowed list. Reject with the allowed list shown. For `language` enums (`en-US`, `zh-CN`), reject other locale strings -- ask user to pick from the allowed list (do not fuzzy-match) |
41
+ | `enum` | Value MUST be in the allowed list. Reject with the allowed list shown. For `language` enums (`en-US` = English, `zh-CN` = 简体中文), reject other locale strings -- ask user to pick from the allowed list (do not fuzzy-match) |
42
42
  | `bool` | Accept exactly `true` / `false` (case-insensitive). Reject `yes`/`1`/`y` |
43
43
  | `int` | Parse as integer; check range when range is documented (e.g., `relevance_threshold` must be 0-100) |
44
- | `list` | Parse as comma-separated tokens; for `knowledge.shared`, every token must be a registered knowledge id |
44
+ | `list` | Parse as comma-separated tokens; for knowledge map entries (`_all` and project keys), every token must be a registered knowledge id |
45
45
 
46
46
  3. **Preview**: render `key: <current> -> <new>` on a single line.
47
47
  4. **Confirm**: prompt `Apply this change? (y/n)`. Skip the prompt only if invocation included an explicit non-interactive flag (none currently exists, so always prompt).
@@ -72,10 +72,10 @@
72
72
  4. Backup current `config.yaml` to `config.yaml.bak` before writing.
73
73
  5. Write defaults atomically.
74
74
  6. Report the keys that changed.
75
- - Do NOT reset `knowledge.shared` to defaults if the user has added entries via `/mvt-manage-context` -- preserve user-added knowledge ids; only reset preferences. Surface this exception in the diff.
75
+ - Do NOT reset knowledge map entries (`_all`, project keys) to defaults if the user has added entries via `/mvt-manage-context` -- preserve user-added knowledge ids; only reset preferences. Surface this exception in the diff.
76
76
 
77
77
  ## Knowledge Inspection (sub-flow used by Interactive Menu and Show All)
78
- - **View**: list shared knowledge ids from `registry.yaml > knowledge.shared`, then per-skill knowledge ids grouped by skill (`registry.yaml > skills.*.knowledge`). Show token estimates from each entry's manifest if available.
78
+ - **View**: list global knowledge ids from `registry.yaml > knowledge._all` and project-specific ids from `knowledge.{projectName}`, then per-skill knowledge ids grouped by skill (`registry.yaml > skills.*.knowledge`). Show token estimates from each entry's manifest if available.
79
79
  - **Modify**: this skill does NOT mutate knowledge settings; defer to `/mvt-manage-context`. Print the suggested command (`/mvt-manage-context move`, `/mvt-manage-context add`, etc.) instead of doing the work here.
80
80
 
81
81
  ## Edge Cases & Errors
@@ -89,5 +89,5 @@
89
89
  | User aborts mid-wizard | No partial write; the temp values are discarded |
90
90
  | `.bak` from previous reset already exists | Overwrite (only the most recent backup is useful) |
91
91
  | Concurrent edit detected (mtime changed during preview->write) | Abort write, surface a message, ask user to re-run |
92
- | `set knowledge.shared <list>` includes unknown id | Reject with the list of valid ids from `registry.yaml` |
92
+ | `set knowledge._all <list>` (or project key) includes unknown id | Reject with the list of valid ids from `registry.yaml` |
93
93
  | `reset` invoked but `config.yaml` already matches defaults | Report "nothing to reset", do not write |
@@ -58,17 +58,14 @@ sections:
58
58
 
59
59
  - type: inline
60
60
  content: |
61
- ### Step 4: Pre-flight Checks
62
- - No blocking checks required (config is always accessible)
63
-
64
61
  ## Configuration Keys
65
62
 
66
63
  ### User Preferences
67
64
 
68
65
  | Key | Type | Default | Description |
69
66
  |-----|------|---------|-------------|
70
- | `preferences.interaction_language` | enum | `en-US` | Language for interactive output: chat replies, prompts, tables (en-US, zh-CN) |
71
- | `preferences.document_output_language` | enum | `en-US` | Language for persisted documents: artifacts, project-context.md (falls back to interaction_language) |
67
+ | `preferences.interaction_language` | enum | `en-US` | Language for interactive output: chat replies, prompts, tables. Values: `en-US` (English), `zh-CN` (简体中文) |
68
+ | `preferences.document_output_language` | enum | `en-US` | Language for persisted documents: artifacts, project-context.md (falls back to interaction_language). Values: `en-US` (English), `zh-CN` (简体中文) |
72
69
  | `preferences.output.no_emojis` | bool | `true` | Disable emojis in output |
73
70
  | `preferences.output.data_format` | enum | `yaml` | Data output format (yaml, json) |
74
71
  | `preferences.context_routing.relevance_threshold` | int | `70` | AI routing threshold for `/mvt-manage-context add` (0-100) |
@@ -79,7 +76,7 @@ sections:
79
76
 
80
77
  | Key | Type | Default | Description |
81
78
  |-----|------|---------|-------------|
82
- | `knowledge.shared` | list | `[core, project-context]` | Shared knowledge entries in registry.yaml, loaded by all skills |
79
+ | `knowledge._all` | list | `[core, project-context]` | Global knowledge entries in registry.yaml under `_all` key, loaded by all skills across all projects |
83
80
 
84
81
  - type: file
85
82
  source: ./business.md
@@ -50,7 +50,6 @@ Collect core metadata. Each field has an explicit constraint -- do not accept va
50
50
  | Purpose | One sentence | Will become the SKILL.md `## Purpose` section |
51
51
  | Category | One of: `workflow`, `shortcut`, `project`, `utility` | Drives how `/mvt-help` groups it |
52
52
  | Description | Third-person, includes what + when + how it differs | Will become the frontmatter `description` |
53
- | Dependencies | List of skill names that must run first, OR `none` | Becomes `depends_on` in registry |
54
53
  | Variants (optional) | List of flag/sub-mode entries | Becomes the Variants table |
55
54
 
56
55
  If the user is unsure on any field, propose a default and ask for confirmation rather than leaving it blank.
@@ -68,7 +67,7 @@ If the user is unsure on any field, propose a default and ask for confirmation r
68
67
  | Output template | `_templates/` | Persisted document that needs a stable structure | `_templates/{name}-output.md` |
69
68
 
70
69
  - **Reuse vs new**: before declaring a new shared resource, check existing skills' SKILL.md files and knowledge entries -- prefer reusing patterns that already exist.
71
- - **Output of this step**: a checklist `(name | category | purpose | path)` shown to user.
70
+ - **Output of this step**: a checklist `(name | purpose | path)` shown to user.
72
71
 
73
72
  ### Step 5: Design the Skill
74
73
  - **What**: produce a one-page outline before generating any file.
@@ -105,22 +104,11 @@ Append the skill entry to `.ai-agents/registry.yaml` > `skills` section:
105
104
 
106
105
  ```yaml
107
106
  {name}:
108
- agent: {agent}
109
107
  description: "{third-person description with trigger keywords}"
110
- path: .claude/skills/{name}/SKILL.md
111
- template: {template_path_or_null}
112
- category: {category}
113
- depends_on: {dependencies_or_omitted}
114
108
  custom: true
115
- knowledge:
116
- {entries_or_empty_list}
117
- next_suggestions:
118
- primary: {suggested_next_skill}
119
- primary_desc: "{when to use the next skill}"
120
109
  ```
121
110
 
122
111
  - The `custom: true` field is **required** for user-created skills; without it, framework updates will overwrite the entry.
123
- - If the skill has no specific knowledge needs, set `knowledge: []` or omit the key entirely.
124
112
  - Validate the YAML still parses after the append; if not, abort and surface the parse error.
125
113
 
126
114
  ### Step 8: Validation
@@ -226,7 +214,7 @@ Copy the following sections verbatim from this document (the assembled SKILL.md
226
214
  | Load Config | Load Config step within Activation Protocol | Copy as-is |
227
215
  | Output Language Constraint | Output Language Constraint step within Activation Protocol | Copy as-is |
228
216
  | Pre-flight Checks | Pre-flight Checks step within Activation Protocol | Replace `checks` table with skill-specific checks; if none required, use a single INFO row |
229
- | State Update | `## State Update` | Replace `/{name}` with the new skill's command; include `active_change` conditional block only if the skill creates changes; include `Shortcut Operation Rules` only if category is `shortcut` |
217
+ | State Update | `## State Update` | Replace `/{name}` with the new skill's command; include `active_change` conditional block only if the skill creates changes; include `Shortcut Operation Rules` if the user opted for shortcut semantics during Step 5 design |
230
218
  | Suggested Next Steps | `## Suggested Next Steps` | Replace `current_skill` with the new skill name; replace conditional suggestions with skill-appropriate ones |
231
219
 
232
220
  **Important**: Do NOT paraphrase or rewrite the standard sections. Copy them character-for-character from this document and only substitute the skill-specific values. This ensures consistency across all MVTT skills.
@@ -50,10 +50,8 @@ sections:
50
50
  - type: shared
51
51
  source: sections/output-language-constraint.md
52
52
 
53
- - type: inline
54
- content: |
55
- ### Step 4: Pre-flight Checks
56
- - No blocking checks required.
53
+ - type: shared
54
+ source: sections/output-format-constraint.md
57
55
 
58
56
  - type: file
59
57
  source: ./business.md
@@ -0,0 +1,94 @@
1
+ ## Execution Flow
2
+
3
+ ### Step 1: Load Requirements
4
+ - If file path provided as argument -> Read that file
5
+ - Otherwise -> Use requirements text from user message
6
+
7
+ ### Step 2: Lightweight Sanity Gate
8
+ - **What**: verify the input warrants epic-scale decomposition
9
+ - **How**: check whether the input is clearly a single-file or single-module change
10
+
11
+ | Signal | Verdict |
12
+ |--------|---------|
13
+ | Input describes 1 feature touching 1-3 files | Too small for epic |
14
+ | Input describes a cohesive system with 2+ independent capability domains | Epic-scale |
15
+ | Ambiguous | Ask user: decompose or redirect to `/mvt-analyze`? |
16
+
17
+ - **Branches**:
18
+
19
+ | Condition | Action |
20
+ |-----------|--------|
21
+ | Clearly epic-scale | Continue to Step 3 |
22
+ | Clearly too small | Suggest: "This looks like a standard change. Use `/mvt-analyze` instead? (y/n)" |
23
+ | Ambiguous | Offer choice: "Decompose as epic (2-8 children) or analyze as single change?" |
24
+
25
+ ### Step 3: Epic Analysis
26
+ - Extract the **vision**: one-sentence summary of the overall goal
27
+ - Define **scope and out-of-scope**: what the epic delivers vs. explicitly excludes
28
+ - Identify **cross-cutting concerns**: themes spanning multiple children (auth, logging, error handling, data migration)
29
+ - Identify **actors and stakeholders**
30
+
31
+ ### Step 4: Decompose into 2-8 Sub-changes
32
+ - **What**: break the epic into right-sized children, each suitable for one analyze-design-plan-implement cycle
33
+ - **Sizing rule**: each child should produce one deliverable capability slice, implementable in 3-10 plan tasks
34
+ - **For each child**, define:
35
+ - `change_id`: `{YYYYMMDD}-{slug}` format. Slug constraints: lowercase ASCII, kebab-case, `[a-z0-9-]+`, 1-4 words (e.g., `user-auth`, `catalog-search`)
36
+ - `title`: concise name
37
+ - `scope`: description of what this child delivers
38
+ - `depends_on`: list of `change_id` values this child depends on (empty for root children)
39
+ - `project`: project hint array. For single-project workspaces: use the sole project name from `project-context.yaml > projects[].name` (e.g., `["mvtt"]` in this workspace; do NOT hardcode `["default"]`). For multi-project workspaces: must match a project name from `project-context.yaml > projects[].name`; if uncertain, ask the user rather than guessing.
40
+ - **DAG constraints**:
41
+ - Dependencies must form a DAG (no cycles)
42
+ - Dependencies reference existing `change_id` values only
43
+ - Prefer shallow depth (wide parallelism) over deep chains
44
+ - **Validation**: if > 8 children needed, WARN and suggest narrowing the epic scope. If < 2 children, suggest using `/mvt-analyze` directly.
45
+
46
+ ### Step 5: Preview and Confirm
47
+ - **What**: show the decomposition result to the user before writing any files.
48
+ - **How**: display the following inline (conversation-only, no disk write yet):
49
+ 1. **Child story table**: the same table that will appear in `epic.md`
50
+ 2. **Dependency diagram**: Mermaid flowchart of child dependencies
51
+ 3. **Suggested starting child**: "Start with: `{first_child_title}` (`{first_child_id}`)"
52
+ - **Wait for user confirmation**: ask "Proceed with this decomposition? (y/n)". Default to **y** if the user does not respond.
53
+ - **On decline or revision request**: do NOT write any files. Revise the decomposition based on user feedback and re-present, or abort if the user chooses to cancel.
54
+ - **On confirmation**: proceed to Step 6.
55
+
56
+ ### Step 6: Write Artifacts
57
+ Write two artifacts using the `decompose-output` template for `epic.md`:
58
+
59
+ 1. **epic.md** (narrative) -- `.ai-agents/workspace/artifacts/{epic_id}/epic.md`
60
+ - Uses the `decompose-output` template.
61
+ - **Child Stories**: Markdown table mirroring `epic.yaml.children[]`
62
+
63
+ | # | Child | Scope | Status | Depends On |
64
+ |---|-------|-------|--------|------------|
65
+
66
+ - **Dependency Map**: Mermaid flowchart showing child dependencies
67
+
68
+ 2. **epic.yaml** (structured) -- `.ai-agents/workspace/artifacts/{epic_id}/epic.yaml`
69
+ - Follows the schema defined in Artifact Structure
70
+ - Set first child `status: active`, all others `status: pending`
71
+ - Set `current_change` to the first child's `change_id`
72
+
73
+ **Self-validation checklist** (verify before writing):
74
+ - [ ] All `change_id` values are unique
75
+ - [ ] All `depends_on` references exist in `children[]`
76
+ - [ ] No cycles in the dependency graph
77
+ - [ ] Exactly one child has `status: active`
78
+ - [ ] `current_change` matches the active child's `change_id`
79
+ - [ ] Each child has non-empty `title` and `scope`
80
+
81
+ **Optional safety net**: after writing, call `epic-update.cjs --validate` to verify:
82
+ ```bash
83
+ node .ai-agents/scripts/epic-update.cjs --validate .ai-agents/workspace/artifacts/{epic_id}/epic.yaml
84
+ ```
85
+
86
+ ### Step 7: Update Session
87
+ Run the session update command (see State Update section) to:
88
+ 1. Create a new `active_epic` in session.yaml
89
+ 2. Set the `epic_path` to the written `epic.yaml`
90
+
91
+ ### Step 8: Output
92
+ Display to the user:
93
+ 1. **Write confirmation**: "Epic created: `{epic_id}` at `{epic_path}`"
94
+ 2. **Suggested next step**: "Run `/mvt-analyze` to start the first child: `{first_child_title}` (`{first_child_id}`)"
@@ -0,0 +1,121 @@
1
+ name: mvt-decompose
2
+ output: .claude/skills/mvt-decompose/SKILL.md
3
+
4
+ frontmatter:
5
+ name: mvt-decompose
6
+ description: "Decompose epic-scale requirements into right-sized sub-changes with DAG dependencies. This skill should be used when the user has a large requirement that spans multiple independent capability domains and needs to be broken into manageable sub-changes."
7
+
8
+ sections:
9
+ - type: inline
10
+ content: |
11
+ # MVT Decompose
12
+
13
+ ## Purpose
14
+
15
+ Decompose epic-scale requirements into 2-8 right-sized sub-changes with explicit DAG dependencies, producing `epic.yaml` (structured) and `epic.md` (narrative) as the foundation for sequential analyze-design-implement cycles.
16
+
17
+ - type: shared
18
+ source: sections/role-header.md
19
+ params:
20
+ role: Strategist
21
+ role_desc: "an Epic Decomposition Strategist"
22
+ decision_rules:
23
+ - rule: "Epic-scale input -> Decompose into 2-8 sub-changes with DAG"
24
+ - rule: "Input too small for epic -> Redirect to /mvt-analyze"
25
+ - rule: "> 8 children needed -> Warn and suggest scope narrowing"
26
+ - rule: "Ambiguous boundaries -> Ask user to clarify before decomposing"
27
+ boundaries:
28
+ - scope: "implement code"
29
+ skill: "/mvt-implement"
30
+ - scope: "design architecture"
31
+ skill: "/mvt-design"
32
+ - scope: "analyze non-epic requirements"
33
+ skill: "/mvt-analyze"
34
+
35
+ - type: shared
36
+ source: sections/activation-load-context.md
37
+
38
+ - type: shared
39
+ source: sections/activation-load-config.md
40
+
41
+ - type: shared
42
+ source: sections/output-language-constraint.md
43
+
44
+ - type: shared
45
+ source: sections/output-format-constraint.md
46
+
47
+ - type: shared
48
+ source: sections/activation-preflight.md
49
+ params:
50
+ checks:
51
+ - order: "1"
52
+ field: "session.initialized_at"
53
+ level: "WARN"
54
+ message: 'Session not initialized. Run `/mvt-init` first.'
55
+ - order: "2"
56
+ field: "projects[] in project-context.yaml"
57
+ level: "WARN"
58
+ message: 'Project not initialized. Run `/mvt-init` first.'
59
+ - order: "3"
60
+ field: "active_change.id"
61
+ level: "WARN"
62
+ message: 'An active change already exists. Decomposing will create a new epic alongside it. Continue? (y/n)'
63
+
64
+ - type: file
65
+ source: ./business.md
66
+
67
+ - type: inline
68
+ content: |
69
+ ## Artifact Structure
70
+
71
+ **epic.md** (narrative):
72
+ Read the document structure template from: `.ai-agents/skills/_templates/decompose-output.md`
73
+ If a custom version exists at `.ai-agents/skills/_templates/custom/decompose-output.md`, use the custom version instead.
74
+ The template defines section headings only. Generate content for each section based on decomposition results.
75
+ Write to: `.ai-agents/workspace/artifacts/{epic_id}/epic.md`
76
+
77
+ **epic.yaml** (structured):
78
+ Write to: `.ai-agents/workspace/artifacts/{epic_id}/epic.yaml`
79
+ Schema:
80
+ ```yaml
81
+ version: 1
82
+ epic_id: "{epic_id}"
83
+ title: "{epic_title}"
84
+ created_at: "{ISO timestamp}"
85
+ updated_at: "{ISO timestamp}"
86
+ status: in_progress
87
+ vision: >
88
+ {epic vision summary}
89
+ current_change: "{first_active_child_id}"
90
+ children:
91
+ - change_id: "{YYYYMMDD}-{slug}"
92
+ title: "{child title}"
93
+ scope: >
94
+ {child scope description}
95
+ status: active # first child: active, rest: pending
96
+ depends_on: [] # DAG dependencies
97
+ project: ["<project-name>"] # use the sole project name from project-context.yaml > projects[].name
98
+ completed_at: null
99
+ ```
100
+
101
+ **epic-id format**: `epic-{YYYYMMDD}-{slug}` (e.g., `epic-20260608-ecommerce-platform`)
102
+
103
+ - type: shared
104
+ source: sections/session-update.md
105
+ params:
106
+ current_skill: mvt-decompose
107
+ new_epic: true
108
+ set_epic_path: true
109
+
110
+ - type: shared
111
+ source: sections/footer-next-steps.md
112
+ params:
113
+ current_skill: mvt-decompose
114
+ conditional_suggestions:
115
+ conditions:
116
+ - condition: "decomposition complete"
117
+ primary: "mvt-analyze"
118
+ primary_desc: "Start analyzing the first (active) sub-change"
119
+ - condition: "default"
120
+ primary: "mvt-analyze"
121
+ primary_desc: "Begin the analyze-design-implement cycle for the current child"
@@ -55,6 +55,9 @@ sections:
55
55
  - type: shared
56
56
  source: sections/output-language-constraint.md
57
57
 
58
+ - type: shared
59
+ source: sections/output-format-constraint.md
60
+
58
61
  - type: shared
59
62
  source: sections/activation-preflight.md
60
63
  params:
@@ -87,9 +87,24 @@
87
87
  | Multi-module | Touches >1 module or shared utility | List impacted modules, read each call site before editing, group by commit if possible |
88
88
  | Cross-architecture | Requires layering change, new dependency, or interface redesign | STOP -- recommend `/mvt-design` (or `/mvt-refactor` if behavior is preserved); do NOT implement here |
89
89
 
90
- - Identify regression risk: which existing tests cover this code? If none, decide whether to add a regression test in Step 7.
90
+ - Identify regression risk: which existing tests cover this code? If none, decide whether to add a regression test in Step 8.
91
91
 
92
- ### Step 6: User Confirmation
92
+ ### Step 6: Identify Project Scope and Load Project-Specific Knowledge
93
+
94
+ This step applies only when the workspace has multiple projects (`projects.length > 1` in `project-context.yaml`). In single-project workspaces, all relevant knowledge was loaded at activation; skip this step entirely.
95
+
96
+ - **Project identification**: match the file paths resolved in prior steps (from review findings, bug detection, or self-contained diagnosis) against `projects[].path` and `projects[].source_paths`:
97
+ - A file whose path starts with a project's `path` prefix belongs to that project.
98
+ - A file under a project's `source_paths` entry also belongs to that project.
99
+ - Collect the set of unique project names from all matched files. This is the **active project scope** for this invocation.
100
+ - **On-demand knowledge loading**: for each project P in the active project scope, read `.ai-agents/registry.yaml` and load:
101
+ 1. Every entry under `knowledge.{P}` -- load each entry's referenced files (resolve relative to `.ai-agents/{source}`).
102
+ 2. Every entry under `skills.mvt-fix.knowledge.{P}` -- load each entry's referenced files.
103
+ 3. Skip any key absent from the registry (no project-specific knowledge is valid; do not warn).
104
+ - **Multi-project scenario**: if affected files span multiple projects, load each project's knowledge sequentially. The skill operates with the union of all loaded project-specific knowledge plus the `_all` knowledge already loaded at activation.
105
+ - **Unmatched files**: if a file path does not match any project's `path` or `source_paths`, surface a note and treat it as belonging to the first project in `projects[]` (fallback). This may indicate a configuration gap in `project-context.yaml`.
106
+
107
+ ### Step 7: User Confirmation
93
108
  - **When to confirm before applying**:
94
109
  - Multi-module class or above.
95
110
  - The fix changes a public/exported symbol or a configuration default.
@@ -99,14 +114,14 @@
99
114
  - One-liner / single-file class AND fix is purely additive or correctional AND reproduction was verified.
100
115
  - **Confirmation prompt format**: present `Root cause: ...`, `Proposed change: <files + summary>`, `Risk: <regression scope>`, then ask `Apply? (y / n / show-diff)`.
101
116
 
102
- ### Step 7: Apply the Fix
117
+ ### Step 8: Apply the Fix
103
118
  - For source 1a (review.md): apply fixes per finding; re-run the review's relevant checks (not reproduction) to confirm each fix addresses its finding.
104
119
  - Make the targeted code change.
105
120
  - If no test covered the regression and the fix class is multi-module or above, add a minimal regression test alongside the fix.
106
121
  - Re-run the original repro (if any) to confirm resolution.
107
122
  - If repro still fails -> revert, return to Step 3 with the new evidence.
108
123
 
109
- ### Step 8: Write Fix Notes
124
+ ### Step 9: Write Fix Notes
110
125
  - **Path**: `.ai-agents/workspace/artifacts/{change-id}/fix-notes.md` if an `active_change` exists; otherwise inline in the conversation only (no artifact -- shortcut operation).
111
126
  - **Structure** (each section is a single paragraph or list):
112
127
  - `Symptom` -- what the user saw / reported.
@@ -118,7 +133,7 @@
118
133
  - `Regression risk` -- scope of behavior potentially affected, plus what tests guard it.
119
134
  - `Follow-ups` -- TODOs, deferred refactors, related issues.
120
135
 
121
- ### Step 9: State Update
136
+ ### Step 10: State Update
122
137
  Apply the State Update rules defined in the **State Update** section below.
123
138
 
124
139
  ## Edge Cases & Errors
@@ -128,6 +143,6 @@ Apply the State Update rules defined in the **State Update** section below.
128
143
  | Bug is intermittent / racy | Mark reproduction as "flaky", state confidence level explicitly, prefer adding instrumentation over speculative fix |
129
144
  | Fix would require breaking a downstream API | STOP -- escalate to `/mvt-design` or `/mvt-refactor`; do not silently break contracts |
130
145
  | Root cause is in a third-party dependency | Document the upstream issue, apply a minimal local workaround clearly labeled as temporary |
131
- | User aborts at Step 6 | Do not write fix notes; record the diagnosis as a comment in the conversation only |
146
+ | User aborts at Step 7 | Do not write fix notes; record the diagnosis as a comment in the conversation only |
132
147
  | Fix relies on changes the user has uncommitted in another branch | Surface the conflict before editing; do not overwrite |
133
148
  | `active_change` is missing entirely | Apply fix without writing artifact (shortcut mode), summarize result in conversation |
@@ -47,6 +47,9 @@ sections:
47
47
  - type: shared
48
48
  source: sections/output-language-constraint.md
49
49
 
50
+ - type: shared
51
+ source: sections/output-format-constraint.md
52
+
50
53
  - type: shared
51
54
  source: sections/activation-preflight.md
52
55
  params:
@@ -61,7 +64,7 @@ sections:
61
64
  ## Operation Mode: Shortcut
62
65
 
63
66
  This skill operates as a shortcut — it can execute at any time without checking workflow prerequisites.
64
- - Do NOT update `progress` (this is a shortcut operation, not a workflow phase).
67
+ - Do NOT update `active_change` (this is a shortcut operation, not a workflow phase).
65
68
 
66
69
  - type: file
67
70
  source: ./business.md
@@ -11,8 +11,9 @@
11
11
 
12
12
  | Condition | Recommendation |
13
13
  |-----------|---------------|
14
- | `session.yaml` missing or `initialized_at` empty | `/mvt-init` -- Initialize the project |
14
+ | `.ai-agents/workspace/session.yaml` missing or `initialized_at` empty | `/mvt-init` -- Initialize the project |
15
15
  | Initialized AND `project-context.md` does not exist | `/mvt-analyze-code` -- Analyze existing code |
16
+ | `active_epic.id` non-empty AND `active_change.id` empty (epic-pending) | `/mvt-analyze` -- Start the next sub-change in the epic |
16
17
  | No requirements (no `analysis.md` for active change AND no completed `/mvt-analyze` in `history`) | `/mvt-analyze` -- Analyze requirements |
17
18
  | No requirements, but user describes a simple change directly | `/mvt-quick-dev` -- Implement a simple change quickly |
18
19
  | Requirements present, no `design.md` | `/mvt-design` -- Design architecture |
@@ -25,14 +26,11 @@
25
26
 
26
27
  ### Step 3: Display Skills Catalog
27
28
  Read `registry.yaml` > `skills` section.
28
- Group skills by `category` field and display as tables:
29
- - `workflow` -> "Workflow Skills (sequential phases)"
30
- - `shortcut` -> "Shortcut Skills (anytime, no prerequisites)"
31
- - `project` -> "Project Management Skills"
32
- - `utility` -> "Utility Skills"
29
+ Display all skills as a single flat table (no grouping; the section comment headers in `registry.yaml` already group them by role for human readers):
30
+ - Header row: `Skill | Description`
33
31
 
34
32
  For each skill, show: `/{skill-name}` | `description` field from registry.
35
- Sort within each group by declaration order in registry.
33
+ Sort by declaration order in registry.
36
34
 
37
35
  ### Step 4: Show Workflow Diagram
38
36
  Display the standard workflow with current position highlighted:
@@ -45,6 +43,9 @@ flowchart LR
45
43
  E --> F[review] --> G[test]
46
44
 
47
45
  C -.->|simple change| Q[quick-dev]
46
+ C -.->|epic scale| DC[decompose]
47
+ DC --> C2[analyze<br/>epic-child]
48
+ C2 --> D
48
49
  ```
49
50
 
50
51
  Color-code based on current progress: green (done), yellow (current/recommended), gray (pending). The "current" node is whichever skill the Step 2 table recommended; "done" is determined by the same evidence the Step 2 table consumed.
@@ -56,7 +57,7 @@ Color-code based on current progress: green (done), yellow (current/recommended)
56
57
  | Question pattern | Response |
57
58
  |------------------|----------|
58
59
  | "What should I do next?" / no specific question | Repeat the Step 2 recommendation in one line, followed by a one-clause reason citing the matched condition |
59
- | "What does `/mvt-X` do?" / asks about a specific skill | Read the skill's metadata from `registry.yaml`, show: name, description, category, dependencies, knowledge entries (if any), template (if any). If the skill has a `path`, mention "see SKILL.md for the full procedure" -- do NOT inline the full SKILL.md content (too large) |
60
+ | "What does `/mvt-X` do?" / asks about a specific skill | Read the skill's metadata from `registry.yaml`, show: name, description, knowledge entries (if any), template (if any). Mention "see the skill's SKILL.md for the full procedure" -- do NOT inline the full SKILL.md content (too large) |
60
61
  | "Compare `/mvt-X` and `/mvt-Y`" | Pull descriptions from registry; if both are workflow skills, mention their relative position in the diagram |
61
62
  | Asks about something not in registry | Reply: "No skill matches that. Available skills: see catalog above." Do not invent skills |
62
63
 
@@ -69,4 +70,5 @@ Color-code based on current progress: green (done), yellow (current/recommended)
69
70
  | `changes[]` references a `plan_path` that no longer exists | Ignore for help purposes; do not warn -- `/mvt-status` is the right place for that |
70
71
  | User invokes `/mvt-help` while inside an active change with Critical review findings | Step 2's recommendation is `/mvt-fix`; surface this prominently above the catalog |
71
72
  | User asks about a custom skill (registry entry with `custom: true`) | Treat identically to built-ins; the only difference is showing `custom: true` in the metadata view |
72
- | Workflow diagram cannot be rendered (mermaid unsupported in environment) | Fall back to a textual flow: `init -> analyze-code -> analyze -> design -> [plan-dev] -> implement -> review -> test` |
73
+ | Workflow diagram cannot be rendered (mermaid unsupported in environment) | Fall back to a textual flow: `init -> analyze-code -> analyze -> [decompose (epic) -> analyze (epic-child)] -> design -> [plan-dev] -> implement -> review -> test` |
74
+ | Epic-pending state (`active_epic` non-empty, `active_change` empty) | Step 2's recommendation is `/mvt-analyze` to start the next sub-change; the decompose path is shown in the workflow diagram |
@@ -24,11 +24,6 @@ sections:
24
24
  - type: shared
25
25
  source: sections/activation-load-config.md
26
26
 
27
- - type: inline
28
- content: |
29
- ### Step 4: Pre-flight Checks
30
- - No blocking checks required.
31
-
32
27
  - type: file
33
28
  source: ./business.md
34
29