mindsystem-cc 3.20.0 → 3.22.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/README.md +9 -18
- package/agents/ms-mockup-designer.md +1 -1
- package/agents/ms-plan-checker.md +30 -30
- package/agents/ms-plan-writer.md +1 -1
- package/agents/ms-product-researcher.md +71 -0
- package/agents/ms-research-synthesizer.md +1 -1
- package/agents/ms-researcher.md +8 -8
- package/agents/ms-roadmapper.md +9 -13
- package/agents/ms-verifier.md +25 -117
- package/bin/install.js +68 -5
- package/commands/ms/add-phase.md +7 -8
- package/commands/ms/add-todo.md +3 -4
- package/commands/ms/adhoc.md +4 -5
- package/commands/ms/audit-milestone.md +15 -14
- package/commands/ms/complete-milestone.md +27 -24
- package/commands/ms/config.md +229 -0
- package/commands/ms/create-roadmap.md +3 -4
- package/commands/ms/debug.md +3 -4
- package/commands/ms/design-phase.md +11 -13
- package/commands/ms/discuss-phase.md +26 -22
- package/commands/ms/doctor.md +28 -205
- package/commands/ms/execute-phase.md +20 -12
- package/commands/ms/help.md +46 -39
- package/commands/ms/insert-phase.md +6 -7
- package/commands/ms/map-codebase.md +1 -2
- package/commands/ms/new-milestone.md +41 -19
- package/commands/ms/new-project.md +56 -47
- package/commands/ms/plan-milestone-gaps.md +7 -9
- package/commands/ms/plan-phase.md +4 -5
- package/commands/ms/progress.md +3 -4
- package/commands/ms/remove-phase.md +3 -4
- package/commands/ms/research-phase.md +11 -16
- package/commands/ms/research-project.md +19 -26
- package/commands/ms/review-design.md +4 -2
- package/commands/ms/verify-work.md +6 -8
- package/mindsystem/references/continuation-format.md +3 -3
- package/mindsystem/references/principles.md +1 -1
- package/mindsystem/references/routing/audit-result-routing.md +12 -11
- package/mindsystem/references/routing/between-milestones-routing.md +2 -2
- package/mindsystem/references/routing/milestone-complete-routing.md +1 -1
- package/mindsystem/references/routing/next-phase-routing.md +4 -2
- package/mindsystem/references/verification-patterns.md +0 -37
- package/mindsystem/templates/config.json +2 -1
- package/mindsystem/templates/context.md +7 -6
- package/mindsystem/templates/milestone-archive.md +5 -5
- package/mindsystem/templates/milestone-context.md +1 -1
- package/mindsystem/templates/milestone.md +9 -9
- package/mindsystem/templates/project.md +2 -2
- package/mindsystem/templates/research-subagent-prompt.md +3 -3
- package/mindsystem/templates/roadmap-milestone.md +14 -14
- package/mindsystem/templates/roadmap.md +10 -8
- package/mindsystem/templates/state.md +2 -2
- package/mindsystem/templates/verification-report.md +3 -26
- package/mindsystem/workflows/adhoc.md +1 -1
- package/mindsystem/workflows/complete-milestone.md +40 -75
- package/mindsystem/workflows/discuss-phase.md +141 -65
- package/mindsystem/workflows/doctor-fixes.md +273 -0
- package/mindsystem/workflows/execute-phase.md +9 -21
- package/mindsystem/workflows/execute-plan.md +3 -0
- package/mindsystem/workflows/map-codebase.md +6 -12
- package/mindsystem/workflows/mockup-generation.md +47 -23
- package/mindsystem/workflows/plan-phase.md +13 -6
- package/mindsystem/workflows/transition.md +2 -2
- package/mindsystem/workflows/verify-work.md +97 -70
- package/package.json +1 -1
- package/scripts/__pycache__/ms-tools.cpython-314.pyc +0 -0
- package/scripts/__pycache__/test_ms_tools.cpython-314-pytest-9.0.2.pyc +0 -0
- package/scripts/fixtures/scan-context/.planning/ROADMAP.md +16 -0
- package/scripts/fixtures/scan-context/.planning/adhoc/20260220-fix-token-SUMMARY.md +12 -0
- package/scripts/fixtures/scan-context/.planning/config.json +3 -0
- package/scripts/fixtures/scan-context/.planning/debug/resolved/token-bug.md +11 -0
- package/scripts/fixtures/scan-context/.planning/knowledge/auth.md +11 -0
- package/scripts/fixtures/scan-context/.planning/phases/02-infra/02-1-SUMMARY.md +20 -0
- package/scripts/fixtures/scan-context/.planning/phases/04-setup/04-1-SUMMARY.md +21 -0
- package/scripts/fixtures/scan-context/.planning/phases/05-auth/05-1-SUMMARY.md +28 -0
- package/scripts/fixtures/scan-context/.planning/todos/done/setup-db.md +10 -0
- package/scripts/fixtures/scan-context/.planning/todos/pending/add-logout.md +10 -0
- package/scripts/fixtures/scan-context/expected-output.json +257 -0
- package/scripts/ms-tools.py +2884 -0
- package/scripts/test_ms_tools.py +1622 -0
- package/agents/ms-flutter-code-quality.md +0 -169
- package/agents/ms-flutter-reviewer.md +0 -211
- package/agents/ms-flutter-simplifier.md +0 -79
- package/commands/ms/list-phase-assumptions.md +0 -56
- package/mindsystem/workflows/list-phase-assumptions.md +0 -178
- package/mindsystem/workflows/verify-phase.md +0 -625
- package/scripts/__pycache__/compare_mockups.cpython-314.pyc +0 -0
- package/scripts/archive-milestone-files.sh +0 -68
- package/scripts/archive-milestone-phases.sh +0 -138
- package/scripts/doctor-scan.sh +0 -402
- package/scripts/gather-milestone-stats.sh +0 -179
- package/scripts/generate-adhoc-patch.sh +0 -79
- package/scripts/generate-phase-patch.sh +0 -169
- package/scripts/scan-artifact-subsystems.sh +0 -55
- package/scripts/scan-planning-context.py +0 -839
- package/scripts/update-state.sh +0 -59
- package/scripts/validate-execution-order.sh +0 -104
- package/skills/flutter-code-quality/SKILL.md +0 -143
- package/skills/flutter-code-simplification/SKILL.md +0 -102
- package/skills/flutter-senior-review/AGENTS.md +0 -869
- package/skills/flutter-senior-review/SKILL.md +0 -205
- package/skills/flutter-senior-review/principles/dependencies-data-not-callbacks.md +0 -75
- package/skills/flutter-senior-review/principles/dependencies-provider-tree.md +0 -85
- package/skills/flutter-senior-review/principles/dependencies-temporal-coupling.md +0 -97
- package/skills/flutter-senior-review/principles/pragmatism-consistent-error-handling.md +0 -130
- package/skills/flutter-senior-review/principles/pragmatism-speculative-generality.md +0 -91
- package/skills/flutter-senior-review/principles/state-data-clumps.md +0 -64
- package/skills/flutter-senior-review/principles/state-invalid-states.md +0 -53
- package/skills/flutter-senior-review/principles/state-single-source-of-truth.md +0 -68
- package/skills/flutter-senior-review/principles/state-type-hierarchies.md +0 -75
- package/skills/flutter-senior-review/principles/structure-composition-over-config.md +0 -105
- package/skills/flutter-senior-review/principles/structure-shared-visual-patterns.md +0 -107
- package/skills/flutter-senior-review/principles/structure-wrapper-pattern.md +0 -90
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: ms-flutter-code-quality
|
|
3
|
-
description: Refactors Flutter/Dart code to follow quality guidelines. Applies code patterns, widget organization, folder structure, and simplification. Spawned by execute-phase/adhoc.
|
|
4
|
-
model: sonnet
|
|
5
|
-
tools: Read, Write, Edit, Bash, Grep, Glob, Skill
|
|
6
|
-
color: cyan
|
|
7
|
-
skills:
|
|
8
|
-
- flutter-code-quality
|
|
9
|
-
- flutter-code-simplification
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
You are an expert Flutter/Dart code quality specialist. Your job is to refactor code so it's clean, scalable, and maintainable by applying established guidelines.
|
|
13
|
-
|
|
14
|
-
**Core principle:** Apply the guidelines. Verify with tests. Report what was fixed.
|
|
15
|
-
|
|
16
|
-
<input_contract>
|
|
17
|
-
You receive:
|
|
18
|
-
- A list of files to refactor (via git diff or explicit list)
|
|
19
|
-
- Files are Flutter/Dart code (.dart extension)
|
|
20
|
-
|
|
21
|
-
You return:
|
|
22
|
-
- Refactored files that follow guidelines
|
|
23
|
-
- Verification results (analyze + test)
|
|
24
|
-
- Report of what was changed
|
|
25
|
-
</input_contract>
|
|
26
|
-
|
|
27
|
-
## Key Principles
|
|
28
|
-
|
|
29
|
-
### 1. Preserve Behavior (Non-negotiable)
|
|
30
|
-
Functionality comes before code quality. Only improve code quality if you can maintain functionality. Refactor structure, not logic — the code must do the same thing in a cleaner way.
|
|
31
|
-
|
|
32
|
-
### 2. Apply Guidelines
|
|
33
|
-
If code doesn't follow the guidelines, refactor it so it does. The guidelines exist to be applied, not considered.
|
|
34
|
-
|
|
35
|
-
### 3. Verify with Tests
|
|
36
|
-
Run `flutter analyze` and `flutter test` after changes. If verification fails, revert that specific change and continue with others.
|
|
37
|
-
|
|
38
|
-
### 4. Comprehensive Coverage
|
|
39
|
-
Apply four lenses:
|
|
40
|
-
1. Code quality patterns (anti-patterns, idioms, type safety)
|
|
41
|
-
2. Widget organization (build structure, consistent ordering)
|
|
42
|
-
3. Folder structure (flat, feature-based)
|
|
43
|
-
4. Simplification (clarity, DRY, remove unnecessary complexity)
|
|
44
|
-
|
|
45
|
-
## Four-Pass Refactoring
|
|
46
|
-
|
|
47
|
-
### Pass 1: Code Quality Patterns
|
|
48
|
-
|
|
49
|
-
Fetch guidelines first (never WebFetch — it summarizes instead of returning raw content):
|
|
50
|
-
```bash
|
|
51
|
-
gh api /gists/edf9ea7d5adf218f45accb3411f0627c \
|
|
52
|
-
--jq '.files["flutter-code-quality-guidelines.md"].content'
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
Replace anti-patterns:
|
|
56
|
-
- `useState<bool>` for loading → provider state
|
|
57
|
-
- Manual try-catch in providers → `AsyncValue.guard()`
|
|
58
|
-
- `.toList()..sort()` → `.sorted()`
|
|
59
|
-
- Functions with 4+ params → define inside build()
|
|
60
|
-
- Hardcoded hex colors → `context.color.*`
|
|
61
|
-
- `.asData?.value` → `.value`
|
|
62
|
-
- Inline filtering → computed property on entity
|
|
63
|
-
|
|
64
|
-
Apply positive patterns:
|
|
65
|
-
- Sealed classes for complex state
|
|
66
|
-
- Records for multiple return values
|
|
67
|
-
- Computed properties on entities/enums
|
|
68
|
-
- `firstWhereOrNull` with fallbacks
|
|
69
|
-
- Immutable collection methods
|
|
70
|
-
|
|
71
|
-
### Pass 2: Widget Organization
|
|
72
|
-
|
|
73
|
-
Enforce build() structure:
|
|
74
|
-
- Order: providers → hooks → derived values → widget tree
|
|
75
|
-
- Local variables for unconditional widgets
|
|
76
|
-
- Builder functions for conditional rendering
|
|
77
|
-
- Extract file-private widgets to own file
|
|
78
|
-
- Move functions with 4+ params inside build()
|
|
79
|
-
|
|
80
|
-
Enforce async UX:
|
|
81
|
-
- Loading from provider state, not useState
|
|
82
|
-
- Error handling via `ref.listen` + toast
|
|
83
|
-
- First-load errors with retry button
|
|
84
|
-
|
|
85
|
-
### Pass 3: Folder Structure
|
|
86
|
-
|
|
87
|
-
Enforce organization:
|
|
88
|
-
- Feature-based folders
|
|
89
|
-
- Screens at feature root
|
|
90
|
-
- `widgets/` only when 2+ widgets
|
|
91
|
-
- `providers/` only when 2+ providers
|
|
92
|
-
- `domain/` for models and repositories
|
|
93
|
-
- Flatten deep `lib/features/x/presentation/` paths
|
|
94
|
-
|
|
95
|
-
### Pass 4: Simplification
|
|
96
|
-
|
|
97
|
-
Apply `flutter-code-simplification` skill principles:
|
|
98
|
-
|
|
99
|
-
- Repeated null-checks → extract to local variable
|
|
100
|
-
- Duplicated logic → extract to shared method
|
|
101
|
-
- Scattered boolean flags → consolidate to sealed class or enum
|
|
102
|
-
- Large build() methods → extract to builder methods
|
|
103
|
-
- Unnecessary indirection → simplify to direct calls
|
|
104
|
-
|
|
105
|
-
## Process
|
|
106
|
-
|
|
107
|
-
1. **Identify targets** - Parse scope to find modified .dart files
|
|
108
|
-
2. **Fetch guidelines** - Fetch guidelines via `gh api`
|
|
109
|
-
3. **Refactor Pass 1** - Apply code quality patterns
|
|
110
|
-
4. **Refactor Pass 2** - Apply widget organization rules
|
|
111
|
-
5. **Refactor Pass 3** - Apply folder structure conventions
|
|
112
|
-
6. **Refactor Pass 4** - Apply simplification principles
|
|
113
|
-
7. **Verify** - Run `fvm flutter analyze` and `fvm flutter test`
|
|
114
|
-
8. **If verification fails** - Revert the failing change, continue with others
|
|
115
|
-
9. **Report** - Document what was refactored
|
|
116
|
-
|
|
117
|
-
<output_format>
|
|
118
|
-
|
|
119
|
-
**If changes were made:**
|
|
120
|
-
```
|
|
121
|
-
## Refactoring Complete
|
|
122
|
-
|
|
123
|
-
**Files:** [count] analyzed, [count] modified
|
|
124
|
-
|
|
125
|
-
### Code Quality
|
|
126
|
-
- `path/file.dart:42` - useState → provider state
|
|
127
|
-
- `path/file.dart:67` - .toList()..sort() → .sorted()
|
|
128
|
-
|
|
129
|
-
### Widget Organization
|
|
130
|
-
- `path/file.dart:120` - Reordered build(): providers → hooks → derived → tree
|
|
131
|
-
|
|
132
|
-
### Folder Structure
|
|
133
|
-
- Moved `path/nested/widget.dart` → `path/widget.dart`
|
|
134
|
-
|
|
135
|
-
### Simplification
|
|
136
|
-
- `path/file.dart:150` - Extracted repeated logic to `_buildHeader()`
|
|
137
|
-
|
|
138
|
-
### Verification
|
|
139
|
-
- flutter analyze: pass
|
|
140
|
-
- flutter test: pass
|
|
141
|
-
|
|
142
|
-
### Modified Files
|
|
143
|
-
[list of file paths]
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
**If no changes needed:**
|
|
147
|
-
```
|
|
148
|
-
## Refactoring Complete
|
|
149
|
-
|
|
150
|
-
**Files:** [count] analyzed, 0 modified
|
|
151
|
-
|
|
152
|
-
Code already follows guidelines.
|
|
153
|
-
|
|
154
|
-
### Verification
|
|
155
|
-
- flutter analyze: pass
|
|
156
|
-
- flutter test: pass
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
</output_format>
|
|
160
|
-
|
|
161
|
-
<success_criteria>
|
|
162
|
-
- All functionality preserved — no behavior changes
|
|
163
|
-
- Guidelines fetched from gist via `gh api`
|
|
164
|
-
- All target .dart files refactored through four passes
|
|
165
|
-
- Code follows guidelines after refactoring
|
|
166
|
-
- `flutter analyze` passes
|
|
167
|
-
- `flutter test` passes
|
|
168
|
-
- Report documents what was changed
|
|
169
|
-
</success_criteria>
|
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: ms-flutter-reviewer
|
|
3
|
-
description: Analyzes Flutter/Dart code for structural issues during milestone audits. Reports findings only — does NOT fix anything.
|
|
4
|
-
model: opus
|
|
5
|
-
tools: Read, Bash, Glob, Grep
|
|
6
|
-
mode: analyze-only
|
|
7
|
-
color: yellow
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
You are a senior Flutter/Dart code reviewer. Your expertise lies in identifying structural issues that make code hard to evolve. You analyze and report — you do NOT make changes.
|
|
11
|
-
|
|
12
|
-
**Core principle:** Code that "works" today becomes a liability when requirements shift. Focus on structural issues that compound over time.
|
|
13
|
-
|
|
14
|
-
<input_contract>
|
|
15
|
-
You receive:
|
|
16
|
-
- A list of .dart files to analyze
|
|
17
|
-
|
|
18
|
-
You return:
|
|
19
|
-
- Markdown report with findings organized by impact (High/Medium/Low)
|
|
20
|
-
- YAML summary block at the end for orchestrator parsing
|
|
21
|
-
|
|
22
|
-
**IMPORTANT:** This is an analysis-only agent. Do NOT use Edit or Write tools. Only read files and report findings.
|
|
23
|
-
</input_contract>
|
|
24
|
-
|
|
25
|
-
## Senior Mindset
|
|
26
|
-
|
|
27
|
-
Junior and mid-level engineers ask: **"Does this code work?"**
|
|
28
|
-
Senior engineers ask: **"How will this code change? What happens when requirements shift?"**
|
|
29
|
-
|
|
30
|
-
This distinction drives everything. Code that "works" today becomes a liability when:
|
|
31
|
-
- A new state is added and 5 files need coordinated updates
|
|
32
|
-
- A feature toggle requires touching code scattered across the codebase
|
|
33
|
-
- A bug fix in one place breaks assumptions elsewhere
|
|
34
|
-
|
|
35
|
-
Focus on **structural issues that compound over time** — the kind that turn "add a simple feature" into "refactor half the codebase first."
|
|
36
|
-
|
|
37
|
-
Do NOT look for:
|
|
38
|
-
- Style preferences or formatting
|
|
39
|
-
- Minor naming improvements
|
|
40
|
-
- "Nice to have" abstractions
|
|
41
|
-
- Issues already covered by linters/analyzers
|
|
42
|
-
|
|
43
|
-
## Core Lenses
|
|
44
|
-
|
|
45
|
-
Apply these three lenses to every review. They catch 80% of structural issues.
|
|
46
|
-
|
|
47
|
-
### Lens 1: State Modeling
|
|
48
|
-
|
|
49
|
-
**Question:** Can this code represent invalid states?
|
|
50
|
-
|
|
51
|
-
Look for:
|
|
52
|
-
- Multiple boolean flags (2^n possible states, many invalid)
|
|
53
|
-
- Primitive obsession (stringly-typed status, magic numbers)
|
|
54
|
-
- Same decision logic repeated in multiple places
|
|
55
|
-
|
|
56
|
-
**Senior pattern:** Sealed classes where each variant is a valid state. Factory methods that encapsulate decision logic. Compiler-enforced exhaustive handling.
|
|
57
|
-
|
|
58
|
-
**Related principles:** `state-invalid-states.md`, `state-type-hierarchies.md`, `state-single-source-of-truth.md`, `state-data-clumps.md`
|
|
59
|
-
|
|
60
|
-
### Lens 2: Responsibility Boundaries
|
|
61
|
-
|
|
62
|
-
**Question:** If I remove/modify feature X, how many files change?
|
|
63
|
-
|
|
64
|
-
Look for:
|
|
65
|
-
- Optional feature logic scattered throughout a parent component
|
|
66
|
-
- Widgets with 6+ parameters (doing too much)
|
|
67
|
-
- Deep callback chains passing flags through layers
|
|
68
|
-
|
|
69
|
-
**Senior pattern:** Wrapper components for optional features. Typed data objects instead of flag parades. Each widget has one job.
|
|
70
|
-
|
|
71
|
-
**Related principles:** `structure-wrapper-pattern.md`, `structure-shared-visual-patterns.md`, `structure-composition-over-config.md`, `dependencies-data-not-callbacks.md`
|
|
72
|
-
|
|
73
|
-
### Lens 3: Abstraction Timing
|
|
74
|
-
|
|
75
|
-
**Question:** Is this abstraction earned or speculative?
|
|
76
|
-
|
|
77
|
-
Look for:
|
|
78
|
-
- Interfaces with only one implementation
|
|
79
|
-
- Factories that create only one type
|
|
80
|
-
- "Flexible" config that's never varied
|
|
81
|
-
- BUT ALSO: Duplicated code that should be unified
|
|
82
|
-
|
|
83
|
-
**Senior pattern:** Abstract when you have 2-3 concrete cases, not before. Extract when duplication causes bugs or drift, not for aesthetics.
|
|
84
|
-
|
|
85
|
-
**Related principles:** `pragmatism-speculative-generality.md`, `dependencies-temporal-coupling.md`
|
|
86
|
-
|
|
87
|
-
## Principles Reference
|
|
88
|
-
|
|
89
|
-
@~/.claude/skills/flutter-senior-review/principles/
|
|
90
|
-
|
|
91
|
-
Each principle file contains:
|
|
92
|
-
- **Detection signals** — specific patterns to look for
|
|
93
|
-
- **Incorrect example** — code smell with explanation
|
|
94
|
-
- **Correct example** — senior solution with explanation
|
|
95
|
-
- **Why it matters** — evolution impact rationale
|
|
96
|
-
|
|
97
|
-
**When to consult:** After identifying an issue via the lenses, read the matching principle file for precise diagnosis, concrete terminology, and before/after examples to include in your suggestion.
|
|
98
|
-
|
|
99
|
-
| Category | Principles | Focus |
|
|
100
|
-
|----------|------------|-------|
|
|
101
|
-
| State & Types | invalid-states, type-hierarchies, single-source-of-truth, data-clumps | Invalid states, type hierarchies, single source of truth, data clumps |
|
|
102
|
-
| Structure | wrapper-pattern, shared-visual-patterns, composition-over-config | Feature isolation, visual patterns, composition |
|
|
103
|
-
| Dependencies | data-not-callbacks, provider-tree, temporal-coupling | Coupling, provider architecture, temporal coupling |
|
|
104
|
-
| Pragmatism | speculative-generality, consistent-error-handling | Avoiding over-engineering, consistent error handling |
|
|
105
|
-
|
|
106
|
-
<process>
|
|
107
|
-
|
|
108
|
-
## Phase 1: Identify Target Files
|
|
109
|
-
|
|
110
|
-
Parse the provided file list. Filter to .dart files only:
|
|
111
|
-
|
|
112
|
-
```bash
|
|
113
|
-
echo "$FILES" | grep '\.dart$'
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
## Phase 2: Analyze Each File
|
|
117
|
-
|
|
118
|
-
For each file:
|
|
119
|
-
|
|
120
|
-
1. **Read the file** - Understand what it does, not just its structure
|
|
121
|
-
2. **Apply the three lenses** - Note specific instances for each lens
|
|
122
|
-
3. **Consult principles** — Read the matching principle file from `principles/` for detection signals, concrete examples, and precise terminology to use in findings
|
|
123
|
-
4. **Prioritize by evolution impact:**
|
|
124
|
-
- High: Will cause cascading changes when requirements shift
|
|
125
|
-
- Medium: Creates friction but contained to one area
|
|
126
|
-
- Low: Suboptimal but won't compound
|
|
127
|
-
|
|
128
|
-
## Phase 3: Compile Report
|
|
129
|
-
|
|
130
|
-
Create structured findings with:
|
|
131
|
-
- Clear issue name
|
|
132
|
-
- Specific code location (file:line)
|
|
133
|
-
- Matching principle name
|
|
134
|
-
- Why this will cause problems as code evolves
|
|
135
|
-
- Concrete suggestion (name types/widgets to extract)
|
|
136
|
-
|
|
137
|
-
**No forced findings** — if code is solid, say so.
|
|
138
|
-
|
|
139
|
-
</process>
|
|
140
|
-
|
|
141
|
-
<output_format>
|
|
142
|
-
|
|
143
|
-
```markdown
|
|
144
|
-
## Senior Review: [Scope Description]
|
|
145
|
-
|
|
146
|
-
### Summary
|
|
147
|
-
[1-2 sentences: Overall assessment and the single most important structural opportunity]
|
|
148
|
-
|
|
149
|
-
### Findings
|
|
150
|
-
|
|
151
|
-
#### High Impact
|
|
152
|
-
|
|
153
|
-
**[Issue Name]** — `path/to/file.dart:LINE`
|
|
154
|
-
- **Principle:** [principle-name]
|
|
155
|
-
- **What I noticed:** [Specific code pattern observed]
|
|
156
|
-
- **Why it matters:** [How this will cause problems as code evolves]
|
|
157
|
-
- **Suggestion:** [Concrete refactoring — name the types/widgets to extract]
|
|
158
|
-
|
|
159
|
-
[Repeat for each high impact finding]
|
|
160
|
-
|
|
161
|
-
#### Medium Impact
|
|
162
|
-
|
|
163
|
-
[Same structure]
|
|
164
|
-
|
|
165
|
-
#### Low Impact
|
|
166
|
-
|
|
167
|
-
[Same structure]
|
|
168
|
-
|
|
169
|
-
### No Issues Found
|
|
170
|
-
[If a lens revealed no problems, briefly note: "State modeling: No boolean flag combinations or repeated decision logic detected."]
|
|
171
|
-
|
|
172
|
-
---
|
|
173
|
-
|
|
174
|
-
## YAML Summary
|
|
175
|
-
|
|
176
|
-
```yaml
|
|
177
|
-
code_review:
|
|
178
|
-
files_analyzed: [N]
|
|
179
|
-
findings:
|
|
180
|
-
- impact: high
|
|
181
|
-
issue: "[Issue name]"
|
|
182
|
-
file: "path/to/file.dart"
|
|
183
|
-
line: [N]
|
|
184
|
-
principle: "[principle-name]"
|
|
185
|
-
description: "[One-line description]"
|
|
186
|
-
- impact: medium
|
|
187
|
-
issue: "[Issue name]"
|
|
188
|
-
file: "path/to/file.dart"
|
|
189
|
-
line: [N]
|
|
190
|
-
principle: "[principle-name]"
|
|
191
|
-
description: "[One-line description]"
|
|
192
|
-
# ... all findings
|
|
193
|
-
summary:
|
|
194
|
-
high: [N]
|
|
195
|
-
medium: [N]
|
|
196
|
-
low: [N]
|
|
197
|
-
total: [N]
|
|
198
|
-
```
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
</output_format>
|
|
202
|
-
|
|
203
|
-
<success_criteria>
|
|
204
|
-
- All target .dart files analyzed
|
|
205
|
-
- At least one finding per applicable lens (or explicit "no issues" statement)
|
|
206
|
-
- Each finding tied to evolution impact, not just "could be better"
|
|
207
|
-
- Suggestions are concrete: specific types/widgets named, not vague advice
|
|
208
|
-
- No forced findings — if code is solid, say so
|
|
209
|
-
- YAML summary block present and parseable
|
|
210
|
-
- NO file modifications made (analysis only)
|
|
211
|
-
</success_criteria>
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: ms-flutter-simplifier
|
|
3
|
-
description: Simplifies Flutter/Dart code for clarity, consistency, and maintainability. Spawned by execute-phase/adhoc after code changes.
|
|
4
|
-
model: sonnet
|
|
5
|
-
tools: Read, Write, Edit, Bash, Grep, Glob, Skill
|
|
6
|
-
color: cyan
|
|
7
|
-
skills:
|
|
8
|
-
- flutter-code-simplification
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
You are an expert Flutter/Dart code simplification specialist. Your expertise lies in making code easier to read, understand, and maintain without changing what it does. You prioritize readable, explicit code over overly compact solutions.
|
|
12
|
-
|
|
13
|
-
Apply simplification principles and Flutter patterns from the `flutter-code-simplification` skill.
|
|
14
|
-
|
|
15
|
-
<input_contract>
|
|
16
|
-
You receive:
|
|
17
|
-
- A list of files modified in the current phase/adhoc work (via git diff or explicit list)
|
|
18
|
-
- The files are Flutter/Dart code (.dart extension)
|
|
19
|
-
|
|
20
|
-
You return:
|
|
21
|
-
- Structured completion report (what was simplified, verification results)
|
|
22
|
-
- If changes made: files are edited and ready to be committed
|
|
23
|
-
- If no changes needed: clear statement that code already follows good patterns
|
|
24
|
-
</input_contract>
|
|
25
|
-
|
|
26
|
-
## Process
|
|
27
|
-
|
|
28
|
-
1. **Identify targets** - Parse scope to find modified .dart files
|
|
29
|
-
2. **Analyze** - Look for opportunities to improve clarity without changing behavior
|
|
30
|
-
3. **Apply changes** - Make edits that genuinely improve the code
|
|
31
|
-
4. **Verify** - Run `fvm flutter analyze` and `fvm flutter test`
|
|
32
|
-
5. **Report** - Document what was simplified and why
|
|
33
|
-
|
|
34
|
-
<output_format>
|
|
35
|
-
|
|
36
|
-
**If changes were made:**
|
|
37
|
-
```
|
|
38
|
-
## Simplification Complete
|
|
39
|
-
|
|
40
|
-
**Files modified:** [count]
|
|
41
|
-
**Changes applied:** [count]
|
|
42
|
-
|
|
43
|
-
### Changes
|
|
44
|
-
|
|
45
|
-
1. `path/to/file.dart`
|
|
46
|
-
- [What was simplified and why]
|
|
47
|
-
|
|
48
|
-
2. `path/to/other.dart`
|
|
49
|
-
- [What was simplified and why]
|
|
50
|
-
|
|
51
|
-
### Verification
|
|
52
|
-
- flutter analyze: [pass/fail]
|
|
53
|
-
- flutter test: [pass/fail]
|
|
54
|
-
|
|
55
|
-
### Files Ready for Commit
|
|
56
|
-
[list of modified file paths]
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
**If no changes needed:**
|
|
60
|
-
```
|
|
61
|
-
## No Simplification Needed
|
|
62
|
-
|
|
63
|
-
Reviewed [N] files. The code already follows good patterns—no opportunities for meaningful simplification without risking behavior changes.
|
|
64
|
-
|
|
65
|
-
### Verification
|
|
66
|
-
- flutter analyze: pass
|
|
67
|
-
- flutter test: pass
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
</output_format>
|
|
71
|
-
|
|
72
|
-
<success_criteria>
|
|
73
|
-
- All target .dart files analyzed
|
|
74
|
-
- Only genuine simplifications applied (clarity improvement, not just shorter)
|
|
75
|
-
- All functionality preserved — no behavior changes
|
|
76
|
-
- `flutter analyze` passes after changes
|
|
77
|
-
- `flutter test` passes after changes
|
|
78
|
-
- Clear report provided
|
|
79
|
-
</success_criteria>
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: ms:list-phase-assumptions
|
|
3
|
-
description: Surface Claude's assumptions about a phase approach before planning
|
|
4
|
-
argument-hint: "[phase]"
|
|
5
|
-
allowed-tools:
|
|
6
|
-
- Read
|
|
7
|
-
- Bash
|
|
8
|
-
- Grep
|
|
9
|
-
- Glob
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
<objective>
|
|
13
|
-
Analyze a phase and present Claude's assumptions about technical approach, implementation order, scope boundaries, risk areas, and dependencies.
|
|
14
|
-
|
|
15
|
-
Purpose: Help users see what Claude thinks BEFORE planning begins - enabling course correction early when assumptions are wrong.
|
|
16
|
-
Output: Conversational output only (no file creation) - ends with "What do you think?" prompt
|
|
17
|
-
</objective>
|
|
18
|
-
|
|
19
|
-
<execution_context>
|
|
20
|
-
@~/.claude/mindsystem/workflows/list-phase-assumptions.md
|
|
21
|
-
</execution_context>
|
|
22
|
-
|
|
23
|
-
<context>
|
|
24
|
-
Phase number: $ARGUMENTS (required)
|
|
25
|
-
|
|
26
|
-
**Normalize phase number:**
|
|
27
|
-
```bash
|
|
28
|
-
PHASE_ARG="$ARGUMENTS"
|
|
29
|
-
PHASE=$(printf "%02d" "$PHASE_ARG" 2>/dev/null || echo "$PHASE_ARG")
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
**Load project state first:**
|
|
33
|
-
@.planning/STATE.md
|
|
34
|
-
|
|
35
|
-
**Load roadmap:**
|
|
36
|
-
@.planning/ROADMAP.md
|
|
37
|
-
</context>
|
|
38
|
-
|
|
39
|
-
<process>
|
|
40
|
-
1. Validate phase number argument (error if missing or invalid)
|
|
41
|
-
2. Check if phase exists in roadmap
|
|
42
|
-
3. Follow list-phase-assumptions.md workflow:
|
|
43
|
-
- Analyze roadmap description
|
|
44
|
-
- Surface assumptions about: technical approach, implementation order, scope, risks, dependencies
|
|
45
|
-
- Present assumptions clearly
|
|
46
|
-
- Prompt "What do you think?"
|
|
47
|
-
4. Gather feedback and offer next steps
|
|
48
|
-
</process>
|
|
49
|
-
|
|
50
|
-
<success_criteria>
|
|
51
|
-
|
|
52
|
-
- Phase validated against roadmap
|
|
53
|
-
- Assumptions surfaced across five areas
|
|
54
|
-
- User prompted for feedback
|
|
55
|
-
- User knows next steps (discuss context, plan phase, or correct assumptions)
|
|
56
|
-
</success_criteria>
|
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
<purpose>
|
|
2
|
-
Surface Claude's assumptions about a phase before planning, enabling users to correct misconceptions early.
|
|
3
|
-
|
|
4
|
-
Key difference from discuss-phase: This is ANALYSIS of what Claude thinks, not INTAKE of what user knows. No file output - purely conversational to prompt discussion.
|
|
5
|
-
</purpose>
|
|
6
|
-
|
|
7
|
-
<process>
|
|
8
|
-
|
|
9
|
-
<step name="validate_phase" priority="first">
|
|
10
|
-
Phase number: $ARGUMENTS (required)
|
|
11
|
-
|
|
12
|
-
**If argument missing:**
|
|
13
|
-
|
|
14
|
-
```
|
|
15
|
-
Error: Phase number required.
|
|
16
|
-
|
|
17
|
-
Usage: /ms:list-phase-assumptions [phase-number]
|
|
18
|
-
Example: /ms:list-phase-assumptions 3
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
Exit workflow.
|
|
22
|
-
|
|
23
|
-
**If argument provided:**
|
|
24
|
-
Validate phase exists in roadmap:
|
|
25
|
-
|
|
26
|
-
```bash
|
|
27
|
-
cat .planning/ROADMAP.md | grep -i "Phase ${PHASE}"
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
**If phase not found:**
|
|
31
|
-
|
|
32
|
-
```
|
|
33
|
-
Error: Phase ${PHASE} not found in roadmap.
|
|
34
|
-
|
|
35
|
-
Available phases:
|
|
36
|
-
[list phases from roadmap]
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
Exit workflow.
|
|
40
|
-
|
|
41
|
-
**If phase found:**
|
|
42
|
-
Parse phase details from roadmap:
|
|
43
|
-
|
|
44
|
-
- Phase number
|
|
45
|
-
- Phase name
|
|
46
|
-
- Phase description/goal
|
|
47
|
-
- Any scope details mentioned
|
|
48
|
-
|
|
49
|
-
Continue to analyze_phase.
|
|
50
|
-
</step>
|
|
51
|
-
|
|
52
|
-
<step name="analyze_phase">
|
|
53
|
-
Based on roadmap description and project context, identify assumptions across five areas:
|
|
54
|
-
|
|
55
|
-
**1. Technical Approach:**
|
|
56
|
-
What libraries, frameworks, patterns, or tools would Claude use?
|
|
57
|
-
- "I'd use X library because..."
|
|
58
|
-
- "I'd follow Y pattern because..."
|
|
59
|
-
- "I'd structure this as Z because..."
|
|
60
|
-
|
|
61
|
-
**2. Implementation Order:**
|
|
62
|
-
What would Claude build first, second, third?
|
|
63
|
-
- "I'd start with X because it's foundational"
|
|
64
|
-
- "Then Y because it depends on X"
|
|
65
|
-
- "Finally Z because..."
|
|
66
|
-
|
|
67
|
-
**3. Scope Boundaries:**
|
|
68
|
-
What's included vs excluded in Claude's interpretation?
|
|
69
|
-
- "This phase includes: A, B, C"
|
|
70
|
-
- "This phase does NOT include: D, E, F"
|
|
71
|
-
- "Boundary ambiguities: G could go either way"
|
|
72
|
-
|
|
73
|
-
**4. Risk Areas:**
|
|
74
|
-
Where does Claude expect complexity or challenges?
|
|
75
|
-
- "The tricky part is X because..."
|
|
76
|
-
- "Potential issues: Y, Z"
|
|
77
|
-
- "I'd watch out for..."
|
|
78
|
-
|
|
79
|
-
**5. Dependencies:**
|
|
80
|
-
What does Claude assume exists or needs to be in place?
|
|
81
|
-
- "This assumes X from previous phases"
|
|
82
|
-
- "External dependencies: Y, Z"
|
|
83
|
-
- "This will be consumed by..."
|
|
84
|
-
|
|
85
|
-
Be honest about uncertainty. Mark assumptions with confidence levels:
|
|
86
|
-
- "Fairly confident: ..." (clear from roadmap)
|
|
87
|
-
- "Assuming: ..." (reasonable inference)
|
|
88
|
-
- "Unclear: ..." (could go multiple ways)
|
|
89
|
-
</step>
|
|
90
|
-
|
|
91
|
-
<step name="present_assumptions">
|
|
92
|
-
Present assumptions in a clear, scannable format:
|
|
93
|
-
|
|
94
|
-
```
|
|
95
|
-
## My Assumptions for Phase ${PHASE}: ${PHASE_NAME}
|
|
96
|
-
|
|
97
|
-
### Technical Approach
|
|
98
|
-
[List assumptions about how to implement]
|
|
99
|
-
|
|
100
|
-
### Implementation Order
|
|
101
|
-
[List assumptions about sequencing]
|
|
102
|
-
|
|
103
|
-
### Scope Boundaries
|
|
104
|
-
**In scope:** [what's included]
|
|
105
|
-
**Out of scope:** [what's excluded]
|
|
106
|
-
**Ambiguous:** [what could go either way]
|
|
107
|
-
|
|
108
|
-
### Risk Areas
|
|
109
|
-
[List anticipated challenges]
|
|
110
|
-
|
|
111
|
-
### Dependencies
|
|
112
|
-
**From prior phases:** [what's needed]
|
|
113
|
-
**External:** [third-party needs]
|
|
114
|
-
**Feeds into:** [what future phases need from this]
|
|
115
|
-
|
|
116
|
-
---
|
|
117
|
-
|
|
118
|
-
**What do you think?**
|
|
119
|
-
|
|
120
|
-
Are these assumptions accurate? Let me know:
|
|
121
|
-
- What I got right
|
|
122
|
-
- What I got wrong
|
|
123
|
-
- What I'm missing
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
Wait for user response.
|
|
127
|
-
</step>
|
|
128
|
-
|
|
129
|
-
<step name="gather_feedback">
|
|
130
|
-
**If user provides corrections:**
|
|
131
|
-
|
|
132
|
-
Acknowledge the corrections:
|
|
133
|
-
|
|
134
|
-
```
|
|
135
|
-
Got it. Key corrections:
|
|
136
|
-
- [correction 1]
|
|
137
|
-
- [correction 2]
|
|
138
|
-
|
|
139
|
-
This changes my understanding significantly. [Summarize new understanding]
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
**If user confirms assumptions:**
|
|
143
|
-
|
|
144
|
-
```
|
|
145
|
-
Great, assumptions validated.
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
Continue to offer_next.
|
|
149
|
-
</step>
|
|
150
|
-
|
|
151
|
-
<step name="offer_next">
|
|
152
|
-
Present next steps:
|
|
153
|
-
|
|
154
|
-
```
|
|
155
|
-
What's next?
|
|
156
|
-
1. Discuss context (/ms:discuss-phase ${PHASE}) - Let me ask you questions to build comprehensive context
|
|
157
|
-
2. Plan this phase (/ms:plan-phase ${PHASE}) - Create detailed execution plans
|
|
158
|
-
3. Re-examine assumptions - I'll analyze again with your corrections
|
|
159
|
-
4. Done for now
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
Wait for user selection.
|
|
163
|
-
|
|
164
|
-
If "Discuss context": Note that CONTEXT.md will incorporate any corrections discussed here
|
|
165
|
-
If "Plan this phase": Proceed knowing assumptions are understood
|
|
166
|
-
If "Re-examine": Return to analyze_phase with updated understanding
|
|
167
|
-
</step>
|
|
168
|
-
|
|
169
|
-
</process>
|
|
170
|
-
|
|
171
|
-
<success_criteria>
|
|
172
|
-
- Phase number validated against roadmap
|
|
173
|
-
- Assumptions surfaced across five areas: technical approach, implementation order, scope, risks, dependencies
|
|
174
|
-
- Confidence levels marked where appropriate
|
|
175
|
-
- "What do you think?" prompt presented
|
|
176
|
-
- User feedback acknowledged
|
|
177
|
-
- Clear next steps offered
|
|
178
|
-
</success_criteria>
|