design-mobile-apps
Use when the user wants to design a mobile app or UI screens, when they mention their Sleek (sleek.design) projects, or when implementing Sleek designs in code (HTML, React Native, SwiftUI).
1How It Works & Mechanism
Functionality is realized by calling a third-party SaaS (Sleek) REST API: The agent acts as Sleek's API client, sending user intent to the Sleek server via `POST /api/v1/projects/:id/chat/messages`. Sleek's AI generates the screens, while the agent retrieves results and presents screenshots—the skill itself contains no design or rendering code.
[sleek.design](https://sleek.design) is an AI-powered mobile app design tool. You interact with it via a REST API at `/api/v1/*` to create projects, describe what you want built in plain language, and get back rendered screens.
Authentication uses an environment variable Bearer token: Every request includes `Authorization: Bearer $SLEEK_API_KEY`, and frontmatter declares requires-env.
**Auth**: `Authorization: Bearer $SLEEK_API_KEY` on every `/api/v1/*` request
When no key is available, an OAuth-like device flow is used: Calls POST /device/start to obtain verificationUrl + userCode + deviceCode; after the user confirms in the browser, it polls /device/poll to retrieve the key and writes it to SLEEK_API_KEY.
If `SLEEK_API_KEY` is not set, use the device flow so the user never handles the raw key: 1. `POST https://sleek.design/api/v1/device/start` (no auth) with body `{"source": "your-tool-slug"}`. The response contains a `verificationUrl`, a human-checkable `userCode`, a secret `deviceCode`, and a poll `interval` in seconds. 2. Show the user the `verificationUrl` and the `userCode`, and tell them to confirm the code matches before approving. 3. Poll `POST https://sleek.design/api/v1/device/poll` with `{"deviceCode": "..."}` every `interval` seconds. When the user approves, the poll returns `{"status": "approved", "key": "sk_..."}` exactly once: store it as `SLEEK_API_KEY`.
Design workflow = project → chat message → polling run → screenshot closed loop: The entire user intent is sent via chat in a single payload, Sleek plans screens and layout automatically, and the agent polls runId until completed before capturing and displaying screenshots to the user.
Send the request with `POST /api/v1/projects/:id/chat/messages`. Sleek plans screen content and layout from your message, and will invent a visual style if you don't give it one. Don't decompose the request into screens and don't add product details the user didn't ask for; send the full intent as a single message.
Asynchronous discipline: Chat defaults to async (202 + runId), polling uses a 2s → 5s backoff with a 5-minute cap; `?wait=true` blocks up to 300s; single project single run constraint (409 conflict handling), and idempotency-key for idempotent retries.
chat messages are async by default: you get a `runId` and poll `GET /api/v1/projects/:id/chat/runs/:runId`. Start at 2s interval, back off to 5s after 10s, give up after 5 minutes.
Result verification closed loop: When a run produces screen_created/updated, it must call POST /api/v1/screenshots to present screenshots to the user; silent completion is prohibited. During self-checks, fullHeight is used to reshoot the entire page.
After every chat run that produces `screen_created` or `screen_updated` operations, **take screenshots and show them to the user** using `POST /api/v1/screenshots`. The step is done only when the user has seen a screenshot of every screen the run created or updated; never complete a run silently.
Code implementation path: Fetch component HTML (activeVersion or pinned version) → save as .html; for React Native/SwiftUI, use both HTML and screenshots as references, retrieve icons via Iconify API, and extract fonts from HTML link tags.
The component `code` is a complete HTML document. Save it directly to a `.html` file. No build step needed.
Built-in security policy: Single host, HTTPS only, keys passed exclusively via Authorization header, and minimum scope keys.
**Single host**: All requests go exclusively to `https://sleek.design`. No data is sent to third parties.
2Core Capabilities
3External Dependencies
| Kind | Dependency / Endpoint |
|---|---|
| api | Sleek REST API (sleek.design) |
| api | Sleek OpenAPI spec |
| api | Iconify API(仅实现原生图标时) |
| cli | curl |
| package | react-native-svg(SvgXml,仅 RN 实现路径) |
4Recommended Governance & Evidence
- scripts/: Executes local scripts or commands: curl (executed by the host: `curl -o run.json` and 'use shell commands to fetch the API respon
- 网络端点: Declares external network access: https://sleek.design/api/v1/* (all endpoints for projects/chat/run/screenshots/references, Bearer auth)
- 本地工作目录: File read/write and artifact output: Screenshots saved to the project directory ('Save screenshots in the project directory')
5Second-Pass Verification
- [ok] 鉴权与凭证读取 — '**Auth**: `Authorization: Bearer $SLEEK_API_KEY` on every `/api/v1/*` request' 原文在;frontmatter requires-env: SLEEK_API_KEY。无其他凭证访问。
- [ok] device flow 换 key — device/start(无鉴权拿 verificationUrl/userCode/deviceCode)+ device/poll 轮询换 sk_ key 并 'store it as SLEEK_API_KEY' 的原文完整存在。
- [ok] 网络外发 host 清单 — 正则扫描全部 URL host 仅 sleek.design(功能主体)与 api.iconify.design(图标实现);example.com 是 imageUrls 文档占位;'Single host… No data is sent to third parties' 与实现路径的 iconify 调用并存——严格说 iconify 为第二外发点,但系文档明示的实现步骤,非隐蔽行为。
- [ok] 本地文件写入 — 'Save screenshots in the project directory'、'Save it directly to a `.html` file'、'curl -o run.json'、SVG 存静态资源四处写入指令均有原文。
- [ok] 无脚本内置 — skill 目录仅 SKILL.md 一个文件,仓库无 scripts/;curl/写文件全部由宿主按指示执行,无自带可执行代码。
- [ok] 端点表与正文一致性 — Quick Reference 11 个端点(projects/components/references/chat runs/cancel/screenshots)与正文 HTTP 示例逐一对应,参数表含 required/默认值/级联(padding)语义。
- [ok] 异步轮询纪律 — 'Start at 2s interval, back off to 5s after 10s, give up after 5 minutes' 与 '?wait=true'(300s 上限、202 超时转轮询)原文在,非编造。
- [ok] 截图验收闭环 — 'never complete a run silently' + fullHeight 自查('re-shoot the screen with `fullHeight: true`')+ 并行截图建议原文均在。
6Verdict & Scenarios
215af338726abdb5…