Building Widgets with AI¶
You can leverage AI coding assistantsβsuch as Antigravity, Claude, Cursor, Codex, and custom LLM toolsβto generate complete, production-ready cross-platform WARP widgets automatically.
WARP provides a pre-configured AI Skill (SKILL.md) that teaches AI agents the exact architecture, composable DSL, theme tokens, Glance/WidgetKit host boilerplate, and best practices.
Quick Start: Copy & Paste Prompt for AI
Copy and paste this generic prompt directly into your AI assistant (Claude, Cursor, Antigravity, ChatGPT, or Codex) to generate any new widget:
Read the WARP Skill instructions from https://github.com/DevAtrii/Warp/tree/main/.agents/skills/warp-widget/SKILL.md and create a [WIDGET_NAME, e.g. Weather / Habit Tracker / Crypto] home screen widget for Kotlin Multiplatform. Include State, Actions, ActionHandler, shared WarpWidget composable UI, and Android Glance receiver boilerplate.
1. How the WARP AI Skill Works¶
The WARP AI Skill (warp-widget) provides AI models with complete context about WARP:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Developer Prompt β
β "Create a Crypto Price Tracker widget using WARP" β
βββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β WARP Skill (SKILL.md) β
β Β· Enforces WARP Compose DSL (WarpColumn, WarpText, etc.) β
β Β· State & Actions serialization patterns β
β Β· Auto-generates Android Glance Receiver & AppWidget β
β Β· Generates PlatformContext & Swift WidgetKit bridges β
βββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Generated Output β
β 1. CryptoWarpWidget.kt (commonMain) β
β 2. CryptoWidgetReceiver.kt (androidMain) β
β 3. App Group & WidgetKit Integration Guides β
βββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββ
2. Using WARP Skill across AI Tools¶
π€ Antigravity & Agentic AI Tools¶
Antigravity automatically discovers skills placed in .agents/skills/.
- Automatic Setup: The skill is already configured in
.agents/skills/warp-widget/SKILL.md. - Generic Prompt:
β‘ Cursor¶
Cursor uses workspace rules and skills to guide code generation.
- Option A (Auto-Discovery): Cursor automatically indexes
.agents/skills/warp-widget/SKILL.md. - Option B (Direct URL Reference): In Cursor Chat or Agent Mode, paste the GitHub link:
π§ Claude (Anthropic / Desktop / Web)¶
You can provide the WARP Skill to Claude via Projects or direct prompt attachment.
- Claude Projects: Upload
docs/skills/warp-widget/SKILL.mdto your Claude Project Knowledge. - Claude Code CLI / Desktop: Place
SKILL.mdinside your project's.agents/skills/warp-widget/SKILL.mdor.claude/skills/. - Generic Prompting:
π OpenAI Codex & Custom LLM Assistants¶
For ChatGPT, Custom GPTs, or custom LLM scripts:
- Copy the raw markdown content from WARP
SKILL.mdon GitHub. - Paste it into your System Prompt or Knowledge Files.
- Generic Prompt:
3. Example Copy & Paste Prompts¶
Here are ready-to-use prompt examples you can copy and paste:
4. Skill File Links & Live Documentation Index¶
You can view, reference, or download the WARP AI Skill and documentation index directly:
| Reference | Location | Target AI Tool / Audience |
|---|---|---|
| π Live Docs Sitemap Index | https://warp.atherio.dev/sitemap.xml |
Web crawlers & AI agents indexing full documentation |
| π GitHub Repository Skill | SKILL.md on GitHub |
Web AI tools (Claude, Cursor, ChatGPT, Codex) |
| π Local Agent Skill | .agents/skills/warp-widget/SKILL.md |
Antigravity, Cursor, Claude Code, and KMP agents |
| π Documentation Copy | docs/skills/warp-widget/SKILL.md |
Local project documentation reference |
5. What the AI Will Generate & iOS Setup Options¶
When you ask an AI assistant with the WARP Skill enabled to build a widget, it will generate:
- State Payload (
@Serializable data class ...): Immutable state payload. - Sealed Action Classes (
@Serializable sealed class ...): Type-safe tap action events. - Action Handler (
WarpActionHandler): Asynchronous state updates viaupdateWarpWidgetState. - Shared Composable UI (
WarpWidget): Cross-platform Compose UI using WARP theme and layout primitives. - Android Glance Host (
androidMain):WarpGlanceWidgetReceiverandWarpGlanceWidgetmapping drawable asset IDs. - iOS Swift Boilerplate Setup:
- Option A (Web Generator): Use the interactive Warp Widget Wizard (
https://warp.atherio.dev/wizard.html) to download the 6 generated Swift WidgetKit boilerplate files (.zip). - Option B (Repository Reference Files): If browser access is unavailable, copy template files directly from
iosApp/CounterWidgeton GitHub and manually update the widget and framework module names.