kvdm-co-pilot/create-cmp/cmp-doctor
Claude Code and agent skill by kvdm-co-pilot/create-cmp
- community
Checking that the SKILL.md file is still in the repository.
Diagnose and heal both the toolchain AND the project a Kotlin/Compose Multiplatform (CMP/KMP) build needs. Use this when the user wants to set up or fix their CMP/KMP toolchain — Android SDK / AVD / emulator, JDK 17, Xcode / CocoaPods / XcodeGen, Appium and its drivers — or asks "set up CMP toolchain", "install Appium for KMP", "install Android SDK for Compose Multiplatform", "why won't my KMP project build", "my Compose Multiplatform build fails", "kotlin and ksp version mismatch", "check my version catalog", "prepare my machine for KMP Android + iOS", or "fix my Kotlin Multiplatform environment". Inside ANY Gradle/KMP project it also diagnoses the project: kotlin↔ksp lockstep, drift from proven-green version sets, the KSP2/iOS Room catch-22, SDK wiring, ~/.konan bloat and free disk — --fix applies the safe heals. Consent-gated: shows each exact command and asks before installing. Ends with a per-dependency GREEN/FAIL verdict.
Install
npx vskill@latest install kvdm-co-pilot/create-cmp/cmp-doctorSKILL.md
The same SKILL.md was published earlier as kvdm-co-pilot/create-cmp/cmp-doctor.
cmp-doctor — bootstrap the CMP toolchain & diagnose the project
Your job: get the machine to a state where a CMP/KMP project can build (Android, and iOS on macOS) and run device tests — and, when run inside a project, get the project to a buildable state too. (The stamped E2E harness is Maestro — curl -fsSL https://get.maestro.mobile.dev | bash; the Appium drivers below serve the legacy pre-Maestro path.) You wrap the engine's bootstrap (${CLAUDE_PLUGIN_ROOT}/src/doctor.mjs per CONTRACT/DESIGN; exposed on the CLI as the doctor subcommand). Do not hand-roll installs in bash when the engine can do it — the engine is idempotent and verifies each tool. Use this skill to drive it and to relay its consent prompts.
What it checks, then offers to install
- JDK 17 (Temurin, via Homebrew or SDKMAN).
- Android SDK + cmdline-tools via
sdkmanager(platform, build-tools, platform-tools, emulator,
a system image) and a bootable AVD.
- Xcode + Command Line Tools — checks
xcode-select. Xcode itself cannot be installed from the
CLI; the App Store step is surfaced as the one unavoidable manual action and handled gracefully.
- CocoaPods and XcodeGen (Homebrew).
- Node + Appium 3.x and its drivers (
appium driver install uiautomator2, andxcuitest
on macOS), each verified — legacy e2e path only; Maestro is a separate one-line install.
- adb / emulator reverse-port wiring for the test harness.
On Linux, it scopes to Android-only and says so explicitly (no iOS toolchain).
Project diagnosis — works on ANY KMP project
When doctor runs inside (or is pointed at, via --target-dir) a directory with Gradle files, it adds a project diagnosis section on top of the toolchain checks. This works on any KMP project with a gradle/libs.versions.toml — whoever scaffolded it:
- kotlin ↔ ksp lockstep —
kspmust be<kotlin>-<kspVersion>; a mismatch is the classic
KMP build-killer and is reported as a FAIL.
- Drift vs the nearest proven-green version set — which catalog versions differ from a
CI-verified set, with create-cmp upgrade as the one-command fix.
- The KSP2/iOS catch-22 — Room + an iOS target without
ksp.useKSP2=truein gradle.properties
dies at link time with ClassNotFoundException: …MainKt; doctor flags it (and --fix heals it).
- local.properties / sdk.dir — missing file, missing key, or a path that doesn't exist.
- Environment —
~/.konansize (reported when over 10 GB) and free disk space (warned under
3 GB — a real KMP build-killer).
--fix applies only the SAFE heals (write local.properties from ANDROID_HOME, add ksp.useKSP2=true); everything else prints the exact manual command instead.
Inspector MCP — is the capability actually here? (agent-run check group)
The cmp-inspector MCP is the plugin's whole UI feedback surface; when it is silently absent, agents degrade to screenshots and raw adb without anyone noticing (this happened for an entire production build). These four checks are yours to run directly — the engine cannot see your session. Report each as GREEN/FAIL with the next command.
- Tools resolvable in THIS session — ToolSearch for "cmp-inspector". Any tool whose
name contains cmp-inspector = GREEN, whatever its prefix: a plugin install names them mcp__plugin_create-cmp_cmp-inspector__*, a project-scope .mcp.json names them mcp__cmp-inspector__*. Never FAIL on the prefix alone. FAIL means the server is not attached to this session: continue with checks 2–4 to say WHY. MCP servers attach at session START — if the plugin was enabled (or fixed) after this session began, no in-session retry will ever surface the tools; the next command is: restart the session.
- Plugin registered + enabled — read
~/.claude/settings.json(and the project's
.claude/settings.json / .claude/settings.local.json) for enabledPlugins containing the create-cmp plugin. FAIL → enable the plugin, then restart the session (check 1's rule applies).
- Marketplace copy staleness — the installed copy under
~/.claude/plugins/marketplaces/<name> is a git clone that never auto-updates (a real copy sat three weeks stale). If it is a git repo: git -C <copy> fetch --quiet && git -C <copy> log --oneline HEAD..origin/HEAD | wc -l (offline? report "staleness unknown — offline", not GREEN). If the marketplace source is a local path (find it in ~/.claude/plugins/known_marketplaces.json or settings extraKnownMarketplaces), also compare against that directory's HEAD. Behind → FAIL: "plugin copy is N commits behind its source". Remediation: update/reinstall the marketplace copy — the exact command depends on the Claude Code version (the general mechanism is the plugin marketplace update flow); the manual fallback that always works is git -C <marketplace-copy> pull. Then restart the session.
- Bundled server starts — prove the server binary answers a JSON-RPC initialize:
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"doctor","version":"0"}}}' | node "${CLAUDE_PLUGIN_ROOT}/inspector/mcp/dist/server.mjs" — any "result" line back = GREEN. A crash or silence = FAIL: the copy is broken or half-updated; re-run check 3's remediation, then this again.
Two device-side notes that fit here (field lessons, both reproduced on real apps):
- Stale adb server —
adb devicessaysdevicebut automation clients (Maestro/dadb,
the inspector's forward) get device offline: the server-side transport entry is stale. The next command is adb kill-server && adb start-server && adb wait-for-device — not an emulator reboot, not an app fault.
- Per-app AVD isolation — sharing one emulator across different apps' sessions crosses
their data and can wedge adbd into false "app crash" symptoms. That is the default: one AVD per app, named after the app. A project can opt into the machine's ONE shared emulator instead (next section, asked per project), which keeps the isolation by booting it wiped and serializing it with the device lease.
Shared test devices — asked per project (ask the human; never decide it)
Per-app emulators and stray iOS runtimes cost 3–19 GB each, and filled a real developer's disk four times in seven weeks. The machine keeps ONE emulator, ONE simulator and ONE iOS runtime, detected from what is installed, and each project is asked on its own whether it uses them (the decision record is docs/features/shared-device-pin.md in the create-cmp repo). Every git worktree of one repo is one project. A project never asked keeps the per-app behaviour.
Plain doctor inside a project asks at a terminal. Your session has no terminal, so you put the question — for the project you are working in (--target-dir <app>, default the cwd):
node "${CLAUDE_PLUGIN_ROOT}/bin/create-cmp.mjs" doctor --device-pin status --target-dir <app>
— prints the project, whether it was asked, how many other projects share, the disk check (free space and every installed emulator, image, runtime and cached runtime download with its size), the shared set, the pros, the cons, and what sharing would let them reclaim with the exact command for each. It writes nothing.
- If it says
decided: not asked yet(or the user asked to change it), ask with
AskUserQuestion: two options, "Use the shared devices" and "Keep per-app devices", carrying the pros, the cons, the free space and the reclaimable total from step 1 in the option descriptions. Never pick for them, and never pass --yes.
- Record it for that project:
doctor --device-pin shared --target-dir <app>or
--device-pin per-app. One project's answer never changes another's.
- Relay the "Reclaimable" list. Doctor deletes nothing — offer to run a removal only when the
user asks, one item at a time. A cached runtime download (AssetsV2) is protected by System Integrity Protection — rm fails there even with sudo — so send the user to Xcode → Settings → Components to delete that runtime; never suggest disabling SIP.
When a lane, an iOS build or connect_live refuses with "the pinned shared … is not on this machine", the device was removed (often by an Xcode or SDK update): with the user's agreement run doctor --device-pin repin, which re-detects the machine's set from what is installed — it never downloads a replacement, and it changes the set for every project that shares it (it says how many).
How to run it
(If invoked from the published package: npx create-cmp-cli@latest doctor.)
Consent gating — the hard rule
This skill installs system software. It is consent-gated by design:
- In interactive use, the engine shows the exact command for each missing tool and asks before
running it. Relay that prompt to the user and wait for approval — do not pass --yes unless the user explicitly asked for an unattended/CI run.
- Never install Xcode silently — surface the App Store action and let the user do it.
- It is idempotent: already-present tools are detected and skipped, so re-running is safe.
Report
Relay the engine's per-dependency GREEN/FAIL verdict verbatim, and the project-diagnosis findings when it ran inside a project. For anything FAIL, give the user the precise next step (e.g. "install Xcode from the App Store, then re-run"; for version drift or a lockstep violation, point them at cmp-upgrade). When everything is GREEN, point them at cmp-new to scaffold an app or cmp-qa-prep to bring up the test harness.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/cmp-doctor/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/kvdm-co-pilot/create-cmp/cmp-doctor)