@uoyo/mvtt 2.0.0-beta.4 → 2.0.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +299 -64
- package/README.zh-CN.md +419 -0
- package/dist/commands/install.d.ts.map +1 -1
- package/dist/commands/install.js +27 -2
- package/dist/commands/install.js.map +1 -1
- package/dist/commands/uninstall.d.ts.map +1 -1
- package/dist/commands/uninstall.js +19 -7
- package/dist/commands/uninstall.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +4 -2
- 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/scripts/epic-update.cjs +7670 -0
- package/dist/scripts/plan-update.cjs +255 -82
- package/dist/scripts/session-update.cjs +84 -6
- package/dist/types/platform.d.ts +12 -0
- package/dist/types/platform.d.ts.map +1 -0
- package/dist/types/platform.js +24 -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/install-manifest.yaml +4 -0
- package/package.json +1 -1
- package/registry.yaml +72 -198
- 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 +1 -1
- 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/session-update.md +41 -1
- package/sources/skills/mvt-analyze/business.md +46 -8
- package/sources/skills/mvt-analyze/manifest.yaml +5 -1
- package/sources/skills/mvt-analyze-code/business.md +18 -17
- package/sources/skills/mvt-analyze-code/manifest.yaml +3 -6
- package/sources/skills/mvt-check-context/business.md +13 -6
- package/sources/skills/mvt-check-context/manifest.yaml +0 -5
- package/sources/skills/mvt-cleanup/business.md +17 -2
- package/sources/skills/mvt-config/business.md +5 -5
- package/sources/skills/mvt-config/manifest.yaml +3 -6
- package/sources/skills/mvt-create-skill/business.md +2 -14
- package/sources/skills/mvt-create-skill/manifest.yaml +0 -5
- package/sources/skills/mvt-decompose/business.md +94 -0
- package/sources/skills/mvt-decompose/manifest.yaml +121 -0
- package/sources/skills/mvt-fix/business.md +21 -6
- package/sources/skills/mvt-fix/manifest.yaml +1 -1
- package/sources/skills/mvt-help/business.md +11 -9
- package/sources/skills/mvt-help/manifest.yaml +0 -5
- package/sources/skills/mvt-implement/business.md +51 -8
- package/sources/skills/mvt-init/business.md +23 -13
- package/sources/skills/mvt-init/manifest.yaml +1 -2
- package/sources/skills/mvt-manage-context/business.md +41 -14
- package/sources/skills/mvt-manage-context/manifest.yaml +2 -6
- package/sources/skills/mvt-plan-dev/business.md +17 -9
- package/sources/skills/mvt-quick-dev/business.md +22 -7
- package/sources/skills/mvt-quick-dev/manifest.yaml +0 -1
- package/sources/skills/mvt-refactor/business.md +32 -17
- package/sources/skills/mvt-refactor/manifest.yaml +0 -5
- package/sources/skills/mvt-resume/business.md +32 -12
- package/sources/skills/mvt-resume/manifest.yaml +3 -3
- package/sources/skills/mvt-review/business.md +24 -9
- package/sources/skills/mvt-status/business.md +37 -9
- package/sources/skills/mvt-status/manifest.yaml +2 -2
- package/sources/skills/mvt-sync-context/business.md +30 -16
- package/sources/skills/mvt-template/business.md +1 -1
- package/sources/skills/mvt-template/manifest.yaml +0 -5
- package/sources/skills/mvt-test/business.md +30 -15
- package/sources/skills/mvt-update-plan/business.md +41 -12
- package/sources/skills/mvt-update-plan/manifest.yaml +7 -7
- package/sources/templates/decompose-output/body.md +13 -0
- package/sources/templates/decompose-output/manifest.yaml +11 -0
|
@@ -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 |
|
|
@@ -58,17 +58,14 @@ sections:
|
|
|
58
58
|
|
|
59
59
|
- type: inline
|
|
60
60
|
content: |
|
|
61
|
-
### Step 4: Pre-flight Checks
|
|
62
|
-
- No blocking checks required (config is always accessible)
|
|
63
|
-
|
|
64
61
|
## Configuration Keys
|
|
65
62
|
|
|
66
63
|
### User Preferences
|
|
67
64
|
|
|
68
65
|
| Key | Type | Default | Description |
|
|
69
66
|
|-----|------|---------|-------------|
|
|
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) |
|
|
67
|
+
| `preferences.interaction_language` | enum | `en-US` | Language for interactive output: chat replies, prompts, tables. Values: `en-US` (English), `zh-CN` (简体中文) |
|
|
68
|
+
| `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
69
|
| `preferences.output.no_emojis` | bool | `true` | Disable emojis in output |
|
|
73
70
|
| `preferences.output.data_format` | enum | `yaml` | Data output format (yaml, json) |
|
|
74
71
|
| `preferences.context_routing.relevance_threshold` | int | `70` | AI routing threshold for `/mvt-manage-context add` (0-100) |
|
|
@@ -79,7 +76,7 @@ sections:
|
|
|
79
76
|
|
|
80
77
|
| Key | Type | Default | Description |
|
|
81
78
|
|-----|------|---------|-------------|
|
|
82
|
-
| `knowledge.
|
|
79
|
+
| `knowledge._all` | list | `[core, project-context]` | Global knowledge entries in registry.yaml under `_all` key, loaded by all skills across all projects |
|
|
83
80
|
|
|
84
81
|
- type: file
|
|
85
82
|
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
|
|
@@ -226,7 +214,7 @@ Copy the following sections verbatim from this document (the assembled SKILL.md
|
|
|
226
214
|
| Load Config | Load Config step within Activation Protocol | Copy as-is |
|
|
227
215
|
| Output Language Constraint | Output 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.
|
|
@@ -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/output-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"
|
|
@@ -87,9 +87,24 @@
|
|
|
87
87
|
| Multi-module | Touches >1 module or shared utility | List impacted modules, read each call site before editing, group by commit if possible |
|
|
88
88
|
| Cross-architecture | Requires layering change, new dependency, or interface redesign | STOP -- recommend `/mvt-design` (or `/mvt-refactor` if behavior is preserved); do NOT implement here |
|
|
89
89
|
|
|
90
|
-
- Identify regression risk: which existing tests cover this code? If none, decide whether to add a regression test in Step
|
|
90
|
+
- Identify regression risk: which existing tests cover this code? If none, decide whether to add a regression test in Step 8.
|
|
91
91
|
|
|
92
|
-
### Step 6:
|
|
92
|
+
### Step 6: Identify Project Scope and Load Project-Specific Knowledge
|
|
93
|
+
|
|
94
|
+
This step applies only when the workspace has multiple projects (`projects.length > 1` in `project-context.yaml`). In single-project workspaces, all relevant knowledge was loaded at activation; skip this step entirely.
|
|
95
|
+
|
|
96
|
+
- **Project identification**: match the file paths resolved in prior steps (from review findings, bug detection, or self-contained diagnosis) against `projects[].path` and `projects[].source_paths`:
|
|
97
|
+
- A file whose path starts with a project's `path` prefix belongs to that project.
|
|
98
|
+
- A file under a project's `source_paths` entry also belongs to that project.
|
|
99
|
+
- Collect the set of unique project names from all matched files. This is the **active project scope** for this invocation.
|
|
100
|
+
- **On-demand knowledge loading**: for each project P in the active project scope, read `.ai-agents/registry.yaml` and load:
|
|
101
|
+
1. Every entry under `knowledge.{P}` -- load each entry's referenced files (resolve relative to `.ai-agents/{source}`).
|
|
102
|
+
2. Every entry under `skills.mvt-fix.knowledge.{P}` -- load each entry's referenced files.
|
|
103
|
+
3. Skip any key absent from the registry (no project-specific knowledge is valid; do not warn).
|
|
104
|
+
- **Multi-project scenario**: if affected files span multiple projects, load each project's knowledge sequentially. The skill operates with the union of all loaded project-specific knowledge plus the `_all` knowledge already loaded at activation.
|
|
105
|
+
- **Unmatched files**: if a file path does not match any project's `path` or `source_paths`, surface a note and treat it as belonging to the first project in `projects[]` (fallback). This may indicate a configuration gap in `project-context.yaml`.
|
|
106
|
+
|
|
107
|
+
### Step 7: User Confirmation
|
|
93
108
|
- **When to confirm before applying**:
|
|
94
109
|
- Multi-module class or above.
|
|
95
110
|
- The fix changes a public/exported symbol or a configuration default.
|
|
@@ -99,14 +114,14 @@
|
|
|
99
114
|
- One-liner / single-file class AND fix is purely additive or correctional AND reproduction was verified.
|
|
100
115
|
- **Confirmation prompt format**: present `Root cause: ...`, `Proposed change: <files + summary>`, `Risk: <regression scope>`, then ask `Apply? (y / n / show-diff)`.
|
|
101
116
|
|
|
102
|
-
### Step
|
|
117
|
+
### Step 8: Apply the Fix
|
|
103
118
|
- For source 1a (review.md): apply fixes per finding; re-run the review's relevant checks (not reproduction) to confirm each fix addresses its finding.
|
|
104
119
|
- Make the targeted code change.
|
|
105
120
|
- If no test covered the regression and the fix class is multi-module or above, add a minimal regression test alongside the fix.
|
|
106
121
|
- Re-run the original repro (if any) to confirm resolution.
|
|
107
122
|
- If repro still fails -> revert, return to Step 3 with the new evidence.
|
|
108
123
|
|
|
109
|
-
### Step
|
|
124
|
+
### Step 9: Write Fix Notes
|
|
110
125
|
- **Path**: `.ai-agents/workspace/artifacts/{change-id}/fix-notes.md` if an `active_change` exists; otherwise inline in the conversation only (no artifact -- shortcut operation).
|
|
111
126
|
- **Structure** (each section is a single paragraph or list):
|
|
112
127
|
- `Symptom` -- what the user saw / reported.
|
|
@@ -118,7 +133,7 @@
|
|
|
118
133
|
- `Regression risk` -- scope of behavior potentially affected, plus what tests guard it.
|
|
119
134
|
- `Follow-ups` -- TODOs, deferred refactors, related issues.
|
|
120
135
|
|
|
121
|
-
### Step
|
|
136
|
+
### Step 10: State Update
|
|
122
137
|
Apply the State Update rules defined in the **State Update** section below.
|
|
123
138
|
|
|
124
139
|
## Edge Cases & Errors
|
|
@@ -128,6 +143,6 @@ Apply the State Update rules defined in the **State Update** section below.
|
|
|
128
143
|
| Bug is intermittent / racy | Mark reproduction as "flaky", state confidence level explicitly, prefer adding instrumentation over speculative fix |
|
|
129
144
|
| Fix would require breaking a downstream API | STOP -- escalate to `/mvt-design` or `/mvt-refactor`; do not silently break contracts |
|
|
130
145
|
| Root cause is in a third-party dependency | Document the upstream issue, apply a minimal local workaround clearly labeled as temporary |
|
|
131
|
-
| User aborts at Step
|
|
146
|
+
| User aborts at Step 7 | Do not write fix notes; record the diagnosis as a comment in the conversation only |
|
|
132
147
|
| Fix relies on changes the user has uncommitted in another branch | Surface the conflict before editing; do not overwrite |
|
|
133
148
|
| `active_change` is missing entirely | Apply fix without writing artifact (shortcut mode), summarize result in conversation |
|
|
@@ -64,7 +64,7 @@ sections:
|
|
|
64
64
|
## Operation Mode: Shortcut
|
|
65
65
|
|
|
66
66
|
This skill operates as a shortcut — it can execute at any time without checking workflow prerequisites.
|
|
67
|
-
- Do NOT update `
|
|
67
|
+
- Do NOT update `active_change` (this is a shortcut operation, not a workflow phase).
|
|
68
68
|
|
|
69
69
|
- type: file
|
|
70
70
|
source: ./business.md
|
|
@@ -11,8 +11,9 @@
|
|
|
11
11
|
|
|
12
12
|
| Condition | Recommendation |
|
|
13
13
|
|-----------|---------------|
|
|
14
|
-
|
|
|
14
|
+
| `.ai-agents/workspace/session.yaml` missing or `initialized_at` empty | `/mvt-init` -- Initialize the project |
|
|
15
15
|
| Initialized AND `project-context.md` does not exist | `/mvt-analyze-code` -- Analyze existing code |
|
|
16
|
+
| `active_epic.id` non-empty AND `active_change.id` empty (epic-pending) | `/mvt-analyze` -- Start the next sub-change in the epic |
|
|
16
17
|
| No requirements (no `analysis.md` for active change AND no completed `/mvt-analyze` in `history`) | `/mvt-analyze` -- Analyze requirements |
|
|
17
18
|
| No requirements, but user describes a simple change directly | `/mvt-quick-dev` -- Implement a simple change quickly |
|
|
18
19
|
| Requirements present, no `design.md` | `/mvt-design` -- Design architecture |
|
|
@@ -25,14 +26,11 @@
|
|
|
25
26
|
|
|
26
27
|
### Step 3: Display Skills Catalog
|
|
27
28
|
Read `registry.yaml` > `skills` section.
|
|
28
|
-
|
|
29
|
-
-
|
|
30
|
-
- `shortcut` -> "Shortcut Skills (anytime, no prerequisites)"
|
|
31
|
-
- `project` -> "Project Management Skills"
|
|
32
|
-
- `utility` -> "Utility Skills"
|
|
29
|
+
Display all skills as a single flat table (no grouping; the section comment headers in `registry.yaml` already group them by role for human readers):
|
|
30
|
+
- Header row: `Skill | Description`
|
|
33
31
|
|
|
34
32
|
For each skill, show: `/{skill-name}` | `description` field from registry.
|
|
35
|
-
Sort
|
|
33
|
+
Sort by declaration order in registry.
|
|
36
34
|
|
|
37
35
|
### Step 4: Show Workflow Diagram
|
|
38
36
|
Display the standard workflow with current position highlighted:
|
|
@@ -45,6 +43,9 @@ flowchart LR
|
|
|
45
43
|
E --> F[review] --> G[test]
|
|
46
44
|
|
|
47
45
|
C -.->|simple change| Q[quick-dev]
|
|
46
|
+
C -.->|epic scale| DC[decompose]
|
|
47
|
+
DC --> C2[analyze<br/>epic-child]
|
|
48
|
+
C2 --> D
|
|
48
49
|
```
|
|
49
50
|
|
|
50
51
|
Color-code based on current progress: green (done), yellow (current/recommended), gray (pending). The "current" node is whichever skill the Step 2 table recommended; "done" is determined by the same evidence the Step 2 table consumed.
|
|
@@ -56,7 +57,7 @@ Color-code based on current progress: green (done), yellow (current/recommended)
|
|
|
56
57
|
| Question pattern | Response |
|
|
57
58
|
|------------------|----------|
|
|
58
59
|
| "What should I do next?" / no specific question | Repeat the Step 2 recommendation in one line, followed by a one-clause reason citing the matched condition |
|
|
59
|
-
| "What does `/mvt-X` do?" / asks about a specific skill | Read the skill's metadata from `registry.yaml`, show: name, description,
|
|
60
|
+
| "What does `/mvt-X` do?" / asks about a specific skill | Read the skill's metadata from `registry.yaml`, show: name, description, knowledge entries (if any), template (if any). Mention "see the skill's SKILL.md for the full procedure" -- do NOT inline the full SKILL.md content (too large) |
|
|
60
61
|
| "Compare `/mvt-X` and `/mvt-Y`" | Pull descriptions from registry; if both are workflow skills, mention their relative position in the diagram |
|
|
61
62
|
| Asks about something not in registry | Reply: "No skill matches that. Available skills: see catalog above." Do not invent skills |
|
|
62
63
|
|
|
@@ -69,4 +70,5 @@ Color-code based on current progress: green (done), yellow (current/recommended)
|
|
|
69
70
|
| `changes[]` references a `plan_path` that no longer exists | Ignore for help purposes; do not warn -- `/mvt-status` is the right place for that |
|
|
70
71
|
| User invokes `/mvt-help` while inside an active change with Critical review findings | Step 2's recommendation is `/mvt-fix`; surface this prominently above the catalog |
|
|
71
72
|
| User asks about a custom skill (registry entry with `custom: true`) | Treat identically to built-ins; the only difference is showing `custom: true` in the metadata view |
|
|
72
|
-
| Workflow diagram cannot be rendered (mermaid unsupported in environment) | Fall back to a textual flow: `init -> analyze-code -> analyze -> design -> [plan-dev] -> implement -> review -> test` |
|
|
73
|
+
| Workflow diagram cannot be rendered (mermaid unsupported in environment) | Fall back to a textual flow: `init -> analyze-code -> analyze -> [decompose (epic) -> analyze (epic-child)] -> design -> [plan-dev] -> implement -> review -> test` |
|
|
74
|
+
| Epic-pending state (`active_epic` non-empty, `active_change` empty) | Step 2's recommendation is `/mvt-analyze` to start the next sub-change; the decompose path is shown in the workflow diagram |
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
- The actual source files referenced in the design's `File Structure` and `Change Tracking` sections.
|
|
6
6
|
- **Fallback**:
|
|
7
7
|
- If `design.md` is missing, surface a WARN and ask the user whether to (a) run `/mvt-design` first or (b) proceed using their conversational description as the design (mark artifact with "Source: conversation only").
|
|
8
|
-
- If
|
|
8
|
+
- If coding standards are not loaded by activation, fall back to language/framework defaults inferred from `project-context.yaml`.
|
|
9
9
|
|
|
10
10
|
### Step 2: Plan the Implementation
|
|
11
11
|
- **What**: produce an ordered file list with the smallest possible commit boundary per group.
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
2. Topologically order files by dependency: domain entities -> repositories/adapters -> use-case/services -> controllers/UI.
|
|
15
15
|
3. Group consecutive files that share a single conceptual change into one commit boundary.
|
|
16
16
|
4. For each file, decide: `create | modify | delete`, and write a one-line intent.
|
|
17
|
-
- **Plan-aware behavior**: if `plan.yaml` is present,
|
|
17
|
+
- **Plan-aware behavior**: if `plan.yaml` is present, identify the active task from `current_tasks` (the entry matching the current project, or the sole entry in single-project mode), then treat that task's `artifacts.files` (cross-reference `plan.tasks[*].artifacts.files`) as a **starting-scope hint, not a hard ceiling**. The source of truth for scope remains `design.md`'s `Change Tracking` (per Step 2.1). When `artifacts.files` is `null` or empty, derive scope entirely from `Change Tracking`. If implementation reveals files beyond this hint are genuinely required, do NOT silently expand — surface them via Step 3 confirmation and never absorb files that clearly belong to a different task.
|
|
18
18
|
- **Output of this step**: an in-conversation list shown to user as a preview, with no write yet.
|
|
19
19
|
|
|
20
20
|
### Step 3: Confirm Scope (when needed)
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
- The plan introduces a new public API (exported symbol, HTTP endpoint, CLI flag).
|
|
24
24
|
- The plan deletes existing code (delete count > 0).
|
|
25
25
|
- The plan deviates from `design.md` (e.g., adds files not in `Change Tracking` or skips files listed there).
|
|
26
|
-
- The plan touches files beyond
|
|
26
|
+
- The plan touches files beyond the active task's `artifacts.files` hint (state which files are added and why, in one line each).
|
|
27
27
|
- **Otherwise**: proceed silently.
|
|
28
28
|
- **On deviation from design**: explain the deviation reason in one line; if the deviation is structural (new module, layer change, interface break), STOP and recommend re-running `/mvt-design`.
|
|
29
29
|
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
- **What**: write/modify the planned files, one commit-group at a time.
|
|
32
32
|
- **How**:
|
|
33
33
|
1. For each commit-group: write all files, then move on. Do not interleave groups.
|
|
34
|
-
2. Follow
|
|
34
|
+
2. Follow the coding standards loaded by activation (if any). Match the surrounding code style if standards are silent.
|
|
35
35
|
3. Respect module/layer rules from `project-context.md`. Forbidden imports must NOT appear; use the abstractions defined in `design.md`'s `Key Interfaces`.
|
|
36
36
|
4. Add error handling at system boundaries only (HTTP, DB, external API, file IO, message bus). Do NOT add try/catch around internal calls "just in case".
|
|
37
37
|
5. Inline comments only for: non-obvious algorithmic choices, deliberate workarounds with a reason, interface contracts not expressible in code. Never narrate WHAT the code does.
|
|
@@ -75,9 +75,50 @@
|
|
|
75
75
|
- `Open TODOs` -- anything deferred for `/mvt-review`, `/mvt-test`, or follow-up changes.
|
|
76
76
|
- The actual source code goes to the project tree; the artifact is a record, not the code itself.
|
|
77
77
|
|
|
78
|
-
### Step 8:
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
### Step 8: Deliverables Handoff (if applicable)
|
|
79
|
+
|
|
80
|
+
**SKIP this step entirely** (go directly to Step 9) if ANY of the following is true:
|
|
81
|
+
- No `plan.yaml` exists for the active change (`active_change.plan_path` is empty or the file does not exist).
|
|
82
|
+
- No task in `plan.tasks[]` has a `depends_on` entry that includes the current task id (i.e., the current task has zero downstream dependents).
|
|
83
|
+
|
|
84
|
+
> These are hard guards. Do NOT prompt the user about deliverables unless BOTH guards pass.
|
|
85
|
+
|
|
86
|
+
- **Prompt the user**:
|
|
87
|
+
- If `task.deliverables` already exists (re-implementation / rescope): "Implementation changed, and downstream task(s) {ids} depend on it. Update deliverables? (y/n)"
|
|
88
|
+
- If this is the first time (no `deliverables` field on the task): "Downstream task(s) {ids} will consume this task's output. Generate deliverables? (default y)"
|
|
89
|
+
- **On confirmation**, append a deliverables subsection under the task's existing `## Task: {id}` section in `implementation.md` (if multi-task plan) or as a dedicated section (if single-task). Use this soft skeleton:
|
|
90
|
+
|
|
91
|
+
```markdown
|
|
92
|
+
### Deliverables
|
|
93
|
+
|
|
94
|
+
#### Public Interface
|
|
95
|
+
{Describe exported symbols, function signatures, endpoint contracts that downstream tasks rely on.}
|
|
96
|
+
|
|
97
|
+
#### Data Shapes
|
|
98
|
+
{Describe data structures, types, schemas that flow between this task and downstream consumers.}
|
|
99
|
+
|
|
100
|
+
#### Usage Constraints
|
|
101
|
+
{Document invariants, preconditions, or side effects that downstream tasks must respect.}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
- **After writing deliverables**, call `plan-update.cjs` with both flags in a single invocation:
|
|
105
|
+
```bash
|
|
106
|
+
node .ai-agents/scripts/plan-update.cjs \
|
|
107
|
+
--plan "<active_change.plan_path>" \
|
|
108
|
+
--task <current_task_id> \
|
|
109
|
+
--status <current_status> \
|
|
110
|
+
--deliverables-pointer current \
|
|
111
|
+
--mark-deliverable-stale <downstream_task_id1>[,<downstream_task_id2>,...] \
|
|
112
|
+
--projects <project_list>
|
|
113
|
+
```
|
|
114
|
+
`<project_list>` is the comma-separated project names from `plan.yaml > current_tasks` keys. In a single-project workspace this is `default`. The `--projects` flag ensures per-project validation runs correctly in multi-project plans.
|
|
115
|
+
The `--status` must be the task's current status (typically `in_progress` at this point, since Step 9 has not yet run). Pass ALL downstream dependent task ids as a comma-separated list to `--mark-deliverable-stale` so that `/mvt-resume` and `/mvt-status` can surface the stale warning.
|
|
116
|
+
- **On user decline**: do not write deliverables and do not call `plan-update.cjs` with the deliverables flags. The downstream tasks will not receive stale warnings, which is acceptable if the user considers the contract unchanged.
|
|
117
|
+
- **Error handling**: if `plan-update.cjs` rejects (e.g., malformed freshness), surface stderr and leave `implementation.md` as written. The deliverables content is the source of truth; the pointer can be retried via `/mvt-update-plan`.
|
|
118
|
+
|
|
119
|
+
### Step 9: Plan-Aware Progress Hint (if applicable)
|
|
120
|
+
- If `plan.yaml` exists and `current_tasks` identifies the active task for this implementation, suggest the user run `/mvt-update-plan <task-id> done` (or `blocked` with reason).
|
|
121
|
+
- If the files actually touched differ from the active task's `artifacts.files` (extra files added during Step 3, or planned files left untouched), explicitly remind the user to run `/mvt-update-plan` so the plan's `artifacts.files` reflects reality for `/mvt-resume` and future sessions.
|
|
81
122
|
- Do NOT modify `plan.yaml` directly from this skill; it is owned by `/mvt-update-plan`.
|
|
82
123
|
- Do NOT modify `changes` directly; it is owned by `/mvt-plan-dev` / `/mvt-update-plan`.
|
|
83
124
|
|
|
@@ -91,4 +132,6 @@
|
|
|
91
132
|
| User aborts at Step 3 confirmation | Do not write any source files or artifact |
|
|
92
133
|
| File listed in `Change Tracking` no longer exists in the working tree | Surface, ask user whether design is stale or file was deleted in a parallel change |
|
|
93
134
|
| Implementation must touch a file outside the active project (other repo / submodule) | STOP -- this is out of scope for `/mvt-implement`; surface and ask user to plan it as a separate change |
|
|
94
|
-
| Plan task is `blocked` or `done` already | Refuse to implement that task; ask user to pick another `
|
|
135
|
+
| Plan task is `blocked` or `done` already | Refuse to implement that task; ask user to pick another task from `current_tasks` or run `/mvt-update-plan` |
|
|
136
|
+
| Deliverables already exist and user declines to update | Leave existing deliverables in place; do not call `plan-update.cjs` with deliverables flags |
|
|
137
|
+
| `plan-update.cjs` rejects deliverables pointer | Surface error; leave `implementation.md` as written (content is source of truth, pointer can be retried) |
|