mobile-ai-agents 1.0.26 → 1.0.27
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 +3 -1
- package/docs/core-loops.md +3 -2
- package/docs/performance-loop.md +194 -0
- package/package.json +1 -1
- package/workflows/perf-sprint.md +2 -0
package/README.md
CHANGED
|
@@ -126,7 +126,7 @@ Platform Plugins: Android · iOS · Flutter · React Native · Kotlin Multiplatf
|
|
|
126
126
|
| Planning | Idea discovery, PRD, roadmap, task breakdown | `@APPFORGE`, `/grill-mobile`, `/feature-slice` |
|
|
127
127
|
| Architecture | System design, clean code, module boundaries, model separation | `@AXIOM`, `/clean-code-audit`, platform reviewers |
|
|
128
128
|
| Development | Feature implementation, UI build, refactor, code review | `@MOBILE-HARNESS`, `@FIGMA`, platform builders |
|
|
129
|
-
| Performance | Startup, ANR, memory leaks, frame drops, battery, network, app size | `@PERF`, `@FREEZE`, `@RETAINER`, `/perf-audit
|
|
129
|
+
| Performance | Startup, ANR, memory leaks, frame drops, battery, network, app size | `@PERF`, `@FREEZE`, `@RETAINER`, `/perf-audit`, [Performance Loop](docs/performance-loop.md) |
|
|
130
130
|
| Security | OWASP, secrets, auth, storage, deep links, WebView, permissions | `@SENTINEL`, `/security-audit`, `/security-scan` |
|
|
131
131
|
| Testing | Unit tests, UI tests, accessibility, PRD checks, device QA | `/mobile-mcp-qa`, TDD skills, accessibility audit |
|
|
132
132
|
| Release | CI/CD, signing, release notes, rollout, store checklist | `@PIPELINE`, `@SCRIBE`, `/release-prep` |
|
|
@@ -137,6 +137,8 @@ Security and performance are built into the loop before release. They are not op
|
|
|
137
137
|
|
|
138
138
|
Full guide: [docs/core-loops.md](docs/core-loops.md)
|
|
139
139
|
|
|
140
|
+
Performance guide: [docs/performance-loop.md](docs/performance-loop.md)
|
|
141
|
+
|
|
140
142
|
---
|
|
141
143
|
|
|
142
144
|
## See It In Action
|
package/docs/core-loops.md
CHANGED
|
@@ -69,7 +69,7 @@ The user should not have to manually prompt every stage. The system should stop
|
|
|
69
69
|
| Planning | Turn rough ideas into PRDs, roadmaps, and task slices. | `@APPFORGE`, `/grill-mobile`, `/feature-slice` |
|
|
70
70
|
| Architecture | Review system design, module boundaries, model separation, and clean code. | `@AXIOM`, `/clean-code-audit`, platform reviewers |
|
|
71
71
|
| Development | Implement one feature slice at a time and keep code scoped. | `@MOBILE-HARNESS`, `@FIGMA`, screen builders, code reviewers |
|
|
72
|
-
| Performance | Find and fix startup, ANR, memory, frame, battery, network, and size issues. | `@PERF`, `@FREEZE`, `@RETAINER`, `/perf-audit`, `/anr-investigation
|
|
72
|
+
| Performance | Find and fix startup, ANR, memory, frame, battery, network, and size issues. | `@PERF`, `@FREEZE`, `@RETAINER`, `/perf-audit`, `/anr-investigation`, [Performance Loop](performance-loop.md) |
|
|
73
73
|
| Security | Audit OWASP risks, secrets, auth, storage, deep links, WebViews, permissions, logs, and release hardening. | `@SENTINEL`, `security-scanner`, `/security-audit`, `/security-scan` |
|
|
74
74
|
| Testing | Add unit/UI tests, run device QA, check accessibility, and verify PRD/design match. | TDD skills, `/prd-verification`, `/mobile-mcp-qa`, `/accessibility-audit` |
|
|
75
75
|
| Release | Prepare CI/CD, signing, release notes, rollout, and store submission. | `@PIPELINE`, `@SCRIBE`, `/release-prep` |
|
|
@@ -117,6 +117,8 @@ Evidence: Play Console ANR trace, startup code, device reproduction
|
|
|
117
117
|
Output: root cause, fix, verification plan, regression check
|
|
118
118
|
```
|
|
119
119
|
|
|
120
|
+
Full Performance Loop guide: [performance-loop.md](performance-loop.md)
|
|
121
|
+
|
|
120
122
|
## Marketing Position
|
|
121
123
|
|
|
122
124
|
Use this sentence when explaining the repo:
|
|
@@ -138,6 +140,5 @@ The model is intentionally ahead of the full implementation. The strongest next
|
|
|
138
140
|
- `/prd-verification` rollout into Mobile Harness and APPFORGE evidence gates
|
|
139
141
|
- Mobile Flight Recorder
|
|
140
142
|
- Device Proof Reports
|
|
141
|
-
- dedicated Performance Loop reports
|
|
142
143
|
- dedicated Security Audit Loop reports
|
|
143
144
|
- Kotlin Multiplatform plugin assets
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
# Performance Loop
|
|
2
|
+
|
|
3
|
+
Performance is a first-class Mobile AI Agents loop. Use it when a mobile app is slow, janky, freezing, leaking memory, draining battery, using too much network, or growing too large.
|
|
4
|
+
|
|
5
|
+
The loop is evidence-first: measure the symptom, choose the right agent or skill, apply the smallest fix, re-measure, save the baseline, and monitor for regressions.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## What It Covers
|
|
10
|
+
|
|
11
|
+
| Area | Symptoms | Best Starting Point |
|
|
12
|
+
|---|---|---|
|
|
13
|
+
| Startup | Cold start, hot start, slow splash, app open delay | `@PERF`, `/perf-audit` |
|
|
14
|
+
| ANR | Frozen UI, input timeout, Play Console ANR | `@FREEZE`, `/anr-investigation` |
|
|
15
|
+
| Memory leaks | Retained Fragment/View/Activity, growing heap, OOM | `@RETAINER`, `/memory-leak-investigation` |
|
|
16
|
+
| Frame drops / jank | Slow scroll, dropped frames, animation stutter | `@PERF`, `/perf-audit`, platform reviewer |
|
|
17
|
+
| Battery | High CPU wakeups, background work, location abuse | `@PERF`, `/perf-audit` |
|
|
18
|
+
| Network | Chatty requests, large payloads, retry storms | `@PERF`, `/perf-audit` |
|
|
19
|
+
| Bundle / app size | Large APK/AAB/IPA, slow download, bloated assets | `@PERF`, `/perf-audit` |
|
|
20
|
+
| Slow screens | Heavy render, blocking IO, expensive lists | `@PERF`, `/perf-audit` |
|
|
21
|
+
| Regression monitoring | Performance gets worse after a PR or release | `perf-sprint`, Mobile Harness |
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Agent And Skill Map
|
|
26
|
+
|
|
27
|
+
| Need | Agent Or Skill | Use It For |
|
|
28
|
+
|---|---|---|
|
|
29
|
+
| Broad performance diagnosis | `@PERF` | Find bottlenecks, prioritize fixes, define measurements |
|
|
30
|
+
| Android ANR investigation | `@FREEZE`, `/anr-investigation` | Thread, lock, binder, and timeout analysis |
|
|
31
|
+
| Android memory leak analysis | `@RETAINER`, `/memory-leak-investigation` | LeakCanary reference path and lifecycle ownership |
|
|
32
|
+
| Screen-level profiling | `/perf-audit` | Main thread, rendering, memory, list, and fix ranking |
|
|
33
|
+
| Compose UI jank | `/compose-review`, `compose-ui-reviewer` | Recomposition, LazyColumn keys, effects, state stability |
|
|
34
|
+
| Flutter rebuilds | `/flutter-review`, `@DART` | Widget rebuilds, state, layout, async handling |
|
|
35
|
+
| React Native re-renders | `performance-optimizer`, `/rn-performance`, `@BRIDGE` | React memoization, FlatList, bridge hot paths |
|
|
36
|
+
| Unity frame budget | `@FORGE`, `/game-perf` | Update loops, GC allocations, draw calls, physics |
|
|
37
|
+
| Device validation | `/mobile-mcp-qa`, `device-proof-report` | Verify performance-sensitive flows on a target device |
|
|
38
|
+
| Delivery orchestration | `@MOBILE-HARNESS`, `perf-sprint` | Run checks after implementation and save evidence |
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Loop Steps
|
|
43
|
+
|
|
44
|
+
```text
|
|
45
|
+
1. IDENTIFY SYMPTOM
|
|
46
|
+
-> Startup, ANR, memory leak, jank, battery, network, size, or slow screen.
|
|
47
|
+
|
|
48
|
+
2. COLLECT EVIDENCE
|
|
49
|
+
-> Device model, OS, app version, commit, user flow, baseline numbers, traces, screenshots, logs.
|
|
50
|
+
|
|
51
|
+
3. CHOOSE ROUTE
|
|
52
|
+
-> Select the smallest matching agent or skill from the map.
|
|
53
|
+
|
|
54
|
+
4. ANALYZE ROOT CAUSE
|
|
55
|
+
-> Name the hot function, blocked thread, retained owner, expensive render path, or oversized asset.
|
|
56
|
+
|
|
57
|
+
5. APPLY SMALLEST SAFE FIX
|
|
58
|
+
-> Change one bottleneck at a time so improvement can be attributed.
|
|
59
|
+
|
|
60
|
+
6. VERIFY WITH MEASUREMENTS
|
|
61
|
+
-> Re-run the same flow on the same target and compare before/after numbers.
|
|
62
|
+
|
|
63
|
+
7. SAVE PERFORMANCE BASELINE
|
|
64
|
+
-> Write `PERFORMANCE_AUDIT_REPORT.md` and store trace/screenshot links.
|
|
65
|
+
|
|
66
|
+
8. MONITOR REGRESSIONS
|
|
67
|
+
-> Add a test, CI threshold, release gate, or follow-up task when possible.
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Evidence To Collect
|
|
73
|
+
|
|
74
|
+
| Platform | Evidence |
|
|
75
|
+
|---|---|
|
|
76
|
+
| Android | Play Console ANR cluster, `traces.txt`, Perfetto/Systrace, Android Studio Profiler, LeakCanary trace, APK Analyzer output, device model, API level |
|
|
77
|
+
| iOS | Instruments Time Profiler, Core Animation, Allocations/Leaks, MetricKit, Xcode Organizer reports, device model, iOS version |
|
|
78
|
+
| Flutter | Flutter DevTools Performance and Memory tabs, rebuild counts, timeline flame chart, package size output |
|
|
79
|
+
| React Native | React DevTools Profiler, Flipper Perf Monitor, Hermes profile, Metro bundle size, native traces |
|
|
80
|
+
| Unity | Unity Profiler, frame debugger, memory snapshot, draw call count, texture memory, target device |
|
|
81
|
+
| Unreal | Unreal Insights, stat unit, stat game, stat RHI, render thread timing, packaged build size |
|
|
82
|
+
|
|
83
|
+
If there is no baseline, the result is `BLOCKED` or `UNKNOWN`. Do not claim a performance fix without re-measuring.
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Android Examples
|
|
88
|
+
|
|
89
|
+
### ANR During Startup
|
|
90
|
+
|
|
91
|
+
```text
|
|
92
|
+
Symptom: Play Console reports "Input dispatching timed out" during app launch.
|
|
93
|
+
Evidence: ANR trace shows main thread blocked in RoomDatabase.query().
|
|
94
|
+
Route: @FREEZE + /anr-investigation.
|
|
95
|
+
Fix: Move startup database read to Dispatchers.IO and defer non-critical initialization.
|
|
96
|
+
Verify: Compare cold start time and confirm no main-thread DB query appears in trace.
|
|
97
|
+
Report: PERFORMANCE_AUDIT_REPORT.md with ANR cluster link, before/after startup time, and trace links.
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Fragment Memory Leak
|
|
101
|
+
|
|
102
|
+
```text
|
|
103
|
+
Symptom: Heap grows after opening and closing ProfileFragment.
|
|
104
|
+
Evidence: LeakCanary shows RecyclerView retaining ProfileAdapter, which retains Fragment views.
|
|
105
|
+
Route: @RETAINER + /memory-leak-investigation.
|
|
106
|
+
Fix: Clear RecyclerView adapter in onDestroyView() and remove view references from adapter callbacks.
|
|
107
|
+
Verify: Reopen/close ProfileFragment five times and confirm LeakCanary no longer reports retained Fragment.
|
|
108
|
+
Report: PERFORMANCE_AUDIT_REPORT.md with retained size before/after and LeakCanary evidence.
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## Cross-Platform Examples
|
|
114
|
+
|
|
115
|
+
| Platform | Symptom | Route | Verification |
|
|
116
|
+
|---|---|---|---|
|
|
117
|
+
| iOS | Slow SwiftUI list scroll | `@PERF`, `@SWIFT`, `/ios-performance` | Instruments Core Animation frame times improve |
|
|
118
|
+
| Flutter | Product grid rebuilds every item | `@DART`, `/flutter-review`, `/perf-audit` | DevTools shows fewer rebuilds and frame times under 16ms |
|
|
119
|
+
| React Native | Feed drops frames on like button | `performance-optimizer`, `/rn-performance` | React Profiler shows fewer row renders |
|
|
120
|
+
| Unity | Mobile level spikes GC every few seconds | `@FORGE`, `/game-perf` | Unity Profiler shows no hot-path GC.Alloc spikes |
|
|
121
|
+
| Unreal | Blueprint Tick runs expensive logic | `@UNREAL`, `/game-perf` | Unreal Insights shows reduced game thread time |
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## Report Format
|
|
126
|
+
|
|
127
|
+
Create:
|
|
128
|
+
|
|
129
|
+
```text
|
|
130
|
+
PERFORMANCE_AUDIT_REPORT.md
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Use this deterministic format:
|
|
134
|
+
|
|
135
|
+
```markdown
|
|
136
|
+
# Performance Audit Report
|
|
137
|
+
|
|
138
|
+
## Summary
|
|
139
|
+
Result: PASS | FAIL | BLOCKED
|
|
140
|
+
Platform:
|
|
141
|
+
Device:
|
|
142
|
+
OS Version:
|
|
143
|
+
App Version:
|
|
144
|
+
Commit:
|
|
145
|
+
Flow:
|
|
146
|
+
Performance Area: Startup | ANR | Memory | Frame | Battery | Network | Size | Slow Screen | Regression
|
|
147
|
+
|
|
148
|
+
## Baseline
|
|
149
|
+
| Metric | Before | Target | Evidence |
|
|
150
|
+
|---|---:|---:|---|
|
|
151
|
+
|
|
152
|
+
## Findings
|
|
153
|
+
| ID | Severity | Area | Evidence | Root Cause | Fix Summary |
|
|
154
|
+
|---|---|---|---|---|---|
|
|
155
|
+
|
|
156
|
+
## Finding Details
|
|
157
|
+
### PERF-001 - <short title>
|
|
158
|
+
- Severity:
|
|
159
|
+
- Area:
|
|
160
|
+
- Evidence:
|
|
161
|
+
- Root Cause:
|
|
162
|
+
- Fix:
|
|
163
|
+
- Verification:
|
|
164
|
+
- Regression Guard:
|
|
165
|
+
|
|
166
|
+
## Changes Made
|
|
167
|
+
| File | Change | Reason |
|
|
168
|
+
|---|---|---|
|
|
169
|
+
|
|
170
|
+
## Verification
|
|
171
|
+
| Metric | Before | After | Result | Evidence |
|
|
172
|
+
|---|---:|---:|---|---|
|
|
173
|
+
|
|
174
|
+
## Device Or Trace Evidence
|
|
175
|
+
- <trace, screenshot, profiler export, issue, or report link>
|
|
176
|
+
|
|
177
|
+
## Regression Monitoring
|
|
178
|
+
- <test, CI threshold, dashboard, alert, or follow-up issue>
|
|
179
|
+
|
|
180
|
+
## Next Actions
|
|
181
|
+
1. <highest priority next fix or "None">
|
|
182
|
+
2. <next fix or "None">
|
|
183
|
+
3. <next fix or "None">
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## Pass/Fail Rules
|
|
189
|
+
|
|
190
|
+
- `PASS`: The measured bottleneck improved or meets target, and evidence is attached.
|
|
191
|
+
- `FAIL`: The bottleneck remains, got worse, or lacks a safe fix.
|
|
192
|
+
- `BLOCKED`: Required evidence, device, build, credentials, or profiler access is missing.
|
|
193
|
+
|
|
194
|
+
Performance work is complete only when the report includes before/after measurements and a regression monitoring decision.
|
package/package.json
CHANGED
package/workflows/perf-sprint.md
CHANGED
|
@@ -44,6 +44,7 @@ When users are reporting slow performance, or before a major release as a perfor
|
|
|
44
44
|
↓ Document: before numbers, after numbers, what changed.
|
|
45
45
|
|
|
46
46
|
6. DOCUMENT
|
|
47
|
+
↓ Write PERFORMANCE_AUDIT_REPORT.md.
|
|
47
48
|
↓ Add before/after screenshots to PR description.
|
|
48
49
|
↓ Link to profiler traces in the PR.
|
|
49
50
|
↓ Add a performance test or threshold to CI so it doesn't regress.
|
|
@@ -75,4 +76,5 @@ When users are reporting slow performance, or before a major release as a perfor
|
|
|
75
76
|
|
|
76
77
|
- Measured baseline vs. improved numbers
|
|
77
78
|
- Code changes with documented performance rationale
|
|
79
|
+
- `PERFORMANCE_AUDIT_REPORT.md`
|
|
78
80
|
- Performance CI gate to prevent regression
|