@uoyo/mvtt 2.0.0-beta.0 → 2.0.0-beta.1
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 +131 -147
- 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 +18 -0
- package/dist/commands/migrate.d.ts.map +1 -0
- package/dist/commands/migrate.js +163 -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 +192 -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 +34 -26
- package/sources/skills/mvt-check-context/business.md +89 -42
- package/sources/skills/mvt-check-context/manifest.yaml +10 -21
- 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 +15 -27
- package/sources/skills/mvt-create-skill/business.md +224 -111
- package/sources/skills/mvt-create-skill/manifest.yaml +31 -15
- package/sources/skills/mvt-design/business.md +116 -34
- package/sources/skills/mvt-design/manifest.yaml +22 -31
- package/sources/skills/mvt-fix/business.md +103 -28
- package/sources/skills/mvt-fix/manifest.yaml +8 -22
- package/sources/skills/mvt-help/business.md +74 -70
- package/sources/skills/mvt-help/manifest.yaml +16 -10
- package/sources/skills/mvt-implement/business.md +91 -32
- package/sources/skills/mvt-implement/manifest.yaml +17 -33
- package/sources/skills/mvt-init/business.md +164 -49
- package/sources/skills/mvt-init/manifest.yaml +36 -28
- 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 +17 -32
- 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 +15 -34
- package/sources/skills/mvt-status/business.md +71 -24
- package/sources/skills/mvt-status/manifest.yaml +18 -26
- package/sources/skills/mvt-sync-context/business.md +148 -23
- package/sources/skills/mvt-sync-context/manifest.yaml +51 -39
- package/sources/skills/mvt-template/business.md +96 -49
- package/sources/skills/mvt-template/manifest.yaml +13 -21
- package/sources/skills/mvt-test/business.md +104 -36
- package/sources/skills/mvt-test/manifest.yaml +14 -23
- 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 +8 -31
- 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 +6 -27
- 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 +6 -40
- package/sources/templates/review-output/manifest.yaml +11 -11
- package/sources/templates/test-output/body.md +4 -28
- package/sources/templates/test-output/manifest.yaml +11 -11
- 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,49 +1,96 @@
|
|
|
1
|
-
## Execution Flow
|
|
2
|
-
|
|
3
|
-
### Step 1: Load
|
|
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
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
**
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
-
|
|
1
|
+
## Execution Flow
|
|
2
|
+
|
|
3
|
+
### Step 1: Load Inputs
|
|
4
|
+
- **Recommended**:
|
|
5
|
+
- `.ai-agents/skills/_templates/` -- default templates (read-only from this skill).
|
|
6
|
+
|
|
7
|
+
### Step 2: Build Template Inventory
|
|
8
|
+
- **What**: produce the canonical list of templates with their status.
|
|
9
|
+
- **How**:
|
|
10
|
+
1. From `registry.yaml`, collect every `skills.<name>.template` value that is not null.
|
|
11
|
+
2. For each entry, derive the basename (e.g., `analyze-output.md`).
|
|
12
|
+
3. For each basename:
|
|
13
|
+
- `default` exists if the file is present under `.ai-agents/skills/_templates/`.
|
|
14
|
+
- `custom` exists if the file is present under `.ai-agents/skills/_templates/custom/` with the same basename.
|
|
15
|
+
4. Status:
|
|
16
|
+
- `Default` if only default exists.
|
|
17
|
+
- `Customized` if both exist.
|
|
18
|
+
- `Orphan-custom` if custom exists but registry has no skill referencing it (surface as a warning).
|
|
19
|
+
- `Missing` if registry references a basename that has no default file (surface as a warning).
|
|
20
|
+
|
|
21
|
+
### Step 3: Display Inventory and Wait for Action
|
|
22
|
+
- Render the inventory as a numbered table:
|
|
23
|
+
|
|
24
|
+
```markdown
|
|
25
|
+
| # | Template | Skill(s) | Status |
|
|
26
|
+
|---|----------|----------|--------|
|
|
27
|
+
| 1 | analyze-output.md | mvt-analyze | Default |
|
|
28
|
+
| 2 | design-output.md | mvt-design | Customized |
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
- Below the table, list available actions: `view {#}`, `customize {#}`, `reset {#}`, `export {#} [path]`.
|
|
32
|
+
- If any `Orphan-custom` or `Missing` rows exist, print a one-line warning above the table.
|
|
33
|
+
- Wait for user input. The `{#}` may be a number or the basename.
|
|
34
|
+
|
|
35
|
+
### Step 4: Dispatch Action
|
|
36
|
+
|
|
37
|
+
#### 4a. View
|
|
38
|
+
- **What**: show the active version of the template.
|
|
39
|
+
- **How**:
|
|
40
|
+
1. If `Customized`, read the custom file. Otherwise read the default.
|
|
41
|
+
2. Print the file content in a fenced code block, prefixed by a single line: `Showing: <default|custom> -- <path>`.
|
|
42
|
+
3. No write.
|
|
43
|
+
|
|
44
|
+
#### 4b. Customize
|
|
45
|
+
- **What**: create or update the custom override; preserve a structure the assembler can still consume.
|
|
46
|
+
- **How** (4-step subflow):
|
|
47
|
+
1. **Show baseline**: print the current active version (custom if exists, otherwise default).
|
|
48
|
+
2. **Collect modifications from the user**: ask for one of these explicit input forms (do not improvise):
|
|
49
|
+
- "replace section `<heading>` with: ..."
|
|
50
|
+
- "add section `<heading>` after `<existing-heading>`: ..."
|
|
51
|
+
- "remove section `<heading>`"
|
|
52
|
+
- "edit frontmatter field `<key>` to `<value>`"
|
|
53
|
+
- "free-form patch: <unified diff>"
|
|
54
|
+
3. **Preview**: render the resulting file (full content) and a diff against the baseline. Do NOT write yet.
|
|
55
|
+
4. **Validate** (mandatory before write):
|
|
56
|
+
- Frontmatter block (`---\n...\n---`) must be present and parseable.
|
|
57
|
+
- Required frontmatter keys (`id`, `version`, `skill` if originally present) must be retained.
|
|
58
|
+
- All Mustache placeholders that were present in the default and that the assembler relies on (`{{...}}`, `{{#...}}`, `{{?...}}`, `{{^...}}`) must still be present unless the user explicitly removed them; warn if removed.
|
|
59
|
+
- Validation failures -> abort write, surface the failed checks, return to step 2 of this subflow.
|
|
60
|
+
5. **Confirm and write**: prompt `Save customized template to .ai-agents/skills/_templates/custom/<name>? (y/n)`. On `y`, write atomically (temp + rename). Backup any existing custom file as `<name>.bak` first.
|
|
61
|
+
|
|
62
|
+
#### 4c. Reset
|
|
63
|
+
- **What**: revert to the default template.
|
|
64
|
+
- **How**:
|
|
65
|
+
1. If no custom file exists, report "Already default, nothing to reset" and stop.
|
|
66
|
+
2. Show a one-line summary of what will be deleted (`<path>`, last modified date).
|
|
67
|
+
3. Require explicit confirmation: `Delete custom override <name>? (y/n)`.
|
|
68
|
+
4. On `y`, delete the file. Do NOT keep a backup -- user must use git for recovery.
|
|
69
|
+
5. Report success and the new status (`Default`).
|
|
70
|
+
|
|
71
|
+
#### 4d. Export
|
|
72
|
+
- **What**: emit the template content to a destination chosen by the user.
|
|
73
|
+
- **How**:
|
|
74
|
+
1. Determine source: custom version if exists, otherwise default. Print which one is being exported.
|
|
75
|
+
2. Determine destination using the table:
|
|
76
|
+
|
|
77
|
+
| User input | Destination |
|
|
78
|
+
|------------|-------------|
|
|
79
|
+
| No path given | Print the content as a fenced code block in chat |
|
|
80
|
+
| Relative or absolute file path | Write to that path; if file exists, ask for confirmation before overwriting |
|
|
81
|
+
| Literal string `custom` | Copy default to `.ai-agents/skills/_templates/custom/<name>` (use as starting point for customization) |
|
|
82
|
+
|
|
83
|
+
3. Never write outside the project root unless an absolute path was explicitly provided by the user.
|
|
84
|
+
|
|
85
|
+
### Step 5: (session update handled by shared section)
|
|
86
|
+
|
|
87
|
+
## Edge Cases & Errors
|
|
88
|
+
|
|
89
|
+
| Case | Handling |
|
|
90
|
+
|------|----------|
|
|
91
|
+
| User selects a `#` that doesn't exist in inventory | Re-display the table, ask again |
|
|
92
|
+
| `customize` validation fails repeatedly | After two failed attempts, suggest user export to a file and edit manually, then re-import via `customize` with `free-form patch` |
|
|
93
|
+
| Custom file exists but registry no longer references the template (`Orphan-custom`) | Allow `view` and `reset`; refuse `customize` (stale target); recommend running `/mvt-init --refresh` or removing the file manually |
|
|
94
|
+
| Default file is missing (`Missing`) | Refuse all actions for that row; suggest reinstall (`mvtt install`) |
|
|
95
|
+
| User aborts at any confirmation prompt | Do not modify any file; report "no changes" |
|
|
96
|
+
| External process modified the file between preview and write | Detect via mtime check just before write; abort and re-run preview |
|
|
@@ -3,7 +3,7 @@ output: .claude/skills/mvt-template/SKILL.md
|
|
|
3
3
|
|
|
4
4
|
frontmatter:
|
|
5
5
|
name: mvt-template
|
|
6
|
-
description: "View, customize, and manage output templates for MVTT skills.
|
|
6
|
+
description: "View, customize, and manage output templates for MVTT skills. This skill should be used when user wants to inspect available templates, create custom template versions, reset customizations, or export templates."
|
|
7
7
|
|
|
8
8
|
sections:
|
|
9
9
|
- type: inline
|
|
@@ -12,7 +12,7 @@ sections:
|
|
|
12
12
|
|
|
13
13
|
## Purpose
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
View, customize, and manage MVTT output templates. Inspect default templates, create custom versions that override defaults, reset customizations, and export templates.
|
|
16
16
|
|
|
17
17
|
- type: shared
|
|
18
18
|
source: sections/role-header.md
|
|
@@ -36,36 +36,28 @@ sections:
|
|
|
36
36
|
source: sections/activation-load-context.md
|
|
37
37
|
params:
|
|
38
38
|
extended_context:
|
|
39
|
-
- ".ai-agents/registry.yaml -- Template registry"
|
|
40
39
|
- "Scan `.ai-agents/skills/_templates/custom/` for existing customizations"
|
|
41
40
|
|
|
42
41
|
- type: shared
|
|
43
42
|
source: sections/activation-load-config.md
|
|
44
43
|
|
|
44
|
+
- type: shared
|
|
45
|
+
source: sections/output-language-constraint.md
|
|
46
|
+
|
|
45
47
|
- type: inline
|
|
46
48
|
content: |
|
|
47
49
|
### Step 3: Pre-flight Checks
|
|
48
50
|
- No blocking checks required.
|
|
49
51
|
|
|
50
|
-
### Step 4: Execute
|
|
51
|
-
Proceed to Execution Flow below.
|
|
52
|
-
|
|
53
52
|
- type: file
|
|
54
53
|
source: ./business.md
|
|
55
54
|
|
|
56
|
-
- type:
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
No external template -- output is inline based on the action:
|
|
61
|
-
|
|
62
|
-
```markdown
|
|
63
|
-
## Template Manager
|
|
64
|
-
|
|
65
|
-
{Action-specific content}
|
|
55
|
+
- type: shared
|
|
56
|
+
source: sections/session-update.md
|
|
57
|
+
params:
|
|
58
|
+
read_only: true
|
|
66
59
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
```
|
|
60
|
+
- type: shared
|
|
61
|
+
source: sections/footer-next-steps.md
|
|
62
|
+
params:
|
|
63
|
+
current_skill: mvt-template
|
|
@@ -1,36 +1,104 @@
|
|
|
1
|
-
## Execution Flow
|
|
2
|
-
|
|
3
|
-
### Step 1: Load
|
|
4
|
-
-
|
|
5
|
-
-
|
|
6
|
-
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
-
|
|
24
|
-
|
|
25
|
-
### Step
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
1
|
+
## Execution Flow
|
|
2
|
+
|
|
3
|
+
### Step 1: Load Inputs
|
|
4
|
+
- **Required**:
|
|
5
|
+
- The implementation files to test (see Step 2 for resolution).
|
|
6
|
+
- **Recommended**:
|
|
7
|
+
- Existing tests near the target files -- to follow conventions and avoid duplication.
|
|
8
|
+
- **Fallback**:
|
|
9
|
+
- If test framework is unspecified in `project-context.yaml`, infer from package manifests (jest/vitest/pytest/junit/...) and ask user to confirm before generating tests.
|
|
10
|
+
- If `project-context.md` business rules are missing, derive scenarios solely from code and design; mark coverage analysis as "rule-mapping unavailable".
|
|
11
|
+
|
|
12
|
+
### Step 2: Resolve Test Target
|
|
13
|
+
- **What**: produce the file list under test.
|
|
14
|
+
- **How**: pick the FIRST source that yields a non-empty list.
|
|
15
|
+
|
|
16
|
+
| Source | Condition |
|
|
17
|
+
|--------|-----------|
|
|
18
|
+
| User-provided feature/file argument (`/mvt-test {feature}`) | Argument present |
|
|
19
|
+
| `implementation.md` -> `Files Touched` | Active change has implementation artifact |
|
|
20
|
+
| `git diff --name-only main...HEAD` filtered to source dirs | Inside a feature branch |
|
|
21
|
+
| Recently modified source files | Last-resort, last 24h mtime |
|
|
22
|
+
|
|
23
|
+
- For each target file, locate or plan its corresponding test file path using the project's test layout convention (mirror under `tests/`, sibling `*.test.ts`, etc.).
|
|
24
|
+
|
|
25
|
+
### Step 3: Identify Test Scenarios
|
|
26
|
+
- **What**: produce a Scenario Table covering happy path, edge, negative, and security cases.
|
|
27
|
+
- **How**:
|
|
28
|
+
1. For each public function / endpoint in scope, list at least: 1 happy path, 1 boundary, 1 invalid input.
|
|
29
|
+
2. For each business rule from `project-context.md` that this code implements, list at least 1 scenario asserting the rule.
|
|
30
|
+
3. For each error path declared in `design.md` data flow, list at least 1 scenario.
|
|
31
|
+
4. Consult the Test Case Types table (provided in shared section above):
|
|
32
|
+
- Happy Path / Edge / Negative -> always include if applicable.
|
|
33
|
+
- Security -> include only when requirements mention auth, data sensitivity, or external input boundaries.
|
|
34
|
+
- Performance -> include only when requirements explicitly state SLAs.
|
|
35
|
+
|
|
36
|
+
### Step 4: Choose Test Granularity
|
|
37
|
+
- **What**: assign each scenario to unit / integration / E2E.
|
|
38
|
+
- **How**: use the rule below; one scenario maps to one granularity.
|
|
39
|
+
|
|
40
|
+
| Granularity | Use when |
|
|
41
|
+
|-------------|----------|
|
|
42
|
+
| Unit | Pure logic, single class/function, no IO, deterministic |
|
|
43
|
+
| Integration | Crosses a system boundary (DB, HTTP, queue, file system); module collaboration without UI |
|
|
44
|
+
| E2E | User-visible flow that traverses multiple services or includes UI interaction |
|
|
45
|
+
|
|
46
|
+
- A single scenario should not be tested at multiple granularities unless explicitly required (avoid wasteful duplication).
|
|
47
|
+
- Flag scenarios that need integration but the project lacks an integration test setup -> note in artifact, suggest setup, do not invent a fixture.
|
|
48
|
+
|
|
49
|
+
### Step 5: Design Test Cases
|
|
50
|
+
- **What**: turn each scenario into a concrete test case row.
|
|
51
|
+
- **How**: each row must include `id | scenario | granularity | preconditions | inputs | actions | expected | rule-traced-to`.
|
|
52
|
+
- Prioritize: every business rule trace must be present; happy paths first, then edges, then negatives, then security/performance.
|
|
53
|
+
- For external dependencies, decide mock/stub/fake per project conventions; document the choice.
|
|
54
|
+
|
|
55
|
+
### Step 6: Write Test Code
|
|
56
|
+
- **What**: emit test files using project conventions.
|
|
57
|
+
- **How**:
|
|
58
|
+
1. Match the project's existing test framework, file layout, and naming.
|
|
59
|
+
2. Test names describe the scenario in business language ("rejects login when password is expired"), not the function name.
|
|
60
|
+
3. Each test follows arrange / act / assert structure with no hidden setup.
|
|
61
|
+
4. Use mocks/stubs only at boundaries identified in Step 4; do NOT mock the unit under test.
|
|
62
|
+
5. Do not modify the production code being tested -- if implementation has a bug, surface it (Step 8) and recommend `/mvt-fix`.
|
|
63
|
+
6. Avoid `skip` / `only` / commented-out tests in the final output.
|
|
64
|
+
|
|
65
|
+
### Step 7: Coverage Analysis (only when `--coverage` flag set)
|
|
66
|
+
- **What**: produce a coverage map and gap list.
|
|
67
|
+
- **How**:
|
|
68
|
+
1. Map each test case (Step 5) back to: a target file/function, and (if available) a business rule from `project-context.md`.
|
|
69
|
+
2. Identify gaps: target functions with no test, business rules with no test, error paths from `design.md` with no test.
|
|
70
|
+
3. Read coverage thresholds from `.ai-agents/config.yaml` if present; otherwise default targets: line >= 80%, branch >= 70%, business-rule == 100%.
|
|
71
|
+
4. Recommend additional test cases for each gap; do not auto-generate them in this run unless user confirms.
|
|
72
|
+
|
|
73
|
+
### Step 8: Surface Implementation Issues (if any)
|
|
74
|
+
- During scenario design or test writing you may discover the implementation is wrong (failing test reveals a real bug, not a test bug).
|
|
75
|
+
- **Do not** modify production code from this skill.
|
|
76
|
+
- Record each finding with: scenario id, expected vs observed, severity (Critical / Warning), and recommend `/mvt-fix`.
|
|
77
|
+
|
|
78
|
+
### Step 9: Write Artifact
|
|
79
|
+
- **Path**: `.ai-agents/workspace/artifacts/{active_change.id}/tests/test-design.md`.
|
|
80
|
+
- **Template**: `.ai-agents/skills/_templates/test-output.md` (custom override at `_templates/custom/...` takes precedence).
|
|
81
|
+
- **Required content** (mapped to template headings):
|
|
82
|
+
- `Scope` -- target files, fallbacks applied.
|
|
83
|
+
- `Test Framework & Layout` -- chosen framework, file layout convention.
|
|
84
|
+
- `Test Scenarios` -- the Scenario Table from Step 3.
|
|
85
|
+
- `Test Cases` -- the row-level table from Step 5.
|
|
86
|
+
- `Granularity Decisions` -- summary from Step 4, including any "needs setup" gaps.
|
|
87
|
+
- `Coverage Analysis` -- only when `--coverage`; otherwise omit the heading.
|
|
88
|
+
- `Implementation Issues Found` -- from Step 8; empty list is fine.
|
|
89
|
+
- `Suggested Run Commands` -- one or two commands the user can copy-paste.
|
|
90
|
+
- The actual test files go to the project tree; the artifact is a record.
|
|
91
|
+
|
|
92
|
+
### Step 10: (session update handled by shared section)
|
|
93
|
+
|
|
94
|
+
## Edge Cases & Errors
|
|
95
|
+
|
|
96
|
+
| Case | Handling |
|
|
97
|
+
|------|----------|
|
|
98
|
+
| Test framework unsupported by environment (e.g., language has no widely-used framework) | STOP, report, ask user for guidance; do not improvise a custom harness |
|
|
99
|
+
| Implementation files have zero public API (purely internal) | Cap at integration-level scenarios; do not test private symbols |
|
|
100
|
+
| Existing tests for the target are present and conflict with new scenarios | Surface the conflict in `Implementation Issues Found`; do not silently delete or rewrite existing tests |
|
|
101
|
+
| External services required and not mockable (e.g., real LLM call) | Use recorded fixtures if conventional; otherwise mark scenarios as `requires-live-service` and skip code generation |
|
|
102
|
+
| Flaky test detected during writing | Add deterministic seeding/clock; if not possible, mark as `flaky-suspected` and surface in artifact |
|
|
103
|
+
| User asks to "skip edge cases" | Refuse: edge cases are a non-negotiable boundary of this skill; explain and continue |
|
|
104
|
+
| `--coverage` set but coverage tool not configured in project | Generate the gap list from scenarios alone; suggest tool setup; do not invoke a non-existent coverage runner |
|
|
@@ -3,7 +3,7 @@ output: .claude/skills/mvt-test/SKILL.md
|
|
|
3
3
|
|
|
4
4
|
frontmatter:
|
|
5
5
|
name: mvt-test
|
|
6
|
-
description: "Generate and design tests to validate implementations.
|
|
6
|
+
description: "Generate and design tests to validate implementations. This skill should be used when user wants to write tests, validate code, generate test cases, or analyze test coverage."
|
|
7
7
|
|
|
8
8
|
sections:
|
|
9
9
|
- type: inline
|
|
@@ -12,7 +12,7 @@ sections:
|
|
|
12
12
|
|
|
13
13
|
## Purpose
|
|
14
14
|
|
|
15
|
-
Design and write tests to validate implementations against requirements. Ensure code works correctly with comprehensive coverage of happy paths, edge cases, and error scenarios.
|
|
15
|
+
Design and write tests to validate implementations against requirements and business rules. Ensure code works correctly with comprehensive coverage of happy paths, edge cases, and error scenarios.
|
|
16
16
|
|
|
17
17
|
- type: shared
|
|
18
18
|
source: sections/role-header.md
|
|
@@ -49,14 +49,14 @@ sections:
|
|
|
49
49
|
source: sections/activation-load-context.md
|
|
50
50
|
params:
|
|
51
51
|
extended_context:
|
|
52
|
-
- ".ai-agents/knowledge/core/review-principles.md -- Code quality principles"
|
|
53
|
-
- ".ai-agents/knowledge/patterns/{pattern.active}/ -- Active pattern knowledge"
|
|
54
|
-
- ".ai-agents/knowledge/principle/coding-standards.md -- Project coding standards"
|
|
55
52
|
- "Implementation files to be tested"
|
|
56
53
|
|
|
57
54
|
- type: shared
|
|
58
55
|
source: sections/activation-load-config.md
|
|
59
56
|
|
|
57
|
+
- type: shared
|
|
58
|
+
source: sections/output-language-constraint.md
|
|
59
|
+
|
|
60
60
|
- type: shared
|
|
61
61
|
source: sections/activation-preflight.md
|
|
62
62
|
params:
|
|
@@ -64,21 +64,14 @@ sections:
|
|
|
64
64
|
- order: "1"
|
|
65
65
|
field: "session.initialized_at"
|
|
66
66
|
level: "WARN"
|
|
67
|
-
message:
|
|
67
|
+
message: "Session not initialized. Run `/mvt-init` first."
|
|
68
68
|
- order: "2"
|
|
69
69
|
field: "no implementation files"
|
|
70
70
|
level: "WARN"
|
|
71
|
-
message:
|
|
72
|
-
- order: "3"
|
|
73
|
-
field: "pattern.active"
|
|
74
|
-
level: "WARN"
|
|
75
|
-
message: 'Architecture pattern not set. Suggest `/mvt-init`." (allow user to proceed)'
|
|
71
|
+
message: "No implementation found. Run `/mvt-implement` first."
|
|
76
72
|
|
|
77
73
|
- type: inline
|
|
78
74
|
content: |
|
|
79
|
-
### Step 4: Execute
|
|
80
|
-
Proceed to Execution Flow below.
|
|
81
|
-
|
|
82
75
|
## Test Case Types
|
|
83
76
|
|
|
84
77
|
| Type | Description | Priority |
|
|
@@ -94,18 +87,16 @@ sections:
|
|
|
94
87
|
|
|
95
88
|
- type: inline
|
|
96
89
|
content: |
|
|
97
|
-
##
|
|
98
|
-
|
|
99
|
-
Read and use the output template from: `.ai-agents/skills/_templates/test-output.md`
|
|
100
|
-
|
|
90
|
+
## Artifact Structure
|
|
91
|
+
Read the document structure template from: `.ai-agents/skills/_templates/test-output.md`
|
|
101
92
|
If a custom version exists at `.ai-agents/skills/_templates/custom/test-output.md`, use the custom version instead.
|
|
93
|
+
The template defines section headings only. Generate content for each section based on test design results.
|
|
94
|
+
Write the artifact to: `.ai-agents/workspace/artifacts/{change-id}/tests/test-design.md`
|
|
102
95
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
Every response MUST end with a Suggested Next Steps section.
|
|
96
|
+
- type: shared
|
|
97
|
+
source: sections/session-update.md
|
|
106
98
|
|
|
107
99
|
- type: shared
|
|
108
100
|
source: sections/footer-next-steps.md
|
|
109
101
|
params:
|
|
110
|
-
|
|
111
|
-
next_primary_desc: "Run tests with the appropriate command; if tests fail, use this"
|
|
102
|
+
current_skill: mvt-test
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
## Execution Flow
|
|
2
|
+
|
|
3
|
+
### Step 1: Resolve Target
|
|
4
|
+
|
|
5
|
+
Required inputs:
|
|
6
|
+
|
|
7
|
+
- **task_id** -- which task to update
|
|
8
|
+
- **new_status** -- one of: `pending`, `in_progress`, `done`, `blocked`, `skipped`
|
|
9
|
+
- **artifacts** (optional, comma-separated paths) -- files produced or touched
|
|
10
|
+
- **notes** (optional) -- free-form note string
|
|
11
|
+
|
|
12
|
+
Resolution rules:
|
|
13
|
+
|
|
14
|
+
- If `task_id` is omitted AND exactly one task currently has status `in_progress` -> default to that task.
|
|
15
|
+
- If `task_id` is omitted AND zero or multiple tasks are in_progress -> ask the user to specify.
|
|
16
|
+
- If the user reply is the natural-language form `done` / `blocked: <reason>` (from a workflow skill's soft-prompt) -> map to:
|
|
17
|
+
- `done` -> task = plan.current_task, new_status = done
|
|
18
|
+
- `blocked: <reason>` -> task = plan.current_task, new_status = blocked, notes = `<reason>`
|
|
19
|
+
|
|
20
|
+
### Step 2: Load and Validate Existing Plan
|
|
21
|
+
|
|
22
|
+
1. Read `active_change.plan_path` (the file location is fixed by `/mvt-plan-dev`).
|
|
23
|
+
2. Parse YAML; if parse fails or schema is invalid -> stop and report. Do not attempt to repair silently.
|
|
24
|
+
3. Verify the target `task_id` exists in `tasks[]`. If not, list valid ids and stop.
|
|
25
|
+
|
|
26
|
+
### Step 3: Apply the Update
|
|
27
|
+
|
|
28
|
+
Mutate the in-memory plan:
|
|
29
|
+
|
|
30
|
+
1. Find the target task; capture `old_status` for the report.
|
|
31
|
+
2. Set `tasks[i].status = new_status`.
|
|
32
|
+
3. If `artifacts` provided -> append to `tasks[i].artifacts` (de-duplicate).
|
|
33
|
+
4. If `notes` provided -> overwrite `tasks[i].notes`.
|
|
34
|
+
5. Update `plan.updated_at` to current ISO 8601 timestamp.
|
|
35
|
+
|
|
36
|
+
### Step 4: Recompute current_task
|
|
37
|
+
|
|
38
|
+
Selection logic, in order:
|
|
39
|
+
|
|
40
|
+
1. If any task has status `in_progress` AND it is **not** the task we just changed to a terminal status (done/blocked/skipped) -> `current_task` = that task's id.
|
|
41
|
+
2. Otherwise pick the first task (by array order) where:
|
|
42
|
+
- `status == pending`
|
|
43
|
+
- All ids in `depends_on` reference tasks with status `done`
|
|
44
|
+
3. If no such task exists AND every task is `done` -> set `plan.status = done`, `current_task = null`.
|
|
45
|
+
4. If no such task exists but some tasks are still `pending` (because their dependencies are not done -- e.g., everything reachable is blocked) -> set `current_task = null`, leave `plan.status = in_progress`. Surface a warning in the output ("All remaining tasks are blocked by dependencies; resolve a blocker before continuing").
|
|
46
|
+
|
|
47
|
+
If the selected next task is currently `pending` -> promote it to `in_progress` (so the plan accurately reflects the active focus). Skip this promotion if `plan.status` just transitioned to `done`.
|
|
48
|
+
|
|
49
|
+
### Step 5: Validate and Write
|
|
50
|
+
|
|
51
|
+
1. Run the plan validator on the mutated structure.
|
|
52
|
+
2. If validation fails -> abort the write, report the validation errors, leave the original file untouched.
|
|
53
|
+
3. Otherwise, write back to `active_change.plan_path`.
|
|
54
|
+
|
|
55
|
+
### Step 6: Update Session State
|
|
56
|
+
|
|
57
|
+
Apply the standard State Update rules (see shared section above) AND the update-plan-specific updates:
|
|
58
|
+
|
|
59
|
+
- Refresh the matching entry in `recent_changes[]`: `last_updated` -> current ISO 8601 timestamp.
|
|
60
|
+
- Do NOT touch `active_change.has_plan` / `active_change.plan_path`.
|
|
61
|
+
|
|
62
|
+
### Step 7: Output
|
|
63
|
+
|
|
64
|
+
Emit the Plan Update summary block defined in the Output Format section. Include:
|
|
65
|
+
|
|
66
|
+
- The task that changed (id, title, old -> new status).
|
|
67
|
+
- A compact table of all tasks with their current status.
|
|
68
|
+
- The new `current_task` (or "(plan complete)" if `plan.status == done`).
|
|
69
|
+
- A one-line "Next" hint:
|
|
70
|
+
- If a new `current_task` is set -> recommend the skill matching its `skill_hint`.
|
|
71
|
+
- If plan complete -> recommend `/mvt-cleanup` or starting a new change via `/mvt-analyze`.
|
|
72
|
+
- If all remaining tasks are blocked -> recommend resolving the blocker (point at the `notes` of the blocked task).
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
name: mvt-update-plan
|
|
2
|
+
output: .claude/skills/mvt-update-plan/SKILL.md
|
|
3
|
+
|
|
4
|
+
frontmatter:
|
|
5
|
+
name: mvt-update-plan
|
|
6
|
+
description: "Update a single task in the active change's plan.yaml: change status, attach artifacts, leave notes, and auto-advance current_task. This skill should be used after a workflow skill finishes work that maps to a plan task, or whenever the user wants to mark a task as done, blocked, or skipped."
|
|
7
|
+
|
|
8
|
+
sections:
|
|
9
|
+
- type: inline
|
|
10
|
+
content: |
|
|
11
|
+
# MVT Update Plan
|
|
12
|
+
|
|
13
|
+
## Purpose
|
|
14
|
+
|
|
15
|
+
Apply incremental updates to the active plan.yaml: mark a task done/blocked/skipped, attach the artifacts produced, and let the skill auto-advance `current_task` to the next executable task. AI may invoke this skill on the user's behalf when the user replies to a soft-prompt with `done` / `blocked: <reason>`.
|
|
16
|
+
|
|
17
|
+
- type: shared
|
|
18
|
+
source: sections/role-header.md
|
|
19
|
+
params:
|
|
20
|
+
role: Architect
|
|
21
|
+
role_desc: "a Development Planner"
|
|
22
|
+
decision_rules:
|
|
23
|
+
- rule: "Task id provided AND target status valid -> Apply update, advance current_task, write back"
|
|
24
|
+
- rule: "Task id missing AND only one task is in_progress -> Default to that task"
|
|
25
|
+
- rule: "Target status would create an invalid current_task -> Recompute current_task automatically"
|
|
26
|
+
- rule: "All tasks become done -> Set plan.status = done, current_task = null"
|
|
27
|
+
- rule: "active_change.has_plan is false -> Stop and suggest /mvt-plan-dev"
|
|
28
|
+
|
|
29
|
+
boundaries:
|
|
30
|
+
- scope: "create new tasks or restructure the plan"
|
|
31
|
+
skill: "/mvt-plan-dev"
|
|
32
|
+
- scope: "create or modify the active change itself"
|
|
33
|
+
skill: "/mvt-analyze"
|
|
34
|
+
- scope: "implement code"
|
|
35
|
+
skill: "/mvt-implement"
|
|
36
|
+
|
|
37
|
+
- type: shared
|
|
38
|
+
source: sections/activation-load-context.md
|
|
39
|
+
params:
|
|
40
|
+
extended_context:
|
|
41
|
+
- "{active_change.plan_path} -- The plan to update (resolved from session.yaml)"
|
|
42
|
+
|
|
43
|
+
- type: shared
|
|
44
|
+
source: sections/activation-load-config.md
|
|
45
|
+
|
|
46
|
+
- type: shared
|
|
47
|
+
source: sections/output-language-constraint.md
|
|
48
|
+
|
|
49
|
+
- type: shared
|
|
50
|
+
source: sections/activation-preflight.md
|
|
51
|
+
params:
|
|
52
|
+
checks:
|
|
53
|
+
- order: "1"
|
|
54
|
+
field: "session.initialized_at"
|
|
55
|
+
level: "WARN"
|
|
56
|
+
message: 'Session not initialized. Run `/mvt-init` first.'
|
|
57
|
+
- order: "2"
|
|
58
|
+
field: "active_change.has_plan"
|
|
59
|
+
level: "BLOCK"
|
|
60
|
+
message: 'No active plan. Run `/mvt-plan-dev` to create one before updating.'
|
|
61
|
+
|
|
62
|
+
- type: inline
|
|
63
|
+
content: |
|
|
64
|
+
### Shortcut Operation Rules
|
|
65
|
+
- Can execute at any time when an active plan exists
|
|
66
|
+
- Performs surgical edits only -- never overwrites the whole plan structure
|
|
67
|
+
- Re-validates the resulting plan before writing; aborts on validation failure
|
|
68
|
+
|
|
69
|
+
- type: file
|
|
70
|
+
source: ./business.md
|
|
71
|
+
|
|
72
|
+
- type: inline
|
|
73
|
+
content: |
|
|
74
|
+
## Output Format
|
|
75
|
+
|
|
76
|
+
Render an inline summary (no external template). Structure:
|
|
77
|
+
|
|
78
|
+
```markdown
|
|
79
|
+
## Plan Update
|
|
80
|
+
|
|
81
|
+
### Change Applied
|
|
82
|
+
- **Task**: {task_id} -- {task_title}
|
|
83
|
+
- **Status**: {old_status} -> {new_status}
|
|
84
|
+
- **Artifacts attached**: {comma_separated_list_or_"(none)"}
|
|
85
|
+
- **Notes**: {notes_or_"(unchanged)"}
|
|
86
|
+
|
|
87
|
+
### Plan Progress
|
|
88
|
+
| # | id | title | status |
|
|
89
|
+
|---|----|----|--------|
|
|
90
|
+
| ... |
|
|
91
|
+
|
|
92
|
+
Progress: {done_count}/{total_count}
|
|
93
|
+
Current task: {new_current_task_id_or_"(plan complete)"}
|
|
94
|
+
|
|
95
|
+
### Next
|
|
96
|
+
{one-line guidance: continue to next task, resolve blocker, or run /mvt-cleanup}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Every response MUST end with a Suggested Next Steps section.
|
|
100
|
+
|
|
101
|
+
- type: shared
|
|
102
|
+
source: sections/session-update.md
|
|
103
|
+
|
|
104
|
+
- type: inline
|
|
105
|
+
content: |
|
|
106
|
+
### Update-Plan Specific State Updates
|
|
107
|
+
|
|
108
|
+
In addition to the mandatory updates above, this skill MUST refresh `recent_changes` for the active change:
|
|
109
|
+
|
|
110
|
+
- Find the entry where `id == active_change.id`. If absent, append one (this should be rare; happens when the plan was created out-of-band).
|
|
111
|
+
- Set `last_updated` to the current ISO 8601 timestamp.
|
|
112
|
+
- Trim to max 5 entries (drop the oldest by `last_updated` ascending).
|
|
113
|
+
|
|
114
|
+
Do NOT modify `active_change.has_plan` or `active_change.plan_path` here -- those are owned by `/mvt-plan-dev`.
|
|
115
|
+
|
|
116
|
+
- type: shared
|
|
117
|
+
source: sections/footer-next-steps.md
|
|
118
|
+
params:
|
|
119
|
+
current_skill: mvt-update-plan
|
|
120
|
+
conditional_suggestions:
|
|
121
|
+
conditions:
|
|
122
|
+
- condition: "plan_done"
|
|
123
|
+
primary: mvt-cleanup
|
|
124
|
+
primary_desc: "All tasks complete -- clean up artifacts and prepare to start the next change"
|
|
125
|
+
- condition: "default"
|
|
126
|
+
primary: mvt-implement
|
|
127
|
+
primary_desc: "Continue with the next current_task"
|
|
128
|
+
alternatives:
|
|
129
|
+
- skill: mvt-resume
|
|
130
|
+
desc: "Refresh context after task transitions"
|
|
131
|
+
- skill: mvt-status
|
|
132
|
+
desc: "Inspect overall progress across changes"
|