cascivo 1.8.2 → 1.9.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/README.md +1 -0
- package/dist/{app-BhCskK3W.mjs → app-Dt98v4Zq.mjs} +3 -3
- package/dist/{app-BhCskK3W.mjs.map → app-Dt98v4Zq.mjs.map} +1 -1
- package/dist/{blueprint-B6Z8NrCr.mjs → blueprint-BBrlwJhm.mjs} +2 -2
- package/dist/{blueprint-B6Z8NrCr.mjs.map → blueprint-BBrlwJhm.mjs.map} +1 -1
- package/dist/cmdspec.json +310 -1
- package/dist/{create-DIaknp48.mjs → create-BMqDBB8r.mjs} +3 -3
- package/dist/{create-DIaknp48.mjs.map → create-BMqDBB8r.mjs.map} +1 -1
- package/dist/design-CYQqMPQB.mjs +3 -0
- package/dist/design-CYQqMPQB.mjs.map +1 -0
- package/dist/generated/audit-contract.json +3 -2
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +70 -33
- package/dist/index.mjs.map +1 -1
- package/dist/skills/cascivo-design/SKILL.md +44 -0
- package/dist/skills/cascivo-design/references/check-rules.md +37 -0
- package/dist/skills/cascivo-design/references/critique-rubric.md +26 -0
- package/dist/skills/cascivo-design/references/direction.md +113 -0
- package/dist/skills/cascivo-design/references/without-cascivo.md +17 -0
- package/package.json +8 -3
- package/readme.body.md +1 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cascivo-design
|
|
3
|
+
description: Build a page or screen that is good on the first try - choose an aesthetic direction and record it as tokens, plan the page from a brief, build it, audit the rendered result with `cascivo design check` and fix until clean. Use for any UI work (React, htmx, static HTML, Rust `.cv`), including projects that do not use cascivo yet.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# cascivo-design
|
|
7
|
+
|
|
8
|
+
Direct, plan, build, measure, fix.
|
|
9
|
+
Needs `@cascivo/design` and `playwright` as dev dependencies.
|
|
10
|
+
|
|
11
|
+
## Steps
|
|
12
|
+
|
|
13
|
+
1. **Direction.** `DESIGN.md` exists: read it, it is the direction; go to step 2. Else choose
|
|
14
|
+
one before any markup: a type pairing, a palette, a motion rule, one signature element and
|
|
15
|
+
one composition move (asymmetry, scale contrast, broken grid, overlap, full bleed), all
|
|
16
|
+
drawn from the brief's subject, none copied from an example. Use the `frontend-design`
|
|
17
|
+
skill if installed, else `references/direction.md`. Record it:
|
|
18
|
+
`npx cascivo design init --theme <name> --accent <colour> --font-display "<stack>" --font-body "<stack>" --signature "<one sentence>" --composition "<one sentence>"`
|
|
19
|
+
(`--primary --background --surface --text` too). It writes the tokens to `DESIGN.md` front
|
|
20
|
+
matter and prints a `:root` block: paste that into the page stylesheet. More tokens: add them
|
|
21
|
+
to the front matter and to `:root`. Read `DESIGN.md`; it limits everything below.
|
|
22
|
+
2. **Plan.** `npx cascivo design plan "<brief>"` (`--format view` for ViewConfig JSON). Its
|
|
23
|
+
slots fix content and reading order, not layout: keep them and their states, then lay them
|
|
24
|
+
out with the composition move. Never stack them as even centred blocks. Only components
|
|
25
|
+
the plan or registry names. Display face on headings, accent where it counts, the
|
|
26
|
+
signature element once.
|
|
27
|
+
3. **Measure.** `npx cascivo design check <url|file.html>` from the project root (or
|
|
28
|
+
`--design <path>`): tokens in `DESIGN.md` and on `:root` count as on-scale. Each line is
|
|
29
|
+
`level rule selector - message -> fix`; apply the fix it names. At most 3 rounds. Change
|
|
30
|
+
only what a finding names; never drop the direction to clear a warning, declare the token
|
|
31
|
+
instead. Rules: `references/check-rules.md`.
|
|
32
|
+
4. **Critique, once.** At exit 0, start one separate subagent with only the brief, the output
|
|
33
|
+
of `npx cascivo design see <url>` and `references/critique-rubric.md`. Fix each "no",
|
|
34
|
+
re-run check once, stop.
|
|
35
|
+
|
|
36
|
+
## Report
|
|
37
|
+
|
|
38
|
+
The final score line, the rounds used, the direction and composition move in one line, any finding left and why.
|
|
39
|
+
|
|
40
|
+
## Notes
|
|
41
|
+
|
|
42
|
+
- No cascivo in the project: `references/without-cascivo.md`.
|
|
43
|
+
- Still failing after 3 rounds: stop and report. Do not loop.
|
|
44
|
+
- Guide: <https://cascivo.com/docs/guides/using-cascivo-design>.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# `design check` rules
|
|
2
|
+
|
|
3
|
+
One line per finding: `level rule selector xN - message -> fix`. `error` fails the run (exit 1);
|
|
4
|
+
`warn` only lowers the score. `--max N` caps the list (default 20); `--json` gives everything.
|
|
5
|
+
|
|
6
|
+
| Rule | Category | Checks |
|
|
7
|
+
| ---------------------------------------------------- | --------- | -------------------------------------------------------------- |
|
|
8
|
+
| `overflow` | mobile | No sideways scroll at 320, 360, 390 and 414px |
|
|
9
|
+
| `touch-target` | mobile | Interactive elements are 44x44px on touch (error under 24) |
|
|
10
|
+
| `axe/<id>` | a11y | axe-core, WCAG 2.2 AA |
|
|
11
|
+
| `contrast` | contrast | Computed text colour against its background, 4.5:1 (3:1 large) |
|
|
12
|
+
| `token/spacing`, `/font-size`, `/radius`, `/color` | tokens | Computed values sit on the page's cascivo scales |
|
|
13
|
+
| `scale/spacing`, `scale/colors` | tokens | A page without cascivo: 4px grid, at most 12 colours |
|
|
14
|
+
| `hierarchy/h1`, `/heading-order` | hierarchy | One `<h1>`, levels descend one step at a time |
|
|
15
|
+
| `hierarchy/body-text`, `/line-length`, `/font-sizes` | hierarchy | Running text >=16px, lines <=80ch, at most 6 font sizes |
|
|
16
|
+
|
|
17
|
+
## The project's own tokens are on-scale
|
|
18
|
+
|
|
19
|
+
A value passes the `tokens` rules when it matches a custom property the page defines on `:root`,
|
|
20
|
+
or a token in the front matter of `DESIGN.md` (`colors`, `spacing`, `rounded`,
|
|
21
|
+
`typography.*.fontSize`). `check` reads `./DESIGN.md` when it is there; `--design <path>` names
|
|
22
|
+
another. So a chosen palette or display size is not a finding once it is declared; a literal
|
|
23
|
+
that is declared nowhere still is.
|
|
24
|
+
|
|
25
|
+
## Usual fixes
|
|
26
|
+
|
|
27
|
+
- `overflow`: `min-inline-size: 0` on the flex/grid child, `max-inline-size: 100%` on media,
|
|
28
|
+
`flex-wrap: wrap` on rows, `overflow-x: auto` on a wide table's wrapper.
|
|
29
|
+
- `touch-target`: `min-block-size: var(--cascivo-target-min-coarse, 2.75rem)` and the same
|
|
30
|
+
inline size, inside `@media (pointer: coarse)` if the desktop size must stay small.
|
|
31
|
+
- `contrast`: use the colour the fix names, or a text token (`--cascivo-color-foreground`,
|
|
32
|
+
`--cascivo-color-text-subtle`) on a surface token.
|
|
33
|
+
- `token/*`: replace the literal with the token the fix names. If the value is part of the
|
|
34
|
+
direction, declare it instead (front matter and `:root`).
|
|
35
|
+
- `hierarchy/line-length`: `max-inline-size: 65ch` on the text block.
|
|
36
|
+
|
|
37
|
+
Fix errors first, then warnings in list order. Do not silence a rule by hiding the element.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Critique rubric
|
|
2
|
+
|
|
3
|
+
For the critique subagent. You get the brief, the `design see` digest and the screenshot path.
|
|
4
|
+
Read the screenshot. Answer every question `yes` or `no`, each with one line of evidence that
|
|
5
|
+
names a landmark, heading or selector from the digest. No score, no taste words ("clean",
|
|
6
|
+
"modern"), no rewrite of the page. A question that does not apply to this page is `yes`.
|
|
7
|
+
|
|
8
|
+
1. **Purpose.** Does the first screen say what the page is for, in the words of the brief?
|
|
9
|
+
2. **One primary action.** Is there exactly one visually dominant action per view?
|
|
10
|
+
3. **Order.** Does the reading order match the order of importance in the brief?
|
|
11
|
+
4. **Hierarchy.** Can you tell title, section headings and body apart by size or weight alone?
|
|
12
|
+
5. **Grouping.** Are related items closer to each other than to unrelated ones?
|
|
13
|
+
6. **Density.** Is every section needed for the brief? (A filler section is a `no`.)
|
|
14
|
+
7. **Copy.** Is every label and heading specific? (Lorem ipsum, "Feature 1", "Click here" are a `no`.)
|
|
15
|
+
8. **States.** Does the page show the states the plan lists (empty, loading, error, selected)?
|
|
16
|
+
9. **Mobile.** At 390px, is the primary action reachable without sideways scroll and above the
|
|
17
|
+
second screen?
|
|
18
|
+
10. **Consistency.** Does one kind of thing look the same everywhere (buttons, cards, spacing)?
|
|
19
|
+
|
|
20
|
+
Output format, one line per question:
|
|
21
|
+
|
|
22
|
+
```text
|
|
23
|
+
3 no - "Pricing" (h2) comes before the product summary; brief leads with the product
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
The builder fixes each `no`, runs `design check` once more, and stops.
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Choosing a direction
|
|
2
|
+
|
|
3
|
+
Use this when no `frontend-design` skill is installed. Decide all six before writing markup,
|
|
4
|
+
in about five minutes. The aim: someone who sees the page for two seconds can say what it is
|
|
5
|
+
for and would not mistake it for another product.
|
|
6
|
+
|
|
7
|
+
## 1. Start from the subject, not from "modern"
|
|
8
|
+
|
|
9
|
+
Write one line: who uses this, where, in what mood. Then name a real-world reference the
|
|
10
|
+
subject already has: a ledger, a seed catalogue, a flight strip, a lab notebook, a concert
|
|
11
|
+
poster, a transit map, a field guide. Take the palette, type and signature from that
|
|
12
|
+
reference. "Clean and minimal" is not a direction; it is the absence of one.
|
|
13
|
+
|
|
14
|
+
## 2. Type pairing (`--font-display`, `--font-body`)
|
|
15
|
+
|
|
16
|
+
Pick a display face with character and a quiet body face. No web fonts unless the project
|
|
17
|
+
already loads them; these system stacks need no network:
|
|
18
|
+
|
|
19
|
+
- Old-style serif: `"Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif`
|
|
20
|
+
- Transitional serif: `Charter, "Bitstream Charter", Cambria, Georgia, serif`
|
|
21
|
+
- Slab: `Rockwell, "Rockwell Nova", "Roboto Slab", "DejaVu Serif", serif`
|
|
22
|
+
- Humanist sans: `Seravek, "Gill Sans Nova", Ubuntu, Calibri, "DejaVu Sans", sans-serif`
|
|
23
|
+
- Geometric sans: `Avenir, Montserrat, Corbel, "URW Gothic", sans-serif`
|
|
24
|
+
- Industrial sans: `Bahnschrift, "DIN Alternate", "Franklin Gothic Medium", "Nimbus Sans Narrow", sans-serif`
|
|
25
|
+
- Mono: `ui-monospace, "Cascadia Code", Menlo, Consolas, monospace`
|
|
26
|
+
- Rounded: `ui-rounded, "Hiragino Maru Gothic ProN", Quicksand, Comfortaa, sans-serif`
|
|
27
|
+
|
|
28
|
+
Contrast the pair (serif display over sans body, mono labels over serif text). Set display
|
|
29
|
+
type large and tight (line-height 1.05 to 1.2); weight and size carry hierarchy, not colour.
|
|
30
|
+
Stay on the type scale; if the display needs a bigger step, declare it in `DESIGN.md`.
|
|
31
|
+
|
|
32
|
+
## 3. Palette (`--accent`, `--primary`, `--background`, `--surface`, `--text`)
|
|
33
|
+
|
|
34
|
+
- One dominant neutral that is not pure white or pure black: tint it toward the accent
|
|
35
|
+
(`oklch(0.98 0.01 <hue>)` paper, `oklch(0.2 0.02 <hue>)` ink).
|
|
36
|
+
- One accent, saturated, used on under 10% of the surface: the primary action, one highlight.
|
|
37
|
+
- Optionally one secondary for data or status. Stop at three hues.
|
|
38
|
+
- Text on background at 4.5:1 or more; text on the accent too. `check` measures it.
|
|
39
|
+
- Avoid the defaults: blue-600 on white, purple-to-blue gradients, grey-on-grey cards.
|
|
40
|
+
|
|
41
|
+
## 4. Motion (write one sentence in `DESIGN.md` under Motion)
|
|
42
|
+
|
|
43
|
+
One rule, for example "only the thing the user just acted on moves". Use the `fast` / `base`
|
|
44
|
+
/ `slow` tokens. No entrance animation on scroll. Everything stops under
|
|
45
|
+
`prefers-reduced-motion`.
|
|
46
|
+
|
|
47
|
+
## 5. One signature element (`--signature`)
|
|
48
|
+
|
|
49
|
+
One thing a visitor would describe to someone else, built from CSS and tokens, used once or
|
|
50
|
+
as one repeated motif. It must come from the subject:
|
|
51
|
+
|
|
52
|
+
- a ruled ledger line under headings; row numbers in the margin; a ticket-stub notch
|
|
53
|
+
- an oversized numeral or initial; a stamp or seal; a hand-drawn underline (SVG)
|
|
54
|
+
- a strict visible grid with hairlines; a diagonal cut section; a full-bleed colour band
|
|
55
|
+
- data drawn as the subject itself (a plan as a train ticket, a step list as a route)
|
|
56
|
+
|
|
57
|
+
Not a signature: a gradient blob, a glass card, an emoji, a drop shadow, a rotating badge.
|
|
58
|
+
|
|
59
|
+
## 6. One composition move (`--composition`)
|
|
60
|
+
|
|
61
|
+
The plan gives slots. Slots fix what the page says and in what order. They do not say where
|
|
62
|
+
anything sits or how big it is: a page that stacks the slots as even, centred blocks has no
|
|
63
|
+
composition. Pick one move, from the subject, and write it as one sentence:
|
|
64
|
+
|
|
65
|
+
- **Asymmetry:** an uneven split (2:5, 1:3) or one edge everything hangs from; the other
|
|
66
|
+
side stays empty or holds one object.
|
|
67
|
+
- **Scale contrast:** one thing five to ten times the size of what is next to it (a price, a
|
|
68
|
+
numeral, a word, a chart) and everything else small.
|
|
69
|
+
- **Broken grid:** a visible strict grid, and one element that leaves it: wider, offset by a
|
|
70
|
+
column, or crossing a section edge.
|
|
71
|
+
- **Overlap:** one layer sits on another: a card across a band's edge, type over an image.
|
|
72
|
+
- **Full bleed:** one band runs edge to edge in a solid colour between contained sections.
|
|
73
|
+
- **Density flip:** dense where the genre is airy (a table, not cards) or the reverse.
|
|
74
|
+
- **Off-axis:** a rotated label, a vertical heading in the margin, a diagonal cut.
|
|
75
|
+
|
|
76
|
+
Then vary the rhythm: no two neighbouring sections share a layout, and not every section is
|
|
77
|
+
heading plus three columns. On a phone the move stays, in a smaller form (the big numeral is
|
|
78
|
+
still the biggest thing; the offset becomes an indent). It never causes sideways scroll.
|
|
79
|
+
|
|
80
|
+
## Contrasting directions, one line each
|
|
81
|
+
|
|
82
|
+
These show the range, not a menu. Do not use one as written: your brief has its own subject,
|
|
83
|
+
and a direction borrowed from a list is the same page as everyone else's.
|
|
84
|
+
|
|
85
|
+
- Night-shift ops console: mono labels, near-black green, amber alerts; one huge status word.
|
|
86
|
+
- Seed catalogue: slab headings, leaf green on unbleached paper; plants numbered in the margin.
|
|
87
|
+
- Transit map: geometric sans, white with four line colours; steps drawn as stations on a route.
|
|
88
|
+
- Concert poster: condensed industrial caps, two flat inks; the title rotated up the left edge.
|
|
89
|
+
- Lab notebook: old-style serif with mono data, blue ruled lines; figures break the text column.
|
|
90
|
+
- Toy shop: rounded sans, three bright primaries; shapes overlap section edges.
|
|
91
|
+
- Legal brief: transitional serif, black on white, one red; dense numbered clauses, no cards.
|
|
92
|
+
|
|
93
|
+
If your direction could sit in this list unchanged for a different product, it is not yet
|
|
94
|
+
about your subject. Go back to step 1.
|
|
95
|
+
|
|
96
|
+
## Record it, then hold it
|
|
97
|
+
|
|
98
|
+
```sh
|
|
99
|
+
npx cascivo design init --theme <light|dark|...> \
|
|
100
|
+
--background "<colour>" --text "<colour>" --accent "<colour>" --primary "<colour>" \
|
|
101
|
+
--font-display '<stack>' --font-body '<stack>' \
|
|
102
|
+
--signature "<one sentence>" --composition "<one sentence>"
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Every value is yours: there is no default look to fall back on.
|
|
106
|
+
|
|
107
|
+
Paste the printed `:root` block into the page stylesheet. Anything else you invent (a second
|
|
108
|
+
hue, a display size, a card radius) goes in both places: the `DESIGN.md` front matter and a
|
|
109
|
+
custom property on `:root`. Then `check` treats it as on-scale. A hard-coded value that is in
|
|
110
|
+
neither is still a finding, and that is the point: the direction is a system, not decoration.
|
|
111
|
+
|
|
112
|
+
The `DESIGN.md` ban list still holds. A direction is never a reason for low contrast, a
|
|
113
|
+
target under 44px, or sideways scroll at 320px.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Projects that do not use cascivo
|
|
2
|
+
|
|
3
|
+
`design check`, `design see` and `design plan` need no cascivo components in the project.
|
|
4
|
+
|
|
5
|
+
- **Install:** `pnpm add -D @cascivo/design playwright cascivo` (dev only; nothing ships).
|
|
6
|
+
- **`init`:** still run it. `DESIGN.md` then records cascivo's scales as a neutral baseline.
|
|
7
|
+
Replace its token table with the project's own tokens if it has them.
|
|
8
|
+
- **`plan`:** read the slots, states and rules. Ignore the component names; map each slot to
|
|
9
|
+
the project's own component.
|
|
10
|
+
- **`check`:** the report's `cascivo` field is `false`, and the `token/*` rules are replaced by
|
|
11
|
+
`scale/spacing` (4px grid) and `scale/colors` (at most 12 colours). Mobile, a11y, contrast and
|
|
12
|
+
hierarchy rules are the same. The score is comparable across both kinds of page. Lengths and
|
|
13
|
+
colours the project declares (custom properties on `:root`, `DESIGN.md` front matter) pass the
|
|
14
|
+
grid and do not count toward the 12.
|
|
15
|
+
- **Fixes:** a fix that names a `--cascivo-*` token means "use the project's nearest scale value".
|
|
16
|
+
|
|
17
|
+
To adopt cascivo later: `npx cascivo init`, then `npx cascivo add <component>`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cascivo",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "CLI — npx cascivo init / add / list / update",
|
|
6
6
|
"keywords": [
|
|
@@ -47,7 +47,8 @@
|
|
|
47
47
|
"@cascivo/registry": "^0.3.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@cascivo/app": "1.
|
|
50
|
+
"@cascivo/app": "1.12.1",
|
|
51
|
+
"@cascivo/design": "0.1.0",
|
|
51
52
|
"@cascivo/email": "0.6.1",
|
|
52
53
|
"@cascivo/theme-kit": "0.0.0",
|
|
53
54
|
"@docspack/cmdspec": "^0.2.0",
|
|
@@ -56,16 +57,20 @@
|
|
|
56
57
|
"vite-plus": "^1.0.0"
|
|
57
58
|
},
|
|
58
59
|
"peerDependencies": {
|
|
60
|
+
"@cascivo/design": ">=0.0.0",
|
|
59
61
|
"@cascivo/email": ">=0.2.0"
|
|
60
62
|
},
|
|
61
63
|
"peerDependenciesMeta": {
|
|
64
|
+
"@cascivo/design": {
|
|
65
|
+
"optional": true
|
|
66
|
+
},
|
|
62
67
|
"@cascivo/email": {
|
|
63
68
|
"optional": true
|
|
64
69
|
}
|
|
65
70
|
},
|
|
66
71
|
"cmdspec": "./dist/cmdspec.json",
|
|
67
72
|
"scripts": {
|
|
68
|
-
"build": "vp pack --minify && node scripts/write-cmdspec.mjs && node -e \"const fs=require('fs');fs.mkdirSync('dist/generated',{recursive:true});fs.copyFileSync('src/generated/audit-contract.json','dist/generated/audit-contract.json')\" && node -e \"const fs=require('fs');const f='dist/index.mjs';const c=fs.readFileSync(f,'utf8');if(!c.startsWith('#!/'))fs.writeFileSync(f,'#!/usr/bin/env node\\n'+c);fs.chmodSync(f,0o755)\"",
|
|
73
|
+
"build": "vp pack --minify && node scripts/write-cmdspec.mjs && node scripts/copy-skill.mjs && node -e \"const fs=require('fs');fs.mkdirSync('dist/generated',{recursive:true});fs.copyFileSync('src/generated/audit-contract.json','dist/generated/audit-contract.json')\" && node -e \"const fs=require('fs');const f='dist/index.mjs';const c=fs.readFileSync(f,'utf8');if(!c.startsWith('#!/'))fs.writeFileSync(f,'#!/usr/bin/env node\\n'+c);fs.chmodSync(f,0o755)\"",
|
|
69
74
|
"check": "tsc --noEmit",
|
|
70
75
|
"test": "vp test",
|
|
71
76
|
"dev": "vp pack --watch"
|
package/readme.body.md
CHANGED
|
@@ -16,6 +16,7 @@ cascivo view owner/repo/dashboard # preview an item (or template) before instal
|
|
|
16
16
|
cascivo list # list available components
|
|
17
17
|
cascivo update # pull newer versions of copied components
|
|
18
18
|
cascivo audit --ai # flag hard-coded values, invented props, missing wiring
|
|
19
|
+
cascivo design plan "<brief>" # plan a page; also check, see, init, theme (@cascivo/design)
|
|
19
20
|
cascivo mcp init # add the cascivo MCP server to your agent's config
|
|
20
21
|
cascivo search <query> # search components across registries
|
|
21
22
|
cascivo theme add <name> # install a first-party theme (12 available)
|