iterating-with-ai-and-mcp

Drives Compose HotSwan from MCP clients to edit, reload, screenshot, and iterate Kotlin UI.

Updated May 31, 2026
One-click install
npx skills add https://github.com/decoutkhanqindev/Lich-Viet-Loc-Phat --skill iterating-with-ai-and-mcp-decoutkhanqindev
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: iterating-with-ai-and-mcp
Source: https://github.com/decoutkhanqindev/Lich-Viet-Loc-Phat/tree/main/.claude/skills/iterating-with-ai-and-mcp
Command: npx skills add https://github.com/decoutkhanqindev/Lich-Viet-Loc-Phat --skill iterating-with-ai-and-mcp-decoutkhanqindev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? AI agents normally cannot see whether their UI edits actually worked on a running Android device. This Skill gives an MCP-capable agent (Claude Code, Cursor) a closed feedback loop over Compose HotSwan: edit a Kotlin file, trigger a hot reload, capture a device screenshot, and evaluate the result against the design intent without a human steering each step. ## Core Features & Use Cases - Seven verbatim MCP tools: hotswan_get_status, hotswan_reload, hotswan_take_screenshot, hotswan_start_snapshot, hotswan_stop_snapshot, hotswan_select_variant, and hotswan_build_and_install, with rules against inventing tool names. - Canonical agent loop: status check, snapshot session, edit, reload with tier reading, screenshot evaluation, and optional rollback to a preferred variant. - Safety habits: watcher-state verification before edits, snapshot wrapping for rollback, and fallback to full install for schema changes like new parameters or resource IDs. - Use Case: A developer tells Claude Code to tune a Compose screen until it matches a mock; the agent iterates autonomously, rolls back to the best snapshot variant, and only falls back to a full install when an edit changes the class schema. ## Quick Start Ask your MCP-connected AI agent to check the HotSwan watcher status, start a snapshot session, then iteratively edit the target Kotlin composable, reload, and screenshot until the screen matches your design mock.

Frequently Asked Questions about iterating-with-ai-and-mcp

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I let an AI agent iterate on a Jetpack Compose UI automatically?▼

Connect an MCP-capable client like Claude Code or Cursor to the HotSwan plugin's HTTP MCP server. The agent then runs a loop of editing the Kotlin file, calling hotswan_reload, capturing a screenshot with hotswan_take_screenshot, and evaluating the result against the design intent.

What MCP tools does Compose HotSwan expose?▼

HotSwan exposes exactly seven tools: hotswan_get_status, hotswan_reload, hotswan_take_screenshot, hotswan_start_snapshot, hotswan_stop_snapshot, hotswan_select_variant, and hotswan_build_and_install. Agents must not invent additional tool names.

Can Claude Code or Cursor take screenshots of a running Android app?▼

Yes, through the hotswan_take_screenshot MCP tool exposed by the HotSwan IntelliJ plugin. It returns image bytes or a path the agent can read back and inspect to verify its UI edits visually.

Why does hotswan_reload do nothing when my agent calls it?▼

The reload silently no-ops if the app is not running or the watcher is not in the WATCHING state. Always call hotswan_get_status first and confirm watcher state before issuing edits or reloads.

When should I use hotswan_build_and_install instead of hotswan_reload?▼

Use hotswan_build_and_install only for schema changes such as adding a function parameter, changing a constructor, or adding a new resource ID, which hot reload cannot handle. It is a fallback, not a default, since full installs destroy the speed advantage of the hot reload loop.

How do I roll back to an earlier UI iteration with HotSwan?▼

Wrap the iteration loop in hotswan_start_snapshot and hotswan_stop_snapshot so every reload auto-captures a screenshot and source state. Then call hotswan_select_variant to roll the source code back to the preferred intermediate variant.