@uoyo/mvtt 2.0.0-beta.6 → 2.1.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 (109) hide show
  1. package/dist/cli.d.ts.map +1 -1
  2. package/dist/cli.js +14 -6
  3. package/dist/cli.js.map +1 -1
  4. package/dist/commands/doctor.d.ts.map +1 -1
  5. package/dist/commands/doctor.js +28 -16
  6. package/dist/commands/doctor.js.map +1 -1
  7. package/dist/commands/install.d.ts.map +1 -1
  8. package/dist/commands/install.js +64 -59
  9. package/dist/commands/install.js.map +1 -1
  10. package/dist/commands/uninstall.d.ts.map +1 -1
  11. package/dist/commands/uninstall.js +58 -25
  12. package/dist/commands/uninstall.js.map +1 -1
  13. package/dist/commands/update.d.ts.map +1 -1
  14. package/dist/commands/update.js +31 -20
  15. package/dist/commands/update.js.map +1 -1
  16. package/dist/fs/materialize.d.ts.map +1 -1
  17. package/dist/fs/materialize.js +3 -2
  18. package/dist/fs/materialize.js.map +1 -1
  19. package/dist/index.js +0 -1
  20. package/dist/index.js.map +1 -1
  21. package/dist/scripts/epic-update.cjs +32 -14
  22. package/dist/scripts/epic-update.md +57 -0
  23. package/dist/scripts/plan-update.cjs +54 -23
  24. package/dist/scripts/plan-update.md +59 -0
  25. package/dist/scripts/session-update.cjs +36 -17
  26. package/dist/types/platform.d.ts +1 -1
  27. package/dist/types/platform.d.ts.map +1 -1
  28. package/dist/types/platform.js +12 -0
  29. package/dist/types/platform.js.map +1 -1
  30. package/dist/util/bilingual.d.ts +10 -0
  31. package/dist/util/bilingual.d.ts.map +1 -0
  32. package/dist/util/bilingual.js +14 -0
  33. package/dist/util/bilingual.js.map +1 -0
  34. package/dist/util/cancel.d.ts +2 -0
  35. package/dist/util/cancel.d.ts.map +1 -0
  36. package/dist/util/cancel.js +6 -0
  37. package/dist/util/cancel.js.map +1 -0
  38. package/dist/util/color.d.ts +9 -6
  39. package/dist/util/color.d.ts.map +1 -1
  40. package/dist/util/color.js +10 -10
  41. package/dist/util/color.js.map +1 -1
  42. package/dist/util/spinner.d.ts +8 -0
  43. package/dist/util/spinner.d.ts.map +1 -0
  44. package/dist/util/spinner.js +17 -0
  45. package/dist/util/spinner.js.map +1 -0
  46. package/install-manifest.yaml +4 -0
  47. package/package.json +4 -3
  48. package/registry.yaml +72 -72
  49. package/sources/defaults/config.yaml +5 -0
  50. package/sources/scripts/epic-update.js +3 -21
  51. package/sources/scripts/epic-update.md +57 -0
  52. package/sources/scripts/plan-update.js +30 -20
  53. package/sources/scripts/plan-update.md +59 -0
  54. package/sources/scripts/session-update.js +7 -23
  55. package/sources/sections/activation-load-config.md +7 -10
  56. package/sources/sections/activation-load-context.md +15 -25
  57. package/sources/sections/activation-preflight.md +1 -1
  58. package/sources/sections/footer-next-steps.md +1 -1
  59. package/sources/sections/language-constraint.md +11 -0
  60. package/sources/sections/output-format-constraint.md +11 -14
  61. package/sources/sections/project-context-profile.md +29 -29
  62. package/sources/sections/script-usage-rule.md +32 -0
  63. package/sources/sections/session-update.md +24 -110
  64. package/sources/skills/mvt-analyze/business.md +1 -1
  65. package/sources/skills/mvt-analyze/manifest.yaml +7 -7
  66. package/sources/skills/mvt-analyze-code/manifest.yaml +7 -7
  67. package/sources/skills/mvt-bug-detect/manifest.yaml +3 -0
  68. package/sources/skills/mvt-check-context/manifest.yaml +3 -0
  69. package/sources/skills/mvt-cleanup/business.md +9 -0
  70. package/sources/skills/mvt-cleanup/manifest.yaml +6 -6
  71. package/sources/skills/mvt-config/business.md +1 -0
  72. package/sources/skills/mvt-config/manifest.yaml +4 -0
  73. package/sources/skills/mvt-create-skill/business.md +1 -1
  74. package/sources/skills/mvt-create-skill/manifest.yaml +1 -1
  75. package/sources/skills/mvt-decompose/business.md +18 -9
  76. package/sources/skills/mvt-decompose/manifest.yaml +7 -7
  77. package/sources/skills/mvt-design/business.md +34 -43
  78. package/sources/skills/mvt-design/manifest.yaml +7 -7
  79. package/sources/skills/mvt-fix/manifest.yaml +6 -6
  80. package/sources/skills/mvt-help/business.md +19 -9
  81. package/sources/skills/mvt-help/manifest.yaml +6 -14
  82. package/sources/skills/mvt-implement/business.md +27 -34
  83. package/sources/skills/mvt-implement/manifest.yaml +8 -14
  84. package/sources/skills/mvt-init/manifest.yaml +6 -6
  85. package/sources/skills/mvt-manage-context/manifest.yaml +1 -1
  86. package/sources/skills/mvt-plan-dev/business.md +12 -2
  87. package/sources/skills/mvt-plan-dev/manifest.yaml +7 -7
  88. package/sources/skills/mvt-quick-dev/manifest.yaml +1 -1
  89. package/sources/skills/mvt-refactor/manifest.yaml +1 -1
  90. package/sources/skills/mvt-resume/manifest.yaml +3 -0
  91. package/sources/skills/mvt-review/business.md +3 -9
  92. package/sources/skills/mvt-review/manifest.yaml +7 -7
  93. package/sources/skills/mvt-status/business.md +2 -12
  94. package/sources/skills/mvt-status/manifest.yaml +3 -0
  95. package/sources/skills/mvt-sync-context/business.md +1 -1
  96. package/sources/skills/mvt-sync-context/manifest.yaml +6 -6
  97. package/sources/skills/mvt-template/manifest.yaml +3 -0
  98. package/sources/skills/mvt-test/business.md +2 -10
  99. package/sources/skills/mvt-test/manifest.yaml +7 -7
  100. package/sources/skills/mvt-update-plan/business.md +12 -27
  101. package/sources/skills/mvt-update-plan/manifest.yaml +12 -6
  102. package/sources/templates/analyze-output/body.md +41 -0
  103. package/sources/templates/decompose-output/body.md +36 -0
  104. package/sources/templates/design-output/body.md +48 -0
  105. package/sources/templates/implement-output/body.md +48 -3
  106. package/sources/templates/project-context/body.md +45 -0
  107. package/sources/templates/review-output/body.md +59 -0
  108. package/sources/templates/test-output/body.md +72 -0
  109. package/sources/sections/output-language-constraint.md +0 -11
@@ -6,148 +6,62 @@ This skill is read-only and does NOT modify `.ai-agents/workspace/session.yaml`.
6
6
  {{^read_only}}
7
7
  ## State Update
8
8
 
9
- After completing the skill's main task, run the session update script **exactly once** with the following arguments:
9
+ After the skill's main task, run the session update script **exactly once**:
10
10
 
11
11
  ```bash
12
- node .ai-agents/scripts/session-update.cjs --skill <skill_command_name> --summary "<concise one-line summary>"{{#update_active_change}} --new-change "<active_change.title>" --change-id <active_change.id>{{#link_subchange_to_epic}} --epic-id <active_epic.id>{{/link_subchange_to_epic}}{{/update_active_change}}{{#set_plan_path}} --set-plan-path ".ai-agents/workspace/artifacts/{active_change.id}/plan.yaml"{{/set_plan_path}}{{#update_change}} --update-change{{/update_change}}{{#close_change}} --close-change{{/close_change}}{{#set_change_status}} --set-change-status <status>{{/set_change_status}}{{#new_epic}} --new-epic "<epic_title>" --epic-id <epic_id>{{/new_epic}}{{#set_epic_path}} --set-epic-path <epic_path>{{/set_epic_path}}{{#set_epic_status}} --set-epic-status <status>{{/set_epic_status}}{{#close_epic}} --close-epic{{/close_epic}}{{#no_change}} --no-change{{/no_change}}{{#set_synced}} --set-synced{{/set_synced}}{{#truncate_history}} --truncate-history <count>{{/truncate_history}}{{#update_initialized_at}} --set-initialized{{/update_initialized_at}}
12
+ node .ai-agents/scripts/session-update.cjs --skill {{current_skill}} --summary "<concise one-line summary>"{{#update_active_change}} --new-change "<active_change.title>" --change-id <active_change.id>{{#link_subchange_to_epic}} --epic-id <active_epic.id>{{/link_subchange_to_epic}}{{/update_active_change}}{{#set_plan_path}} --set-plan-path ".ai-agents/workspace/artifacts/{active_change.id}/plan.yaml"{{/set_plan_path}}{{#update_change}} --update-change{{/update_change}}{{#close_change}} --close-change{{/close_change}}{{#set_change_status}} --set-change-status <status>{{/set_change_status}}{{#new_epic}} --new-epic "<epic_title>" --epic-id <epic_id>{{/new_epic}}{{#set_epic_path}} --set-epic-path <epic_path>{{/set_epic_path}}{{#set_epic_status}} --set-epic-status <status>{{/set_epic_status}}{{#close_epic}} --close-epic{{/close_epic}}{{#no_change}} --no-change{{/no_change}}{{#set_synced}} --set-synced{{/set_synced}}{{#truncate_history}} --truncate-history <count>{{/truncate_history}}{{#update_initialized_at}} --set-initialized{{/update_initialized_at}}
13
13
 
14
14
  ```
15
15
 
16
- If the script exits with code 0, the state update was applied successfully; there is no need to read or verify the session file.
16
+ Write `--summary` as one concise line in the configured `interaction_language`.
17
17
 
18
- ### Argument values
18
+ ### Critical flag semantics
19
19
 
20
- | Argument | Value source | Example |
21
- |----------|-------------|---------|
22
- | `--skill` | The exact skill command name without the leading `/` | `{{current_skill}}` |
23
- | `--summary` | A concise one-line description of what this invocation accomplished, in the configured `interaction_language` | `"Identified auth requirements and created change chg-001"` |
20
+ - Use only the flags rendered in the command above; do not invent extra session-update flags.
24
21
  {{#update_active_change}}
25
- | `--new-change` | The title of the new change being created (same value written to `active_change.title`) | `"User authentication system"` |
26
- | `--change-id` | The unique identifier of the new change (same value written to `active_change.id`) | `chg-001` |
22
+ - `--new-change` and `--change-id` are required together; they set `active_change.{id,title,created_at}` and snapshot any prior active change into `changes[]`.
27
23
  {{/update_active_change}}
28
- {{#set_plan_path}}
29
- | `--set-plan-path` | The path to the newly created plan.yaml | `".ai-agents/workspace/artifacts/chg-001/plan.yaml"` |
30
- {{/set_plan_path}}
31
- {{#update_change}}
32
- | `--update-change` | Flag only, no value. Upserts the current `active_change` into `changes[]`. | |
33
- {{/update_change}}
24
+ {{#set_plan_path}}{{#update_change}}
25
+ - `--set-plan-path` must be used with `--update-change`; together they persist the active change's `plan_path` into `changes[]`.
26
+ {{/update_change}}{{/set_plan_path}}
27
+ {{#update_change}}{{^set_plan_path}}
28
+ - `--update-change` upserts the current `active_change` into `changes[]`, refreshes `updated_at`, and preserves the configured change-history limit.
29
+ {{/set_plan_path}}{{/update_change}}
34
30
  {{#close_change}}
35
- | `--close-change` | Flag only, no value. Snapshots `active_change` into `changes[]` with `status: done`, then clears `active_change`. | — |
31
+ - `--close-change` snapshots `active_change` into `changes[]` with `status: done`, then clears all active-change fields.
36
32
  {{/close_change}}
37
33
  {{#set_change_status}}
38
- | `--set-change-status` | The status to set on the `changes[]` entry matching `active_change.id`. Values: `active`, `done`, `abandoned`. | `done` |
34
+ - `--set-change-status` sets the matching `changes[]` entry to `active`, `done`, or `abandoned`.
39
35
  {{/set_change_status}}
40
36
  {{#no_change}}
41
- | `--no-change` | Flag only, no value. Forces `history[].change_id` to empty string (skips `active_change.id` fallback). | — |
37
+ - `--no-change` forces `history[].change_id` to empty instead of falling back to `active_change.id`.
42
38
  {{/no_change}}
43
39
  {{#set_synced}}
44
- | `--set-synced` | Flag only, no value. Sets `session.last_synced_at` to current time. | — |
40
+ - `--set-synced` refreshes `session.last_synced_at`.
45
41
  {{/set_synced}}
46
42
  {{#truncate_history}}
47
- | `--truncate-history` | Number of most recent history entries to keep (read from `config.yaml > preferences.history_limits.history`, default 20); older entries are discarded. | `20` |
43
+ - `--truncate-history` keeps the most recent N `history[]` entries; use the configured history limit.
48
44
  {{/truncate_history}}
49
45
  {{#update_initialized_at}}
50
- | `--set-initialized` | Flag only, no value. Set when this skill initializes the project for the first time. | — |
46
+ - `--set-initialized` sets `session.initialized_at` only when it is empty.
51
47
  {{/update_initialized_at}}
52
48
  {{#new_epic}}
53
- | `--new-epic` | The title of the new epic being created (same value written to `active_epic.title`) | `"ecommerce platform"` |
54
- | `--epic-id` | The unique identifier of the new epic. Required when using `--new-epic`. Format: `epic-{YYYYMMDD}-{slug}`. | `"epic-20260608-ecommerce-platform"` |
49
+ - `--new-epic` requires `--epic-id`; together they set `active_epic.{id,title,created_at}` and snapshot any prior active epic into `epics[]`.
55
50
  {{/new_epic}}
56
51
  {{#set_epic_path}}
57
- | `--set-epic-path` | The path to the written `epic.yaml` file. Sets `active_epic.epic_path`. | `".ai-agents/workspace/artifacts/epic-20260608-ecommerce-platform/epic.yaml"` |
52
+ - `--set-epic-path` records the written `epic.yaml` path on `active_epic.epic_path`.
58
53
  {{/set_epic_path}}
59
54
  {{#set_epic_status}}
60
- | `--set-epic-status` | The status to set on the `epics[]` entry matching `active_epic.id`. Values: `in_progress`, `done`, `abandoned`. | `done` |
55
+ - `--set-epic-status` sets the matching `epics[]` entry to `in_progress`, `done`, or `abandoned`.
61
56
  {{/set_epic_status}}
62
57
  {{#close_epic}}
63
- | `--close-epic` | Flag only, no value. Snapshots `active_epic` into `epics[]` with `status: done`, then clears all `active_epic` fields. | — |
58
+ - `--close-epic` snapshots `active_epic` into `epics[]` with `status: done`, then clears all active-epic fields.
64
59
  {{/close_epic}}
65
60
  {{#link_subchange_to_epic}}
66
- | `--epic-id` (with `--new-change`) | The parent epic id that this new sub-change belongs to. Only valid when used together with `--new-change`. | `"epic-20260608-ecommerce-platform"` |
61
+ - `--epic-id` with `--new-change` links the new active change to its parent epic; do not use it outside `--new-epic` or `--new-change`.
67
62
  {{/link_subchange_to_epic}}
68
63
 
69
- {{#update_active_change}}
70
- ### Parameter semantics
71
-
72
- | Argument | When to use | Effect on `session.yaml` |
73
- |----------|-------------|--------------------------|
74
- | `--new-change` + `--change-id` | Skill creates or identifies a new change | Sets `active_change.id`, `.title`, `.created_at`. Auto-snapshots old `active_change` into `changes[]` if non-empty. Requires both arguments together. |
75
- {{#link_subchange_to_epic}}
76
- | `--epic-id` (with `--new-change`) | Skill creates a new sub-change inside an existing epic (epic-child mode) | Writes `active_change.epic_id` so the new sub-change is linked to the parent epic. Only valid when used together with `--new-change`. |
77
- {{/link_subchange_to_epic}}
78
- {{#set_plan_path}}
79
- | `--set-plan-path` | Skill creates a new `plan.yaml` for the active change | Sets `active_change.plan_path`. Must be used together with `--update-change`. |
80
- {{/set_plan_path}}
81
- {{#update_change}}
82
- | `--update-change` | Skill creates or modifies a plan (i.e., after `plan.yaml` is written/updated) | Upserts current `active_change` into `changes[]` (with `status: active`), sets `updated_at`, sorts ascending, truncates to configured limit. |
83
- {{/update_change}}
84
- {{#close_change}}
85
- | `--close-change` | All plan tasks are completed | Snapshots `active_change` into `changes[]` with `status: done`, then clears all `active_change` fields. |
86
- {{/close_change}}
87
- {{#set_change_status}}
88
- | `--set-change-status` | Explicitly mark a change as `done` or `abandoned` | Sets `status` on the `changes[]` entry whose `id` matches `active_change.id`. |
89
- {{/set_change_status}}
90
- {{#set_epic_path}}
91
- | `--set-epic-path` | Skill writes or moves the `epic.yaml` file (e.g., after `/mvt-decompose` writes the artifacts) | Sets `active_epic.epic_path`. |
92
- {{/set_epic_path}}
93
- {{#set_epic_status}}
94
- | `--set-epic-status` | Skill marks the active epic as `done` or `abandoned` (rarely used directly — `epic-update.cjs` usually drives this) | Sets `status` on the `epics[]` entry whose `id` matches `active_epic.id`. |
95
- {{/set_epic_status}}
96
- {{#close_epic}}
97
- | `--close-epic` | Skill closes the active epic (e.g., after archiving a completed epic) | Snapshots `active_epic` into `epics[]` with `status: done`, then clears all `active_epic` fields. |
98
- {{/close_epic}}
99
- {{#no_change}}
100
- | `--no-change` | Skill should not be associated with any change | Forces `history[].change_id` to empty string, skipping the `active_change.id` fallback. |
101
- {{/no_change}}
102
- {{#set_synced}}
103
- | `--set-synced` | Skill synchronizes context files | Sets `session.last_synced_at` to the current time. |
104
- {{/set_synced}}
105
- {{#truncate_history}}
106
- | `--truncate-history` | Maintenance: trim old history entries | Keeps the most recent N entries in `history[]`, discards older ones. |
107
- {{/truncate_history}}
108
- {{#update_initialized_at}}
109
- | `--set-initialized` | Skill initializes the project for the first time | Sets `session.initialized_at` (idempotent — only writes if empty). |
110
- {{/update_initialized_at}}
111
- {{/update_active_change}}
112
- {{^update_active_change}}
113
- ### Parameter semantics
114
-
115
- | Argument | When to use | Effect on `session.yaml` |
116
- |----------|-------------|--------------------------|
117
- {{#new_epic}}
118
- | `--new-epic` + `--epic-id` | Skill creates a new epic (e.g., `/mvt-decompose`) | Sets `active_epic.{id,title,created_at}`. Auto-snapshots old `active_epic` into `epics[]` if non-empty. Requires both arguments together. |
119
- {{/new_epic}}
120
- {{#update_change}}
121
- | `--update-change` | Skill modifies a plan (i.e., after `plan.yaml` is updated) | Upserts current `active_change` into `changes[]` (with `status: active`), sets `updated_at`, sorts ascending, truncates to configured limit. |
122
- {{/update_change}}
123
- {{#close_change}}
124
- | `--close-change` | All plan tasks are completed | Snapshots `active_change` into `changes[]` with `status: done`, then clears all `active_change` fields. |
125
- {{/close_change}}
126
- {{#set_change_status}}
127
- | `--set-change-status` | Explicitly mark a change as `done` or `abandoned` | Sets `status` on the `changes[]` entry whose `id` matches `active_change.id`. |
128
- {{/set_change_status}}
129
- {{#set_epic_path}}
130
- | `--set-epic-path` | Skill writes or moves the `epic.yaml` file (e.g., after `/mvt-decompose` writes the artifacts) | Sets `active_epic.epic_path`. |
131
- {{/set_epic_path}}
132
- {{#set_epic_status}}
133
- | `--set-epic-status` | Skill marks the active epic as `done` or `abandoned` (rarely used directly — `epic-update.cjs` usually drives this) | Sets `status` on the `epics[]` entry whose `id` matches `active_epic.id`. |
134
- {{/set_epic_status}}
135
- {{#close_epic}}
136
- | `--close-epic` | Skill closes the active epic (e.g., after archiving a completed epic) | Snapshots `active_epic` into `epics[]` with `status: done`, then clears all `active_epic` fields. |
137
- {{/close_epic}}
138
- {{#no_change}}
139
- | `--no-change` | Skill should not be associated with any change | Forces `history[].change_id` to empty string, skipping the `active_change.id` fallback. |
140
- {{/no_change}}
141
- {{#set_synced}}
142
- | `--set-synced` | Skill synchronizes context files | Sets `session.last_synced_at` to the current time. |
143
- {{/set_synced}}
144
- {{#truncate_history}}
145
- | `--truncate-history` | Maintenance: trim old history entries | Keeps the most recent N entries in `history[]`, discards older ones. |
146
- {{/truncate_history}}
147
- {{#update_initialized_at}}
148
- | `--set-initialized` | Skill initializes the project for the first time | Sets `session.initialized_at` (idempotent — only writes if empty). |
149
- {{/update_initialized_at}}
150
- {{/update_active_change}}
64
+ If the script exits with code 0, the state update was applied successfully; do not read or verify the session file.
151
65
 
152
66
  ### Failure handling
153
67
 
@@ -8,7 +8,7 @@ In this state the user is starting a new sub-change within an existing epic. Rea
8
8
  |----------|-------------|----------|
9
9
  | A | Empty | Auto-use `current_change` child's scope from `epic.yaml` as the requirement input. Proceed to Step 3. |
10
10
  | B | Supplements current child | Merge user message with `current_change` child's scope. Proceed to Step 3. |
11
- | C | Points to different child | Locate target in `children[]`. If `depends_on` has unfinished prerequisites → warn and ask to confirm forced reorder (y/n). If deps satisfied → confirm switch (y/n). On confirmed reorder: call `epic-update.cjs --epic <epic_path> --switch-active <target_id>`. If target not in `children[]` → offer to treat as independent change (exit epic-child mode) or `--add-child`. |
11
+ | C | Points to different child | Locate target in `children[]`. If `depends_on` has unfinished prerequisites → warn and ask to confirm forced reorder (y/n). If deps satisfied → confirm switch (y/n). On confirmed reorder: call the Epic Update Script in `--switch-active` mode with `node .ai-agents/scripts/epic-update.cjs --epic <epic_path> --switch-active <target_id>`. If target not in `children[]` → offer to treat as independent change (exit epic-child mode) or use `--add-child` mode to append it as a new child. Read `.ai-agents/scripts/epic-update.md` only if a required mode or flag is not rendered here. Do NOT hand-edit `epic.yaml`, advance `current_change`, or read `.cjs`/`.js` source. |
12
12
 
13
13
  ## Execution Flow
14
14
 
@@ -41,12 +41,6 @@ sections:
41
41
  - type: shared
42
42
  source: sections/activation-load-config.md
43
43
 
44
- - type: shared
45
- source: sections/output-language-constraint.md
46
-
47
- - type: shared
48
- source: sections/output-format-constraint.md
49
-
50
44
  - type: shared
51
45
  source: sections/activation-preflight.md
52
46
  params:
@@ -60,6 +54,12 @@ sections:
60
54
  level: "WARN"
61
55
  message: 'Project not initialized. Run `/mvt-init` first.'
62
56
 
57
+ - type: shared
58
+ source: sections/language-constraint.md
59
+
60
+ - type: shared
61
+ source: sections/output-format-constraint.md
62
+
63
63
  - type: file
64
64
  source: ./business.md
65
65
 
@@ -68,7 +68,7 @@ sections:
68
68
  ## Artifact Structure
69
69
  Read the document structure template from: `.ai-agents/skills/_templates/analyze-output.md`
70
70
  If a custom version exists at `.ai-agents/skills/_templates/custom/analyze-output.md`, use the custom version instead.
71
- The template defines section headings only. Generate content for each section based on analysis results.
71
+ The template defines section structure and guidance comments. Generate applicable content based on analysis results.
72
72
  Write the artifact to: `.ai-agents/workspace/artifacts/{change-id}/analysis.md`
73
73
 
74
74
  - type: shared
@@ -53,12 +53,6 @@ sections:
53
53
  - type: shared
54
54
  source: sections/activation-load-config.md
55
55
 
56
- - type: shared
57
- source: sections/output-language-constraint.md
58
-
59
- - type: shared
60
- source: sections/output-format-constraint.md
61
-
62
56
  - type: shared
63
57
  source: sections/activation-preflight.md
64
58
  params:
@@ -72,6 +66,12 @@ sections:
72
66
  level: "WARN"
73
67
  message: "No projects registered. Run `/mvt-init` first."
74
68
 
69
+ - type: shared
70
+ source: sections/language-constraint.md
71
+
72
+ - type: shared
73
+ source: sections/output-format-constraint.md
74
+
75
75
  - type: inline
76
76
  content: |
77
77
  ## Operation Mode: Independent
@@ -88,7 +88,7 @@ sections:
88
88
  ## Artifact Structure
89
89
  Read the document structure template from: `.ai-agents/skills/_templates/project-context.md`
90
90
  If a custom version exists at `.ai-agents/skills/_templates/custom/project-context.md`, use the custom version instead.
91
- The template defines section headings only. Generate content for each section based on code analysis results.
91
+ The template defines section structure and guidance comments. Generate applicable content based on code analysis results.
92
92
  Write the artifact to: `.ai-agents/knowledge/project/_generated/project-context.md`
93
93
 
94
94
  - type: shared
@@ -44,6 +44,9 @@ sections:
44
44
  - type: shared
45
45
  source: sections/activation-load-config.md
46
46
 
47
+ - type: shared
48
+ source: sections/language-constraint.md
49
+
47
50
  - type: inline
48
51
  content: |
49
52
  ## Operation Mode: Shortcut
@@ -40,6 +40,9 @@ sections:
40
40
  - type: shared
41
41
  source: sections/activation-load-config.md
42
42
 
43
+ - type: shared
44
+ source: sections/language-constraint.md
45
+
43
46
  - type: file
44
47
  source: ./business.md
45
48
 
@@ -104,6 +104,15 @@ N is read from `config.yaml > preferences.history_limits.history` (default 20).
104
104
  ### Step 10: State Update
105
105
  Apply the State Update rules defined in the **State Update** section below.
106
106
 
107
+ **Pre-filled example** (closed active_change + history truncation):
108
+ ```bash
109
+ node .ai-agents/scripts/session-update.cjs \
110
+ --skill mvt-cleanup \
111
+ --close-change \
112
+ --truncate-history 10
113
+ ```
114
+ Replace `10` with the actual `config.yaml > preferences.history_limits.history` value. If only truncating history (active_change still in progress), omit `--close-change`.
115
+
107
116
  ## Edge Cases & Errors
108
117
 
109
118
  | Case | Handling |
@@ -51,12 +51,6 @@ sections:
51
51
  - type: shared
52
52
  source: sections/activation-load-config.md
53
53
 
54
- - type: shared
55
- source: sections/output-language-constraint.md
56
-
57
- - type: shared
58
- source: sections/output-format-constraint.md
59
-
60
54
  - type: shared
61
55
  source: sections/activation-preflight.md
62
56
  params:
@@ -66,6 +60,12 @@ sections:
66
60
  level: "REQUIRED"
67
61
  message: "Project must be initialized (session.yaml exists)"
68
62
 
63
+ - type: shared
64
+ source: sections/language-constraint.md
65
+
66
+ - type: shared
67
+ source: sections/output-format-constraint.md
68
+
69
69
  - type: file
70
70
  source: ./business.md
71
71
 
@@ -61,6 +61,7 @@
61
61
  | 4 | `preferences.output.data_format` | Default `yaml`; allowed: `yaml`, `json` |
62
62
  | 5 | `preferences.context_routing.relevance_threshold` | Default `70`; allowed: 0-100 |
63
63
  | 6 | `preferences.history_limits.*` | Show each limit with current value; accept new int or Enter to keep |
64
+ | 7 | `preferences.planning.granularity` | Default `medium`; allowed: `coarse`, `medium`, `fine` |
64
65
 
65
66
  - After all stages, render a Summary Preview table: `key | from | to`, then a single confirmation prompt to apply ALL changes atomically.
66
67
  - If the user aborts at the summary, discard all in-progress values; do not write anything.
@@ -56,6 +56,9 @@ sections:
56
56
  - type: shared
57
57
  source: sections/activation-load-config.md
58
58
 
59
+ - type: shared
60
+ source: sections/language-constraint.md
61
+
59
62
  - type: inline
60
63
  content: |
61
64
  ## Configuration Keys
@@ -71,6 +74,7 @@ sections:
71
74
  | `preferences.context_routing.relevance_threshold` | int | `70` | AI routing threshold for `/mvt-manage-context add` (0-100) |
72
75
  | `preferences.history_limits.history` | int | `20` | Max history entries (1-100) |
73
76
  | `preferences.history_limits.changes` | int | `20` | Max changes entries (1-100) |
77
+ | `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) |
74
78
 
75
79
  ### Knowledge Settings
76
80
 
@@ -212,7 +212,7 @@ Copy the following sections verbatim from this document (the assembled SKILL.md
212
212
  |---------|----------------------|-----------------|
213
213
  | Activation Protocol | `## Activation Protocol` | Add `extended_context` entries if the skill needs additional context sources; otherwise copy as-is |
214
214
  | Load Config | Load Config step within Activation Protocol | Copy as-is |
215
- | Output Language Constraint | Output Language Constraint step within Activation Protocol | Copy as-is |
215
+ | Language Constraint | Language Constraint step within Activation Protocol | Copy as-is |
216
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 |
217
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 |
218
218
  | Suggested Next Steps | `## Suggested Next Steps` | Replace `current_skill` with the new skill name; replace conditional suggestions with skill-appropriate ones |
@@ -48,7 +48,7 @@ sections:
48
48
  source: sections/activation-load-config.md
49
49
 
50
50
  - type: shared
51
- source: sections/output-language-constraint.md
51
+ source: sections/language-constraint.md
52
52
 
53
53
  - type: shared
54
54
  source: sections/output-format-constraint.md
@@ -54,16 +54,11 @@
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
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
60
+ - 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.
61
+ - **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
62
 
68
63
  2. **epic.yaml** (structured) -- `.ai-agents/workspace/artifacts/{epic_id}/epic.yaml`
69
64
  - Follows the schema defined in Artifact Structure
@@ -78,11 +73,25 @@ Write two artifacts using the `decompose-output` template for `epic.md`:
78
73
  - [ ] `current_change` matches the active child's `change_id`
79
74
  - [ ] Each child has non-empty `title` and `scope`
80
75
 
81
- **Optional safety net**: after writing, call `epic-update.cjs --validate` to verify:
76
+ **Optional safety net**: after writing, validate the epic using the Epic Update Script command below:
82
77
  ```bash
83
78
  node .ai-agents/scripts/epic-update.cjs --validate .ai-agents/workspace/artifacts/{epic_id}/epic.yaml
84
79
  ```
85
80
 
81
+ If the epic needs children added later (e.g. a missed sub-change discovered during analysis), use `--add-child`:
82
+ ```bash
83
+ node .ai-agents/scripts/epic-update.cjs --epic .ai-agents/workspace/artifacts/{epic_id}/epic.yaml \
84
+ --add-child <new_child_id> --child-title "<title>" --child-scope "<scope>"
85
+ ```
86
+
87
+ To advance the epic after a child change completes, use `--complete-child`:
88
+ ```bash
89
+ node .ai-agents/scripts/epic-update.cjs --epic .ai-agents/workspace/artifacts/{epic_id}/epic.yaml \
90
+ --complete-child <completed_child_id>
91
+ ```
92
+
93
+ 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.
94
+
86
95
  ### Step 7: Update Session
87
96
  Run the session update command (see State Update section) to:
88
97
  1. Create a new `active_epic` in session.yaml
@@ -38,12 +38,6 @@ sections:
38
38
  - type: shared
39
39
  source: sections/activation-load-config.md
40
40
 
41
- - type: shared
42
- source: sections/output-language-constraint.md
43
-
44
- - type: shared
45
- source: sections/output-format-constraint.md
46
-
47
41
  - type: shared
48
42
  source: sections/activation-preflight.md
49
43
  params:
@@ -61,6 +55,12 @@ sections:
61
55
  level: "WARN"
62
56
  message: 'An active change already exists. Decomposing will create a new epic alongside it. Continue? (y/n)'
63
57
 
58
+ - type: shared
59
+ source: sections/language-constraint.md
60
+
61
+ - type: shared
62
+ source: sections/output-format-constraint.md
63
+
64
64
  - type: file
65
65
  source: ./business.md
66
66
 
@@ -71,7 +71,7 @@ sections:
71
71
  **epic.md** (narrative):
72
72
  Read the document structure template from: `.ai-agents/skills/_templates/decompose-output.md`
73
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.
74
+ The template defines section structure and guidance comments. Generate applicable content based on decomposition results.
75
75
  Write to: `.ai-agents/workspace/artifacts/{epic_id}/epic.md`
76
76
 
77
77
  **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
88
+ ### Step 8: Suggest Plan Decomposition
98
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
@@ -52,12 +52,6 @@ sections:
52
52
  - type: shared
53
53
  source: sections/activation-load-config.md
54
54
 
55
- - type: shared
56
- source: sections/output-language-constraint.md
57
-
58
- - type: shared
59
- source: sections/output-format-constraint.md
60
-
61
55
  - type: shared
62
56
  source: sections/activation-preflight.md
63
57
  params:
@@ -79,6 +73,12 @@ sections:
79
73
  level: "WARN"
80
74
  message: "No requirements found. Run `/mvt-analyze` first. (allow user to proceed)"
81
75
 
76
+ - type: shared
77
+ source: sections/language-constraint.md
78
+
79
+ - type: shared
80
+ source: sections/output-format-constraint.md
81
+
82
82
  - type: file
83
83
  source: ./business.md
84
84
 
@@ -87,7 +87,7 @@ sections:
87
87
  ## Artifact Structure
88
88
  Read the document structure template from: `.ai-agents/skills/_templates/design-output.md`
89
89
  If a custom version exists at `.ai-agents/skills/_templates/custom/design-output.md`, use the custom version instead.
90
- The template defines section headings only. Generate content for each section based on design results.
90
+ The template defines section structure and guidance comments. Generate applicable content based on design results.
91
91
  Write the artifact to: `.ai-agents/workspace/artifacts/{change-id}/design.md`
92
92
 
93
93
  - type: shared