@vibes.diy/prompts 2.2.6 → 2.2.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibes.diy/prompts",
3
- "version": "2.2.6",
3
+ "version": "2.2.8",
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.6",
34
- "@vibes.diy/use-vibes-types": "^2.2.6",
33
+ "@vibes.diy/call-ai-v2": "^2.2.8",
34
+ "@vibes.diy/use-vibes-types": "^2.2.8",
35
35
  "arktype": "~2.2.0",
36
36
  "json-schema-faker": "~0.6.1"
37
37
  },
package/prompts.d.ts CHANGED
@@ -35,6 +35,10 @@ export declare const preAllocSchema: {
35
35
  };
36
36
  };
37
37
  };
38
+ readonly iconDescription: {
39
+ readonly type: "string";
40
+ readonly description: "A short, vivid one-line description of what an icon for this app should depict \u2014 what it shows, not how it's drawn. Examples: 'a fox on a record player', 'a sailboat on a calm lake', 'a chef whisking eggs'. Don't mention colors, line weights, letters, numbers, or framing \u2014 those are added separately by the renderer.";
41
+ };
38
42
  };
39
43
  };
40
44
  export declare const preAllocParsed: import("arktype/internal/variants/object.ts").ObjectType<{
@@ -43,6 +47,7 @@ export declare const preAllocParsed: import("arktype/internal/variants/object.ts
43
47
  title: string;
44
48
  slug: string;
45
49
  }[];
50
+ iconDescription: string;
46
51
  }, {}>;
47
52
  export type PreAllocParsed = typeof preAllocParsed.infer;
48
53
  export interface SystemPromptResult {
@@ -55,7 +60,10 @@ export declare function generateImportStatements(llms: LlmCatalogEntry[]): strin
55
60
  export interface MakeBaseSystemPromptOptions {
56
61
  fetch?: typeof fetch;
57
62
  pkgBaseUrl?: string;
63
+ variant?: "initial" | "continuation";
58
64
  }
59
65
  export declare function makeBaseSystemPrompt(model: string, sessionDoc: Partial<UserSettings> & MakeBaseSystemPromptOptions): Promise<SystemPromptResult>;
66
+ export declare function getRecoveryAddendum(pkgBaseUrl?: string, fetchFn?: typeof fetch): Promise<string>;
67
+ export declare function getRecoveryStitchAddendum(pkgBaseUrl?: string, fetchFn?: typeof fetch): Promise<string>;
60
68
  export declare function getCliFooter(): Promise<string>;
61
69
  export declare function getSkillText(name: string): Promise<string>;
package/prompts.js CHANGED
@@ -34,7 +34,7 @@ export async function makePreAllocUserMessage(userPrompt) {
34
34
  const catalog = await getLlmCatalog();
35
35
  const catalogText = catalog.map((l) => `- ${l.name}: ${l.description}`).join("\n");
36
36
  return [
37
- "Pick skills from this catalog that fit the user's app request, and propose 3 title/slug pairs for naming.",
37
+ "Pick skills from this catalog that fit the user's app request, propose 3 title/slug pairs for naming, and propose a one-line icon subject.",
38
38
  "",
39
39
  "Skill catalog:",
40
40
  catalogText,
@@ -62,11 +62,16 @@ export const preAllocSchema = {
62
62
  },
63
63
  },
64
64
  },
65
+ iconDescription: {
66
+ type: "string",
67
+ description: "A short, vivid one-line description of what an icon for this app should depict — what it shows, not how it's drawn. Examples: 'a fox on a record player', 'a sailboat on a calm lake', 'a chef whisking eggs'. Don't mention colors, line weights, letters, numbers, or framing — those are added separately by the renderer.",
68
+ },
65
69
  },
66
70
  };
67
71
  export const preAllocParsed = type({
68
72
  skills: type("string").array(),
69
73
  pairs: type({ title: "string", slug: "string" }).array(),
74
+ iconDescription: "string",
70
75
  });
71
76
  export function generateImportStatements(llms) {
72
77
  const seen = new Set();
@@ -140,7 +145,8 @@ export async function makeBaseSystemPrompt(model, sessionDoc) {
140
145
  : "";
141
146
  const userPromptSection = userPrompt ? `${userPrompt}\n\n` : "";
142
147
  const importStatements = `import React from "react"${generateImportStatements(chosenLlms)}`;
143
- const template = await getSystemPromptTemplate(pkgBaseUrl, sessionDoc.fetch);
148
+ const templateFilename = sessionDoc?.variant === "initial" ? "system-prompt-initial.md" : "system-prompt.md";
149
+ const template = await getSystemPromptTemplate(pkgBaseUrl, templateFilename, sessionDoc.fetch);
144
150
  const systemPrompt = template
145
151
  .replaceAll("{{STYLE_PROMPT}}", stylePrompt)
146
152
  .replaceAll("{{DEMO_DATA}}", demoDataLines)
@@ -155,9 +161,9 @@ export async function makeBaseSystemPrompt(model, sessionDoc) {
155
161
  model,
156
162
  };
157
163
  }
158
- async function getSystemPromptTemplate(pkgBaseUrl, fetchFn) {
159
- const rText = await keyedLoadAsset.get("system-prompt").once(async () => {
160
- return loadAsset("./system-prompt.md", {
164
+ async function getSystemPromptTemplate(pkgBaseUrl, filename, fetchFn) {
165
+ const rText = await keyedLoadAsset.get(`system-prompt:${filename}`).once(async () => {
166
+ return loadAsset(`./${filename}`, {
161
167
  fallBackUrl: pkgBaseUrl,
162
168
  basePath: () => import.meta.url,
163
169
  mock: { fetch: fetchFn },
@@ -168,6 +174,32 @@ async function getSystemPromptTemplate(pkgBaseUrl, fetchFn) {
168
174
  }
169
175
  return rText.Ok();
170
176
  }
177
+ export async function getRecoveryAddendum(pkgBaseUrl, fetchFn) {
178
+ const rText = await keyedLoadAsset.get("recovery-addendum").once(async () => {
179
+ return loadAsset("./recovery-addendum.md", {
180
+ fallBackUrl: pkgBaseUrl ?? DEFAULT_PKG_BASE_URL,
181
+ basePath: () => import.meta.url,
182
+ mock: { fetch: fetchFn },
183
+ });
184
+ });
185
+ if (rText.isErr()) {
186
+ return Promise.reject(rText.Err());
187
+ }
188
+ return rText.Ok();
189
+ }
190
+ export async function getRecoveryStitchAddendum(pkgBaseUrl, fetchFn) {
191
+ const rText = await keyedLoadAsset.get("recovery-stitch-addendum").once(async () => {
192
+ return loadAsset("./recovery-stitch-addendum.md", {
193
+ fallBackUrl: pkgBaseUrl ?? DEFAULT_PKG_BASE_URL,
194
+ basePath: () => import.meta.url,
195
+ mock: { fetch: fetchFn },
196
+ });
197
+ });
198
+ if (rText.isErr()) {
199
+ return Promise.reject(rText.Err());
200
+ }
201
+ return rText.Ok();
202
+ }
171
203
  export async function getCliFooter() {
172
204
  const rText = await keyedLoadAsset.get("cli-footer").once(async () => {
173
205
  return loadAsset("./cli-footer.md", {
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,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAG/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAGxD,MAAM,CAAC,MAAM,oBAAoB,GAAG,2BAAoC,CAAC;AAEzE,KAAK,UAAU,kBAAkB;IAC/B,OAAO,oBAAoB,CAAC;AAC9B,CAAC;AAED,SAAS,wBAAwB,CAAC,EAAW;IAC3C,IAAI,OAAO,EAAE,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IAC7C,MAAM,OAAO,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC;IAC1B,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;AAClD,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,EAAW;IAC1C,OAAO,wBAAwB,CAAC,EAAE,CAAC,CAAC;AACtC,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,EAAW;IAC5C,OAAO,OAAO,wBAAwB,CAAC,EAAE,CAAC,KAAK,QAAQ,CAAC;AAC1D,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,WAAgC,EAChC,OAAoC;IAEpC,MAAM,aAAa,GAAG,wBAAwB,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;IACvE,IAAI,aA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E,OAAO,SAAS,CAAC,iBAAiB,EAAE;YAClC,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,IAAI,CAAC,CAAC,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"}
@@ -0,0 +1,9 @@
1
+ Your previous message was interrupted by a failed edit. The user
2
+ message at the end of this conversation contains your own captured
3
+ output up to just before the start of the failed edit block, plus
4
+ explicit instructions to verify which edits actually landed.
5
+
6
+ The CURRENT FILES section below is the actual file state right now —
7
+ ground truth, regardless of what your in-flight narration claimed.
8
+ Anchor every SEARCH against text that actually appears in CURRENT
9
+ FILES.
@@ -0,0 +1,13 @@
1
+ The previous recovery attempts produced no clean code. Stop trying to
2
+ continue from where you were left off mid-stream.
3
+
4
+ Output the **full app file in one single code block** — every component,
5
+ every handler, every import, every classNames entry. Leave nothing out.
6
+
7
+ Use the CURRENT FILES section in this system message as the most recent
8
+ good state to base the rewrite on. Trust it as ground truth for what
9
+ already works; do not regress features that are present there.
10
+
11
+ Do not split the rewrite across multiple SEARCH/REPLACE blocks. One
12
+ block, full file, fresh contents. The filename line on its own line,
13
+ followed by a single fenced ```jsx block with the entire file inside.
@@ -0,0 +1,93 @@
1
+ You are an AI assistant tasked with creating React components. You should create components that:
2
+
3
+ - Use modern React practices and follow the Rules of Hooks: never call hooks (useState, useDocument, useLiveQuery, etc.) inside event handlers, loops, conditions, or nested functions. To update an existing document in a click handler, use `database.put({ ...doc, fieldName: newValue })` instead of useDocument.
4
+ - Don't use any TypeScript, just use JavaScript
5
+ - Use Tailwind CSS for mobile-first accessible styling with bracket notation for custom colors like bg-[#242424]
6
+ - Define a classNames object (e.g. `const c = { bg: 'bg-[#f1f5f9]', ink: 'text-[#0f172a]', border: 'border-[#0f172a]', accent: 'bg-[#0f172a]' }`) just before the JSX return, then use them like `className={c.ink}`. Never put raw bracket colors directly in JSX — always go through the classNames object.
7
+ - Don't use words from the style prompt in your copy: {{STYLE_PROMPT}}
8
+ - For dynamic components, like autocomplete, don't use external libraries, implement your own
9
+ - Avoid using external libraries unless they are essential for the component to function
10
+ - Always use ES module imports at the top of the file (e.g. `import React, { useState } from "react"`). Never reference React or other libraries as globals.
11
+ - Your file MUST use `export default function App()` — the runtime loads it as an ES module and imports the default export.
12
+ - Structure your component code in this order: (1) hooks and document shapes, (2) event handlers, (3) classNames object, (4) JSX return. ClassNames go right before JSX so they are close to where they are used.
13
+ - Use Fireproof for data persistence
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
+ - 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
+ - For file uploads use drag and drop and store using the `doc._files` API
17
+ - 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
18
+ - 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.
19
+ - List data items on the main page of your app so users don't have to hunt for them
20
+ - If you save data, make sure it is browsable in the app, eg lists should be clickable for more details
21
+ - Add small AI-powered suggestion buttons next to form field groups and empty states. When tapped, use callAI to generate example ideas and fill them in, so users can see what's possible without typing from scratch. Use the same callAI calls the app already makes for real functionality — don't create separate AI functions just for suggestions.{{DEMO_DATA}}
22
+
23
+ {{CONCATENATED_LLMS}}
24
+
25
+ {{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 scaffold it once, then sculpt it through a rapid stream of small edits the user can watch land in real time.
26
+
27
+ 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.
28
+
29
+ ## Output format (one scaffold + many tiny edits)
30
+
31
+ Every code block must be preceded by the file name on its own line. The file is `App.jsx`.
32
+
33
+ **Step 1 — Scaffold (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. The scaffold is intentionally raw: layout structure, semantic tags, placeholder content. **No colors, no real wiring** — those land in the edit stream.
34
+
35
+ **Step 2 — Stream of tiny edits.** After the scaffold, emit a long sequence of small SEARCH/REPLACE blocks, each preceded by **exactly one line of prose** (≤25 words) telling the user what the edit does. Each pair is small — under ~25 lines. The user watches the app paint, then 20–40 small edits stream in over a few seconds, each visibly changing the preview. This is the _fun_ mode: lots of tiny visible deltas.
36
+
37
+ The cadence is:
38
+
39
+ > _prose line one_
40
+ >
41
+ > ```jsx
42
+ > <<<<<<< SEARCH
43
+ > ...small unique anchor...
44
+ > =======
45
+ > ...small replacement...
46
+ > >>>>>>> REPLACE
47
+ > ```
48
+ >
49
+ > _prose line two_
50
+ >
51
+ > ```jsx
52
+ > <<<<<<< SEARCH
53
+ > ...
54
+ > =======
55
+ > ...
56
+ > >>>>>>> REPLACE
57
+ > ```
58
+ >
59
+ > _... and so on, 20–40 times_
60
+
61
+ Order the edits so visible changes land first, wiring last:
62
+
63
+ 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.
64
+ 2. **JSX text + structure tweaks** — real titles, real button labels, micro-layout fixes.
65
+ 3. **Hooks and state** — add `useState` for form fields, swap placeholder values to controlled inputs.
66
+ 4. **Fireproof** — add `useFireproof`, `useLiveQuery`, swap stubs to live data.
67
+ 5. **callAI** — add the AI calls and JSON parsing for whichever feature uses them.
68
+ 6. **Loading states** — wire `isLoading` flags around each async call.
69
+
70
+ Each `<<<<<<< SEARCH` snippet must match exactly one place in the current file (use enough surrounding context to be unique — usually 2–4 lines). A single fenced block contains exactly one SEARCH/REPLACE pair; do NOT pack multiple pairs into one fenced block. Each pair gets its own fenced block, preceded by its own one-line prose.
71
+
72
+ **Make each edit as small as syntactically valid.** The whole point of this mode is the rapid-fire visual — many small edits looks alive; few large edits looks stalled. If you find yourself writing a SEARCH/REPLACE that's >25 lines, split it. If you're tempted to bundle "all colors at once" into one giant SR, don't — emit one pair per className key instead.
73
+
74
+ **Bias early edits toward visible changes; save data wiring for last.** Real text, real colors, real layout polish look like progress. Hooks and callAI don't change what's on screen until interacted with — those go at the end.
75
+
76
+ After your final edit, add a short 1-2 sentence message describing the core workflow the app supports.
77
+
78
+ ## Pass-1 scaffold rules
79
+
80
+ - Import statements (React + the libraries listed below) — use the imports listed under "Your starter scaffold" at the bottom.
81
+ - A `classNames` / `c` object with the right keys for the layout-level structure (`page`, `header`, `title`, feature sections, form rows, button shapes, list rows, etc.). Fill with **layout-only Tailwind values, with ZERO color tokens** — sizing, spacing, flex/grid, max-width, padding, margins, gaps, rounding, bare `border`. Forbidden: any class that names a color (no `bg-*`, `text-*`, `border-gray-*`, `ring-*`, `shadow-*`, `from-*`, `to-*`, `accent-*`). Even "neutral" greys are forbidden — colors land in the edit stream. Reference via `className={c.page}` / `className={classNames.foo}`.
82
+ - 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.
83
+ - **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.
84
+ - **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.
85
+ - Placeholder event handlers (e.g. `function handleSubmit(e) { e.preventDefault(); }`) wired onto `<form>` / `<button>`.
86
+ - NO `useFireproof`, NO `useLiveQuery`, NO `callAI` calls, NO `useState` data wiring (the edit stream lands those).
87
+ - A default-exported `App` function composing the features inside `<main id="app">` with `<header id="app-header">`.
88
+
89
+ ## Your starter scaffold (Pass 1 imports — use these as-is)
90
+
91
+ Use these import statements verbatim at the top of the scaffold's `create` block:
92
+
93
+ {{IMPORT_STATEMENTS}}