@cyber-dash-tech/revela 0.17.3 → 0.17.5
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/designs/monet/DESIGN.md +116 -16
- package/designs/starter/DESIGN.md +10 -4
- package/designs/summit/DESIGN.md +30 -0
- package/lib/edit/prompt.ts +3 -0
- package/lib/edit/server.ts +5 -0
- package/lib/prompt-builder.ts +1 -0
- package/lib/refine/server.ts +5 -0
- package/package.json +1 -1
- package/skill/SKILL.md +11 -8
- package/tools/designs.ts +1 -1
package/designs/monet/DESIGN.md
CHANGED
|
@@ -480,6 +480,9 @@ These rules are mandatory for Monet.
|
|
|
480
480
|
- **Sparse slides depend on image weight.** If content is light, the photo or page framing must hold the composition.
|
|
481
481
|
- **No glass cards, neon KPI styling, or startup-product chrome.** Monet is editorial and print-adjacent.
|
|
482
482
|
- **Visual hierarchy is strict:** eyebrow -> heading -> body -> caption.
|
|
483
|
+
- **Icon system is Lucide.** For ordinary UI, semantic, status, category, process, and navigation icons, use Lucide (`data-lucide`). Do not hand-write inline SVG for icons. SVG is allowed only for intentional decorative motifs, illustrations, or design-specific artwork. If any `data-lucide` icon is present, load Lucide via CDN and call `lucide.createIcons()` after `SlidePresentation`.
|
|
484
|
+
- **Chart system is ECharts.** Data charts default to ECharts inside `echart-panel`. Do not use hand-written SVG, div/CSS shapes, canvas mocks, or static faux charts as data-chart substitutes. SVG remains acceptable for decorative motifs, diagrams, or illustrations, not data charts. Before creating or changing a chart, fetch the `echart-panel` component and `section: "chart-rules"`; if chart rules or runtime are unavailable, report the gap instead of inventing a fake chart fallback.
|
|
485
|
+
- **Start from foundation.** New deck HTML starts from `@design:foundation`. Do not recreate foundation CSS, JavaScript, or the HTML skeleton from memory. Prefer a foundation helper when available; otherwise fetch `section: "foundation"` before writing a new deck shell. Existing deck edits preserve the current foundation unless the user asks for foundation repair or QA reports a foundation contract problem.
|
|
483
486
|
|
|
484
487
|
### Common Mistakes
|
|
485
488
|
|
|
@@ -823,6 +826,31 @@ Every slot accepts 1 or more components. The LLM decides what each slot contains
|
|
|
823
826
|
|
|
824
827
|
Use these components when a page needs repeatable editorial modules inside a larger layout. Components define the block itself, not the page grid around it.
|
|
825
828
|
|
|
829
|
+
<!-- @component:box:start -->
|
|
830
|
+
#### Box
|
|
831
|
+
|
|
832
|
+
Card/group primitive for one idea, case, evidence item, metric, objection, risk, or action. Put `text-panel`, `media`, `echart-panel`, `data-table`, `stat-card`, or `quote` inside a box when they support the same idea.
|
|
833
|
+
|
|
834
|
+
```html
|
|
835
|
+
<div class="box">
|
|
836
|
+
<div class="text-panel text-panel--plain">
|
|
837
|
+
<div class="text-panel-body">
|
|
838
|
+
<p class="eyebrow">Evidence</p>
|
|
839
|
+
<h3>One clear idea</h3>
|
|
840
|
+
<p>Short supporting copy or source-bound explanation.</p>
|
|
841
|
+
</div>
|
|
842
|
+
</div>
|
|
843
|
+
</div>
|
|
844
|
+
```
|
|
845
|
+
|
|
846
|
+
```css
|
|
847
|
+
.box { height: 100%; min-height: 0; padding: 28px; border: 1px solid var(--line); background: rgba(255,255,255,0.46); display: flex; flex-direction: column; gap: 18px; overflow: hidden; }
|
|
848
|
+
.box--quiet { background: transparent; }
|
|
849
|
+
.box--mist { background: rgba(240,244,247,0.72); }
|
|
850
|
+
.box--dark { background: #0d1a24; --text-primary:#f0f4f7; --text-secondary:rgba(240,244,247,0.72); --text-muted:rgba(240,244,247,0.55); --line:rgba(240,244,247,0.16); }
|
|
851
|
+
```
|
|
852
|
+
<!-- @component:box:end -->
|
|
853
|
+
|
|
826
854
|
|
|
827
855
|
|
|
828
856
|
<!-- @component:text-panel:start -->
|
|
@@ -937,6 +965,35 @@ Rules:
|
|
|
937
965
|
- **`editorial-list` inside `--dark`.** Add `style="--accent-earth:rgba(240,244,247,0.72)"` on the `<ul>` wrapper so the bullet squares read against the dark background.
|
|
938
966
|
<!-- @component:text-panel:end -->
|
|
939
967
|
|
|
968
|
+
<!-- @component:media:start -->
|
|
969
|
+
#### Media
|
|
970
|
+
|
|
971
|
+
Normal image, screenshot, diagram, logo, or portrait component. Keep important visual information understandable. Do not use `media` for full-bleed covers/dividers/closings; use `hero` for those.
|
|
972
|
+
|
|
973
|
+
```html
|
|
974
|
+
<figure class="media">
|
|
975
|
+
<div class="media-frame">
|
|
976
|
+
<img src="https://images.unsplash.com/photo-1464822759023-fed622ff2c3b?q=80&w=1200&auto=format&fit=crop" alt="Atmospheric water garden detail">
|
|
977
|
+
</div>
|
|
978
|
+
<figcaption class="media-caption source-note">Optional source or field note</figcaption>
|
|
979
|
+
</figure>
|
|
980
|
+
```
|
|
981
|
+
|
|
982
|
+
```css
|
|
983
|
+
.media { height: 100%; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
|
|
984
|
+
.media-frame { position: relative; overflow: hidden; background: transparent; width: 100%; flex: 1; min-height: 0; }
|
|
985
|
+
.media-frame img { width: 100%; height: 100%; display: block; object-fit: cover; }
|
|
986
|
+
.media--contain .media-frame img { object-fit: contain; }
|
|
987
|
+
.media-caption { margin-top: 0; font-size: 11px; line-height: 1.45; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); }
|
|
988
|
+
.media-caption.source, .media-caption.source-note { font-family: "Times New Roman", Times, serif; font-size: 11px; line-height: 1.35; letter-spacing: 0; text-transform: none; }
|
|
989
|
+
```
|
|
990
|
+
|
|
991
|
+
Rules:
|
|
992
|
+
- Use `media` for screenshots, charts exported as images, diagrams, logos, portraits, and evidence visuals that must stay readable.
|
|
993
|
+
- Use `object-fit: contain` through `media--contain` for screenshots, diagrams, and logos when cropping would remove information.
|
|
994
|
+
- Put `media` inside a `box` when the visual and text support one semantic idea.
|
|
995
|
+
<!-- @component:media:end -->
|
|
996
|
+
|
|
940
997
|
<!-- @component:stat-card:start -->
|
|
941
998
|
#### Stat Card
|
|
942
999
|
|
|
@@ -1010,7 +1067,7 @@ Rules:
|
|
|
1010
1067
|
- **Do not over-explain.** If the description starts to become paragraph-length, switch to `text-panel` or pair the stat card with a narrative component in the neighboring slot.
|
|
1011
1068
|
<!-- @component:stat-card:end -->
|
|
1012
1069
|
|
|
1013
|
-
<!-- @
|
|
1070
|
+
<!-- @compat:editorial-image-top:start -->
|
|
1014
1071
|
#### Editorial Image Top
|
|
1015
1072
|
|
|
1016
1073
|
Image-first editorial module: image on top, text below. Best for highlight grids, product/material stories, and any module where the picture should lead before the reader enters the copy.
|
|
@@ -1094,9 +1151,9 @@ Rules:
|
|
|
1094
1151
|
- **Image aspect ratio.** Aim for 16:9 or 3:2 crops for the image block. Portrait crops create tall image zones that push text down and unbalance the composition.
|
|
1095
1152
|
- **Kicker icon size.** Keep Lucide SVG icons at 16–20px. Larger icons shift visual weight from the image to the label zone.
|
|
1096
1153
|
- **`editorial-list` font-size.** Override to `font-size:13px;gap:10px` inline when used inside a very narrow copy zone — the base `editorial-list` is `17px/gap:14px`, which may be too large for tight columns.
|
|
1097
|
-
<!-- @
|
|
1154
|
+
<!-- @compat:editorial-image-top:end -->
|
|
1098
1155
|
|
|
1099
|
-
<!-- @
|
|
1156
|
+
<!-- @compat:editorial-text-top:start -->
|
|
1100
1157
|
#### Editorial Text Top
|
|
1101
1158
|
|
|
1102
1159
|
Text-first editorial module: text on top, image below. Best for narrative snippets, report-style explanations, or blocks where the image serves as evidence rather than the primary hook.
|
|
@@ -1160,9 +1217,9 @@ Rules:
|
|
|
1160
1217
|
- **Same height/stretch rule as `editorial-image-top`.** Do not set fixed heights; let parent grid stretch control the column.
|
|
1161
1218
|
- **When used as a center spine in `highlight-cols`,** this is the one component that may legitimately be taller than its neighbors. That density imbalance is intentional — do not try to equalize it with padding or extra content in the outer columns.
|
|
1162
1219
|
- **`editorial-list` font-size.** Override to `font-size:13px;gap:10px` inline when used inside a very narrow copy zone — the base `editorial-list` is `17px/gap:14px`, which may be too large for tight columns.
|
|
1163
|
-
<!-- @
|
|
1220
|
+
<!-- @compat:editorial-text-top:end -->
|
|
1164
1221
|
|
|
1165
|
-
<!-- @
|
|
1222
|
+
<!-- @compat:editorial-text-left:start -->
|
|
1166
1223
|
#### Editorial Text Left
|
|
1167
1224
|
|
|
1168
1225
|
Horizontal editorial module: a full-width title band on top, with text on the left and a visual slot on the right below. Best for compact feature rows or any slot where a wide-but-short frame suits a side-by-side composition with a clear heading above.
|
|
@@ -1274,7 +1331,7 @@ Rules:
|
|
|
1274
1331
|
- **`echart-container` in visual slot.** Set `width:100%;height:100%` on the container and call `echarts.init()` after `SlidePresentation` is instantiated. The `position:relative;overflow:hidden` on `.editorial-text-left-visual` contains the canvas correctly.
|
|
1275
1332
|
- **`image-title` in visual slot.** The component is self-contained and fills `width:100%;height:100%` automatically. Use `image-title--right` modifier with a bottom-heavy overlay and right-biased blur mask for the most common editorial orientation.
|
|
1276
1333
|
- **Dark background.** Override CSS variables on `.editorial-text-left` to cascade into both the copy and visual zones: `--text-primary`, `--text-secondary`, `--text-muted`, `--line`, `--line-strong` — all set to white-family values.
|
|
1277
|
-
<!-- @
|
|
1334
|
+
<!-- @compat:editorial-text-left:end -->
|
|
1278
1335
|
|
|
1279
1336
|
<!-- @component:echart-panel:start -->
|
|
1280
1337
|
#### EChart Panel
|
|
@@ -1357,7 +1414,11 @@ Rules:
|
|
|
1357
1414
|
- **Chart sizing for `narrative-hero-left-dark`.** The left 7.8fr column is wide. A donut or candlestick chart works best centered with some breathing room. Add `padding: 24px 32px` to `.echart-container` to prevent the chart from touching the column edges.
|
|
1358
1415
|
<!-- @component:echart-panel:end -->
|
|
1359
1416
|
|
|
1360
|
-
<!-- @component:
|
|
1417
|
+
<!-- @component:steps:start -->
|
|
1418
|
+
#### Steps
|
|
1419
|
+
|
|
1420
|
+
Monet step and phase sequences use the flow-horizontal and flow-vertical implementations. Use `.flow-horizontal` for left-to-right process stages and `.flow-vertical` for top-to-bottom phases.
|
|
1421
|
+
|
|
1361
1422
|
#### Flow Horizontal
|
|
1362
1423
|
|
|
1363
1424
|
Horizontal step or phase sequence. Use for process stages, numbered definitions, or parallel concepts that should be read left to right. Suitable for 2–5 items.
|
|
@@ -1487,9 +1548,9 @@ Rules:
|
|
|
1487
1548
|
- **Step copy length directly affects column balance.** One step with a long paragraph will push its column taller than the others and break the horizontal rhythm. Trim all steps to roughly equal length (2–4 lines each).
|
|
1488
1549
|
- **Number card design.** Each `.flow-number` uses two overlapping squares: a white `::before` base square (with border) and a blue `::after` top square (`--accent-earth`) rotated by `--fn-rot`. Set `data-n="01"` on the element (the `::after` reads it via `content: attr(data-n)`). Vary `--fn-rot` per item (e.g. `-9deg`, `7deg`, `-6deg`, `10deg`) for a hand-placed impression.
|
|
1489
1550
|
- **Horizontal rule connector.** The `::before` pseudo-element on `.flow-horizontal` draws a full-width line at `top: 18px` (vertical centre of the 36px number box). `.flow-number` sits above it via `z-index: 1`; its `::before` background is set to `var(--bg-page)` to mask the line behind the white square. On dark backgrounds, override `.flow-horizontal .flow-number::before { background: <dark-bg-color>; }` and set `.flow-horizontal::before { background: rgba(240,244,247,0.15); }`.
|
|
1490
|
-
<!--
|
|
1551
|
+
<!-- flow-horizontal implementation ends -->
|
|
1491
1552
|
|
|
1492
|
-
<!--
|
|
1553
|
+
<!-- flow-vertical implementation starts -->
|
|
1493
1554
|
#### Flow Vertical
|
|
1494
1555
|
|
|
1495
1556
|
Vertical step or timeline sequence. Use for chronological phases, execution stages, or progress narratives that should be read top to bottom. Suitable for 2–6 items.
|
|
@@ -1587,7 +1648,7 @@ Rules:
|
|
|
1587
1648
|
- **Number card design (same as flow-horizontal).** Use `data-n="01"` and `style="--fn-rot:-8deg;"` on each `.flow-number`. Vary the rotation angle per item.
|
|
1588
1649
|
- **Dark text overrides.** Flow-number `::before` border: `rgba(240,244,247,0.3)`; `::after` background: a darker accent or `rgba(41,128,175,0.85)`. h4: `color:#f0f4f7`; p: `color:rgba(240,244,247,0.7)`. Also override the connecting line: `background:rgba(240,244,247,0.2)`.
|
|
1589
1650
|
- **Column height constraint.** `flow-vertical` expands naturally with content. In a two-column layout, ensure the opposing column (`text-panel` or `echart-panel`) has enough content to avoid a large height mismatch.
|
|
1590
|
-
<!-- @component:
|
|
1651
|
+
<!-- @component:steps:end -->
|
|
1591
1652
|
|
|
1592
1653
|
<!-- @component:data-table:start -->
|
|
1593
1654
|
#### Data Table
|
|
@@ -1781,7 +1842,11 @@ Rules:
|
|
|
1781
1842
|
|
|
1782
1843
|
|
|
1783
1844
|
|
|
1784
|
-
<!-- @component:
|
|
1845
|
+
<!-- @component:hero:start -->
|
|
1846
|
+
#### Hero
|
|
1847
|
+
|
|
1848
|
+
Monet hero slides use the image-title implementation for full-bleed cover, closing, atmospheric section divider, or strong visual statement slides.
|
|
1849
|
+
|
|
1785
1850
|
#### Image Title
|
|
1786
1851
|
|
|
1787
1852
|
Self-contained full-canvas component: a dominant photograph with a directional blur layer, a gradient overlay, and a foreground text stack — all composited inside one element. Use for cover slides, closing slides, atmospheric section dividers, or any full-bleed spread where a single image should dominate the entire canvas.
|
|
@@ -1945,7 +2010,7 @@ Rules:
|
|
|
1945
2010
|
- **`--right` closing variant.** Mirror the blur mask: use `mask-image:linear-gradient(to right, transparent 0%, transparent 20%, black 100%)`. The right side stays blurred (text zone); the left side of the image stays sharp.
|
|
1946
2011
|
- **`--center` variant.** Use a radial or symmetric overlay: `radial-gradient(ellipse at center, rgba(5,5,5,0.72) 0%, rgba(5,5,5,0.20) 100%)` or a flat `rgba(5,5,5,0.55)`. Center blur mask: `mask-image:radial-gradient(ellipse at center, black 0%, transparent 80%)`.
|
|
1947
2012
|
- **Subtitle width on `--right`.** `.image-title-subtitle` inherits `max-width:480px` which is set for left-aligned text. On `--right`, override to match the `.image-title-body` width: `style="max-width:520px;margin-left:auto;"`.
|
|
1948
|
-
<!-- @component:
|
|
2013
|
+
<!-- @component:hero:end -->
|
|
1949
2014
|
|
|
1950
2015
|
<!-- @component:toc:start -->
|
|
1951
2016
|
#### TOC Panel
|
|
@@ -2368,7 +2433,11 @@ Omit `--light` only on slides with a white/light background.
|
|
|
2368
2433
|
|
|
2369
2434
|
<!-- @component:page-number:end -->
|
|
2370
2435
|
|
|
2371
|
-
<!-- @component:
|
|
2436
|
+
<!-- @component:roadmap-horizontal:start -->
|
|
2437
|
+
#### Roadmap Horizontal
|
|
2438
|
+
|
|
2439
|
+
Monet horizontal roadmaps use the timeline-journey-horizontal implementation.
|
|
2440
|
+
|
|
2372
2441
|
#### Timeline Journey Horizontal
|
|
2373
2442
|
|
|
2374
2443
|
A horizontal milestone timeline with a central axis line. Nodes sit on the axis; a dashed vertical stem leads to a tip node, with date, title, and description text alongside. Alternate nodes above and below the axis for rhythm. Suitable for 4–8 milestones across a chronological arc, transformation story, or multi-year programme recap.
|
|
@@ -2534,9 +2603,13 @@ Rules:
|
|
|
2534
2603
|
- **Adjust stem length**: Change `--tjh-stem-h` to lengthen or shorten the dashed connector.
|
|
2535
2604
|
- **Dark background overrides**: Set `--line-strong: rgba(240,244,247,0.25)` on `.tjh`, override `.tjh-axis { background }`, set `.tjh-title { color: #f0f4f7 }`, `.tjh-text { color: rgba(240,244,247,0.7) }`. The `--tjh-item-color` accent colours work on dark backgrounds without change.
|
|
2536
2605
|
- **Fewer nodes**: For 4–5 nodes, widen `--tjh-col` by using a smaller denominator (e.g. `calc(100% / 5)`), and space `left` values accordingly.
|
|
2537
|
-
<!-- @component:
|
|
2606
|
+
<!-- @component:roadmap-horizontal:end -->
|
|
2607
|
+
|
|
2608
|
+
<!-- @component:roadmap-vertical:start -->
|
|
2609
|
+
#### Roadmap Vertical
|
|
2610
|
+
|
|
2611
|
+
Monet vertical roadmaps use the timeline-journey-vertical implementation.
|
|
2538
2612
|
|
|
2539
|
-
<!-- @component:timeline-journey-vertical:start -->
|
|
2540
2613
|
#### Timeline Journey Vertical
|
|
2541
2614
|
|
|
2542
2615
|
A vertical milestone timeline with a central axis line. Nodes sit on the axis; a horizontal dashed stem leads to a tip dot, with date, title, and description text alongside. Alternate nodes left and right of the axis for rhythm. Suitable for 3–8 milestones across a chronological arc, transformation story, or multi-year programme recap.
|
|
@@ -2731,6 +2804,33 @@ Rules:
|
|
|
2731
2804
|
- **Dark background overrides**: set on the `.tjv` wrapper — `--line-strong: rgba(240,244,247,0.25)` (axis + stem), `.tjv-title { color: #f0f4f7 }`, `.tjv-text { color: rgba(240,244,247,0.7) }`. The `--tjv-item-color` accent colours work on dark backgrounds without change.
|
|
2732
2805
|
- **Fewer nodes (3–4)**: increase spacing — use `top` values like `15%, 35%, 55%, 75%` to prevent the timeline from clustering at the top.
|
|
2733
2806
|
- **More nodes (6–8)**: keep `.tjv-text` to 1-2 lines and increase vertical spacing between nodes if needed. Treat `17px` as the default body size; only use a smaller local override in exceptional dense layouts.
|
|
2734
|
-
<!-- @component:
|
|
2807
|
+
<!-- @component:roadmap-vertical:end -->
|
|
2735
2808
|
|
|
2736
2809
|
<!-- @design:components:end -->
|
|
2810
|
+
|
|
2811
|
+
<!-- @design:chart-rules:start -->
|
|
2812
|
+
|
|
2813
|
+
### Data Visualization (ECharts)
|
|
2814
|
+
|
|
2815
|
+
- Chart system is ECharts. Data charts should use `echarts.init()` with an `echart-panel` container, not hand-written SVG, div/CSS shapes, canvas mocks, or static faux charts.
|
|
2816
|
+
- Monet charts should feel calm and art-book-like: soft contrast, restrained labels, limited series count, and no dashboard chrome, glow, or excessive gridlines.
|
|
2817
|
+
- Use `--accent-earth`, `--accent-olive`, `--accent-stone`, and `--accent-sage` for primary/supporting series. Use `--accent-danger` only for negative indicators. Derive colors from CSS variables with `getComputedStyle(document.documentElement)` instead of hard-coding unrelated palettes.
|
|
2818
|
+
- Keep chart containers inside `echart-panel` so QA can measure stable geometry. `.echart-container` must have stable sizing through explicit width/height or flex sizing with `min-height: 0`.
|
|
2819
|
+
- Give every chart a unique id. Initialise with `echarts.init()` after `SlidePresentation` is instantiated, and call `chart.resize()` on window resize.
|
|
2820
|
+
- Set `backgroundColor: "transparent"` in chart options. Set text, axis, legend, grid, and tooltip colors explicitly; ECharts canvas text does not inherit CSS reliably.
|
|
2821
|
+
- Always include a short chart caption or source note when data is shown.
|
|
2822
|
+
- Do not use fake chart fallback when ECharts runtime or chart rules are missing. Report the missing runtime/rules or use an approved local/runtime dependency.
|
|
2823
|
+
|
|
2824
|
+
Recommended ECharts defaults:
|
|
2825
|
+
|
|
2826
|
+
```javascript
|
|
2827
|
+
const styles = getComputedStyle(document.documentElement);
|
|
2828
|
+
const chartText = styles.getPropertyValue('--text-secondary').trim();
|
|
2829
|
+
const chartMuted = styles.getPropertyValue('--text-muted').trim();
|
|
2830
|
+
const chartLine = styles.getPropertyValue('--line').trim();
|
|
2831
|
+
const primary = styles.getPropertyValue('--accent-earth').trim();
|
|
2832
|
+
const secondary = styles.getPropertyValue('--accent-olive').trim();
|
|
2833
|
+
const soft = styles.getPropertyValue('--accent-sage').trim();
|
|
2834
|
+
```
|
|
2835
|
+
|
|
2836
|
+
<!-- @design:chart-rules:end -->
|
|
@@ -233,6 +233,9 @@ new SlidePresentation();
|
|
|
233
233
|
- **Stable layout CSS.** Do not rewrite base layout/container CSS unless the structure itself must change. Prefer tokens, typography, component skins, and small motif components.
|
|
234
234
|
- **Reusable class vocabulary.** New classes must be documented in this DESIGN.md. Avoid many one-off selectors in generated decks.
|
|
235
235
|
- **SVG is exceptional.** Use decorative SVG only when the user explicitly asks for an illustration/icon-like visual or when design authoring requires a motif.
|
|
236
|
+
- **Icon system is Lucide.** For ordinary UI, semantic, status, category, process, and navigation icons, use Lucide (`data-lucide`). Do not hand-write inline SVG for icons. SVG is allowed only for intentional decorative motifs, illustrations, or design-specific artwork. If any `data-lucide` icon is present, load Lucide via CDN and call `lucide.createIcons()` after `SlidePresentation`.
|
|
237
|
+
- **Chart system is ECharts.** Data charts default to ECharts inside `echart-panel`. Do not use hand-written SVG, div/CSS shapes, canvas mocks, or static faux charts as data-chart substitutes. SVG remains acceptable for decorative motifs, diagrams, or illustrations, not data charts. Before creating or changing a chart, fetch the `echart-panel` component and `section: "chart-rules"`; if chart rules or runtime are unavailable, report the gap instead of inventing a fake chart fallback.
|
|
238
|
+
- **Start from foundation.** New deck HTML starts from `@design:foundation`. Do not recreate foundation CSS, JavaScript, or the HTML skeleton from memory. Prefer a foundation helper when available; otherwise fetch `section: "foundation"` before writing a new deck shell. Existing deck edits preserve the current foundation unless the user asks for foundation repair or QA reports a foundation contract problem.
|
|
236
239
|
- **Images for photographic references.** Use image treatment rules rather than fake SVG when the reference is photographic, UI, webpage, or product imagery.
|
|
237
240
|
- **Content pages need a stable title block.** Except cover, TOC, closing, section divider, and full-bleed hero slides, every normal content slide should include a visible title block from the upper-left safe area. It should contain a compact chapter/section label plus a slide title written as the page's claim or takeaway.
|
|
238
241
|
- **Do not hide the page title inside a card.** Body components may have their own headings, but the slide-level title block should remain separate and easy to scan unless the chosen layout explicitly defines a compact side-title variant.
|
|
@@ -880,11 +883,14 @@ Rules:
|
|
|
880
883
|
|
|
881
884
|
### Data Visualization (ECharts)
|
|
882
885
|
|
|
883
|
-
-
|
|
884
|
-
- Use
|
|
885
|
-
-
|
|
886
|
+
- Chart system is ECharts. Data charts should use `echarts.init()` with an `echart-panel` container, not hand-written SVG, div/CSS shapes, canvas mocks, or static faux charts.
|
|
887
|
+
- Use neutral chart styling by default: clean axes, limited series count, restrained labels, and transparent backgrounds.
|
|
888
|
+
- Use `--accent-primary` for the main series and `--accent-secondary` for supporting series. Derive colors from CSS variables with `getComputedStyle(document.documentElement)` instead of hard-coding unrelated palettes.
|
|
889
|
+
- Keep chart containers inside `echart-panel` so QA can measure stable geometry. `.echart-container` must have stable sizing through explicit width/height or flex sizing with `min-height: 0`.
|
|
890
|
+
- Give every chart a unique id. Initialise with `echarts.init()` after `SlidePresentation` is instantiated, and call `chart.resize()` on window resize.
|
|
891
|
+
- Set `backgroundColor: "transparent"` in chart options. Set text, axis, legend, grid, and tooltip colors explicitly; ECharts canvas text does not inherit CSS reliably.
|
|
886
892
|
- Always include a short chart caption or source note when data is shown.
|
|
887
|
-
-
|
|
893
|
+
- Do not use fake chart fallback when ECharts runtime or chart rules are missing. Report the missing runtime/rules or use an approved local/runtime dependency.
|
|
888
894
|
|
|
889
895
|
Recommended ECharts defaults:
|
|
890
896
|
|
package/designs/summit/DESIGN.md
CHANGED
|
@@ -443,6 +443,9 @@ These rules are mandatory for Summit.
|
|
|
443
443
|
- **Text panels are not decorative rule panels.** Do not add a default left border, vertical accent bar, yellow/gold line, or inline rule to `text-panel`. Use typography, spacing, boxes, stats, quotes, or layout-level dividers for emphasis.
|
|
444
444
|
- **Titles are Title Case.** Do not set `text-transform:uppercase` on `h1`, `h2`, `h3`, or `h4` titles. Uppercase is reserved for eyebrows, captions, metadata labels, short codes, and date/code-like markers.
|
|
445
445
|
- **Components are transparent by default.** Component primitives should not bring their own paper/background fill. Let `.page`, layout containers, or explicit modifier variants provide background color when needed.
|
|
446
|
+
- **Icon system is Lucide.** For ordinary UI, semantic, status, category, process, and navigation icons, use Lucide (`data-lucide`). Do not hand-write inline SVG for icons. SVG is allowed only for intentional decorative motifs, illustrations, or design-specific artwork. If any `data-lucide` icon is present, load Lucide via CDN and call `lucide.createIcons()` after `SlidePresentation`.
|
|
447
|
+
- **Chart system is ECharts.** Data charts default to ECharts inside `echart-panel`. Do not use hand-written SVG, div/CSS shapes, canvas mocks, or static faux charts as data-chart substitutes. SVG remains acceptable for decorative motifs, diagrams, or illustrations, not data charts. Before creating or changing a chart, fetch the `echart-panel` component and `section: "chart-rules"`; if chart rules or runtime are unavailable, report the gap instead of inventing a fake chart fallback.
|
|
448
|
+
- **Start from foundation.** New deck HTML starts from `@design:foundation`. Do not recreate foundation CSS, JavaScript, or the HTML skeleton from memory. Prefer a foundation helper when available; otherwise fetch `section: "foundation"` before writing a new deck shell. Existing deck edits preserve the current foundation unless the user asks for foundation repair or QA reports a foundation contract problem.
|
|
446
449
|
|
|
447
450
|
### Common Mistakes
|
|
448
451
|
|
|
@@ -2607,3 +2610,30 @@ Rules:
|
|
|
2607
2610
|
<!-- @component:roadmap-vertical:end -->
|
|
2608
2611
|
|
|
2609
2612
|
<!-- @design:components:end -->
|
|
2613
|
+
|
|
2614
|
+
<!-- @design:chart-rules:start -->
|
|
2615
|
+
|
|
2616
|
+
### Data Visualization (ECharts)
|
|
2617
|
+
|
|
2618
|
+
- Chart system is ECharts. Data charts should use `echarts.init()` with an `echart-panel` container, not hand-written SVG, div/CSS shapes, canvas mocks, or static faux charts.
|
|
2619
|
+
- Summit charts should feel editorial and report-like: calm typography, limited series count, restrained labels, and no dashboard chrome, glow, or excessive gridlines.
|
|
2620
|
+
- Use `--accent-earth`, `--accent-olive`, and `--accent-gold` for primary/supporting series. Use `--accent-danger` only for negative indicators. Derive colors from CSS variables with `getComputedStyle(document.documentElement)` instead of hard-coding unrelated palettes.
|
|
2621
|
+
- Keep chart containers inside `echart-panel` so QA can measure stable geometry. `.echart-container` must have stable sizing through explicit width/height or flex sizing with `min-height: 0`.
|
|
2622
|
+
- Give every chart a unique id. Initialise with `echarts.init()` after `SlidePresentation` is instantiated, and call `chart.resize()` on window resize.
|
|
2623
|
+
- Set `backgroundColor: "transparent"` in chart options. Set text, axis, legend, grid, and tooltip colors explicitly; ECharts canvas text does not inherit CSS reliably.
|
|
2624
|
+
- Always include a short chart caption or source note when data is shown.
|
|
2625
|
+
- Do not use fake chart fallback when ECharts runtime or chart rules are missing. Report the missing runtime/rules or use an approved local/runtime dependency.
|
|
2626
|
+
|
|
2627
|
+
Recommended ECharts defaults:
|
|
2628
|
+
|
|
2629
|
+
```javascript
|
|
2630
|
+
const styles = getComputedStyle(document.documentElement);
|
|
2631
|
+
const chartText = styles.getPropertyValue('--text-secondary').trim();
|
|
2632
|
+
const chartMuted = styles.getPropertyValue('--text-muted').trim();
|
|
2633
|
+
const chartLine = styles.getPropertyValue('--line').trim();
|
|
2634
|
+
const primary = styles.getPropertyValue('--accent-earth').trim();
|
|
2635
|
+
const secondary = styles.getPropertyValue('--accent-olive').trim();
|
|
2636
|
+
const highlight = styles.getPropertyValue('--accent-gold').trim();
|
|
2637
|
+
```
|
|
2638
|
+
|
|
2639
|
+
<!-- @design:chart-rules:end -->
|
package/lib/edit/prompt.ts
CHANGED
|
@@ -79,6 +79,9 @@ Instructions:
|
|
|
79
79
|
- Pure artifact polish such as layout, spacing, typography, alignment, color, image crop, animation, export fidelity, runtime JavaScript fixes, or deck HTML contract fixes may remain an artifact-level edit.
|
|
80
80
|
- If the request mixes content meaning and visual polish, treat it as narrative-impacting unless the user clarifies otherwise.
|
|
81
81
|
- Preserve the existing deck structure, active design language, typography, spacing system, animations, and slide count unless the comment explicitly asks otherwise.
|
|
82
|
+
- Before patching ${"`decks/*.html`"}, call ${"`revela-designs`"} with ${"`action: \"read\"`"} and ${"`section: \"rules\"`"} to fetch the active design rules for this edit pass.
|
|
83
|
+
- If the edit changes layout, component structure, typography scale, visual hierarchy, chart usage, icon usage, media treatment, or design-system classes, fetch the relevant ${"`revela-designs`"} layout/component details before editing. Fetch ${"`section: \"chart-rules\"`"} before changing or adding ECharts.
|
|
84
|
+
- Follow the fetched design rules and vocabulary exactly. Do not invent layout classes, component names, CSS variables, icon systems, or visual effects from model memory or the existing deck alone.
|
|
82
85
|
- If an asset/drop payload is present, this is an asset placement request. Use only the saved local asset path from the asset payload in deck HTML. Prefer asset.deckPath when present because it is relative to the target HTML file; otherwise use asset.path.
|
|
83
86
|
- Do not write remote imageUrl, thumbnailUrl, source page URLs, or ${"`/__revela_asset`"} proxy URLs into deck HTML.
|
|
84
87
|
- Logo assets should remain small, clear, and brand-like; do not use logos as decorative backgrounds.
|
package/lib/edit/server.ts
CHANGED
|
@@ -2,6 +2,8 @@ import { randomBytes } from "crypto"
|
|
|
2
2
|
import { existsSync, readFileSync, statSync } from "fs"
|
|
3
3
|
import { fileURLToPath } from "url"
|
|
4
4
|
import { dirname, extname, isAbsolute, resolve, sep } from "path"
|
|
5
|
+
import { ctx } from "../ctx"
|
|
6
|
+
import { buildPrompt } from "../prompt-builder"
|
|
5
7
|
import type { EditableDeck } from "./resolve-deck"
|
|
6
8
|
import { buildEditPrompt, type EditCommentPayload } from "./prompt"
|
|
7
9
|
|
|
@@ -405,6 +407,9 @@ async function handleComment(req: Request, session: EditSession): Promise<Respon
|
|
|
405
407
|
const elements = Array.isArray(body.elements) ? body.elements : []
|
|
406
408
|
if (!comment && comments.length === 0) return jsonResponse({ ok: false, error: "Comment is required" }, 400)
|
|
407
409
|
|
|
410
|
+
ctx.enabled = true
|
|
411
|
+
buildPrompt({ mode: "deck-render" })
|
|
412
|
+
|
|
408
413
|
const prompt = buildEditPrompt({
|
|
409
414
|
...body,
|
|
410
415
|
deck: session.deck,
|
package/lib/prompt-builder.ts
CHANGED
|
@@ -202,6 +202,7 @@ function buildDesignLayer(designName: string): string {
|
|
|
202
202
|
"",
|
|
203
203
|
"| Section | Fetch with |",
|
|
204
204
|
"|---|---|",
|
|
205
|
+
"| Design composition and usage rules | `section: \"rules\"` |",
|
|
205
206
|
"| Layout HTML/CSS details | `layout: \"<name>\"` (see Layout Index above) |",
|
|
206
207
|
"| Component CSS/HTML details | `component: \"<name>\"` (see Component Index above) |",
|
|
207
208
|
"| Data Visualization (ECharts) | `section: \"chart-rules\"` |",
|
package/lib/refine/server.ts
CHANGED
|
@@ -2,8 +2,10 @@ import { randomBytes } from "crypto"
|
|
|
2
2
|
import { existsSync, readFileSync, statSync } from "fs"
|
|
3
3
|
import { fileURLToPath } from "url"
|
|
4
4
|
import { dirname, extname, isAbsolute, relative, resolve, sep } from "path"
|
|
5
|
+
import { ctx } from "../ctx"
|
|
5
6
|
import type { EditableDeck } from "../edit/resolve-deck"
|
|
6
7
|
import { buildEditPrompt, type EditCommentPayload } from "../edit/prompt"
|
|
8
|
+
import { buildPrompt } from "../prompt-builder"
|
|
7
9
|
import type { InspectionElementSnapshot } from "../inspection-context/match"
|
|
8
10
|
import { buildInspectionPrompt } from "../inspect/prompt"
|
|
9
11
|
import { projectWorkspaceElement } from "../inspect/request"
|
|
@@ -715,6 +717,9 @@ async function handleComment(req: Request, session: EditSession): Promise<Respon
|
|
|
715
717
|
const elements = Array.isArray(body.elements) ? body.elements : []
|
|
716
718
|
if (!comment && comments.length === 0) return jsonResponse({ ok: false, error: "Comment is required" }, 400)
|
|
717
719
|
|
|
720
|
+
ctx.enabled = true
|
|
721
|
+
buildPrompt({ mode: "deck-render" })
|
|
722
|
+
|
|
718
723
|
const prompt = buildEditPrompt({
|
|
719
724
|
...body,
|
|
720
725
|
deck: session.deck,
|
package/package.json
CHANGED
package/skill/SKILL.md
CHANGED
|
@@ -193,16 +193,20 @@ If a write produces QA hard errors, fix them before continuing.
|
|
|
193
193
|
Before writing or materially changing HTML:
|
|
194
194
|
|
|
195
195
|
1. Read the deck-plan projection's layout and component names.
|
|
196
|
-
2. Call `revela-designs` with `action: "read"` and `
|
|
196
|
+
2. Call `revela-designs` with `action: "read"` and `section: "rules"` to fetch
|
|
197
|
+
the active design's current composition and usage rules.
|
|
198
|
+
3. Call `revela-designs` with `action: "read"` and `layout` set to all required
|
|
197
199
|
layout names, comma-separated.
|
|
198
|
-
|
|
200
|
+
4. Call `revela-designs` with `action: "read"` and `component` set to all
|
|
199
201
|
required component names, comma-separated.
|
|
200
|
-
|
|
201
|
-
|
|
202
|
+
5. Fetch `section: "chart-rules"` before using ECharts.
|
|
203
|
+
6. Do not update legacy `requiredInputs`; design fetching is an execution step,
|
|
202
204
|
not a workflow permission gate.
|
|
203
205
|
|
|
204
206
|
Never generate HTML from memory or prior knowledge of a design. Copy the fetched
|
|
205
|
-
HTML/CSS structures closely and adapt content to fit the design vocabulary.
|
|
207
|
+
HTML/CSS structures closely and adapt content to fit the design vocabulary. Do
|
|
208
|
+
not treat the injected design summary as a substitute for the fetched `rules`,
|
|
209
|
+
layout, and component details when generating or materially changing HTML.
|
|
206
210
|
|
|
207
211
|
The active design's complete visual specification is injected below after the
|
|
208
212
|
`---` separator. It is the sole visual reference for generating slides.
|
|
@@ -227,7 +231,8 @@ Required contract:
|
|
|
227
231
|
- Do not use 0-based `data-index` as slide identity.
|
|
228
232
|
- Keep the canvas exactly 1920x1080 and 16:9.
|
|
229
233
|
- Keep all CSS inline in one `<style>` block and all JS inline in one `<script>`
|
|
230
|
-
block, except approved CDNs for fonts,
|
|
234
|
+
block, except approved CDNs for fonts, ECharts when needed, or libraries
|
|
235
|
+
explicitly required by fetched design/component rules.
|
|
231
236
|
- Use vanilla JS only. No React, Vue, jQuery, or external application framework.
|
|
232
237
|
- All JS methods must be fully implemented. No empty stubs and no TODO comments.
|
|
233
238
|
- Do not add deck-local editing JavaScript, `contenteditable`, `editable` classes,
|
|
@@ -338,8 +343,6 @@ instructions, secrets, or unverified claims.
|
|
|
338
343
|
- Use semantic HTML where practical.
|
|
339
344
|
- Full keyboard navigation must work.
|
|
340
345
|
- `prefers-reduced-motion` must disable transitions/animations.
|
|
341
|
-
- Use Lucide icons only when icons are needed; load via CDN and call
|
|
342
|
-
`lucide.createIcons()`.
|
|
343
346
|
- Avoid plain background plus unstyled bullet lists.
|
|
344
347
|
- Every slide needs one clear message and one dominant visual focal point.
|
|
345
348
|
- Keep bullet lists short. Prefer semantic boxes, evidence cards, charts, tables,
|
package/tools/designs.ts
CHANGED
|
@@ -25,7 +25,7 @@ export default tool({
|
|
|
25
25
|
"Use action 'activate' to switch to a different design (requires name). " +
|
|
26
26
|
"Use action 'install' to add a new design from a URL, local path, or github:user/repo shorthand (requires source). " +
|
|
27
27
|
"Use action 'remove' to uninstall a design (requires name). " +
|
|
28
|
-
"Use action 'read' to fetch on-demand design content: pass layout (comma-separated names) to get full HTML/CSS for specific layouts, pass component (comma-separated names) to get full CSS/HTML for specific components, or section ('chart-rules' | 'foundation' | 'layouts' | 'components') to get an entire section. Pass neither to get the Component Index table. " +
|
|
28
|
+
"Use action 'read' to fetch on-demand design content: pass layout (comma-separated names) to get full HTML/CSS for specific layouts, pass component (comma-separated names) to get full CSS/HTML for specific components, or section ('rules' | 'chart-rules' | 'foundation' | 'layouts' | 'components') to get an entire section. Pass neither to get the Component Index table. " +
|
|
29
29
|
"After activating a new design, the system prompt is automatically rebuilt.",
|
|
30
30
|
args: {
|
|
31
31
|
action: tool.schema
|