@uoyo/mvtt 2.0.0-beta.0 → 2.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +194 -209
- package/dist/build/assembler.d.ts.map +1 -1
- package/dist/build/assembler.js +2 -0
- package/dist/build/assembler.js.map +1 -1
- package/dist/build/plan-validator.d.ts +26 -0
- package/dist/build/plan-validator.d.ts.map +1 -0
- package/dist/build/plan-validator.js +225 -0
- package/dist/build/plan-validator.js.map +1 -0
- package/dist/build/section-loader.d.ts.map +1 -1
- package/dist/build/section-loader.js +45 -9
- package/dist/build/section-loader.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +2 -11
- package/dist/cli.js.map +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +0 -1
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/install.d.ts +1 -4
- package/dist/commands/install.d.ts.map +1 -1
- package/dist/commands/install.js +18 -14
- package/dist/commands/install.js.map +1 -1
- package/dist/commands/migrate.d.ts +16 -0
- package/dist/commands/migrate.d.ts.map +1 -0
- package/dist/commands/migrate.js +118 -0
- package/dist/commands/migrate.js.map +1 -0
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +35 -2
- package/dist/commands/update.js.map +1 -1
- package/dist/fs/core-manifest.d.ts +17 -0
- package/dist/fs/core-manifest.d.ts.map +1 -0
- package/dist/fs/core-manifest.js +76 -0
- package/dist/fs/core-manifest.js.map +1 -0
- package/dist/fs/install-manifest.d.ts +1 -2
- package/dist/fs/install-manifest.d.ts.map +1 -1
- package/dist/fs/install-manifest.js +1 -2
- package/dist/fs/install-manifest.js.map +1 -1
- package/dist/fs/materialize.d.ts.map +1 -1
- package/dist/fs/materialize.js +23 -3
- package/dist/fs/materialize.js.map +1 -1
- package/dist/types/core-manifest.d.ts +12 -0
- package/dist/types/core-manifest.d.ts.map +1 -0
- package/dist/types/core-manifest.js +2 -0
- package/dist/types/core-manifest.js.map +1 -0
- package/dist/types/registry.d.ts +13 -5
- package/dist/types/registry.d.ts.map +1 -1
- package/install-manifest.yaml +31 -27
- package/package.json +57 -57
- package/registry.yaml +198 -209
- package/sources/defaults/config.yaml +27 -30
- package/sources/defaults/project-context.yaml +15 -26
- package/sources/defaults/session.yaml +31 -23
- package/sources/knowledge/core/manifest.yaml +4 -45
- package/sources/sections/activation-load-config.md +11 -5
- package/sources/sections/activation-load-context.md +26 -11
- package/sources/sections/activation-preflight.md +14 -4
- package/sources/sections/footer-next-steps.md +35 -9
- package/sources/sections/output-language-constraint.md +11 -0
- package/sources/sections/role-header.md +13 -13
- package/sources/sections/session-update.md +47 -0
- package/sources/skills/mvt-analyze/business.md +69 -33
- package/sources/skills/mvt-analyze/manifest.yaml +90 -89
- package/sources/skills/mvt-analyze-code/business.md +82 -35
- package/sources/skills/mvt-analyze-code/manifest.yaml +96 -88
- package/sources/skills/mvt-bug-detect/business.md +101 -0
- package/sources/skills/mvt-bug-detect/manifest.yaml +84 -0
- package/sources/skills/mvt-check-context/business.md +89 -42
- package/sources/skills/mvt-check-context/manifest.yaml +63 -74
- package/sources/skills/mvt-cleanup/business.md +80 -31
- package/sources/skills/mvt-cleanup/manifest.yaml +85 -93
- package/sources/skills/mvt-config/business.md +94 -26
- package/sources/skills/mvt-config/manifest.yaml +96 -108
- package/sources/skills/mvt-create-skill/business.md +231 -111
- package/sources/skills/mvt-create-skill/manifest.yaml +91 -79
- package/sources/skills/mvt-design/business.md +116 -34
- package/sources/skills/mvt-design/manifest.yaml +96 -105
- package/sources/skills/mvt-fix/business.md +132 -28
- package/sources/skills/mvt-fix/manifest.yaml +85 -86
- package/sources/skills/mvt-help/business.md +74 -70
- package/sources/skills/mvt-help/manifest.yaml +67 -61
- package/sources/skills/mvt-implement/business.md +91 -32
- package/sources/skills/mvt-implement/manifest.yaml +80 -96
- package/sources/skills/mvt-init/business.md +164 -49
- package/sources/skills/mvt-init/manifest.yaml +101 -93
- package/sources/skills/mvt-manage-context/business.md +175 -0
- package/sources/skills/mvt-manage-context/manifest.yaml +123 -0
- package/sources/skills/mvt-plan-dev/business.md +75 -0
- package/sources/skills/mvt-plan-dev/manifest.yaml +91 -0
- package/sources/skills/mvt-quick-dev/business.md +99 -0
- package/sources/skills/mvt-quick-dev/manifest.yaml +69 -0
- package/sources/skills/mvt-refactor/business.md +104 -33
- package/sources/skills/mvt-refactor/manifest.yaml +86 -101
- package/sources/skills/mvt-resume/business.md +137 -0
- package/sources/skills/mvt-resume/manifest.yaml +71 -0
- package/sources/skills/mvt-review/business.md +112 -49
- package/sources/skills/mvt-review/manifest.yaml +87 -106
- package/sources/skills/mvt-status/business.md +71 -24
- package/sources/skills/mvt-status/manifest.yaml +66 -74
- package/sources/skills/mvt-sync-context/business.md +150 -25
- package/sources/skills/mvt-sync-context/manifest.yaml +96 -84
- package/sources/skills/mvt-template/business.md +96 -49
- package/sources/skills/mvt-template/manifest.yaml +63 -71
- package/sources/skills/mvt-test/business.md +104 -36
- package/sources/skills/mvt-test/manifest.yaml +102 -111
- package/sources/skills/mvt-update-plan/business.md +72 -0
- package/sources/skills/mvt-update-plan/manifest.yaml +132 -0
- package/sources/templates/analyze-output/body.md +15 -38
- package/sources/templates/analyze-output/manifest.yaml +11 -11
- package/sources/templates/design-output/body.md +17 -50
- package/sources/templates/design-output/manifest.yaml +11 -11
- package/sources/templates/implement-output/body.md +11 -32
- package/sources/templates/implement-output/manifest.yaml +11 -11
- package/sources/templates/project-context/body.md +13 -0
- package/sources/templates/project-context/manifest.yaml +12 -0
- package/sources/templates/review-output/body.md +11 -45
- package/sources/templates/review-output/manifest.yaml +11 -11
- package/sources/templates/test-output/body.md +7 -31
- package/sources/templates/test-output/manifest.yaml +11 -11
- package/dist/fs/protection.d.ts +0 -15
- package/dist/fs/protection.d.ts.map +0 -1
- package/dist/fs/protection.js +0 -16
- package/dist/fs/protection.js.map +0 -1
- package/sources/knowledge/core/review-principles.md +0 -51
- package/sources/knowledge/patterns/clean-architecture/manifest.yaml +0 -66
- package/sources/knowledge/patterns/clean-architecture/review-checklist.md +0 -230
- package/sources/knowledge/patterns/ddd/manifest.yaml +0 -83
- package/sources/knowledge/patterns/ddd/review-checklist.md +0 -226
- package/sources/knowledge/patterns/ddd/tactical-patterns.md +0 -12
- package/sources/knowledge/patterns/frontend-react/manifest.yaml +0 -44
- package/sources/knowledge/patterns/frontend-react/review-checklist.md +0 -78
- package/sources/knowledge/patterns/manifest.yaml +0 -113
- package/sources/skills/mvt-add-context/business.md +0 -47
- package/sources/skills/mvt-add-context/manifest.yaml +0 -83
- package/sources/templates/analyze-code-output/body.md +0 -44
- package/sources/templates/analyze-code-output/manifest.yaml +0 -11
- package/sources/templates/cleanup-output/body.md +0 -9
- package/sources/templates/cleanup-output/manifest.yaml +0 -11
- package/sources/templates/config-output/body.md +0 -11
- package/sources/templates/config-output/manifest.yaml +0 -11
- package/sources/templates/context-check-output/body.md +0 -32
- package/sources/templates/context-check-output/manifest.yaml +0 -11
- package/sources/templates/fix-output/body.md +0 -30
- package/sources/templates/fix-output/manifest.yaml +0 -11
- package/sources/templates/init-output/body.md +0 -34
- package/sources/templates/init-output/manifest.yaml +0 -11
- package/sources/templates/refactor-output/body.md +0 -32
- package/sources/templates/refactor-output/manifest.yaml +0 -11
- package/sources/templates/status-output/body.md +0 -36
- package/sources/templates/status-output/manifest.yaml +0 -11
- package/sources/templates/sync-context-output/body.md +0 -16
- package/sources/templates/sync-context-output/manifest.yaml +0 -11
|
@@ -1,35 +1,82 @@
|
|
|
1
|
-
## Execution Flow
|
|
2
|
-
|
|
3
|
-
### Step 1:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
1
|
+
## Execution Flow
|
|
2
|
+
|
|
3
|
+
### Step 1: Determine Analysis Target
|
|
4
|
+
|
|
5
|
+
Identify which project(s) to analyze:
|
|
6
|
+
|
|
7
|
+
| Variant | Target |
|
|
8
|
+
|---------|--------|
|
|
9
|
+
| `/mvt-analyze-code` | Analyze the first project in `project-context.yaml` (or the only one) |
|
|
10
|
+
| `/mvt-analyze-code --all` | Analyze all projects listed in `project-context.yaml` |
|
|
11
|
+
| `/mvt-analyze-code {name}` | Analyze the project matching the given name |
|
|
12
|
+
|
|
13
|
+
For each target project:
|
|
14
|
+
1. Read its `path` from `project-context.yaml`
|
|
15
|
+
2. Use `path` as the source directory for analysis
|
|
16
|
+
|
|
17
|
+
### Step 2: Load Template
|
|
18
|
+
|
|
19
|
+
Determine the output template for project-context.md:
|
|
20
|
+
|
|
21
|
+
1. Check `.ai-agents/skills/_templates/custom/project-context.md` -- if exists, use it
|
|
22
|
+
2. Otherwise, use `.ai-agents/skills/_templates/project-context.md` (default)
|
|
23
|
+
3. Read the template to understand the required section structure
|
|
24
|
+
4. The template defines section headings only -- generate content freely for each section based on code analysis
|
|
25
|
+
|
|
26
|
+
### Step 3: Scan Code Structure
|
|
27
|
+
|
|
28
|
+
For the target project directory:
|
|
29
|
+
|
|
30
|
+
- Map directory structure (one level below source root)
|
|
31
|
+
- Identify entry points (main files, index files, router files)
|
|
32
|
+
- Detect module boundaries (top-level directories under source root)
|
|
33
|
+
|
|
34
|
+
### Step 4: Extract Modules and Entities
|
|
35
|
+
|
|
36
|
+
- Identify top-level modules and their responsibilities
|
|
37
|
+
- For each module, determine: path, responsibility, dependencies on other modules
|
|
38
|
+
- Identify domain entities (models, schemas, types, interfaces)
|
|
39
|
+
- Classify entities by type: domain model, value object, DTO, configuration
|
|
40
|
+
|
|
41
|
+
### Step 5: Extract Core Terms
|
|
42
|
+
|
|
43
|
+
Scan code for domain-specific terminology:
|
|
44
|
+
|
|
45
|
+
- Class and interface names that represent domain concepts
|
|
46
|
+
- Abbreviations and their expansions
|
|
47
|
+
- Domain jargon used in comments and docstrings
|
|
48
|
+
- Present as a glossary table: | Term | Meaning |
|
|
49
|
+
|
|
50
|
+
### Step 6: Extract Business Rules
|
|
51
|
+
|
|
52
|
+
Identify key business logic and constraints:
|
|
53
|
+
|
|
54
|
+
- Validation rules (assertions, guards, precondition checks)
|
|
55
|
+
- Computation rules (formulas, algorithms, calculation logic)
|
|
56
|
+
- State transition rules (workflow steps, status changes)
|
|
57
|
+
- Constraint rules (limits, quotas, access restrictions)
|
|
58
|
+
|
|
59
|
+
### Step 7: Extract API Overview
|
|
60
|
+
|
|
61
|
+
Identify public interfaces:
|
|
62
|
+
|
|
63
|
+
- HTTP endpoints (routes, handlers) with method and path
|
|
64
|
+
- Public methods of service classes
|
|
65
|
+
- Event publishers and subscribers
|
|
66
|
+
- CLI commands (if applicable)
|
|
67
|
+
|
|
68
|
+
### Step 8: Generate Output
|
|
69
|
+
|
|
70
|
+
1. For each analyzed project, generate a section in the template format:
|
|
71
|
+
- Use `# Project: {name}` as the top-level heading
|
|
72
|
+
- Fill each template section with analysis results
|
|
73
|
+
- If a section has no relevant content, include the heading with "(No relevant content detected)"
|
|
74
|
+
|
|
75
|
+
2. Write the output to `.ai-agents/knowledge/project/_generated/project-context.md`:
|
|
76
|
+
- If analyzing a single project, write that project's section
|
|
77
|
+
- If analyzing multiple projects (`--all`), write all sections separated by `---`
|
|
78
|
+
- If the file already exists, merge with existing content:
|
|
79
|
+
- Replace sections for re-analyzed projects
|
|
80
|
+
- Preserve sections for projects NOT in this analysis run
|
|
81
|
+
|
|
82
|
+
3. Do NOT update `project-context.yaml` -- it is the lean index, managed by `/mvt-init` and `/mvt-sync-context` only
|
|
@@ -1,88 +1,96 @@
|
|
|
1
|
-
name: mvt-analyze-code
|
|
2
|
-
output: .claude/skills/mvt-analyze-code/SKILL.md
|
|
3
|
-
|
|
4
|
-
frontmatter:
|
|
5
|
-
name: mvt-analyze-code
|
|
6
|
-
description: "
|
|
7
|
-
|
|
8
|
-
sections:
|
|
9
|
-
- type: inline
|
|
10
|
-
content: |
|
|
11
|
-
# MVT Analyze Code
|
|
12
|
-
|
|
13
|
-
## Purpose
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
- type: shared
|
|
18
|
-
source: sections/role-header.md
|
|
19
|
-
params:
|
|
20
|
-
role: Analyst
|
|
21
|
-
role_desc: "a
|
|
22
|
-
decision_rules:
|
|
23
|
-
- rule: "Source code exists -> Proceed with codebase scanning"
|
|
24
|
-
- rule: "No source code found -> Warn user and suggest checking project path"
|
|
25
|
-
- rule: "
|
|
26
|
-
- rule: "
|
|
27
|
-
boundaries:
|
|
28
|
-
- scope: "make architecture decisions"
|
|
29
|
-
skill: "/mvt-design"
|
|
30
|
-
- scope: "recommend technologies"
|
|
31
|
-
skill: "/mvt-design"
|
|
32
|
-
- scope: "write implementation code"
|
|
33
|
-
skill: "/mvt-implement"
|
|
34
|
-
|
|
35
|
-
- type:
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
- type:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
1
|
+
name: mvt-analyze-code
|
|
2
|
+
output: .claude/skills/mvt-analyze-code/SKILL.md
|
|
3
|
+
|
|
4
|
+
frontmatter:
|
|
5
|
+
name: mvt-analyze-code
|
|
6
|
+
description: "Analyze existing code to generate project-context.md with terms, modules, layers, and business rules. This skill should be used when user wants to understand an existing codebase, generate documentation for legacy code, onboard to a new project, or extract requirements from source code."
|
|
7
|
+
|
|
8
|
+
sections:
|
|
9
|
+
- type: inline
|
|
10
|
+
content: |
|
|
11
|
+
# MVT Analyze Code
|
|
12
|
+
|
|
13
|
+
## Purpose
|
|
14
|
+
|
|
15
|
+
Analyze existing code to generate the project-context.md file, which describes the project's terms, modules, layer structure, business rules, and API overview. This is an independent operation that does not create a change-id.
|
|
16
|
+
|
|
17
|
+
- type: shared
|
|
18
|
+
source: sections/role-header.md
|
|
19
|
+
params:
|
|
20
|
+
role: Analyst
|
|
21
|
+
role_desc: "a Code Analysis Expert"
|
|
22
|
+
decision_rules:
|
|
23
|
+
- rule: "Source code exists -> Proceed with codebase scanning"
|
|
24
|
+
- rule: "No source code found -> Warn user and suggest checking project path"
|
|
25
|
+
- rule: "Multiple frameworks detected -> List all and prompt for primary confirmation"
|
|
26
|
+
- rule: "Custom template exists -> Use it instead of default template"
|
|
27
|
+
boundaries:
|
|
28
|
+
- scope: "make architecture decisions"
|
|
29
|
+
skill: "/mvt-design"
|
|
30
|
+
- scope: "recommend technologies"
|
|
31
|
+
skill: "/mvt-design"
|
|
32
|
+
- scope: "write implementation code"
|
|
33
|
+
skill: "/mvt-implement"
|
|
34
|
+
|
|
35
|
+
- type: inline
|
|
36
|
+
content: |
|
|
37
|
+
## Variants
|
|
38
|
+
|
|
39
|
+
| Variant | Description |
|
|
40
|
+
|---------|-------------|
|
|
41
|
+
| `/mvt-analyze-code` | Analyze the first (or only) project |
|
|
42
|
+
| `/mvt-analyze-code --all` | Analyze all projects in the workspace |
|
|
43
|
+
| `/mvt-analyze-code {name}` | Analyze a specific project by name |
|
|
44
|
+
|
|
45
|
+
- type: shared
|
|
46
|
+
source: sections/activation-load-context.md
|
|
47
|
+
params:
|
|
48
|
+
extended_context:
|
|
49
|
+
- "Scan project source directories for analysis"
|
|
50
|
+
- ".ai-agents/skills/_templates/project-context.md -- Default template for output structure"
|
|
51
|
+
- ".ai-agents/skills/_templates/custom/project-context.md -- Custom template (if exists)"
|
|
52
|
+
|
|
53
|
+
- type: shared
|
|
54
|
+
source: sections/activation-load-config.md
|
|
55
|
+
|
|
56
|
+
- type: shared
|
|
57
|
+
source: sections/output-language-constraint.md
|
|
58
|
+
|
|
59
|
+
- type: shared
|
|
60
|
+
source: sections/activation-preflight.md
|
|
61
|
+
params:
|
|
62
|
+
checks:
|
|
63
|
+
- order: "1"
|
|
64
|
+
field: "session.initialized_at"
|
|
65
|
+
level: "WARN"
|
|
66
|
+
message: "Session not initialized. Run `/mvt-init` first."
|
|
67
|
+
- order: "2"
|
|
68
|
+
field: "projects[] in project-context.yaml"
|
|
69
|
+
level: "WARN"
|
|
70
|
+
message: "No projects registered. Run `/mvt-init` first."
|
|
71
|
+
|
|
72
|
+
- type: inline
|
|
73
|
+
content: |
|
|
74
|
+
### Independent Operation Rules
|
|
75
|
+
- This is an independent operation -- no workflow prerequisites required
|
|
76
|
+
- Does NOT create a change-id
|
|
77
|
+
- Output is written to `.ai-agents/knowledge/project/_generated/project-context.md`
|
|
78
|
+
|
|
79
|
+
- type: file
|
|
80
|
+
source: ./business.md
|
|
81
|
+
|
|
82
|
+
- type: inline
|
|
83
|
+
content: |
|
|
84
|
+
## Artifact Structure
|
|
85
|
+
Read the document structure template from: `.ai-agents/skills/_templates/project-context.md`
|
|
86
|
+
If a custom version exists at `.ai-agents/skills/_templates/custom/project-context.md`, use the custom version instead.
|
|
87
|
+
The template defines section headings only. Generate content for each section based on code analysis results.
|
|
88
|
+
Write the artifact to: `.ai-agents/knowledge/project/_generated/project-context.md`
|
|
89
|
+
|
|
90
|
+
- type: shared
|
|
91
|
+
source: sections/session-update.md
|
|
92
|
+
|
|
93
|
+
- type: shared
|
|
94
|
+
source: sections/footer-next-steps.md
|
|
95
|
+
params:
|
|
96
|
+
current_skill: mvt-analyze-code
|
|
@@ -0,0 +1,101 @@
|
|
|
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
|
+
### Step 7: (session update handled by shared section)
|
|
91
|
+
|
|
92
|
+
## Edge Cases & Errors
|
|
93
|
+
|
|
94
|
+
| Case | Handling |
|
|
95
|
+
|------|----------|
|
|
96
|
+
| Bug is intermittent / racy | Mark reproduction as "flaky", state confidence level explicitly, suggest adding instrumentation rather than speculative analysis |
|
|
97
|
+
| Root cause is in a third-party dependency | Document the upstream issue, note that local workaround would be the only fix option |
|
|
98
|
+
| Bug description describes expected behavior (NotABug) | Explain clearly with evidence from code/business rules, do NOT proceed to suggest fixes |
|
|
99
|
+
| Multiple independent bugs described in one input | Analyze each separately, present multiple diagnosis blocks |
|
|
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 |
|
|
@@ -0,0 +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: shared
|
|
48
|
+
source: sections/output-language-constraint.md
|
|
49
|
+
|
|
50
|
+
- type: inline
|
|
51
|
+
content: |
|
|
52
|
+
### Shortcut Operation Rules
|
|
53
|
+
- Can execute at any time without checking workflow prerequisites
|
|
54
|
+
- Do NOT update `progress` (this is a shortcut operation, not a workflow phase)
|
|
55
|
+
- Do NOT write any artifact — diagnosis is presented in conversation only
|
|
56
|
+
- Do NOT modify any source code — this skill is read-only analysis
|
|
57
|
+
|
|
58
|
+
- type: file
|
|
59
|
+
source: ./business.md
|
|
60
|
+
|
|
61
|
+
- type: shared
|
|
62
|
+
source: sections/session-update.md
|
|
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,42 +1,89 @@
|
|
|
1
|
-
## Execution Flow
|
|
2
|
-
|
|
3
|
-
### Step 1:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
**
|
|
7
|
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
|
|
11
|
-
**
|
|
12
|
-
- `.ai-agents/
|
|
13
|
-
- `.ai-agents/knowledge/
|
|
14
|
-
- `.
|
|
15
|
-
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
- `.
|
|
22
|
-
|
|
23
|
-
### Step
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
- Knowledge
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
### Step
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
|
|
42
|
-
|
|
1
|
+
## Execution Flow
|
|
2
|
+
|
|
3
|
+
### Step 1: Load Inputs
|
|
4
|
+
- **Recommended**:
|
|
5
|
+
- `.ai-agents/knowledge/core/manifest.yaml` -- to filter `core/_framework/` (excluded) from `core/user/` (in-scope).
|
|
6
|
+
- **Fallback**: missing `core/manifest.yaml` -> treat all `core/*` files as user-origin (over-counts; flag in report).
|
|
7
|
+
|
|
8
|
+
### Step 2: Determine In-Scope Files
|
|
9
|
+
This skill measures only files the **user** can reduce or relocate. Framework-fixed overhead is excluded.
|
|
10
|
+
|
|
11
|
+
**In scope (user-actionable):**
|
|
12
|
+
- Index: `.ai-agents/workspace/project-context.yaml`.
|
|
13
|
+
- Semantic context: `.ai-agents/knowledge/project/_generated/project-context.md`.
|
|
14
|
+
- Shared knowledge: every entry in `registry.yaml > knowledge.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
|
+
- Per-skill knowledge: every entry in `registry.yaml > skills.*.knowledge`, grouped by skill.
|
|
16
|
+
- Artifacts: all files under `.ai-agents/workspace/artifacts/` recursively.
|
|
17
|
+
|
|
18
|
+
**Out of scope (do NOT scan):**
|
|
19
|
+
- `.claude/skills/mvt-*/SKILL.md` -- framework-shipped, not user-editable.
|
|
20
|
+
- `.ai-agents/knowledge/core/_framework/**` -- framework-shipped.
|
|
21
|
+
- `.ai-agents/config.yaml`, `.ai-agents/workspace/session.yaml`, `.ai-agents/registry.yaml` -- small, required, and addressed via `/mvt-config` or `/mvt-manage-context`, not here.
|
|
22
|
+
|
|
23
|
+
### Step 3: Estimate Token Consumption
|
|
24
|
+
- **What**: produce a per-file tokens estimate and per-category subtotals.
|
|
25
|
+
- **How**:
|
|
26
|
+
1. For each in-scope file: tokens ~= `characters / 4`.
|
|
27
|
+
2. Group by category: `Index`, `Semantic Context`, `Shared Knowledge`, `Per-Skill Knowledge`, `Artifacts`.
|
|
28
|
+
3. For Shared Knowledge, compute total once -- this is per-skill overhead (loaded by every skill invocation).
|
|
29
|
+
4. For Per-Skill Knowledge, compute totals per skill so users can see which skill is heaviest.
|
|
30
|
+
5. Identify the Top 5 largest single files across the whole in-scope set.
|
|
31
|
+
|
|
32
|
+
### Step 4: Apply Thresholds and Health Status
|
|
33
|
+
- **What**: assign each file/category a status of `healthy | borderline | oversized`.
|
|
34
|
+
- **How**: read thresholds from `.ai-agents/config.yaml > preferences.context_thresholds.*` if present; otherwise use the defaults below.
|
|
35
|
+
|
|
36
|
+
| Subject | healthy | borderline | oversized |
|
|
37
|
+
|---------|---------|------------|-----------|
|
|
38
|
+
| Total in-scope tokens | <= 12000 | 12001-25000 | > 25000 |
|
|
39
|
+
| Single file tokens | <= 3000 | 3001-6000 | > 6000 |
|
|
40
|
+
| `project-context.md` tokens | <= 4000 | 4001-8000 | > 8000 |
|
|
41
|
+
| Shared Knowledge total tokens | <= 6000 | 6001-12000 | > 12000 |
|
|
42
|
+
| Single change-id artifacts directory tokens | <= 3000 | 3001-8000 | > 8000 |
|
|
43
|
+
|
|
44
|
+
- Overall workspace status = the worst status across all subjects above.
|
|
45
|
+
|
|
46
|
+
### Step 5: Generate Recommendations
|
|
47
|
+
- **What**: produce a list of specific, actionable recommendations. Each entry is `(trigger, message, suggested skill)`.
|
|
48
|
+
- **How**: walk the table; emit a recommendation for every row whose trigger fires.
|
|
49
|
+
|
|
50
|
+
| Trigger | Message template | Suggested skill |
|
|
51
|
+
|---------|------------------|-----------------|
|
|
52
|
+
| `project-context.md` is `oversized` | "project-context.md is {N} tokens. Regenerate with leaner sections." | `/mvt-analyze-code` |
|
|
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` |
|
|
55
|
+
| A specific change-id directory is `oversized` | "artifacts/{id} alone is {N} tokens. Summarize this change." | `/mvt-cleanup` |
|
|
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
|
+
| A single Shared Knowledge file is `oversized` | "{path} is {N} tokens. Split or move to per-skill." | `/mvt-manage-context move` |
|
|
58
|
+
| Per-skill Knowledge entry exists in `registry.yaml` but its referenced files are missing | "{skill} declares knowledge `{id}` but `{path}` is missing." | `/mvt-manage-context remove` (or restore the file) |
|
|
59
|
+
| A knowledge file exists on disk but no `registry.yaml` entry references it | "{path} is unused (not loaded by any skill)." | `/mvt-manage-context remove` |
|
|
60
|
+
| Two knowledge entries reference identical content (same hash) | "{a} and {b} are duplicates. Consolidate." | manual edit |
|
|
61
|
+
|
|
62
|
+
- **Constraints on recommendations**:
|
|
63
|
+
- Never recommend changes to framework files (`_framework/`, `mvt-*/SKILL.md`).
|
|
64
|
+
- Never recommend deletion without an `/mvt-manage-context` or `/mvt-cleanup` command -- those skills own the actual mutation.
|
|
65
|
+
- If no triggers fire, return a single line: "Workspace context is healthy ({N} tokens total)."
|
|
66
|
+
|
|
67
|
+
### Step 6: Generate Report
|
|
68
|
+
- Render the report in this order:
|
|
69
|
+
1. **Summary** -- one line: total tokens + overall status.
|
|
70
|
+
2. **Per-Category Breakdown** -- table: `category | files | tokens | status`.
|
|
71
|
+
3. **Top 5 Largest Files** -- table: `path | tokens | category | status`.
|
|
72
|
+
4. **Per-Skill Knowledge Cost** -- table: `skill | tokens` (sorted desc); include shared knowledge as a separate row labeled `(shared, loaded every time)`.
|
|
73
|
+
5. **Recommendations** -- numbered list from Step 5; if empty, render the healthy line.
|
|
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
|
+
- The report is conversation output; this skill does NOT write any artifact.
|
|
76
|
+
|
|
77
|
+
### Step 7: (session update handled by shared section)
|
|
78
|
+
|
|
79
|
+
## Edge Cases & Errors
|
|
80
|
+
|
|
81
|
+
| Case | Handling |
|
|
82
|
+
|------|----------|
|
|
83
|
+
| `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
|
+
| `core/manifest.yaml` cannot be parsed | Treat the whole `core/` tree as in-scope (over-counts); add a note in the report |
|
|
85
|
+
| 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 `skill_history`) | Surface but downgrade to a one-line note ("recently cleaned -- remaining {N} tokens are likely active work") |
|
|
87
|
+
| 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
|
+
| 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
|
+
| 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 |
|