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

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 (84) hide show
  1. package/README.md +184 -193
  2. package/dist/build/section-loader.d.ts.map +1 -1
  3. package/dist/build/section-loader.js +18 -8
  4. package/dist/build/section-loader.js.map +1 -1
  5. package/dist/fs/materialize.d.ts.map +1 -1
  6. package/dist/fs/materialize.js +5 -0
  7. package/dist/fs/materialize.js.map +1 -1
  8. package/dist/scripts/session-update.cjs +7568 -0
  9. package/install-manifest.yaml +2 -0
  10. package/package.json +3 -2
  11. package/registry.yaml +6 -0
  12. package/sources/defaults/config.yaml +7 -7
  13. package/sources/defaults/session.yaml +9 -16
  14. package/sources/scripts/session-update.js +351 -0
  15. package/sources/sections/activation-load-context.md +4 -0
  16. package/sources/sections/footer-next-steps.md +1 -1
  17. package/sources/sections/output-language-constraint.md +11 -11
  18. package/sources/sections/session-update.md +115 -47
  19. package/sources/skills/mvt-analyze/business.md +7 -7
  20. package/sources/skills/mvt-analyze/manifest.yaml +1 -0
  21. package/sources/skills/mvt-analyze-code/manifest.yaml +110 -96
  22. package/sources/skills/mvt-bug-detect/business.md +99 -0
  23. package/sources/skills/mvt-bug-detect/manifest.yaml +84 -0
  24. package/sources/skills/mvt-check-context/business.md +3 -5
  25. package/sources/skills/mvt-check-context/manifest.yaml +70 -63
  26. package/sources/skills/mvt-cleanup/business.md +49 -23
  27. package/sources/skills/mvt-cleanup/manifest.yaml +15 -10
  28. package/sources/skills/mvt-config/business.md +1 -2
  29. package/sources/skills/mvt-config/manifest.yaml +103 -96
  30. package/sources/skills/mvt-create-skill/business.md +84 -76
  31. package/sources/skills/mvt-create-skill/manifest.yaml +107 -95
  32. package/sources/skills/mvt-design/business.md +3 -6
  33. package/sources/skills/mvt-design/manifest.yaml +109 -96
  34. package/sources/skills/mvt-fix/business.md +39 -9
  35. package/sources/skills/mvt-fix/manifest.yaml +88 -72
  36. package/sources/skills/mvt-help/business.md +2 -4
  37. package/sources/skills/mvt-help/manifest.yaml +75 -67
  38. package/sources/skills/mvt-implement/business.md +4 -5
  39. package/sources/skills/mvt-implement/manifest.yaml +93 -80
  40. package/sources/skills/mvt-init/business.md +2 -2
  41. package/sources/skills/mvt-init/manifest.yaml +102 -101
  42. package/sources/skills/mvt-manage-context/business.md +186 -175
  43. package/sources/skills/mvt-manage-context/manifest.yaml +134 -123
  44. package/sources/skills/mvt-plan-dev/business.md +101 -20
  45. package/sources/skills/mvt-plan-dev/manifest.yaml +90 -91
  46. package/sources/skills/mvt-quick-dev/business.md +2 -1
  47. package/sources/skills/mvt-quick-dev/manifest.yaml +84 -69
  48. package/sources/skills/mvt-refactor/business.md +2 -1
  49. package/sources/skills/mvt-refactor/manifest.yaml +104 -86
  50. package/sources/skills/mvt-resume/business.md +28 -68
  51. package/sources/skills/mvt-resume/manifest.yaml +81 -71
  52. package/sources/skills/mvt-review/business.md +3 -3
  53. package/sources/skills/mvt-review/manifest.yaml +108 -87
  54. package/sources/skills/mvt-status/business.md +14 -18
  55. package/sources/skills/mvt-status/manifest.yaml +74 -66
  56. package/sources/skills/mvt-sync-context/business.md +155 -150
  57. package/sources/skills/mvt-sync-context/manifest.yaml +99 -96
  58. package/sources/skills/mvt-template/business.md +0 -2
  59. package/sources/skills/mvt-template/manifest.yaml +68 -63
  60. package/sources/skills/mvt-test/business.md +3 -3
  61. package/sources/skills/mvt-test/manifest.yaml +115 -102
  62. package/sources/skills/mvt-update-plan/business.md +83 -72
  63. package/sources/skills/mvt-update-plan/manifest.yaml +124 -132
  64. package/sources/templates/analyze-output/body.md +15 -15
  65. package/sources/templates/design-output/body.md +17 -17
  66. package/sources/templates/implement-output/body.md +11 -11
  67. package/sources/templates/review-output/body.md +11 -11
  68. package/sources/templates/test-output/body.md +7 -7
  69. package/dist/build/plan-validator.d.ts +0 -26
  70. package/dist/build/plan-validator.d.ts.map +0 -1
  71. package/dist/build/plan-validator.js +0 -225
  72. package/dist/build/plan-validator.js.map +0 -1
  73. package/dist/commands/build.d.ts +0 -5
  74. package/dist/commands/build.d.ts.map +0 -1
  75. package/dist/commands/build.js +0 -46
  76. package/dist/commands/build.js.map +0 -1
  77. package/dist/commands/migrate.d.ts +0 -18
  78. package/dist/commands/migrate.d.ts.map +0 -1
  79. package/dist/commands/migrate.js +0 -163
  80. package/dist/commands/migrate.js.map +0 -1
  81. package/dist/fs/protection.d.ts +0 -15
  82. package/dist/fs/protection.d.ts.map +0 -1
  83. package/dist/fs/protection.js +0 -16
  84. package/dist/fs/protection.js.map +0 -1
@@ -1,150 +1,155 @@
1
- ## Execution Flow
2
-
3
- ### Step 1: Identify Completed Changes
4
- - **What**: produce a candidate list of change-ids whose artifacts will be aggregated.
5
- - **How**:
6
- 1. Read `session.yaml`. Collect `recent_changes[]` entries with `status: completed`.
7
- 2. For each candidate, verify `.ai-agents/workspace/artifacts/{change-id}/` exists AND contains at least one of `analysis.md` or `design.md`. Drop entries with only `plan.yaml`.
8
- 3. (Fallback) If `recent_changes[]` is empty, scan `.ai-agents/workspace/artifacts/*/` directly; offer those with `analysis.md` or `design.md`, marked `unindexed`.
9
- 4. Exclude any change-id whose directory contains an `_archive/` subfolder (already archived).
10
- 5. Exclude `active_change.id` (work in flight).
11
-
12
- - **Present** the list:
13
-
14
- | # | change-id | title | status | analysis.md | design.md | implementation.md |
15
- |---|-----------|-------|--------|-------------|-----------|-------------------|
16
-
17
- - **Always print before user confirmation**:
18
- > Run `/mvt-sync-context` BEFORE `/mvt-cleanup`. Once cleanup archives a change-id, this skill will skip it.
19
-
20
- - **Prompt**: "Select changes to aggregate. Indices (e.g. 1,3,5), `a` for all, `n` to cancel."
21
-
22
- - Cancel / empty selection -> stop with "no changes applied".
23
-
24
- ### Step 2: Read Current Project Context (Adaptive Structure Discovery)
25
-
26
- This step establishes the **target structure** that aggregated content must fit into. The structure is NOT assumed -- it is derived from the current document.
27
-
28
- 1. Read `.ai-agents/knowledge/project/_generated/project-context.md`.
29
- - Already required by preflight; if discovered missing here, STOP and recommend `/mvt-analyze-code`.
30
- 2. Parse the current `.md` into a section map:
31
- - Each top-level `##` heading -> one section anchor.
32
- - Record: section title (verbatim), byte range, and a 1-line semantic summary derived from the section's content (e.g., "lists domain terms with definitions" or "describes module dependencies").
33
- - The summary is what enables matching in Step 3 -- section titles may be in any language and may not match conventional names (Terms / Modules / etc.).
34
- 3. If the document has zero `##` sections (single block) -> STOP. Recommend `/mvt-analyze-code` to establish a sectioned baseline first.
35
- 4. Read `.ai-agents/workspace/project-context.yaml`. Record current `projects[].source_paths`, `modules`, and `tech_stack` for diff comparison in Step 4d.
36
-
37
- ### Step 3: Extract and Classify Artifact Content
38
-
39
- - **What**: from each selected change-id, extract atomic knowledge items and classify them against the section map from Step 2.
40
- - **How**:
41
- 1. For each selected change-id, read available artifacts (`analysis.md`, `design.md`, `implementation.md`).
42
- 2. Extract atomic items. Typical sources:
43
- - `analysis.md` -> domain terms, actors, business rules, constraints
44
- - `design.md` -> modules, layers, dependency rules, key interfaces, ADRs
45
- - `implementation.md` -> files added/changed (informs `.yaml` source_paths), realized vs deviated design points
46
- 3. For each item, match to a section from the Step 2 map:
47
- - Match by semantic similarity to **section title + 1-line summary**, not by exact string.
48
- - Confidence levels:
49
- - **mapped**: exactly one section matches with high confidence
50
- - **ambiguous**: 2+ sections plausibly match
51
- - **orphan**: no section matches; propose a new section name
52
- 4. For each item, also detect change type relative to current section content:
53
- - `new` -- target section does not contain this entity
54
- - `modify` -- target section mentions the entity but artifact provides a different value
55
- - `redundant` -- already present, no change (will be filtered out, not shown to user)
56
-
57
- ### Step 4: Render the Update Plan (Four Tables)
58
-
59
- #### 4a. Section-mapped items
60
- | # | change-id | item | type | target section | classification |
61
- |---|-----------|------|------|----------------|----------------|
62
-
63
- #### 4b. Conflicts requiring resolution (every `modify` item)
64
- | # | item | section | current value | proposed value (from {change-id}) |
65
- |---|------|---------|---------------|-----------------------------------|
66
-
67
- #### 4c. Ambiguous and orphan items
68
- | # | item | reason | candidate sections (or proposed new section) |
69
- |---|------|--------|----------------------------------------------|
70
-
71
- #### 4d. Implied yaml changes
72
- | # | yaml field | current | proposed |
73
- |---|------------|---------|----------|
74
-
75
- ### Step 5: User Confirmation (Per-Table)
76
-
77
- - **4a**: default = accept all. User input: indices to drop, or `e <n>` to edit a single item's target section.
78
- - **4b**: **explicit per-row decision required**. Format `<index>:<keep|replace|edit>`. Example: `1:replace,2:keep,3:edit`. No default.
79
- - **4c**: per row, user picks an existing section, types a new section name, or `skip`.
80
- - **4d**: default = accept; user can drop indices.
81
-
82
- Then ask: **"Run optional read-only code verification before applying? (y/n)"**
83
-
84
- ### Step 6: (Optional) Read-only Code Verification
85
-
86
- This step catches artifacts claiming entities never actually delivered. It is **read-only** -- it never writes anything to `.md` or `.yaml`.
87
-
88
- If user opts in:
89
- 1. For each accepted item naming a code entity (module path, file, class, function), search the codebase under registered `source_paths`:
90
- - Module path -> directory exists?
91
- - File -> file exists?
92
- - Symbol -> grep within source_paths
93
- 2. Classify findings:
94
-
95
- | Finding | Action |
96
- |---------|--------|
97
- | Artifact item matches code | Mark `verified`; keep in apply list |
98
- | Artifact item NOT found in code | Flag `unverified`; ask user: drop or proceed (likely reverted / un-merged) |
99
- | Code contains module / file / symbol that NO artifact item references | **Do NOT add to apply list.** Print: `Code-only entity detected: {path}. Run /mvt-analyze-code for ground-truth rebuild.` |
100
-
101
- 3. Re-render the apply list with `verified` / `unverified` markers; final confirmation.
102
-
103
- If user skips verification: proceed directly to Step 7 with Step 5 selections.
104
-
105
- ### Step 7: Apply Updates (Merge Mode)
106
-
107
- - **Pre-write**:
108
- 1. Backup: `project-context.md` -> `project-context.md.bak`; `project-context.yaml` -> `project-context.yaml.bak`. Overwrite any prior `.bak`.
109
- 2. Backup write failure -> STOP, do not modify originals.
110
-
111
- - **Update `project-context.md`** (merge, never rewrite):
112
- 1. Each `new` item: append to target section, matching the section's existing style (bullet vs paragraph).
113
- 2. Each `modify` item with `replace`: replace the matching line in place. Smallest possible diff.
114
- 3. Each `orphan` item with new-section choice: append a new `##` section at end of file.
115
- 4. **Never delete** any existing line. **Never reorder** existing sections.
116
-
117
- - **Update `project-context.yaml`** (structured merge):
118
- 1. Apply accepted entries from Table 4d.
119
- 2. Add new `source_paths` to matching project entry; add new modules to `modules[]`.
120
- 3. **Never delete** an existing yaml entry in this skill.
121
-
122
- - **Atomicity**: temp + rename per file. If `.md` write succeeds but `.yaml` fails (or vice versa) -> restore the failed one from `.bak`, keep the other; report partial success.
123
-
124
- ### Step 8: Report
125
-
126
- 1. **Applied summary** -- counts: items added / modified / skipped / orphaned-into-new-section
127
- 2. **Files changed** -- paths + byte deltas
128
- 3. **Backup paths** -- so user can manually revert
129
- 4. **Out-of-scope reminder** (always print):
130
- > This skill processes additions and modifications only. Module deletions, renames, and large refactors are NOT detected here. Run `/mvt-analyze-code` periodically to rebuild from ground truth.
131
- 5. **Suggested next**:
132
- - Aggregated >= 1 change -> "Run `/mvt-cleanup` to archive these completed changes."
133
- - Verification flagged code-only entities -> "Run `/mvt-analyze-code` to capture missing entities."
134
-
135
- ### Step 9: (session update handled by shared section)
136
- - Refresh `session.last_synced_at` to current ISO timestamp.
137
-
138
- ## Edge Cases & Errors
139
-
140
- | Case | Handling |
141
- |------|----------|
142
- | `project-context.md` does not exist | Caught at preflight; recommend `/mvt-analyze-code` |
143
- | `.md` has zero `##` sections | STOP at Step 2; recommend `/mvt-analyze-code` |
144
- | Selected change-id has only `plan.yaml` | Filtered in Step 1; will not appear |
145
- | `modify` with `replace` but the existing line cannot be located deterministically | Fall back to append + flag as duplicate-needs-manual-edit; do NOT silently overwrite the wrong line |
146
- | `.md.bak` already exists | Overwrite (only the most recent backup matters) |
147
- | User aborts at Step 5 | Do not write; report "no changes applied" |
148
- | Step 6 verification finds zero matches for everything | Strong warning; require explicit confirm before proceeding (artifacts likely describe planned, not delivered, work) |
149
- | Two artifacts contradict each other (design says layer A, implementation says layer B) | Surface in Table 4b as cross-artifact conflict; user picks |
150
- | change-id was archived between Step 1 and Step 7 | Skip with note; do not error the run |
1
+ ## Execution Flow
2
+
3
+ ### Step 1: Identify Completed Changes
4
+ - **What**: produce a candidate list of change-ids whose artifacts will be aggregated.
5
+ - **How**:
6
+ 1. Read `session.yaml`. Collect `changes[]` entries with `status: done`.
7
+ 2. For each candidate, verify `.ai-agents/workspace/artifacts/{change-id}/` exists AND contains at least one of `analysis.md` or `design.md`. Drop entries with only `plan.yaml`.
8
+ 3. (Fallback) If `changes[]` is empty, scan `.ai-agents/workspace/artifacts/*/` directly; offer those with `analysis.md` or `design.md`, marked `unindexed`.
9
+ 4. Exclude already-archived or irrelevant changes:
10
+ - **Indexed changes**: exclude any `changes[]` entry with `status: abandoned`. For `status: done` entries, Step 1.2's directory existence check already filters out those whose artifacts have been moved to `artifacts/_archived/` by `/mvt-cleanup`.
11
+ - **Fallback scan**: when scanning `artifacts/*/` directly, skip any path under `artifacts/_archived/` (the unified archive directory managed by `/mvt-cleanup`).
12
+ 5. Exclude `active_change.id` (work in flight).
13
+
14
+ - **Present** the list:
15
+
16
+ | # | change-id | title | status | analysis.md | design.md | implementation.md |
17
+ |---|-----------|-------|--------|-------------|-----------|-------------------|
18
+
19
+ - **Always print before user confirmation**:
20
+ > Run `/mvt-sync-context` BEFORE `/mvt-cleanup`. Once cleanup archives a change-id, this skill will skip it.
21
+
22
+ - **Prompt**: "Select changes to aggregate. Indices (e.g. 1,3,5), `a` for all, `n` to cancel."
23
+
24
+ - Cancel / empty selection -> stop with "no changes applied".
25
+
26
+ ### Step 2: Read Current Project Context (Adaptive Structure Discovery)
27
+
28
+ This step establishes the **target structure** that aggregated content must fit into. The structure is NOT assumed -- it is derived from the current document.
29
+
30
+ 1. Read `.ai-agents/knowledge/project/_generated/project-context.md`.
31
+ - Already required by preflight; if discovered missing here, STOP and recommend `/mvt-analyze-code`.
32
+ 2. Parse the current `.md` into a section map:
33
+ - Each top-level `##` heading -> one section anchor.
34
+ - Record: section title (verbatim), byte range, and a 1-line semantic summary derived from the section's content (e.g., "lists domain terms with definitions" or "describes module dependencies").
35
+ - The summary is what enables matching in Step 3 -- section titles may be in any language and may not match conventional names (Terms / Modules / etc.).
36
+ 3. If the document has zero `##` sections (single block) -> STOP. Recommend `/mvt-analyze-code` to establish a sectioned baseline first.
37
+ 4. Read `.ai-agents/workspace/project-context.yaml`. Record current `projects[].source_paths`, `modules`, and `tech_stack` for diff comparison in Step 4d.
38
+
39
+ ### Step 3: Extract and Classify Artifact Content
40
+
41
+ - **What**: from each selected change-id, extract atomic knowledge items and classify them against the section map from Step 2.
42
+ - **How**:
43
+ 1. For each selected change-id, read available artifacts (`analysis.md`, `implementation.md`).
44
+ 2. Extract atomic items. Typical sources:
45
+ - `analysis.md` -> domain terms, actors, business rules, constraints
46
+ - `implementation.md` -> files added/changed (informs `.yaml` source_paths), realized vs deviated design points
47
+ 3. For each item, match to a section from the Step 2 map:
48
+ - Match by semantic similarity to **section title + 1-line summary**, not by exact string.
49
+ - Confidence levels:
50
+ - **mapped**: exactly one section matches with high confidence
51
+ - **ambiguous**: 2+ sections plausibly match
52
+ - **orphan**: no section matches; propose a new section name
53
+ 4. For each item, also detect change type relative to current section content:
54
+ - `new` -- target section does not contain this entity
55
+ - `modify` -- target section mentions the entity but artifact provides a different value
56
+ - `redundant` -- already present, no change (will be filtered out, not shown to user)
57
+
58
+ ### Step 4: Render the Update Plan (Four Tables)
59
+
60
+ #### 4a. Section-mapped items
61
+ | # | change-id | item | type | target section | classification |
62
+ |---|-----------|------|------|----------------|----------------|
63
+
64
+ #### 4b. Conflicts requiring resolution (every `modify` item)
65
+ | # | item | section | current value | proposed value (from {change-id}) |
66
+ |---|------|---------|---------------|-----------------------------------|
67
+
68
+ #### 4c. Ambiguous and orphan items
69
+ | # | item | reason | candidate sections (or proposed new section) |
70
+ |---|------|--------|----------------------------------------------|
71
+
72
+ #### 4d. Implied yaml changes
73
+ | # | yaml field | current | proposed |
74
+ |---|------------|---------|----------|
75
+
76
+ ### Step 5: User Confirmation (Per-Table)
77
+
78
+ - **4a**: default = accept all. User input: indices to drop, or `e <n>` to edit a single item's target section.
79
+ - **4b**: **explicit per-row decision required**. Format `<index>:<keep|replace|edit>`. Example: `1:replace,2:keep,3:edit`. No default.
80
+ - **4c**: per row, user picks an existing section, types a new section name, or `skip`.
81
+ - **4d**: default = accept; user can drop indices.
82
+
83
+ Then ask: **"Run optional read-only code verification before applying? (y/n)"**
84
+
85
+ ### Step 6: (Optional) Read-only Code Verification
86
+
87
+ This step catches artifacts claiming entities never actually delivered. It is **read-only** -- it never writes anything to `.md` or `.yaml`.
88
+
89
+ If user opts in:
90
+ 1. For each accepted item naming a code entity (module path, file, class, function), search the codebase under registered `source_paths`:
91
+ - Module path -> directory exists?
92
+ - File -> file exists?
93
+ - Symbol -> grep within source_paths
94
+ 2. Classify findings:
95
+
96
+ | Finding | Action |
97
+ |---------|--------|
98
+ | Artifact item matches code | Mark `verified`; keep in apply list |
99
+ | Artifact item NOT found in code | Flag `unverified`; ask user: drop or proceed (likely reverted / un-merged) |
100
+ | Code contains module / file / symbol that NO artifact item references | **Do NOT add to apply list.** Print: `Code-only entity detected: {path}. Run /mvt-analyze-code for ground-truth rebuild.` |
101
+
102
+ 3. Re-render the apply list with `verified` / `unverified` markers; final confirmation.
103
+
104
+ If user skips verification: proceed directly to Step 7 with Step 5 selections.
105
+
106
+ ### Step 7: Apply Updates (Merge Mode)
107
+
108
+ - **Pre-write**:
109
+ 1. Backup: `project-context.md` -> `project-context.md.bak`; `project-context.yaml` -> `project-context.yaml.bak`. Overwrite any prior `.bak`.
110
+ 2. Backup write failure -> STOP, do not modify originals.
111
+
112
+ - **Update `project-context.md`** (merge, never rewrite):
113
+ 1. Each `new` item: append to target section, matching the section's existing style (bullet vs paragraph).
114
+ 2. Each `modify` item with `replace`: replace the matching line in place. Smallest possible diff.
115
+ 3. Each `orphan` item with new-section choice: append a new `##` section at end of file.
116
+ 4. **Never delete** any existing line. **Never reorder** existing sections.
117
+
118
+ - **Update `project-context.yaml`** (structured merge):
119
+ 1. Apply accepted entries from Table 4d.
120
+ 2. Add new `source_paths` to matching project entry; add new modules to `modules[]`.
121
+ 3. **Never delete** an existing yaml entry in this skill.
122
+
123
+ - **Atomicity**: temp + rename per file. If `.md` write succeeds but `.yaml` fails (or vice versa) -> restore the failed one from `.bak`, keep the other; report partial success.
124
+
125
+ ### Step 8: Report
126
+
127
+ 1. **Applied summary** -- counts: items added / modified / skipped / orphaned-into-new-section
128
+ 2. **Files changed** -- paths + byte deltas
129
+ 3. **Backup paths** -- so user can manually revert
130
+ 4. **Synced changes** -- list all change-ids whose knowledge was aggregated in this run:
131
+ > The following changes have been synced and can be safely archived: {change-id-1}, {change-id-2}, ...
132
+ > Last synced at: {last_synced_at} (updated by this run)
133
+ 5. **Out-of-scope reminder** (always print):
134
+ > This skill processes additions and modifications only. Module deletions, renames, and large refactors are NOT detected here. Run `/mvt-analyze-code` periodically to rebuild from ground truth.
135
+ 6. **Suggested next**:
136
+ - Aggregated >= 1 change -> "Run `/mvt-cleanup` to archive these completed changes."
137
+ - Verification flagged code-only entities -> "Run `/mvt-analyze-code` to capture missing entities."
138
+
139
+ ### Step 9: State Update
140
+ Apply the State Update rules defined in the **State Update** section below.
141
+ - The `--set-synced` parameter updates `session.last_synced_at`.
142
+
143
+ ## Edge Cases & Errors
144
+
145
+ | Case | Handling |
146
+ |------|----------|
147
+ | `project-context.md` does not exist | Caught at preflight; recommend `/mvt-analyze-code` |
148
+ | `.md` has zero `##` sections | STOP at Step 2; recommend `/mvt-analyze-code` |
149
+ | Selected change-id has only `plan.yaml` | Filtered in Step 1; will not appear |
150
+ | `modify` with `replace` but the existing line cannot be located deterministically | Fall back to append + flag as duplicate-needs-manual-edit; do NOT silently overwrite the wrong line |
151
+ | `.md.bak` already exists | Overwrite (only the most recent backup matters) |
152
+ | User aborts at Step 5 | Do not write; report "no changes applied" |
153
+ | Step 6 verification finds zero matches for everything | Strong warning; require explicit confirm before proceeding (artifacts likely describe planned, not delivered, work) |
154
+ | Two artifacts contradict each other (design says layer A, implementation says layer B) | Surface in Table 4b as cross-artifact conflict; user picks |
155
+ | change-id was archived between Step 1 and Step 7 | Skip with note; do not error the run |
@@ -1,96 +1,99 @@
1
- name: mvt-sync-context
2
- output: .claude/skills/mvt-sync-context/SKILL.md
3
-
4
- frontmatter:
5
- name: mvt-sync-context
6
- description: "Aggregate completed change artifacts (analysis/design/implementation) and merge new domain knowledge into project-context.md and project-context.yaml. This skill should be used after one or more changes are completed to keep long-term project knowledge in sync with delivered work."
7
-
8
- sections:
9
- - type: inline
10
- content: |
11
- # MVT Sync Context
12
-
13
- ## Purpose
14
-
15
- Keep `project-context.md` (semantic) and `project-context.yaml` (structural index) in sync with completed work. This is an artifact-driven, incremental synchronization: it reads workspace artifacts of completed changes, classifies new domain knowledge, and merges it into the long-term context. It does NOT scan code for new content; an optional read-only code verification step can validate that artifact-claimed entities exist.
16
-
17
- - type: shared
18
- source: sections/role-header.md
19
- params:
20
- role: Conductor
21
- role_desc: "a Workflow Coordinator"
22
- decision_rules:
23
- - rule: "Completed changes found -> List for user confirmation, then aggregate"
24
- - rule: "No completed changes since last sync -> Report nothing to do"
25
- - rule: "Conflicts with existing project-context.md -> Render conflict table, require user resolution"
26
- - rule: "User opts in to code verification -> Run read-only scan; flag artifact entries that cannot be located"
27
- - rule: "Code-only entities discovered (in code, not in artifacts) -> Do NOT write; recommend /mvt-analyze-code"
28
- - rule: "Artifact references modules/source_paths absent from project-context.yaml -> Propose yaml additions for user confirmation"
29
- boundaries:
30
- - scope: "regenerate project-context.md from full code scan"
31
- skill: "/mvt-analyze-code"
32
- - scope: "archive completed change artifacts"
33
- skill: "/mvt-cleanup"
34
- - scope: "manage shared / per-skill knowledge files"
35
- skill: "/mvt-manage-context"
36
-
37
- - type: inline
38
- content: |
39
- ### When to Use
40
- - After one or more changes are marked `completed` and you want to fold their knowledge into long-term context
41
- - BEFORE running `/mvt-cleanup` (sync first, archive after)
42
- - When `project-context.md` looks behind delivered work but you do not want to pay a full `/mvt-analyze-code` regeneration
43
-
44
- ### When NOT to Use
45
- - For deletions, renames, or module deprecations -> use `/mvt-analyze-code` (full ground-truth rebuild)
46
- - To pick up code changes never recorded as MVTT changes -> use `/mvt-analyze-code`
47
- - To clean / archive workspace -> use `/mvt-cleanup`
48
-
49
- - type: shared
50
- source: sections/activation-load-context.md
51
- params:
52
- extended_context:
53
- - ".ai-agents/workspace/artifacts/{change-id}/ -- Source artifacts for completed changes"
54
- - ".ai-agents/knowledge/project/_generated/project-context.md -- Current semantic context (merge target)"
55
- - ".ai-agents/workspace/project-context.yaml -- Current structural index (merge target)"
56
-
57
- - type: shared
58
- source: sections/activation-load-config.md
59
-
60
- - type: shared
61
- source: sections/output-language-constraint.md
62
-
63
- - type: shared
64
- source: sections/activation-preflight.md
65
- params:
66
- checks:
67
- - order: "1"
68
- field: "session.initialized_at"
69
- level: "BLOCK"
70
- message: "Session not initialized. Run `/mvt-init` first."
71
- - order: "2"
72
- field: ".ai-agents/knowledge/project/_generated/project-context.md exists"
73
- level: "BLOCK"
74
- message: "project-context.md not found. Run `/mvt-analyze-code` to create the initial document; this skill only handles incremental updates."
75
-
76
- - type: file
77
- source: ./business.md
78
-
79
- - type: shared
80
- source: sections/session-update.md
81
-
82
- - type: shared
83
- source: sections/footer-next-steps.md
84
- params:
85
- current_skill: mvt-sync-context
86
- conditional_suggestions:
87
- conditions:
88
- - condition: "merge applied successfully"
89
- primary: "mvt-cleanup"
90
- primary_desc: "Archive aggregated change artifacts now that knowledge is sync'd"
91
- - condition: "code verification flagged code-only entities"
92
- primary: "mvt-analyze-code"
93
- primary_desc: "Regenerate project-context.md from full code scan"
94
- - condition: "default"
95
- primary: "mvt-check-context"
96
- primary_desc: "Audit token cost and overall context health"
1
+ name: mvt-sync-context
2
+ output: .claude/skills/mvt-sync-context/SKILL.md
3
+
4
+ frontmatter:
5
+ name: mvt-sync-context
6
+ description: "Aggregate completed change artifacts (analysis/design/implementation) and merge new domain knowledge into project-context.md and project-context.yaml. This skill should be used after one or more changes are completed to keep long-term project knowledge in sync with delivered work."
7
+
8
+ sections:
9
+ - type: inline
10
+ content: |
11
+ # MVT Sync Context
12
+
13
+ ## Purpose
14
+
15
+ Keep `project-context.md` (semantic) and `project-context.yaml` (structural index) in sync with completed work. This is an artifact-driven, incremental synchronization: it reads workspace artifacts of completed changes, classifies new domain knowledge, and merges it into the long-term context. It does NOT scan code for new content; an optional read-only code verification step can validate that artifact-claimed entities exist.
16
+
17
+ - type: shared
18
+ source: sections/role-header.md
19
+ params:
20
+ role: Conductor
21
+ role_desc: "a Workflow Coordinator"
22
+ decision_rules:
23
+ - rule: "Completed changes found -> List for user confirmation, then aggregate"
24
+ - rule: "No completed changes since last sync -> Report nothing to do"
25
+ - rule: "Conflicts with existing project-context.md -> Render conflict table, require user resolution"
26
+ - rule: "User opts in to code verification -> Run read-only scan; flag artifact entries that cannot be located"
27
+ - rule: "Code-only entities discovered (in code, not in artifacts) -> Do NOT write; recommend /mvt-analyze-code"
28
+ - rule: "Artifact references modules/source_paths absent from project-context.yaml -> Propose yaml additions for user confirmation"
29
+ boundaries:
30
+ - scope: "regenerate project-context.md from full code scan"
31
+ skill: "/mvt-analyze-code"
32
+ - scope: "archive completed change artifacts"
33
+ skill: "/mvt-cleanup"
34
+ - scope: "manage shared / per-skill knowledge files"
35
+ skill: "/mvt-manage-context"
36
+
37
+ - type: inline
38
+ content: |
39
+ ### When to Use
40
+ - After one or more changes are marked `completed` and you want to fold their knowledge into long-term context
41
+ - BEFORE running `/mvt-cleanup` (sync first, archive after)
42
+ - When `project-context.md` looks behind delivered work but you do not want to pay a full `/mvt-analyze-code` regeneration
43
+
44
+ ### When NOT to Use
45
+ - For deletions, renames, or module deprecations -> use `/mvt-analyze-code` (full ground-truth rebuild)
46
+ - To pick up code changes never recorded as MVTT changes -> use `/mvt-analyze-code`
47
+ - To clean / archive workspace -> use `/mvt-cleanup`
48
+
49
+ - type: shared
50
+ source: sections/activation-load-context.md
51
+ params:
52
+ extended_context:
53
+ - ".ai-agents/workspace/artifacts/{change-id}/ -- Source artifacts for completed changes"
54
+ - ".ai-agents/knowledge/project/_generated/project-context.md -- Current semantic context (merge target)"
55
+ - ".ai-agents/workspace/project-context.yaml -- Current structural index (merge target)"
56
+
57
+ - type: shared
58
+ source: sections/activation-load-config.md
59
+
60
+ - type: shared
61
+ source: sections/output-language-constraint.md
62
+
63
+ - type: shared
64
+ source: sections/activation-preflight.md
65
+ params:
66
+ checks:
67
+ - order: "1"
68
+ field: "session.initialized_at"
69
+ level: "BLOCK"
70
+ message: "Session not initialized. Run `/mvt-init` first."
71
+ - order: "2"
72
+ field: ".ai-agents/knowledge/project/_generated/project-context.md exists"
73
+ level: "BLOCK"
74
+ message: "project-context.md not found. Run `/mvt-analyze-code` to create the initial document; this skill only handles incremental updates."
75
+
76
+ - type: file
77
+ source: ./business.md
78
+
79
+ - type: shared
80
+ source: sections/session-update.md
81
+ params:
82
+ current_skill: mvt-sync-context
83
+ set_synced: true
84
+
85
+ - type: shared
86
+ source: sections/footer-next-steps.md
87
+ params:
88
+ current_skill: mvt-sync-context
89
+ conditional_suggestions:
90
+ conditions:
91
+ - condition: "merge applied successfully"
92
+ primary: "mvt-cleanup"
93
+ primary_desc: "Archive aggregated change artifacts now that knowledge is sync'd"
94
+ - condition: "code verification flagged code-only entities"
95
+ primary: "mvt-analyze-code"
96
+ primary_desc: "Regenerate project-context.md from full code scan"
97
+ - condition: "default"
98
+ primary: "mvt-check-context"
99
+ primary_desc: "Audit token cost and overall context health"
@@ -82,8 +82,6 @@
82
82
 
83
83
  3. Never write outside the project root unless an absolute path was explicitly provided by the user.
84
84
 
85
- ### Step 5: (session update handled by shared section)
86
-
87
85
  ## Edge Cases & Errors
88
86
 
89
87
  | Case | Handling |