Skip to content
Skill

compose-ui-control

by diegosouzapw

AI Summary

This booster enables AI coding assistants to control and interact with Compose Desktop applications through HTTP endpoints, allowing for automated UI testing and interaction during development. Developers building or testing Compose Desktop apps benefit from automated UI control capabilities.

Install

Copy this and paste it into Claude Code, Cursor, or any AI assistant:

I want to install the "compose-ui-control" skill in my project.

Please run this command in my terminal:
# Install skill into the correct directory (2 files)
mkdir -p .claude/skills/compose-ui-control && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/compose-ui-control/SKILL.md "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/design/compose-ui-control/SKILL.md" && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/compose-ui-control/metadata.json "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/design/compose-ui-control/metadata.json"

Then restart Claude Code (or reload the window in Cursor) so the skill is picked up.

Description

Control a running Compose Desktop application via HTTP. Use when you need to interact with UI elements, click buttons, enter text, wait for elements to appear, or capture screenshots in a Compose Desktop app that has compose-ui-test-server enabled.

compose-ui-test-server

A library that enables AI coding agents to control Compose Desktop applications at runtime via HTTP. • Repository: https://github.com/forketyfork/compose-ui-test-server • Maven Central: io.github.forketyfork:compose-ui-test-server • Current version: 0.2.0

Checking If Already Installed

Before setting up, check if the project already has the library: `bash grep -r "compose-ui-test-server\|composeuittest" --include=".gradle" --include="*.kt" . ` Look for: • Dependency on io.github.forketyfork:compose-ui-test-server • Imports from io.github.forketyfork.composeuittest If found, skip to Starting the Application.

Step 1: Add the dependency

Find the app's build.gradle.kts and locate the desktop source set dependencies. Add compose-ui-test-server and compose.uiTest: `kotlin kotlin { sourceSets { val desktopMain by getting { dependencies { // Existing dependencies... // Add these two: implementation("io.github.forketyfork:compose-ui-test-server:0.2.0") @OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class) implementation(compose.uiTest) } } } } ` For projects using version catalogs, add to gradle/libs.versions.toml: `toml [libraries] compose-ui-test-server = { module = "io.github.forketyfork:compose-ui-test-server", version = "0.2.0" } ` Then reference in build.gradle.kts: `kotlin implementation(libs.compose.ui.test.server) `

Step 2: Update the main function

Find the application's main() function (usually in Main.kt or similar). Replace the standard Compose Desktop launcher with runApplication: Before (typical Compose Desktop main): `kotlin import androidx.compose.ui.window.Window import androidx.compose.ui.window.application fun main() = application { Window(onCloseRequest = ::exitApplication, title = "My App") { App() } } ` After (with agent control support): `kotlin import io.github.forketyfork.composeuittest.WindowConfig import io.github.forketyfork.composeuittest.runApplication fun main() = runApplication( windowConfig = WindowConfig( title = "My App", minimumWidth = 1024, minimumHeight = 768, ), ) { App() } ` The app now runs normally by default, but supports agent control when launched with COMPOSE_UI_TEST_SERVER_ENABLED=true.

Discussion

0/2000
Loading comments...

Health Signals

MaintenanceCommitted 1mo ago
Active
AdoptionUnder 100 stars
0 ★ · Niche
DocsREADME + description
Well-documented

GitHub Signals

Issues0
Updated1mo ago
View on GitHub
No License

My Fox Den

Community Rating

Sign in to rate this booster

Works With

Claude Code