@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
@@ -44,12 +44,6 @@ sections:
44
44
  - type: shared
45
45
  source: sections/activation-load-config.md
46
46
 
47
- - type: shared
48
- source: sections/output-language-constraint.md
49
-
50
- - type: shared
51
- source: sections/output-format-constraint.md
52
-
53
47
  - type: shared
54
48
  source: sections/activation-preflight.md
55
49
  params:
@@ -59,6 +53,12 @@ sections:
59
53
  level: "WARN"
60
54
  message: 'Session not initialized. Run `/mvt-init` first.'
61
55
 
56
+ - type: shared
57
+ source: sections/language-constraint.md
58
+
59
+ - type: shared
60
+ source: sections/output-format-constraint.md
61
+
62
62
  - type: inline
63
63
  content: |
64
64
  ## Operation Mode: Shortcut
@@ -2,12 +2,19 @@
2
2
 
3
3
  ### Step 1: Load Inputs
4
4
  - **Recommended**:
5
- - `.ai-agents/knowledge/project/_generated/project-context.md` -- existence check only, to detect whether semantic context has been generated.
5
+ - `.ai-agents/knowledge/project/_generated/project-context.md` -- existence check only, to detect whether semantic context has been generated. This generated semantic context (`.md`) is distinct from the structural project index (`.ai-agents/workspace/project-context.yaml`) loaded during activation.
6
6
  - **Fallback**: any missing optional file is treated as "feature absent" for assessment purposes; do not abort. If `registry.yaml` itself is missing, surface the error and recommend `mvtt install`.
7
7
 
8
8
  ### Step 2: Assess User Position
9
9
  - **What**: pick exactly one recommended next skill based on the current workspace state.
10
10
  - **How**: walk the table top-to-bottom; the first row whose condition holds wins.
11
+ - **Evidence conventions**:
12
+ - Active change artifacts resolve under `.ai-agents/workspace/artifacts/{active_change.id}/`.
13
+ - `analysis.md`, `design.md`, `implementation.md`, `review.md`, and `test-design.md` refer to files in the active change artifact directory unless stated otherwise.
14
+ - Completed skill history matches `session.yaml > history[].skill` exactly, using the `/mvt-` prefix and case-sensitive skill name. When `active_change.id` is non-empty, prefer history rows whose `change_id` matches the active change; use unmatched history only as fallback context.
15
+ - `Change Tracking lists > 5 files` means `design.md > ## Change Tracking` names more than five affected files.
16
+ - A `review.md` has Critical findings when its severity summary or Critical Issues section reports one or more Critical findings.
17
+ - **Runtime recommendation**: store the winning row as the primary runtime recommendation. Use that same recommendation in Current Status, "What should I do next?" answers, and as the first Suggested Next Steps item.
11
18
 
12
19
  | Condition | Recommendation |
13
20
  |-----------|---------------|
@@ -20,13 +27,13 @@
20
27
  | `design.md` exists, change is large (Change Tracking lists > 5 files OR ADR includes breaking change OR > 1 new module) | `/mvt-plan-dev` -- Decompose into tracked plan |
21
28
  | `design.md` (or `plan.yaml`) ready, no `implementation.md` | `/mvt-implement` -- Implement the design |
22
29
  | `implementation.md` exists, no `review.md` | `/mvt-review` -- Review the code |
30
+ | `review.md` has Critical findings | `/mvt-fix` -- Fix critical issues before continuing; surface prominently above the catalog |
23
31
  | `review.md` exists with no Critical findings, no `test-design.md` | `/mvt-test` -- Write tests |
24
- | `review.md` has Critical findings | `/mvt-fix` -- Fix critical issues before continuing |
25
32
  | All of the above complete | `/mvt-cleanup` -- Tidy artifacts, OR start a new feature with `/mvt-analyze` |
26
33
 
27
34
  ### Step 3: Display Skills Catalog
28
35
  Read `registry.yaml` > `skills` section.
29
- Display all skills as a single flat table (no grouping; the section comment headers in `registry.yaml` already group them by role for human readers):
36
+ Display all skills as a single flat table:
30
37
  - Header row: `Skill | Description`
31
38
 
32
39
  For each skill, show: `/{skill-name}` | `description` field from registry.
@@ -46,9 +53,13 @@ flowchart LR
46
53
  C -.->|epic scale| DC[decompose]
47
54
  DC --> C2[analyze<br/>epic-child]
48
55
  C2 --> D
56
+
57
+ classDef done fill:#c6efce,stroke:#2e7d32,color:#2e7d32
58
+ classDef current fill:#ffeb9c,stroke:#f59e0b,color:#b45309
59
+ classDef pending fill:#f0f0f0,stroke:#9ca3af,color:#6b7280
49
60
  ```
50
61
 
51
- Color-code based on current progress: green (done), yellow (current/recommended), gray (pending). The "current" node is whichever skill the Step 2 table recommended; "done" is determined by the same evidence the Step 2 table consumed.
62
+ Apply `:::done`, `:::current`, and `:::pending` to nodes based on current progress: green/done, yellow/current recommendation, gray/pending. The "current" node is whichever skill the Step 2 table recommended; "done" is determined by the same evidence the Step 2 table consumed.
52
63
 
53
64
  ### Step 5: Respond to User Questions
54
65
  - **What**: handle the user's free-form question after the catalog is rendered.
@@ -56,10 +67,10 @@ Color-code based on current progress: green (done), yellow (current/recommended)
56
67
 
57
68
  | Question pattern | Response |
58
69
  |------------------|----------|
59
- | "What should I do next?" / no specific question | Repeat the Step 2 recommendation in one line, followed by a one-clause reason citing the matched condition |
60
- | "What does `/mvt-X` do?" / asks about a specific skill | Read the skill's metadata from `registry.yaml`, show: name, description, knowledge entries (if any), template (if any). Mention "see the skill's SKILL.md for the full procedure" -- do NOT inline the full SKILL.md content (too large) |
70
+ | "What should I do next?" / no specific question | Repeat the primary runtime recommendation in one line, followed by a reason explaining why the matched current state fact applies |
71
+ | "What does `/mvt-X` do?" / asks about a specific skill | Read the skill's metadata from `registry.yaml`; show name and description. If `template` exists, mention it. If `custom: true` is set, note it. If `knowledge` exists on that skill entry, show it; otherwise omit knowledge. Mention "see the skill's SKILL.md for the full procedure" -- do NOT inline the full SKILL.md content (too large) |
61
72
  | "Compare `/mvt-X` and `/mvt-Y`" | Pull descriptions from registry; if both are workflow skills, mention their relative position in the diagram |
62
- | Asks about something not in registry | Reply: "No skill matches that. Available skills: see catalog above." Do not invent skills |
73
+ | Asks about something not in registry | Do not invent skills. Use simple keyword overlap against skill names and descriptions in `registry.yaml`; if there are close matches, show up to two "closest matches" with one-line reasons. If no close matches exist, say no skill matches and point to the catalog. |
63
74
 
64
75
  ## Edge Cases & Errors
65
76
 
@@ -68,7 +79,6 @@ Color-code based on current progress: green (done), yellow (current/recommended)
68
79
  | `registry.yaml` missing | STOP at Step 1; recommend `mvtt install`; show no catalog |
69
80
  | `session.yaml` missing | Render catalog (Step 3) and diagram (Step 4) without the "current position" highlight; Step 2 recommends `/mvt-init` |
70
81
  | `changes[]` references a `plan_path` that no longer exists | Ignore for help purposes; do not warn -- `/mvt-status` is the right place for that |
71
- | User invokes `/mvt-help` while inside an active change with Critical review findings | Step 2's recommendation is `/mvt-fix`; surface this prominently above the catalog |
72
82
  | User asks about a custom skill (registry entry with `custom: true`) | Treat identically to built-ins; the only difference is showing `custom: true` in the metadata view |
73
- | Workflow diagram cannot be rendered (mermaid unsupported in environment) | Fall back to a textual flow: `init -> analyze-code -> analyze -> [decompose (epic) -> analyze (epic-child)] -> design -> [plan-dev] -> implement -> review -> test` |
83
+ | Workflow diagram cannot be rendered (mermaid unsupported in environment) | Fall back to a textual flow: `init -> analyze-code -> analyze -> [decompose (epic) -> analyze (epic-child)] -> design -> [plan-dev] -> implement -> review -> test`; mark nodes with `[done]`, `[current]`, or `[pending]` using the same evidence rules |
74
84
  | Epic-pending state (`active_epic` non-empty, `active_change` empty) | Step 2's recommendation is `/mvt-analyze` to start the next sub-change; the decompose path is shown in the workflow diagram |
@@ -24,6 +24,9 @@ sections:
24
24
  - type: shared
25
25
  source: sections/activation-load-config.md
26
26
 
27
+ - type: shared
28
+ source: sections/language-constraint.md
29
+
27
30
  - type: file
28
31
  source: ./business.md
29
32
 
@@ -37,15 +40,15 @@ sections:
37
40
  ## MVT Help
38
41
 
39
42
  ### Current Status
40
- - **Project**: {name} ({initialized/not initialized})
43
+ - **Project**: {project names from `project-context.yaml > projects[]`, comma-separated} ({initialized/not initialized from `session.yaml > session.initialized_at`})
41
44
  - **Last Skill**: {last command from history}
42
- - **Recommended Next**: `/mvt-{next}` -- {description}
45
+ - **Recommended Next**: {primary runtime recommendation from Step 2}
43
46
 
44
47
  ### Workflow
45
48
  {Mermaid flowchart with current position highlighted}
46
49
 
47
50
  ### Available Skills
48
- {Skills tables grouped by category, as defined in Step 3}
51
+ {Single flat skills table, sorted by registry declaration order}
49
52
  ```
50
53
 
51
54
  - type: shared
@@ -57,14 +60,3 @@ sections:
57
60
  source: sections/footer-next-steps.md
58
61
  params:
59
62
  current_skill: mvt-help
60
- conditional_suggestions:
61
- conditions:
62
- - condition: "project not initialized"
63
- primary: mvt-init
64
- primary_desc: "Initialize the project"
65
- - condition: "project initialized, no active change"
66
- primary: mvt-analyze
67
- primary_desc: "Start analyzing requirements for a new feature"
68
- - condition: "active change in progress"
69
- primary: mvt-resume
70
- primary_desc: "Resume work on the active change"
@@ -11,10 +11,12 @@
11
11
  - **What**: produce an ordered file list with the smallest possible commit boundary per group.
12
12
  - **How**:
13
13
  1. Take `Change Tracking` from `design.md` as the source of truth for which files are in scope.
14
- 2. Topologically order files by dependency: domain entities -> repositories/adapters -> use-case/services -> controllers/UI.
15
- 3. Group consecutive files that share a single conceptual change into one commit boundary.
16
- 4. For each file, decide: `create | modify | delete`, and write a one-line intent.
17
- - **Plan-aware behavior**: if `plan.yaml` is present, identify the active task from `current_tasks` (the entry matching the current project, or the sole entry in single-project mode), then treat that task's `artifacts.files` (cross-reference `plan.tasks[*].artifacts.files`) as a **starting-scope hint, not a hard ceiling**. The source of truth for scope remains `design.md`'s `Change Tracking` (per Step 2.1). When `artifacts.files` is `null` or empty, derive scope entirely from `Change Tracking`. If implementation reveals files beyond this hint are genuinely required, do NOT silently expand — surface them via Step 3 confirmation and never absorb files that clearly belong to a different task.
14
+ 2. Derive dependencies from `Module Design`, `Key Interfaces`, and `Data Flow`.
15
+ 3. Order files dependency-first: shared types/contracts -> dependency-free internals -> dependents -> entry points/controllers/routes/UI shells.
16
+ 4. For async/event flows: event schemas first; then producers and consumers after shared contracts. Put producers before consumers only when consumers import producer-side types.
17
+ 5. Group consecutive files that share a single conceptual change into one commit boundary.
18
+ 6. For each file, decide: `create | modify | delete`, and write a one-line intent.
19
+ - **Plan-aware behavior**: if `plan.yaml` exists, resolve one active task before planning. Candidate task ids come from deduplicated `current_tasks`; if one remains, use it. If several remain, prefer an explicit user task id, then match current paths against each candidate's `artifacts.files` and project paths; if still ambiguous, ask the user. Treat the resolved task's `artifacts.files` as a starting-scope hint only; `design.md` Change Tracking remains authoritative. Confirm Step 3 before touching files beyond the hint, and never absorb files that belong to another task.
18
20
  - **Output of this step**: an in-conversation list shown to user as a preview, with no write yet.
19
21
 
20
22
  ### Step 3: Confirm Scope (when needed)
@@ -39,18 +41,19 @@
39
41
 
40
42
  ### Step 5: Verify Design Compliance
41
43
  - **What**: confirm the implementation matches the design before writing the artifact.
42
- - **How**: run the checks below. Each is either Auto (mechanical / scriptable / type-checker) or Manual (read the design + diff).
44
+ - **How**: run the checks below and record the result in `implementation.md > Design Compliance`. `mvt-review` will use this section as an input and independently verify claimed passes or undocumented deviations.
43
45
 
44
- | Check | Mode | Action on failure |
45
- |-------|------|-------------------|
46
- | Files touched == Change Tracking ± deviation noted | Auto (compare lists) | Update artifact's deviation log OR revert extras |
47
- | Each file lives in the module/layer assigned by `Module Design` | Auto (path match against design table) | Move file or mark deliberate exception with rationale |
48
- | Public interfaces match `Key Interfaces` (signatures, endpoints) | Auto (grep for declarations) | Adjust to match OR raise as deliberate change requiring `/mvt-design` re-run |
49
- | Forbidden cross-layer imports absent | Auto (grep import paths against `project-context.md` rules) | BLOCK -- must fix before artifact write |
50
- | Error handling lives only at boundaries listed in design | Manual (read code) | Refactor or document why an interior catch was needed |
51
- | No new external deps not listed in `design.md` ADRs | Auto (diff package manifests) | Either remove or add an ADR via `/mvt-design` |
46
+ | Check | Mode | Failure level | Action on failure |
47
+ |-------|------|---------------|-------------------|
48
+ | Files touched == Change Tracking ± deviation noted | Auto (mechanical list compare) | WARN-and-document | Update `Deviations from Design` OR revert extras |
49
+ | Each file lives in the module/layer assigned by `Module Design` | Semi-auto (path heuristic; downgrade to Manual if design tables lack path/module mapping) | WARN-and-document | Move file or mark deliberate exception with rationale |
50
+ | Public interfaces match `Key Interfaces` (signatures, endpoints) | Semi-auto (grep can find declarations; signature compatibility is Manual) | BLOCK | Adjust to match OR stop and require `/mvt-design` re-run for a deliberate contract change |
51
+ | Forbidden cross-layer imports absent | Auto (mechanical grep against `project-context.md` rules) | BLOCK | Fix before artifact write |
52
+ | Error handling lives only at boundaries listed in design | Manual (read code) | FIX-in-place | Refactor or document why an interior catch was needed |
53
+ | No new external deps not listed in `design.md` ADRs | Auto (mechanical manifest diff; Manual if no manifest exists) | BLOCK | Remove the dependency OR stop and add an ADR via `/mvt-design` |
52
54
 
53
55
  - **On any BLOCK failure**: stop, fix, re-run Step 5. Do not proceed to Step 6.
56
+ - **If `design.md` is missing**: skip only the checks that require design (`Change Tracking`, `Module Design`, `Key Interfaces`, boundary error-handling list, external-dependency ADRs). Still run forbidden import checks when `project-context.md` contains layer or import rules.
54
57
 
55
58
  ### Step 6: Run Quick Self-Check
56
59
  - **What**: light-weight verification before handing off to `/mvt-review` or `/mvt-test`.
@@ -60,20 +63,11 @@
60
63
  3. UI/frontend changes: per project rules, ask user to verify in browser; do NOT claim "tested" if you only ran type-check.
61
64
 
62
65
  ### Step 7: Write Artifact
63
- - **Path and template**: as defined in the **Artifact Structure** section below. The artifact filename is ALWAYS `implementation.md` — one file per change, never per task. Do NOT invent task-suffixed names like `implementation-t1.md`.
64
- - **Multi-task plans (single-file accumulation)**: when `plan.yaml` drives the change and you implement tasks across separate invocations, all task implementations accumulate into the **same** `implementation.md`:
65
- 1. If `implementation.md` does not yet exist -> create it from the template.
66
- 2. If it already exists -> read it, then **append** a new `## Task: {current_task_id} {task_title}` section for this task. Do NOT overwrite prior tasks' sections.
67
- 3. Under that task section, place this invocation's required content (the headings below). Keep earlier tasks' sections intact.
68
- 4. For single-task or plan-less changes, write the content at the top level without a per-task wrapper (existing behavior).
69
- - **Required content** (mapped to template headings):
70
- - `Implementation Summary` -- one paragraph: what was built, scope.
71
- - `Files Touched` -- table: path | create/modify/delete | one-line intent.
72
- - `Design Compliance` -- summary of Step 5 checks (passed / deviated, with reasons).
73
- - `Deviations from Design` -- empty list is acceptable; otherwise list each deviation with rationale.
74
- - `Self-Check Results` -- type-check status, suggested test commands (Step 6).
75
- - `Open TODOs` -- anything deferred for `/mvt-review`, `/mvt-test`, or follow-up changes.
76
- - The actual source code goes to the project tree; the artifact is a record, not the code itself.
66
+ - **Path**: `.ai-agents/workspace/artifacts/{change-id}/implementation.md` — always this filename, one file per change. Never per-task suffixed names.
67
+ - **Template**: load from the **Artifact Structure** section below. Follow the HTML comments for what each section should contain; strip comments from the final artifact.
68
+ - **Multi-task accumulation**: if `plan.yaml` drives implementation across separate invocations, append a `## Task: {id} — {title}` section per task — never overwrite a *different* task's section. If `## Task: {id}` for the *same* task already exists (re-implementation after `blocked` or rescope), replace that section's content in place — preserve any `### Deliverables` subsection within it. Single-task or plan-less: write at top level without a task wrapper.
69
+ - **Required coverage**: cover only content that is applicable to this implementation. Preserve enough information for downstream skills to understand what changed, files touched, design compliance, deviations, validation results, and open TODOs. 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.
70
+ - The artifact is a record, not the code. Reference file paths and summarise intent do NOT paste source listings.
77
71
 
78
72
  ### Step 8: Deliverables Handoff (if applicable)
79
73
 
@@ -101,18 +95,16 @@
101
95
  {Document invariants, preconditions, or side effects that downstream tasks must respect.}
102
96
  ```
103
97
 
104
- - **After writing deliverables**, call `plan-update.cjs` with both flags in a single invocation:
98
+ - **After writing deliverables**, call `plan-update.cjs` with both deliverables flags in a single invocation. Use the command below as authoritative:
105
99
  ```bash
106
100
  node .ai-agents/scripts/plan-update.cjs \
107
101
  --plan "<active_change.plan_path>" \
108
102
  --task <current_task_id> \
109
- --status <current_status> \
110
103
  --deliverables-pointer current \
111
- --mark-deliverable-stale <downstream_task_id1>[,<downstream_task_id2>,...] \
112
- --projects <project_list>
104
+ --mark-deliverable-stale <downstream_task_id1>[,<downstream_task_id2>,...]
113
105
  ```
114
- `<project_list>` is the comma-separated project names from `plan.yaml > current_tasks` keys. In a single-project workspace this is `default`. The `--projects` flag ensures per-project validation runs correctly in multi-project plans.
115
- The `--status` must be the task's current status (typically `in_progress` at this point, since Step 9 has not yet run). Pass ALL downstream dependent task ids as a comma-separated list to `--mark-deliverable-stale` so that `/mvt-resume` and `/mvt-status` can surface the stale warning.
106
+ Use this exact metadata-only command. Do NOT add `--status`, hand-edit `plan.yaml`, choose `current_tasks`, or read `.cjs`/`.js` source.
107
+ Pass ALL downstream dependent task ids as a comma-separated list to `--mark-deliverable-stale` so that `/mvt-resume` and `/mvt-status` can surface the stale warning.
116
108
  - **On user decline**: do not write deliverables and do not call `plan-update.cjs` with the deliverables flags. The downstream tasks will not receive stale warnings, which is acceptable if the user considers the contract unchanged.
117
109
  - **Error handling**: if `plan-update.cjs` rejects (e.g., malformed freshness), surface stderr and leave `implementation.md` as written. The deliverables content is the source of truth; the pointer can be retried via `/mvt-update-plan`.
118
110
 
@@ -126,7 +118,7 @@
126
118
 
127
119
  | Case | Handling |
128
120
  |------|----------|
129
- | `design.md` missing | WARN, ask user; if they proceed, mark artifact "Source: conversation only" and skip Step 5 design-match checks |
121
+ | `design.md` missing | WARN, ask user; if they proceed, mark artifact "Source: conversation only"; in Step 5 skip checks that require design.md but still run forbidden import checks from `project-context.md` when rules exist |
130
122
  | Implementation reveals the design is infeasible | STOP at Step 4, document the blocker in conversation, recommend `/mvt-design` re-run -- do not silently improvise an alternative |
131
123
  | Type-checker fails on pre-existing errors unrelated to the change | Note in artifact, do not attempt blanket fixes outside scope |
132
124
  | User aborts at Step 3 confirmation | Do not write any source files or artifact |
@@ -135,3 +127,4 @@
135
127
  | Plan task is `blocked` or `done` already | Refuse to implement that task; ask user to pick another task from `current_tasks` or run `/mvt-update-plan` |
136
128
  | Deliverables already exist and user declines to update | Leave existing deliverables in place; do not call `plan-update.cjs` with deliverables flags |
137
129
  | `plan-update.cjs` rejects deliverables pointer | Surface error; leave `implementation.md` as written (content is source of truth, pointer can be retried) |
130
+ | Re-implementing a task whose `## Task: {id}` section already exists in `implementation.md` | Replace that section's content in place; preserve any `### Deliverables` subsection within it. Do NOT create a second `## Task: {id}` section |
@@ -40,12 +40,6 @@ sections:
40
40
  - type: shared
41
41
  source: sections/activation-load-config.md
42
42
 
43
- - type: shared
44
- source: sections/output-language-constraint.md
45
-
46
- - type: shared
47
- source: sections/output-format-constraint.md
48
-
49
43
  - type: shared
50
44
  source: sections/activation-preflight.md
51
45
  params:
@@ -58,10 +52,12 @@ sections:
58
52
  field: "projects[] in project-context.yaml"
59
53
  level: "BLOCK"
60
54
  message: "Project not initialized. Run `/mvt-init` first."
61
- - order: "3"
62
- field: "modules in project-context.md"
63
- level: "WARN"
64
- message: "No architecture defined. Run `/mvt-design` first. (allow user to proceed)"
55
+
56
+ - type: shared
57
+ source: sections/language-constraint.md
58
+
59
+ - type: shared
60
+ source: sections/output-format-constraint.md
65
61
 
66
62
  - type: file
67
63
  source: ./business.md
@@ -69,10 +65,8 @@ sections:
69
65
  - type: inline
70
66
  content: |
71
67
  ## Artifact Structure
72
- Read the document structure template from: `.ai-agents/skills/_templates/implement-output.md`
73
- If a custom version exists at `.ai-agents/skills/_templates/custom/implement-output.md`, use the custom version instead.
74
- The template defines section headings only. Generate content for each section based on implementation results.
75
- Write the artifact to: `.ai-agents/workspace/artifacts/{change-id}/implementation.md`
68
+ Template location: `.ai-agents/skills/_templates/implement-output.md`
69
+ Custom override: `.ai-agents/skills/_templates/custom/implement-output.md` (takes precedence if present)
76
70
 
77
71
  - type: shared
78
72
  source: sections/session-update.md
@@ -55,12 +55,6 @@ sections:
55
55
  - type: shared
56
56
  source: sections/activation-load-config.md
57
57
 
58
- - type: shared
59
- source: sections/output-language-constraint.md
60
-
61
- - type: shared
62
- source: sections/output-format-constraint.md
63
-
64
58
  - type: shared
65
59
  source: sections/activation-preflight.md
66
60
  params:
@@ -70,6 +64,12 @@ sections:
70
64
  level: "INFO"
71
65
  message: "This is a first-time init, proceed normally."
72
66
 
67
+ - type: shared
68
+ source: sections/language-constraint.md
69
+
70
+ - type: shared
71
+ source: sections/output-format-constraint.md
72
+
73
73
  - type: file
74
74
  source: ./business.md
75
75
 
@@ -47,7 +47,7 @@ sections:
47
47
  source: sections/activation-load-config.md
48
48
 
49
49
  - type: shared
50
- source: sections/output-language-constraint.md
50
+ source: sections/language-constraint.md
51
51
 
52
52
  - type: shared
53
53
  source: sections/output-format-constraint.md
@@ -21,17 +21,27 @@ If `active_change.plan_path is non-empty` AND `.ai-agents/workspace/artifacts/{a
21
21
 
22
22
  ### Step 3: Decompose Into Tasks
23
23
 
24
- Decompose the change with the following constraints. These constraints are AI-friendly granularity rules — too coarse leaves a task uncompletable in a single skill invocation; too fine turns the plan into noise.
24
+ Decompose the change with the following constraints. These constraints are AI-friendly decomposition rules.
25
+
26
+ **Granularity guidance** — read from `preferences.planning.granularity` in `.ai-agents/config.yaml`. Default: `medium`.
27
+
28
+ | Level | Decomposition style |
29
+ |-------|---------------------|
30
+ | `coarse` | Prefer fewer, larger tasks — combine related work into broader task boundaries |
31
+ | `medium` | Balanced — each task maps to one focused skill invocation |
32
+ | `fine` | Prefer more, smaller tasks — split work into narrower, focused units |
33
+
34
+ This is **qualitative AI guidance**, not a hard task count constraint. A complex change may produce many tasks; a simple one may produce few — both are valid at any granularity level.
25
35
 
26
36
  | Rule | Detail |
27
37
  |------|--------|
28
- | Count | Aim for 3–10 tasks at the top level. If the change clearly needs more, stop and propose phasing into multiple plans (one per phase). |
29
38
  | Single responsibility | Each task should map to one focused skill invocation (e.g., one `/mvt-implement` for one feature slice). |
30
39
  | Independently verifiable | Each task must have at least one acceptance criterion that a human or test can check. |
31
40
  | Explicit dependencies | If task B requires output from task A, list `A` in B's `depends_on`. Avoid hidden ordering. Tasks that can run in parallel should have no dependency between them. |
32
41
  | No cycles | Dependency graph must be a DAG. Validation will reject cycles. |
33
42
  | Skill hint | Set `skill_hint` to the skill best suited to execute the task (without `/` prefix): `mvt-implement`, `mvt-test`, `mvt-fix`, `mvt-design`, `mvt-review`, `mvt-refactor`, etc. |
34
43
  | Project attribution | Each task must have a `project` array listing which projects it belongs to. In a single-project workspace (`projects.length == 1`), set `project: ["default"]` (or the sole project's name). In a multi-project workspace, auto-infer from the task's file paths matching `projects[].path` and `projects[].source_paths`; if ambiguous, prompt the user. Cross-project tasks list multiple project names. |
44
+ | Invalid value handling | If `granularity` contains a value other than `coarse`, `medium`, `fine`, warn the user and fall back to `medium`. |
35
45
 
36
46
  ### Step 4: Assemble plan.yaml
37
47
 
@@ -22,7 +22,7 @@ sections:
22
22
  decision_rules:
23
23
  - rule: "active_change is set AND plan_path is empty -> Generate a fresh plan.yaml"
24
24
  - rule: "active_change is set AND plan_path is non-empty -> Confirm before regenerating; default to /mvt-update-plan"
25
- - rule: "Tasks would exceed 10 -> Stop, propose phasing the change into multiple plans"
25
+ - rule: "Plan grows beyond practical manageability -> Stop, propose phasing the change into multiple plans"
26
26
  - rule: "Dependencies form a cycle -> Reject and ask the user to resolve"
27
27
  - rule: "active_change is empty -> Stop and request /mvt-analyze first"
28
28
  boundaries:
@@ -45,12 +45,6 @@ sections:
45
45
  - type: shared
46
46
  source: sections/activation-load-config.md
47
47
 
48
- - type: shared
49
- source: sections/output-language-constraint.md
50
-
51
- - type: shared
52
- source: sections/output-format-constraint.md
53
-
54
48
  - type: shared
55
49
  source: sections/activation-preflight.md
56
50
  params:
@@ -64,6 +58,12 @@ sections:
64
58
  level: "BLOCK"
65
59
  message: 'No active change. Run `/mvt-analyze` to create one before planning.'
66
60
 
61
+ - type: shared
62
+ source: sections/language-constraint.md
63
+
64
+ - type: shared
65
+ source: sections/output-format-constraint.md
66
+
67
67
  - type: file
68
68
  source: ./business.md
69
69
 
@@ -45,7 +45,7 @@ sections:
45
45
  source: sections/activation-load-config.md
46
46
 
47
47
  - type: shared
48
- source: sections/output-language-constraint.md
48
+ source: sections/language-constraint.md
49
49
 
50
50
  - type: shared
51
51
  source: sections/output-format-constraint.md
@@ -63,7 +63,7 @@ sections:
63
63
  source: sections/activation-load-config.md
64
64
 
65
65
  - type: shared
66
- source: sections/output-language-constraint.md
66
+ source: sections/language-constraint.md
67
67
 
68
68
  - type: shared
69
69
  source: sections/output-format-constraint.md
@@ -56,6 +56,9 @@ sections:
56
56
  level: "WARN"
57
57
  message: "Session not initialized. Run `/mvt-init` first."
58
58
 
59
+ - type: shared
60
+ source: sections/language-constraint.md
61
+
59
62
  - type: file
60
63
  source: ./business.md
61
64
 
@@ -47,6 +47,7 @@ This step applies only when the workspace has multiple projects (`projects.lengt
47
47
  - **How**: walk the checklist below. Skip any group whose inputs were missing per Step 1 fallback notes.
48
48
 
49
49
  **Group A -- Design / Layer Compliance** (requires design.md OR project-context.md)
50
+ - If `implementation.md > Design Compliance` exists, use it as the implementer's self-check claim set. Independently verify claimed passes and investigate any skipped, deviated, or undocumented item; do not repeat every mechanical self-check when the claim is already supported.
50
51
  - Each file is in the module/layer assigned by design or project-context.
51
52
  - Dependency direction respects layer rules (no upward imports, no forbidden cross-module reaches).
52
53
  - Public interfaces match `Key Interfaces` from design.
@@ -96,15 +97,8 @@ This step applies only when the workspace has multiple projects (`projects.lengt
96
97
  - Each finding must include: file, line range, severity, observation, recommendation.
97
98
 
98
99
  ### Step 7: Write Artifact
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`.
100
- - **Required content** (mapped to template headings):
101
- - `Review Scope` -- file list, depth, aspect filter, fallbacks applied (e.g., "design.md missing -> Group A skipped").
102
- - `Summary` -- counts per severity + one-paragraph overall verdict (Approve / Approve with comments / Request changes / Block).
103
- - `Critical Findings` -- one entry per finding.
104
- - `Warnings`.
105
- - `Suggestions`.
106
- - `Skipped Checks` -- groups skipped because inputs were missing, with reason.
107
- - `Recommended Next Skill` -- e.g., `/mvt-fix` for Critical, `/mvt-test` if Group E gaps, `/mvt-refactor` if Group B is dominant.
100
+ - **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`. Follow the HTML comments in the template for what each section should contain; strip comments from the final artifact.
101
+ - **Required coverage**: cover only content that is applicable to this review. Preserve enough information for the user to understand what was reviewed, the verdict, material findings, skipped checks, and the recommended next step. 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.
108
102
 
109
103
  ### Step 8: Verdict Rule
110
104
  - Critical > 0 -> verdict is `Request changes`. Suggest `/mvt-fix`.
@@ -59,12 +59,6 @@ sections:
59
59
  - type: shared
60
60
  source: sections/activation-load-config.md
61
61
 
62
- - type: shared
63
- source: sections/output-language-constraint.md
64
-
65
- - type: shared
66
- source: sections/output-format-constraint.md
67
-
68
62
  - type: shared
69
63
  source: sections/activation-preflight.md
70
64
  params:
@@ -78,6 +72,12 @@ sections:
78
72
  level: "WARN"
79
73
  message: "No code to review. Run `/mvt-implement` first or specify files."
80
74
 
75
+ - type: shared
76
+ source: sections/language-constraint.md
77
+
78
+ - type: shared
79
+ source: sections/output-format-constraint.md
80
+
81
81
  - type: file
82
82
  source: ./business.md
83
83
 
@@ -86,7 +86,7 @@ sections:
86
86
  ## Artifact Structure
87
87
  Read the document structure template from: `.ai-agents/skills/_templates/review-output.md`
88
88
  If a custom version exists at `.ai-agents/skills/_templates/custom/review-output.md`, use the custom version instead.
89
- The template defines section headings only. Generate content for each section based on review results.
89
+ The template defines section structure and guidance comments. Generate applicable content based on review results.
90
90
  Write the artifact to: `.ai-agents/workspace/artifacts/{change-id}/review.md`
91
91
 
92
92
  - type: shared
@@ -26,7 +26,7 @@
26
26
 
27
27
  | Condition | Action |
28
28
  |-----------|--------|
29
- | No plans found anywhere | Skip the Changes Overview section entirely; render "No active changes." |
29
+ | No plans found anywhere | Skip the Changes Overview section entirely; render "No active plans." |
30
30
  | One plan found | Render Changes Overview with one row |
31
31
  | Multiple plans found | Render Changes Overview sorted: `in_progress` desc by `updated_at` first, then `done` desc by `updated_at`, then `abandoned` last |
32
32
  | Any plan over the cap (more than ~12 rows) | Show top 10 rows; print a `+N older changes hidden -- see artifacts/` line |
@@ -34,7 +34,7 @@
34
34
  ### Step 4: Build the Status Report
35
35
  - Render in this order, omitting any section whose inputs were unavailable:
36
36
 
37
- 1. **Header** -- one-line summary: project name (from `project-context.yaml`), framework version, last synced timestamp.
37
+ 1. **Header** -- one-line summary: project name (from `project-context.yaml`), last synced timestamp.
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`.
@@ -64,20 +64,10 @@
64
64
  |-----------|-------|--------|----------|---------------|---------|------------|
65
65
 
66
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"
69
67
  6. **Skill History** -- last 5 rows of the timeline from Step 2.
70
68
 
71
69
  - 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.
72
70
 
73
- ### Step 5: Suggest Next Step
74
- - Resolution order (first match wins):
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.
79
- - The suggestion must be a single line: skill command + one-clause reason.
80
-
81
71
  ## Edge Cases & Errors
82
72
 
83
73
  | Case | Handling |
@@ -49,6 +49,9 @@ sections:
49
49
  level: "WARN"
50
50
  message: "Session not initialized. Run `/mvt-init` first."
51
51
 
52
+ - type: shared
53
+ source: sections/language-constraint.md
54
+
52
55
  - type: file
53
56
  source: ./business.md
54
57
 
@@ -181,7 +181,7 @@ If user skips verification: proceed directly to Step 10 with Step 7 selections.
181
181
  ### Step 12: State Update
182
182
  Apply the State Update rules defined in the **State Update** section below.
183
183
  - The `--set-synced` parameter updates `session.last_synced_at`.
184
- - Pass `--projects` to plan-update.cjs when updating a plan that has project attribution.
184
+ - When updating a plan that has project attribution, pass `--projects` to `plan-update.cjs`; read `.ai-agents/scripts/plan-update.md` only if the workflow needs flags or value sources not rendered in this skill. Do NOT hand-edit `plan.yaml` or read `.cjs`/`.js` source.
185
185
 
186
186
  ## Edge Cases & Errors
187
187
 
@@ -57,12 +57,6 @@ sections:
57
57
  - type: shared
58
58
  source: sections/activation-load-config.md
59
59
 
60
- - type: shared
61
- source: sections/output-language-constraint.md
62
-
63
- - type: shared
64
- source: sections/output-format-constraint.md
65
-
66
60
  - type: shared
67
61
  source: sections/activation-preflight.md
68
62
  params:
@@ -76,6 +70,12 @@ sections:
76
70
  level: "BLOCK"
77
71
  message: "project-context.md not found. Run `/mvt-analyze-code` to create the initial document; this skill only handles incremental updates."
78
72
 
73
+ - type: shared
74
+ source: sections/language-constraint.md
75
+
76
+ - type: shared
77
+ source: sections/output-format-constraint.md
78
+
79
79
  - type: shared
80
80
  source: sections/project-context-profile.md
81
81
 
@@ -41,6 +41,9 @@ sections:
41
41
  - type: shared
42
42
  source: sections/activation-load-config.md
43
43
 
44
+ - type: shared
45
+ source: sections/language-constraint.md
46
+
44
47
  - type: file
45
48
  source: ./business.md
46
49
 
@@ -91,16 +91,8 @@ This step applies only when the workspace has multiple projects (`projects.lengt
91
91
  - Record each finding with: scenario id, expected vs observed, severity (Critical / Warning), and recommend `/mvt-fix`.
92
92
 
93
93
  ### Step 10: Write Artifact
94
- - **Path and template**: as defined in the **Artifact Structure** section below.
95
- - **Required content** (mapped to template headings):
96
- - `Scope` -- target files, fallbacks applied.
97
- - `Test Framework & Layout` -- chosen framework, file layout convention.
98
- - `Test Scenarios` -- the Scenario Table from Step 4.
99
- - `Test Cases` -- the row-level table from Step 6.
100
- - `Granularity Decisions` -- summary from Step 5, including any "needs setup" gaps.
101
- - `Coverage Analysis` -- only when `--coverage`; otherwise omit the heading.
102
- - `Implementation Issues Found` -- from Step 9; empty list is fine.
103
- - `Suggested Run Commands` -- one or two commands the user can copy-paste.
94
+ - **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.
95
+ - **Required coverage**: cover only content that is applicable to this test effort. Preserve enough information for the user to understand the target scope, chosen framework/layout, scenarios and runnable test cases, granularity choices, coverage gaps when `--coverage` is set, implementation issues when found, and practical run commands when tests are generated. 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.
104
96
  - The actual test files go to the project tree; the artifact is a record.
105
97
 
106
98
  ### Step 11: State Update