@vibes.diy/prompts 14.3.326 → 14.3.327
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/index.d.ts +1 -1
- package/index.js +1 -1
- package/llms/image-gen.md +1 -1
- package/llms/index.d.ts +1 -1
- package/llms/index.js +1 -1
- package/llms/needs.d.ts +2 -0
- package/llms/needs.js +12 -0
- package/llms/types.d.ts +1 -0
- package/llms/voxel.js +1 -0
- package/package.json +5 -5
- package/system-prompt-initial-oneshot.md +1 -1
- package/system-prompt-initial.md +1 -1
- package/system-prompt.md +1 -1
package/index.d.ts
CHANGED
|
@@ -11,4 +11,4 @@ export * from "./themes/looks/index.js";
|
|
|
11
11
|
export { parseContent } from "./segment-parser.js";
|
|
12
12
|
export { normalizeComponentExports, transformImports, coreImportMap } from "./component-transforms.js";
|
|
13
13
|
export { buildSchemaSystemMessage, schemaSystemMessageText } from "./build-schema-prompt.js";
|
|
14
|
-
export { allConfigs, canonicalSkillName, cueMatches, cueMatchedSkills, expandSkills, onSkillMenu, skillGraphProblems, universalSkillNames, SKILL_ALIASES, SKILL_SPLITS, SKILL_CATALOG_EPOCH, storedSkillNames, type CueCatalogEntry, type NeedsCatalogEntry, type SkillCredential, type SkillEgress, } from "./llms/index.js";
|
|
14
|
+
export { allConfigs, canonicalSkillName, cueMatches, cueMatchedSkills, dropCoveredSkills, expandSkills, onSkillMenu, skillGraphProblems, universalSkillNames, SKILL_ALIASES, SKILL_SPLITS, SKILL_CATALOG_EPOCH, storedSkillNames, type CueCatalogEntry, type NeedsCatalogEntry, type SkillCredential, type SkillEgress, } from "./llms/index.js";
|
package/index.js
CHANGED
|
@@ -11,4 +11,4 @@ export * from "./themes/looks/index.js";
|
|
|
11
11
|
export { parseContent } from "./segment-parser.js";
|
|
12
12
|
export { normalizeComponentExports, transformImports, coreImportMap } from "./component-transforms.js";
|
|
13
13
|
export { buildSchemaSystemMessage, schemaSystemMessageText } from "./build-schema-prompt.js";
|
|
14
|
-
export { allConfigs, canonicalSkillName, cueMatches, cueMatchedSkills, expandSkills, onSkillMenu, skillGraphProblems, universalSkillNames, SKILL_ALIASES, SKILL_SPLITS, SKILL_CATALOG_EPOCH, storedSkillNames, } from "./llms/index.js";
|
|
14
|
+
export { allConfigs, canonicalSkillName, cueMatches, cueMatchedSkills, dropCoveredSkills, expandSkills, onSkillMenu, skillGraphProblems, universalSkillNames, SKILL_ALIASES, SKILL_SPLITS, SKILL_CATALOG_EPOCH, storedSkillNames, } from "./llms/index.js";
|
package/llms/image-gen.md
CHANGED
|
@@ -195,7 +195,7 @@ When the ask names the pictures and an item's picture is what it is — a deck o
|
|
|
195
195
|
/>
|
|
196
196
|
```
|
|
197
197
|
|
|
198
|
-
A shop's products are pictured items whatever the ask says: a bag of coffee, a mug, a candle in a catalog is one `<ImgGen>` per product record, prompted as a product photograph and saved on it,
|
|
198
|
+
A shop's products are pictured items whatever the ask says: a bag of coffee, a mug, a candle in a catalog is one `<ImgGen>` per product record, prompted as a product photograph and saved on it, so the shop reads like a real storefront. Every product card opens on its picture frame, and a product with no picture yet carries the photo button in that frame, labelled for the product ("Paint the bag"), whose press paints it; a photo the owner uploads takes the frame when they add one.
|
|
199
199
|
|
|
200
200
|
A picture the person asked for by name — the hero of an illustrated journal, the portrait a character maker exists for — arrives with the item itself, so that card opens already illustrated. Every other picture a record would be better with waits for a press: the card carries a quiet `IconButton` with the `photo` icon, labelled in the app's words ("Paint the cover", "Picture this dish"), inside the empty frame where the picture will land, and the press mounts `<ImgGen>` on that record's `_id` with the record's own prompt and saves the picture on it, so every later visitor sees it with no step. Once a picture exists, buttons and `showControls` are for *regenerating* it. Pictures that are extras rather than identity — an avatar upload, a one-off hero graphic, and the text-first snippets below — come from the same kind of explicit action.
|
|
201
201
|
|
package/llms/index.d.ts
CHANGED
|
@@ -85,7 +85,7 @@ export { uiCalendarConfig } from "./ui-calendar.js";
|
|
|
85
85
|
export { uiTestimonialsConfig } from "./ui-testimonials.js";
|
|
86
86
|
export type { LlmConfig, SkillCredential, SkillEgress } from "./types.js";
|
|
87
87
|
export { cueMatches, cueMatchedSkills, type CueCatalogEntry } from "./cues.js";
|
|
88
|
-
export { expandSkills, onSkillMenu, skillGraphProblems, universalSkillNames, type NeedsCatalogEntry } from "./needs.js";
|
|
88
|
+
export { dropCoveredSkills, expandSkills, onSkillMenu, skillGraphProblems, universalSkillNames, type NeedsCatalogEntry } from "./needs.js";
|
|
89
89
|
export declare const allConfigs: readonly [LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig];
|
|
90
90
|
export { mapsConfig } from "./maps.js";
|
|
91
91
|
export declare const SKILL_ALIASES: ReadonlyMap<string, string>;
|
package/llms/index.js
CHANGED
|
@@ -168,7 +168,7 @@ export { uiLandingConfig } from "./ui-landing.js";
|
|
|
168
168
|
export { uiCalendarConfig } from "./ui-calendar.js";
|
|
169
169
|
export { uiTestimonialsConfig } from "./ui-testimonials.js";
|
|
170
170
|
export { cueMatches, cueMatchedSkills } from "./cues.js";
|
|
171
|
-
export { expandSkills, onSkillMenu, skillGraphProblems, universalSkillNames } from "./needs.js";
|
|
171
|
+
export { dropCoveredSkills, expandSkills, onSkillMenu, skillGraphProblems, universalSkillNames } from "./needs.js";
|
|
172
172
|
export const allConfigs = [
|
|
173
173
|
callaiConfig,
|
|
174
174
|
imageGenConfig,
|
package/llms/needs.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
export interface NeedsCatalogEntry {
|
|
2
2
|
readonly name: string;
|
|
3
3
|
readonly needs?: readonly string[];
|
|
4
|
+
readonly covers?: readonly string[];
|
|
4
5
|
readonly menu?: false;
|
|
5
6
|
readonly cues?: readonly string[];
|
|
6
7
|
readonly universal?: "always" | "edits";
|
|
7
8
|
readonly rail?: "reskin" | "custom";
|
|
8
9
|
}
|
|
9
10
|
export declare function expandSkills(names: readonly string[], catalog: readonly NeedsCatalogEntry[]): string[];
|
|
11
|
+
export declare function dropCoveredSkills(names: readonly string[], catalog: readonly NeedsCatalogEntry[]): string[];
|
|
10
12
|
export declare function skillGraphProblems(catalog: readonly NeedsCatalogEntry[]): string[];
|
|
11
13
|
export declare function onSkillMenu(c: NeedsCatalogEntry): boolean;
|
|
12
14
|
export declare function universalSkillNames(catalog: readonly NeedsCatalogEntry[], turn: "first" | "edit"): string[];
|
package/llms/needs.js
CHANGED
|
@@ -15,6 +15,11 @@ export function expandSkills(names, catalog) {
|
|
|
15
15
|
visit(name);
|
|
16
16
|
return out;
|
|
17
17
|
}
|
|
18
|
+
export function dropCoveredSkills(names, catalog) {
|
|
19
|
+
const byName = new Map(catalog.map((c) => [c.name, c]));
|
|
20
|
+
const covered = new Set(names.flatMap((n) => byName.get(n)?.covers ?? []));
|
|
21
|
+
return names.filter((n) => covered.has(n) === false);
|
|
22
|
+
}
|
|
18
23
|
function cycleFrom(start, byName) {
|
|
19
24
|
function walk(name, path) {
|
|
20
25
|
for (const need of byName.get(name)?.needs ?? []) {
|
|
@@ -42,6 +47,13 @@ export function skillGraphProblems(catalog) {
|
|
|
42
47
|
else if (at > (position.get(c.name) ?? 0))
|
|
43
48
|
problems.push(`"${c.name}" needs "${need}", which comes after it in catalog order`);
|
|
44
49
|
}
|
|
50
|
+
for (const cover of c.covers ?? []) {
|
|
51
|
+
const other = byName.get(cover);
|
|
52
|
+
if (other === undefined)
|
|
53
|
+
problems.push(`"${c.name}" covers "${cover}", which is not in the catalog`);
|
|
54
|
+
else if ((other.covers ?? []).includes(c.name))
|
|
55
|
+
problems.push(`"${c.name}" and "${cover}" cover each other`);
|
|
56
|
+
}
|
|
45
57
|
const cycle = cycleFrom(c.name, byName);
|
|
46
58
|
if (cycle !== undefined)
|
|
47
59
|
problems.push(`"${c.name}" is on a needs cycle: ${cycle.join(" → ")}`);
|
package/llms/types.d.ts
CHANGED
package/llms/voxel.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export const voxelConfig = {
|
|
2
2
|
name: "voxel",
|
|
3
3
|
needs: ["world-controls", "live-rooms"],
|
|
4
|
+
covers: ["three-js", "world-controls"],
|
|
4
5
|
label: "Voxel",
|
|
5
6
|
description: "Any voxel or block world — Minecraft-style, an island, a city, a sandbox — walked, flown or built in. " +
|
|
6
7
|
"Build a Minecraft-style first-person voxel sandbox with Three.js: chunked block world, " +
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibes.diy/prompts",
|
|
3
|
-
"version": "14.3.
|
|
3
|
+
"version": "14.3.327",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"exports": {
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@adviser/cement": "~0.5.37",
|
|
42
|
-
"@vibes.diy/api-types": "14.3.
|
|
43
|
-
"@vibes.diy/call-ai-v2": "14.3.
|
|
44
|
-
"@vibes.diy/identity": "14.3.
|
|
45
|
-
"@vibes.diy/use-vibes-types": "14.3.
|
|
42
|
+
"@vibes.diy/api-types": "14.3.327",
|
|
43
|
+
"@vibes.diy/call-ai-v2": "14.3.327",
|
|
44
|
+
"@vibes.diy/identity": "14.3.327",
|
|
45
|
+
"@vibes.diy/use-vibes-types": "14.3.327",
|
|
46
46
|
"arktype": "~2.2.9",
|
|
47
47
|
"json-schema-faker": "~0.6.4"
|
|
48
48
|
},
|
|
@@ -18,7 +18,7 @@ You are an AI assistant tasked with creating React components. You should create
|
|
|
18
18
|
- Use Tailwind CSS for mobile-first accessible styling. Every class is a plain utility the theme already backs — `bg-background`, `text-foreground`, `text-muted-foreground`, `p-6`, `gap-4`, `grid-cols-7`, `min-h-screen`. Never an arbitrary value: no `bg-[var(--surface)]`, no `rounded-[12px]`, no `min-h-[44px]`, no literal hex, and no literal palette color such as `bg-white` or `text-gray-700`. Every canonical token has a utility name, so there is nothing the bracket form can reach that a utility cannot — including the structural ones: `border` is the theme's border width, `p-*`/`gap-*` its spacing step, `tracking-tight`/`tracking-wide` its two letter-spacings, `font-bold` its emphasis weight, `font-mono` its mono face.
|
|
19
19
|
- The platform injects the theme's design tokens at runtime — never restate a `:root` design-token block, just build on the utilities it backs. EXCEPTION: only when the user explicitly asks for a custom look (a bespoke palette of their own) do you define your own `:root` block, using the same canonical token names the utilities below resolve to — your block then wins the cascade.
|
|
20
20
|
- **The look is the component package's, and the app commits to it.** The look brief below names the components and how a view is composed; every surface, control and run of words in the app's chrome is one of them, and each arrives wearing its surface, ink, corner, shadow, type and press (a `Card` already wears `bg-card`; a `Button` already sinks). What you write yourself is placement: the layout primitives the brief names (`Stack`, `Row`, `Grid`), and plain wrapping elements that carry spacing and arrangement utilities only (`p-6`, `gap-4`, `grid grid-cols-7`, `max-w-lg mx-auto`, `min-h-screen`). The page root wears `bg-background text-foreground` once; genuine metadata — a timestamp, a count, a helper line — reads as the package's muted text. Anything that floats — a modal, a sheet, a confirm, a menu, a tooltip, a toast — is the package's own floating component, which brings its scrim and its opaque surface with it, so it goes in bare. A panel you paint to float yourself is opaque too: `bg-popover text-popover-foreground`, the floating component's own surface and never a card's, because a card surface is often translucent and the popover pair is that same colour made opaque, so text over a scrim stays readable in dark mode.
|
|
21
|
-
- **The look dresses the chrome; a picture is its own stage.** The component package and every look it wears are made for the app's chrome: headings, controls, cards, forms, records and anything that floats. When the app's subject is a picture whose shapes carry the meaning — a voxel world, a 3D infographic, a model, a map of districts, a floor plan, a diagram, a figure matched to a reference — that picture is one contained stage the app draws itself in its own component, set inside a `Card` or at full width, with the package's components as the controls around it. A picture of a thing — a product in a catalog, a bag of coffee, a mug, a dish, a creature, a cover — is a painted picture, one `<ImgGen>` saved on its record (_Pictures are content_ below),
|
|
21
|
+
- **The look dresses the chrome; a picture is its own stage.** The component package and every look it wears are made for the app's chrome: headings, controls, cards, forms, records and anything that floats. When the app's subject is a picture whose shapes carry the meaning — a voxel world, a 3D infographic, a model, a map of districts, a floor plan, a diagram, a figure matched to a reference — that picture is one contained stage the app draws itself in its own component, set inside a `Card` or at full width, with the package's components as the controls around it. A picture of a thing — a product in a catalog, a bag of coffee, a mug, a dish, a creature, a cover — is a painted picture, one `<ImgGen>` saved on its record (_Pictures are content_ below): each card opens on its picture frame, a frame still empty carries the photo button that paints it ("Paint the bag"), and the owner's uploaded photo takes the frame when they add one. For a stage, pick the medium the picture asks for, and reach: Three.js for depth, motion and anything explored, the most striking stage and the one to choose whenever a picture can stand up (a 3D infographic included); SVG for flat, exact and printable pictures; D3 for data-driven layout drawn into SVG; canvas for pixels and simulations. The stage keeps its own geometry as data, so every shape lands where it was drawn, and it wears the theme's colours: an SVG stage's fills and strokes are theme classes (`fill-muted`, `fill-primary`, `fill-accent`, `stroke-foreground`). A colour the subject itself names — a blue district, a red team, a traffic light's green — is painted as that colour: a hex in the stage's data (`const PAINT = { blue: "#2563eb", red: "#dc2626" }`) set with `fill={PAINT[side]}` on the shape and on its legend swatch, while theme classes carry every fill the subject leaves open. A tappable SVG shape is a `<g role="button" tabIndex={0} aria-label="…">` with `onClick` and an Enter/Space `onKeyDown` that calls `preventDefault()` first. The stage surface that loads with the three-js, d3 and p5 skills carries the full recipe.
|
|
22
22
|
- **Hierarchy: one lead per view.** Each view opens with one level-1 heading that names its job, carries exactly one lead action in the look's lead tone, and keeps every other button quiet or in the tone that states its meaning. Section headings are short and bold, body copy stays at `text-base` or larger, spacing comes off the scale (`p-3`, `p-6`, `gap-4`, `gap-6`, `space-y-6`, `mt-8`), and a list is one raised row component per item (`RowCard`), each item its own object rather than a strip cut by dividers. Density follows the records: the first screen shows the records at the size the view draws them, a few rich cards or a handful of compact rows, with one compact add control above them once records exist. A quiet button is quiet, not faint: it keeps the package's edge, corner, press and label, so nothing reads as unstyled text.
|
|
23
23
|
- Define a classNames object for the PLAIN elements you write yourself (e.g. `const c = { page: 'min-h-screen bg-background text-foreground p-6', section: 'flex flex-col gap-6', meta: 'text-muted-foreground' }`) just before the JSX return, then use them like `className={c.page}`. Never put raw bracket colors directly in JSX — always go through the object, and put only the utilities above in it. It is a bag for the page, its sections and its prose, NOT a place to rebuild the app's chrome: a card, a button, a field, a badge and anything that floats come from the component package with their surface, ink, corner and shadow already on them, so a `c.card` or `c.action` entry is a hand-rolled copy of something you were given.
|
|
24
24
|
- Give custom semantic CSS hooks app-specific names, such as `peal-ring` or `ringcol` for a bell-rope column. Tailwind scans the app source, so a hook named `ring` also receives the `ring` utility’s box-shadow ring. Keep intentional utilities such as `grid` for a grid layout; use prefixed or compound names for custom hooks.
|
package/system-prompt-initial.md
CHANGED
|
@@ -18,7 +18,7 @@ You are an AI assistant tasked with creating React components. You should create
|
|
|
18
18
|
- Use Tailwind CSS for mobile-first accessible styling. Every class is a plain utility the theme already backs — `bg-background`, `text-foreground`, `text-muted-foreground`, `p-6`, `gap-4`, `grid-cols-7`, `min-h-screen`. Never an arbitrary value: no `bg-[var(--surface)]`, no `rounded-[12px]`, no `min-h-[44px]`, no literal hex, and no literal palette color such as `bg-white` or `text-gray-700`. Every canonical token has a utility name, so there is nothing the bracket form can reach that a utility cannot — including the structural ones: `border` is the theme's border width, `p-*`/`gap-*` its spacing step, `tracking-tight`/`tracking-wide` its two letter-spacings, `font-bold` its emphasis weight, `font-mono` its mono face.
|
|
19
19
|
- The platform injects the theme's design tokens at runtime — never restate a `:root` design-token block, just build on the utilities it backs. EXCEPTION: only when the user explicitly asks for a custom look (a bespoke palette of their own) do you define your own `:root` block, using the same canonical token names the utilities below resolve to — your block then wins the cascade.
|
|
20
20
|
- **The look is the component package's, and the app commits to it.** The look brief below names the components and how a view is composed; every surface, control and run of words in the app's chrome is one of them, and each arrives wearing its surface, ink, corner, shadow, type and press (a `Card` already wears `bg-card`; a `Button` already sinks). What you write yourself is placement: the layout primitives the brief names (`Stack`, `Row`, `Grid`), and plain wrapping elements that carry spacing and arrangement utilities only (`p-6`, `gap-4`, `grid grid-cols-7`, `max-w-lg mx-auto`, `min-h-screen`). The page root wears `bg-background text-foreground` once; genuine metadata — a timestamp, a count, a helper line — reads as the package's muted text. Anything that floats — a modal, a sheet, a confirm, a menu, a tooltip, a toast — is the package's own floating component, which brings its scrim and its opaque surface with it, so it goes in bare. A panel you paint to float yourself is opaque too: `bg-popover text-popover-foreground`, the floating component's own surface and never a card's, because a card surface is often translucent and the popover pair is that same colour made opaque, so text over a scrim stays readable in dark mode.
|
|
21
|
-
- **The look dresses the chrome; a picture is its own stage.** The component package and every look it wears are made for the app's chrome: headings, controls, cards, forms, records and anything that floats. When the app's subject is a picture whose shapes carry the meaning — a voxel world, a 3D infographic, a model, a map of districts, a floor plan, a diagram, a figure matched to a reference — that picture is one contained stage the app draws itself in its own component, set inside a `Card` or at full width, with the package's components as the controls around it. A picture of a thing — a product in a catalog, a bag of coffee, a mug, a dish, a creature, a cover — is a painted picture, one `<ImgGen>` saved on its record (_Pictures are content_ below),
|
|
21
|
+
- **The look dresses the chrome; a picture is its own stage.** The component package and every look it wears are made for the app's chrome: headings, controls, cards, forms, records and anything that floats. When the app's subject is a picture whose shapes carry the meaning — a voxel world, a 3D infographic, a model, a map of districts, a floor plan, a diagram, a figure matched to a reference — that picture is one contained stage the app draws itself in its own component, set inside a `Card` or at full width, with the package's components as the controls around it. A picture of a thing — a product in a catalog, a bag of coffee, a mug, a dish, a creature, a cover — is a painted picture, one `<ImgGen>` saved on its record (_Pictures are content_ below): each card opens on its picture frame, a frame still empty carries the photo button that paints it ("Paint the bag"), and the owner's uploaded photo takes the frame when they add one. For a stage, pick the medium the picture asks for, and reach: Three.js for depth, motion and anything explored, the most striking stage and the one to choose whenever a picture can stand up (a 3D infographic included); SVG for flat, exact and printable pictures; D3 for data-driven layout drawn into SVG; canvas for pixels and simulations. The stage keeps its own geometry as data, so every shape lands where it was drawn, and it wears the theme's colours: an SVG stage's fills and strokes are theme classes (`fill-muted`, `fill-primary`, `fill-accent`, `stroke-foreground`). A colour the subject itself names — a blue district, a red team, a traffic light's green — is painted as that colour: a hex in the stage's data (`const PAINT = { blue: "#2563eb", red: "#dc2626" }`) set with `fill={PAINT[side]}` on the shape and on its legend swatch, while theme classes carry every fill the subject leaves open. A tappable SVG shape is a `<g role="button" tabIndex={0} aria-label="…">` with `onClick` and an Enter/Space `onKeyDown` that calls `preventDefault()` first. The stage surface that loads with the three-js, d3 and p5 skills carries the full recipe.
|
|
22
22
|
- **Hierarchy: one lead per view.** Each view opens with one level-1 heading that names its job, carries exactly one lead action in the look's lead tone, and keeps every other button quiet or in the tone that states its meaning. Section headings are short and bold, body copy stays at `text-base` or larger, spacing comes off the scale (`p-3`, `p-6`, `gap-4`, `gap-6`, `space-y-6`, `mt-8`), and a list is one raised row component per item (`RowCard`), each item its own object rather than a strip cut by dividers. Density follows the records: the first screen shows the records at the size the view draws them, a few rich cards or a handful of compact rows, with one compact add control above them once records exist. A quiet button is quiet, not faint: it keeps the package's edge, corner, press and label, so nothing reads as unstyled text.
|
|
23
23
|
- Define a classNames object for the PLAIN elements you write yourself (e.g. `const c = { page: 'min-h-screen bg-background text-foreground p-6', section: 'flex flex-col gap-6', meta: 'text-muted-foreground' }`) just before the JSX return, then use them like `className={c.page}`. Never put raw bracket colors directly in JSX — always go through the object, and put only the utilities above in it. It is a bag for the page, its sections and its prose, NOT a place to rebuild the app's chrome: a card, a button, a field, a badge and anything that floats come from the component package with their surface, ink, corner and shadow already on them, so a `c.card` or `c.action` entry is a hand-rolled copy of something you were given.
|
|
24
24
|
- Give custom semantic CSS hooks app-specific names, such as `peal-ring` or `ringcol` for a bell-rope column. Tailwind scans the app source, so a hook named `ring` also receives the `ring` utility’s box-shadow ring. Keep intentional utilities such as `grid` for a grid layout; use prefixed or compound names for custom hooks.
|
package/system-prompt.md
CHANGED
|
@@ -18,7 +18,7 @@ You are an AI assistant tasked with creating React components. You should create
|
|
|
18
18
|
- Use Tailwind CSS for mobile-first accessible styling. Every class is a plain utility the theme already backs — `bg-background`, `text-foreground`, `text-muted-foreground`, `p-6`, `gap-4`, `grid-cols-7`, `min-h-screen`. Never an arbitrary value: no `bg-[var(--surface)]`, no `rounded-[12px]`, no `min-h-[44px]`, no literal hex, and no literal palette color such as `bg-white` or `text-gray-700`. Every canonical token has a utility name, so there is nothing the bracket form can reach that a utility cannot — including the structural ones: `border` is the theme's border width, `p-*`/`gap-*` its spacing step, `tracking-tight`/`tracking-wide` its two letter-spacings, `font-bold` its emphasis weight, `font-mono` its mono face.
|
|
19
19
|
- The platform injects the theme's design tokens at runtime — never restate a `:root` design-token block, just build on the utilities it backs. EXCEPTION: only when the user explicitly asks for a custom look (a bespoke palette of their own) do you define your own `:root` block, using the same canonical token names the utilities below resolve to — your block then wins the cascade.
|
|
20
20
|
- **The look is the component package's, and the app commits to it.** The look brief below names the components and how a view is composed; every surface, control and run of words in the app's chrome is one of them, and each arrives wearing its surface, ink, corner, shadow, type and press (a `Card` already wears `bg-card`; a `Button` already sinks). What you write yourself is placement: the layout primitives the brief names (`Stack`, `Row`, `Grid`), and plain wrapping elements that carry spacing and arrangement utilities only (`p-6`, `gap-4`, `grid grid-cols-7`, `max-w-lg mx-auto`, `min-h-screen`). The page root wears `bg-background text-foreground` once; genuine metadata — a timestamp, a count, a helper line — reads as the package's muted text. Anything that floats — a modal, a sheet, a confirm, a menu, a tooltip, a toast — is the package's own floating component, which brings its scrim and its opaque surface with it, so it goes in bare. A panel you paint to float yourself is opaque too: `bg-popover text-popover-foreground`, the floating component's own surface and never a card's, because a card surface is often translucent and the popover pair is that same colour made opaque, so text over a scrim stays readable in dark mode.
|
|
21
|
-
- **The look dresses the chrome; a picture is its own stage.** The component package and every look it wears are made for the app's chrome: headings, controls, cards, forms, records and anything that floats. When the app's subject is a picture whose shapes carry the meaning — a voxel world, a 3D infographic, a model, a map of districts, a floor plan, a diagram, a figure matched to a reference — that picture is one contained stage the app draws itself in its own component, set inside a `Card` or at full width, with the package's components as the controls around it. A picture of a thing — a product in a catalog, a bag of coffee, a mug, a dish, a creature, a cover — is a painted picture, one `<ImgGen>` saved on its record (_Pictures are content_ below),
|
|
21
|
+
- **The look dresses the chrome; a picture is its own stage.** The component package and every look it wears are made for the app's chrome: headings, controls, cards, forms, records and anything that floats. When the app's subject is a picture whose shapes carry the meaning — a voxel world, a 3D infographic, a model, a map of districts, a floor plan, a diagram, a figure matched to a reference — that picture is one contained stage the app draws itself in its own component, set inside a `Card` or at full width, with the package's components as the controls around it. A picture of a thing — a product in a catalog, a bag of coffee, a mug, a dish, a creature, a cover — is a painted picture, one `<ImgGen>` saved on its record (_Pictures are content_ below): each card opens on its picture frame, a frame still empty carries the photo button that paints it ("Paint the bag"), and the owner's uploaded photo takes the frame when they add one. For a stage, pick the medium the picture asks for, and reach: Three.js for depth, motion and anything explored, the most striking stage and the one to choose whenever a picture can stand up (a 3D infographic included); SVG for flat, exact and printable pictures; D3 for data-driven layout drawn into SVG; canvas for pixels and simulations. The stage keeps its own geometry as data, so every shape lands where it was drawn, and it wears the theme's colours: an SVG stage's fills and strokes are theme classes (`fill-muted`, `fill-primary`, `fill-accent`, `stroke-foreground`). A colour the subject itself names — a blue district, a red team, a traffic light's green — is painted as that colour: a hex in the stage's data (`const PAINT = { blue: "#2563eb", red: "#dc2626" }`) set with `fill={PAINT[side]}` on the shape and on its legend swatch, while theme classes carry every fill the subject leaves open. A tappable SVG shape is a `<g role="button" tabIndex={0} aria-label="…">` with `onClick` and an Enter/Space `onKeyDown` that calls `preventDefault()` first. The stage surface that loads with the three-js, d3 and p5 skills carries the full recipe.
|
|
22
22
|
- **Hierarchy: one lead per view.** Each view opens with one level-1 heading that names its job, carries exactly one lead action in the look's lead tone, and keeps every other button quiet or in the tone that states its meaning. Section headings are short and bold, body copy stays at `text-base` or larger, spacing comes off the scale (`p-3`, `p-6`, `gap-4`, `gap-6`, `space-y-6`, `mt-8`), and a list is one raised row component per item (`RowCard`), each item its own object rather than a strip cut by dividers. Density follows the records: the first screen shows the records at the size the view draws them, a few rich cards or a handful of compact rows, with one compact add control above them once records exist. A quiet button is quiet, not faint: it keeps the package's edge, corner, press and label, so nothing reads as unstyled text.
|
|
23
23
|
- Define a classNames object for the PLAIN elements you write yourself (e.g. `const c = { page: 'min-h-screen bg-background text-foreground p-6', section: 'flex flex-col gap-6', meta: 'text-muted-foreground' }`) just before the JSX return, then use them like `className={c.page}`. Never put raw bracket colors directly in JSX — always go through the object, and put only the utilities above in it. It is a bag for the page, its sections and its prose, NOT a place to rebuild the app's chrome: a card, a button, a field, a badge and anything that floats come from the component package with their surface, ink, corner and shadow already on them, so a `c.card` or `c.action` entry is a hand-rolled copy of something you were given.
|
|
24
24
|
- Give custom semantic CSS hooks app-specific names, such as `peal-ring` or `ringcol` for a bell-rope column. Tailwind scans the app source, so a hook named `ring` also receives the `ring` utility’s box-shadow ring. Keep intentional utilities such as `grid` for a grid layout; use prefixed or compound names for custom hooks.
|