微算力 · API 导航与自营网关
API 接入 EN
未登录登录
🎨

AI 驱动,一句话生成移动应用设计

Desing mobile apps · v1.0.0
设计 安全 S 级 榜单 #3 作者 stefanofa 公开目录收录
8.6k 下载 3 安装 30.2k 收藏 28 浏览

简介

通过自然语言指令快速生成移动端 UI 设计,支持项目创建、智能布局和可视化截图,适合产品原型和迭代开发,需 Pro+ 订阅。

原始描述

Use when the user wants to design a mobile app, create screens, build UI, or interact with their Sleek projects. Covers high-level requests ("design an app t...

通过你的 Agent 添加

点「快速安装」复制一段指令,粘给你正在用的 Agent(Claude Code、Codex、OpenClaw 等),它会自己完成安装。

或者手动安装

Claude Codeunzip -o skill.zip -d ~/.claude/skills/desing-mobile-apps/
其它 Agent解压到它自己的 skills 目录,目录名用 desing-mobile-apps

包里是 SKILL.md 加作者附带的文件,解压后目录名就是技能名。 技能申请的权限由作者决定,装之前请确认它能读什么、能执行什么。

中文使用说明 来自收录源

核心用法

Sleek 是一款面向移动端的 AI 驱动 UI 设计工具,通过 REST API 将自然语言描述转化为可渲染的设计稿。开发者或设计师只需发送如「设计一个健身追踪应用」这样的文本指令,系统即可自动创建项目、生成屏幕并完成视觉布局。关键交互流程包括:创建项目 → 发送聊天消息描述需求 → 轮询任务状态 → 获取截图结果。支持异步(默认)和同步(wait=true,最长阻塞 300 秒)两种模式,并提供幂等性键(idempotency-key)以安全处理网络重试。

截图交付规则是使用的核心:每次聊天运行产生 screen_created 或 screen_updated 后,必须调用截图接口展示结果。首次创建屏幕时需交付单屏截图 + 全项目合图;更新时仅需单屏截图。截图支持透明背景、多倍缩放和自定义间距。

显著优点

  • 自然语言驱动:无需掌握设计工具或编写布局代码,用日常语言描述即可生成专业 UI
  • 快速原型:从概念到可视截图的闭环极短,适合敏捷迭代和用户测试
  • API 优先:标准 REST 接口,易于集成到现有工作流或自动化脚本
  • 细粒度权限:API Key 支持最小权限原则(projects:read、chats:write 等),降低密钥泄露风险
  • 幂等性支持:通过 idempotency-key 避免重复创建,提升系统可靠性

潜在缺点与局限性

  • 订阅门槛:API 访问强制要求 Pro+ 计划,对个人开发者或早期团队成本较高
  • 单项目串行:同一项目同时只能运行一个聊天任务,高并发场景需排队处理
  • AI 黑盒:布局决策由 AI 自动完成,对像素级精确控制或复杂自定义交互支持有限
  • HTTPS 图片限制:视觉上下文仅支持 HTTPS URL,本地图片需先上传
  • 无代码导出:当前文档未提及导出为 React Native、SwiftUI 等代码的能力,设计稿可能锁定在平台内

适合人群

  • 产品经理和设计师:快速将想法转化为可视原型,用于内部评审或用户测试
  • 独立开发者:缺乏专职设计师时,用 AI 生成 MVP 的 UI 方案
  • 企业设计系统团队:探索 AI 辅助的设计规范生成和组件变体管理

常规风险

  • 密钥管理:API Key 仅创建时显示一次,泄露后需重新生成;需配合安全存储(如环境变量或密钥管理系统)
  • 成本失控:AI 生成消耗积分(credits),高频调用或复杂项目可能导致 out_of_credits 错误
  • 生成一致性:相同描述可能产生不同布局,关键品牌资产仍需人工复核
  • 数据隐私:设计内容和参考图片上传至 Sleek 服务器,敏感行业需评估合规性

技能正文


name: sleek-design-mobile-apps description: Use when the user wants to design a mobile app, create screens, build UI, or interact with their Sleek projects. Covers high-level requests ("design an app that does X") and specific ones ("list my projects", "create a new project", "screenshot that screen").

Designing with Sleek

Overview

Sleek 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. All communication is standard HTTP with bearer token auth.

Base URL: https://sleek.design Auth: Authorization: Bearer <API_KEY> on every /api/v1/* request Content-Type: application/json (requests and responses) CORS: Enabled on all /api/v1/* endpoints


Prerequisites: API Key

Create API keys at https://sleek.design/dashboard/api-keys. The full key value is shown only once at creation — store it securely.

Required plan: Pro+ (API access is gated)

Key scopes

Scope What it unlocks
projects:read List / get projects
projects:write Create / delete projects
components:read List components in a project
chats:read Get chat run status
chats:write Send chat messages
screenshots Render component screenshots

Create a key with only the scopes needed for the task.


Handling high-level requests

When the user says something like "design a fitness tracking app" or "build me a settings screen":

  1. Create a project if one doesn't exist yet (ask the user for a name, or derive one from the request)
  2. Send a chat message describing what to build — you can use the user's words directly as message.text; Sleek's AI interprets natural language
  3. Follow the screenshot delivery rule below to show the result

You do not need to decompose the request into screens first. Send the full intent as a single message and let Sleek decide what screens to create.


Screenshot delivery rule

After every chat run that produces screen_created or screen_updated operations, always take screenshots and show them to the user. Never silently complete a chat run without delivering the visuals.

When screens are created for the first time on a project (i.e. the run includes screen_created operations), deliver:

  1. One screenshot per newly created screen (individual componentIds: [screenId])
  2. One combined screenshot of all screens in the project (componentIds: [all screen ids])

When only existing screens are updated, deliver one screenshot per affected screen.

Use background: "transparent" for all screenshots unless the user explicitly requests otherwise.


Quick Reference — All Endpoints

Method Path Scope Description
GET /api/v1/projects projects:read List projects
POST /api/v1/projects projects:write Create project
GET /api/v1/projects/:id projects:read Get project
DELETE /api/v1/projects/:id projects:write Delete project
GET /api/v1/projects/:id/components components:read List components
POST /api/v1/projects/:id/chat/messages chats:write Send chat message
GET /api/v1/projects/:id/chat/runs/:runId chats:read Poll run status
POST /api/screenshots screenshots Render screenshot

All IDs are stable string identifiers.


Endpoints

Projects

List projects

GET /api/v1/projects?limit=50&offset=0
Authorization: Bearer <key>

Response 200:

{
  "data": [
    {
      "id": "proj_abc",
      "name": "My App",
      "slug": "my-app",
      "createdAt": "2026-01-01T00:00:00Z",
      "updatedAt": "..."
    }
  ],
  "pagination": { "total": 12, "limit": 50, "offset": 0 }
}

Create project

POST /api/v1/projects
Authorization: Bearer <key>
Content-Type: application/json

{ "name": "My New App" }

Response 201 — same shape as a single project.

Get / Delete project

GET    /api/v1/projects/:projectId
DELETE /api/v1/projects/:projectId   → 204 No Content

Components

List components

GET /api/v1/projects/:projectId/components?limit=50&offset=0
Authorization: Bearer <key>

Response 200:

{
  "data": [
    {
      "id": "cmp_xyz",
      "name": "Hero Section",
      "activeVersion": 3,
      "versions": [{ "id": "ver_001", "version": 1, "createdAt": "..." }],
      "createdAt": "...",
      "updatedAt": "..."
    }
  ],
  "pagination": { "total": 5, "limit": 50, "offset": 0 }
}

Chat — Send Message

This is the core action: describe what you want in message.text and the AI creates or modifies screens.

POST /api/v1/projects/:projectId/chat/messages?wait=false
Authorization: Bearer <key>
Content-Type: application/json
idempotency-key: <optional, max 255 chars>

{
  "message": { "text": "Add a pricing section with three tiers" },
  "imageUrls": ["https://example.com/ref.png"],
  "target": { "screenId": "scr_abc" }
}
Field Required Notes
message.text Yes 1+ chars, trimmed
imageUrls No HTTPS URLs only; included as visual context
target.screenId No Edit a specific screen; omit to let AI decide
?wait=true/false No Sync wait mode (default: false)
idempotency-key header No Replay-safe re-sends

Response — async (default, wait=false)

Status 202 Accepted. result and error are absent until the run reaches a terminal state.

{
  "data": {
    "runId": "run_111",
    "status": "queued",
    "statusUrl": "/api/v1/projects/proj_abc/chat/runs/run_111"
  }
}

Response — sync (wait=true)

Blocks up to 300 seconds. Returns 200 when completed, 202 if timed out.

{
  "data": {
    "runId": "run_111",
    "status": "completed",
    "statusUrl": "...",
    "result": {
      "assistantText": "I added a pricing section with...",
      "operations": [
        { "type": "screen_created", "screenId": "scr_xyz", "screenName": "Pricing" },
        { "type": "screen_updated", "screenId": "scr_abc" },
        { "type": "theme_updated" }
      ]
    }
  }
}

Chat — Poll Run Status

Use this after async send to check progress.

GET /api/v1/projects/:projectId/chat/runs/:runId
Authorization: Bearer <key>

Response — same shape as send message data object:

{
  "data": {
    "runId": "run_111",
    "status": "queued",
    "statusUrl": "..."
  }
}

When completed successfully, result is present:

{
  "data": {
    "runId": "run_111",
    "status": "completed",
    "statusUrl": "...",
    "result": {
      "assistantText": "...",
      "operations": [...]
    }
  }
}

When failed, error is present:

{
  "data": {
    "runId": "run_111",
    "status": "failed",
    "statusUrl": "...",
    "error": { "code": "execution_failed", "message": "..." }
  }
}

Run status lifecycle: queued → running → completed | failed


Screenshots

Takes a snapshot of one or more rendered components.

POST /api/screenshots
Authorization: Bearer <key>
Content-Type: application/json

{
  "componentIds": ["cmp_xyz", "cmp_abc"],
  "projectId": "proj_abc",
  "format": "png",
  "scale": 2,
  "gap": 40,
  "padding": 40,
  "background": "transparent"
}
Field Default Notes
format png png or webp
scale 2 1–3 (device pixel ratio)
gap 40 Pixels between components
padding 40 Canvas padding
background transparent Any CSS color

Always use "background": "transparent" unless the user explicitly requests a specific background color.

Response: raw binary image/png or image/webp with Content-Disposition: attachment.


Error Shapes

{ "code": "UNAUTHORIZED", "message": "..." }
HTTP Code When
401 UNAUTHORIZED Missing/invalid/expired API key
403 FORBIDDEN Valid key, wrong scope or plan
404 NOT_FOUND Resource doesn't exist
400 BAD_REQUEST Validation failure
409 CONFLICT Another run is active for this project
500 INTERNAL_SERVER_ERROR Server error

Chat run-level errors (inside data.error):

Code Meaning
out_of_credits Organization has no credits left
execution_failed AI execution error

Flows

Flow 1: Create project and generate a UI (async + polling)

1. POST /api/v1/projects                              → get projectId
2. POST /api/v1/projects/:id/chat/messages            → get runId (202)
3. Poll GET /api/v1/projects/:id/chat/runs/:runId
   until status == "completed" or "failed"
4. Collect screenIds from result.operations
   (screen_created and screen_updated entries)
5. Screenshot each affected screen individually
6. If any screen_created: also screenshot all project screens combined
7. Show all screenshots to the user

Polling recommendation: start at 2s interval, back off to 5s after 10s, give up after 5 minutes.

Flow 2: Sync mode (simple, blocking)

Best for short tasks or when latency is acceptable.

1. POST /api/v1/projects/:id/chat/messages?wait=true
   → blocks up to 300s
   → 200 if completed, 202 if timed out
2. If 202, fall back to Flow 1 polling with the returned runId
3. On completion, screenshot and show affected screens (see screenshot delivery rule)

Flow 3: Edit a specific screen

1. GET /api/v1/projects/:id/components         → find screenId
2. POST /api/v1/projects/:id/chat/messages
   body: { message: { text: "..." }, target: { screenId: "scr_xyz" } }
3. Poll or wait as above
4. Screenshot the updated screen and show it to the user

Flow 4: Idempotent message (safe retries)

Add idempotency-key header on the send request. If the network drops and you retry with the same key, the server returns the existing run rather than creating a duplicate. The key must be ≤255 chars.

POST /api/v1/projects/:id/chat/messages
idempotency-key: my-unique-request-id-abc123

Flow 5: One run at a time (conflict handling)

Only one active run is allowed per project. If you send a message while one is running, you get 409 CONFLICT. Wait for the active run to complete before sending the next message.

409 response → poll existing run → completed → send next message

Pagination

All list endpoints accept limit (1–100, default 50) and offset (≥0). The response always includes pagination.total so you can page through all results.

GET /api/v1/projects?limit=10&offset=20

Common Mistakes

Mistake Fix
Sending to /api/v1 without Authorization header Add Authorization: Bearer <key> to every request
Using wrong scope Check key's scopes match the endpoint (e.g. chats:write for sending messages)
Sending next message before run completes Poll until completed/failed before next send
Using wait=true on long generations It blocks 300s max; have a fallback to polling for 202 response
HTTP URLs in imageUrls Only HTTPS URLs are accepted
Assuming result is present on 202 result is absent until status is completed

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

mobile-designui-generationprototypingapi-integrationai-assisted-designrest-api

同类 Skill