@uibot/skills 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/content/agents/artifact-lite.md +33 -0
- package/content/agents/default.md +57 -0
- package/content/craft/accessibility-baseline.md +6 -0
- package/content/craft/animation-discipline.md +6 -0
- package/content/craft/anti-ai-slop.md +7 -0
- package/content/craft/color.md +6 -0
- package/content/craft/density-and-spacing.md +6 -0
- package/content/craft/form-validation.md +6 -0
- package/content/craft/laws-of-ux.md +6 -0
- package/content/craft/rtl-and-bidi.md +5 -0
- package/content/craft/state-coverage.md +5 -0
- package/content/craft/typography.md +6 -0
- package/content/skills/apply-design-md/SKILL.md +73 -0
- package/content/skills/extract-design-tokens/SKILL.md +80 -0
- package/content/skills/generate-admin-page/SKILL.md +200 -0
- package/content/skills/generate-landing-page/SKILL.md +114 -0
- package/content/skills/html-deck/SKILL.md +53 -0
- package/content/skills/html-mobile-mockup/SKILL.md +49 -0
- package/content/skills/html-prototype/SKILL.md +49 -0
- package/content/skills/html-social-carousel/SKILL.md +90 -0
- package/content/skills/html-social-carousel/example.html +219 -0
- package/content/skills/uibot-yaml-spec/SKILL.md +166 -0
- package/dist/builtin-pack.d.ts +36 -0
- package/dist/capability.d.ts +16 -0
- package/dist/evolver.d.ts +85 -0
- package/dist/fs-source.d.ts +10 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +162 -0
- package/dist/loader.d.ts +11 -0
- package/dist/match.d.ts +12 -0
- package/dist/reflection-store.d.ts +21 -0
- package/dist/registry.d.ts +10 -0
- package/dist/regression-store.d.ts +37 -0
- package/dist/schema.d.ts +9 -0
- package/dist/selector.d.ts +19 -0
- package/dist/usage-store.d.ts +24 -0
- package/package.json +38 -4
- package/README.md +0 -3
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: artifact-lite
|
|
3
|
+
name: Artifact Lite
|
|
4
|
+
description: Directly generates a single standalone HTML prototype or slide deck as one inline <artifact type="html"> block. No discovery questions — used by the focused HTML/PPT verification playground.
|
|
5
|
+
defaultModel: deepseek-v4-flash
|
|
6
|
+
allowedSkills:
|
|
7
|
+
- html-prototype
|
|
8
|
+
- html-deck
|
|
9
|
+
- html-mobile-mockup
|
|
10
|
+
- html-social-carousel
|
|
11
|
+
allowedCapabilities:
|
|
12
|
+
- catalog:component
|
|
13
|
+
- designMd:source
|
|
14
|
+
enabled: true
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
你是 Artifact Lite,一个**一次成型**的产物生成助手。你产出自包含的单文件 HTML 产物,按用户意图选用最合适的 HTML skill:
|
|
18
|
+
|
|
19
|
+
1. **HTML 原型 / 落地页 / 官网**(prototype)— 走 `html-prototype` skill,输出 `<artifact type="html" kind="prototype">`。
|
|
20
|
+
2. **演示文稿 / 幻灯片**(deck / PPT)— 走 `html-deck` skill,输出 `<artifact type="html" kind="deck">`。
|
|
21
|
+
3. **移动端 / App 原型**(mobile)— 走 `html-mobile-mockup` skill,输出 `<artifact type="html" kind="prototype">`。
|
|
22
|
+
4. **社交轮播卡片 / 营销卡片**(social carousel)— 走 `html-social-carousel` skill。
|
|
23
|
+
|
|
24
|
+
按用户消息中的关键词与所选模板(题首的【…】关键词)匹配最合适的 skill;当题首已给出明确关键词时,优先据此选 skill。
|
|
25
|
+
|
|
26
|
+
## 绝对规则(违反即失败)
|
|
27
|
+
|
|
28
|
+
- **直接在你这条回复的正文里**输出完整的单文件 HTML,用所选 skill 的 Output Contract 规定的 `<artifact type="html" kind="...">...</artifact>` 包裹。
|
|
29
|
+
- **禁止提问。禁止输出任何 `<question-form>` 或澄清问题。** 信息不足时,**自行做出合理的设计假设**并立即生成 —— 绝不等待用户补充。
|
|
30
|
+
- **禁止调用任何工具**,尤其禁止把 HTML 写入文件(不要用 write_file / 文件系统 / 任何 tool)。产物必须以 `<artifact>` 文本形式直接出现在回复里。
|
|
31
|
+
- HTML 必须自包含:内联 CSS、系统字体,可用 `/tailwind-play.js`;禁止外链脚本 / 字体 / 图片 / 第三方素材;用诚实的占位文案,不编造数据指标。
|
|
32
|
+
- 用户输入含「原型 / prototype / 落地页 / 官网 / mockup」→ html-prototype;含「PPT / 演示文稿 / 幻灯片 / deck / slides / 路演」→ html-deck。
|
|
33
|
+
- 输出顺序:先一句话(≤1 行)说明你做了什么,紧接着就是那个 `<artifact>` 块。不要长篇解释。
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: ui-generator
|
|
3
|
+
name: UI Generator
|
|
4
|
+
description: Generates UIBot Spec v2 pages based on user intent, using the component catalog and selected design style.
|
|
5
|
+
defaultModel: deepseek-v4-flash
|
|
6
|
+
allowedSkills:
|
|
7
|
+
- generate-admin-page
|
|
8
|
+
- generate-landing-page
|
|
9
|
+
- extract-design-tokens
|
|
10
|
+
- apply-design-md
|
|
11
|
+
allowedCapabilities:
|
|
12
|
+
- catalog:component
|
|
13
|
+
- designMd:source
|
|
14
|
+
enabled: true
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
你是 UIBot UI Generator,一个专门生成 UIBot Spec v2 格式页面的 AI 助手。
|
|
18
|
+
|
|
19
|
+
## 核心职责
|
|
20
|
+
|
|
21
|
+
根据用户描述,输出符合 UIBot Spec v2 格式的 YAML 页面定义。输出必须是可被 UIBot 编译器直接解析的合法 YAML。
|
|
22
|
+
|
|
23
|
+
## 输出格式
|
|
24
|
+
|
|
25
|
+
始终输出如下格式:
|
|
26
|
+
|
|
27
|
+
```yaml
|
|
28
|
+
page:
|
|
29
|
+
id: <page-id>
|
|
30
|
+
title: <Page Title>
|
|
31
|
+
blocks:
|
|
32
|
+
- type: <BlockType>
|
|
33
|
+
props:
|
|
34
|
+
...
|
|
35
|
+
children:
|
|
36
|
+
- ...
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## 约束规则
|
|
40
|
+
|
|
41
|
+
1. **只使用目录中声明的 Block 类型**(见 Catalog 章节)
|
|
42
|
+
2. **operator 语法**:用 `_state: path` 读取状态,`_eq` 做比较,`_payload` 读取请求结果
|
|
43
|
+
3. **Action 语法**:事件处理用 `events.onClick[].action`,参数用 `params:` 而非 `props:`
|
|
44
|
+
4. **可见性门禁**:`visible: { _eq: [{ _state: _user.role }, admin] }` 置于 block 顶层
|
|
45
|
+
5. **禁止内联 mock 数据**:表格数据通过 `requests[].onSuccess: SetState` 加载
|
|
46
|
+
6. **不输出 HTML**:只输出 UIBot YAML Spec
|
|
47
|
+
|
|
48
|
+
## 风格适配
|
|
49
|
+
|
|
50
|
+
如果用户提供了设计风格偏好或已选择 design-md,将其 CSS token 应用到外层 Box 的 `style` 属性,并根据风格指南调整 Button variant、Card padding 等。
|
|
51
|
+
|
|
52
|
+
## 工作流程
|
|
53
|
+
|
|
54
|
+
1. 理解用户的页面意图(CRUD 管理、落地页、仪表盘等)
|
|
55
|
+
2. 选择适合的技能(generate-admin-page / generate-landing-page)
|
|
56
|
+
3. 如有 design-md 激活,应用 apply-design-md 技能
|
|
57
|
+
4. 输出完整的 UIBot YAML Spec
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Anti AI Slop
|
|
2
|
+
|
|
3
|
+
- Avoid purple-blue gradient defaults unless the brief explicitly asks for them.
|
|
4
|
+
- Do not use emoji as feature icons.
|
|
5
|
+
- Use one accent color with a clear budget.
|
|
6
|
+
- Replace generic copy with brief-specific language or honest placeholders.
|
|
7
|
+
- Prefer real UI structure over decorative cards and floating blobs.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# Typography
|
|
2
|
+
|
|
3
|
+
- Pair a distinct display face with a quiet system body stack.
|
|
4
|
+
- Keep body text readable and avoid viewport-scaled font sizes.
|
|
5
|
+
- Use mono only for numerics, labels, and technical metadata.
|
|
6
|
+
- Make hierarchy visible through size, weight, spacing, and rhythm.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: apply-design-md
|
|
3
|
+
title: Apply Design-MD Style
|
|
4
|
+
version: "1.1.0"
|
|
5
|
+
triggers: [design-md, 风格, 品牌风格, 应用风格, 主题, 暗色, 暗色主题, theme, apply style, shadcn, dark mode]
|
|
6
|
+
tags: [design-md, styling, theme]
|
|
7
|
+
category: design-system
|
|
8
|
+
allowedCapabilities: [catalog:component]
|
|
9
|
+
authors: [uibot-team]
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Purpose
|
|
13
|
+
|
|
14
|
+
Apply a selected design-md style guide to a UIBot Spec.
|
|
15
|
+
Translates design tokens and style preferences into block `props` values.
|
|
16
|
+
|
|
17
|
+
If no design-md matches, still apply the UI Craft baseline (lane + anti-slop)
|
|
18
|
+
from the system prompt. `frontend-principles` is force-included on the default
|
|
19
|
+
generation path; `control-console` auto-selects for ops / dense admin intents.
|
|
20
|
+
Brand seeds (linear / stripe / vercel / notion / supabase / claude / raycast /
|
|
21
|
+
figma / ibm) win on tokens when selected.
|
|
22
|
+
|
|
23
|
+
## How Tokens Reach The Output
|
|
24
|
+
|
|
25
|
+
Spec blocks do not take `className` or `style` (only `Link` has `className`), so
|
|
26
|
+
there is no per-block style override in a Spec. Tokens reach the page two ways:
|
|
27
|
+
|
|
28
|
+
1. **`PageLayout` props** (one per page): `appearance` (`default | admin`),
|
|
29
|
+
`theme`, `font`, `direction`, and `tokens`, an object of CSS tokens
|
|
30
|
+
(sidebar, surface, foreground, accent, accent-foreground, border, font,
|
|
31
|
+
primary, primary-foreground). Map the design-md `extractedTokens` onto
|
|
32
|
+
`tokens`; do not invent token names outside that list.
|
|
33
|
+
2. **The HTML artifact** that mirrors the Spec: declare the design-md values as
|
|
34
|
+
CSS variables on `:root` in one `<style>` block and reference them with
|
|
35
|
+
`var(--primary)` etc. This is where non-catalog tokens (spacing, shadow,
|
|
36
|
+
radius, type scale) are expressed.
|
|
37
|
+
|
|
38
|
+
```yaml
|
|
39
|
+
- type: PageLayout
|
|
40
|
+
props:
|
|
41
|
+
appearance: admin
|
|
42
|
+
tokens:
|
|
43
|
+
primary: "<token value>"
|
|
44
|
+
border: "<token value>"
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Per-Block Style Mapping
|
|
48
|
+
|
|
49
|
+
Only catalog props carry style decisions:
|
|
50
|
+
|
|
51
|
+
- **Button**: `variant` by design-md `category`. `admin`: `default` for primary
|
|
52
|
+
actions, `outline` or `ghost` for secondary. `landing`: `default` for hero
|
|
53
|
+
CTAs, `ghost` for nav links, `outline` for secondary CTAs.
|
|
54
|
+
- **Heading**: use `level` consistently (page title 1, section 2, card title 3);
|
|
55
|
+
the design-md typography scale goes into the HTML artifact's CSS.
|
|
56
|
+
- **Box**: density through `gap` / `padding` (`none | xs | sm | md | lg | xl`):
|
|
57
|
+
compact for `admin`, roomier for `landing`.
|
|
58
|
+
- **Card / Table**: no style props; do not try to restyle them.
|
|
59
|
+
|
|
60
|
+
## Dark Mode
|
|
61
|
+
|
|
62
|
+
If the design-md tags include `dark-mode`, set `PageLayout.theme` to the dark
|
|
63
|
+
theme and give the HTML artifact a dark `:root` palette. Keep contrast at 4.5 or
|
|
64
|
+
above.
|
|
65
|
+
|
|
66
|
+
## Validation Checklist
|
|
67
|
+
|
|
68
|
+
- [ ] No `className` / `style` on any block except `Link.className`
|
|
69
|
+
- [ ] `PageLayout.tokens` keys are from the list above; there is at most one `PageLayout`
|
|
70
|
+
- [ ] All `Button.variant` values are `default | outline | secondary | ghost | destructive | link` (never `primary`)
|
|
71
|
+
- [ ] All `Form.Submit.variant` values are `default | destructive | outline | ghost`
|
|
72
|
+
- [ ] The HTML artifact uses `var(--token)` references, not scattered hex values
|
|
73
|
+
- [ ] `Card.title` is a plain string; `Heading.level` is an integer 1-6
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: extract-design-tokens
|
|
3
|
+
title: Extract Design Tokens
|
|
4
|
+
version: "1.0.0"
|
|
5
|
+
triggers: [token, tokens, design token, 设计 token, 风格提取, 主题色, 品牌色, 提取, css variable, extract]
|
|
6
|
+
tags: [design-md, tokens]
|
|
7
|
+
category: design-system
|
|
8
|
+
allowedCapabilities: []
|
|
9
|
+
authors: [uibot-team]
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Purpose
|
|
13
|
+
|
|
14
|
+
Extract design tokens from a description, screenshot alt-text, or URL reference,
|
|
15
|
+
and format them as a UIBot `design-md` frontmatter block.
|
|
16
|
+
|
|
17
|
+
## Output Format
|
|
18
|
+
|
|
19
|
+
When extracting tokens, produce a YAML frontmatter block like this:
|
|
20
|
+
|
|
21
|
+
```yaml
|
|
22
|
+
---
|
|
23
|
+
id: <derived-id>
|
|
24
|
+
title: <Brand/Style Name>
|
|
25
|
+
category: <admin|landing|blog|dashboard>
|
|
26
|
+
tags: [<relevant-tags>]
|
|
27
|
+
origin: local
|
|
28
|
+
extractedTokens:
|
|
29
|
+
- name: "--primary"
|
|
30
|
+
value: "<hex or hsl>"
|
|
31
|
+
group: colors
|
|
32
|
+
- name: "--background"
|
|
33
|
+
value: "<hex or hsl>"
|
|
34
|
+
group: colors
|
|
35
|
+
- name: "--foreground"
|
|
36
|
+
value: "<hex or hsl>"
|
|
37
|
+
group: colors
|
|
38
|
+
- name: "--radius"
|
|
39
|
+
value: "<rem value>"
|
|
40
|
+
group: shape
|
|
41
|
+
- name: "--font-sans"
|
|
42
|
+
value: "<font stack>"
|
|
43
|
+
group: typography
|
|
44
|
+
---
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Token Extraction Rules
|
|
48
|
+
|
|
49
|
+
### Colors
|
|
50
|
+
- Extract primary, secondary, accent, background, foreground, border, muted colors
|
|
51
|
+
- Use CSS custom property naming: `--primary`, `--secondary`, `--accent`, `--muted`
|
|
52
|
+
- Express as HSL when possible: `"222.2 84% 4.9%"` (no `hsl()` wrapper)
|
|
53
|
+
|
|
54
|
+
### Typography
|
|
55
|
+
- Extract font families as `--font-sans`, `--font-mono`, `--font-serif`
|
|
56
|
+
- Extract base font size if specified
|
|
57
|
+
|
|
58
|
+
### Shape
|
|
59
|
+
- Extract border radius as `--radius` in rem units
|
|
60
|
+
- Extract shadow tokens if distinctive
|
|
61
|
+
|
|
62
|
+
### Spacing
|
|
63
|
+
- Extract spacing scale only if non-standard (e.g., `--space-base: 0.875rem`)
|
|
64
|
+
|
|
65
|
+
## Minimal Token Set (always include)
|
|
66
|
+
|
|
67
|
+
At minimum, extract these 5 tokens:
|
|
68
|
+
1. `--primary` — main brand color
|
|
69
|
+
2. `--background` — page background
|
|
70
|
+
3. `--foreground` — main text color
|
|
71
|
+
4. `--radius` — border radius
|
|
72
|
+
5. `--font-sans` — primary font
|
|
73
|
+
|
|
74
|
+
## After Extraction
|
|
75
|
+
|
|
76
|
+
Append a brief style guide body describing:
|
|
77
|
+
1. Color palette philosophy (warm/cool/neutral, light/dark mode preference)
|
|
78
|
+
2. Typography choices (clean/serif/monospace character)
|
|
79
|
+
3. Spacing density (compact/default/spacious)
|
|
80
|
+
4. Recommended UIBot blocks that suit this style
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: generate-admin-page
|
|
3
|
+
title: Generate Admin Page
|
|
4
|
+
version: "1.2.0"
|
|
5
|
+
triggers: [admin, dashboard, crud, 后台, 管理, table, users, list]
|
|
6
|
+
tags: [admin, crud, layout]
|
|
7
|
+
category: page-recipe
|
|
8
|
+
allowedCapabilities: [catalog:component]
|
|
9
|
+
authors: [uibot-team]
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Purpose
|
|
13
|
+
|
|
14
|
+
Generate admin / management pages as UIBot Spec blocks: user management,
|
|
15
|
+
resource CRUD, data tables with actions, KPI overviews, role-gated content.
|
|
16
|
+
The YAML envelope, operator list and HTML artifact rules come from
|
|
17
|
+
`uibot-yaml-spec`; this skill only adds the admin page recipes. Output the
|
|
18
|
+
page object directly (`id`, `title`, `blocks`), never wrapped in `page:`.
|
|
19
|
+
|
|
20
|
+
## Standard Structure
|
|
21
|
+
|
|
22
|
+
```yaml
|
|
23
|
+
id: <resource>-list
|
|
24
|
+
title: <资源>管理
|
|
25
|
+
blocks:
|
|
26
|
+
- type: PageLayout
|
|
27
|
+
props:
|
|
28
|
+
appearance: admin
|
|
29
|
+
title: <资源>管理
|
|
30
|
+
slots:
|
|
31
|
+
sidebar:
|
|
32
|
+
- type: PageSiderMenu
|
|
33
|
+
props:
|
|
34
|
+
title: <应用名>
|
|
35
|
+
children:
|
|
36
|
+
- type: MenuLink
|
|
37
|
+
props:
|
|
38
|
+
label: <导航项>
|
|
39
|
+
href: /<path>
|
|
40
|
+
active: false
|
|
41
|
+
children:
|
|
42
|
+
- type: Card
|
|
43
|
+
props:
|
|
44
|
+
title: <资源>列表
|
|
45
|
+
slots:
|
|
46
|
+
actions:
|
|
47
|
+
- type: Button
|
|
48
|
+
props:
|
|
49
|
+
label: 新建<资源>
|
|
50
|
+
variant: default
|
|
51
|
+
visible:
|
|
52
|
+
_eq:
|
|
53
|
+
- _user: role
|
|
54
|
+
- admin
|
|
55
|
+
events:
|
|
56
|
+
onClick:
|
|
57
|
+
- action: Link
|
|
58
|
+
params:
|
|
59
|
+
path: /<resource>/new
|
|
60
|
+
children:
|
|
61
|
+
- type: Table
|
|
62
|
+
props:
|
|
63
|
+
columns:
|
|
64
|
+
- key: <field1>
|
|
65
|
+
label: <列名1>
|
|
66
|
+
- key: <field2>
|
|
67
|
+
label: <列名2>
|
|
68
|
+
rows:
|
|
69
|
+
_state: <resource>.data
|
|
70
|
+
emptyText: 暂无<资源>
|
|
71
|
+
requests:
|
|
72
|
+
- id: load-<resource>
|
|
73
|
+
connectionId: <resource>-db
|
|
74
|
+
payload:
|
|
75
|
+
operation: Find
|
|
76
|
+
onSuccess:
|
|
77
|
+
- action: SetState
|
|
78
|
+
params:
|
|
79
|
+
path: <resource>.data
|
|
80
|
+
value:
|
|
81
|
+
_payload: data
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Overview With Stats
|
|
85
|
+
|
|
86
|
+
Lead with a stats row, then the table. Values come from state; if a number is
|
|
87
|
+
not known, leave it out or show `n/a`. Never write a made-up figure or a
|
|
88
|
+
made-up change ("+12%") as a literal.
|
|
89
|
+
|
|
90
|
+
```yaml
|
|
91
|
+
- type: Box
|
|
92
|
+
props:
|
|
93
|
+
direction: row
|
|
94
|
+
gap: md
|
|
95
|
+
children:
|
|
96
|
+
- type: Stat
|
|
97
|
+
props:
|
|
98
|
+
label: 用户总数
|
|
99
|
+
value:
|
|
100
|
+
_state: stats.totalUsers
|
|
101
|
+
change:
|
|
102
|
+
_state: stats.totalUsersChange
|
|
103
|
+
- type: Stat
|
|
104
|
+
props:
|
|
105
|
+
label: 活跃会话
|
|
106
|
+
value:
|
|
107
|
+
_state: stats.activeSessions
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Fill `stats.*` through a `requests` entry on the owning block, the same way
|
|
111
|
+
the table loads its rows. If no connection exists for the numbers, add a final
|
|
112
|
+
`# MOCK:` comment (see `uibot-yaml-spec`) rather than hard-coding values.
|
|
113
|
+
|
|
114
|
+
## Form Page Structure
|
|
115
|
+
|
|
116
|
+
```yaml
|
|
117
|
+
- type: Card
|
|
118
|
+
props:
|
|
119
|
+
title: 编辑<资源>
|
|
120
|
+
children:
|
|
121
|
+
- type: Form
|
|
122
|
+
props:
|
|
123
|
+
label: edit-<resource>-form
|
|
124
|
+
children:
|
|
125
|
+
- type: Form.Input
|
|
126
|
+
props:
|
|
127
|
+
name: <field>
|
|
128
|
+
label: <字段名>
|
|
129
|
+
required: true
|
|
130
|
+
helpText: <字段下方的提示>
|
|
131
|
+
value:
|
|
132
|
+
_bindState: edit<Resource>.<field>
|
|
133
|
+
- type: Form.Select
|
|
134
|
+
props:
|
|
135
|
+
name: role
|
|
136
|
+
label: 角色
|
|
137
|
+
options:
|
|
138
|
+
- value: admin
|
|
139
|
+
label: 管理员
|
|
140
|
+
- value: viewer
|
|
141
|
+
label: 只读成员
|
|
142
|
+
value:
|
|
143
|
+
_bindState: edit<Resource>.role
|
|
144
|
+
- type: Form.Submit
|
|
145
|
+
props:
|
|
146
|
+
label: 保存
|
|
147
|
+
events:
|
|
148
|
+
onSubmit:
|
|
149
|
+
- action: Validate
|
|
150
|
+
params:
|
|
151
|
+
formId: edit-<resource>-form
|
|
152
|
+
- action: Request
|
|
153
|
+
params:
|
|
154
|
+
connectionId: <resource>-db
|
|
155
|
+
request:
|
|
156
|
+
payload:
|
|
157
|
+
operation: UpdateOne
|
|
158
|
+
filter:
|
|
159
|
+
id:
|
|
160
|
+
_state: edit<Resource>.id
|
|
161
|
+
data:
|
|
162
|
+
_state: edit<Resource>
|
|
163
|
+
onSuccess:
|
|
164
|
+
- action: Link
|
|
165
|
+
params:
|
|
166
|
+
path: /<resource>
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## Design-md pairing
|
|
170
|
+
|
|
171
|
+
Prefer `control-console` (bundled) when the intent is ops / dense admin, or
|
|
172
|
+
`ibm-design` for Carbon-like light chrome. Do not apply a marketing brand
|
|
173
|
+
(figma / stripe landing) to a CRUD page.
|
|
174
|
+
|
|
175
|
+
## Key Rules
|
|
176
|
+
|
|
177
|
+
- Always wrap content in `PageLayout` → `Card` hierarchy; one `PageLayout` per page.
|
|
178
|
+
- Tables load data through `requests[].onSuccess` + `SetState` (`params.path`,
|
|
179
|
+
`params.value`); never inline sample rows.
|
|
180
|
+
- `Request` actions use `params.connectionId` and a nested `params.request`;
|
|
181
|
+
`onSuccess` / `onError` sit beside `params`, not inside it.
|
|
182
|
+
- Role-gated actions: `visible: { _eq: [{ _user: role }, admin] }`.
|
|
183
|
+
- Bind editable fields with `_bindState`, read-only values with `_state`.
|
|
184
|
+
- Submit order: `Validate`, then `Request`, then `Link` back to the list.
|
|
185
|
+
- `Button.variant`: `default | outline | secondary | ghost | destructive | link`
|
|
186
|
+
(never `primary`); `Form.Submit.variant`: `default | destructive | outline | ghost`.
|
|
187
|
+
- Unknown metrics stay `n/a` or an empty state, never an invented figure.
|
|
188
|
+
- Say once that data is sample data with a floating `Toast` (`placement: top-right`, `level: info`, a short title and one line, `closeable` left on), not a banner inside every card. `PageLayout` already keeps the header and sidebar fixed and scrolls only the main area, and it spaces its top-level blocks; do not add manual spacers.
|
|
189
|
+
- Write titles, labels and copy in Chinese unless the user asks otherwise.
|
|
190
|
+
|
|
191
|
+
## Operator Cheatsheet
|
|
192
|
+
|
|
193
|
+
| Pattern | Example |
|
|
194
|
+
|---------|---------|
|
|
195
|
+
| Read state | `_state: path.to.value` |
|
|
196
|
+
| Bind form field | `value: { _bindState: editUser.name }` |
|
|
197
|
+
| Conditional visibility | `visible: { _eq: [{ _user: role }, admin] }` |
|
|
198
|
+
| Map response | `value: { _payload: data }` |
|
|
199
|
+
| Current user | `_user: name` / `_user: role` |
|
|
200
|
+
| List scope item | `_item: fieldName` (inside List/Table rows) |
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: generate-landing-page
|
|
3
|
+
title: Generate Landing Page
|
|
4
|
+
version: "1.2.0"
|
|
5
|
+
triggers: [landing, homepage, hero, saas, marketing, 落地页, 官网, features, pricing]
|
|
6
|
+
tags: [landing, layout]
|
|
7
|
+
category: page-recipe
|
|
8
|
+
allowedCapabilities: [catalog:component]
|
|
9
|
+
authors: [uibot-team]
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Purpose
|
|
13
|
+
|
|
14
|
+
Generate marketing / landing pages as UIBot Spec blocks (page object `id`,
|
|
15
|
+
`title`, `blocks`; never wrapped in `page:`; envelope rules in `uibot-yaml-spec`). Target: SaaS homepages,
|
|
16
|
+
product sites, pricing pages. Pick the **marketing / landing** UI Craft lane,
|
|
17
|
+
then a brand design-md (vercel / stripe / figma / …). Never default to
|
|
18
|
+
purple-gradient SaaS or a centered Inter hero.
|
|
19
|
+
|
|
20
|
+
## Lane first
|
|
21
|
+
|
|
22
|
+
1. Visual direction in one sentence (not "clean modern SaaS").
|
|
23
|
+
2. Differentiator: the one thing someone will remember.
|
|
24
|
+
3. If a brand design-md is selected, it owns hex and type.
|
|
25
|
+
4. Prefer catalog L2/L3 blocks. Never invent types.
|
|
26
|
+
|
|
27
|
+
## Standard page (catalog recipes)
|
|
28
|
+
|
|
29
|
+
Use `PageLayout` as the shell. Prefer these blocks when they exist in the
|
|
30
|
+
catalog — do **not** rebuild them from `Box` + `Card` + `Stat`:
|
|
31
|
+
|
|
32
|
+
| Section | Block | Notes |
|
|
33
|
+
| --- | --- | --- |
|
|
34
|
+
| Hero | `Hero` | Asymmetric editorial hero. Optional `BrowserFrame` in `aside`. |
|
|
35
|
+
| Proof | `LogoCloud` | Text wordmarks only. Or qualitative copy — no fake "12,000 users". |
|
|
36
|
+
| Features | `SectionHeader` + `FeatureGrid` | `items: [{icon, title, desc}]`. |
|
|
37
|
+
| How it works | `Steps` | Numbered or connected. |
|
|
38
|
+
| Pricing | `PricingTable` | 2–4 plans. Mark at most one `highlighted`. |
|
|
39
|
+
| Close | `CtaBand` | Single high-contrast CTA. |
|
|
40
|
+
|
|
41
|
+
```yaml
|
|
42
|
+
id: index-page
|
|
43
|
+
title: 产品首页
|
|
44
|
+
blocks:
|
|
45
|
+
- type: PageLayout
|
|
46
|
+
props:
|
|
47
|
+
title: Northwind
|
|
48
|
+
children:
|
|
49
|
+
- type: Hero
|
|
50
|
+
props:
|
|
51
|
+
eyebrow: Issue tracker
|
|
52
|
+
title: One surface for triage
|
|
53
|
+
subtitle: Keyboard-first. No vanity KPIs.
|
|
54
|
+
primaryCta: { label: Start free, href: /signup }
|
|
55
|
+
secondaryCta: { label: View pricing, href: /pricing }
|
|
56
|
+
- type: LogoCloud
|
|
57
|
+
props:
|
|
58
|
+
label: Built for teams already in Linear-style tools
|
|
59
|
+
logos: [{ name: Platform }, { name: Payments }, { name: Infra }]
|
|
60
|
+
- type: SectionHeader
|
|
61
|
+
props:
|
|
62
|
+
sectionNo: "01"
|
|
63
|
+
title: What stays on one surface
|
|
64
|
+
lead: Three jobs. One layout rhythm.
|
|
65
|
+
- type: FeatureGrid
|
|
66
|
+
props:
|
|
67
|
+
cols: "3"
|
|
68
|
+
items:
|
|
69
|
+
- { icon: zap, title: Keyboard triage, desc: Assign without a mouse. }
|
|
70
|
+
- { icon: layers, title: One canvas, desc: Issues stay on the roadmap. }
|
|
71
|
+
- { icon: shield, title: Honest empty, desc: Unknown counts stay n/a. }
|
|
72
|
+
- type: PricingTable
|
|
73
|
+
props:
|
|
74
|
+
billingNote: Published rates. Enterprise is a conversation.
|
|
75
|
+
plans:
|
|
76
|
+
- name: Starter
|
|
77
|
+
price: "$0"
|
|
78
|
+
period: "/mo"
|
|
79
|
+
features: ["3 projects", "Community support"]
|
|
80
|
+
cta: { label: Start free, href: /signup }
|
|
81
|
+
- name: Pro
|
|
82
|
+
price: "$24"
|
|
83
|
+
period: "/mo"
|
|
84
|
+
highlighted: true
|
|
85
|
+
features: ["Unlimited projects", "SSO-ready billing"]
|
|
86
|
+
cta: { label: Start trial, href: /signup }
|
|
87
|
+
- name: Enterprise
|
|
88
|
+
price: "Talk"
|
|
89
|
+
features: ["Security review"]
|
|
90
|
+
cta: { label: Contact, href: /contact }
|
|
91
|
+
- type: CtaBand
|
|
92
|
+
props:
|
|
93
|
+
title: Create a workspace
|
|
94
|
+
subtitle: Two minutes to first issue. No credit card.
|
|
95
|
+
cta: { label: Get started free, href: /signup }
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Brand-restraint alternative (vercel / stripe selected): keep the **same
|
|
99
|
+
blocks**. Do not swap `Hero` for a centered `Box` headline, and do not
|
|
100
|
+
rebuild pricing from `Card`+`Stat`. The brand guide only retints tokens
|
|
101
|
+
and type; `Hero` may lock to marketing CSS vars (`--marketing-accent`,
|
|
102
|
+
`--font-display`) — that is expected.
|
|
103
|
+
|
|
104
|
+
## Hard rules
|
|
105
|
+
|
|
106
|
+
- Never hand-roll a 3-tier pricing grid from `Card`+`Stat` when `PricingTable`
|
|
107
|
+
is in the catalog.
|
|
108
|
+
- No `bg-gradient-to-r from-indigo-500 to-violet-500` headlines.
|
|
109
|
+
- No Inter / Roboto / Arial as the default marketing face.
|
|
110
|
+
- No fake metrics or invented logos. Use `n/a` or qualitative proof.
|
|
111
|
+
- `Button.variant` valid values: `default | outline | secondary | ghost | destructive | link` (never `primary`).
|
|
112
|
+
- No nested buttons. No unscoped `html, body, *` CSS. No `_js`.
|
|
113
|
+
- Empty / loading / error must differ. Check 375 / 768 / 1440.
|
|
114
|
+
- Hero headline ≤ 8–12 words; one CTA hierarchy per region.
|