mindsystem-cc 3.13.0 → 3.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/agents/ms-mock-generator.md +51 -138
- package/commands/ms/design-phase.md +6 -2
- package/commands/ms/verify-work.md +11 -18
- package/mindsystem/references/mock-patterns.md +149 -240
- package/mindsystem/templates/UAT.md +1 -275
- package/mindsystem/workflows/mockup-generation.md +1 -1
- package/mindsystem/workflows/verify-work.md +71 -298
- package/package.json +1 -1
- package/skills/flutter-code-quality/SKILL.md +1 -1
- package/skills/flutter-code-simplification/SKILL.md +1 -1
- package/skills/flutter-senior-review/SKILL.md +1 -1
- package/mindsystem/workflows/generate-mocks.md +0 -261
package/LICENSE
CHANGED
|
@@ -1,182 +1,95 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ms-mock-generator
|
|
3
|
-
description: Generates
|
|
3
|
+
description: Generates inline mock edits in batch for UAT testing. Spawned by verify-work when 5+ mocks needed.
|
|
4
4
|
model: sonnet
|
|
5
5
|
tools: Read, Write, Edit, Bash, Grep, Glob
|
|
6
6
|
color: cyan
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
<role>
|
|
10
|
-
You are a Mindsystem mock generator. You
|
|
10
|
+
You are a Mindsystem batch mock generator. You edit service/repository methods inline to hardcode return values for manual UAT testing.
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
Spawned by `/ms:verify-work` when a batch requires 5+ mocks — too many for main context to handle efficiently.
|
|
13
13
|
|
|
14
|
-
Your job:
|
|
14
|
+
Your job: Read each service method, edit it to return hardcoded values before the real implementation, and report what was changed.
|
|
15
15
|
</role>
|
|
16
16
|
|
|
17
17
|
<context_you_receive>
|
|
18
|
-
Your prompt
|
|
18
|
+
Your prompt includes:
|
|
19
19
|
|
|
20
|
-
- **
|
|
21
|
-
- **Tests requiring this mock**: List of tests with their expected behaviors
|
|
20
|
+
- **Tests requiring mocks**: List with mock_type and expected behavior for each
|
|
22
21
|
- **Phase info**: Current phase being tested
|
|
22
|
+
- **Mocked files so far**: Files already edited in previous batches (avoid conflicts)
|
|
23
23
|
</context_you_receive>
|
|
24
24
|
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
cat .planning/PROJECT.md 2>/dev/null | head -50
|
|
29
|
-
```
|
|
25
|
+
<references>
|
|
26
|
+
@~/.claude/mindsystem/references/mock-patterns.md
|
|
27
|
+
</references>
|
|
30
28
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
**2. Verify with config files**
|
|
34
|
-
```bash
|
|
35
|
-
# Flutter/Dart
|
|
36
|
-
ls pubspec.yaml 2>/dev/null
|
|
29
|
+
<process>
|
|
37
30
|
|
|
38
|
-
|
|
39
|
-
ls package.json 2>/dev/null && grep -E '"react"|"next"' package.json
|
|
40
|
-
|
|
41
|
-
# React Native
|
|
42
|
-
ls package.json 2>/dev/null && grep '"react-native"' package.json
|
|
43
|
-
|
|
44
|
-
# Vue
|
|
45
|
-
ls package.json 2>/dev/null && grep '"vue"' package.json
|
|
46
|
-
```
|
|
31
|
+
**1. Identify service methods**
|
|
47
32
|
|
|
48
|
-
|
|
49
|
-
- Flutter: `pubspec.yaml` exists
|
|
50
|
-
- React/Next.js: `package.json` with react/next dependency
|
|
51
|
-
- React Native: `package.json` with react-native dependency
|
|
52
|
-
- Vue: `package.json` with vue dependency
|
|
53
|
-
- Other: Generate generic pattern with clear adaptation notes
|
|
54
|
-
</framework_detection>
|
|
33
|
+
For each test, identify the service/repository method that provides the data being tested. Use Grep to find fetch calls, API methods, or data access points related to the test's expected behavior.
|
|
55
34
|
|
|
56
|
-
|
|
57
|
-
**Philosophy:** Mocks are temporary scaffolding. They should:
|
|
58
|
-
- Be contained in as few files as possible (ideally 1 override file)
|
|
59
|
-
- Have minimal hooks in production code (single if-check)
|
|
60
|
-
- Be easy to completely remove (delete file + remove hooks)
|
|
35
|
+
**2. Read and edit each method**
|
|
61
36
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
1. **Create override file** - Single file with all mock flags and data
|
|
65
|
-
2. **Add minimal hooks** - If-check at service/repository layer
|
|
66
|
-
3. **Provide toggle instructions** - How to enable/disable each state
|
|
67
|
-
|
|
68
|
-
**Override file location conventions:**
|
|
69
|
-
- Flutter: `lib/test_overrides.dart`
|
|
70
|
-
- React/Next.js: `src/testOverrides.ts` or `lib/testOverrides.ts`
|
|
71
|
-
- React Native: `src/testOverrides.ts`
|
|
72
|
-
- Vue: `src/testOverrides.ts`
|
|
73
|
-
</mock_pattern>
|
|
74
|
-
|
|
75
|
-
<generation_process>
|
|
76
|
-
**1. Analyze tests to determine mock requirements**
|
|
77
|
-
|
|
78
|
-
For each test, identify:
|
|
79
|
-
- What state needs to be simulated
|
|
80
|
-
- What service/API call needs to be intercepted
|
|
81
|
-
- What data should be returned
|
|
82
|
-
|
|
83
|
-
**2. Create override file**
|
|
37
|
+
For each method, add a hardcoded return/throw BEFORE the real implementation:
|
|
84
38
|
|
|
85
39
|
```
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
# Flags
|
|
89
|
-
forcePremiumUser = false
|
|
90
|
-
forceErrorState = false
|
|
91
|
-
forceEmptyResponse = false
|
|
92
|
-
forceLoadingState = false
|
|
40
|
+
// MOCK: {description} — revert after UAT
|
|
41
|
+
{hardcoded return value or throw}
|
|
93
42
|
|
|
94
|
-
|
|
95
|
-
mockErrorMessage = "Simulated error for testing"
|
|
96
|
-
mockPremiumUserData = { ... }
|
|
97
|
-
|
|
98
|
-
# Reset function
|
|
99
|
-
resetAllOverrides() { ... }
|
|
43
|
+
// Real implementation below...
|
|
100
44
|
```
|
|
101
45
|
|
|
102
|
-
**
|
|
46
|
+
**Patterns by mock_type:**
|
|
103
47
|
|
|
104
|
-
|
|
105
|
-
|
|
48
|
+
| mock_type | Edit pattern |
|
|
49
|
+
|-----------|-------------|
|
|
50
|
+
| `error_state` | `throw Exception('{error message}');` before real call |
|
|
51
|
+
| `empty_response` | `return [];` or `return null;` before real call |
|
|
52
|
+
| `premium_user` | `return {hardcoded user object with premium fields};` |
|
|
53
|
+
| `external_data` | `return {hardcoded data matching expected schema};` |
|
|
54
|
+
| `loading_state` | `await {5s delay};` before real call |
|
|
55
|
+
| `transient_state` | Delay or never-resolve — read `mock-patterns.md` transient_state_patterns |
|
|
56
|
+
| `offline` | `throw {network error};` before real call |
|
|
106
57
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
if (testOverrides.forcePremiumUser) {
|
|
111
|
-
return testOverrides.mockPremiumUserData
|
|
112
|
-
}
|
|
113
|
-
// ... real implementation
|
|
114
|
-
}
|
|
115
|
-
```
|
|
58
|
+
**3. For transient_state mocks:** Read `mock-patterns.md` for delay injection and never-resolve strategies. Choose based on whether the test is verifying the transition or the loading UI appearance.
|
|
59
|
+
|
|
60
|
+
**4. Track all changes**
|
|
116
61
|
|
|
117
|
-
|
|
62
|
+
Maintain a list of every file edited and what was changed.
|
|
118
63
|
|
|
119
|
-
|
|
120
|
-
1. Which file to edit
|
|
121
|
-
2. Which flag to set
|
|
122
|
-
3. How to apply (hot reload, restart, etc.)
|
|
123
|
-
4. How to verify mock is active
|
|
124
|
-
</generation_process>
|
|
64
|
+
</process>
|
|
125
65
|
|
|
126
66
|
<return_format>
|
|
127
67
|
```markdown
|
|
128
|
-
##
|
|
129
|
-
|
|
130
|
-
**Framework detected:** {Flutter | React | etc.}
|
|
131
|
-
**Mock type:** {the mock_type requested}
|
|
132
|
-
|
|
133
|
-
### Files Created
|
|
134
|
-
|
|
135
|
-
**{path/to/override_file}**
|
|
136
|
-
- Purpose: Central mock control
|
|
137
|
-
- Flags: {list of flags added}
|
|
68
|
+
## Mocks Applied
|
|
138
69
|
|
|
139
|
-
### Files
|
|
70
|
+
### Files Edited
|
|
140
71
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
72
|
+
| File | Method | Mock Type | Change |
|
|
73
|
+
|------|--------|-----------|--------|
|
|
74
|
+
| `{path}` | `{methodName}` | {type} | {brief description} |
|
|
144
75
|
|
|
145
|
-
###
|
|
76
|
+
### Cleanup
|
|
146
77
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
4. Verify: {what user should see to confirm mock is active}
|
|
152
|
-
|
|
153
|
-
**To enable {mock_state_2}:**
|
|
154
|
-
...
|
|
155
|
-
|
|
156
|
-
### Reset
|
|
157
|
-
|
|
158
|
-
To disable all mocks:
|
|
159
|
-
1. Set all flags to `false` in `{override_file}`
|
|
160
|
-
2. {Hot reload / Restart}
|
|
78
|
+
To revert all mocks:
|
|
79
|
+
```bash
|
|
80
|
+
git checkout -- {space-separated list of files}
|
|
81
|
+
```
|
|
161
82
|
|
|
162
|
-
|
|
83
|
+
### Mocked Files List
|
|
84
|
+
{JSON array of file paths for UAT.md frontmatter}
|
|
163
85
|
```
|
|
164
86
|
</return_format>
|
|
165
87
|
|
|
166
88
|
<constraints>
|
|
167
|
-
-
|
|
168
|
-
-
|
|
169
|
-
-
|
|
170
|
-
-
|
|
171
|
-
-
|
|
172
|
-
-
|
|
89
|
+
- Edit existing methods only — do not create new files
|
|
90
|
+
- Add mock code BEFORE the real implementation (early return pattern)
|
|
91
|
+
- Mark every edit with `// MOCK: {description} — revert after UAT`
|
|
92
|
+
- Do not modify test files — this is for manual UAT, not automated tests
|
|
93
|
+
- Do not create override files or toggle flags — inline hardcoding only
|
|
94
|
+
- Keep mock data minimal but realistic enough for UI rendering
|
|
173
95
|
</constraints>
|
|
174
|
-
|
|
175
|
-
<success_criteria>
|
|
176
|
-
- [ ] Framework correctly detected
|
|
177
|
-
- [ ] Override file created with appropriate flags
|
|
178
|
-
- [ ] Minimal hooks added to production code (if needed)
|
|
179
|
-
- [ ] Clear toggle instructions for each mock state
|
|
180
|
-
- [ ] Reset instructions provided
|
|
181
|
-
- [ ] All files written to disk (not just returned as content)
|
|
182
|
-
</success_criteria>
|
|
@@ -109,7 +109,11 @@ If exists, extract:
|
|
|
109
109
|
|
|
110
110
|
**3c. Optional context — project UI skill:**
|
|
111
111
|
|
|
112
|
-
|
|
112
|
+
Scan the skills list in the most recent system-reminder for a skill whose description mentions UI patterns, components, design system, or implementation styling (e.g., "Flutter/Dart patterns", "React component library", "UI implementation patterns").
|
|
113
|
+
|
|
114
|
+
If a matching skill is found, invoke it: `Skill(skill: "skill-name")`. Extract aesthetic patterns (colors, components, spacing, typography) from the loaded content for the `<existing_aesthetic>` block passed to ms-designer.
|
|
115
|
+
|
|
116
|
+
If no matching skill is found, skip this step and note "No project UI skill found" in the `<existing_aesthetic>` block.
|
|
113
117
|
|
|
114
118
|
**3d. Optional context - codebase analysis:**
|
|
115
119
|
|
|
@@ -178,7 +182,7 @@ Follow mockup-generation workflow:
|
|
|
178
182
|
4. Present directions to user for approval/tweaking
|
|
179
183
|
5. Read platform template (mobile or web)
|
|
180
184
|
6. Spawn 3 x ms-mockup-designer agents in parallel
|
|
181
|
-
7.
|
|
185
|
+
7. Run comparison script (`compare_mockups.py`), open in browser, and present to user
|
|
182
186
|
8. Handle selection (single pick, combine, tweak, more variants, or skip)
|
|
183
187
|
9. Extract CSS specs from chosen variant into `<mockup_direction>` block
|
|
184
188
|
|
|
@@ -43,9 +43,9 @@ Phase: $ARGUMENTS (optional)
|
|
|
43
43
|
4. **Extract testable deliverables** from summaries
|
|
44
44
|
5. **Classify tests by mock requirements** — Use SUMMARY.md mock_hints when available; classify inline with keyword heuristics when absent. Confirm data availability with user before batching.
|
|
45
45
|
6. **Group into batches** — By mock type, max 4 per batch, no-mock tests first
|
|
46
|
-
- If any tests require mocks: Read `~/.claude/mindsystem/references/mock-patterns.md`
|
|
46
|
+
- If any tests require transient_state mocks: Read `~/.claude/mindsystem/references/mock-patterns.md` for delay strategies
|
|
47
47
|
7. **For each batch:**
|
|
48
|
-
- If mock needed:
|
|
48
|
+
- If mock needed: Apply inline mocks (1-4 direct edits, 5+ via ms-mock-generator subagent), tell user to hot reload
|
|
49
49
|
- Present tests via AskUserQuestion (Pass / Can't test / Skip / Other)
|
|
50
50
|
- Process results, update UAT.md
|
|
51
51
|
- **For each issue found:**
|
|
@@ -54,10 +54,10 @@ Phase: $ARGUMENTS (optional)
|
|
|
54
54
|
- If complex: Spawn ms-verify-fixer subagent
|
|
55
55
|
- 2 retries on failed re-test, then offer options
|
|
56
56
|
8. **On batch transition:**
|
|
57
|
-
- If new mock_type:
|
|
57
|
+
- If new mock_type: Revert old mocks (`git checkout -- <mocked_files>`), apply new ones
|
|
58
58
|
- If same mock_type: Keep mocks active
|
|
59
59
|
9. **On completion:**
|
|
60
|
-
-
|
|
60
|
+
- Revert all mocks (`git checkout -- <mocked_files>`)
|
|
61
61
|
- Generate UAT fixes patch
|
|
62
62
|
- Restore user's pre-existing work (if stashed)
|
|
63
63
|
- Commit UAT.md, present summary
|
|
@@ -77,23 +77,16 @@ Phase: $ARGUMENTS (optional)
|
|
|
77
77
|
- Don't run automated tests — this is manual user validation
|
|
78
78
|
- Don't skip investigation — always try 2-3 tool calls before escalating
|
|
79
79
|
- Don't fix complex issues inline — spawn fixer subagent for multi-file or architectural changes
|
|
80
|
-
- Don't commit mock code —
|
|
80
|
+
- Don't commit mock code — stash mocked files before fixing, restore after
|
|
81
81
|
- Don't re-present skipped tests — assumptions stand
|
|
82
82
|
</anti_patterns>
|
|
83
83
|
|
|
84
84
|
<success_criteria>
|
|
85
|
-
- [ ]
|
|
86
|
-
- [ ]
|
|
87
|
-
- [ ]
|
|
88
|
-
- [ ]
|
|
89
|
-
- [ ]
|
|
90
|
-
- [ ] Issues investigated with lightweight check first
|
|
91
|
-
- [ ] Simple issues fixed inline with proper commit message
|
|
92
|
-
- [ ] Complex issues escalated to fixer subagent
|
|
93
|
-
- [ ] Failed re-tests get 2 retries then options
|
|
94
|
-
- [ ] Stash conflicts auto-resolved to fix version
|
|
95
|
-
- [ ] Mocks discarded on completion
|
|
85
|
+
- [ ] Mocks stashed before fixing, restored after (git stash push/pop cycle)
|
|
86
|
+
- [ ] Stash conflicts auto-resolved to fix version (git checkout --theirs)
|
|
87
|
+
- [ ] Blocked tests re-presented after blocking issues resolved
|
|
88
|
+
- [ ] Failed re-tests get 2 retries then options (tracked via retry_count)
|
|
89
|
+
- [ ] All mocks reverted on completion (git checkout -- <mocked_files>)
|
|
96
90
|
- [ ] UAT fixes patch generated
|
|
97
|
-
- [ ] User's pre-existing work restored
|
|
98
|
-
- [ ] UAT.md committed with final summary
|
|
91
|
+
- [ ] User's pre-existing work restored from stash
|
|
99
92
|
</success_criteria>
|