/core:mobiai-mobile-debuggingfrom core
Guides root-cause analysis for mobile bugs, test failures, and crashes before any fix is proposed. Enforces phased evidence gathering with fast and gated paths.
Ships in core. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Random fixes waste time and create new bugs. Quick patches mask underlying issues.
Core principle: ALWAYS find root cause before attempting fixes. Symptom fixes are failure.
You MUST NOT propose any fix, write any code, edit any production file, refactor any surrounding code, or invoke `mobiai-mobile-tdd` until you have (a) gathered evidence, (b) separated what is known from what is assumed, (c) formed and verified a hypothesis, and (d) stated the root cause.Whether you also need explicit user confirmation at steps (b) and (d) depends on the scope classification inherited from the caller (or declared at Pre-flight below). Fast path: no confirmation gate, proceed autonomously. Gated path: explicit confirmation required at both steps.
The most common failure mode is pattern-matching the symptom to a familiar-looking cause and proposing a fix before the evidence supports it — especially when a sub-agent or exploration returns a confident diagnosis that was never cross-checked against the code. Threading, null, lifecycle, cache, "the backend changed" — all tempting guesses. Every bug goes through the phased flow.
The scope classification only changes whether you wait for user confirmation, not whether you do the analysis. Fast path still gathers evidence, splits known vs. assumed, forms and verifies a hypothesis, and states the root cause — it just returns that result to the caller instead of pausing for approval.
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
This skill inherits the scope from its caller (typically mobiai-fix-issue). If invoked standalone, classify at the start:
Fast path — work autonomously through all phases; return the verified root cause to the caller at Phase 6:
Gated path — stop and wait for user confirmation at Phase 2 and Phase 5:
In doubt → gated path.
You MUST create a task for each of these items and complete them in order. Do not skip phases. Do not merge phases.
mobiai-fix-issue if the broader pipeline is active, or invoke mobiai-mobile-tddUse for ANY mobile technical issue:
Use this ESPECIALLY when:
Don't skip when:
Standalone invocations only — skip this section when called from mobiai-fix-issue, which already runs its own pre-flight review and would otherwise double-prompt.
If <repo>/.mobiai/brain/config.json exists, do a quick review pass before forming hypotheses. The issue you're investigating might be related to a known workaround already logged as temporary debt; checking up front prevents re-deriving an answer that's already in the brain.
Preferred — MCP tool (when mobiai-brain MCP server is registered):
Invoke mobile_review with default args. From the returned overdue list, focus on entries whose platform matches the project's platform and whose area overlaps with the symptoms (component, module, feature where the bug shows up). Run mobile_scan first if you don't already know the project's platform.
Fallback — CLI:
mobiai brain review --no-fail
If 1+ overdue entries match, mention them to the user before Phase 1:
"Heads up — there are N overdue temporary workaround(s) in / that may relate to what you're seeing: . I'll proceed with the investigation; let me know if you want to look at those first."
Then continue with Phase 1. Don't pause unless asked. Skip silently when:
Standalone invocations only — skip this section when called from mobiai-fix-issue, which already runs its own Graph pre-flight at Phase 1.
The Graph indexes Kotlin/Swift symbols and can rank files by relevance to a symptom — useful for Phase 1 (Gather Evidence) and Phase 3 (Form a Hypothesis). Brain says "what's known about this area"; Graph says "where the affected code lives today".
If <repo>/.mobiai/graph/index.json exists:
# Freshness — if "hace Xd" with X ≥ 1, suggest refresh (don't auto-run):
mobiai graph status
# Locate relevant files from the symptom (top results = where to look first):
mobiai graph context "<one-line symptom or bug title>"
# If a symbol appears in the stack trace, find its callers:
mobiai graph callers <SymbolFromStackTrace>
If the index is ≥1 day old, mention it to the user before continuing:
"El índice del Graph es de hace Xd. Si querés resultados frescos, corré
mobiai graph init."
Don't run init autonomously — let the user decide.
If .mobiai/graph/index.json does not exist and the project has .kt or .swift files:
"No veo el índice del Graph. Generalo con
mobiai graph inity vuelvo a buscar — sin él tengo que grep a ciegas y leer más archivos de los necesarios."
Don't run init autonomously.
Skip silently when:
Before forming any opinion, collect the raw material.
Read error messages carefully
Confirm reproducibility
| Platform | How to reproduce |
|---|---|
| Android | adb logcat for logs, reproduce on emulator, check specific API level |
| iOS | Xcode console or simctl logs, reproduce on simulator, check iOS version |
| Flutter | flutter run with --verbose, check both platforms |
| React Native | Metro console, adb logcat / Xcode console, check native bridge errors |
| KMP | Reproduce on each target platform; check whether the issue is in shared code or platform-specific actual implementations |
Check recent changes & find the breaking commit
git log --oneline -20 -- <affected-file> — commits that touched the affected filegit blame -L <line>,<line> <file> — which commit last changed the specific failing linegit log --all --grep="<keyword>" — past related fixes that might show the introduction of a conflicting patterngit bisect when the history is dense or the search space is large. The breaking commit goes into the PR description (it helps the reviewer assess scope and decide backport priority).Collect concrete evidence
Add diagnostic instrumentation at component boundaries:
| Platform | Instrumentation |
|---|---|
| Android | Log.d(TAG, "value=$value") at ViewModel, Repository, DAO boundaries |
| iOS | print("value=\(value)") or os_log at ViewModel, Service, Store boundaries |
| Flutter | debugPrint("value=$value") at BLoC/Provider, Repository, API boundaries |
| React Native | console.log("value=", value) at component, hook, API boundaries |
| KMP | Log at the shared/expect boundary AND at each actual implementation |
Identify affected platforms precisely
Separate what you actually observed from what you are inferring. List in two columns:
Every item in "Assumed" is a candidate to either verify (moving it to Known) or to drop.
One hypothesis at a time, stated specifically. Not "it's a race condition" — rather "the ViewModel's observeUser() coroutine is cancelled by the Activity being recreated on rotation, so the subsequent emission is dropped".
Check common mobile bug categories to frame the hypothesis:
Lifecycle bugs:
onSaveInstanceState missing?viewWillAppear vs viewDidLoad timing? SceneDelegate lifecycle?dispose() not called?Threading bugs:
@MainActor missing?setState after dispose?Memory bugs:
[weak self]?Data bugs:
KMP-specific:
actual implementations across platformsState the single hypothesis in the form: "I think X is the root cause because Y". Be specific.
Verify against code and evidence, not against intuition.
Find working examples
Test minimally
Read the code path carefully
If verification fails
Once the hypothesis is verified, state:
Fast path: state the root cause concisely and proceed to Phase 6 without pausing. If you discover during Phase 4 that the evidence is contradictory or the hypothesis doesn't hold cleanly, upgrade to gated path before presenting.
Gated path: ask explicitly:
"This is the root cause I've identified and verified. Do you confirm this is correct before I propose a fix?"
Wait for the user's explicit confirmation. If the user pushes back or points to evidence you missed, return to Phase 3 or Phase 4 as appropriate.
The fix itself is not proposed inside this skill. mobiai-mobile-debugging ends when the root cause is stated (fast path) or confirmed (gated path).
mobiai-fix-issue, return control — mobiai-fix-issue's Phase 4 (Propose the Fix) takes over with its own gating rules. Skip the Brain hook below — mobiai-fix-issue runs its own save proposal at the end of Phase 6 (verification). Don't double-prompt.mobiai-mobile-tdd to write the failing test first, then the implementation.Standalone invocations only (skip when called from mobiai-fix-issue). After the root cause is confirmed, check whether <repo>/.mobiai/brain/config.json exists. If it does NOT, skip silently.
If it does, judge whether the cause is worth remembering. Save when:
Skip when the cause is trivial (typo, obvious null, one-line bug with no broader pattern).
When worth saving, propose the save to the user (one-line confirmation). Never invoke silently. Use status: active when the root cause is documented but no fix is applied yet (the entry serves as "we understood this, future agents should know"), or status: temporary with review_after when a workaround was applied that needs revisiting.
Preferred — MCP tool (if your client has the mobiai-brain MCP server registered, you'll see this tool in your toolbox):
Invoke mobile_save_bugfix with:
title: short, e.g. "Compose recomposition loop in LazyColumn with derivedStateOf"platform: android | ios | shared | kmp | flutter | react-nativearea: free-form, e.g. "compose" | "coroutines" | "gradle"status: active | temporaryreview_after: "YYYY-MM-DD" (only when status is temporary)files: array of repo-relative file pathsbody: Markdown with ### Symptom / ### Root Cause / ### Investigation Notes / ### ResolutionFallback — CLI (if MCP isn't configured):
mobiai brain save bugfix \
--title "<short, e.g. 'Compose recomposition loop in LazyColumn with derivedStateOf'>" \
--platform <android|ios|shared|kmp|flutter|react-native> \
--area <free-form, e.g. compose | coroutines | gradle> \
--status <active|temporary> \
--review-after <YYYY-MM-DD if temporary> \
--files "<file1>,<file2>" \
--body "### Symptom
What the user observed.
### Root Cause
The actual cause, in plain language.
### Investigation Notes
The evidence that confirmed it — log lines, commits, behavior on different builds.
### Resolution
What was done about it (or 'documented only, no fix applied yet')."
The body fields are suggestions, not a rigid template. Use the structure that fits what you found.
If you catch yourself thinking:
ALL of these mean: STOP. Return to Phase 1.
| Excuse | Reality |
|---|---|
| "Issue is simple, don't need process" | Simple issues have root causes too. The phased flow is fast for simple bugs. |
| "Emergency, no time for process" | Systematic debugging is FASTER than guess-and-check thrashing. |
| "Just try this first, then investigate" | First fix sets the pattern. Do it right from the start. |
| "I'll write tests after confirming the fix works" | Untested fixes don't stick. Test first proves it. |
| "This null check should handle it" | Why is it null? That's the actual bug. |
| "Works on my device" | There are thousands of device/OS combinations. |
| "The Explore agent already diagnosed it" | Sub-agents can be confidently wrong. Verify against the code. |
| "One more fix attempt" (after 2+ failures) | 3+ failures = architectural problem. Question the pattern, don't fix again. |
| Phase | Key Activity | Fast path | Gated path |
|---|---|---|---|
| 1. Gather evidence | Read errors, reproduce, check changes, instrument | Proceed autonomously | Proceed autonomously |
| 2. Known vs. assumed | Split facts from inferences | Record internally, proceed | Present to user, wait for confirmation |
| 3. Hypothesis | Single specific testable theory | Proceed autonomously | Proceed autonomously |
| 4. Verify | Compare to working code, test minimally | Proceed autonomously | Proceed autonomously |
| 5. Root cause | Present cause + evidence + causal chain | State and proceed to Phase 6 | Ask user to confirm before Phase 6 |
| 6. Hand off | Return to mobiai-fix-issue or invoke mobiai-mobile-tdd | Implementation begins elsewhere | Implementation begins elsewhere |
mobiai-fix-issue — the broader pipeline; calls this skill for its Phase 3. The scope classification (fast/gated) declared in mobiai-fix-issue is inherited by this skill.mobiai-mobile-tdd — for creating the failing test once the root cause is confirmedmobiai-mobile-verification — to verify the fix worked before claiming successmobiai-reproduce-bug — for driving a device/emulator/simulator to reproduce the bug in Phase 1 (use only when mobiai-fix-issue Phase 2 authorized reproduction; do not invoke autonomously)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub arisguimera/mobiai-core --plugin core22 skills in this plugin
/mobiai-analyze-crashUse when the user shares a crash from any source (stack trace, log, screenshot, error description) and wants to find the root cause and fix it./mobiai-brainUse when the user asks about past decisions, workarounds, bugfixes, testing patterns or integrations specific to *this* project, OR before proposing non-trivial architecture/integration changes. MobiAI Brain is per-project living memory at <repo>/.mobiai/brain/. Loads context the user already captured so suggestions respect real project conventions instead of generic best practices./mobiai-crashlyticsUse when the user shares a Firebase Crashlytics crash link, crash ID, or asks to investigate a Crashlytics issue in depth./mobiai-create-prYOU MUST use this before ANY git push, branch push to remote, merge, or PR creation — regardless of phrasing or language. Covers all irreversible integration actions (committing, pushing, opening a PR, shipping finished work). Also triggers proactively after a fix when the user signals completion (still ask before pushing). Works with any git hosting provider./mobiai-fix-issueYou MUST use this before starting any bug fix from a ticket or issue, OR when re-opening a ticket whose previous fix attempt didn't work (user shares a commit SHA and says 'no anda' / 'didn't fix it' / 'still broken'). Fetch, understand, investigate root cause, apply the fix with tests, and verify. For small line-level fixes, runs autonomously end-to-end and gates only before push. For complex changes, gates at each phase boundary./mobiai-graphUse when the user asks about code impact, call graph, callers/callees, semantic exploration of the mobile codebase, or 'where is X used'. Routes the agent to query MobiAI Graph (mobiai graph search/callers/context) instead of grep/read. Pre-flight checks that .mobiai/graph/index.json exists; if not, suggests `mobiai graph init` without running it.2 plugins ship this exact skill · first indexed Jul 20, 2026
Other plugins' skills for the same job