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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/README.md +299 -64
  2. package/README.zh-CN.md +419 -0
  3. package/dist/commands/install.d.ts.map +1 -1
  4. package/dist/commands/install.js +27 -2
  5. package/dist/commands/install.js.map +1 -1
  6. package/dist/commands/uninstall.d.ts.map +1 -1
  7. package/dist/commands/uninstall.js +19 -7
  8. package/dist/commands/uninstall.js.map +1 -1
  9. package/dist/commands/update.d.ts.map +1 -1
  10. package/dist/commands/update.js +4 -2
  11. package/dist/commands/update.js.map +1 -1
  12. package/dist/fs/install-manifest.d.ts +4 -1
  13. package/dist/fs/install-manifest.d.ts.map +1 -1
  14. package/dist/fs/install-manifest.js +13 -1
  15. package/dist/fs/install-manifest.js.map +1 -1
  16. package/dist/fs/materialize.d.ts +2 -0
  17. package/dist/fs/materialize.d.ts.map +1 -1
  18. package/dist/fs/materialize.js +46 -13
  19. package/dist/fs/materialize.js.map +1 -1
  20. package/dist/fs/registry-merge.d.ts +19 -0
  21. package/dist/fs/registry-merge.d.ts.map +1 -0
  22. package/dist/fs/registry-merge.js +220 -0
  23. package/dist/fs/registry-merge.js.map +1 -0
  24. package/dist/scripts/epic-update.cjs +7670 -0
  25. package/dist/scripts/plan-update.cjs +7736 -0
  26. package/dist/scripts/session-update.cjs +84 -6
  27. package/dist/types/platform.d.ts +12 -0
  28. package/dist/types/platform.d.ts.map +1 -0
  29. package/dist/types/platform.js +24 -0
  30. package/dist/types/platform.js.map +1 -0
  31. package/dist/types/registry.d.ts +3 -24
  32. package/dist/types/registry.d.ts.map +1 -1
  33. package/install-manifest.yaml +10 -2
  34. package/package.json +1 -1
  35. package/registry.yaml +72 -198
  36. package/sources/defaults/config.yaml +8 -13
  37. package/sources/defaults/project-context.yaml +2 -5
  38. package/sources/defaults/session.yaml +14 -2
  39. package/sources/knowledge/core/manifest.yaml +1 -4
  40. package/sources/scripts/epic-update.js +512 -0
  41. package/sources/scripts/plan-update.js +614 -0
  42. package/sources/scripts/session-update.js +102 -2
  43. package/sources/sections/activation-load-config.md +1 -1
  44. package/sources/sections/activation-load-context.md +42 -13
  45. package/sources/sections/activation-preflight.md +1 -1
  46. package/sources/sections/footer-next-steps.md +3 -2
  47. package/sources/sections/output-format-constraint.md +14 -0
  48. package/sources/sections/project-context-profile.md +29 -0
  49. package/sources/sections/session-update.md +41 -1
  50. package/sources/skills/mvt-analyze/business.md +46 -8
  51. package/sources/skills/mvt-analyze/manifest.yaml +8 -1
  52. package/sources/skills/mvt-analyze-code/business.md +18 -17
  53. package/sources/skills/mvt-analyze-code/manifest.yaml +9 -6
  54. package/sources/skills/mvt-check-context/business.md +13 -6
  55. package/sources/skills/mvt-check-context/manifest.yaml +0 -5
  56. package/sources/skills/mvt-cleanup/business.md +17 -2
  57. package/sources/skills/mvt-cleanup/manifest.yaml +3 -0
  58. package/sources/skills/mvt-config/business.md +5 -5
  59. package/sources/skills/mvt-config/manifest.yaml +3 -6
  60. package/sources/skills/mvt-create-skill/business.md +2 -14
  61. package/sources/skills/mvt-create-skill/manifest.yaml +2 -4
  62. package/sources/skills/mvt-decompose/business.md +94 -0
  63. package/sources/skills/mvt-decompose/manifest.yaml +121 -0
  64. package/sources/skills/mvt-design/manifest.yaml +3 -0
  65. package/sources/skills/mvt-fix/business.md +21 -6
  66. package/sources/skills/mvt-fix/manifest.yaml +4 -1
  67. package/sources/skills/mvt-help/business.md +11 -9
  68. package/sources/skills/mvt-help/manifest.yaml +0 -5
  69. package/sources/skills/mvt-implement/business.md +57 -10
  70. package/sources/skills/mvt-implement/manifest.yaml +3 -0
  71. package/sources/skills/mvt-init/business.md +23 -13
  72. package/sources/skills/mvt-init/manifest.yaml +4 -2
  73. package/sources/skills/mvt-manage-context/business.md +41 -14
  74. package/sources/skills/mvt-manage-context/manifest.yaml +7 -5
  75. package/sources/skills/mvt-plan-dev/business.md +17 -9
  76. package/sources/skills/mvt-plan-dev/manifest.yaml +3 -0
  77. package/sources/skills/mvt-quick-dev/business.md +22 -7
  78. package/sources/skills/mvt-quick-dev/manifest.yaml +3 -1
  79. package/sources/skills/mvt-refactor/business.md +32 -17
  80. package/sources/skills/mvt-refactor/manifest.yaml +2 -4
  81. package/sources/skills/mvt-resume/business.md +32 -12
  82. package/sources/skills/mvt-resume/manifest.yaml +3 -3
  83. package/sources/skills/mvt-review/business.md +24 -9
  84. package/sources/skills/mvt-review/manifest.yaml +3 -0
  85. package/sources/skills/mvt-status/business.md +37 -9
  86. package/sources/skills/mvt-status/manifest.yaml +2 -2
  87. package/sources/skills/mvt-sync-context/business.md +77 -34
  88. package/sources/skills/mvt-sync-context/manifest.yaml +6 -0
  89. package/sources/skills/mvt-template/business.md +1 -1
  90. package/sources/skills/mvt-template/manifest.yaml +0 -5
  91. package/sources/skills/mvt-test/business.md +30 -15
  92. package/sources/skills/mvt-test/manifest.yaml +3 -0
  93. package/sources/skills/mvt-update-plan/business.md +64 -33
  94. package/sources/skills/mvt-update-plan/manifest.yaml +10 -7
  95. package/sources/templates/decompose-output/body.md +13 -0
  96. package/sources/templates/decompose-output/manifest.yaml +11 -0
@@ -16,12 +16,27 @@
16
16
  3. State the current behavior in plain language; include any non-obvious side effects or invariants you can see in the code.
17
17
  - **Output of this step**: a target table (`file | range | role`) and a "current behavior" paragraph; both are shown to user before continuing.
18
18
 
19
- ### Step 3: Classify Refactoring Type
19
+ ### Step 3: Identify Project Scope and Load Project-Specific Knowledge
20
+
21
+ This step applies only when the workspace has multiple projects (`projects.length > 1` in `project-context.yaml`). In single-project workspaces, all relevant knowledge was loaded at activation; skip this step entirely.
22
+
23
+ - **Project identification**: match the file paths resolved in Step 2 against `projects[].path` and `projects[].source_paths`:
24
+ - A file whose path starts with a project's `path` prefix belongs to that project.
25
+ - A file under a project's `source_paths` entry also belongs to that project.
26
+ - Collect the set of unique project names from all matched files. This is the **active project scope** for this invocation.
27
+ - **On-demand knowledge loading**: for each project P in the active project scope, read `.ai-agents/registry.yaml` and load:
28
+ 1. Every entry under `knowledge.{P}` -- load each entry's referenced files (resolve relative to `.ai-agents/{source}`).
29
+ 2. Every entry under `skills.mvt-refactor.knowledge.{P}` -- load each entry's referenced files.
30
+ 3. Skip any key absent from the registry (no project-specific knowledge is valid; do not warn).
31
+ - **Multi-project scenario**: if files span multiple projects, load each project's knowledge sequentially. The skill operates with the union of all loaded project-specific knowledge plus the `_all` knowledge already loaded at activation.
32
+ - **Unmatched files**: if a file path does not match any project's `path` or `source_paths`, surface a note and treat it as belonging to the first project in `projects[]` (fallback). This may indicate a configuration gap in `project-context.yaml`.
33
+
34
+ ### Step 4: Classify Refactoring Type
20
35
  - **What**: pick the smallest type that covers the requested change. Use the Refactoring Types table above for risk levels.
21
36
  - **How**: assign one primary type per refactoring task. Multiple types in one run are allowed but each must be tracked separately in the artifact.
22
37
  - If the request requires `Change Interface/API` AND the symbol is exported beyond the project (public API, library entry point, IPC boundary): STOP -- this is no longer a refactoring task; recommend `/mvt-design`.
23
38
 
24
- ### Step 4: Risk Assessment
39
+ ### Step 5: Risk Assessment
25
40
  - **What**: assign a final risk score and decide whether explicit confirmation is needed.
26
41
  - **How**: combine refactoring type and impact factors.
27
42
 
@@ -34,11 +49,11 @@
34
49
  | User has uncommitted changes overlapping the target | +1 |
35
50
 
36
51
  - Final risk = type's base level + factors:
37
- - Low + 0..1 -> proceed silently in Step 7.
38
- - Medium OR Low + 2 -> require explicit confirmation in Step 6.
39
- - High OR (Medium + 2) -> require explicit confirmation AND a behavior-preservation strategy from Step 5.
52
+ - Low + 0..1 -> proceed silently in Step 8.
53
+ - Medium OR Low + 2 -> require explicit confirmation in Step 7.
54
+ - High OR (Medium + 2) -> require explicit confirmation AND a behavior-preservation strategy from Step 6.
40
55
 
41
- ### Step 5: Choose Behavior-Preservation Strategy
56
+ ### Step 6: Choose Behavior-Preservation Strategy
42
57
  - **What**: pick a verification path BEFORE editing.
43
58
  - **How**: choose the row that matches your test reality.
44
59
 
@@ -50,34 +65,34 @@
50
65
 
51
66
  - Document the chosen strategy in the artifact regardless of risk level.
52
67
 
53
- ### Step 6: Confirm with User (when required)
54
- - **Trigger**: per the Step 4 thresholds, or any High-risk type.
68
+ ### Step 7: Confirm with User (when required)
69
+ - **Trigger**: per the Step 5 thresholds, or any High-risk type.
55
70
  - **Format**: present a single screen with:
56
71
  - Target summary (Step 2's table, condensed to file count + symbol).
57
72
  - Refactoring type and risk level.
58
73
  - Number of callers and a list of the top 5 affected files.
59
- - Behavior-preservation strategy (Step 5).
74
+ - Behavior-preservation strategy (Step 6).
60
75
  - One yes/no prompt: `Proceed with this refactor? (y / n / show-plan)`.
61
76
 
62
- ### Step 7: Plan and Execute Incrementally
77
+ ### Step 8: Plan and Execute Incrementally
63
78
  - **What**: apply the change in the smallest reversible steps.
64
79
  - **How**:
65
80
  1. Break the refactor into ordered sub-steps (e.g., Rename: 1) update declaration, 2) update callers, 3) update tests, 4) update docs).
66
81
  2. After each sub-step:
67
82
  - Compile / type-check the affected files.
68
- - If a test command was identified in Step 5, run it (or surface it for user to run if running tests is not allowed in this environment).
83
+ - If a test command was identified in Step 6, run it (or surface it for user to run if running tests is not allowed in this environment).
69
84
  - On failure: revert the sub-step, surface the cause, do NOT continue.
70
85
  3. Do not interleave behavior changes (bug fixes, feature toggles) with the refactor. If you spot one, note it for follow-up; do not silently include it.
71
86
  4. Do not modify code outside the planned target unless required for compilation/type correctness; record any such "incidental" edits.
72
87
 
73
- ### Step 8: Verify Behavior Preservation
88
+ ### Step 9: Verify Behavior Preservation
74
89
  - **What**: prove (within the chosen strategy) that observable behavior is unchanged.
75
90
  - **How**:
76
91
  - With tests: all pre-existing tests pass; new characterization tests pass; assert pass count is unchanged or increased.
77
92
  - Without tests: list the call sites you visually verified, plus the manual behavior checks you recommend the user run.
78
- - If anything regresses: revert the most recent sub-step, surface the regression, return to Step 7. Do not declare success.
93
+ - If anything regresses: revert the most recent sub-step, surface the regression, return to Step 8. Do not declare success.
79
94
 
80
- ### Step 9: Write Refactor Notes
95
+ ### Step 10: Write Refactor Notes
81
96
  - **Path**: `.ai-agents/workspace/artifacts/{change-id}/refactor-notes.md` if `active_change` exists; otherwise inline summary in conversation only (shortcut mode).
82
97
  - **Required content**:
83
98
  - `Target` -- file/symbol list, current-behavior paragraph.
@@ -88,7 +103,7 @@
88
103
  - `Verification Result` -- tests run, pass/fail counts; or manual checks recommended.
89
104
  - `Follow-ups` -- deferred behavior changes spotted during refactoring.
90
105
 
91
- ### Step 10: State Update
106
+ ### Step 11: State Update
92
107
  Apply the State Update rules defined in the **State Update** section below.
93
108
 
94
109
  ## Edge Cases & Errors
@@ -98,8 +113,8 @@ Apply the State Update rules defined in the **State Update** section below.
98
113
  | Target spans multiple repos / submodules | STOP -- out of scope; recommend a coordinated change rather than a single refactor |
99
114
  | Refactor uncovers a real bug | Pause refactor, document the bug, recommend `/mvt-fix` -- do NOT fix during the refactor |
100
115
  | Refactor target is dead code | Confirm with user before deleting; offer alternative of marking deprecated first |
101
- | Symbol is referenced via reflection / dynamic dispatch / string lookup | Increase risk by +2; require strategy 5(a) (characterization test) before proceeding |
116
+ | Symbol is referenced via reflection / dynamic dispatch / string lookup | Increase risk by +2; require strategy 6(a) (characterization test) before proceeding |
102
117
  | User has uncommitted changes overlapping the target | Show diff, recommend committing/stashing first, ask for explicit confirmation if user wants to proceed anyway |
103
118
  | Type/test failures persist after revert | Surface a clear summary; suggest user re-run the original test baseline to detect a pre-existing failure unrelated to the refactor |
104
- | User aborts at Step 6 | Do not modify any file; report "no changes" |
119
+ | User aborts at Step 7 | Do not modify any file; report "no changes" |
105
120
  | Active change is mid-implementation (not yet `done`) | Warn that refactoring during implementation can confuse review/test phases; require explicit confirmation |
@@ -65,10 +65,8 @@ sections:
65
65
  - type: shared
66
66
  source: sections/output-language-constraint.md
67
67
 
68
- - type: inline
69
- content: |
70
- ### Step 4: Pre-flight Checks
71
- - No blocking checks required (shortcut operation).
68
+ - type: shared
69
+ source: sections/output-format-constraint.md
72
70
 
73
71
  - type: inline
74
72
  content: |
@@ -2,12 +2,23 @@
2
2
 
3
3
  ### Step 1: Read Session State
4
4
 
5
- Extract from the already-loaded session context:
6
- - `active_change` -- the current change-id (if any), plan_path
5
+ Read `.ai-agents/workspace/session.yaml`. If the file is missing or empty, jump to Step 8 with the "no session" branch.
6
+
7
+ Extract:
8
+ - `active_change` -- the current change-id (if any), plan_path, epic_id
9
+ - `active_epic` -- the current epic (if any): id, title, epic_path
7
10
  - `changes` -- list of changes with active plans
8
11
  - `history` -- last 20 entries (skill name, timestamp, change_id)
9
12
 
10
- If session.yaml is missing or empty, jump to Step 8 with the "no session" branch.
13
+ ### Step 1a: Check Epic State
14
+
15
+ After extracting session data in Step 1, check for epic state:
16
+
17
+ | Condition | Action |
18
+ |-----------|--------|
19
+ | `active_change.id` non-empty AND `active_change.epic_id` non-empty | Set `within_epic = true`. Continue to Step 2 (normal plan-based resume). In Step 7, include an Epic Context section. |
20
+ | `active_change.id` empty AND `active_epic.id` non-empty (epic-pending) | Read `epic.yaml` via `active_epic.epic_path`. If unreadable, warn and jump to Step 8 with the "epic-pending but epic.yaml missing" edge case. Otherwise, identify the child referenced by `epic.yaml.current_change` as the resume target. Skip Steps 2-6 and go directly to Step 7 with a simplified report containing: (1) **Epic State** -- epic title, id, status, progress (done/total); (2) **Current Sub-change** -- title, scope, depends_on status of each dependency; (3) **Resume Point** -- "Resuming epic: {title}. Next sub-change: {current_change_title}. Run `/mvt-analyze` to start."; (4) **Recommended Next Step** -- `/mvt-analyze` -- Start the next sub-change in the epic. |
21
+ | Neither | Continue to Step 2 (normal flow). |
11
22
 
12
23
  ### Step 2: Discover Pending Plans
13
24
 
@@ -56,18 +67,23 @@ For each artifact, capture: file path, mtime, size (in tokens estimate = chars /
56
67
 
57
68
  ### Step 5: Determine Resume Point
58
69
 
59
- Read the plan's `current_task`. The resume point = that task. Next-step recommendation = the task's `skill_hint` (or infer from task title if skill_hint is absent).
70
+ Read the plan's `current_tasks` map. The resume point = the task(s) referenced by `current_tasks`. Next-step recommendation = the relevant task's `skill_hint` (or infer from task title if skill_hint is absent).
71
+
72
+ For multi-project workspaces, if `current_tasks` has entries for multiple projects, display each project's current task separately.
60
73
 
61
74
  Also filter `history` to entries matching `change_id == selected_change_id` (entries with empty change_id are excluded from this filtered view).
62
75
 
76
+ If the plan-update script output from a previous session included a `project_switch` notification, surface it: "Last session crossed from {from} to {to} project."
77
+
63
78
  ### Step 6: Load Plan Progress
64
79
 
65
80
  Generate the **Plan Progress** section:
66
81
 
67
82
  - Read all tasks from plan.yaml.
68
- - Build a compact status table: `| # | id | title | status | skill_hint |`
69
- - Highlight `current_task` row (prefix with `>>` or bold).
83
+ - Build a compact status table: `| # | id | title | status | project | skill_hint |`
84
+ - Highlight `current_tasks` rows (prefix with `>>` or bold).
70
85
  - Count summary: `Done: {d}, In Progress: {ip}, Pending: {p}, Blocked: {b}, Skipped: {s}`
86
+ - If any task has `deliverables.freshness == "stale"`, append a warning: "Stale deliverables: {task_ids} -- downstream tasks may be out of date. Run `/mvt-implement` to refresh."
71
87
 
72
88
  And the **Current Task Detail** section:
73
89
 
@@ -82,11 +98,12 @@ And the **Current Task Detail** section:
82
98
  Render via the `resume-output.md` template. Sections to fill:
83
99
 
84
100
  1. **Active Task** -- name, change-id, started_at (from selected plan)
85
- 2. **Plan Progress** -- task table + counts + current task detail
86
- 3. **Recent Skill History** -- last 5 entries from history (filtered to selected change if applicable)
87
- 4. **Recent Artifacts** -- the top 5 artifacts collected in Step 4 (path, mtime, size)
88
- 5. **Resume Point** -- a one-paragraph natural-language summary of "where we are"
89
- 6. **Recommended Next Step** -- the mapped next skill from Step 5, with justification
101
+ 2. **Epic Context** (if `within_epic` is true) -- epic title, id, progress (done/total children), current position within the epic. Resolve the parent epic path: compare `active_change.epic_id` to `active_epic.id`. If they match, use `active_epic.epic_path`. If they do not match, search `session.epics[]` for an entry with `id == active_change.epic_id` and use its `epic_path`. If neither path exists, render the plan resume and add a bounded warning: "Epic context could not be loaded (epic_id: {active_change.epic_id})." Read `epic.yaml` via the resolved path and render: "This change is part of epic: **{epic_title}** ({done}/{total} sub-changes done). Current: {active_child_title}."
102
+ 3. **Plan Progress** -- task table + counts + current task detail
103
+ 4. **Recent Skill History** -- last 5 entries from history (filtered to selected change if applicable)
104
+ 5. **Recent Artifacts** -- the top 5 artifacts collected in Step 4 (path, mtime, size)
105
+ 6. **Resume Point** -- a one-paragraph natural-language summary of "where we are"
106
+ 7. **Recommended Next Step** -- the mapped next skill from Step 5, with justification
90
107
 
91
108
  ### Step 8: Edge Cases
92
109
 
@@ -94,4 +111,7 @@ Render via the `resume-output.md` template. Sections to fill:
94
111
  - **No active plans**: report "No active plans found. Start a new change with `/mvt-analyze` or run `/mvt-status` to check project state."
95
112
  - **Selected change but referenced artifacts missing**: warn "Artifact directory `{path}` not found -- task state may be stale. Verify with `/mvt-status` or run `/mvt-cleanup`."
96
113
  - **Plan exists but plan.yaml is invalid** (parse error or schema violation): warn "plan.yaml is corrupted or invalid. Run `/mvt-plan-dev` to regenerate, or `/mvt-status` to inspect."
97
- - **Stale task warning**: If plan's `current_task` has status `in_progress` but the plan's `updated_at` is more than 5 days old, append a notice: "Current task has been in_progress for {N} days without updates. Consider running `/mvt-update-plan` to refresh status."
114
+ - **Stale task warning**: If plan's `current_tasks` entries reference tasks with status `in_progress` but the plan's `updated_at` is more than 5 days old, append a notice: "Current task has been in_progress for {N} days without updates. Consider running `/mvt-update-plan` to refresh status."
115
+ - **Stale deliverables warning**: If any task has `deliverables.freshness == "stale"`, warn: "Task(s) {ids} have stale deliverables. Downstream tasks may reference outdated contracts. Run `/mvt-implement` to refresh."
116
+ - **Epic-pending but epic.yaml missing**: warn "Epic state references `epic_path` but file not found at `{path}`. Run `/mvt-status` to inspect or `/mvt-cleanup` to archive stale entries."
117
+ - **Epic-pending but current_change empty or invalid**: warn "Epic `current_change` is empty or points to a non-existent child. Run `/mvt-status` to inspect the epic state."
@@ -30,8 +30,8 @@ sections:
30
30
  - rule: "Exactly one in_progress plan found -> Auto-select it and proceed"
31
31
  - rule: "No plans found -> Report no active plans, suggest `/mvt-analyze` or `/mvt-plan-dev`"
32
32
  - rule: "active_change is empty AND history is empty AND no plans -> Recommend `/mvt-init` or `/mvt-status`"
33
- - rule: "Plan exists and has current_task -> Use current_task's skill_hint as next-step recommendation"
34
- - rule: "Plan's current_task has been in_progress for >5 days -> Surface stale warning"
33
+ - rule: "Plan exists and has current_tasks -> Use current_tasks entry's skill_hint as next-step recommendation"
34
+ - rule: "Plan's current_tasks entry has been in_progress for >5 days -> Surface stale warning"
35
35
  - rule: "Last skill was interrupted -> Surface the context, suggest retry"
36
36
  boundaries:
37
37
  - scope: "read git state (branch, diff, commits)"
@@ -70,7 +70,7 @@ sections:
70
70
  current_skill: mvt-resume
71
71
  conditional_suggestions:
72
72
  conditions:
73
- - condition: "plan has current_task with skill_hint"
73
+ - condition: "plan has current_tasks entry with skill_hint"
74
74
  primary: mvt-implement
75
75
  primary_desc: "Continue with the next planned task (use skill_hint)"
76
76
  - condition: "no active plans found"
@@ -4,7 +4,7 @@
4
4
  - **Required**:
5
5
  - The set of files to review (see Step 2 for resolution).
6
6
  - **Fallback**:
7
- - If `design.md`/`implementation.md` are missing, downgrade to "code-only review": skip the design-compliance checks (Step 4 row group A) and note the limitation in the artifact.
7
+ - If `design.md`/`implementation.md` are missing, downgrade to "code-only review": skip the design-compliance checks (Step 5 row group A) and note the limitation in the artifact.
8
8
  - If `project-context.md` is missing, skip layer-compliance checks and note the limitation.
9
9
 
10
10
  ### Step 2: Resolve Review Target
@@ -22,12 +22,27 @@
22
22
  - If the resolved list is empty, STOP and ask the user to specify the target.
23
23
  - If the list exceeds ~30 files, ask the user to scope down OR confirm a high-level (per-module) review depth.
24
24
 
25
- ### Step 3: Determine Review Depth
26
- - **Default**: full review across all axes (Step 4).
25
+ ### Step 3: Identify Project Scope and Load Project-Specific Knowledge
26
+
27
+ This step applies only when the workspace has multiple projects (`projects.length > 1` in `project-context.yaml`). In single-project workspaces, all relevant knowledge was loaded at activation; skip this step entirely.
28
+
29
+ - **Project identification**: match the file paths resolved in Step 2 against `projects[].path` and `projects[].source_paths`:
30
+ - A file whose path starts with a project's `path` prefix belongs to that project.
31
+ - A file under a project's `source_paths` entry also belongs to that project.
32
+ - Collect the set of unique project names from all matched files. This is the **active project scope** for this invocation.
33
+ - **On-demand knowledge loading**: for each project P in the active project scope, read `.ai-agents/registry.yaml` and load:
34
+ 1. Every entry under `knowledge.{P}` -- load each entry's referenced files (resolve relative to `.ai-agents/{source}`).
35
+ 2. Every entry under `skills.mvt-review.knowledge.{P}` -- load each entry's referenced files.
36
+ 3. Skip any key absent from the registry (no project-specific knowledge is valid; do not warn).
37
+ - **Multi-project scenario**: if files span multiple projects, load each project's knowledge sequentially. The skill operates with the union of all loaded project-specific knowledge plus the `_all` knowledge already loaded at activation.
38
+ - **Unmatched files**: if a file path does not match any project's `path` or `source_paths`, surface a note and treat it as belonging to the first project in `projects[]` (fallback). This may indicate a configuration gap in `project-context.yaml`.
39
+
40
+ ### Step 4: Determine Review Depth
41
+ - **Default**: full review across all axes (Step 5).
27
42
  - `--aspect <name>`: narrow to a single axis. Supported aspects: `architecture`, `quality`, `errors`, `edge-cases`, `security`, `naming`, `tests`. Other aspects -> ask user to clarify.
28
43
  - For files >300 lines, do a structural pass first (interfaces, exports, key paths) before line-level review; do not attempt line-by-line on huge files.
29
44
 
30
- ### Step 4: Run Review Checks
45
+ ### Step 5: Run Review Checks
31
46
  - **What**: produce findings, each tagged with severity, location, and a concrete remedy.
32
47
  - **How**: walk the checklist below. Skip any group whose inputs were missing per Step 1 fallback notes.
33
48
 
@@ -39,7 +54,7 @@
39
54
 
40
55
  **Group B -- Code Quality**
41
56
  - Functions are small and focused; flag functions > ~50 lines or with > ~3 nested control levels.
42
- - Naming is clear, consistent with `naming-conventions.md`, and matches surrounding code.
57
+ - Naming is clear, consistent with the naming conventions loaded by activation (if any), and matches surrounding code.
43
58
  - No duplication: same logic appearing >= 3 times warrants extraction.
44
59
  - No premature abstraction: a single-use helper / interface / wrapper is a finding.
45
60
  - No dead code, unused imports, commented-out blocks left behind.
@@ -68,7 +83,7 @@
68
83
  - Auth/authz checks present on every protected endpoint or operation.
69
84
  - SQL/NoSQL/HTML rendered through parameterized / escaped APIs.
70
85
 
71
- ### Step 5: Categorize and De-duplicate Findings
86
+ ### Step 6: Categorize and De-duplicate Findings
72
87
  - **Severity**: assign each finding using the table below.
73
88
 
74
89
  | Level | Definition | Examples |
@@ -80,7 +95,7 @@
80
95
  - Merge duplicate findings (same root cause appearing in multiple files) into one entry with a list of locations.
81
96
  - Each finding must include: file, line range, severity, observation, recommendation.
82
97
 
83
- ### Step 6: Write Artifact
98
+ ### Step 7: Write Artifact
84
99
  - **Path and template**: as defined in the **Artifact Structure** section below. If no `active_change` exists, use `.ai-agents/workspace/artifacts/_ad-hoc-review-{YYYY-MM-DD-HHMM}/review.md`.
85
100
  - **Required content** (mapped to template headings):
86
101
  - `Review Scope` -- file list, depth, aspect filter, fallbacks applied (e.g., "design.md missing -> Group A skipped").
@@ -91,13 +106,13 @@
91
106
  - `Skipped Checks` -- groups skipped because inputs were missing, with reason.
92
107
  - `Recommended Next Skill` -- e.g., `/mvt-fix` for Critical, `/mvt-test` if Group E gaps, `/mvt-refactor` if Group B is dominant.
93
108
 
94
- ### Step 7: Verdict Rule
109
+ ### Step 8: Verdict Rule
95
110
  - Critical > 0 -> verdict is `Request changes`. Suggest `/mvt-fix`.
96
111
  - Critical = 0, Warnings > 5 -> verdict is `Approve with comments`.
97
112
  - Critical = 0, Warnings <= 5, Suggestions only -> verdict is `Approve`.
98
113
  - Code-only review (design.md missing) -> verdict cannot be higher than `Approve with comments` (call it out explicitly).
99
114
 
100
- ### Step 8: State Update
115
+ ### Step 9: State Update
101
116
  Apply the State Update rules defined in the **State Update** section below.
102
117
 
103
118
  ## Edge Cases & Errors
@@ -62,6 +62,9 @@ sections:
62
62
  - type: shared
63
63
  source: sections/output-language-constraint.md
64
64
 
65
+ - type: shared
66
+ source: sections/output-format-constraint.md
67
+
65
68
  - type: shared
66
69
  source: sections/activation-preflight.md
67
70
  params:
@@ -11,16 +11,16 @@
11
11
  ### Step 2: Build Activity Timeline
12
12
  - **What**: produce the most-recent-first list of history entries with derived metadata.
13
13
  - **How**:
14
- 1. Read `history` from `session.yaml`.
14
+ 1. Read `.ai-agents/workspace/session.yaml`, extract `history`.
15
15
  2. For each entry, attach: relative time (e.g., "2h ago"), `change_id` (if present), and the originating skill name.
16
16
  3. Limit to the last 10 entries for the rendered table; keep full count separately for the summary line.
17
17
 
18
18
  ### Step 3: Discover All Plans (Multi-Change Dashboard)
19
19
  - **What**: produce the canonical plan list across the workspace.
20
20
  - **How**:
21
- 1. Iterate `changes[]` from `session.yaml`. For each entry with a `plan_path`, attempt to read the plan file.
21
+ 1. From the session data loaded above, iterate `changes[]`. For each entry with a `plan_path`, attempt to read the plan file.
22
22
  2. Glob `.ai-agents/workspace/artifacts/*/plan.yaml` to find any plans not registered in `changes` (mark them `unindexed`). **Exclude paths under `artifacts/_archived/`** — those are completed changes archived by `/mvt-cleanup`.
23
- 3. For each plan, extract: `change_id`, `title`, `status`, `current_task`, task progress (`done/total`), `updated_at`, `skill_hint` (from current task if present).
23
+ 3. For each plan, extract: `change_id`, `title`, `status`, `current_tasks`, task progress (`done/total`), `updated_at`, `skill_hint` (from current task if present).
24
24
  4. If a plan file is present but malformed, include a row with `(corrupt)` in the status column and mark the file path; do not abort.
25
25
  - **Branches**:
26
26
 
@@ -38,19 +38,44 @@
38
38
  2. **Projects** -- table: name | type | tech stack (truncated). Cap at 10 rows; collapse the rest into `+N more`.
39
39
  3. **Semantic Context** -- one line: `project-context.md present` / `missing -- run /mvt-analyze-code`.
40
40
  4. **Active Change** -- if `active_change` exists: id, title, start time. Else: `none`.
41
+ 4a. **Epic Progress** -- if `active_epic.id` is non-empty:
42
+ - Read `epic.yaml` via `active_epic.epic_path`. If the file is missing or unreadable, render `(epic.yaml not found at {path})` and skip this section.
43
+ - Compute progress: count children with `status` in `["done", "abandoned"]` as completed; total = `children.length`.
44
+ - Render:
45
+
46
+ ```markdown
47
+ ## Epic: {epic_title} ({epic_id})
48
+ Progress: {done}/{total} done -- Status: {status}
49
+
50
+ | Sub-change | Status | depends_on | Internal Progress |
51
+ |------------|--------|------------|-------------------|
52
+ | {title} | {status} | {deps or --} | {plan progress or --} |
53
+ ```
54
+
55
+ - For each child in `epic.yaml.children[]`:
56
+ - `depends_on`: comma-separated list of change_ids, or `--` if empty.
57
+ - `Internal Progress`: for a child with `status: active`, attempt to read its plan.yaml from `.ai-agents/workspace/artifacts/{change_id}/plan.yaml`. If found, show `{done_count}/{total_count} tasks`. If not found, show `--`. For non-active children, show `--`.
58
+ - Below the table, render a context line:
59
+ - If `active_change.id` is non-empty (within-epic active change): "Current: **{active_child_title}**. Run `/mvt-resume` to continue."
60
+ - If `active_change.id` is empty (epic-pending state): "Next sub-change: **{current_change_title}**. Run `/mvt-analyze` to start."
41
61
  5. **Changes Overview** -- table from Step 3 (skip if no plans). Render with these columns:
42
62
 
43
- | change-id | title | status | progress | current_task | updated_at |
44
- |-----------|-------|--------|----------|--------------|------------|
63
+ | change-id | title | status | progress | current_tasks | project | updated_at |
64
+ |-----------|-------|--------|----------|---------------|---------|------------|
65
+
66
+ For `current_tasks`, display as a compact representation: if single-project, show the task id only; if multi-project, show `web: t2, api: t1` format. The `project` column lists the distinct projects across all tasks in the plan.
67
+
68
+ If any task has `deliverables.freshness == "stale"`, append a warning row: "Stale deliverables: {task_ids} -- run `/mvt-implement` to refresh"
45
69
  6. **Skill History** -- last 5 rows of the timeline from Step 2.
46
70
 
47
71
  - Hard cap: total rendered output should not exceed ~120 lines. If it would, truncate Skill History first; never truncate the active change or Changes Overview header rows.
48
72
 
49
73
  ### Step 5: Suggest Next Step
50
74
  - Resolution order (first match wins):
51
- 1. `active_change` has a plan in `in_progress`, `current_task` is set -> suggest the task's `skill_hint` (or, if missing, recommend `/mvt-update-plan` to set `current_task`).
52
- 2. `project-context.md` is missing -> suggest `/mvt-analyze-code`.
53
- 3. No `active_change` or no active plan -> suggest `/mvt-analyze` to start a new feature OR `/mvt-help` to browse the catalog.
75
+ 1. `active_change` has a plan in `in_progress`, `current_tasks` has entries -> suggest the relevant task's `skill_hint` (or, if missing, recommend `/mvt-update-plan` to set `current_tasks`).
76
+ 2. `active_epic.id` non-empty AND `active_change.id` empty (epic-pending state) -> suggest `/mvt-analyze` -- Start the next sub-change in the epic.
77
+ 3. `project-context.md` is missing -> suggest `/mvt-analyze-code`.
78
+ 4. No `active_change` or no active plan -> suggest `/mvt-analyze` to start a new feature OR `/mvt-help` to browse the catalog.
54
79
  - The suggestion must be a single line: skill command + one-clause reason.
55
80
 
56
81
  ## Edge Cases & Errors
@@ -60,8 +85,11 @@
60
85
  | `session.yaml` missing entirely | Render a minimal report (Projects section if available) and recommend `/mvt-init` |
61
86
  | `session.yaml` corrupt (parse error) | Surface error with file path, render Projects only, recommend `/mvt-init` to reinitialize |
62
87
  | `changes[]` references a `plan_path` that no longer exists | Include in Changes Overview with `(missing)` marker; do not delete the index entry from this skill |
63
- | Plan file's `current_task` references a task id not in `tasks[]` | Render `current_task` as `(invalid: <id>)`; do not attempt to fix |
88
+ | Plan file's `current_tasks` references a task id not in `tasks[]` | Render `current_tasks` entry as `(invalid: <id>)`; do not attempt to fix |
64
89
  | Plan file's `status` is not one of the known values | Render the raw value verbatim; flag in skip-checks of the report |
65
90
  | Both `changes[]` and the artifact glob find the same plan | Deduplicate by `change_id`; prefer the indexed entry's metadata |
66
91
  | Multiple `in_progress` plans | All rendered in Changes Overview; Step 5's suggestion picks the most recently updated; mention the count in the suggestion line |
67
92
  | Workspace contains zero projects | Render header only with a single suggestion: `/mvt-init` |
93
+ | `active_epic.epic_path` points to missing `epic.yaml` | Render `(epic.yaml not found at {path})` in Epic Progress section; skip the section |
94
+ | `epic.yaml` parse error | Surface one-line error with file path, skip Epic Progress section; do not attempt repair |
95
+ | `epic.yaml.current_change` points to non-existent child | Show `(invalid: {id})` in the child table context line |
@@ -25,7 +25,7 @@ sections:
25
25
  - rule: "If workflow in progress -> Highlight recent skill history and next recommended step"
26
26
  - rule: "If project-context.md missing -> Suggest `/mvt-analyze-code` to generate semantic context"
27
27
  - rule: "If one or more plans exist -> Show Changes Overview table with progress for all plans"
28
- - rule: "If an in_progress plan has a current_task -> Suggest the matching skill_hint as next step"
28
+ - rule: "If an in_progress plan has current_tasks -> Suggest the matching skill_hint as next step"
29
29
  boundaries:
30
30
  - scope: "analyze requirements"
31
31
  skill: "/mvt-analyze"
@@ -63,7 +63,7 @@ sections:
63
63
  current_skill: mvt-status
64
64
  conditional_suggestions:
65
65
  conditions:
66
- - condition: "active change with current_task"
66
+ - condition: "active change with current_tasks"
67
67
  primary: mvt-resume
68
68
  primary_desc: "Resume work on the current task"
69
69
  - condition: "project-context.md missing"