@cyber-dash-tech/revela 0.3.1 → 0.4.1

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/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  **English** | [中文](README.zh-CN.md)
4
4
 
5
- [![npm version](https://img.shields.io/npm/v/@cyber-dash-tech/revela)](https://www.npmjs.com/package/@cyber-dash-tech/revela) [![license](https://img.shields.io/npm/l/@cyber-dash-tech/revela)](LICENSE) [![tests](https://img.shields.io/badge/tests-125%20passing-brightgreen)](tests/) [![OpenCode plugin](https://img.shields.io/badge/OpenCode-plugin-blue)](https://opencode.ai) [![Bun](https://img.shields.io/badge/Bun-%E2%89%A51.0-orange)](https://bun.sh)
5
+ [![npm version](https://img.shields.io/npm/v/@cyber-dash-tech/revela)](https://www.npmjs.com/package/@cyber-dash-tech/revela) [![license](https://img.shields.io/npm/l/@cyber-dash-tech/revela)](LICENSE) [![tests](https://img.shields.io/badge/tests-138%20passing-brightgreen)](tests/) [![OpenCode plugin](https://img.shields.io/badge/OpenCode-plugin-blue)](https://opencode.ai) [![Bun](https://img.shields.io/badge/Bun-%E2%89%A51.0-orange)](https://bun.sh)
6
6
 
7
7
  <p align="center">
8
8
  <img src="assets/img/logo.png" alt="Revela" width="800" />
@@ -54,9 +54,13 @@ Restart OpenCode.
54
54
 
55
55
  To install globally, add the same entry to `~/.config/opencode/opencode.json`.
56
56
 
57
+ OpenCode `v1.14.22+` respects `.npmrc` settings during plugin installs, so direct installation through
58
+ the `plugin` field should be the default path.
59
+
57
60
  ### Local wrapper install
58
61
 
59
- Use this when Bun-based plugin install is blocked, unreliable, or you want to run from a local checkout.
62
+ Use this when direct plugin install is blocked in your environment, or when you want to run from a
63
+ local checkout during development.
60
64
 
61
65
  ```bash
62
66
  git clone https://github.com/cyber-dash-tech/revela
@@ -72,10 +76,6 @@ export { default } from "/absolute/path/to/revela/index.ts";
72
76
 
73
77
  If you use the local wrapper route, remove any `@cyber-dash-tech/revela` entry from `opencode.json`, otherwise OpenCode may still try Bun installation.
74
78
 
75
- ### China mainland note
76
-
77
- OpenCode's npm plugin installer uses Bun and may ignore npm mirror settings. If direct installation fails, prefer the local wrapper method.
78
-
79
79
  ---
80
80
 
81
81
  ## Quick Start
@@ -124,6 +124,9 @@ Disable presentation mode when done:
124
124
 
125
125
  /revela designs list installed designs
126
126
  /revela designs <name> activate a design
127
+ /revela designs-new <name> create a custom design with AI
128
+ /revela designs-edit <name> refine an existing custom design with AI
129
+ /revela designs-preview [name] open a design preview in the browser
127
130
  /revela designs-add <source> install a design from URL, local path, or github:user/repo
128
131
  /revela designs-rm <name> remove an installed design
129
132
 
@@ -136,7 +139,7 @@ Disable presentation mode when done:
136
139
  /revela pptx <file> export an HTML deck to editable PPTX in the same directory
137
140
  ```
138
141
 
139
- All `/revela` commands run locally with zero LLM cost.
142
+ Most `/revela` commands run locally with zero LLM cost. `/revela designs-new` and `/revela designs-edit` start AI-assisted design authoring workflows.
140
143
 
141
144
  ---
142
145
 
@@ -162,6 +165,9 @@ When Revela is enabled, the agent can use:
162
165
  - `revela-workspace-scan` to discover PDFs, Office files, CSVs, Markdown, and text files in the workspace
163
166
  - the `revela-research` subagent for targeted web research
164
167
  - `revela-research-save` to write structured findings into `researches/<topic>/`
168
+ - `revela-research-images-list` to extract structured image candidates from `researches/<topic>/*.md`
169
+ - `revela-media-batch-save` to batch-save selected research image leads into workspace assets
170
+ - `revela-media-save` to turn chosen local or remote images into reusable workspace assets under `assets/<topic>/media/`
165
171
 
166
172
  Supported document extraction paths:
167
173
 
@@ -179,6 +185,39 @@ This extraction is transparent to the main agent.
179
185
 
180
186
  ---
181
187
 
188
+ ## Media Assets
189
+
190
+ Research findings can record image leads in `## Images`, but those URLs are still just leads.
191
+ Final slides should reference local workspace assets instead of remote image URLs.
192
+
193
+ Use `revela-media-save` when the agent wants to promote one chosen image into a formal project asset.
194
+
195
+ Current Stage 2 additions:
196
+
197
+ - `revela-research-images-list` parses `## Images` sections into structured candidates
198
+ - the primary agent can review those candidates and select a subset to use
199
+ - `revela-media-batch-save` batch-saves the selected subset into `assets/<topic>/media/`
200
+ - this stage is still text-driven; it does not inspect image pixels or do visual recognition
201
+
202
+ Current Stage 1 behavior:
203
+
204
+ - accepts either `sourcePath` for a workspace-local image or `sourceUrl` for a remote image
205
+ - saves successful results into `assets/<topic>/media/`
206
+ - updates `assets/<topic>/media-manifest.json`
207
+ - records failed attempts with explicit statuses such as `invalid-url` and `cannot-download`
208
+ - lets the agent reference the returned local path directly in final HTML
209
+
210
+ Typical flow:
211
+
212
+ 1. `revela-research` writes image leads into `researches/<topic>/*.md`
213
+ 2. the primary agent calls `revela-research-images-list` and selects the images worth using
214
+ 3. `revela-media-batch-save` or `revela-media-save` downloads or copies them into `assets/<topic>/media/`
215
+ 4. the deck uses the returned local paths in `<img src="...">`
216
+
217
+ This keeps final decks stable, offline-friendly, and independent from expiring remote URLs.
218
+
219
+ ---
220
+
182
221
  ## Layout QA And Compliance
183
222
 
184
223
  Every time the agent writes `decks/*.html`, Revela runs an automatic Puppeteer-based QA pass at `1920x1080`.
@@ -226,7 +265,42 @@ Repository design examples:
226
265
 
227
266
  ## Custom Designs
228
267
 
229
- A custom design is a folder containing `DESIGN.md` with frontmatter metadata:
268
+ A custom design is a folder containing `DESIGN.md`. The folder name becomes the install target name
269
+ unless the installer infers another name from the source.
270
+
271
+ You can ask Revela to create a new local design interactively:
272
+
273
+ ```text
274
+ /revela designs-new my-design
275
+ ```
276
+
277
+ The agent will interview you for visual references, summarize a design brief for confirmation, then save `DESIGN.md` and `preview.html` into your local Revela designs directory. The default structural base is an internal neutral `starter` design, which is hidden from the normal design list. Use `--base summit` or `--base monet` only when you want to derive from those specific styles.
278
+
279
+ Refine an existing local design:
280
+
281
+ ```text
282
+ /revela designs-edit my-design
283
+ ```
284
+
285
+ The agent will ask what to change, inspect the current design, confirm an edit brief, then overwrite the local design package through the controlled authoring tool.
286
+
287
+ Open a design preview in your browser:
288
+
289
+ ```text
290
+ /revela designs-preview my-design
291
+ ```
292
+
293
+ Omit the name to preview the active design. If a design has no `preview.html`, Revela will report that no preview is available.
294
+
295
+ Recommended structure:
296
+
297
+ ```text
298
+ my-design/
299
+ ├── DESIGN.md
300
+ └── preview.html optional, but recommended for humans
301
+ ```
302
+
303
+ `DESIGN.md` starts with frontmatter metadata:
230
304
 
231
305
  ```yaml
232
306
  ---
@@ -237,7 +311,124 @@ version: 1.0.0
237
311
  ---
238
312
  ```
239
313
 
240
- For larger designs, use the marker system:
314
+ ### Minimal working example
315
+
316
+ This is the smallest useful `DESIGN.md` shape. It gives the model a clear visual system, one layout,
317
+ and one reusable component.
318
+
319
+ ```md
320
+ ---
321
+ name: alpine-brief
322
+ description: Minimal editorial design for strategy decks
323
+ author: you
324
+ version: 1.0.0
325
+ ---
326
+
327
+ ## Visual Style
328
+
329
+ Apply this visual style to every slide in the deck.
330
+
331
+ <!-- @design:foundation:start -->
332
+ ### Color Palette
333
+
334
+ ```css
335
+ :root {
336
+ --bg: #f6f2ea;
337
+ --surface: #fffdf8;
338
+ --text-primary: #1c1a17;
339
+ --text-secondary: #625b52;
340
+ --accent: #8a6a45;
341
+ --line: rgba(28, 26, 23, 0.14);
342
+ --font-display: 'IBM Plex Sans Condensed', 'Inter', sans-serif;
343
+ --font-body: 'Inter', sans-serif;
344
+ }
345
+ ```
346
+
347
+ ### Typography
348
+
349
+ - Headings use `--font-display`
350
+ - Body copy uses `--font-body`
351
+ - Keep all sizing in fixed `px` for a `1920x1080` canvas
352
+
353
+ ### HTML Structure
354
+
355
+ - Every slide must use `<section class="slide" slide-qa="true|false">`
356
+ - Every slide must contain one `.slide-canvas`
357
+ - Keep all CSS in one `<style>` block and all JS in one `<script>` block
358
+ <!-- @design:foundation:end -->
359
+
360
+ <!-- @design:rules:start -->
361
+ ### Composition Rules
362
+
363
+ - Use warm off-white backgrounds and restrained brown accents
364
+ - Prefer narrow text columns and generous whitespace
365
+ - Avoid glow, glassmorphism, neon gradients, and dashboard styling
366
+ <!-- @design:rules:end -->
367
+
368
+ <!-- @design:layouts:start -->
369
+ <!-- @layout:cover:start qa=false -->
370
+ ### Cover layout
371
+
372
+ - Centered title stack
373
+ - Small eyebrow at top
374
+ - One thin accent divider under the title
375
+ <!-- @layout:cover:end -->
376
+
377
+ <!-- @layout:two-col:start qa=true -->
378
+ ### Two-column layout
379
+
380
+ - Left column for argument, right column for evidence
381
+ - Recommended split: `5 / 7`
382
+ - Keep the left column under `520px` for readable paragraphs
383
+ <!-- @layout:two-col:end -->
384
+ <!-- @design:layouts:end -->
385
+
386
+ <!-- @design:components:start -->
387
+ <!-- @component:stat-card:start -->
388
+ ### Stat card (`.stat-card`)
389
+
390
+ ```html
391
+ <div class="stat-card">
392
+ <div class="stat-label">Revenue CAGR</div>
393
+ <div class="stat-value">27%</div>
394
+ <div class="stat-note">2024-2028E</div>
395
+ </div>
396
+ ```
397
+
398
+ ```css
399
+ .stat-card {
400
+ border-top: 1px solid var(--line);
401
+ padding-top: 18px;
402
+ }
403
+
404
+ .stat-label {
405
+ font-size: 12px;
406
+ letter-spacing: 0.12em;
407
+ text-transform: uppercase;
408
+ color: var(--text-secondary);
409
+ }
410
+
411
+ .stat-value {
412
+ margin-top: 10px;
413
+ font-family: var(--font-display);
414
+ font-size: 72px;
415
+ line-height: 0.95;
416
+ }
417
+
418
+ .stat-note {
419
+ margin-top: 8px;
420
+ font-size: 16px;
421
+ color: var(--text-secondary);
422
+ }
423
+ ```
424
+ <!-- @component:stat-card:end -->
425
+ <!-- @design:components:end -->
426
+ ```
427
+
428
+ ### Marker system
429
+
430
+ For larger designs, use the marker system so Revela can keep the always-on prompt compact and fetch
431
+ details only when needed:
241
432
 
242
433
  ```html
243
434
  <!-- @design:foundation:start -->
@@ -265,6 +456,26 @@ Chart rules
265
456
  <!-- @design:chart-rules:end -->
266
457
  ```
267
458
 
459
+ Marker roles:
460
+
461
+ - `@design:foundation`: core tokens, HTML skeleton, CSS foundations, typography, spacing, page framing
462
+ - `@design:rules`: composition rules, dos and don'ts, art direction constraints, interaction rules
463
+ - `@design:layouts`: named layout recipes such as `cover`, `toc`, `two-col`, `data-vis`
464
+ - `@design:components`: reusable building blocks such as `card`, `stat-card`, `quote-block`
465
+ - `@design:chart-rules`: chart-specific rules that are only needed when a slide actually uses charts
466
+
467
+ Layout marker rules:
468
+
469
+ - Use stable, simple names such as `cover`, `two-col`, `stats`, `timeline`
470
+ - Add `qa=true` for dense content layouts and `qa=false` for intentionally sparse structural layouts
471
+ - Write each layout section as a recipe: purpose, recommended structure, preferred ratios, and known constraints
472
+
473
+ Component marker rules:
474
+
475
+ - Include at least one concrete HTML example
476
+ - Include the CSS class names the component depends on
477
+ - Prefer a small vocabulary of reusable class names over many one-off classes
478
+
268
479
  Prompt injection behavior:
269
480
 
270
481
  - always injected: `@design:foundation`, `@design:rules`, layout index, component index
@@ -272,6 +483,13 @@ Prompt injection behavior:
272
483
 
273
484
  If a design has no markers, Revela falls back to injecting the full `DESIGN.md` body.
274
485
 
486
+ ### Practical guidance
487
+
488
+ - Put the non-negotiable rules in `foundation` and `rules`; do not hide essential constraints only inside one layout
489
+ - Keep layout names semantically meaningful; they become the vocabulary the model sees in the layout index
490
+ - If your design defines a custom CSS class, document that class inside `DESIGN.md`; QA checks can flag classes not present in the design vocabulary
491
+ - Add `preview.html` when possible so humans can inspect the design before activating it
492
+
275
493
  Install a custom design:
276
494
 
277
495
  ```text
package/README.zh-CN.md CHANGED
@@ -54,9 +54,12 @@ Revela 是一种工作模式,不是独立 agent。
54
54
 
55
55
  如果想全局安装,可以把同样配置写到 `~/.config/opencode/opencode.json`。
56
56
 
57
+ OpenCode `v1.14.22+` 在插件安装时已经会遵循 `.npmrc` 设置,因此默认应优先使用
58
+ `plugin` 字段直接安装。
59
+
57
60
  ### 本地 wrapper 安装
58
61
 
59
- 如果 Bun 安装被网络阻塞、不稳定,或者你想直接运行本地源码仓库,建议使用本地 wrapper。
62
+ 如果你的环境里直接安装仍然受阻,或者你想在开发时直接运行本地源码仓库,可以使用本地 wrapper。
60
63
 
61
64
  ```bash
62
65
  git clone https://github.com/cyber-dash-tech/revela
@@ -72,10 +75,6 @@ export { default } from "/absolute/path/to/revela/index.ts";
72
75
 
73
76
  如果使用本地 wrapper,记得把 `opencode.json` 里的 `@cyber-dash-tech/revela` `plugin` 配置删掉,否则 OpenCode 仍可能尝试用 Bun 安装。
74
77
 
75
- ### 中国大陆网络说明
76
-
77
- OpenCode 的 npm 插件安装依赖 Bun,而 Bun 可能不会遵循 npm mirror 设置。如果直接安装失败,优先使用上面的本地 wrapper 方案。
78
-
79
78
  ---
80
79
 
81
80
  ## 快速开始
@@ -124,6 +123,9 @@ Create a 6-slide HTML deck on humanoid robotics supply chains. Cite the main mar
124
123
 
125
124
  /revela designs 列出已安装 design
126
125
  /revela designs <name> 激活某个 design
126
+ /revela designs-new <name> 通过 AI 创建一个自定义 design
127
+ /revela designs-edit <name> 通过 AI 调整已有自定义 design
128
+ /revela designs-preview [name] 在浏览器中打开 design preview
127
129
  /revela designs-add <source> 从 URL、本地路径或 github:user/repo 安装 design
128
130
  /revela designs-rm <name> 删除已安装 design
129
131
 
@@ -136,7 +138,7 @@ Create a 6-slide HTML deck on humanoid robotics supply chains. Cite the main mar
136
138
  /revela pptx <file> 将 HTML deck 导出为同目录可编辑 PPTX
137
139
  ```
138
140
 
139
- 所有 `/revela` 命令都在本地执行,不消耗 LLM token
141
+ 大多数 `/revela` 命令都在本地执行,不消耗 LLM token。`/revela designs-new` 和 `/revela designs-edit` 会启动 AI 辅助的 design 创建/编辑流程。
140
142
 
141
143
  ---
142
144
 
@@ -226,7 +228,42 @@ Create a 6-slide HTML deck on humanoid robotics supply chains. Cite the main mar
226
228
 
227
229
  ## 自定义 Designs
228
230
 
229
- 自定义 design 是一个包含 `DESIGN.md` 的文件夹,并带有 frontmatter:
231
+ 自定义 design 本质上是一个包含 `DESIGN.md` 的文件夹。目录名通常会成为安装后的 design 名称,
232
+ 除非安装器从来源中推断出其他名称。
233
+
234
+ 你也可以让 Revela 交互式创建一个新的本地 design:
235
+
236
+ ```text
237
+ /revela designs-new my-design
238
+ ```
239
+
240
+ Agent 会先询问你的审美参考,整理设计 brief 并等待确认,然后把 `DESIGN.md` 和 `preview.html` 保存到本地 Revela designs 目录。默认结构底座是内部中性 `starter` design,它不会出现在普通 design 列表中。只有当你明确想从 `summit` 或 `monet` 的具体风格派生时,才建议使用 `--base summit` 或 `--base monet`。
241
+
242
+ 调整已有本地 design:
243
+
244
+ ```text
245
+ /revela designs-edit my-design
246
+ ```
247
+
248
+ Agent 会询问你想修改什么,读取当前 design,整理 edit brief 并等待确认,然后通过受控 authoring tool 覆盖保存本地 design 包。
249
+
250
+ 在浏览器中打开某个 design 的 preview:
251
+
252
+ ```text
253
+ /revela designs-preview my-design
254
+ ```
255
+
256
+ 省略 name 时会打开当前 active design 的 preview。如果该 design 没有 `preview.html`,Revela 会提示没有可用 preview。
257
+
258
+ 推荐目录结构:
259
+
260
+ ```text
261
+ my-design/
262
+ ├── DESIGN.md
263
+ └── preview.html 可选,但推荐,方便人工预览
264
+ ```
265
+
266
+ `DESIGN.md` 顶部使用 frontmatter:
230
267
 
231
268
  ```yaml
232
269
  ---
@@ -237,7 +274,123 @@ version: 1.0.0
237
274
  ---
238
275
  ```
239
276
 
240
- 对于较大的 design,建议使用 marker 体系:
277
+ ### 最小可用示例
278
+
279
+ 下面是一个最小但可工作的 `DESIGN.md` 结构。它至少给模型提供了明确的视觉系统、一个 layout 和一个可复用 component。
280
+
281
+ ```md
282
+ ---
283
+ name: alpine-brief
284
+ description: Minimal editorial design for strategy decks
285
+ author: you
286
+ version: 1.0.0
287
+ ---
288
+
289
+ ## Visual Style
290
+
291
+ Apply this visual style to every slide in the deck.
292
+
293
+ <!-- @design:foundation:start -->
294
+ ### Color Palette
295
+
296
+ ```css
297
+ :root {
298
+ --bg: #f6f2ea;
299
+ --surface: #fffdf8;
300
+ --text-primary: #1c1a17;
301
+ --text-secondary: #625b52;
302
+ --accent: #8a6a45;
303
+ --line: rgba(28, 26, 23, 0.14);
304
+ --font-display: 'IBM Plex Sans Condensed', 'Inter', sans-serif;
305
+ --font-body: 'Inter', sans-serif;
306
+ }
307
+ ```
308
+
309
+ ### Typography
310
+
311
+ - 标题使用 `--font-display`
312
+ - 正文使用 `--font-body`
313
+ - 所有尺寸都固定为 `px`,基于 `1920x1080` 画布设计
314
+
315
+ ### HTML Structure
316
+
317
+ - 每张 slide 都必须使用 `<section class="slide" slide-qa="true|false">`
318
+ - 每张 slide 内都必须有一个 `.slide-canvas`
319
+ - 所有 CSS 放在一个 `<style>` 块里,所有 JS 放在一个 `<script>` 块里
320
+ <!-- @design:foundation:end -->
321
+
322
+ <!-- @design:rules:start -->
323
+ ### Composition Rules
324
+
325
+ - 使用偏暖的浅色背景和克制的棕色强调色
326
+ - 文字列保持偏窄,给足留白
327
+ - 避免 glow、glassmorphism、neon gradient 和 dashboard 风格
328
+ <!-- @design:rules:end -->
329
+
330
+ <!-- @design:layouts:start -->
331
+ <!-- @layout:cover:start qa=false -->
332
+ ### Cover layout
333
+
334
+ - 居中的标题堆叠
335
+ - 顶部有小号 eyebrow
336
+ - 标题下方有一条细的强调色分隔线
337
+ <!-- @layout:cover:end -->
338
+
339
+ <!-- @layout:two-col:start qa=true -->
340
+ ### Two-column layout
341
+
342
+ - 左列负责论点,右列负责证据
343
+ - 推荐比例:`5 / 7`
344
+ - 左列宽度尽量控制在 `520px` 以内,保证段落可读性
345
+ <!-- @layout:two-col:end -->
346
+ <!-- @design:layouts:end -->
347
+
348
+ <!-- @design:components:start -->
349
+ <!-- @component:stat-card:start -->
350
+ ### Stat card (`.stat-card`)
351
+
352
+ ```html
353
+ <div class="stat-card">
354
+ <div class="stat-label">Revenue CAGR</div>
355
+ <div class="stat-value">27%</div>
356
+ <div class="stat-note">2024-2028E</div>
357
+ </div>
358
+ ```
359
+
360
+ ```css
361
+ .stat-card {
362
+ border-top: 1px solid var(--line);
363
+ padding-top: 18px;
364
+ }
365
+
366
+ .stat-label {
367
+ font-size: 12px;
368
+ letter-spacing: 0.12em;
369
+ text-transform: uppercase;
370
+ color: var(--text-secondary);
371
+ }
372
+
373
+ .stat-value {
374
+ margin-top: 10px;
375
+ font-family: var(--font-display);
376
+ font-size: 72px;
377
+ line-height: 0.95;
378
+ }
379
+
380
+ .stat-note {
381
+ margin-top: 8px;
382
+ font-size: 16px;
383
+ color: var(--text-secondary);
384
+ }
385
+ ```
386
+ <!-- @component:stat-card:end -->
387
+ <!-- @design:components:end -->
388
+ ```
389
+
390
+ ### Marker 体系
391
+
392
+ 对于较大的 design,建议使用 marker 体系,这样 Revela 可以把常驻 prompt 控制在较小体积,
393
+ 只在需要时按需读取 layout / component 细节:
241
394
 
242
395
  ```html
243
396
  <!-- @design:foundation:start -->
@@ -265,6 +418,26 @@ Chart rules
265
418
  <!-- @design:chart-rules:end -->
266
419
  ```
267
420
 
421
+ 各类 marker 的职责:
422
+
423
+ - `@design:foundation`:设计 token、HTML 骨架、CSS 基础、字体、间距、页面 framing
424
+ - `@design:rules`:构图原则、do / don't、art direction 限制、交互规则
425
+ - `@design:layouts`:具名 layout 配方,例如 `cover`、`toc`、`two-col`、`data-vis`
426
+ - `@design:components`:可复用组件,例如 `card`、`stat-card`、`quote-block`
427
+ - `@design:chart-rules`:只有图表页才需要的图表规范
428
+
429
+ Layout marker 编写建议:
430
+
431
+ - 名称保持稳定、简单,例如 `cover`、`two-col`、`stats`、`timeline`
432
+ - 内容密集型 layout 用 `qa=true`,结构型或刻意稀疏的 layout 用 `qa=false`
433
+ - 每个 layout 都写成配方:用途、推荐结构、推荐比例、已知约束
434
+
435
+ Component marker 编写建议:
436
+
437
+ - 至少提供一个具体 HTML 示例
438
+ - 明确列出组件依赖的 CSS class 名
439
+ - 尽量复用少量稳定 class,不要堆太多一次性 class
440
+
268
441
  Prompt 注入规则:
269
442
 
270
443
  - 常驻注入:`@design:foundation`、`@design:rules`、layout index、component index
@@ -272,6 +445,13 @@ Prompt 注入规则:
272
445
 
273
446
  如果 design 没有 marker,Revela 会退回到整份 `DESIGN.md` 全量注入。
274
447
 
448
+ ### 实际编写建议
449
+
450
+ - 把不可妥协的规则放进 `foundation` 和 `rules`,不要只藏在某个 layout 里
451
+ - layout 名称尽量语义化,因为模型在 layout index 里首先看到的就是这些名字
452
+ - 如果定义了自定义 CSS class,记得在 `DESIGN.md` 里写出来;QA 会检查 design 词汇表之外的新 class
453
+ - 如果条件允许,最好同时提供 `preview.html`,方便人工预览和验收
454
+
275
455
  安装自定义 design:
276
456
 
277
457
  ```text