@uoyo/mvtt 2.0.0-beta.0 → 2.0.0-beta.2

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 (151) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +194 -209
  3. package/dist/build/assembler.d.ts.map +1 -1
  4. package/dist/build/assembler.js +2 -0
  5. package/dist/build/assembler.js.map +1 -1
  6. package/dist/build/plan-validator.d.ts +26 -0
  7. package/dist/build/plan-validator.d.ts.map +1 -0
  8. package/dist/build/plan-validator.js +225 -0
  9. package/dist/build/plan-validator.js.map +1 -0
  10. package/dist/build/section-loader.d.ts.map +1 -1
  11. package/dist/build/section-loader.js +45 -9
  12. package/dist/build/section-loader.js.map +1 -1
  13. package/dist/cli.d.ts.map +1 -1
  14. package/dist/cli.js +2 -11
  15. package/dist/cli.js.map +1 -1
  16. package/dist/commands/doctor.d.ts.map +1 -1
  17. package/dist/commands/doctor.js +0 -1
  18. package/dist/commands/doctor.js.map +1 -1
  19. package/dist/commands/install.d.ts +1 -4
  20. package/dist/commands/install.d.ts.map +1 -1
  21. package/dist/commands/install.js +18 -14
  22. package/dist/commands/install.js.map +1 -1
  23. package/dist/commands/migrate.d.ts +16 -0
  24. package/dist/commands/migrate.d.ts.map +1 -0
  25. package/dist/commands/migrate.js +118 -0
  26. package/dist/commands/migrate.js.map +1 -0
  27. package/dist/commands/update.d.ts.map +1 -1
  28. package/dist/commands/update.js +35 -2
  29. package/dist/commands/update.js.map +1 -1
  30. package/dist/fs/core-manifest.d.ts +17 -0
  31. package/dist/fs/core-manifest.d.ts.map +1 -0
  32. package/dist/fs/core-manifest.js +76 -0
  33. package/dist/fs/core-manifest.js.map +1 -0
  34. package/dist/fs/install-manifest.d.ts +1 -2
  35. package/dist/fs/install-manifest.d.ts.map +1 -1
  36. package/dist/fs/install-manifest.js +1 -2
  37. package/dist/fs/install-manifest.js.map +1 -1
  38. package/dist/fs/materialize.d.ts.map +1 -1
  39. package/dist/fs/materialize.js +23 -3
  40. package/dist/fs/materialize.js.map +1 -1
  41. package/dist/types/core-manifest.d.ts +12 -0
  42. package/dist/types/core-manifest.d.ts.map +1 -0
  43. package/dist/types/core-manifest.js +2 -0
  44. package/dist/types/core-manifest.js.map +1 -0
  45. package/dist/types/registry.d.ts +13 -5
  46. package/dist/types/registry.d.ts.map +1 -1
  47. package/install-manifest.yaml +31 -27
  48. package/package.json +57 -57
  49. package/registry.yaml +198 -209
  50. package/sources/defaults/config.yaml +27 -30
  51. package/sources/defaults/project-context.yaml +15 -26
  52. package/sources/defaults/session.yaml +31 -23
  53. package/sources/knowledge/core/manifest.yaml +4 -45
  54. package/sources/sections/activation-load-config.md +11 -5
  55. package/sources/sections/activation-load-context.md +26 -11
  56. package/sources/sections/activation-preflight.md +14 -4
  57. package/sources/sections/footer-next-steps.md +35 -9
  58. package/sources/sections/output-language-constraint.md +11 -0
  59. package/sources/sections/role-header.md +13 -13
  60. package/sources/sections/session-update.md +47 -0
  61. package/sources/skills/mvt-analyze/business.md +69 -33
  62. package/sources/skills/mvt-analyze/manifest.yaml +90 -89
  63. package/sources/skills/mvt-analyze-code/business.md +82 -35
  64. package/sources/skills/mvt-analyze-code/manifest.yaml +96 -88
  65. package/sources/skills/mvt-bug-detect/business.md +101 -0
  66. package/sources/skills/mvt-bug-detect/manifest.yaml +84 -0
  67. package/sources/skills/mvt-check-context/business.md +89 -42
  68. package/sources/skills/mvt-check-context/manifest.yaml +63 -74
  69. package/sources/skills/mvt-cleanup/business.md +80 -31
  70. package/sources/skills/mvt-cleanup/manifest.yaml +85 -93
  71. package/sources/skills/mvt-config/business.md +94 -26
  72. package/sources/skills/mvt-config/manifest.yaml +96 -108
  73. package/sources/skills/mvt-create-skill/business.md +231 -111
  74. package/sources/skills/mvt-create-skill/manifest.yaml +91 -79
  75. package/sources/skills/mvt-design/business.md +116 -34
  76. package/sources/skills/mvt-design/manifest.yaml +96 -105
  77. package/sources/skills/mvt-fix/business.md +132 -28
  78. package/sources/skills/mvt-fix/manifest.yaml +85 -86
  79. package/sources/skills/mvt-help/business.md +74 -70
  80. package/sources/skills/mvt-help/manifest.yaml +67 -61
  81. package/sources/skills/mvt-implement/business.md +91 -32
  82. package/sources/skills/mvt-implement/manifest.yaml +80 -96
  83. package/sources/skills/mvt-init/business.md +164 -49
  84. package/sources/skills/mvt-init/manifest.yaml +101 -93
  85. package/sources/skills/mvt-manage-context/business.md +175 -0
  86. package/sources/skills/mvt-manage-context/manifest.yaml +123 -0
  87. package/sources/skills/mvt-plan-dev/business.md +75 -0
  88. package/sources/skills/mvt-plan-dev/manifest.yaml +91 -0
  89. package/sources/skills/mvt-quick-dev/business.md +99 -0
  90. package/sources/skills/mvt-quick-dev/manifest.yaml +69 -0
  91. package/sources/skills/mvt-refactor/business.md +104 -33
  92. package/sources/skills/mvt-refactor/manifest.yaml +86 -101
  93. package/sources/skills/mvt-resume/business.md +137 -0
  94. package/sources/skills/mvt-resume/manifest.yaml +71 -0
  95. package/sources/skills/mvt-review/business.md +112 -49
  96. package/sources/skills/mvt-review/manifest.yaml +87 -106
  97. package/sources/skills/mvt-status/business.md +71 -24
  98. package/sources/skills/mvt-status/manifest.yaml +66 -74
  99. package/sources/skills/mvt-sync-context/business.md +150 -25
  100. package/sources/skills/mvt-sync-context/manifest.yaml +96 -84
  101. package/sources/skills/mvt-template/business.md +96 -49
  102. package/sources/skills/mvt-template/manifest.yaml +63 -71
  103. package/sources/skills/mvt-test/business.md +104 -36
  104. package/sources/skills/mvt-test/manifest.yaml +102 -111
  105. package/sources/skills/mvt-update-plan/business.md +72 -0
  106. package/sources/skills/mvt-update-plan/manifest.yaml +132 -0
  107. package/sources/templates/analyze-output/body.md +15 -38
  108. package/sources/templates/analyze-output/manifest.yaml +11 -11
  109. package/sources/templates/design-output/body.md +17 -50
  110. package/sources/templates/design-output/manifest.yaml +11 -11
  111. package/sources/templates/implement-output/body.md +11 -32
  112. package/sources/templates/implement-output/manifest.yaml +11 -11
  113. package/sources/templates/project-context/body.md +13 -0
  114. package/sources/templates/project-context/manifest.yaml +12 -0
  115. package/sources/templates/review-output/body.md +11 -45
  116. package/sources/templates/review-output/manifest.yaml +11 -11
  117. package/sources/templates/test-output/body.md +7 -31
  118. package/sources/templates/test-output/manifest.yaml +11 -11
  119. package/dist/fs/protection.d.ts +0 -15
  120. package/dist/fs/protection.d.ts.map +0 -1
  121. package/dist/fs/protection.js +0 -16
  122. package/dist/fs/protection.js.map +0 -1
  123. package/sources/knowledge/core/review-principles.md +0 -51
  124. package/sources/knowledge/patterns/clean-architecture/manifest.yaml +0 -66
  125. package/sources/knowledge/patterns/clean-architecture/review-checklist.md +0 -230
  126. package/sources/knowledge/patterns/ddd/manifest.yaml +0 -83
  127. package/sources/knowledge/patterns/ddd/review-checklist.md +0 -226
  128. package/sources/knowledge/patterns/ddd/tactical-patterns.md +0 -12
  129. package/sources/knowledge/patterns/frontend-react/manifest.yaml +0 -44
  130. package/sources/knowledge/patterns/frontend-react/review-checklist.md +0 -78
  131. package/sources/knowledge/patterns/manifest.yaml +0 -113
  132. package/sources/skills/mvt-add-context/business.md +0 -47
  133. package/sources/skills/mvt-add-context/manifest.yaml +0 -83
  134. package/sources/templates/analyze-code-output/body.md +0 -44
  135. package/sources/templates/analyze-code-output/manifest.yaml +0 -11
  136. package/sources/templates/cleanup-output/body.md +0 -9
  137. package/sources/templates/cleanup-output/manifest.yaml +0 -11
  138. package/sources/templates/config-output/body.md +0 -11
  139. package/sources/templates/config-output/manifest.yaml +0 -11
  140. package/sources/templates/context-check-output/body.md +0 -32
  141. package/sources/templates/context-check-output/manifest.yaml +0 -11
  142. package/sources/templates/fix-output/body.md +0 -30
  143. package/sources/templates/fix-output/manifest.yaml +0 -11
  144. package/sources/templates/init-output/body.md +0 -34
  145. package/sources/templates/init-output/manifest.yaml +0 -11
  146. package/sources/templates/refactor-output/body.md +0 -32
  147. package/sources/templates/refactor-output/manifest.yaml +0 -11
  148. package/sources/templates/status-output/body.md +0 -36
  149. package/sources/templates/status-output/manifest.yaml +0 -11
  150. package/sources/templates/sync-context-output/body.md +0 -16
  151. package/sources/templates/sync-context-output/manifest.yaml +0 -11
@@ -1,74 +1,66 @@
1
- name: mvt-status
2
- output: .claude/skills/mvt-status/SKILL.md
3
-
4
- frontmatter:
5
- name: mvt-status
6
- description: "Show current project and workflow status including progress through phases, active changes, and session state. Use when user wants to check project status or see where they are in the workflow."
7
-
8
- sections:
9
- - type: inline
10
- content: |
11
- # MVT Status
12
-
13
- ## Purpose
14
-
15
- Display comprehensive project and workflow status, showing progress through development phases, active changes, and current session state.
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: "If project not initialized -> Warn and suggest `/mvt-init`"
24
- - rule: "If no active change -> Show project info only, suggest starting a workflow"
25
- - rule: "If workflow in progress -> Highlight current phase and next recommended step"
26
- boundaries:
27
- - scope: "analyze requirements"
28
- skill: "/mvt-analyze"
29
- - scope: "design architecture"
30
- skill: "/mvt-design"
31
- - scope: "write implementation code"
32
- skill: "/mvt-implement"
33
-
34
- - type: shared
35
- source: sections/activation-load-context.md
36
-
37
- - type: shared
38
- source: sections/activation-load-config.md
39
-
40
- - type: shared
41
- source: sections/activation-preflight.md
42
- params:
43
- checks:
44
- - order: "1"
45
- field: "session.initialized_at"
46
- level: "WARN"
47
- message: 'Session not initialized. Run `/mvt-init` first.'
48
- - order: "2"
49
- field: "project.name"
50
- level: "WARN"
51
- message: 'Project not initialized. Run `/mvt-init` first.'
52
-
53
- - type: inline
54
- content: |
55
- ### Step 4: Execute
56
- Proceed to Execution Flow below.
57
-
58
- - type: file
59
- source: ./business.md
60
-
61
- - type: inline
62
- content: |
63
- ## Output Format
64
-
65
- Read and use the output template from: `.ai-agents/skills/_templates/status-output.md`
66
-
67
- If a custom version exists at `.ai-agents/skills/_templates/custom/status-output.md`, use the custom version instead.
68
-
69
- Fill the template placeholders with the current state data.
70
-
71
- Every response MUST end with a Suggested Next Steps section.
72
-
73
- ## Suggested Next Steps
74
- After completion, suggest the logical next workflow step based on current progress.
1
+ name: mvt-status
2
+ output: .claude/skills/mvt-status/SKILL.md
3
+
4
+ frontmatter:
5
+ name: mvt-status
6
+ description: "Display current project and workflow status including skill history, active changes, and session state. This skill should be used when user wants to check project status, review workflow progress, or see where they are in the development cycle."
7
+
8
+ sections:
9
+ - type: inline
10
+ content: |
11
+ # MVT Status
12
+
13
+ ## Purpose
14
+
15
+ Display comprehensive project and workflow status, showing project list, semantic context availability, skill history, active changes, and current session state.
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: "If project not initialized -> Warn and suggest `/mvt-init`"
24
+ - rule: "If no active change -> Show project info only, suggest starting a workflow"
25
+ - rule: "If workflow in progress -> Highlight recent skill history and next recommended step"
26
+ - rule: "If project-context.md missing -> Suggest `/mvt-analyze-code` to generate semantic context"
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"
29
+ boundaries:
30
+ - scope: "analyze requirements"
31
+ skill: "/mvt-analyze"
32
+ - scope: "design architecture"
33
+ skill: "/mvt-design"
34
+ - scope: "write implementation code"
35
+ skill: "/mvt-implement"
36
+
37
+ - type: shared
38
+ source: sections/activation-load-context.md
39
+
40
+ - type: shared
41
+ source: sections/activation-load-config.md
42
+
43
+ - type: shared
44
+ source: sections/output-language-constraint.md
45
+
46
+ - type: shared
47
+ source: sections/activation-preflight.md
48
+ params:
49
+ checks:
50
+ - order: "1"
51
+ field: "session.initialized_at"
52
+ level: "WARN"
53
+ message: "Session not initialized. Run `/mvt-init` first."
54
+
55
+ - type: file
56
+ source: ./business.md
57
+
58
+ - type: shared
59
+ source: sections/session-update.md
60
+ params:
61
+ read_only: true
62
+
63
+ - type: shared
64
+ source: sections/footer-next-steps.md
65
+ params:
66
+ current_skill: mvt-status
@@ -1,25 +1,150 @@
1
- ## Execution Flow
2
-
3
- ### Step 1: Detect Changes
4
- - If git available:
5
- - Run `git diff --name-only` (unstaged changes)
6
- - Run `git diff --name-only --cached` (staged changes)
7
- - Run `git diff --name-only HEAD~1` (last commit changes)
8
- - Merge results and deduplicate
9
- - If git not available:
10
- - Scan for recently modified files in source directories
11
-
12
- ### Step 2: Analyze Changed Files
13
- - Read each changed file
14
- - Extract entities (classes, models, types)
15
- - Extract services (service classes, API handlers)
16
- - Extract keywords and topics
17
-
18
- ### Step 3: Update Workspace
19
- 1. Update `.ai-agents/workspace/project-context.yaml`:
20
- - Add new entities to architecture section
21
- - Add new services
22
- - Update module mappings
23
- 2. Update `.ai-agents/workspace/session.yaml`:
24
- - Set `session.last_command: "/mvt-sync-context"`
25
- - Append one-line summary to `recent_actions` (keep max 3)
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,84 +1,96 @@
1
- name: mvt-sync-context
2
- output: .claude/skills/mvt-sync-context/SKILL.md
3
-
4
- frontmatter:
5
- name: mvt-sync-context
6
- description: "Synchronize workspace context with code changes after manual modifications or git operations. Use when context seems out of sync with code, after manual edits, or after git merge/rebase."
7
-
8
- sections:
9
- - type: inline
10
- content: |
11
- # MVT Sync Context
12
-
13
- ## Purpose
14
-
15
- Synchronize the MVTT workspace context with code changes made outside the workflow. This is a code-driven, automatic synchronization that scans git diffs and file changes to update project context.
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: "Git available -> Use git diff to detect changes"
24
- - rule: "Git not available -> Scan for recently modified files"
25
- - rule: "Changes detected -> Analyze and update context"
26
- - rule: "No changes detected -> Report context is already in sync"
27
- boundaries:
28
- - scope: "analyze requirements"
29
- skill: "/mvt-analyze"
30
- - scope: "design architecture"
31
- skill: "/mvt-design"
32
- - scope: "write implementation code"
33
- skill: "/mvt-implement"
34
-
35
- - type: inline
36
- content: |
37
- ### When to Use
38
- - After manual code changes outside the workflow
39
- - When context seems out of sync with code
40
- - After git operations (merge, rebase, etc.)
41
-
42
- - type: shared
43
- source: sections/activation-load-context.md
44
-
45
- - type: shared
46
- source: sections/activation-load-config.md
47
-
48
- - type: shared
49
- source: sections/activation-preflight.md
50
- params:
51
- checks:
52
- - order: "1"
53
- field: "project-context is empty"
54
- level: "WARN"
55
- message: 'Project not initialized. Run `/mvt-init` first.'
56
-
57
- - type: inline
58
- content: |
59
- ### Step 4: Execute
60
- Proceed to Execution Flow below.
61
-
62
- - type: file
63
- source: ./business.md
64
-
65
- - type: inline
66
- content: |
67
- ## Output Format
68
-
69
- Read and use the output template from: `.ai-agents/skills/_templates/sync-context-output.md`
70
-
71
- If a custom version exists at `.ai-agents/skills/_templates/custom/sync-context-output.md`, use the custom version instead.
72
-
73
- Fill the template placeholders with the sync results.
74
-
75
- Every response MUST end with a Suggested Next Steps section.
76
-
77
- - type: shared
78
- source: sections/footer-next-steps.md
79
- params:
80
- next_primary: mvt-status
81
- next_primary_desc: "Verify context state after sync"
82
- next_alternatives:
83
- - skill: "(continue)"
84
- when: "Continue with your current task"
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"