@vibes.diy/prompts 2.2.16-dev.1 → 2.2.16-dev.2
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/llms/use-viewer.md +3 -1
- package/package.json +3 -3
- package/prompts.d.ts +6 -0
- package/prompts.js +20 -1
- package/prompts.js.map +1 -1
- package/settings.d.ts +1 -0
- package/system-prompt-initial.md +44 -27
- package/system-prompt.md +6 -3
package/llms/use-viewer.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# useViewer Hook
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`useViewer()` is a **read-only window** into runtime-managed access control. The platform owns the rules — who's the owner, who has been granted read or write — and `useViewer()` lets your app see what the runtime decided. You cannot grant or revoke access from code; you can only reflect the runtime's verdict in your UI.
|
|
4
|
+
|
|
5
|
+
The contract: **every write surface (form, submit button, edit input, delete button) must consult `can("write")`** and render a read-only fallback when it returns false. This applies even when the app sounds single-user — sharing is the runtime's decision, not the prompt's.
|
|
4
6
|
|
|
5
7
|
## Basic Usage
|
|
6
8
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibes.diy/prompts",
|
|
3
|
-
"version": "2.2.16-dev.
|
|
3
|
+
"version": "2.2.16-dev.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"description": "",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"@fireproof/core-types-base": "~0.24.19",
|
|
31
31
|
"@fireproof/core-types-protocols-cloud": "~0.24.19",
|
|
32
32
|
"@fireproof/use-fireproof": "~0.24.19",
|
|
33
|
-
"@vibes.diy/call-ai-v2": "^2.2.16-dev.
|
|
34
|
-
"@vibes.diy/use-vibes-types": "^2.2.16-dev.
|
|
33
|
+
"@vibes.diy/call-ai-v2": "^2.2.16-dev.2",
|
|
34
|
+
"@vibes.diy/use-vibes-types": "^2.2.16-dev.2",
|
|
35
35
|
"arktype": "~2.2.0",
|
|
36
36
|
"json-schema-faker": "~0.6.1"
|
|
37
37
|
},
|
package/prompts.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export declare function getDefaultSkills(): Promise<string[]>;
|
|
|
12
12
|
export declare function makePreAllocUserMessage(userPrompt: string): Promise<string>;
|
|
13
13
|
export declare const preAllocSchema: {
|
|
14
14
|
readonly name: "pre_alloc";
|
|
15
|
+
readonly required: readonly ["skills", "pairs", "iconDescription", "enrichedPrompt"];
|
|
15
16
|
readonly properties: {
|
|
16
17
|
readonly skills: {
|
|
17
18
|
readonly type: "array";
|
|
@@ -43,6 +44,10 @@ export declare const preAllocSchema: {
|
|
|
43
44
|
readonly type: "string";
|
|
44
45
|
readonly description: "Theme slug from the theme catalog above. Pick the one whose mood best fits the app \u2014 playful apps lean playful themes, focus/utility apps lean clean themes, retro apps lean retro themes, etc. Always pick something rather than leaving empty; the catalog is broad enough to cover most app moods. Only omit if the request is so abstract that every theme would feel arbitrary.";
|
|
45
46
|
};
|
|
47
|
+
readonly enrichedPrompt: {
|
|
48
|
+
readonly type: "string";
|
|
49
|
+
readonly description: string;
|
|
50
|
+
};
|
|
46
51
|
};
|
|
47
52
|
};
|
|
48
53
|
export declare const preAllocParsed: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
@@ -53,6 +58,7 @@ export declare const preAllocParsed: import("arktype/internal/variants/object.ts
|
|
|
53
58
|
}[];
|
|
54
59
|
iconDescription: string;
|
|
55
60
|
theme?: string | undefined;
|
|
61
|
+
enrichedPrompt?: string | undefined;
|
|
56
62
|
}, {}>;
|
|
57
63
|
export type PreAllocParsed = typeof preAllocParsed.infer;
|
|
58
64
|
export interface SystemPromptResult {
|
package/prompts.js
CHANGED
|
@@ -31,6 +31,7 @@ export async function resolveEffectiveModel(settingsDoc, vibeDoc) {
|
|
|
31
31
|
export async function getDefaultSkills() {
|
|
32
32
|
return ["fireproof", "callai", "image-gen", "web-audio"];
|
|
33
33
|
}
|
|
34
|
+
const PRE_ALLOC_PLATFORM_PARAGRAPH = "Platform stack: a vibe is a single-file React app that runs in the user's browser. Fireproof is a peer-replicated document database — `useFireproof(name)` returns a database handle and `useLiveQuery(field)` keeps every viewer's UI in lockstep with the underlying docs in real time, no separate sync layer. callAI is a typed call to a hosted LLM that returns JSON matching a schema the app declares; the JSON is saved as a Fireproof doc so it persists and shows up live for every viewer. useViewer is a read-only window into runtime-managed access control: the platform owns who can read and who can write, and `useViewer().can('write')` lets the app reflect that verdict in its UI without ever setting it. ImgGen renders a generated illustration tile when imagery is naturally part of the experience, not as decoration.";
|
|
34
35
|
export async function makePreAllocUserMessage(userPrompt) {
|
|
35
36
|
const catalog = await getLlmCatalog();
|
|
36
37
|
const catalogText = catalog.map((l) => `- ${l.name}: ${l.description}`).join("\n");
|
|
@@ -38,7 +39,9 @@ export async function makePreAllocUserMessage(userPrompt) {
|
|
|
38
39
|
.map((t) => `- ${t.slug}: ${t.name}${t.bodyFont ? ` (${t.bodyFont.replace(/['"]/g, "").split(",")[0].trim()})` : ""}`)
|
|
39
40
|
.join("\n");
|
|
40
41
|
return [
|
|
41
|
-
|
|
42
|
+
PRE_ALLOC_PLATFORM_PARAGRAPH,
|
|
43
|
+
"",
|
|
44
|
+
"Pick skills from this catalog that fit the user's app request, propose 3 title/slug pairs for naming, propose a one-line icon subject, pick a theme that matches the app's mood, and write a 3-sentence enriched-prompt preamble that grounds the build in our core platform features for THIS specific app.",
|
|
42
45
|
"",
|
|
43
46
|
"Skill catalog:",
|
|
44
47
|
catalogText,
|
|
@@ -52,6 +55,7 @@ export async function makePreAllocUserMessage(userPrompt) {
|
|
|
52
55
|
}
|
|
53
56
|
export const preAllocSchema = {
|
|
54
57
|
name: "pre_alloc",
|
|
58
|
+
required: ["skills", "pairs", "iconDescription", "enrichedPrompt"],
|
|
55
59
|
properties: {
|
|
56
60
|
skills: {
|
|
57
61
|
type: "array",
|
|
@@ -77,6 +81,17 @@ export const preAllocSchema = {
|
|
|
77
81
|
type: "string",
|
|
78
82
|
description: "Theme slug from the theme catalog above. Pick the one whose mood best fits the app — playful apps lean playful themes, focus/utility apps lean clean themes, retro apps lean retro themes, etc. Always pick something rather than leaving empty; the catalog is broad enough to cover most app moods. Only omit if the request is so abstract that every theme would feel arbitrary.",
|
|
79
83
|
},
|
|
84
|
+
enrichedPrompt: {
|
|
85
|
+
type: "string",
|
|
86
|
+
description: [
|
|
87
|
+
"REQUIRED. A 3-sentence preamble grounding THIS app in our platform — dense narrative, no padding, no flourishes.",
|
|
88
|
+
"Sentence 1: what users see and do in this app, and that Fireproof's live sync shares the activity with every viewer in real time.",
|
|
89
|
+
"Sentence 2: name the callAI role that fits this app's central activity. Common roles to pick from: (a) AI-suggest / autofill for form fields — the user taps a button next to an input and callAI returns an example value drawn from the app's domain, ready to accept or edit; (b) critique or extend user-authored content — callAI scores, rewrites, summarizes, or proposes the next thing (next line of a poem, follow-up task, related recipe); (c) categorize, tag, or score content on save — sentiment, topical tags, priority. Pick ONE role that genuinely fits this app. Name the user action that triggers the call and what kind of structured response comes back.",
|
|
90
|
+
"Sentence 3: name the write actions in this app, and that non-owners see a read-only view because the runtime's access control hides the write surfaces — useViewer reflects that verdict, the app never sets it. If generated imagery is naturally part of the app's domain, add a brief clause naming what an ImgGen tile depicts.",
|
|
91
|
+
'Do NOT include code: no function names like `useLiveQuery` or `database.put`, no doc-shape objects in braces, no `can("write")` syntax, no backtick-quoted field names. Plain narrative, not a code spec.',
|
|
92
|
+
"Do NOT invent imagery features when the app's domain wouldn't naturally include them.",
|
|
93
|
+
].join(" "),
|
|
94
|
+
},
|
|
80
95
|
},
|
|
81
96
|
};
|
|
82
97
|
export const preAllocParsed = type({
|
|
@@ -84,6 +99,7 @@ export const preAllocParsed = type({
|
|
|
84
99
|
pairs: type({ title: "string", slug: "string" }).array(),
|
|
85
100
|
iconDescription: "string",
|
|
86
101
|
"theme?": "string",
|
|
102
|
+
"enrichedPrompt?": "string",
|
|
87
103
|
});
|
|
88
104
|
export function generateImportStatements(llms) {
|
|
89
105
|
const seen = new Set();
|
|
@@ -175,6 +191,8 @@ export async function makeBaseSystemPrompt(model, sessionDoc) {
|
|
|
175
191
|
? `The app is called "${sessionDoc.title}". Use this exact name in the app's heading and anywhere the app refers to itself.\n\n`
|
|
176
192
|
: "";
|
|
177
193
|
const userPromptSection = userPrompt ? `${userPrompt}\n\n` : "";
|
|
194
|
+
const enrichedPromptRaw = typeof sessionDoc?.enrichedPrompt === "string" ? sessionDoc.enrichedPrompt.trim() : "";
|
|
195
|
+
const enrichedPromptSection = enrichedPromptRaw ? `<app-workflow>\n${enrichedPromptRaw}\n</app-workflow>\n\n` : "";
|
|
178
196
|
const importStatements = `import React from "react"${generateImportStatements(chosenLlms)}`;
|
|
179
197
|
const templateFilename = sessionDoc?.variant === "initial" ? "system-prompt-initial.md" : "system-prompt.md";
|
|
180
198
|
const template = await getSystemPromptTemplate(pkgBaseUrl, templateFilename, sessionDoc.fetch);
|
|
@@ -184,6 +202,7 @@ export async function makeBaseSystemPrompt(model, sessionDoc) {
|
|
|
184
202
|
.replaceAll("{{CONCATENATED_LLMS}}", concatenatedLlmsTxt)
|
|
185
203
|
.replaceAll("{{THEME_DESIGN}}", themeDesignSection)
|
|
186
204
|
.replaceAll("{{TITLE_SECTION}}", titleSection)
|
|
205
|
+
.replaceAll("{{ENRICHED_PROMPT}}", enrichedPromptSection)
|
|
187
206
|
.replaceAll("{{USER_PROMPT}}", userPromptSection)
|
|
188
207
|
.replaceAll("{{IMPORT_STATEMENTS}}", importStatements);
|
|
189
208
|
return {
|
package/prompts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../jsr/prompts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAmB,MAAM,gBAAgB,CAAC;AACpF,OA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AAC,IAAI,CAAC,KAAK,IAAI,EAAE;QAC3D,OAAO,SAAS,CAAC,UAAU,IAAI,KAAK,EAAE;YACpC,WAAW,EAAE,oBAAoB;YACjC,QAAQ,EAAE,GAAG,EAAE,CAAC,OAAO,IAAI,CAAC,GAAG;SAChC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,IAAI,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC;QAClB,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC;IACrC,CAAC;IACD,OAAO,KAAK,CAAC,EAAE,EAAE,CAAC;AACpB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,IAAY;IAC7C,MAAM,KAAK,GAAG,MAAM,cAAc,CAAC,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE;QACtE,OAAO,SAAS,CAAC,YAAY,IAAI,KAAK,EAAE;YACtC,WAAW,EAAE,oBAAoB;YACjC,QAAQ,EAAE,GAAG,EAAE,CAAC,OAAO,IAAI,CAAC,GAAG;SAChC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,IAAI,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC;QAClB,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC;IACrC,CAAC;IACD,OAAO,KAAK,CAAC,EAAE,EAAE,CAAC;AACpB,CAAC"}
|
package/settings.d.ts
CHANGED
package/system-prompt-initial.md
CHANGED
|
@@ -14,7 +14,7 @@ You are an AI assistant tasked with creating React components. You should create
|
|
|
14
14
|
- Use `callAI` to fetch AI, use schema like this: `JSON.parse(await callAI(prompt, { schema: { properties: { todos: { type: 'array', items: { type: 'string' } } } } }))` and save final responses as individual Fireproof documents.
|
|
15
15
|
- Always show loading states during any async operation (callAI, fetch, database queries): use a useState boolean (e.g. `isLoading`), set it true before the call and false in .finally(). While loading: (1) disable the trigger button with `disabled={isLoading}`, (2) replace the button text with a spinning SVG icon using CSS animation `animate-spin` (a simple circle with a gap), (3) optionally show a short status text like 'Loading...' near the button. Never leave the user clicking a button with no visual feedback. Pattern: `setIsLoading(true); try { await callAI(...); } finally { setIsLoading(false); }`
|
|
16
16
|
- For file uploads use drag and drop and store using the `doc._files` API; for AI image generation use `<ImgGen prompt="..." />`
|
|
17
|
-
-
|
|
17
|
+
- Access control (who can read, who can write) is decided by the runtime, not by your code. `useViewer()` is the app's read-only window into that decision — call `const { viewer, can } = useViewer();` from `"use-vibes"`. `viewer` is `{ userSlug, displayName?, avatarUrl } | null` (null for anonymous). `can("write")` returns the runtime's verdict; you cannot grant or override it. Your only job is to reflect that verdict in the UI: **every write surface (form, submit button, edit input, delete button) must be wrapped in `can("write")` — show it only when true, render a read-only state otherwise.** Pattern: `if (!can("write")) return <p>Read-only view — contact the owner for write access.</p>;` Render avatars with `<img src={viewer.avatarUrl} />` (opaque URL — use directly). For multi-db apps pass the dbName: `can("write", "comments")`. This applies to every app — never skip useViewer because the app "sounds single-user"; the runtime decides sharing, not the prompt. See use-viewer docs.
|
|
18
18
|
- Don't try to generate png or base64 data, use placeholder image APIs instead, like https://picsum.photos/400 where 400 is the square size
|
|
19
19
|
- Never use emojis in the UI. Use inline SVG icons instead — simple, single-color, stroke-based SVGs (24x24 viewBox, strokeWidth 2, strokeLinecap round, strokeLinejoin round). Build icons directly in JSX, do not import icon libraries.
|
|
20
20
|
- List data items on the main page of your app so users don't have to hunt for them
|
|
@@ -23,69 +23,86 @@ You are an AI assistant tasked with creating React components. You should create
|
|
|
23
23
|
|
|
24
24
|
{{CONCATENATED_LLMS}}
|
|
25
25
|
{{THEME_DESIGN}}
|
|
26
|
-
{{TITLE_SECTION}}{{USER_PROMPT}}IMPORTANT: You are working in one JavaScript file (`App.jsx`). This is the **first turn** — `App.jsx` does not exist yet. You'll
|
|
26
|
+
{{TITLE_SECTION}}{{ENRICHED_PROMPT}}{{USER_PROMPT}}IMPORTANT: You are working in one JavaScript file (`App.jsx`). This is the **first turn** — `App.jsx` does not exist yet. You'll paint a colored shell once, then grow each feature into it through small fill-then-wire passes the user watches land in the preview.
|
|
27
27
|
|
|
28
28
|
Before writing code, provide a title and brief description of the app. Then list the top 3 features that are the best fit for a mobile web database with real-time collaboration and describe a short planned workflow showing how those features connect into a coherent user experience.
|
|
29
29
|
|
|
30
|
-
## Output format (one
|
|
30
|
+
## Output format (one colored shell + 4–6 feature passes)
|
|
31
31
|
|
|
32
32
|
Every code block must be preceded by the file name on its own line. The file is `App.jsx`.
|
|
33
33
|
|
|
34
|
-
**Step 1 —
|
|
34
|
+
**Step 1 — Colored shell (one full-file `create` block).** Emit a single fenced ```jsx block containing the full initial file. No SEARCH/REPLACE markers, no `=======`, no `>>>>>>> REPLACE`—`App.jsx` doesn't exist yet.
|
|
35
35
|
|
|
36
|
-
**
|
|
36
|
+
**The shell must paint colored shape on the first render.** It contains:
|
|
37
|
+
|
|
38
|
+
- Imports.
|
|
39
|
+
- A full `classNames` / `c` object with **real Tailwind colors filled in** — page background, header colors, section frames, button styles. Final-ish colors, not placeholders.
|
|
40
|
+
- The `<header>` with the real brand title (and any always-visible top chrome).
|
|
41
|
+
- One empty `<section id="…">` shell per planned feature inside `<main>` — stable ids, real chrome, no content yet. Each shell looks like:
|
|
42
|
+
|
|
43
|
+
```jsx
|
|
44
|
+
<section id="feature-id" className={c.section}>
|
|
45
|
+
<h2>{/* feature-name pass */}</h2>
|
|
46
|
+
</section>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Target ~40–60 lines total.
|
|
50
|
+
|
|
51
|
+
**Step 2 — Fill-then-wire feature passes.** After the shell, emit **4–6 SEARCH/REPLACE pairs**, each preceded by **exactly one line of prose** (≤25 words) saying what just landed. The user watches the colored shell paint, then each feature grows into it: structure first (so the layout fills in visibly), then wiring (so it starts working). For each feature, do these two passes back-to-back before moving to the next feature:
|
|
52
|
+
|
|
53
|
+
1. **Fill pass** — replace one empty `<section id="feature-id">…</section>` with the section's real structure: heading, form fields, list rows, button placements, static placeholder copy ("Add a task", a couple of example rows). No hooks, no callAI, no live data yet.
|
|
54
|
+
2. **Wire pass** — replace the now-filled section with the same section plus hooks (`useState`, `useFireproof`, `useLiveQuery`), `callAI` if the feature uses it, and `isLoading` flags around async calls. Placeholders become controlled inputs and live data.
|
|
55
|
+
|
|
56
|
+
For an app with 2 features → 4 passes total. With 3 features → 6 passes total. If a feature is trivial (display-only, no async, no input) you may collapse its two passes into one combined fill-and-wire pass — but only when there's truly nothing to wire.
|
|
37
57
|
|
|
38
58
|
The cadence is:
|
|
39
59
|
|
|
40
|
-
> _prose line
|
|
60
|
+
> _prose line — what the fill pass adds_
|
|
41
61
|
>
|
|
42
62
|
> ```jsx
|
|
43
63
|
> <<<<<<< SEARCH
|
|
44
|
-
> ...
|
|
64
|
+
> ...empty <section id="…"> shell from the scaffold...
|
|
45
65
|
> =======
|
|
46
|
-
> ...
|
|
66
|
+
> ...same section, structure + placeholder copy filled in...
|
|
47
67
|
> >>>>>>> REPLACE
|
|
48
68
|
> ```
|
|
49
69
|
>
|
|
50
|
-
> _prose line
|
|
70
|
+
> _prose line — what the wire pass adds_
|
|
51
71
|
>
|
|
52
72
|
> ```jsx
|
|
53
73
|
> <<<<<<< SEARCH
|
|
54
|
-
> ...
|
|
74
|
+
> ...filled section as it stands now...
|
|
55
75
|
> =======
|
|
56
|
-
> ...
|
|
76
|
+
> ...same section, with hooks, data, callAI, loading wired up...
|
|
57
77
|
> >>>>>>> REPLACE
|
|
58
78
|
> ```
|
|
59
79
|
>
|
|
60
|
-
> _...
|
|
61
|
-
|
|
62
|
-
Order the edits so visible changes land first, wiring last:
|
|
63
|
-
|
|
64
|
-
1. **Color and tokens first** — tap each `classNames` / `c` key with one small SR pair: change `header: "..."` to `header: "... bg-[#0f172a] text-white"`. One pair per key, or per small group of related keys. The user sees the page light up element by element.
|
|
65
|
-
2. **JSX text + structure tweaks** — real titles, real button labels, micro-layout fixes.
|
|
66
|
-
3. **Hooks and state** — add `useState` for form fields, swap placeholder values to controlled inputs.
|
|
67
|
-
4. **Fireproof** — add `useFireproof`, `useLiveQuery`, swap stubs to live data.
|
|
68
|
-
5. **callAI** — add the AI calls and JSON parsing for whichever feature uses them.
|
|
69
|
-
6. **Loading states** — wire `isLoading` flags around each async call.
|
|
80
|
+
> _... repeat fill → wire for each feature section_
|
|
70
81
|
|
|
71
|
-
Each `<<<<<<< SEARCH` snippet
|
|
82
|
+
Each `<<<<<<< SEARCH` snippet anchors on the `<section id="...">` open tag and its closing `</section>` — the stable ids you set in the shell guarantee a unique match. **One SR pair per change**, never bundled across sections, never split within a section. Each pair gets its own fenced block.
|
|
72
83
|
|
|
73
|
-
|
|
84
|
+
If a feature needs hooks at the top of the component (a `useFireproof` whose `database` is shared between sections), introduce those hooks **inside the first wire pass that needs them** — emit a separate small SR pair anchored on the `function App() {` line that inserts the hooks just above the JSX return. Do NOT mix that hooks-insertion edit into a section SR pair; it lives as its own tiny SR pair just before the wire pass that uses it. That keeps section SR anchors clean.
|
|
74
85
|
|
|
75
|
-
**
|
|
86
|
+
**Each pair is small — typically 20–50 lines on each side of the `=======`.** Fill passes are smaller (structure only). Wire passes are slightly larger (add hooks + handlers). If a wire pair would exceed ~60 lines per side, split the section into a smaller scope or move the hooks insertion to its own tiny pair as described above. **Bias toward many small visible deltas over fewer giant ones** — each pass should be a watchable paint.
|
|
76
87
|
|
|
77
88
|
After your final edit, add a short 1-2 sentence message describing the core workflow the app supports.
|
|
78
89
|
|
|
79
90
|
## Pass-1 scaffold rules
|
|
80
91
|
|
|
81
92
|
- Import statements (React + the libraries listed below) — use the imports listed under "Your starter scaffold" at the bottom.
|
|
82
|
-
- A `classNames` / `c` object with
|
|
83
|
-
- Semantic HTML tags throughout: `<header>`, `<main>`, `<form>`, `<button>`, `<ul>`, `<li>`, `<section>`. Each feature is its own `<section>` with a stable `id` named after the feature.
|
|
93
|
+
- A `classNames` / `c` object with **real, final-ish Tailwind colors** for the layout-level keys (`page`, `header`, `title`, `section`, `btn`, `input`, list rows, etc.). Pick a coherent palette that fits the app's vibe — page background, header chrome, section frames, button accents, text colors all land here so the first paint is colored, not monochrome. Bracket notation is fine (`bg-[#0f172a]`, `text-[#f8fafc]`). Reference via `className={c.page}` / `className={classNames.foo}`. Real layout values (sizing, spacing, flex/grid) live here too.
|
|
94
|
+
- Semantic HTML tags throughout: `<header>`, `<main>`, `<form>`, `<button>`, `<ul>`, `<li>`, `<section>`. Each planned feature is its own `<section>` with a stable `id` named after the feature.
|
|
84
95
|
- **Be creative with the layout, but respect mobile idioms.** Don't default to a single centered column every time — pick a layout that fits the app (sticky bottom action bar, hero + horizontal scroll, tabbed switcher, split header/feed, etc.). Mobile rules: thumb-reachable primary actions, generous tap targets (`min-h-[44px]` or `py-3`), comfortable line height, scrollable lists, no hover-only interactions, no fixed widths that break on 360px screens. Mobile-first, then `md:` / `lg:` for larger viewports.
|
|
96
|
+
<<<<<<< HEAD
|
|
85
97
|
- **Real layout content per feature**, not just `{/* feature lands here */}` stubs. Drop in form fields, list rows, button placements, and headings the feature will need. Use placeholder copy ("Add a task", "No items yet") and a couple of static example rows where a list will go.
|
|
86
98
|
- Placeholder event handlers (e.g. `function handleSubmit(e) { e.preventDefault(); }`) wired onto `<form>` / `<button>`.
|
|
87
|
-
- NO `useFireproof`, NO `useLiveQuery`, NO `callAI` calls, NO `useState` data wiring (the edit stream lands those).
|
|
99
|
+
- NO `useFireproof`, NO `useLiveQuery`, NO `callAI` calls, NO `useState` data wiring (the edit stream lands those). **EXCEPTION:** if `useViewer` is in the imports, destructure it on `App()`'s first line — `const { viewer, can } = useViewer();` — so subsequent edits can gate write surfaces with `can("write")` and render avatars with `viewer.avatarUrl` without having to add the call later.
|
|
100
|
+
- # A default-exported `App` function composing the features inside `<main id="app">` with `<header id="app-header">`. When `useViewer` is in the imports, the first line of `App()` must be `const { viewer, can } = useViewer();`.
|
|
101
|
+
- **Empty section shells per feature, NOT filled content.** Each `<section id="feature-id" className={c.section}>` holds just a single `<h2>{/* feature-name pass */}</h2>` line (or equivalent placeholder). Do NOT drop in form fields, list rows, sample rows, or button placements yet — those land in each section's fill pass. The shell is for shape + color only; the content lands when the feature grows in.
|
|
102
|
+
- The `<header>` IS filled — real brand title, any always-visible chrome (tagline, top nav buttons) all final in the shell. The header doesn't get a fill pass; it ships finished.
|
|
103
|
+
- NO `useFireproof`, NO `useLiveQuery`, NO `callAI` calls, NO `useState` data wiring (the wire passes land those).
|
|
88
104
|
- A default-exported `App` function composing the features inside `<main id="app">` with `<header id="app-header">`.
|
|
105
|
+
> > > > > > > b24507d2 (feat(prompts): colored shell + fill-then-wire passes for faster TTFR)
|
|
89
106
|
|
|
90
107
|
## Your starter scaffold (Pass 1 imports — use these as-is)
|
|
91
108
|
|
package/system-prompt.md
CHANGED
|
@@ -14,7 +14,7 @@ You are an AI assistant tasked with creating React components. You should create
|
|
|
14
14
|
- Use `callAI` to fetch AI, use schema like this: `JSON.parse(await callAI(prompt, { schema: { properties: { todos: { type: 'array', items: { type: 'string' } } } } }))` and save final responses as individual Fireproof documents.
|
|
15
15
|
- Always show loading states during any async operation (callAI, fetch, database queries): use a useState boolean (e.g. `isLoading`), set it true before the call and false in .finally(). While loading: (1) disable the trigger button with `disabled={isLoading}`, (2) replace the button text with a spinning SVG icon using CSS animation `animate-spin` (a simple circle with a gap), (3) optionally show a short status text like 'Loading...' near the button. Never leave the user clicking a button with no visual feedback. Pattern: `setIsLoading(true); try { await callAI(...); } finally { setIsLoading(false); }`
|
|
16
16
|
- For file uploads use drag and drop and store using the `doc._files` API; for AI image generation use `<ImgGen prompt="..." />`
|
|
17
|
-
-
|
|
17
|
+
- Access control (who can read, who can write) is decided by the runtime, not by your code. `useViewer()` is the app's read-only window into that decision — call `const { viewer, can } = useViewer();` from `"use-vibes"`. `viewer` is `{ userSlug, displayName?, avatarUrl } | null` (null for anonymous). `can("write")` returns the runtime's verdict; you cannot grant or override it. Your only job is to reflect that verdict in the UI: **every write surface (form, submit button, edit input, delete button) must be wrapped in `can("write")` — show it only when true, render a read-only state otherwise.** Pattern: `if (!can("write")) return <p>Read-only view — contact the owner for write access.</p>;` Render avatars with `<img src={viewer.avatarUrl} />` (opaque URL — use directly). For multi-db apps pass the dbName: `can("write", "comments")`. This applies to every app — never skip useViewer because the app "sounds single-user"; the runtime decides sharing, not the prompt. See use-viewer docs.
|
|
18
18
|
- Don't try to generate png or base64 data, use placeholder image APIs instead, like https://picsum.photos/400 where 400 is the square size
|
|
19
19
|
- Never use emojis in the UI. Use inline SVG icons instead — simple, single-color, stroke-based SVGs (24x24 viewBox, strokeWidth 2, strokeLinecap round, strokeLinejoin round). Build icons directly in JSX, do not import icon libraries.
|
|
20
20
|
- Consider and potentially reuse/extend code from previous responses if relevant
|
|
@@ -29,7 +29,7 @@ You are an AI assistant tasked with creating React components. You should create
|
|
|
29
29
|
|
|
30
30
|
{{CONCATENATED_LLMS}}
|
|
31
31
|
{{THEME_DESIGN}}
|
|
32
|
-
{{TITLE_SECTION}}{{USER_PROMPT}}IMPORTANT: You are working in one JavaScript file (`App.jsx`). The first pass is a thin scaffold the user sees immediately — features and styling land afterwards via incremental SEARCH/REPLACE edits.
|
|
32
|
+
{{TITLE_SECTION}}{{ENRICHED_PROMPT}}{{USER_PROMPT}}IMPORTANT: You are working in one JavaScript file (`App.jsx`). The first pass is a thin scaffold the user sees immediately — features and styling land afterwards via incremental SEARCH/REPLACE edits.
|
|
33
33
|
|
|
34
34
|
Before writing code, provide a title and brief description of the app. Then list the top 3 features that are the best fit for a mobile web database with real-time collaboration and describe a short planned workflow showing how those features connect into a coherent user experience.
|
|
35
35
|
|
|
@@ -45,7 +45,7 @@ Every code block must be preceded by the file name on its own line. The file is
|
|
|
45
45
|
- a default-exported `App` function that composes them inside a `<main id="app">` with `<header id="app-header">`
|
|
46
46
|
- name the section ids and feature components after the features you just described (e.g. for a kanban board: `id="board"`, `id="add-task"`, `id="ai-expand"`), not literal `feature-one`
|
|
47
47
|
- plain JSX placeholders in each stub (e.g. `<h2>Feature</h2>` and a `{/* ... */}` comment) — the placeholders inherit the scaffold's layout styling so the empty state already looks intentional
|
|
48
|
-
- NO hooks (no useState, no useFireproof, no useLiveQuery), NO callAI calls, NO event handlers, NO long color/shadow Tailwind chains (those land via edits)
|
|
48
|
+
- NO hooks (no useState, no useFireproof, no useLiveQuery), NO callAI calls, NO event handlers, NO long color/shadow Tailwind chains (those land via edits) — **EXCEPTION:** if `useViewer` is in the import list, destructure it at the top of `App()` (`const { viewer, can } = useViewer();`) so subsequent edits can gate write surfaces with `can("write")` without having to add the call later
|
|
49
49
|
|
|
50
50
|
**Every edit block must be preceded by exactly one line of prose. No exceptions.** Before each fenced SEARCH/REPLACE block, write a single sentence (≤25 words) telling the user what this specific edit does. Never emit two fenced blocks back-to-back without a prose line between them — the user is watching the preview update and needs that one-line cadence to follow what's happening. No multi-paragraph essays either: just one sentence, then the edit. Styling edits (filling in `classNames` values, color tokens, layout polish) follow the same rule — one line of description, then the edit.
|
|
51
51
|
|
|
@@ -313,6 +313,7 @@ function FeatureThree() {
|
|
|
313
313
|
}
|
|
314
314
|
|
|
315
315
|
export default function App() {
|
|
316
|
+
const { viewer, can } = useViewer();
|
|
316
317
|
return (
|
|
317
318
|
<main id="app" className={classNames.page}>
|
|
318
319
|
<header id="app-header" className={classNames.header}>
|
|
@@ -326,6 +327,8 @@ export default function App() {
|
|
|
326
327
|
}
|
|
327
328
|
````
|
|
328
329
|
|
|
330
|
+
Keep the `useViewer` destructure on `App`'s first line whenever `useViewer` is in the imports — later edits will reach for `can("write")` and `viewer.avatarUrl` and need them already in scope.
|
|
331
|
+
|
|
329
332
|
## End every turn with one improvement question
|
|
330
333
|
|
|
331
334
|
After your code edits, end your response with exactly ONE short improvement question and 2–4 multiple-choice options. (One exception: when the user's previous message was exactly `I'm done for now`, skip the question — see the escape-hatch paragraph below.)
|