@uoyo/mvtt 2.0.0 → 2.2.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 (94) hide show
  1. package/dist/cli.js +2 -2
  2. package/dist/cli.js.map +1 -1
  3. package/dist/commands/update.d.ts +1 -1
  4. package/dist/commands/update.d.ts.map +1 -1
  5. package/dist/commands/update.js +18 -1
  6. package/dist/commands/update.js.map +1 -1
  7. package/dist/fs/core-manifest.d.ts +4 -3
  8. package/dist/fs/core-manifest.d.ts.map +1 -1
  9. package/dist/fs/core-manifest.js +5 -4
  10. package/dist/fs/core-manifest.js.map +1 -1
  11. package/dist/fs/materialize.d.ts +2 -0
  12. package/dist/fs/materialize.d.ts.map +1 -1
  13. package/dist/fs/materialize.js +6 -5
  14. package/dist/fs/materialize.js.map +1 -1
  15. package/dist/fs/registry-merge.d.ts +4 -3
  16. package/dist/fs/registry-merge.d.ts.map +1 -1
  17. package/dist/fs/registry-merge.js +5 -4
  18. package/dist/fs/registry-merge.js.map +1 -1
  19. package/dist/scripts/epic-update.cjs +235 -207
  20. package/dist/scripts/epic-update.md +57 -0
  21. package/dist/scripts/plan-update.cjs +224 -222
  22. package/dist/scripts/plan-update.md +68 -0
  23. package/dist/scripts/session-update.cjs +229 -210
  24. package/install-manifest.yaml +4 -0
  25. package/package.json +1 -1
  26. package/sources/defaults/config.yaml +5 -0
  27. package/sources/scripts/epic-update.js +73 -22
  28. package/sources/scripts/epic-update.md +57 -0
  29. package/sources/scripts/plan-update.js +56 -28
  30. package/sources/scripts/plan-update.md +68 -0
  31. package/sources/scripts/session-update.js +68 -24
  32. package/sources/sections/activation-protocol.md +46 -0
  33. package/sources/sections/footer-next-steps.md +1 -1
  34. package/sources/sections/language-constraint.md +3 -18
  35. package/sources/sections/output-format-constraint.md +6 -9
  36. package/sources/sections/role-header.md +1 -1
  37. package/sources/sections/script-usage-rule.md +32 -0
  38. package/sources/sections/session-update.md +30 -110
  39. package/sources/skills/mvt-analyze/business.md +1 -1
  40. package/sources/skills/mvt-analyze/manifest.yaml +13 -16
  41. package/sources/skills/mvt-analyze-code/business.md +3 -0
  42. package/sources/skills/mvt-analyze-code/manifest.yaml +11 -15
  43. package/sources/skills/mvt-bug-detect/manifest.yaml +3 -4
  44. package/sources/skills/mvt-check-context/business.md +2 -2
  45. package/sources/skills/mvt-check-context/manifest.yaml +3 -6
  46. package/sources/skills/mvt-cleanup/business.md +47 -11
  47. package/sources/skills/mvt-cleanup/manifest.yaml +12 -13
  48. package/sources/skills/mvt-config/business.md +45 -49
  49. package/sources/skills/mvt-config/manifest.yaml +21 -25
  50. package/sources/skills/mvt-create-skill/business.md +15 -11
  51. package/sources/skills/mvt-create-skill/manifest.yaml +6 -9
  52. package/sources/skills/mvt-decompose/business.md +21 -9
  53. package/sources/skills/mvt-decompose/manifest.yaml +15 -17
  54. package/sources/skills/mvt-design/business.md +35 -44
  55. package/sources/skills/mvt-design/manifest.yaml +13 -15
  56. package/sources/skills/mvt-fix/business.md +7 -1
  57. package/sources/skills/mvt-fix/manifest.yaml +9 -13
  58. package/sources/skills/mvt-help/business.md +20 -9
  59. package/sources/skills/mvt-help/manifest.yaml +7 -18
  60. package/sources/skills/mvt-implement/business.md +27 -34
  61. package/sources/skills/mvt-implement/manifest.yaml +12 -21
  62. package/sources/skills/mvt-init/manifest.yaml +10 -13
  63. package/sources/skills/mvt-manage-context/business.md +4 -2
  64. package/sources/skills/mvt-manage-context/manifest.yaml +3 -6
  65. package/sources/skills/mvt-plan-dev/business.md +20 -8
  66. package/sources/skills/mvt-plan-dev/manifest.yaml +13 -17
  67. package/sources/skills/mvt-quick-dev/business.md +1 -1
  68. package/sources/skills/mvt-quick-dev/manifest.yaml +3 -4
  69. package/sources/skills/mvt-refactor/business.md +1 -1
  70. package/sources/skills/mvt-refactor/manifest.yaml +3 -4
  71. package/sources/skills/mvt-resume/business.md +3 -3
  72. package/sources/skills/mvt-resume/manifest.yaml +10 -13
  73. package/sources/skills/mvt-review/business.md +12 -11
  74. package/sources/skills/mvt-review/manifest.yaml +17 -18
  75. package/sources/skills/mvt-status/business.md +12 -21
  76. package/sources/skills/mvt-status/manifest.yaml +7 -10
  77. package/sources/skills/mvt-sync-context/business.md +20 -18
  78. package/sources/skills/mvt-sync-context/manifest.yaml +11 -15
  79. package/sources/skills/mvt-template/business.md +5 -5
  80. package/sources/skills/mvt-template/manifest.yaml +3 -6
  81. package/sources/skills/mvt-test/business.md +11 -11
  82. package/sources/skills/mvt-test/manifest.yaml +15 -18
  83. package/sources/skills/mvt-update-plan/business.md +18 -29
  84. package/sources/skills/mvt-update-plan/manifest.yaml +18 -16
  85. package/sources/templates/analyze-output/body.md +41 -0
  86. package/sources/templates/decompose-output/body.md +36 -0
  87. package/sources/templates/design-output/body.md +48 -0
  88. package/sources/templates/implement-output/body.md +48 -3
  89. package/sources/templates/project-context/body.md +45 -0
  90. package/sources/templates/review-output/body.md +59 -0
  91. package/sources/templates/test-output/body.md +72 -0
  92. package/sources/sections/activation-load-config.md +0 -11
  93. package/sources/sections/activation-load-context.md +0 -59
  94. package/sources/sections/activation-preflight.md +0 -14
@@ -1,57 +1,62 @@
1
1
  ## Execution Flow
2
2
 
3
+ `/mvt-config` takes no arguments. Every invocation opens the Interactive Menu (Step 2); all actions -- viewing settings, editing a key, and guided setup -- are reached from there. There is no `set` / `show` / `wizard` / `reset` invocation form.
4
+
3
5
  ### Step 1: Load Inputs
6
+ - **Required**:
7
+ - `.ai-agents/config.yaml` -- the configuration to inspect and edit.
4
8
  - **Recommended**:
5
- - `.ai-agents/knowledge/core/manifest.yaml` -- only when computing token estimates for shared knowledge view.
9
+ - `.ai-agents/knowledge/core/manifest.yaml` -- only when computing token estimates for the shared knowledge view.
6
10
  - **Fallback**: if `config.yaml` is missing, surface the error and recommend `mvtt install` or `/mvt-init`. Do not silently create a fresh config from this skill.
7
11
 
8
- ### Step 2: Dispatch by Mode
9
- - **What**: pick the operating mode from the user's invocation.
10
- - **How**:
11
-
12
- | Invocation | Mode | Go to |
13
- |------------|------|-------|
14
- | `/mvt-config` (no args) | Interactive Menu | Step 3 |
15
- | `/mvt-config show` | Show All | Step 4 |
16
- | `/mvt-config set {key} {value}` | Direct Set | Step 5 |
17
- | `/mvt-config wizard` | Guided Wizard | Step 6 |
18
- | `/mvt-config reset` | Reset | Step 7 |
19
- | Anything else | Refuse, print Variants table, stop | -- |
20
-
21
- ### Step 3: Interactive Menu
22
- 1. Read current `config.yaml` and render a numbered menu grouped by category (User Preferences, Knowledge Settings, etc.) with current values inline.
23
- 2. Wait for user to select a category number (or `q` to quit).
24
- 3. Show the category detail view: keys with current values, type, default, allowed values.
25
- 4. Let user pick a key to edit; reuse Step 5 (Direct Set) sub-flow for validation, preview, confirmation, write.
26
- 5. After write, return to the top-level menu until user quits.
27
- 6. No write happens unless the Step 5 sub-flow confirms.
28
-
29
- ### Step 4: Show All
12
+ ### Step 2: Interactive Menu (entry point)
13
+ 1. Read current `config.yaml`.
14
+ 2. Render the top-level menu with these actions:
15
+
16
+ | # | Action | Goes to |
17
+ |---|--------|---------|
18
+ | 1 | View all settings | Step 3 |
19
+ | 2 | Edit a setting | Step 4 |
20
+ | 3 | Guided setup (walk through common settings) | Step 5 |
21
+ | `q` | Quit | -- exit, no write |
22
+
23
+ 3. Wait for the user's selection. Re-render the menu after any action completes, until the user quits.
24
+ 4. On an unrecognized selection, re-print the menu and prompt again. Do not exit.
25
+ 5. No write happens unless the user confirms -- either in the Edit sub-flow (Step 4) or at the Guided-setup summary (Step 5).
26
+
27
+ ### Step 3: View All
30
28
  - Print every key with `current value | type | default`. Mark values that differ from default with a `*`.
31
- - Print the Configuration Keys reference table (provided in shared section above) below the values, for context.
32
- - No write.
29
+ - Print the Configuration Keys reference table (provided in the shared section above) below the values, for context.
30
+ - No write. Return to the top-level menu (Step 2).
33
31
 
34
- ### Step 5: Direct Set (`set {key} {value}`)
35
- 1. **Validate key exists**:
36
- - The key must match one of the rows in the Configuration Keys table. If not, print "Unknown key: <name>", list available keys, exit without writing.
32
+ ### Step 4: Edit a Setting
33
+ 1. Render a numbered list of editable keys grouped by category (User Preferences, etc.) with current values inline.
34
+ 2. Wait for the user to select a key (or `b` to go back to the top-level menu).
35
+ 3. Show the key detail: current value, type, default, allowed values.
36
+ 4. Run the **Edit sub-flow** (below) for the selected key.
37
+ 5. After the sub-flow completes (write or cancel), return to the editable-key list, then to the top-level menu.
38
+
39
+ #### Edit sub-flow (validate -> preview -> confirm -> write)
40
+ Used by Step 4 and by each stage of Step 5.
41
+
42
+ 1. **Validate key exists**: the key must match one of the rows in the Configuration Keys table. If not, report it and return without writing.
37
43
  2. **Validate value type and constraints**:
38
44
 
39
45
  | Type | Validation |
40
46
  |------|------------|
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) |
47
+ | `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 the user to pick from the allowed list (do not fuzzy-match) |
42
48
  | `bool` | Accept exactly `true` / `false` (case-insensitive). Reject `yes`/`1`/`y` |
43
49
  | `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 map entries (`_all` and project keys), every token must be a registered knowledge id |
45
50
 
46
51
  3. **Preview**: render `key: <current> -> <new>` on a single line.
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).
52
+ 4. **Confirm**: prompt `Apply this change? (y/n)`. On `n`, discard and return.
48
53
  5. **Write atomically**:
49
54
  - Read the current file, mutate only the targeted key, preserve all other content and formatting (do NOT rewrite the whole file from a template -- the user may have comments).
50
55
  - Write to a temp file in the same directory, then rename. On any error, do not touch the original.
51
56
  6. Report the new value and a one-line "what this affects" hint (e.g., "applies to subsequent skill invocations").
52
57
 
53
- ### Step 6: Guided Wizard
54
- - Walk the user through these stages in order. Each stage uses the Step 5 validation rules. Defer the actual write to the end.
58
+ ### Step 5: Guided Setup
59
+ - Selected from the top-level menu. Walk the user through these stages in order. Each stage uses the Edit sub-flow's validation rules. Defer the actual write to the end.
55
60
 
56
61
  | Stage | Key | Notes |
57
62
  |-------|-----|-------|
@@ -61,20 +66,13 @@
61
66
  | 4 | `preferences.output.data_format` | Default `yaml`; allowed: `yaml`, `json` |
62
67
  | 5 | `preferences.context_routing.relevance_threshold` | Default `70`; allowed: 0-100 |
63
68
  | 6 | `preferences.history_limits.*` | Show each limit with current value; accept new int or Enter to keep |
69
+ | 7 | `preferences.planning.granularity` | Default `medium`; allowed: `coarse`, `medium`, `fine` |
64
70
 
65
71
  - After all stages, render a Summary Preview table: `key | from | to`, then a single confirmation prompt to apply ALL changes atomically.
66
72
  - If the user aborts at the summary, discard all in-progress values; do not write anything.
73
+ - After applying (or aborting), return to the top-level menu (Step 2).
67
74
 
68
- ### Step 7: Reset
69
- 1. Build the diff between current `config.yaml` and framework defaults: list every key that will revert.
70
- 2. Render the diff as `key | current | will-become-default`.
71
- 3. Require explicit confirmation: `Reset all settings to defaults? (y/n)`.
72
- 4. Backup current `config.yaml` to `config.yaml.bak` before writing.
73
- 5. Write defaults atomically.
74
- 6. Report the keys that changed.
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
-
77
- ## Knowledge Inspection (sub-flow used by Interactive Menu and Show All)
75
+ ## Knowledge Inspection (sub-flow used by View All and Edit a Setting)
78
76
  - **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
77
  - **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
78
 
@@ -84,10 +82,8 @@
84
82
  |------|----------|
85
83
  | `config.yaml` missing | STOP; recommend `mvtt install` or `/mvt-init` |
86
84
  | `config.yaml` exists but unparseable YAML | Surface error with line number; refuse to write; recommend manual fix or `mvtt install --refresh` |
87
- | User runs `set` with a deprecated key (`preferences.language`) | Print migration hint: `Run mvtt update --migrate-config` to split into the two language fields. Do not mutate the deprecated key |
88
- | Wizard stage receives an empty value | Treat as "accept default for this stage", continue |
89
- | User aborts mid-wizard | No partial write; the temp values are discarded |
90
- | `.bak` from previous reset already exists | Overwrite (only the most recent backup is useful) |
85
+ | Editing a deprecated key (`preferences.language`) | Print migration hint: `Run mvtt update --migrate-config` to split into the two language fields. Do not mutate the deprecated key |
86
+ | Guided-setup stage receives an empty value | Treat as "accept default for this stage", continue |
87
+ | User aborts mid guided-setup | No partial write; the temp values are discarded |
91
88
  | Concurrent edit detected (mtime changed during preview->write) | Abort write, surface a message, ask user to re-run |
92
- | `set knowledge._all <list>` (or project key) includes unknown id | Reject with the list of valid ids from `registry.yaml` |
93
- | `reset` invoked but `config.yaml` already matches defaults | Report "nothing to reset", do not write |
89
+ | User asks to edit `knowledge._all` or any knowledge map key | Refuse and route to `/mvt-manage-context`; this skill inspects knowledge settings but does not mutate them |
@@ -12,7 +12,7 @@ sections:
12
12
 
13
13
  ## Purpose
14
14
 
15
- Manage MVTT framework configuration interactively. Provide guided setup, direct key-value setting, and a setup wizard for common configurations.
15
+ Manage MVTT framework configuration through an interactive menu: view all settings, edit an individual key, or run a guided setup for common configurations.
16
16
 
17
17
  - type: shared
18
18
  source: sections/role-header.md
@@ -20,13 +20,12 @@ sections:
20
20
  role: Conductor
21
21
  role_desc: "a Workflow Coordinator"
22
22
  decision_rules:
23
- - rule: "No arguments -> Show interactive configuration menu"
24
- - rule: "`show` argument -> Display all current settings"
25
- - rule: "`set {key} {value}` -> Validate and apply the specific setting"
26
- - rule: "`wizard` argument -> Start guided setup flow"
27
- - rule: "`reset` argument -> Reset all settings to defaults after confirmation"
28
- - rule: "Invalid key -> Show available keys and exit"
29
- - rule: "Invalid value type -> Show expected type and exit"
23
+ - rule: "Any invocation -> Open the interactive configuration menu (this skill takes no arguments)"
24
+ - rule: "Menu: View all settings -> Display every key with current value, type, default"
25
+ - rule: "Menu: Edit a setting -> Pick a key, validate, preview, confirm, write"
26
+ - rule: "Menu: Guided setup -> Walk common settings in order, apply atomically at the end"
27
+ - rule: "Invalid key -> Show available keys and return to the menu"
28
+ - rule: "Invalid value type -> Show expected type and re-prompt"
30
29
  boundaries:
31
30
  - scope: "analyze requirements"
32
31
  skill: "/mvt-analyze"
@@ -37,25 +36,22 @@ sections:
37
36
 
38
37
  - type: inline
39
38
  content: |
40
- ## Variants
39
+ ## Usage
41
40
 
42
- | Variant | Description |
43
- |---------|-------------|
44
- | `/mvt-config` | Show interactive configuration menu |
45
- | `/mvt-config show` | Display all current settings |
46
- | `/mvt-config set {key} {value}` | Set a specific configuration value |
47
- | `/mvt-config wizard` | Start guided setup wizard |
48
- | `/mvt-config reset` | Reset all settings to defaults |
41
+ `/mvt-config` takes no arguments. It always opens an interactive menu; all actions are reached from there.
42
+
43
+ | Menu action | Description |
44
+ |-------------|-------------|
45
+ | View all settings | Display every configuration key with its current value, type, and default |
46
+ | Edit a setting | Pick a key, then validate, preview, confirm, and write the change |
47
+ | Guided setup | Walk through common settings in order and apply them atomically |
49
48
 
50
49
  - type: shared
51
- source: sections/activation-load-context.md
50
+ source: sections/activation-protocol.md
52
51
  params:
53
52
  extended_context:
54
53
  - ".ai-agents/config.yaml -- Current configuration (this skill's primary target)"
55
54
 
56
- - type: shared
57
- source: sections/activation-load-config.md
58
-
59
55
  - type: shared
60
56
  source: sections/language-constraint.md
61
57
 
@@ -72,14 +68,14 @@ sections:
72
68
  | `preferences.output.no_emojis` | bool | `true` | Disable emojis in output |
73
69
  | `preferences.output.data_format` | enum | `yaml` | Data output format (yaml, json) |
74
70
  | `preferences.context_routing.relevance_threshold` | int | `70` | AI routing threshold for `/mvt-manage-context add` (0-100) |
75
- | `preferences.history_limits.history` | int | `20` | Max history entries (1-100) |
76
- | `preferences.history_limits.changes` | int | `20` | Max changes entries (1-100) |
71
+ | `preferences.history_limits.history` | int | `10` | Max history entries (1-100) |
72
+ | `preferences.history_limits.changes` | int | `10` | Max changes entries (1-100) |
73
+ | `preferences.context_thresholds.*` | map | built-in thresholds | Optional context health thresholds read by `/mvt-check-context`; omitted keys use built-in defaults |
74
+ | `preferences.planning.granularity` | enum | `medium` | Task decomposition granularity for `/mvt-plan-dev`. Qualitative AI guidance, not hard limits. Values: `coarse` (fewer, larger tasks), `medium` (balanced), `fine` (more, smaller tasks) |
77
75
 
78
76
  ### Knowledge Settings
79
77
 
80
- | Key | Type | Default | Description |
81
- |-----|------|---------|-------------|
82
- | `knowledge._all` | list | `[core, project-context]` | Global knowledge entries in registry.yaml under `_all` key, loaded by all skills across all projects |
78
+ Knowledge routing is managed by `/mvt-manage-context`, not by `/mvt-config`. Requests to change `knowledge.*` keys must be refused and routed there.
83
79
 
84
80
  - type: file
85
81
  source: ./business.md
@@ -45,7 +45,7 @@ Collect core metadata. Each field has an explicit constraint -- do not accept va
45
45
 
46
46
  | Field | Constraint | Notes |
47
47
  |-------|------------|-------|
48
- | Name | Lowercase, kebab-case, no spaces. Prefix `mvt-` for framework skills; project-specific prefixes (e.g., `app-`, `proj-`) are also acceptable | Reject if conflicts with an existing entry in `registry.yaml` |
48
+ | Name | Lowercase, kebab-case, no spaces, must match `^[a-z][a-z0-9-]*$`. Prefix `mvt-` for framework skills; project-specific prefixes (e.g., `app-`, `proj-`) are also acceptable | Reject if invalid or if it conflicts with an existing entry in `registry.yaml` |
49
49
  | Agent role | One of: `conductor`, `analyst`, `architect`, `developer`, `reviewer`, `tester` | Maps the skill to an existing role family |
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 |
@@ -77,7 +77,7 @@ If the user is unsure on any field, propose a default and ask for confirmation r
77
77
  |--------|----------|
78
78
  | Input parameters | What does the skill need from the user / workspace? |
79
79
  | Execution mode | Interactive / automated / hybrid |
80
- | Pre-flight checks | List, with severity (BLOCK / WARN); defer to `activation-preflight.md` shared section |
80
+ | Pre-flight checks | List, with severity (BLOCK / WARN); these populate the Pre-flight part of the Activation Protocol copied into the generated SKILL.md |
81
81
  | Decision rules (in role-header) | 3-7 imperative rules covering the major branches |
82
82
  | Boundaries | What is in-scope vs delegated to other skills |
83
83
  | Execution Flow steps | Bulleted titles only (full content comes in Step 6) |
@@ -86,7 +86,7 @@ If the user is unsure on any field, propose a default and ask for confirmation r
86
86
  ### Step 6: Generate Skill Files
87
87
  1. Create skill directory: `.claude/skills/{name}/`.
88
88
  2. Generate a complete `SKILL.md` file (see Generated SKILL.md Structure below). This file must be fully self-contained — there is no assembler or build step to resolve shared section references. All content must be inlined directly into the SKILL.md.
89
- 3. For standard sections (Activation Protocol, Load Config, Language Constraint, Pre-flight, State Update, Next Steps), copy them verbatim from this document's own SKILL.md and substitute only the skill-specific values (role, decision rules, boundaries, pre-flight checks, next-skill suggestions). Do NOT paraphrase standard sections copy character-for-character to ensure consistency.
89
+ 3. For standard sections (Activation Protocol, Language Constraint, Output Format Constraint, State Update, Next Steps), read the existing shared section files under `.ai-agents/sections/` or the corresponding installed skill section and substitute only the skill-specific values (role, decision rules, boundaries, pre-flight checks, next-skill suggestions). Do NOT reproduce these sections from memory; use the checked-in source text as the canonical template.
90
90
  4. For skill-specific sections (frontmatter, Purpose, Execution Flow, Edge Cases & Errors), generate fresh content following the skeleton below.
91
91
  - `## Execution Flow`
92
92
  - `### Step 1: Load Inputs` -- list required and recommended files, plus fallback rules.
@@ -100,16 +100,21 @@ If the user is unsure on any field, propose a default and ask for confirmation r
100
100
  7. SKILL.md word budget: aim for the body to be under ~5k words. Push reference material to `references/`.
101
101
 
102
102
  ### Step 7: Register in Registry (MANDATORY)
103
- Append the skill entry to `.ai-agents/registry.yaml` > `skills` section:
103
+ Create a pre-write backup of `.ai-agents/registry.yaml`, then add the skill entry to `.ai-agents/registry.yaml` > `skills` section using structured YAML serialization (not hand-written string concatenation):
104
104
 
105
105
  ```yaml
106
106
  {name}:
107
107
  description: "{third-person description with trigger keywords}"
108
108
  custom: true
109
+ template: "_templates/{name}-output.md" # include ONLY if an output template was created in Step 6; omit this key otherwise
109
110
  ```
110
111
 
112
+ - If an output template was created in Step 6, set `template:` to its path so `/mvt-template` can discover it; otherwise omit the key entirely.
111
113
  - The `custom: true` field is **required** for user-created skills; without it, framework updates will overwrite the entry.
112
- - Validate the YAML still parses after the append; if not, abort and surface the parse error.
114
+ - Refuse to overwrite an existing skill key.
115
+ - Escape `description` through the YAML serializer; never interpolate raw user text into YAML.
116
+ - Validate the YAML still parses after the write; if not, restore the backup and surface the parse error.
117
+ - Post-write, assert the skills entry count increased by exactly 1 and no existing sibling skill entry changed.
113
118
 
114
119
  ### Step 8: Validation
115
120
  Walk this checklist; any failed item must be fixed before declaring success.
@@ -150,7 +155,7 @@ Apply the State Update rules defined in the **State Update** section below.
150
155
  | Skill duplicates an existing skill's responsibility | Surface the overlap (cite the existing skill's description); propose merging or sub-classing as a variant rather than creating a duplicate |
151
156
  | User provides a non-third-person description ("Use this skill when you need...") | Rewrite to third-person before saving; show the rewrite for confirmation |
152
157
  | Generated SKILL.md is missing a standard section (e.g., State Update, Next Steps) | Abort generation; inform user which section is missing; read an existing SKILL.md for the correct structure |
153
- | `registry.yaml` parse fails after append | Restore from a pre-append backup; surface the error; do not leave the registry corrupt |
158
+ | `registry.yaml` parse fails after write | Restore from the pre-write backup; surface the error; do not leave the registry corrupt |
154
159
 
155
160
  ## Generated SKILL.md Structure
156
161
 
@@ -210,11 +215,10 @@ Copy the following sections verbatim from this document (the assembled SKILL.md
210
215
 
211
216
  | Section | Source in this document | What to replace |
212
217
  |---------|----------------------|-----------------|
213
- | Activation Protocol | `## Activation Protocol` | Add `extended_context` entries if the skill needs additional context sources; otherwise copy as-is |
214
- | Load Config | Load Config step within Activation Protocol | Copy as-is |
215
- | Language Constraint | Language Constraint step within Activation Protocol | Copy as-is |
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 |
218
+ | Activation Protocol | `## Activation Protocol` (the whole Load + Resolve block) | Copy the entire block as-is. The block already covers context loading, project scope, knowledge, config preferences, and pre-flight. Adjust only two skill-specific parts: under Load, the Extended Context entries (add the files/directives this skill needs, or drop the Extended Context bullet if none); under Resolve > Pre-flight, the checks table (skill-specific checks, or a single INFO row if none required) |
219
+ | Language Constraint | `## Language Constraint` | Copy as-is (separate section, not part of Activation Protocol) |
220
+ | Output Format Constraint | `## Output Format Constraint` | Copy as-is (separate section); include only if the skill writes persisted markdown |
217
221
  | 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 |
218
222
  | Suggested Next Steps | `## Suggested Next Steps` | Replace `current_skill` with the new skill name; replace conditional suggestions with skill-appropriate ones |
219
223
 
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.
224
+ **Important**: Do NOT paraphrase or rewrite the standard sections. Load them from the checked-in shared section sources or a selected installed exemplar and only substitute the skill-specific values. This ensures consistency across all MVTT skills.
@@ -28,25 +28,22 @@ sections:
28
28
  - rule: "Usage patterns unclear -> Ask for concrete examples before proceeding"
29
29
  boundaries:
30
30
  - scope: "generate skills that deviate from MVTT SKILL.md standard structure"
31
- skill: "the standard structure as documented"
31
+ guidance: "follow the standard structure as documented"
32
32
  - scope: "use arbitrary prefixes without validating naming conventions"
33
- skill: "`mvt-` or a project-specific prefix like `app-`, `proj-`"
33
+ guidance: "use `mvt-` or a project-specific prefix like `app-`, `proj-`"
34
34
  - scope: "create skills without registering in registry.yaml"
35
- skill: "`custom: true` in registry.yaml"
35
+ guidance: "register with `custom: true` in registry.yaml"
36
36
  - scope: "write vague or first-person descriptions"
37
- skill: "third-person with effective trigger keywords"
37
+ guidance: "write third-person with effective trigger keywords"
38
38
  - scope: "exceed ~5k words in SKILL.md body"
39
- skill: "references/ for detailed content"
39
+ guidance: "push detailed content to references/"
40
40
 
41
41
  - type: shared
42
- source: sections/activation-load-context.md
42
+ source: sections/activation-protocol.md
43
43
  params:
44
44
  extended_context:
45
45
  - "Load one existing SKILL.md as structural reference (e.g., `.claude/skills/mvt-status/SKILL.md`)"
46
46
 
47
- - type: shared
48
- source: sections/activation-load-config.md
49
-
50
47
  - type: shared
51
48
  source: sections/language-constraint.md
52
49
 
@@ -54,16 +54,13 @@
54
54
  - **On confirmation**: proceed to Step 6.
55
55
 
56
56
  ### Step 6: Write Artifacts
57
- Write two artifacts using the `decompose-output` template for `epic.md`:
57
+ Write two artifacts:
58
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
- |---|-------|-------|--------|------------|
59
+ Before writing, derive `epic_id` and check whether `.ai-agents/workspace/artifacts/{epic_id}/` already exists. If it exists, do NOT overwrite it; warn the user and ask for a disambiguating slug, then re-run the preview from Step 5 with the new id.
65
60
 
66
- - **Dependency Map**: Mermaid flowchart showing child dependencies
61
+ 1. **epic.md** (narrative) -- `.ai-agents/workspace/artifacts/{epic_id}/epic.md`
62
+ - Uses the `decompose-output` template. Follow the HTML comments in the template for what each section should contain (including the Child Stories table format and the Dependency Map mermaid flowchart); strip comments from the final artifact.
63
+ - **Required coverage**: cover only content that is applicable to this decomposition. Preserve enough information for the user to understand the epic vision, boundaries, cross-cutting concerns, child stories, dependencies, and unresolved questions. Do not create empty or artificial sections just because an item is named here; if the template omits or renames a section, place applicable content in the closest relevant section.
67
64
 
68
65
  2. **epic.yaml** (structured) -- `.ai-agents/workspace/artifacts/{epic_id}/epic.yaml`
69
66
  - Follows the schema defined in Artifact Structure
@@ -72,17 +69,32 @@ Write two artifacts using the `decompose-output` template for `epic.md`:
72
69
 
73
70
  **Self-validation checklist** (verify before writing):
74
71
  - [ ] All `change_id` values are unique
72
+ - [ ] `.ai-agents/workspace/artifacts/{epic_id}/` does not already exist
75
73
  - [ ] All `depends_on` references exist in `children[]`
76
74
  - [ ] No cycles in the dependency graph
77
75
  - [ ] Exactly one child has `status: active`
78
76
  - [ ] `current_change` matches the active child's `change_id`
79
77
  - [ ] Each child has non-empty `title` and `scope`
80
78
 
81
- **Optional safety net**: after writing, call `epic-update.cjs --validate` to verify:
79
+ **Optional safety net**: after writing, validate the epic using the Epic Update Script command below:
82
80
  ```bash
83
81
  node .ai-agents/scripts/epic-update.cjs --validate .ai-agents/workspace/artifacts/{epic_id}/epic.yaml
84
82
  ```
85
83
 
84
+ If the epic needs children added later (e.g. a missed sub-change discovered during analysis), use `--add-child`:
85
+ ```bash
86
+ node .ai-agents/scripts/epic-update.cjs --epic .ai-agents/workspace/artifacts/{epic_id}/epic.yaml \
87
+ --add-child <new_child_id> --child-title "<title>" --child-scope "<scope>"
88
+ ```
89
+
90
+ To advance the epic after a child change completes, use `--complete-child`:
91
+ ```bash
92
+ node .ai-agents/scripts/epic-update.cjs --epic .ai-agents/workspace/artifacts/{epic_id}/epic.yaml \
93
+ --complete-child <completed_child_id>
94
+ ```
95
+
96
+ For post-write epic mutations, use the rendered `epic-update.cjs` commands. Do NOT hand-edit `epic.yaml`, advance `current_change`, or read `.cjs`/`.js` source.
97
+
86
98
  ### Step 7: Update Session
87
99
  Run the session update command (see State Update section) to:
88
100
  1. Create a new `active_epic` in session.yaml
@@ -33,33 +33,31 @@ sections:
33
33
  skill: "/mvt-analyze"
34
34
 
35
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/language-constraint.md
43
-
44
- - type: shared
45
- source: sections/output-format-constraint.md
46
-
47
- - type: shared
48
- source: sections/activation-preflight.md
36
+ source: sections/activation-protocol.md
49
37
  params:
38
+ activation_reads:
39
+ - session.yaml
40
+ has_preflight: true
50
41
  checks:
51
42
  - order: "1"
52
43
  field: "session.initialized_at"
53
44
  level: "WARN"
54
- message: 'Session not initialized. Run `/mvt-init` first.'
45
+ message: "Session not initialized. Run `/mvt-init` first."
55
46
  - order: "2"
56
47
  field: "projects[] in project-context.yaml"
57
48
  level: "WARN"
58
- message: 'Project not initialized. Run `/mvt-init` first.'
49
+ message: "Project not initialized. Run `/mvt-init` first."
59
50
  - order: "3"
60
51
  field: "active_change.id"
52
+ condition: "active_change.id is non-empty"
61
53
  level: "WARN"
62
- message: 'An active change already exists. Decomposing will create a new epic alongside it. Continue? (y/n)'
54
+ message: "An active change already exists. Decomposing will create a new epic alongside it. Continue? (y/n)"
55
+
56
+ - type: shared
57
+ source: sections/language-constraint.md
58
+
59
+ - type: shared
60
+ source: sections/output-format-constraint.md
63
61
 
64
62
  - type: file
65
63
  source: ./business.md
@@ -71,7 +69,7 @@ sections:
71
69
  **epic.md** (narrative):
72
70
  Read the document structure template from: `.ai-agents/skills/_templates/decompose-output.md`
73
71
  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.
72
+ The template defines section structure and guidance comments. Generate applicable content based on decomposition results.
75
73
  Write to: `.ai-agents/workspace/artifacts/{epic_id}/epic.md`
76
74
 
77
75
  **epic.yaml** (structured):
@@ -5,7 +5,7 @@
5
5
  - Existing design artifacts of related prior changes (`artifacts/*/design.md`) -- to stay consistent.
6
6
  - **Fallback**:
7
7
  - If `analysis.md` is missing, surface a WARN and accept the user's free-text intent as the requirement input.
8
- - If `project-context.md` is missing, proceed but mark the design as "context-light" and skip the layer-compliance check in Step 4.
8
+ - If `project-context.md` is missing, proceed but mark the design as "context-light" and skip the layer-compliance check in Step 3.
9
9
 
10
10
  ### Step 2: Frame the Problem
11
11
  - **What**: produce a one-paragraph problem statement plus a list of explicit architectural concerns (3-7 items).
@@ -15,36 +15,35 @@
15
15
  3. Drop any concern that is not actually exercised by the requirements -- do not invent NFRs.
16
16
  - **Output of this step**: a Concerns Table with columns `concern | source-of-evidence | priority(must/should/nice)`.
17
17
 
18
- ### Step 3: Choose Architecture Style
19
- - **What**: select the smallest viable architecture style for this change. Escalate only when concerns force it.
20
- - **How**: pick the row that matches the dominant concerns; multiple changes within the same project should normally pick the same style unless requirements force otherwise.
21
-
22
- | Style | Use when | Avoid when |
23
- |-------|----------|------------|
24
- | Plain CRUD / 3-layer | Single resource flow, no domain rules beyond validation | Complex business invariants, multi-step workflows |
25
- | Service-oriented within a module | Multiple use cases sharing entities, transactions across them | Cross-team boundaries, independent deployment needs |
26
- | Domain-driven (aggregates, domain services) | Rich business rules, invariants, multiple actors per workflow | Simple read-mostly resources |
27
- | Event-driven / async | Long-running flows, decoupled side-effects, retry/back-pressure | Strong synchronous contracts, immediate-consistency reads |
28
- | Multi-service / boundary split | Independent scaling or deployment, separate teams | Single team, single deployment pipeline -- DEFER |
29
-
30
- - If the requirements suggest "multi-service" but project is currently single-service: STOP and ask user to confirm scope expansion before designing across services.
31
-
32
- ### Step 4: Design Module Structure
18
+ ### Step 3: Design Module Structure
33
19
  - **What**: list modules (new and modified), their responsibilities, owned entities, and interfaces.
34
20
  - **How**:
35
- 1. Map each Concern (Step 2) to one owning module.
36
- 2. For every module, write: name, responsibility (one sentence), owned entities, public interface (function/class signatures or HTTP endpoints), dependencies on other modules.
37
- 3. Validate dependency direction against `project-context.md` layer rules (e.g., domain -> infra forbidden). If violation found, redesign or flag it as an explicit ADR (Step 6).
38
- 4. Use the existing module names from `project-context.md` whenever possible -- introduce a new module only when no existing one fits.
21
+ 1. Follow existing project architecture first: `project-context.md`, accepted ADRs, framework constraints, and domain rules override the examples below.
22
+ 2. Start simple. Add a boundary, abstraction, async flow, dependency, or new module only when a must/should concern requires it.
23
+ 3. For each must/should Concern (Step 2), choose the smallest response that satisfies it. Use the table as examples, not a closed list; if no row fits, derive a response from the concern itself.
24
+
25
+ | Concern signal (example) | Smallest architectural response | Module consequence |
26
+ |---------------------------|----------------------------------|--------------------|
27
+ | Simple data lifecycle | CRUD-oriented service/repository shape | Resource module with validation and persistence boundary |
28
+ | Rich business invariant | Domain model or aggregate boundary | Entity or aggregate module owns invariant enforcement |
29
+ | Shared multi-step workflow | Application service or use-case coordinator | Workflow module coordinates existing modules |
30
+ | Async side effect or retry need | Event handler or queue boundary | Producer/consumer or handler module; mark event boundary |
31
+ | Independent deployment, scaling, or team ownership | Service boundary candidate | STOP if it implies a new deployable service, runtime, or cross-service contract |
32
+
33
+ 4. Output the concern mapping as `concern | response | owning module | boundary impact`.
34
+ 5. For every module, write: name, responsibility (one sentence), owned entities, public interface (function/class signatures or HTTP endpoints), dependencies on other modules.
35
+ 6. Reuse existing module names from `project-context.md` whenever possible. Add a new module only when no existing module fits.
36
+ 7. Validate dependency direction against `project-context.md` layer rules (e.g., domain -> infra forbidden). If violation found, redesign or flag it as an explicit ADR (Step 5).
39
37
  - **Branches**:
40
38
 
41
39
  | Condition | Action |
42
40
  |-----------|--------|
43
41
  | Layer-compliance check passes | Proceed |
44
42
  | Single layer violation, fix is local | Adjust module placement, document in change tracking |
45
- | Systemic violation (style mismatch with existing project) | STOP, raise ADR (Step 6) and ask user to confirm direction before continuing |
43
+ | Architectural response implies a new deployable service, runtime, or cross-service contract | STOP, ask user to confirm scope expansion before designing across boundaries |
44
+ | Systemic violation (mismatch with existing project architecture) | STOP, raise ADR (Step 5) and ask user to confirm direction before continuing |
46
45
 
47
- ### Step 5: Define Data Flow
46
+ ### Step 4: Define Data Flow
48
47
  - **What**: for each primary use case, produce a sequence of module interactions.
49
48
  - **How**:
50
49
  1. For each use case (from Step 2 / analysis.md), list the trigger, the modules involved, the call order, and the persistence/event boundaries.
@@ -52,7 +51,7 @@
52
51
  3. Mark transactional boundaries explicitly (`-- transaction begin/end`).
53
52
  4. Identify error paths for each flow: what happens if step N fails? Document fallback behavior (retry, compensating action, user-visible error).
54
53
 
55
- ### Step 6: Document Decisions (ADRs)
54
+ ### Step 5: Document Decisions (ADRs)
56
55
  - **What**: capture every non-obvious choice as an Architecture Decision Record.
57
56
  - **How**: write one ADR per decision with these fields:
58
57
 
@@ -66,39 +65,31 @@
66
65
  | Consequences | Positive and negative impacts; which downstream skills/modules pay the cost |
67
66
 
68
67
  - Decisions that MUST be ADRs (do not skip):
69
- - Choice of architecture style (Step 3) when more than one row was viable.
68
+ - Any architectural response that changes module boundaries, deployment/runtime boundaries, persistence boundaries, async/event boundaries, or public contracts.
70
69
  - Any layer-rule violation accepted as a deliberate exception.
71
70
  - Introduction of a new external dependency (DB, queue, library category).
72
71
  - Breaking change to an existing public interface.
73
72
 
74
- ### Step 7: User Confirmation Before Write
73
+ ### Step 6: User Confirmation Before Write
75
74
  - **When to confirm before writing the artifact**:
76
- - Step 3 escalated to multi-service.
77
- - Step 4 raised a systemic layer violation.
78
- - Step 6 contains any ADR with `status: proposed` for a breaking change.
75
+ - Step 3 identified a new deployable service, runtime, or cross-service contract.
76
+ - Step 3 raised a systemic layer violation.
77
+ - Step 5 contains any ADR with `status: proposed` for a breaking change.
79
78
  - The design adds a new external dependency.
80
79
  - **When to write silently**:
81
80
  - Single-module addition that fits existing layers, no ADR escalations, no breaking change.
82
- - **Confirmation format**: present a one-screen summary -- style chosen, modules added/changed, ADRs requiring review, a single yes/no prompt. Do not dump the full artifact.
83
-
84
- ### Step 8: Write Artifact
85
- - **Path and template**: as defined in the **Artifact Structure** section below.
86
- - **Required sections** (filled per template headings, but content must include):
87
- - `Overview` -- the problem statement (Step 2).
88
- - `Architecture Decision Records` -- every ADR from Step 6.
89
- - `Module Design` -- table of modules from Step 4.
90
- - `Key Interfaces` -- explicit signatures/endpoints.
91
- - `Data Flow` -- sequences from Step 5, including error paths.
92
- - `File Structure` -- mapping of modules to file/directory paths in this repo.
93
- - `Implementation Guidelines` -- ordering hints for `/mvt-implement` and `/mvt-plan-dev`.
94
- - `Change Tracking` -- list of files expected to be created/modified/deleted.
81
+ - **Confirmation format**: present a one-screen summary -- module boundary changes, deployment/runtime boundary changes, ADRs requiring review, external dependencies, and a single yes/no prompt. Do not dump the full artifact.
82
+
83
+ ### Step 7: Write Artifact
84
+ - **Path and template**: as defined in the **Artifact Structure** section below. Follow the HTML comments in the template for what each section should contain; strip comments from the final artifact.
85
+ - **Required coverage**: cover only content that is applicable to this design. Preserve enough information for downstream skills to understand the problem, decisions made, module/interface/data-flow impacts, expected file changes, and implementation guidance. Do not create empty or artificial sections just because an item is named here; if the template omits or renames a section, place applicable content in the closest relevant section.
95
86
  - Do NOT modify `project-context.yaml` or `project-context.md` here.
96
87
 
97
- ### Step 9: Suggest Plan Decomposition
98
- - If `Change Tracking` lists more than ~5 files OR Module Design adds more than 1 new module OR ADRs include any breaking change, recommend `/mvt-plan-dev` as the next step.
88
+ ### Step 8: Suggest Plan Decomposition
89
+ - If `Change Tracking` lists more than 5 files OR Module Design adds more than 1 new module OR ADRs include any breaking change, recommend `/mvt-plan-dev` as the next step.
99
90
  - Otherwise recommend `/mvt-implement` directly.
100
91
 
101
- ### Step 10: State Update
92
+ ### Step 9: State Update
102
93
  Apply the State Update rules defined in the **State Update** section below.
103
94
 
104
95
  ## Edge Cases & Errors