@uoyo/mvtt 2.0.0-beta.2 → 2.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -11
- package/dist/build/section-loader.d.ts.map +1 -1
- package/dist/build/section-loader.js +18 -8
- package/dist/build/section-loader.js.map +1 -1
- package/dist/fs/materialize.d.ts.map +1 -1
- package/dist/fs/materialize.js +5 -0
- package/dist/fs/materialize.js.map +1 -1
- package/dist/scripts/session-update.cjs +7568 -0
- package/install-manifest.yaml +2 -0
- package/package.json +3 -2
- package/sources/defaults/config.yaml +7 -7
- package/sources/defaults/session.yaml +9 -16
- package/sources/scripts/session-update.js +351 -0
- package/sources/sections/activation-load-context.md +4 -0
- package/sources/sections/footer-next-steps.md +1 -1
- package/sources/sections/session-update.md +100 -32
- package/sources/skills/mvt-analyze/manifest.yaml +1 -0
- package/sources/skills/mvt-analyze-code/manifest.yaml +18 -4
- package/sources/skills/mvt-bug-detect/business.md +99 -101
- package/sources/skills/mvt-bug-detect/manifest.yaml +84 -84
- package/sources/skills/mvt-check-context/business.md +3 -5
- package/sources/skills/mvt-check-context/manifest.yaml +15 -8
- package/sources/skills/mvt-cleanup/business.md +49 -23
- package/sources/skills/mvt-cleanup/manifest.yaml +15 -10
- package/sources/skills/mvt-config/business.md +1 -2
- package/sources/skills/mvt-config/manifest.yaml +11 -4
- package/sources/skills/mvt-create-skill/business.md +6 -5
- package/sources/skills/mvt-create-skill/manifest.yaml +27 -11
- package/sources/skills/mvt-design/business.md +3 -6
- package/sources/skills/mvt-design/manifest.yaml +14 -1
- package/sources/skills/mvt-fix/business.md +2 -1
- package/sources/skills/mvt-fix/manifest.yaml +6 -3
- package/sources/skills/mvt-help/business.md +2 -4
- package/sources/skills/mvt-help/manifest.yaml +13 -5
- package/sources/skills/mvt-implement/business.md +4 -5
- package/sources/skills/mvt-implement/manifest.yaml +13 -0
- package/sources/skills/mvt-init/business.md +2 -2
- package/sources/skills/mvt-init/manifest.yaml +1 -0
- package/sources/skills/mvt-manage-context/business.md +11 -0
- package/sources/skills/mvt-manage-context/manifest.yaml +14 -3
- package/sources/skills/mvt-plan-dev/business.md +101 -20
- package/sources/skills/mvt-plan-dev/manifest.yaml +18 -19
- package/sources/skills/mvt-quick-dev/business.md +2 -1
- package/sources/skills/mvt-quick-dev/manifest.yaml +21 -6
- package/sources/skills/mvt-refactor/business.md +2 -1
- package/sources/skills/mvt-refactor/manifest.yaml +21 -3
- package/sources/skills/mvt-resume/business.md +28 -68
- package/sources/skills/mvt-resume/manifest.yaml +17 -7
- package/sources/skills/mvt-review/business.md +3 -3
- package/sources/skills/mvt-review/manifest.yaml +22 -1
- package/sources/skills/mvt-status/business.md +14 -18
- package/sources/skills/mvt-status/manifest.yaml +11 -3
- package/sources/skills/mvt-sync-context/business.md +14 -9
- package/sources/skills/mvt-sync-context/manifest.yaml +3 -0
- package/sources/skills/mvt-template/business.md +0 -2
- package/sources/skills/mvt-template/manifest.yaml +13 -8
- package/sources/skills/mvt-test/business.md +3 -3
- package/sources/skills/mvt-test/manifest.yaml +14 -1
- package/sources/skills/mvt-update-plan/business.md +14 -3
- package/sources/skills/mvt-update-plan/manifest.yaml +11 -19
- package/dist/build/plan-validator.d.ts +0 -26
- package/dist/build/plan-validator.d.ts.map +0 -1
- package/dist/build/plan-validator.js +0 -225
- package/dist/build/plan-validator.js.map +0 -1
- package/dist/commands/build.d.ts +0 -5
- package/dist/commands/build.d.ts.map +0 -1
- package/dist/commands/build.js +0 -46
- package/dist/commands/build.js.map +0 -1
- package/dist/commands/migrate.d.ts +0 -16
- package/dist/commands/migrate.d.ts.map +0 -1
- package/dist/commands/migrate.js +0 -118
- package/dist/commands/migrate.js.map +0 -1
|
@@ -1,101 +1,99 @@
|
|
|
1
|
-
## Execution Flow
|
|
2
|
-
|
|
3
|
-
### Step 1: Receive & Complete Input
|
|
4
|
-
- Read the user-provided bug description (free text, possibly with stack trace, error message, or reproduction steps).
|
|
5
|
-
- Assess input completeness using the table below:
|
|
6
|
-
|
|
7
|
-
| Input Situation | Action |
|
|
8
|
-
|-----------------|--------|
|
|
9
|
-
| No input provided | Present a structured template and wait. Template fields: **Error message**, **Reproduction steps**, **Expected behavior**, **Actual behavior**, **Environment** |
|
|
10
|
-
| Only error message | Ask: trigger conditions, runtime environment, recent changes |
|
|
11
|
-
| Only behavioral description (no error) | Ask: any error message available, whether it reproduces reliably, affected scope |
|
|
12
|
-
| Stack trace present | Sufficient — proceed to Step 2 |
|
|
13
|
-
| Reproduction steps + error message | Sufficient — proceed to Step 2 |
|
|
14
|
-
|
|
15
|
-
- When asking for clarification, be specific. Do NOT ask "can you provide more details?" — instead, name the exact missing dimension (e.g., "What error message do you see when this happens?").
|
|
16
|
-
|
|
17
|
-
### Step 2: Signal Extraction & Localization
|
|
18
|
-
- Extract concrete signals from the bug description: error message text, stack trace frames, file paths, function/class names, input data.
|
|
19
|
-
- For each signal, locate matching code (Grep / Glob).
|
|
20
|
-
- Build a candidate file list with one-line justification per file.
|
|
21
|
-
- Read recent git state (`git diff HEAD`, `git log -n 10 --oneline`) to surface recent changes that may correlate with the issue.
|
|
22
|
-
|
|
23
|
-
### Step 3: Reproduction Verification
|
|
24
|
-
|
|
25
|
-
| Condition | Action |
|
|
26
|
-
|-----------|--------|
|
|
27
|
-
| Reproduction steps provided → successfully reproduced | Mark as `Verified`, capture observed vs expected behavior |
|
|
28
|
-
| Reproduction steps provided → cannot reproduce | Mark as `Unverified`, continue with static analysis only |
|
|
29
|
-
| No reproduction steps, but signals are concrete (stack trace + paths) | Continue with static analysis, mark as `Static-only` |
|
|
30
|
-
| No reproduction steps, signals are vague | STOP — ask user for: minimal reproduction, exact error, environment, last-known-good version |
|
|
31
|
-
|
|
32
|
-
### Step 4: Root Cause Analysis
|
|
33
|
-
- Generate 1-5 candidate root cause hypotheses based on the dominant signal:
|
|
34
|
-
|
|
35
|
-
| Dominant Signal | Hypothesis Sources |
|
|
36
|
-
|-----------------|--------------------|
|
|
37
|
-
| Stack trace | Top frame in user code, recently changed code in any frame, null/undefined origin, type mismatch at boundary |
|
|
38
|
-
| Error message | Exact-string search in repo, typed exception class hierarchy, library docs for that error |
|
|
39
|
-
| Recent git diff | Files changed in last N commits intersecting with localized files, commit messages mentioning related modules |
|
|
40
|
-
| Behavioral description (no error) | Module boundary mismatches, off-by-one / null-handling, async/race, state leakage, configuration drift |
|
|
41
|
-
|
|
42
|
-
- Each hypothesis must be written as: `<claim> -- evidence: <pointer> -- check: <how to verify>`.
|
|
43
|
-
- Verify hypotheses from cheapest check to most expensive. Eliminate hypotheses that fail their checks.
|
|
44
|
-
- If ALL hypotheses are eliminated — STOP, surface findings, request more info from user. Do NOT fabricate new hypotheses silently.
|
|
45
|
-
|
|
46
|
-
### Step 5: Impact Assessment & Classification
|
|
47
|
-
|
|
48
|
-
**Bug Confirmation Status:**
|
|
49
|
-
|
|
50
|
-
| Status | Meaning |
|
|
51
|
-
|--------|---------|
|
|
52
|
-
| Confirmed | Root cause verified, bug definitely exists |
|
|
53
|
-
| Likely | Evidence is strong but cannot fully rule out other possibilities |
|
|
54
|
-
| NotABug | Actual behavior matches expected behavior / business rules — not a bug |
|
|
55
|
-
| Inconclusive | Insufficient evidence, requires human judgment |
|
|
56
|
-
|
|
57
|
-
**Severity:**
|
|
58
|
-
|
|
59
|
-
| Level | Definition |
|
|
60
|
-
|-------|------------|
|
|
61
|
-
| Critical | Data loss, security vulnerability, core functionality broken |
|
|
62
|
-
| High | Major feature broken but temporary workaround exists |
|
|
63
|
-
| Medium | Minor feature broken or usability issue |
|
|
64
|
-
| Low | Edge case issue, no significant impact on main flow |
|
|
65
|
-
|
|
66
|
-
**Impact Scope:**
|
|
67
|
-
- List affected modules/files with one-line description each.
|
|
68
|
-
- List affected user scenarios / business flows.
|
|
69
|
-
- Search for similar patterns elsewhere in the codebase (same root cause may exist in other locations).
|
|
70
|
-
|
|
71
|
-
### Step 6: Present Diagnosis
|
|
72
|
-
- Output the diagnosis in conversation using this format:
|
|
73
|
-
|
|
74
|
-
```
|
|
75
|
-
Bug Detection Result
|
|
76
|
-
─────────────────────
|
|
77
|
-
Status: <Confirmed | Likely | NotABug | Inconclusive>
|
|
78
|
-
Severity: <Critical | High | Medium | Low>
|
|
79
|
-
Root Cause: <one paragraph>
|
|
80
|
-
Confidence: <reasoning for the status judgment>
|
|
81
|
-
Impact: <affected modules and scenarios>
|
|
82
|
-
Affected: <file list with line ranges>
|
|
83
|
-
Similar: <other locations that may have the same root cause>
|
|
84
|
-
─────────────────────
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
- For `NotABug`: explain why the current behavior is expected, and suggest `/mvt-analyze` if the requirement itself needs revision.
|
|
88
|
-
- For `Inconclusive`: summarize what was found and what remains unknown, so the user or `/mvt-fix` can act with full awareness.
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
|
95
|
-
|
|
96
|
-
| Bug
|
|
97
|
-
|
|
|
98
|
-
|
|
|
99
|
-
|
|
|
100
|
-
| User provides a URL or external reference | Note it but do NOT fetch external resources; work only with local code and the description text |
|
|
101
|
-
| `active_change` is missing | Run without change context (shortcut mode); omit change-id references in output |
|
|
1
|
+
## Execution Flow
|
|
2
|
+
|
|
3
|
+
### Step 1: Receive & Complete Input
|
|
4
|
+
- Read the user-provided bug description (free text, possibly with stack trace, error message, or reproduction steps).
|
|
5
|
+
- Assess input completeness using the table below:
|
|
6
|
+
|
|
7
|
+
| Input Situation | Action |
|
|
8
|
+
|-----------------|--------|
|
|
9
|
+
| No input provided | Present a structured template and wait. Template fields: **Error message**, **Reproduction steps**, **Expected behavior**, **Actual behavior**, **Environment** |
|
|
10
|
+
| Only error message | Ask: trigger conditions, runtime environment, recent changes |
|
|
11
|
+
| Only behavioral description (no error) | Ask: any error message available, whether it reproduces reliably, affected scope |
|
|
12
|
+
| Stack trace present | Sufficient — proceed to Step 2 |
|
|
13
|
+
| Reproduction steps + error message | Sufficient — proceed to Step 2 |
|
|
14
|
+
|
|
15
|
+
- When asking for clarification, be specific. Do NOT ask "can you provide more details?" — instead, name the exact missing dimension (e.g., "What error message do you see when this happens?").
|
|
16
|
+
|
|
17
|
+
### Step 2: Signal Extraction & Localization
|
|
18
|
+
- Extract concrete signals from the bug description: error message text, stack trace frames, file paths, function/class names, input data.
|
|
19
|
+
- For each signal, locate matching code (Grep / Glob).
|
|
20
|
+
- Build a candidate file list with one-line justification per file.
|
|
21
|
+
- Read recent git state (`git diff HEAD`, `git log -n 10 --oneline`) to surface recent changes that may correlate with the issue.
|
|
22
|
+
|
|
23
|
+
### Step 3: Reproduction Verification
|
|
24
|
+
|
|
25
|
+
| Condition | Action |
|
|
26
|
+
|-----------|--------|
|
|
27
|
+
| Reproduction steps provided → successfully reproduced | Mark as `Verified`, capture observed vs expected behavior |
|
|
28
|
+
| Reproduction steps provided → cannot reproduce | Mark as `Unverified`, continue with static analysis only |
|
|
29
|
+
| No reproduction steps, but signals are concrete (stack trace + paths) | Continue with static analysis, mark as `Static-only` |
|
|
30
|
+
| No reproduction steps, signals are vague | STOP — ask user for: minimal reproduction, exact error, environment, last-known-good version |
|
|
31
|
+
|
|
32
|
+
### Step 4: Root Cause Analysis
|
|
33
|
+
- Generate 1-5 candidate root cause hypotheses based on the dominant signal:
|
|
34
|
+
|
|
35
|
+
| Dominant Signal | Hypothesis Sources |
|
|
36
|
+
|-----------------|--------------------|
|
|
37
|
+
| Stack trace | Top frame in user code, recently changed code in any frame, null/undefined origin, type mismatch at boundary |
|
|
38
|
+
| Error message | Exact-string search in repo, typed exception class hierarchy, library docs for that error |
|
|
39
|
+
| Recent git diff | Files changed in last N commits intersecting with localized files, commit messages mentioning related modules |
|
|
40
|
+
| Behavioral description (no error) | Module boundary mismatches, off-by-one / null-handling, async/race, state leakage, configuration drift |
|
|
41
|
+
|
|
42
|
+
- Each hypothesis must be written as: `<claim> -- evidence: <pointer> -- check: <how to verify>`.
|
|
43
|
+
- Verify hypotheses from cheapest check to most expensive. Eliminate hypotheses that fail their checks.
|
|
44
|
+
- If ALL hypotheses are eliminated — STOP, surface findings, request more info from user. Do NOT fabricate new hypotheses silently.
|
|
45
|
+
|
|
46
|
+
### Step 5: Impact Assessment & Classification
|
|
47
|
+
|
|
48
|
+
**Bug Confirmation Status:**
|
|
49
|
+
|
|
50
|
+
| Status | Meaning |
|
|
51
|
+
|--------|---------|
|
|
52
|
+
| Confirmed | Root cause verified, bug definitely exists |
|
|
53
|
+
| Likely | Evidence is strong but cannot fully rule out other possibilities |
|
|
54
|
+
| NotABug | Actual behavior matches expected behavior / business rules — not a bug |
|
|
55
|
+
| Inconclusive | Insufficient evidence, requires human judgment |
|
|
56
|
+
|
|
57
|
+
**Severity:**
|
|
58
|
+
|
|
59
|
+
| Level | Definition |
|
|
60
|
+
|-------|------------|
|
|
61
|
+
| Critical | Data loss, security vulnerability, core functionality broken |
|
|
62
|
+
| High | Major feature broken but temporary workaround exists |
|
|
63
|
+
| Medium | Minor feature broken or usability issue |
|
|
64
|
+
| Low | Edge case issue, no significant impact on main flow |
|
|
65
|
+
|
|
66
|
+
**Impact Scope:**
|
|
67
|
+
- List affected modules/files with one-line description each.
|
|
68
|
+
- List affected user scenarios / business flows.
|
|
69
|
+
- Search for similar patterns elsewhere in the codebase (same root cause may exist in other locations).
|
|
70
|
+
|
|
71
|
+
### Step 6: Present Diagnosis
|
|
72
|
+
- Output the diagnosis in conversation using this format:
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
Bug Detection Result
|
|
76
|
+
─────────────────────
|
|
77
|
+
Status: <Confirmed | Likely | NotABug | Inconclusive>
|
|
78
|
+
Severity: <Critical | High | Medium | Low>
|
|
79
|
+
Root Cause: <one paragraph>
|
|
80
|
+
Confidence: <reasoning for the status judgment>
|
|
81
|
+
Impact: <affected modules and scenarios>
|
|
82
|
+
Affected: <file list with line ranges>
|
|
83
|
+
Similar: <other locations that may have the same root cause>
|
|
84
|
+
─────────────────────
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
- For `NotABug`: explain why the current behavior is expected, and suggest `/mvt-analyze` if the requirement itself needs revision.
|
|
88
|
+
- For `Inconclusive`: summarize what was found and what remains unknown, so the user or `/mvt-fix` can act with full awareness.
|
|
89
|
+
|
|
90
|
+
## Edge Cases & Errors
|
|
91
|
+
|
|
92
|
+
| Case | Handling |
|
|
93
|
+
|------|----------|
|
|
94
|
+
| Bug is intermittent / racy | Mark reproduction as "flaky", state confidence level explicitly, suggest adding instrumentation rather than speculative analysis |
|
|
95
|
+
| Root cause is in a third-party dependency | Document the upstream issue, note that local workaround would be the only fix option |
|
|
96
|
+
| Bug description describes expected behavior (NotABug) | Explain clearly with evidence from code/business rules, do NOT proceed to suggest fixes |
|
|
97
|
+
| Multiple independent bugs described in one input | Analyze each separately, present multiple diagnosis blocks |
|
|
98
|
+
| User provides a URL or external reference | Note it but do NOT fetch external resources; work only with local code and the description text |
|
|
99
|
+
| `active_change` is missing | Run without change context (shortcut mode); omit change-id references in output |
|
|
@@ -1,84 +1,84 @@
|
|
|
1
|
-
name: mvt-bug-detect
|
|
2
|
-
output: .claude/skills/mvt-bug-detect/SKILL.md
|
|
3
|
-
|
|
4
|
-
frontmatter:
|
|
5
|
-
name: mvt-bug-detect
|
|
6
|
-
description: "Analyze and detect bugs by investigating root cause, assessing severity and impact scope. Produces a structured diagnosis in conversation without applying fixes. This skill should be used when user suspects a bug, wants to understand a problem before fixing, or needs impact analysis."
|
|
7
|
-
|
|
8
|
-
sections:
|
|
9
|
-
- type: inline
|
|
10
|
-
content: |
|
|
11
|
-
# MVT Bug Detect
|
|
12
|
-
|
|
13
|
-
## Purpose
|
|
14
|
-
|
|
15
|
-
Investigate suspected bugs: confirm whether the bug exists, identify root cause, assess severity and impact scope, and produce a structured diagnosis. This skill does NOT apply fixes — it provides analysis to help the user understand the problem and decide on next steps.
|
|
16
|
-
|
|
17
|
-
- type: shared
|
|
18
|
-
source: sections/role-header.md
|
|
19
|
-
params:
|
|
20
|
-
role: Analyst
|
|
21
|
-
role_desc: "a Bug Investigation Specialist"
|
|
22
|
-
decision_rules:
|
|
23
|
-
- rule: "Bug description provided -> Analyze and investigate"
|
|
24
|
-
- rule: "Input too vague -> Prompt for specific details with structured template"
|
|
25
|
-
- rule: "No input -> Provide input template and wait"
|
|
26
|
-
- rule: "Root cause confirmed -> Assess impact and produce diagnosis"
|
|
27
|
-
- rule: "Multiple possible causes -> List hypotheses with evidence, verify each"
|
|
28
|
-
- rule: "Bug does not exist (expected behavior) -> Report clearly, suggest /mvt-analyze if requirement gap"
|
|
29
|
-
- rule: "Evidence insufficient -> Report findings, request more info, do NOT fabricate hypotheses"
|
|
30
|
-
boundaries:
|
|
31
|
-
- scope: "apply fixes"
|
|
32
|
-
skill: "/mvt-fix"
|
|
33
|
-
- scope: "design architecture"
|
|
34
|
-
skill: "/mvt-design"
|
|
35
|
-
- scope: "review code quality"
|
|
36
|
-
skill: "/mvt-review"
|
|
37
|
-
|
|
38
|
-
- type: shared
|
|
39
|
-
source: sections/activation-load-context.md
|
|
40
|
-
params:
|
|
41
|
-
extended_context:
|
|
42
|
-
- "Related source files (load based on bug description signals)"
|
|
43
|
-
|
|
44
|
-
- type: shared
|
|
45
|
-
source: sections/activation-load-config.md
|
|
46
|
-
|
|
47
|
-
- type:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
-
|
|
54
|
-
- Do NOT
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
- type: shared
|
|
65
|
-
source: sections/footer-next-steps.md
|
|
66
|
-
params:
|
|
67
|
-
current_skill: mvt-bug-detect
|
|
68
|
-
conditional_suggestions:
|
|
69
|
-
conditions:
|
|
70
|
-
- condition: "bug confirmed, fix is straightforward"
|
|
71
|
-
primary: "mvt-fix"
|
|
72
|
-
primary_desc: "Fix this bug"
|
|
73
|
-
- condition: "bug confirmed, fix requires architecture change"
|
|
74
|
-
primary: "mvt-design"
|
|
75
|
-
primary_desc: "Design architectural solution first"
|
|
76
|
-
alternatives:
|
|
77
|
-
- skill: "mvt-fix"
|
|
78
|
-
desc: "Apply a minimal workaround"
|
|
79
|
-
- condition: "not a bug (expected behavior)"
|
|
80
|
-
primary: "mvt-analyze"
|
|
81
|
-
primary_desc: "Re-analyze the underlying requirement"
|
|
82
|
-
- condition: "inconclusive, needs deeper code understanding"
|
|
83
|
-
primary: "mvt-analyze-code"
|
|
84
|
-
primary_desc: "Deep-dive into the codebase"
|
|
1
|
+
name: mvt-bug-detect
|
|
2
|
+
output: .claude/skills/mvt-bug-detect/SKILL.md
|
|
3
|
+
|
|
4
|
+
frontmatter:
|
|
5
|
+
name: mvt-bug-detect
|
|
6
|
+
description: "Analyze and detect bugs by investigating root cause, assessing severity and impact scope. Produces a structured diagnosis in conversation without applying fixes. This skill should be used when user suspects a bug, wants to understand a problem before fixing, or needs impact analysis."
|
|
7
|
+
|
|
8
|
+
sections:
|
|
9
|
+
- type: inline
|
|
10
|
+
content: |
|
|
11
|
+
# MVT Bug Detect
|
|
12
|
+
|
|
13
|
+
## Purpose
|
|
14
|
+
|
|
15
|
+
Investigate suspected bugs: confirm whether the bug exists, identify root cause, assess severity and impact scope, and produce a structured diagnosis. This skill does NOT apply fixes — it provides analysis to help the user understand the problem and decide on next steps.
|
|
16
|
+
|
|
17
|
+
- type: shared
|
|
18
|
+
source: sections/role-header.md
|
|
19
|
+
params:
|
|
20
|
+
role: Analyst
|
|
21
|
+
role_desc: "a Bug Investigation Specialist"
|
|
22
|
+
decision_rules:
|
|
23
|
+
- rule: "Bug description provided -> Analyze and investigate"
|
|
24
|
+
- rule: "Input too vague -> Prompt for specific details with structured template"
|
|
25
|
+
- rule: "No input -> Provide input template and wait"
|
|
26
|
+
- rule: "Root cause confirmed -> Assess impact and produce diagnosis"
|
|
27
|
+
- rule: "Multiple possible causes -> List hypotheses with evidence, verify each"
|
|
28
|
+
- rule: "Bug does not exist (expected behavior) -> Report clearly, suggest /mvt-analyze if requirement gap"
|
|
29
|
+
- rule: "Evidence insufficient -> Report findings, request more info, do NOT fabricate hypotheses"
|
|
30
|
+
boundaries:
|
|
31
|
+
- scope: "apply fixes"
|
|
32
|
+
skill: "/mvt-fix"
|
|
33
|
+
- scope: "design architecture"
|
|
34
|
+
skill: "/mvt-design"
|
|
35
|
+
- scope: "review code quality"
|
|
36
|
+
skill: "/mvt-review"
|
|
37
|
+
|
|
38
|
+
- type: shared
|
|
39
|
+
source: sections/activation-load-context.md
|
|
40
|
+
params:
|
|
41
|
+
extended_context:
|
|
42
|
+
- "Related source files (load based on bug description signals)"
|
|
43
|
+
|
|
44
|
+
- type: shared
|
|
45
|
+
source: sections/activation-load-config.md
|
|
46
|
+
|
|
47
|
+
- type: inline
|
|
48
|
+
content: |
|
|
49
|
+
## Operation Mode: Shortcut
|
|
50
|
+
|
|
51
|
+
This skill operates as a shortcut — it can execute at any time without checking workflow prerequisites.
|
|
52
|
+
- Do NOT update `active_change` fields (this is a shortcut operation, not a workflow phase).
|
|
53
|
+
- Do NOT write any artifact — diagnosis is presented in conversation only.
|
|
54
|
+
- Do NOT modify any source code — this skill is read-only analysis.
|
|
55
|
+
|
|
56
|
+
- type: file
|
|
57
|
+
source: ./business.md
|
|
58
|
+
|
|
59
|
+
- type: shared
|
|
60
|
+
source: sections/session-update.md
|
|
61
|
+
params:
|
|
62
|
+
current_skill: mvt-bug-detect
|
|
63
|
+
|
|
64
|
+
- type: shared
|
|
65
|
+
source: sections/footer-next-steps.md
|
|
66
|
+
params:
|
|
67
|
+
current_skill: mvt-bug-detect
|
|
68
|
+
conditional_suggestions:
|
|
69
|
+
conditions:
|
|
70
|
+
- condition: "bug confirmed, fix is straightforward"
|
|
71
|
+
primary: "mvt-fix"
|
|
72
|
+
primary_desc: "Fix this bug"
|
|
73
|
+
- condition: "bug confirmed, fix requires architecture change"
|
|
74
|
+
primary: "mvt-design"
|
|
75
|
+
primary_desc: "Design architectural solution first"
|
|
76
|
+
alternatives:
|
|
77
|
+
- skill: "mvt-fix"
|
|
78
|
+
desc: "Apply a minimal workaround"
|
|
79
|
+
- condition: "not a bug (expected behavior)"
|
|
80
|
+
primary: "mvt-analyze"
|
|
81
|
+
primary_desc: "Re-analyze the underlying requirement"
|
|
82
|
+
- condition: "inconclusive, needs deeper code understanding"
|
|
83
|
+
primary: "mvt-analyze-code"
|
|
84
|
+
primary_desc: "Deep-dive into the codebase"
|
|
@@ -13,7 +13,7 @@ This skill measures only files the **user** can reduce or relocate. Framework-fi
|
|
|
13
13
|
- Semantic context: `.ai-agents/knowledge/project/_generated/project-context.md`.
|
|
14
14
|
- Shared knowledge: every entry in `registry.yaml > knowledge.shared`. 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
15
|
- Per-skill knowledge: every entry in `registry.yaml > skills.*.knowledge`, grouped by skill.
|
|
16
|
-
- Artifacts: all files under `.ai-agents/workspace/artifacts/` recursively.
|
|
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):**
|
|
19
19
|
- `.claude/skills/mvt-*/SKILL.md` -- framework-shipped, not user-editable.
|
|
@@ -51,7 +51,7 @@ This skill measures only files the **user** can reduce or relocate. Framework-fi
|
|
|
51
51
|
|---------|------------------|-----------------|
|
|
52
52
|
| `project-context.md` is `oversized` | "project-context.md is {N} tokens. Regenerate with leaner sections." | `/mvt-analyze-code` |
|
|
53
53
|
| `project-context.md` is `borderline` AND last `/mvt-analyze-code` ran > 30 days ago | "project-context.md is {N} tokens and may be stale. Consider regenerating." | `/mvt-analyze-code` |
|
|
54
|
-
| Total artifacts tokens > artifacts threshold OR > 3 completed changes still in `artifacts/` | "Workspace has {N} tokens of historical artifacts. Archive completed changes." | `/mvt-cleanup` |
|
|
54
|
+
| Total artifacts tokens > artifacts threshold OR > 3 completed changes still in `artifacts/` (excluding `_archived/`) | "Workspace has {N} tokens of historical artifacts. Archive completed changes." | `/mvt-cleanup` |
|
|
55
55
|
| A specific change-id directory is `oversized` | "artifacts/{id} alone is {N} tokens. Summarize this change." | `/mvt-cleanup` |
|
|
56
56
|
| Shared Knowledge total is `oversized` | "Shared knowledge totals {N} tokens (loaded by every skill). Move skill-specific entries to per-skill." | `/mvt-manage-context move` |
|
|
57
57
|
| A single Shared Knowledge file is `oversized` | "{path} is {N} tokens. Split or move to per-skill." | `/mvt-manage-context move` |
|
|
@@ -74,8 +74,6 @@ This skill measures only files the **user** can reduce or relocate. Framework-fi
|
|
|
74
74
|
6. **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
75
|
- The report is conversation output; this skill does NOT write any artifact.
|
|
76
76
|
|
|
77
|
-
### Step 7: (session update handled by shared section)
|
|
78
|
-
|
|
79
77
|
## Edge Cases & Errors
|
|
80
78
|
|
|
81
79
|
| Case | Handling |
|
|
@@ -83,7 +81,7 @@ This skill measures only files the **user** can reduce or relocate. Framework-fi
|
|
|
83
81
|
| `registry.yaml` references a knowledge id whose source path is empty / missing | Include in Step 5 recommendations; do NOT count missing files toward token totals |
|
|
84
82
|
| `core/manifest.yaml` cannot be parsed | Treat the whole `core/` tree as in-scope (over-counts); add a note in the report |
|
|
85
83
|
| Workspace has zero artifacts | Skip the artifacts category in Step 6; do not error |
|
|
86
|
-
| Workspace exceeds the artifacts threshold AND the user just ran `/mvt-cleanup` (within last hour per `
|
|
84
|
+
| Workspace exceeds the artifacts threshold AND the user just ran `/mvt-cleanup` (within last hour per `history`) | Surface but downgrade to a one-line note ("recently cleaned -- remaining {N} tokens are likely active work") |
|
|
87
85
|
| User passes a path argument | This skill ignores arguments; print a one-line note and run as normal (do not narrow scope to a single file -- that is `/mvt-status` territory) |
|
|
88
86
|
| Token estimate disagrees with model's actual consumption | This is expected; the `chars/4` heuristic is an approximation. State this caveat in the Summary line |
|
|
89
87
|
| Two skills declare the same knowledge id | Count the file once for storage but report it under both skills in the Per-Skill table; flag the duplication in Step 5 |
|
|
@@ -20,10 +20,9 @@ sections:
|
|
|
20
20
|
role: Conductor
|
|
21
21
|
role_desc: "a Workflow Coordinator"
|
|
22
22
|
decision_rules:
|
|
23
|
-
- rule: "Total tokens
|
|
24
|
-
- rule: "Total tokens
|
|
25
|
-
- rule: "Total tokens
|
|
26
|
-
- rule: "Total tokens > 30,000 -> Report as \"Overloaded\", strongly recommend cleanup"
|
|
23
|
+
- rule: "Total tokens <= 12,000 -> Report as \"Healthy\""
|
|
24
|
+
- rule: "Total tokens 12,001-25,000 -> Report as \"Borderline\", suggest optimizations"
|
|
25
|
+
- rule: "Total tokens > 25,000 -> Report as \"Oversized\", strongly recommend cleanup"
|
|
27
26
|
boundaries:
|
|
28
27
|
- scope: "modify any files"
|
|
29
28
|
skill: "(Only analyze and recommend)"
|
|
@@ -41,12 +40,9 @@ sections:
|
|
|
41
40
|
- type: shared
|
|
42
41
|
source: sections/activation-load-config.md
|
|
43
42
|
|
|
44
|
-
- type: shared
|
|
45
|
-
source: sections/output-language-constraint.md
|
|
46
|
-
|
|
47
43
|
- type: inline
|
|
48
44
|
content: |
|
|
49
|
-
### Step
|
|
45
|
+
### Step 4: Pre-flight Checks
|
|
50
46
|
- No blocking checks required.
|
|
51
47
|
|
|
52
48
|
- type: file
|
|
@@ -61,3 +57,14 @@ sections:
|
|
|
61
57
|
source: sections/footer-next-steps.md
|
|
62
58
|
params:
|
|
63
59
|
current_skill: mvt-check-context
|
|
60
|
+
conditional_suggestions:
|
|
61
|
+
conditions:
|
|
62
|
+
- condition: "context oversized or borderline"
|
|
63
|
+
primary: mvt-cleanup
|
|
64
|
+
primary_desc: "Archive old artifacts to reduce context"
|
|
65
|
+
alternatives:
|
|
66
|
+
- skill: mvt-manage-context
|
|
67
|
+
desc: "Move per-skill knowledge to reduce shared load"
|
|
68
|
+
- condition: "context healthy"
|
|
69
|
+
primary: mvt-status
|
|
70
|
+
primary_desc: "Check overall project status"
|
|
@@ -3,33 +3,42 @@
|
|
|
3
3
|
### Step 1: Load Inputs
|
|
4
4
|
- **Fallback**: if `session.yaml` is missing, refuse to clean -- without state we can't tell what is in-progress vs completed; recommend `/mvt-init` and stop.
|
|
5
5
|
|
|
6
|
-
### Step 2:
|
|
6
|
+
### Step 2: Pre-Archive Sync Check
|
|
7
|
+
|
|
8
|
+
For each `changes[]` entry with `status: done`:
|
|
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 **⚠️ unsynced**.
|
|
11
|
+
3. Collect all unsynced change-ids into a warning list for display in Step 6.
|
|
12
|
+
|
|
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.
|
|
14
|
+
|
|
15
|
+
### Step 3: Inventory Artifacts
|
|
7
16
|
- **What**: produce a per-change-id inventory with size and last-modified data.
|
|
8
17
|
- **How**:
|
|
9
|
-
1. Walk `.ai-agents/workspace/artifacts/` and group files by their parent change-id directory.
|
|
18
|
+
1. Walk `.ai-agents/workspace/artifacts/` and group files by their parent change-id directory. **Exclude the `_archived/` subdirectory** from the walk — it contains previously archived changes and is not subject to re-inventory.
|
|
10
19
|
2. For each file: characters, estimated tokens (`chars / 4`), last-modified (mtime).
|
|
11
20
|
3. For each change-id directory, sum tokens and file count.
|
|
12
21
|
4. Mark each change-id as `active | in-recent-changes | unindexed | legacy-pattern`:
|
|
13
22
|
- `active` if it matches `session.active_change.id`.
|
|
14
|
-
- `in-recent-changes` if it appears in `session.
|
|
23
|
+
- `in-recent-changes` if it appears in `session.changes[]` (any status).
|
|
15
24
|
- `unindexed` if neither condition holds and it sits under `artifacts/`.
|
|
16
25
|
- `legacy-pattern` if the directory is `knowledge/patterns/` or matches other legacy markers.
|
|
17
26
|
|
|
18
|
-
### Step
|
|
27
|
+
### Step 4: Apply Cleanup Rules
|
|
19
28
|
- **What**: compute Cleanup Candidates from the inventory.
|
|
20
|
-
- **How**: run the rules table
|
|
29
|
+
- **How**: run the rules table below. A single change-id may match multiple rows; collect all proposed actions.
|
|
21
30
|
|
|
22
31
|
| Source | Rule | Proposed action |
|
|
23
32
|
|--------|------|-----------------|
|
|
24
|
-
| `
|
|
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}/` |
|
|
25
34
|
| Change-id directory marked `unindexed` | List for user review (do NOT auto-archive -- could be in-flight work the user just hasn't registered) |
|
|
26
|
-
| `
|
|
35
|
+
| `history` entries beyond the most recent N (from `config.yaml > preferences.history_limits.history`, default 20) | Truncate via `session-update.cjs --truncate-history <N>` |
|
|
27
36
|
| Directory `knowledge/patterns/` exists | Flag for deletion (legacy pattern data; no replacement) |
|
|
28
37
|
| Empty change-id directories (zero files inside) | Propose deletion of the directory itself |
|
|
29
38
|
|
|
30
39
|
- For each candidate, compute: `current size (tokens)` -> `projected size (tokens)`, expected savings.
|
|
31
40
|
|
|
32
|
-
### Step
|
|
41
|
+
### Step 5: Present Cleanup Plan
|
|
33
42
|
- Render the plan as a table:
|
|
34
43
|
|
|
35
44
|
| Item | Category | Current Size | Action | Result |
|
|
@@ -40,41 +49,58 @@
|
|
|
40
49
|
- Below the table, list any items marked `review-only` (unindexed) with a one-line note: user must decide manually.
|
|
41
50
|
- If `--dry-run` is set, STOP here. Print "(dry run -- no changes applied)" and exit cleanly.
|
|
42
51
|
|
|
43
|
-
### Step
|
|
52
|
+
### Step 6: Confirm Before Destructive Steps
|
|
44
53
|
- **Always require confirmation** if the plan includes any of:
|
|
45
54
|
- File deletion (legacy patterns, empty dirs).
|
|
46
55
|
- `summarize` action (collapses multi-file content).
|
|
47
|
-
- `archive` action (moves
|
|
48
|
-
-
|
|
56
|
+
- `archive` action (moves entire change-id directory into `artifacts/_archived/`).
|
|
57
|
+
- If the Step 2 warning list is non-empty, prepend it to the confirmation prompt:
|
|
58
|
+
> ⚠️ The following changes have NOT been synced by `/mvt-sync-context`. Archiving them will permanently lose their knowledge for aggregation:
|
|
59
|
+
> - {change-id}: {title}
|
|
60
|
+
> Options: `y` = archive anyway, `n` = cancel, `sync-first` = abort and run `/mvt-sync-context` first, `show-details` = per-file breakdown.
|
|
61
|
+
- 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.
|
|
62
|
+
- User chooses `sync-first` → stop cleanup, print "Run `/mvt-sync-context` first, then re-run `/mvt-cleanup`." and exit.
|
|
49
63
|
- Do NOT silently delete. Do NOT skip confirmation when `--dry-run` is absent.
|
|
50
64
|
|
|
51
|
-
### Step
|
|
65
|
+
### Step 7: Execute the Plan
|
|
52
66
|
- **What**: apply the confirmed actions.
|
|
53
67
|
- **How**:
|
|
54
|
-
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.
|
|
55
|
-
2. **Archive action
|
|
68
|
+
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
|
+
2. **Archive action** (no summarize): move the **entire** `artifacts/{id}/` directory to `artifacts/_archived/{id}/`. No internal path restructuring needed.
|
|
56
70
|
3. **Delete action**: remove only the items explicitly marked for deletion in the confirmed plan; never recurse beyond what was listed.
|
|
57
|
-
4. **Stale
|
|
71
|
+
4. **Stale history truncation**: call `session-update.cjs --truncate-history <N>` where N is from `config.yaml > preferences.history_limits.history` (default 20).
|
|
58
72
|
5. All file mutations atomic where possible (write-temp + rename, copy-then-delete for moves).
|
|
59
73
|
6. If any single action fails, STOP further actions; report what completed, what failed, and leave a recoverable state (do not partially overwrite a file with truncated content).
|
|
60
74
|
|
|
61
|
-
### Step
|
|
62
|
-
- Print the actually-applied actions (may differ from the plan if Step
|
|
75
|
+
### Step 8: Report Result
|
|
76
|
+
- Print the actually-applied actions (may differ from the plan if Step 7 stopped early).
|
|
63
77
|
- Show new totals: files cleaned, tokens saved.
|
|
64
78
|
- Recommend `/mvt-check-context` to validate the post-cleanup state if savings exceed ~5k tokens.
|
|
65
79
|
|
|
66
|
-
### Step
|
|
67
|
-
|
|
80
|
+
### Step 9: Session Update Parameter Selection
|
|
81
|
+
|
|
82
|
+
Based on the actual cleanup actions performed, choose the appropriate session-update parameter combination:
|
|
83
|
+
|
|
84
|
+
| Actual cleanup action | session-update parameters |
|
|
85
|
+
|----------------------|---------------------------|
|
|
86
|
+
| Closed `active_change` (all plan tasks completed) | `--close-change --truncate-history <N>` |
|
|
87
|
+
| Only truncated history / archived old changes (active_change still in progress) | `--truncate-history <N>` (**do NOT** pass `--close-change`) |
|
|
88
|
+
| `--dry-run` mode (no modifications made) | **Do NOT call** session-update script; only record history |
|
|
89
|
+
|
|
90
|
+
N is read from `config.yaml > preferences.history_limits.history` (default 20).
|
|
91
|
+
|
|
92
|
+
### Step 10: State Update
|
|
93
|
+
Apply the State Update rules defined in the **State Update** section below.
|
|
68
94
|
|
|
69
95
|
## Edge Cases & Errors
|
|
70
96
|
|
|
71
97
|
| Case | Handling |
|
|
72
98
|
|------|----------|
|
|
73
99
|
| `active_change.id` directory matches a "stale completed" rule | Skip cleanup of the active change; never archive in-progress work |
|
|
74
|
-
| `--dry-run` set | Stop after Step
|
|
100
|
+
| `--dry-run` set | Stop after Step 5; do not request confirmation; do not modify any file |
|
|
75
101
|
| Plan would archive ALL artifacts (workspace becomes empty) | Require an extra confirmation: `This will archive every artifact. Continue? (y/n)` |
|
|
76
|
-
| User aborts at Step
|
|
77
|
-
| `
|
|
102
|
+
| User aborts at Step 6 confirmation | Report "no changes applied" |
|
|
103
|
+
| `artifacts/_archived/{id}/` already exists from a prior run | Preserve existing content; merge or skip with a note — do not overwrite |
|
|
78
104
|
| File targeted for action no longer exists (concurrent removal) | Skip with a note; do not error out the whole run |
|
|
79
105
|
| 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 |
|
|
80
|
-
| `session.yaml.bak` present from a previous failed run | Overwrite during Step
|
|
106
|
+
| `session.yaml.bak` present from a previous failed run | Overwrite during Step 7 collapse (only the most recent backup is useful) |
|
|
@@ -63,23 +63,28 @@ sections:
|
|
|
63
63
|
level: "REQUIRED"
|
|
64
64
|
message: "Project must be initialized (session.yaml exists)"
|
|
65
65
|
|
|
66
|
-
- type: inline
|
|
67
|
-
content: |
|
|
68
|
-
## Cleanup Rules
|
|
69
|
-
|
|
70
|
-
| Category | Rule | Action |
|
|
71
|
-
|----------|------|--------|
|
|
72
|
-
| Completed changes | Change with `status: completed` older than current task | Summarize -> archive |
|
|
73
|
-
| Orphaned artifacts | Files in `artifacts/` not referenced by any active change | List for user review |
|
|
74
|
-
| Stale session data | Session history entries older than 5 phases ago | Summarize into single entry |
|
|
75
|
-
|
|
76
66
|
- type: file
|
|
77
67
|
source: ./business.md
|
|
78
68
|
|
|
79
69
|
- type: shared
|
|
80
70
|
source: sections/session-update.md
|
|
71
|
+
params:
|
|
72
|
+
current_skill: mvt-cleanup
|
|
73
|
+
truncate_history: true
|
|
74
|
+
close_change: true
|
|
81
75
|
|
|
82
76
|
- type: shared
|
|
83
77
|
source: sections/footer-next-steps.md
|
|
84
78
|
params:
|
|
85
79
|
current_skill: mvt-cleanup
|
|
80
|
+
conditional_suggestions:
|
|
81
|
+
conditions:
|
|
82
|
+
- condition: "cleanup freed significant tokens"
|
|
83
|
+
primary: mvt-check-context
|
|
84
|
+
primary_desc: "Validate post-cleanup context health"
|
|
85
|
+
- condition: "active change still in progress"
|
|
86
|
+
primary: mvt-resume
|
|
87
|
+
primary_desc: "Resume work on the active change"
|
|
88
|
+
- condition: "no active changes remain"
|
|
89
|
+
primary: mvt-analyze
|
|
90
|
+
primary_desc: "Start a new feature"
|