@uoyo/mvtt 2.0.0-beta.4 → 2.0.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.
- package/README.md +299 -64
- package/README.zh-CN.md +419 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +14 -6
- package/dist/cli.js.map +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +28 -16
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/install.d.ts.map +1 -1
- package/dist/commands/install.js +71 -41
- package/dist/commands/install.js.map +1 -1
- package/dist/commands/uninstall.d.ts.map +1 -1
- package/dist/commands/uninstall.js +75 -30
- package/dist/commands/uninstall.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +34 -21
- package/dist/commands/update.js.map +1 -1
- package/dist/fs/install-manifest.d.ts +4 -1
- package/dist/fs/install-manifest.d.ts.map +1 -1
- package/dist/fs/install-manifest.js +13 -1
- package/dist/fs/install-manifest.js.map +1 -1
- package/dist/fs/materialize.d.ts +2 -0
- package/dist/fs/materialize.d.ts.map +1 -1
- package/dist/fs/materialize.js +39 -9
- package/dist/fs/materialize.js.map +1 -1
- package/dist/fs/registry-merge.d.ts.map +1 -1
- package/dist/fs/registry-merge.js +72 -29
- package/dist/fs/registry-merge.js.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/scripts/epic-update.cjs +7713 -0
- package/dist/scripts/plan-update.cjs +491 -275
- package/dist/scripts/session-update.cjs +320 -199
- package/dist/types/platform.d.ts +12 -0
- package/dist/types/platform.d.ts.map +1 -0
- package/dist/types/platform.js +36 -0
- package/dist/types/platform.js.map +1 -0
- package/dist/types/registry.d.ts +3 -24
- package/dist/types/registry.d.ts.map +1 -1
- package/dist/util/bilingual.d.ts +10 -0
- package/dist/util/bilingual.d.ts.map +1 -0
- package/dist/util/bilingual.js +14 -0
- package/dist/util/bilingual.js.map +1 -0
- package/dist/util/cancel.d.ts +2 -0
- package/dist/util/cancel.d.ts.map +1 -0
- package/dist/util/cancel.js +6 -0
- package/dist/util/cancel.js.map +1 -0
- package/dist/util/color.d.ts +9 -6
- package/dist/util/color.d.ts.map +1 -1
- package/dist/util/color.js +10 -10
- package/dist/util/color.js.map +1 -1
- package/dist/util/spinner.d.ts +8 -0
- package/dist/util/spinner.d.ts.map +1 -0
- package/dist/util/spinner.js +17 -0
- package/dist/util/spinner.js.map +1 -0
- package/install-manifest.yaml +4 -0
- package/package.json +4 -3
- package/registry.yaml +33 -159
- package/sources/defaults/config.yaml +8 -13
- package/sources/defaults/project-context.yaml +2 -5
- package/sources/defaults/session.yaml +14 -2
- package/sources/knowledge/core/manifest.yaml +1 -4
- package/sources/scripts/epic-update.js +512 -0
- package/sources/scripts/plan-update.js +614 -353
- package/sources/scripts/session-update.js +102 -2
- package/sources/sections/activation-load-config.md +3 -3
- package/sources/sections/activation-load-context.md +42 -13
- package/sources/sections/activation-preflight.md +1 -1
- package/sources/sections/footer-next-steps.md +3 -2
- package/sources/sections/language-constraint.md +26 -0
- package/sources/sections/output-format-constraint.md +14 -14
- package/sources/sections/project-context-profile.md +29 -29
- package/sources/sections/session-update.md +41 -1
- package/sources/skills/mvt-analyze/business.md +46 -8
- package/sources/skills/mvt-analyze/manifest.yaml +6 -2
- package/sources/skills/mvt-analyze-code/business.md +18 -17
- package/sources/skills/mvt-analyze-code/manifest.yaml +4 -7
- package/sources/skills/mvt-bug-detect/manifest.yaml +3 -0
- package/sources/skills/mvt-check-context/business.md +13 -6
- package/sources/skills/mvt-check-context/manifest.yaml +2 -4
- package/sources/skills/mvt-cleanup/business.md +17 -2
- package/sources/skills/mvt-cleanup/manifest.yaml +1 -1
- package/sources/skills/mvt-config/business.md +5 -5
- package/sources/skills/mvt-config/manifest.yaml +6 -6
- package/sources/skills/mvt-create-skill/business.md +3 -15
- package/sources/skills/mvt-create-skill/manifest.yaml +1 -6
- package/sources/skills/mvt-decompose/business.md +94 -0
- package/sources/skills/mvt-decompose/manifest.yaml +121 -0
- package/sources/skills/mvt-design/manifest.yaml +1 -1
- package/sources/skills/mvt-fix/business.md +21 -6
- package/sources/skills/mvt-fix/manifest.yaml +2 -2
- package/sources/skills/mvt-help/business.md +11 -9
- package/sources/skills/mvt-help/manifest.yaml +2 -4
- package/sources/skills/mvt-implement/business.md +51 -8
- package/sources/skills/mvt-implement/manifest.yaml +1 -1
- package/sources/skills/mvt-init/business.md +23 -13
- package/sources/skills/mvt-init/manifest.yaml +2 -3
- package/sources/skills/mvt-manage-context/business.md +41 -14
- package/sources/skills/mvt-manage-context/manifest.yaml +3 -7
- package/sources/skills/mvt-plan-dev/business.md +17 -9
- package/sources/skills/mvt-plan-dev/manifest.yaml +1 -1
- package/sources/skills/mvt-quick-dev/business.md +22 -7
- package/sources/skills/mvt-quick-dev/manifest.yaml +1 -2
- package/sources/skills/mvt-refactor/business.md +32 -17
- package/sources/skills/mvt-refactor/manifest.yaml +1 -6
- package/sources/skills/mvt-resume/business.md +32 -12
- package/sources/skills/mvt-resume/manifest.yaml +6 -3
- package/sources/skills/mvt-review/business.md +24 -9
- package/sources/skills/mvt-review/manifest.yaml +1 -1
- package/sources/skills/mvt-status/business.md +37 -9
- package/sources/skills/mvt-status/manifest.yaml +5 -2
- package/sources/skills/mvt-sync-context/business.md +30 -16
- package/sources/skills/mvt-sync-context/manifest.yaml +1 -1
- package/sources/skills/mvt-template/business.md +1 -1
- package/sources/skills/mvt-template/manifest.yaml +2 -4
- package/sources/skills/mvt-test/business.md +30 -15
- package/sources/skills/mvt-test/manifest.yaml +1 -1
- package/sources/skills/mvt-update-plan/business.md +41 -12
- package/sources/skills/mvt-update-plan/manifest.yaml +8 -8
- package/sources/templates/decompose-output/body.md +13 -0
- package/sources/templates/decompose-output/manifest.yaml +11 -0
- package/sources/sections/output-language-constraint.md +0 -11
|
@@ -2,17 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
### Step 1: Determine Analysis Target
|
|
4
4
|
|
|
5
|
-
Identify which project(s) to analyze:
|
|
5
|
+
Identify which project(s) to analyze using interactive routing:
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
For each
|
|
14
|
-
1. Read its `path` from `project-context.yaml`
|
|
15
|
-
2. Use `path` as the source directory for analysis
|
|
7
|
+
1. Read `project-context.yaml > projects[]` to get the list of registered projects.
|
|
8
|
+
2. **Single project** (only one entry): automatically select it — no prompt needed.
|
|
9
|
+
3. **Multiple projects**: present an interactive selection menu:
|
|
10
|
+
- List each project by `name` with its `path`
|
|
11
|
+
- Include an option to **analyze all projects**
|
|
12
|
+
- Wait for user selection before proceeding
|
|
13
|
+
4. For each selected project, read its `path` and use it as the source directory for analysis.
|
|
16
14
|
|
|
17
15
|
### Step 2: Load Template
|
|
18
16
|
|
|
@@ -72,11 +70,14 @@ Identify public interfaces:
|
|
|
72
70
|
- Fill each template section with analysis results
|
|
73
71
|
- If a section has no relevant content, include the heading with "(No relevant content detected)"
|
|
74
72
|
|
|
75
|
-
2. Write the output to `.ai-agents/knowledge/project/_generated/project-context.md
|
|
76
|
-
-
|
|
77
|
-
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
73
|
+
2. Write the output to `.ai-agents/knowledge/project/_generated/project-context.md` (always the flat path, regardless of project count).
|
|
74
|
+
- **Single-project**: write the full document.
|
|
75
|
+
- **Multi-project**: use `# Project: {name}` as the top-level heading to separate each project's content sections within the single file.
|
|
76
|
+
|
|
77
|
+
3. If the output file already exists:
|
|
78
|
+
- **Single-project**: replace the whole file.
|
|
79
|
+
- **Multi-project**: replace only the `# Project: {name}` section(s) for re-analyzed projects; preserve sections for projects NOT in this analysis run.
|
|
80
|
+
|
|
81
|
+
4. **Populate `source_paths`** in `project-context.yaml`: after analyzing each project, update the matching project entry's `source_paths` array with the detected source directories (e.g., `["src/", "test/"]`). This overwrites the empty default set by `/mvt-init`.
|
|
81
82
|
|
|
82
|
-
|
|
83
|
+
5. Do NOT update other fields in `project-context.yaml` -- only `source_paths` is touched by this skill.
|
|
@@ -37,13 +37,10 @@ sections:
|
|
|
37
37
|
|
|
38
38
|
- type: inline
|
|
39
39
|
content: |
|
|
40
|
-
##
|
|
40
|
+
## Invocation
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
| `/mvt-analyze-code` | Analyze the first (or only) project |
|
|
45
|
-
| `/mvt-analyze-code --all` | Analyze all projects in the workspace |
|
|
46
|
-
| `/mvt-analyze-code {name}` | Analyze a specific project by name |
|
|
42
|
+
`/mvt-analyze-code` — single entry point, no arguments or flags.
|
|
43
|
+
When multiple projects exist, the skill interactively prompts the user to select the target(s).
|
|
47
44
|
|
|
48
45
|
- type: shared
|
|
49
46
|
source: sections/activation-load-context.md
|
|
@@ -57,7 +54,7 @@ sections:
|
|
|
57
54
|
source: sections/activation-load-config.md
|
|
58
55
|
|
|
59
56
|
- type: shared
|
|
60
|
-
source: sections/
|
|
57
|
+
source: sections/language-constraint.md
|
|
61
58
|
|
|
62
59
|
- type: shared
|
|
63
60
|
source: sections/output-format-constraint.md
|
|
@@ -10,9 +10,9 @@ This skill measures only files the **user** can reduce or relocate. Framework-fi
|
|
|
10
10
|
|
|
11
11
|
**In scope (user-actionable):**
|
|
12
12
|
- Index: `.ai-agents/workspace/project-context.yaml`.
|
|
13
|
-
- Semantic context: `.ai-agents/knowledge/project/_generated/project-context.md
|
|
14
|
-
- Shared knowledge: every entry in `registry.yaml > knowledge.
|
|
15
|
-
- Per-skill knowledge: every entry in `registry.yaml > skills.*.knowledge
|
|
13
|
+
- Semantic context: `.ai-agents/knowledge/project/_generated/project-context.md` (always the flat path, regardless of project count).
|
|
14
|
+
- Shared knowledge: every entry in `registry.yaml > knowledge._all` and `knowledge.{projectName}` (map-aware -- traverse ALL project keys in the knowledge map). For the `core` entry, scan only files marked as user-origin per `core/manifest.yaml` (or whose path begins with `user/`); skip files under `core/_framework/`.
|
|
15
|
+
- Per-skill knowledge: every entry in `registry.yaml > skills.*.knowledge._all` and `skills.*.knowledge.{projectName}` (map-aware -- traverse ALL project keys for each skill), grouped by skill.
|
|
16
16
|
- Artifacts: all files under `.ai-agents/workspace/artifacts/` recursively. **Exclude the `_archived/` subdirectory** — it contains completed changes archived by `/mvt-cleanup` and should not count toward the active workspace token budget.
|
|
17
17
|
|
|
18
18
|
**Out of scope (do NOT scan):**
|
|
@@ -21,13 +21,19 @@ This skill measures only files the **user** can reduce or relocate. Framework-fi
|
|
|
21
21
|
- `.ai-agents/config.yaml`, `.ai-agents/workspace/session.yaml`, `.ai-agents/registry.yaml` -- small, required, and addressed via `/mvt-config` or `/mvt-manage-context`, not here.
|
|
22
22
|
|
|
23
23
|
### Step 3: Estimate Token Consumption
|
|
24
|
-
- **What**: produce a per-file tokens estimate and per-category subtotals
|
|
24
|
+
- **What**: produce a per-file tokens estimate and per-category subtotals, with **per-project breakdown**.
|
|
25
25
|
- **How**:
|
|
26
26
|
1. For each in-scope file: tokens ~= `characters / 4`.
|
|
27
27
|
2. Group by category: `Index`, `Semantic Context`, `Shared Knowledge`, `Per-Skill Knowledge`, `Artifacts`.
|
|
28
28
|
3. For Shared Knowledge, compute total once -- this is per-skill overhead (loaded by every skill invocation).
|
|
29
29
|
4. For Per-Skill Knowledge, compute totals per skill so users can see which skill is heaviest.
|
|
30
30
|
5. Identify the Top 5 largest single files across the whole in-scope set.
|
|
31
|
+
6. **Per-project breakdown**: for multi-project workspaces, also compute token costs per project:
|
|
32
|
+
- `knowledge._all` = shared across all projects
|
|
33
|
+
- `knowledge.{projectName}` = project-specific overhead
|
|
34
|
+
- `skills.*.knowledge.{projectName}` = per-skill per-project overhead
|
|
35
|
+
Display as a separate table: `project | knowledge tokens | per-skill tokens | total`.
|
|
36
|
+
7. **Global summary**: total tokens across all projects + `_all` overhead loaded every time.
|
|
31
37
|
|
|
32
38
|
### Step 4: Apply Thresholds and Health Status
|
|
33
39
|
- **What**: assign each file/category a status of `healthy | borderline | oversized`.
|
|
@@ -70,8 +76,9 @@ This skill measures only files the **user** can reduce or relocate. Framework-fi
|
|
|
70
76
|
2. **Per-Category Breakdown** -- table: `category | files | tokens | status`.
|
|
71
77
|
3. **Top 5 Largest Files** -- table: `path | tokens | category | status`.
|
|
72
78
|
4. **Per-Skill Knowledge Cost** -- table: `skill | tokens` (sorted desc); include shared knowledge as a separate row labeled `(shared, loaded every time)`.
|
|
73
|
-
5. **
|
|
74
|
-
6. **
|
|
79
|
+
5. **Per-Project Token Accounting** -- table: `project | knowledge tokens | per-skill tokens | total` (only for multi-project workspaces; for single-project, omit this section).
|
|
80
|
+
6. **Recommendations** -- numbered list from Step 5; if empty, render the healthy line.
|
|
81
|
+
7. **Excluded Scope Note** -- one paragraph reminding the user that framework files (`_framework/`, `mvt-*/SKILL.md`, `config.yaml`, `session.yaml`, `registry.yaml`) were not measured here.
|
|
75
82
|
- The report is conversation output; this skill does NOT write any artifact.
|
|
76
83
|
|
|
77
84
|
## Edge Cases & Errors
|
|
@@ -40,10 +40,8 @@ sections:
|
|
|
40
40
|
- type: shared
|
|
41
41
|
source: sections/activation-load-config.md
|
|
42
42
|
|
|
43
|
-
- type:
|
|
44
|
-
|
|
45
|
-
### Step 4: Pre-flight Checks
|
|
46
|
-
- No blocking checks required.
|
|
43
|
+
- type: shared
|
|
44
|
+
source: sections/language-constraint.md
|
|
47
45
|
|
|
48
46
|
- type: file
|
|
49
47
|
source: ./business.md
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
For each `changes[]` entry with `status: done`:
|
|
9
9
|
1. Compare `session.last_synced_at` with the change's `updated_at`.
|
|
10
|
-
2. If `last_synced_at` is empty OR `last_synced_at` < `updated_at`, mark the change as
|
|
10
|
+
2. If `last_synced_at` is empty OR `last_synced_at` < `updated_at`, mark the change as **WARNING: unsynced**.
|
|
11
11
|
3. Collect all unsynced change-ids into a warning list for display in Step 6.
|
|
12
12
|
|
|
13
13
|
This check ensures `/mvt-sync-context` has processed a change's knowledge before cleanup archives it. Once archived, the original artifact files (`analysis.md`, `design.md`, `implementation.md`) are no longer accessible to sync-context.
|
|
@@ -31,6 +31,8 @@ This check ensures `/mvt-sync-context` has processed a change's knowledge before
|
|
|
31
31
|
| Source | Rule | Proposed action |
|
|
32
32
|
|--------|------|-----------------|
|
|
33
33
|
| `changes[]` entry with `status: done` AND any task in plan is older than the active change's start | Summarize: generate a `summary.md` from the change's artifacts, then move the **entire** `artifacts/{id}/` directory (including `summary.md`) to `artifacts/_archived/{id}/` |
|
|
34
|
+
| `changes[]` entry with `status: done` AND `epic_id` non-empty AND parent epic status is NOT `done` | **Epic integrity warning**: mark the candidate as `epic-unsafe` -- archiving a sub-change whose parent epic is still in-progress may leave the epic in an inconsistent state. Default to `n` (skip) in the cleanup plan. User may override to force-archive. |
|
|
35
|
+
| Artifact directory under `artifacts/` whose id starts with `epic-` AND contains `epic.yaml` with `status: done` | **Batch archive candidate**: mark for batch suggestion in Step 7 -- read `epic.yaml.children[]` for child change-ids to offer as batch archive options alongside the epic |
|
|
34
36
|
| Change-id directory marked `unindexed` | List for user review (do NOT auto-archive -- could be in-flight work the user just hasn't registered) |
|
|
35
37
|
| `history` entries beyond the most recent N (from `config.yaml > preferences.history_limits.history`, default 20) | Truncate via `session-update.cjs --truncate-history <N>` |
|
|
36
38
|
| Directory `knowledge/patterns/` exists | Flag for deletion (legacy pattern data; no replacement) |
|
|
@@ -55,7 +57,7 @@ This check ensures `/mvt-sync-context` has processed a change's knowledge before
|
|
|
55
57
|
- `summarize` action (collapses multi-file content).
|
|
56
58
|
- `archive` action (moves entire change-id directory into `artifacts/_archived/`).
|
|
57
59
|
- If the Step 2 warning list is non-empty, prepend it to the confirmation prompt:
|
|
58
|
-
>
|
|
60
|
+
> WARNING: The following changes have NOT been synced by `/mvt-sync-context`. Archiving them will permanently lose their knowledge for aggregation:
|
|
59
61
|
> - {change-id}: {title}
|
|
60
62
|
> Options: `y` = archive anyway, `n` = cancel, `sync-first` = abort and run `/mvt-sync-context` first, `show-details` = per-file breakdown.
|
|
61
63
|
- If no unsynced warnings, use the standard prompt: `Apply cleanup plan? (y / n / show-details)`. `show-details` prints the per-file actions, then re-asks.
|
|
@@ -67,6 +69,16 @@ This check ensures `/mvt-sync-context` has processed a change's knowledge before
|
|
|
67
69
|
- **How**:
|
|
68
70
|
1. **Summarize action**: read the full set of files in the change-id directory; produce a `summary.md` with: title, change-id, status, key decisions (list each ADR/decision title), final outcomes, list of original files. Write `summary.md` into the change-id directory, then move the **entire** `artifacts/{id}/` directory to `artifacts/_archived/{id}/` (summary.md travels with it).
|
|
69
71
|
2. **Archive action** (no summarize): move the **entire** `artifacts/{id}/` directory to `artifacts/_archived/{id}/`. No internal path restructuring needed.
|
|
72
|
+
2a. **Batch archive action** (epic with children): when archiving a completed epic (the change-id is an epic directory containing `epic.yaml` with `status: done`), read `epic.yaml.children` and present the user with three options before proceeding:
|
|
73
|
+
|
|
74
|
+
| Option | Description |
|
|
75
|
+
|--------|-------------|
|
|
76
|
+
| Epic only | Archive only the epic directory (leave child change directories in place) |
|
|
77
|
+
| All children | Archive the epic directory AND move all child change directories (`artifacts/{child_id}/`) to `artifacts/_archived/{child_id}/` |
|
|
78
|
+
| Selective | User picks which children to include alongside the epic |
|
|
79
|
+
|
|
80
|
+
Per ADR-8: archive = abandon references; no post-archive `epic_id` integrity maintenance. Child changes that are also `status: done` are eligible for batch archiving; in-progress or pending children are excluded with a note.
|
|
81
|
+
|
|
70
82
|
3. **Delete action**: remove only the items explicitly marked for deletion in the confirmed plan; never recurse beyond what was listed.
|
|
71
83
|
4. **Stale history truncation**: call `session-update.cjs --truncate-history <N>` where N is from `config.yaml > preferences.history_limits.history` (default 20).
|
|
72
84
|
5. All file mutations atomic where possible (write-temp + rename, copy-then-delete for moves).
|
|
@@ -104,3 +116,6 @@ Apply the State Update rules defined in the **State Update** section below.
|
|
|
104
116
|
| File targeted for action no longer exists (concurrent removal) | Skip with a note; do not error out the whole run |
|
|
105
117
|
| Unindexed change-id directory contains only `plan.yaml` | List as review-only; suggest user runs `/mvt-update-plan` or registers it via `/mvt-plan-dev` instead of cleaning |
|
|
106
118
|
| `session.yaml.bak` present from a previous failed run | Overwrite during Step 7 collapse (only the most recent backup is useful) |
|
|
119
|
+
| Change with `epic_id` is a cleanup candidate but parent epic is still `in_progress` | Mark as `epic-unsafe`; default to skip. User may override to force-archive. Warn: "This change belongs to in-progress epic '{title}'. Archiving it separately may leave the epic in an inconsistent state." |
|
|
120
|
+
| Epic directory marked for batch archive but `epic.yaml` is missing or unreadable | Skip batch suggestion; treat as a regular archive candidate |
|
|
121
|
+
| Batch archive includes a child that is still `in_progress` | Exclude that child from the batch with a note: "Child {id} is in_progress and cannot be archived." |
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
|
|
39
39
|
| Type | Validation |
|
|
40
40
|
|------|------------|
|
|
41
|
-
| `enum` | Value MUST be in the allowed list. Reject with the allowed list shown. For `language` enums (`en-US
|
|
41
|
+
| `enum` | Value MUST be in the allowed list. Reject with the allowed list shown. For `language` enums (`en-US` = English, `zh-CN` = 简体中文), reject other locale strings -- ask user to pick from the allowed list (do not fuzzy-match) |
|
|
42
42
|
| `bool` | Accept exactly `true` / `false` (case-insensitive). Reject `yes`/`1`/`y` |
|
|
43
43
|
| `int` | Parse as integer; check range when range is documented (e.g., `relevance_threshold` must be 0-100) |
|
|
44
|
-
| `list` | Parse as comma-separated tokens; for
|
|
44
|
+
| `list` | Parse as comma-separated tokens; for knowledge map entries (`_all` and project keys), every token must be a registered knowledge id |
|
|
45
45
|
|
|
46
46
|
3. **Preview**: render `key: <current> -> <new>` on a single line.
|
|
47
47
|
4. **Confirm**: prompt `Apply this change? (y/n)`. Skip the prompt only if invocation included an explicit non-interactive flag (none currently exists, so always prompt).
|
|
@@ -72,10 +72,10 @@
|
|
|
72
72
|
4. Backup current `config.yaml` to `config.yaml.bak` before writing.
|
|
73
73
|
5. Write defaults atomically.
|
|
74
74
|
6. Report the keys that changed.
|
|
75
|
-
- Do NOT reset
|
|
75
|
+
- Do NOT reset knowledge map entries (`_all`, project keys) to defaults if the user has added entries via `/mvt-manage-context` -- preserve user-added knowledge ids; only reset preferences. Surface this exception in the diff.
|
|
76
76
|
|
|
77
77
|
## Knowledge Inspection (sub-flow used by Interactive Menu and Show All)
|
|
78
|
-
- **View**: list
|
|
78
|
+
- **View**: list global knowledge ids from `registry.yaml > knowledge._all` and project-specific ids from `knowledge.{projectName}`, then per-skill knowledge ids grouped by skill (`registry.yaml > skills.*.knowledge`). Show token estimates from each entry's manifest if available.
|
|
79
79
|
- **Modify**: this skill does NOT mutate knowledge settings; defer to `/mvt-manage-context`. Print the suggested command (`/mvt-manage-context move`, `/mvt-manage-context add`, etc.) instead of doing the work here.
|
|
80
80
|
|
|
81
81
|
## Edge Cases & Errors
|
|
@@ -89,5 +89,5 @@
|
|
|
89
89
|
| User aborts mid-wizard | No partial write; the temp values are discarded |
|
|
90
90
|
| `.bak` from previous reset already exists | Overwrite (only the most recent backup is useful) |
|
|
91
91
|
| Concurrent edit detected (mtime changed during preview->write) | Abort write, surface a message, ask user to re-run |
|
|
92
|
-
| `set knowledge.
|
|
92
|
+
| `set knowledge._all <list>` (or project key) includes unknown id | Reject with the list of valid ids from `registry.yaml` |
|
|
93
93
|
| `reset` invoked but `config.yaml` already matches defaults | Report "nothing to reset", do not write |
|
|
@@ -56,19 +56,19 @@ sections:
|
|
|
56
56
|
- type: shared
|
|
57
57
|
source: sections/activation-load-config.md
|
|
58
58
|
|
|
59
|
+
- type: shared
|
|
60
|
+
source: sections/language-constraint.md
|
|
61
|
+
|
|
59
62
|
- type: inline
|
|
60
63
|
content: |
|
|
61
|
-
### Step 4: Pre-flight Checks
|
|
62
|
-
- No blocking checks required (config is always accessible)
|
|
63
|
-
|
|
64
64
|
## Configuration Keys
|
|
65
65
|
|
|
66
66
|
### User Preferences
|
|
67
67
|
|
|
68
68
|
| Key | Type | Default | Description |
|
|
69
69
|
|-----|------|---------|-------------|
|
|
70
|
-
| `preferences.interaction_language` | enum | `en-US` | Language for interactive output: chat replies, prompts, tables
|
|
71
|
-
| `preferences.document_output_language` | enum | `en-US` | Language for persisted documents: artifacts, project-context.md (falls back to interaction_language) |
|
|
70
|
+
| `preferences.interaction_language` | enum | `en-US` | Language for interactive output: chat replies, prompts, tables. Values: `en-US` (English), `zh-CN` (简体中文) |
|
|
71
|
+
| `preferences.document_output_language` | enum | `en-US` | Language for persisted documents: artifacts, project-context.md (falls back to interaction_language). Values: `en-US` (English), `zh-CN` (简体中文) |
|
|
72
72
|
| `preferences.output.no_emojis` | bool | `true` | Disable emojis in output |
|
|
73
73
|
| `preferences.output.data_format` | enum | `yaml` | Data output format (yaml, json) |
|
|
74
74
|
| `preferences.context_routing.relevance_threshold` | int | `70` | AI routing threshold for `/mvt-manage-context add` (0-100) |
|
|
@@ -79,7 +79,7 @@ sections:
|
|
|
79
79
|
|
|
80
80
|
| Key | Type | Default | Description |
|
|
81
81
|
|-----|------|---------|-------------|
|
|
82
|
-
| `knowledge.
|
|
82
|
+
| `knowledge._all` | list | `[core, project-context]` | Global knowledge entries in registry.yaml under `_all` key, loaded by all skills across all projects |
|
|
83
83
|
|
|
84
84
|
- type: file
|
|
85
85
|
source: ./business.md
|
|
@@ -50,7 +50,6 @@ Collect core metadata. Each field has an explicit constraint -- do not accept va
|
|
|
50
50
|
| Purpose | One sentence | Will become the SKILL.md `## Purpose` section |
|
|
51
51
|
| Category | One of: `workflow`, `shortcut`, `project`, `utility` | Drives how `/mvt-help` groups it |
|
|
52
52
|
| Description | Third-person, includes what + when + how it differs | Will become the frontmatter `description` |
|
|
53
|
-
| Dependencies | List of skill names that must run first, OR `none` | Becomes `depends_on` in registry |
|
|
54
53
|
| Variants (optional) | List of flag/sub-mode entries | Becomes the Variants table |
|
|
55
54
|
|
|
56
55
|
If the user is unsure on any field, propose a default and ask for confirmation rather than leaving it blank.
|
|
@@ -68,7 +67,7 @@ If the user is unsure on any field, propose a default and ask for confirmation r
|
|
|
68
67
|
| Output template | `_templates/` | Persisted document that needs a stable structure | `_templates/{name}-output.md` |
|
|
69
68
|
|
|
70
69
|
- **Reuse vs new**: before declaring a new shared resource, check existing skills' SKILL.md files and knowledge entries -- prefer reusing patterns that already exist.
|
|
71
|
-
- **Output of this step**: a checklist `(name |
|
|
70
|
+
- **Output of this step**: a checklist `(name | purpose | path)` shown to user.
|
|
72
71
|
|
|
73
72
|
### Step 5: Design the Skill
|
|
74
73
|
- **What**: produce a one-page outline before generating any file.
|
|
@@ -105,22 +104,11 @@ Append the skill entry to `.ai-agents/registry.yaml` > `skills` section:
|
|
|
105
104
|
|
|
106
105
|
```yaml
|
|
107
106
|
{name}:
|
|
108
|
-
agent: {agent}
|
|
109
107
|
description: "{third-person description with trigger keywords}"
|
|
110
|
-
path: .claude/skills/{name}/SKILL.md
|
|
111
|
-
template: {template_path_or_null}
|
|
112
|
-
category: {category}
|
|
113
|
-
depends_on: {dependencies_or_omitted}
|
|
114
108
|
custom: true
|
|
115
|
-
knowledge:
|
|
116
|
-
{entries_or_empty_list}
|
|
117
|
-
next_suggestions:
|
|
118
|
-
primary: {suggested_next_skill}
|
|
119
|
-
primary_desc: "{when to use the next skill}"
|
|
120
109
|
```
|
|
121
110
|
|
|
122
111
|
- The `custom: true` field is **required** for user-created skills; without it, framework updates will overwrite the entry.
|
|
123
|
-
- If the skill has no specific knowledge needs, set `knowledge: []` or omit the key entirely.
|
|
124
112
|
- Validate the YAML still parses after the append; if not, abort and surface the parse error.
|
|
125
113
|
|
|
126
114
|
### Step 8: Validation
|
|
@@ -224,9 +212,9 @@ Copy the following sections verbatim from this document (the assembled SKILL.md
|
|
|
224
212
|
|---------|----------------------|-----------------|
|
|
225
213
|
| Activation Protocol | `## Activation Protocol` | Add `extended_context` entries if the skill needs additional context sources; otherwise copy as-is |
|
|
226
214
|
| Load Config | Load Config step within Activation Protocol | Copy as-is |
|
|
227
|
-
|
|
|
215
|
+
| Language Constraint | Language Constraint step within Activation Protocol | Copy as-is |
|
|
228
216
|
| Pre-flight Checks | Pre-flight Checks step within Activation Protocol | Replace `checks` table with skill-specific checks; if none required, use a single INFO row |
|
|
229
|
-
| State Update | `## State Update` | Replace `/{name}` with the new skill's command; include `active_change` conditional block only if the skill creates changes; include `Shortcut Operation Rules`
|
|
217
|
+
| State Update | `## State Update` | Replace `/{name}` with the new skill's command; include `active_change` conditional block only if the skill creates changes; include `Shortcut Operation Rules` if the user opted for shortcut semantics during Step 5 design |
|
|
230
218
|
| Suggested Next Steps | `## Suggested Next Steps` | Replace `current_skill` with the new skill name; replace conditional suggestions with skill-appropriate ones |
|
|
231
219
|
|
|
232
220
|
**Important**: Do NOT paraphrase or rewrite the standard sections. Copy them character-for-character from this document and only substitute the skill-specific values. This ensures consistency across all MVTT skills.
|
|
@@ -48,16 +48,11 @@ sections:
|
|
|
48
48
|
source: sections/activation-load-config.md
|
|
49
49
|
|
|
50
50
|
- type: shared
|
|
51
|
-
source: sections/
|
|
51
|
+
source: sections/language-constraint.md
|
|
52
52
|
|
|
53
53
|
- type: shared
|
|
54
54
|
source: sections/output-format-constraint.md
|
|
55
55
|
|
|
56
|
-
- type: inline
|
|
57
|
-
content: |
|
|
58
|
-
### Step 4: Pre-flight Checks
|
|
59
|
-
- No blocking checks required.
|
|
60
|
-
|
|
61
56
|
- type: file
|
|
62
57
|
source: ./business.md
|
|
63
58
|
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
## Execution Flow
|
|
2
|
+
|
|
3
|
+
### Step 1: Load Requirements
|
|
4
|
+
- If file path provided as argument -> Read that file
|
|
5
|
+
- Otherwise -> Use requirements text from user message
|
|
6
|
+
|
|
7
|
+
### Step 2: Lightweight Sanity Gate
|
|
8
|
+
- **What**: verify the input warrants epic-scale decomposition
|
|
9
|
+
- **How**: check whether the input is clearly a single-file or single-module change
|
|
10
|
+
|
|
11
|
+
| Signal | Verdict |
|
|
12
|
+
|--------|---------|
|
|
13
|
+
| Input describes 1 feature touching 1-3 files | Too small for epic |
|
|
14
|
+
| Input describes a cohesive system with 2+ independent capability domains | Epic-scale |
|
|
15
|
+
| Ambiguous | Ask user: decompose or redirect to `/mvt-analyze`? |
|
|
16
|
+
|
|
17
|
+
- **Branches**:
|
|
18
|
+
|
|
19
|
+
| Condition | Action |
|
|
20
|
+
|-----------|--------|
|
|
21
|
+
| Clearly epic-scale | Continue to Step 3 |
|
|
22
|
+
| Clearly too small | Suggest: "This looks like a standard change. Use `/mvt-analyze` instead? (y/n)" |
|
|
23
|
+
| Ambiguous | Offer choice: "Decompose as epic (2-8 children) or analyze as single change?" |
|
|
24
|
+
|
|
25
|
+
### Step 3: Epic Analysis
|
|
26
|
+
- Extract the **vision**: one-sentence summary of the overall goal
|
|
27
|
+
- Define **scope and out-of-scope**: what the epic delivers vs. explicitly excludes
|
|
28
|
+
- Identify **cross-cutting concerns**: themes spanning multiple children (auth, logging, error handling, data migration)
|
|
29
|
+
- Identify **actors and stakeholders**
|
|
30
|
+
|
|
31
|
+
### Step 4: Decompose into 2-8 Sub-changes
|
|
32
|
+
- **What**: break the epic into right-sized children, each suitable for one analyze-design-plan-implement cycle
|
|
33
|
+
- **Sizing rule**: each child should produce one deliverable capability slice, implementable in 3-10 plan tasks
|
|
34
|
+
- **For each child**, define:
|
|
35
|
+
- `change_id`: `{YYYYMMDD}-{slug}` format. Slug constraints: lowercase ASCII, kebab-case, `[a-z0-9-]+`, 1-4 words (e.g., `user-auth`, `catalog-search`)
|
|
36
|
+
- `title`: concise name
|
|
37
|
+
- `scope`: description of what this child delivers
|
|
38
|
+
- `depends_on`: list of `change_id` values this child depends on (empty for root children)
|
|
39
|
+
- `project`: project hint array. For single-project workspaces: use the sole project name from `project-context.yaml > projects[].name` (e.g., `["mvtt"]` in this workspace; do NOT hardcode `["default"]`). For multi-project workspaces: must match a project name from `project-context.yaml > projects[].name`; if uncertain, ask the user rather than guessing.
|
|
40
|
+
- **DAG constraints**:
|
|
41
|
+
- Dependencies must form a DAG (no cycles)
|
|
42
|
+
- Dependencies reference existing `change_id` values only
|
|
43
|
+
- Prefer shallow depth (wide parallelism) over deep chains
|
|
44
|
+
- **Validation**: if > 8 children needed, WARN and suggest narrowing the epic scope. If < 2 children, suggest using `/mvt-analyze` directly.
|
|
45
|
+
|
|
46
|
+
### Step 5: Preview and Confirm
|
|
47
|
+
- **What**: show the decomposition result to the user before writing any files.
|
|
48
|
+
- **How**: display the following inline (conversation-only, no disk write yet):
|
|
49
|
+
1. **Child story table**: the same table that will appear in `epic.md`
|
|
50
|
+
2. **Dependency diagram**: Mermaid flowchart of child dependencies
|
|
51
|
+
3. **Suggested starting child**: "Start with: `{first_child_title}` (`{first_child_id}`)"
|
|
52
|
+
- **Wait for user confirmation**: ask "Proceed with this decomposition? (y/n)". Default to **y** if the user does not respond.
|
|
53
|
+
- **On decline or revision request**: do NOT write any files. Revise the decomposition based on user feedback and re-present, or abort if the user chooses to cancel.
|
|
54
|
+
- **On confirmation**: proceed to Step 6.
|
|
55
|
+
|
|
56
|
+
### Step 6: Write Artifacts
|
|
57
|
+
Write two artifacts using the `decompose-output` template for `epic.md`:
|
|
58
|
+
|
|
59
|
+
1. **epic.md** (narrative) -- `.ai-agents/workspace/artifacts/{epic_id}/epic.md`
|
|
60
|
+
- Uses the `decompose-output` template.
|
|
61
|
+
- **Child Stories**: Markdown table mirroring `epic.yaml.children[]`
|
|
62
|
+
|
|
63
|
+
| # | Child | Scope | Status | Depends On |
|
|
64
|
+
|---|-------|-------|--------|------------|
|
|
65
|
+
|
|
66
|
+
- **Dependency Map**: Mermaid flowchart showing child dependencies
|
|
67
|
+
|
|
68
|
+
2. **epic.yaml** (structured) -- `.ai-agents/workspace/artifacts/{epic_id}/epic.yaml`
|
|
69
|
+
- Follows the schema defined in Artifact Structure
|
|
70
|
+
- Set first child `status: active`, all others `status: pending`
|
|
71
|
+
- Set `current_change` to the first child's `change_id`
|
|
72
|
+
|
|
73
|
+
**Self-validation checklist** (verify before writing):
|
|
74
|
+
- [ ] All `change_id` values are unique
|
|
75
|
+
- [ ] All `depends_on` references exist in `children[]`
|
|
76
|
+
- [ ] No cycles in the dependency graph
|
|
77
|
+
- [ ] Exactly one child has `status: active`
|
|
78
|
+
- [ ] `current_change` matches the active child's `change_id`
|
|
79
|
+
- [ ] Each child has non-empty `title` and `scope`
|
|
80
|
+
|
|
81
|
+
**Optional safety net**: after writing, call `epic-update.cjs --validate` to verify:
|
|
82
|
+
```bash
|
|
83
|
+
node .ai-agents/scripts/epic-update.cjs --validate .ai-agents/workspace/artifacts/{epic_id}/epic.yaml
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Step 7: Update Session
|
|
87
|
+
Run the session update command (see State Update section) to:
|
|
88
|
+
1. Create a new `active_epic` in session.yaml
|
|
89
|
+
2. Set the `epic_path` to the written `epic.yaml`
|
|
90
|
+
|
|
91
|
+
### Step 8: Output
|
|
92
|
+
Display to the user:
|
|
93
|
+
1. **Write confirmation**: "Epic created: `{epic_id}` at `{epic_path}`"
|
|
94
|
+
2. **Suggested next step**: "Run `/mvt-analyze` to start the first child: `{first_child_title}` (`{first_child_id}`)"
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
name: mvt-decompose
|
|
2
|
+
output: .claude/skills/mvt-decompose/SKILL.md
|
|
3
|
+
|
|
4
|
+
frontmatter:
|
|
5
|
+
name: mvt-decompose
|
|
6
|
+
description: "Decompose epic-scale requirements into right-sized sub-changes with DAG dependencies. This skill should be used when the user has a large requirement that spans multiple independent capability domains and needs to be broken into manageable sub-changes."
|
|
7
|
+
|
|
8
|
+
sections:
|
|
9
|
+
- type: inline
|
|
10
|
+
content: |
|
|
11
|
+
# MVT Decompose
|
|
12
|
+
|
|
13
|
+
## Purpose
|
|
14
|
+
|
|
15
|
+
Decompose epic-scale requirements into 2-8 right-sized sub-changes with explicit DAG dependencies, producing `epic.yaml` (structured) and `epic.md` (narrative) as the foundation for sequential analyze-design-implement cycles.
|
|
16
|
+
|
|
17
|
+
- type: shared
|
|
18
|
+
source: sections/role-header.md
|
|
19
|
+
params:
|
|
20
|
+
role: Strategist
|
|
21
|
+
role_desc: "an Epic Decomposition Strategist"
|
|
22
|
+
decision_rules:
|
|
23
|
+
- rule: "Epic-scale input -> Decompose into 2-8 sub-changes with DAG"
|
|
24
|
+
- rule: "Input too small for epic -> Redirect to /mvt-analyze"
|
|
25
|
+
- rule: "> 8 children needed -> Warn and suggest scope narrowing"
|
|
26
|
+
- rule: "Ambiguous boundaries -> Ask user to clarify before decomposing"
|
|
27
|
+
boundaries:
|
|
28
|
+
- scope: "implement code"
|
|
29
|
+
skill: "/mvt-implement"
|
|
30
|
+
- scope: "design architecture"
|
|
31
|
+
skill: "/mvt-design"
|
|
32
|
+
- scope: "analyze non-epic requirements"
|
|
33
|
+
skill: "/mvt-analyze"
|
|
34
|
+
|
|
35
|
+
- type: shared
|
|
36
|
+
source: sections/activation-load-context.md
|
|
37
|
+
|
|
38
|
+
- type: shared
|
|
39
|
+
source: sections/activation-load-config.md
|
|
40
|
+
|
|
41
|
+
- type: shared
|
|
42
|
+
source: sections/language-constraint.md
|
|
43
|
+
|
|
44
|
+
- type: shared
|
|
45
|
+
source: sections/output-format-constraint.md
|
|
46
|
+
|
|
47
|
+
- type: shared
|
|
48
|
+
source: sections/activation-preflight.md
|
|
49
|
+
params:
|
|
50
|
+
checks:
|
|
51
|
+
- order: "1"
|
|
52
|
+
field: "session.initialized_at"
|
|
53
|
+
level: "WARN"
|
|
54
|
+
message: 'Session not initialized. Run `/mvt-init` first.'
|
|
55
|
+
- order: "2"
|
|
56
|
+
field: "projects[] in project-context.yaml"
|
|
57
|
+
level: "WARN"
|
|
58
|
+
message: 'Project not initialized. Run `/mvt-init` first.'
|
|
59
|
+
- order: "3"
|
|
60
|
+
field: "active_change.id"
|
|
61
|
+
level: "WARN"
|
|
62
|
+
message: 'An active change already exists. Decomposing will create a new epic alongside it. Continue? (y/n)'
|
|
63
|
+
|
|
64
|
+
- type: file
|
|
65
|
+
source: ./business.md
|
|
66
|
+
|
|
67
|
+
- type: inline
|
|
68
|
+
content: |
|
|
69
|
+
## Artifact Structure
|
|
70
|
+
|
|
71
|
+
**epic.md** (narrative):
|
|
72
|
+
Read the document structure template from: `.ai-agents/skills/_templates/decompose-output.md`
|
|
73
|
+
If a custom version exists at `.ai-agents/skills/_templates/custom/decompose-output.md`, use the custom version instead.
|
|
74
|
+
The template defines section headings only. Generate content for each section based on decomposition results.
|
|
75
|
+
Write to: `.ai-agents/workspace/artifacts/{epic_id}/epic.md`
|
|
76
|
+
|
|
77
|
+
**epic.yaml** (structured):
|
|
78
|
+
Write to: `.ai-agents/workspace/artifacts/{epic_id}/epic.yaml`
|
|
79
|
+
Schema:
|
|
80
|
+
```yaml
|
|
81
|
+
version: 1
|
|
82
|
+
epic_id: "{epic_id}"
|
|
83
|
+
title: "{epic_title}"
|
|
84
|
+
created_at: "{ISO timestamp}"
|
|
85
|
+
updated_at: "{ISO timestamp}"
|
|
86
|
+
status: in_progress
|
|
87
|
+
vision: >
|
|
88
|
+
{epic vision summary}
|
|
89
|
+
current_change: "{first_active_child_id}"
|
|
90
|
+
children:
|
|
91
|
+
- change_id: "{YYYYMMDD}-{slug}"
|
|
92
|
+
title: "{child title}"
|
|
93
|
+
scope: >
|
|
94
|
+
{child scope description}
|
|
95
|
+
status: active # first child: active, rest: pending
|
|
96
|
+
depends_on: [] # DAG dependencies
|
|
97
|
+
project: ["<project-name>"] # use the sole project name from project-context.yaml > projects[].name
|
|
98
|
+
completed_at: null
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
**epic-id format**: `epic-{YYYYMMDD}-{slug}` (e.g., `epic-20260608-ecommerce-platform`)
|
|
102
|
+
|
|
103
|
+
- type: shared
|
|
104
|
+
source: sections/session-update.md
|
|
105
|
+
params:
|
|
106
|
+
current_skill: mvt-decompose
|
|
107
|
+
new_epic: true
|
|
108
|
+
set_epic_path: true
|
|
109
|
+
|
|
110
|
+
- type: shared
|
|
111
|
+
source: sections/footer-next-steps.md
|
|
112
|
+
params:
|
|
113
|
+
current_skill: mvt-decompose
|
|
114
|
+
conditional_suggestions:
|
|
115
|
+
conditions:
|
|
116
|
+
- condition: "decomposition complete"
|
|
117
|
+
primary: "mvt-analyze"
|
|
118
|
+
primary_desc: "Start analyzing the first (active) sub-change"
|
|
119
|
+
- condition: "default"
|
|
120
|
+
primary: "mvt-analyze"
|
|
121
|
+
primary_desc: "Begin the analyze-design-implement cycle for the current child"
|