@bdayadev/flutter-ultra-mcp 1.3.2 → 1.4.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/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/dart/ultra_flutter/pubspec.yaml +0 -2
- package/dart/ultra_flutter_devtools/pubspec.yaml +0 -2
- package/examples/counter-app/README.md +5 -5
- package/examples/oidc-app/README.md +10 -8
- package/package.json +1 -1
- package/packages/flutter-ultra-browser/package.json +1 -1
- package/packages/flutter-ultra-build/package.json +1 -1
- package/packages/flutter-ultra-devtools/package.json +1 -1
- package/packages/flutter-ultra-gesture/package.json +1 -1
- package/packages/flutter-ultra-native-desktop/package.json +1 -1
- package/packages/flutter-ultra-native-mobile/package.json +1 -1
- package/packages/flutter-ultra-patrol/README.md +5 -5
- package/packages/flutter-ultra-patrol/package.json +1 -1
- package/packages/flutter-ultra-runtime/package.json +1 -1
- package/shared/contracts/package.json +2 -2
- package/shared/device-router/package.json +1 -1
- package/shared/keyring/package.json +1 -1
- package/shared/mcp-runtime/package.json +1 -1
- package/shared/state-store/package.json +1 -1
- package/shared/vm-service-client/package.json +1 -1
- package/skills/bisect/SKILL.md +202 -0
- package/skills/debug/SKILL.md +145 -9
- package/skills/devtools/SKILL.md +120 -10
- package/skills/drive/SKILL.md +132 -9
- package/skills/scaffold/SKILL.md +155 -9
- package/skills/setup/SKILL.md +140 -16
- package/skills/test/SKILL.md +159 -8
- package/skills/tour/SKILL.md +91 -12
package/skills/test/SKILL.md
CHANGED
|
@@ -1,19 +1,170 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: test
|
|
2
|
+
name: flutter-test
|
|
3
3
|
description: Orchestrating Flutter unit, widget, and patrol E2E tests with focused reporting. Use when the user asks to run tests, validate a fix, or check coverage on a Flutter project.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Test
|
|
6
|
+
# flutter-test — Test Orchestration
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
## When to use
|
|
9
|
+
|
|
10
|
+
Use this skill when the user asks to run tests, validate that a fix works, check coverage, or triage a failing CI test suite locally. This skill covers all three Flutter test layers: unit, widget, and patrol E2E. For ad-hoc interactive flow verification without a written test, use `flutter-drive` instead.
|
|
11
|
+
|
|
12
|
+
## Prerequisites
|
|
13
|
+
|
|
14
|
+
- A Flutter project is available and identifiable (pubspec.yaml present).
|
|
15
|
+
- For patrol E2E: the app must be buildable for the target device/web. A connected device or emulator is required for mobile E2E.
|
|
16
|
+
- For coverage reports: `lcov` must be available on the host, or the skill produces the raw `lcov.info` path for the user.
|
|
9
17
|
|
|
10
18
|
## Workflow
|
|
11
19
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
- `
|
|
15
|
-
-
|
|
20
|
+
### 1. Identify the project and test scope
|
|
21
|
+
|
|
22
|
+
- Call `mcp__plugin_flutter_flutter-ultra-build__list_projects` to find available projects.
|
|
23
|
+
- Call `mcp__plugin_flutter_flutter-ultra-build__project_info` for the target project to confirm the project path and available flavors.
|
|
24
|
+
- Determine the test scope from the user's request:
|
|
25
|
+
- **Unit/widget only** → sections 2–3
|
|
26
|
+
- **Patrol E2E only** → section 4
|
|
27
|
+
- **Full suite** → sections 2–4 in order
|
|
28
|
+
- **Coverage** → section 2 with coverage flag, then section 5
|
|
29
|
+
|
|
30
|
+
### 2. Static analysis first (fail fast)
|
|
31
|
+
|
|
32
|
+
Before running any tests, call `mcp__plugin_flutter_flutter-ultra-build__analyze` on the project.
|
|
33
|
+
|
|
34
|
+
- If analysis returns errors (not warnings): report them and stop — tests will fail to compile anyway.
|
|
35
|
+
- If analysis returns only warnings: continue but include the warning count in the final report.
|
|
36
|
+
|
|
37
|
+
### 3. Unit and widget tests
|
|
38
|
+
|
|
39
|
+
**Start the test run:**
|
|
40
|
+
|
|
41
|
+
- Unit tests: `mcp__plugin_flutter_flutter-ultra-build__start_run_unit_tests`
|
|
42
|
+
- Pass `testNamePattern` to scope to a specific test file or test name regex (e.g. `invoice_bloc_test`, `.*BlocTest.*`).
|
|
43
|
+
- Pass `coverage: true` when the user requests coverage.
|
|
44
|
+
- Widget tests: `mcp__plugin_flutter_flutter-ultra-build__start_run_widget_tests`
|
|
45
|
+
- Same pattern filtering applies.
|
|
46
|
+
|
|
47
|
+
**Poll until complete:**
|
|
48
|
+
|
|
49
|
+
- Call `mcp__plugin_flutter_flutter-ultra-build__poll_run_unit_tests` (or `poll_run_widget_tests`) in a loop until status is `completed` or `failed`.
|
|
50
|
+
- Poll interval: respect the tool's natural response time; do not sleep artificially.
|
|
51
|
+
|
|
52
|
+
**Get results:**
|
|
53
|
+
|
|
54
|
+
- Call `mcp__plugin_flutter_flutter-ultra-build__get_run_unit_tests_result` (or `get_run_widget_tests_result`).
|
|
55
|
+
- Parse: total tests, passed, failed, skipped, duration.
|
|
56
|
+
- For each failure: extract test name, file path, line number, and failure message.
|
|
57
|
+
|
|
58
|
+
**Cancellation:** if the user interrupts, call `mcp__plugin_flutter_flutter-ultra-build__cancel_run_unit_tests` (or `cancel_run_widget_tests`).
|
|
59
|
+
|
|
60
|
+
### 4. Patrol E2E tests
|
|
61
|
+
|
|
62
|
+
**Discover available tests:**
|
|
63
|
+
|
|
64
|
+
- Call `mcp__plugin_flutter_flutter-ultra-patrol__list_tests` to enumerate test files and individual test names in `integration_test/`.
|
|
65
|
+
|
|
66
|
+
**Start a patrol run:**
|
|
67
|
+
|
|
68
|
+
- Call `mcp__plugin_flutter_flutter-ultra-patrol__start_patrol_test` with:
|
|
69
|
+
- `testFilePath` or `testName` to scope the run.
|
|
70
|
+
- `device` for the target (web, emulator ID, or physical device ID from `mcp__plugin_flutter_flutter-ultra-runtime__list_devices`).
|
|
71
|
+
- `flavor` if the project uses flavors.
|
|
72
|
+
|
|
73
|
+
**Poll until complete:**
|
|
74
|
+
|
|
75
|
+
- Call `mcp__plugin_flutter_flutter-ultra-patrol__poll_patrol_job` in a loop until done.
|
|
76
|
+
- While polling, optionally call `mcp__plugin_flutter_flutter-ultra-patrol__take_patrol_screenshot` at key intervals to capture mid-test state.
|
|
77
|
+
|
|
78
|
+
**Get enriched results:**
|
|
79
|
+
|
|
80
|
+
- Call `mcp__plugin_flutter_flutter-ultra-patrol__get_patrol_result`.
|
|
81
|
+
- The result includes:
|
|
82
|
+
- Pass/fail per test step
|
|
83
|
+
- `logContext`: log lines captured around the failure point
|
|
84
|
+
- Screenshot paths captured during the test
|
|
85
|
+
- Browser console errors (for web): call `mcp__plugin_flutter_flutter-ultra-patrol__get_patrol_browser_errors` for additional detail.
|
|
86
|
+
|
|
87
|
+
**For web E2E failures**: also call `mcp__plugin_flutter_flutter-ultra-patrol__get_patrol_web_debugger_port` to get the Chrome DevTools port, then use `mcp__plugin_flutter_flutter-ultra-browser__connect_over_cdp` for deeper inspection.
|
|
88
|
+
|
|
89
|
+
**Cancellation:** call `mcp__plugin_flutter_flutter-ultra-patrol__cancel_patrol_job` if interrupted.
|
|
90
|
+
|
|
91
|
+
### 5. Coverage report (when requested)
|
|
92
|
+
|
|
93
|
+
After unit tests complete with `coverage: true`:
|
|
94
|
+
|
|
95
|
+
- The build server writes `coverage/lcov.info` relative to the project root.
|
|
96
|
+
- Call `mcp__plugin_flutter_flutter-ultra-build__get_run_unit_tests_result` — the result includes the coverage file path.
|
|
97
|
+
- Report the top-level line coverage percentage if parseable.
|
|
98
|
+
- If the user wants an HTML report: note that they can run `genhtml coverage/lcov.info -o coverage/html` locally.
|
|
99
|
+
- Do not attempt to parse `lcov.info` manually — report the file path and overall percentage only.
|
|
100
|
+
|
|
101
|
+
### 6. Golden test handling
|
|
102
|
+
|
|
103
|
+
When the user asks to update or validate golden screenshots:
|
|
104
|
+
|
|
105
|
+
- **Validate**: `mcp__plugin_flutter_flutter-ultra-build__start_run_golden_tests` → `poll_run_golden_tests` → `get_run_golden_tests_result`.
|
|
106
|
+
- **Update**: `mcp__plugin_flutter_flutter-ultra-build__start_update_goldens` → `poll_update_goldens` → `get_update_goldens_result`.
|
|
107
|
+
- After updating, note that the changed `.png` files in `test/goldens/` must be committed.
|
|
108
|
+
|
|
109
|
+
## Failure triage
|
|
110
|
+
|
|
111
|
+
When tests fail, apply this triage sequence:
|
|
112
|
+
|
|
113
|
+
1. **Compilation errors** (test file won't load): surface the exact error from the result — usually a missing import or type mismatch. Fix the test file if asked.
|
|
114
|
+
2. **Assertion failures** (expected ≠ actual): show the test name, expected value, actual value, and file:line. Do not auto-fix unless asked.
|
|
115
|
+
3. **Timeout failures**: check if the test awaits a Future that never resolves. Suggest checking if `pumpAndSettle` is waiting on an infinite animation.
|
|
116
|
+
4. **Patrol E2E failures**: read `logContext` from `get_patrol_result` — it contains the log lines immediately before the failure. Cross-reference with `get_patrol_browser_errors` for web.
|
|
117
|
+
5. **Screenshot on failure**: patrol captures screenshots automatically on failure; report the path. For unit/widget failures, call `mcp__plugin_flutter_flutter-ultra-runtime__screenshot` if the app is running in debug mode.
|
|
118
|
+
|
|
119
|
+
## Output format
|
|
120
|
+
|
|
121
|
+
After all test layers complete, produce a structured summary:
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
## Test Results
|
|
125
|
+
|
|
126
|
+
| Layer | Total | Passed | Failed | Skipped | Duration |
|
|
127
|
+
|-------|-------|--------|--------|---------|----------|
|
|
128
|
+
| Unit | 42 | 41 | 1 | 0 | 3.2s |
|
|
129
|
+
| Widget| 18 | 18 | 0 | 0 | 8.1s |
|
|
130
|
+
| E2E | 5 | 4 | 1 | 0 | 47s |
|
|
131
|
+
|
|
132
|
+
### Failures
|
|
133
|
+
|
|
134
|
+
**Unit: invoice_bloc_test.dart:87** — `InvoiceListBloc`
|
|
135
|
+
Expected: `InvoiceListLoaded` with 3 items
|
|
136
|
+
Got: `InvoiceListLoaded` with 0 items
|
|
137
|
+
|
|
138
|
+
**E2E: login_flow_test.dart — "should redirect to dashboard after login"**
|
|
139
|
+
Log context: [ERROR] ZitadelException: invalid_client at 14:23:01.332
|
|
140
|
+
Screenshot: .omc/research/patrol-2026-05-19/login_flow_failure.png
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Include the coverage percentage at the bottom if coverage was requested.
|
|
144
|
+
|
|
145
|
+
## Example
|
|
146
|
+
|
|
147
|
+
```
|
|
148
|
+
User: "Run the full test suite for the Invora Flutter app and show me what's failing."
|
|
149
|
+
|
|
150
|
+
1. list_projects → project: clients/invora/invora-flutter
|
|
151
|
+
2. analyze → 0 errors, 3 warnings (continue)
|
|
152
|
+
3. start_run_unit_tests(project: "invora-flutter") → jobId: "unit-001"
|
|
153
|
+
4. poll_run_unit_tests(jobId: "unit-001") → completed
|
|
154
|
+
5. get_run_unit_tests_result → 42 total, 1 failed: invoice_bloc_test.dart:87
|
|
155
|
+
6. start_run_widget_tests(project: "invora-flutter") → jobId: "widget-001"
|
|
156
|
+
7. poll_run_widget_tests → completed, 18/18 passed
|
|
157
|
+
8. list_tests(project: "invora-flutter") → 5 patrol tests
|
|
158
|
+
9. start_patrol_test(testFilePath: "integration_test/", device: "web") → jobId: "patrol-001"
|
|
159
|
+
10. poll_patrol_job → completed, 1 failed: login_flow_test.dart
|
|
160
|
+
11. get_patrol_result → logContext: "ZitadelException: invalid_client", screenshot path
|
|
161
|
+
12. get_patrol_browser_errors → CORS error on /oauth/v2/token
|
|
162
|
+
→ Report table + failure details
|
|
163
|
+
```
|
|
16
164
|
|
|
17
165
|
## See also
|
|
18
166
|
|
|
19
|
-
-
|
|
167
|
+
- Sibling skill: `flutter-drive` for ad-hoc interactive flow automation without a written test
|
|
168
|
+
- Sibling skill: `flutter-debug` for live runtime triage after a test exposes a bug
|
|
169
|
+
- `mcp__plugin_flutter_flutter-ultra-patrol__get_patrol_result` — enriched E2E failure context
|
|
170
|
+
- `mcp__plugin_flutter_flutter-ultra-build__test_filter` — narrow test scope by name or file pattern
|
package/skills/tour/SKILL.md
CHANGED
|
@@ -1,22 +1,101 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: tour
|
|
2
|
+
name: flutter-tour
|
|
3
3
|
description: Running route-by-route screenshot tours of a Flutter app. Use when capturing visual state across many app routes, doing pre-release visual regression sweeps, or documenting a feature's UI for review.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Route Tour
|
|
6
|
+
# flutter-tour — Route Screenshot Tour
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
## When to use
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Use this skill when the user asks to visually document the app, capture all screens for review, or perform a pre-release sweep of the UI. Also use it when producing a screenshot inventory for a design QA pass.
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
## Prerequisites
|
|
13
|
+
|
|
14
|
+
- A Flutter app is already running in debug mode (or can be launched via `mcp__plugin_flutter_flutter-ultra-runtime__launch_app`).
|
|
15
|
+
- For web tours: a browser context is available or can be created via `mcp__plugin_flutter_flutter-ultra-browser__launch_browser`.
|
|
16
|
+
- The app uses GoRouter or Navigator 2.0 (route list can be discovered via `evaluate`).
|
|
17
|
+
|
|
18
|
+
## Workflow
|
|
19
|
+
|
|
20
|
+
1. **Attach to the running session**
|
|
21
|
+
- Call `mcp__plugin_flutter_flutter-ultra-runtime__discover_sessions` to find active sessions.
|
|
22
|
+
- If none, call `mcp__plugin_flutter_flutter-ultra-runtime__launch_app` with the target project/flavor.
|
|
23
|
+
- Call `mcp__plugin_flutter_flutter-ultra-runtime__attach` with the chosen `sessionId`.
|
|
24
|
+
|
|
25
|
+
2. **Discover routes**
|
|
26
|
+
- Call `mcp__plugin_flutter_flutter-ultra-runtime__evaluate` with:
|
|
27
|
+
```dart
|
|
28
|
+
import 'package:go_router/go_router.dart';
|
|
29
|
+
final router = GoRouter.of(context);
|
|
30
|
+
router.configuration.routes.map((r) => r.path).toList().toString()
|
|
31
|
+
```
|
|
32
|
+
- If GoRouter is not used, call `mcp__plugin_flutter_flutter-ultra-runtime__get_widget_tree` and look for `Navigator` or `MaterialApp` `routes` keys.
|
|
33
|
+
- If the user supplied a route list explicitly, use that directly.
|
|
34
|
+
|
|
35
|
+
3. **For each route** (iterate in order):
|
|
36
|
+
a. Navigate via evaluate:
|
|
37
|
+
|
|
38
|
+
```dart
|
|
39
|
+
context.go('/your-route');
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Or for named routes: `context.goNamed('routeName')`.
|
|
43
|
+
b. Wait for the UI to settle — call `mcp__plugin_flutter_flutter-ultra-runtime__evaluate` with `SchedulerBinding.instance.endOfFrame` to await the next frame.
|
|
44
|
+
c. Take a screenshot: `mcp__plugin_flutter_flutter-ultra-runtime__screenshot` — save path as `.omc/research/tour-<YYYY-MM-DD>/<route-slug>.png` where `route-slug` replaces `/` with `-` and strips leading `-`.
|
|
45
|
+
d. For **web targets**: also call `mcp__plugin_flutter_flutter-ultra-browser__screenshot` for a pixel-perfect browser-rendered capture alongside the VM-service capture.
|
|
46
|
+
e. Record the mapping `{ route, file, timestamp, title }` for the report.
|
|
47
|
+
|
|
48
|
+
4. **Handle auth-gated routes**
|
|
49
|
+
- If a route redirects to a login screen, detect it by checking the widget tree for a login form key or `LoginPage` widget type.
|
|
50
|
+
- Perform login via `mcp__plugin_flutter_flutter-ultra-runtime__evaluate` (inject credentials into state) or via gesture tools.
|
|
51
|
+
- Retry the navigation after authentication.
|
|
52
|
+
|
|
53
|
+
5. **Compile the report**
|
|
54
|
+
- Write `.omc/research/tour-<date>/tour-report.md` with a markdown table:
|
|
55
|
+
```markdown
|
|
56
|
+
| Route | Screenshot | Notes |
|
|
57
|
+
| ----- | ---------------------- | ----- |
|
|
58
|
+
| /home | [home.png](./home.png) | |
|
|
59
|
+
```
|
|
60
|
+
- List any routes that could not be captured and the reason (auth wall, crash, async timeout).
|
|
61
|
+
|
|
62
|
+
## Handling edge cases
|
|
63
|
+
|
|
64
|
+
- **Auth-gated routes**: detect redirect to login by calling `mcp__plugin_flutter_flutter-ultra-runtime__get_widget_tree` after navigation and checking top-level widget type. Authenticate first, then retry.
|
|
65
|
+
- **Routes with async data**: after `context.go(...)`, await `SchedulerBinding.instance.endOfFrame` and optionally call `evaluate` to check if a loading indicator is still present (`find.byType(CircularProgressIndicator).evaluate().isNotEmpty`). Wait up to 5 seconds in 500 ms increments.
|
|
66
|
+
- **Routes that cause errors**: catch exceptions from `evaluate`; log the error in the report and continue to the next route.
|
|
67
|
+
- **Parameterized routes** (e.g. `/item/:id`): substitute a known test ID, e.g. `/item/1`. Ask the user for sample IDs if none are obvious from context.
|
|
68
|
+
- **Bottom sheets / dialogs**: these are not routes in GoRouter. Capture them by triggering them via `evaluate` after navigating to the parent route, screenshot, then dismiss.
|
|
69
|
+
|
|
70
|
+
## Output format
|
|
71
|
+
|
|
72
|
+
At the end of the tour, produce:
|
|
73
|
+
|
|
74
|
+
1. A summary message listing how many routes were captured successfully vs. skipped.
|
|
75
|
+
2. The path to `tour-report.md`.
|
|
76
|
+
3. Inline markdown image links for any screenshots already visible in context (first 3 max to avoid flooding).
|
|
77
|
+
|
|
78
|
+
## Example
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
User: "Take a screenshot tour of the Invora app — all routes."
|
|
82
|
+
|
|
83
|
+
1. discover_sessions → sessionId: "flutter-1"
|
|
84
|
+
2. attach(sessionId: "flutter-1")
|
|
85
|
+
3. evaluate → routes: ["/", "/login", "/dashboard", "/invoices", "/invoices/:id", "/settings"]
|
|
86
|
+
4. For "/":
|
|
87
|
+
- evaluate: context.go('/')
|
|
88
|
+
- evaluate: await SchedulerBinding.instance.endOfFrame
|
|
89
|
+
- screenshot → .omc/research/tour-2026-05-19/-home.png
|
|
90
|
+
5. For "/login":
|
|
91
|
+
- evaluate: context.go('/login')
|
|
92
|
+
- screenshot → .omc/research/tour-2026-05-19/-login.png
|
|
93
|
+
... (repeat for each route)
|
|
94
|
+
6. Write tour-report.md with table of all routes + image links.
|
|
95
|
+
```
|
|
18
96
|
|
|
19
97
|
## See also
|
|
20
98
|
|
|
21
|
-
-
|
|
22
|
-
-
|
|
99
|
+
- Sibling skill: `flutter-drive` for multi-step interaction flows
|
|
100
|
+
- `mcp__plugin_flutter_flutter-ultra-runtime__evaluate` — arbitrary Dart expression evaluation in app context
|
|
101
|
+
- `mcp__plugin_flutter_flutter-ultra-browser__screenshot` — browser-level screenshot for web targets
|