Skip to content

Commit c115d36

Browse files
CharlieHelpsjchris
authored andcommitted
Remove instructional text overrides from prompts and UI
1 parent 508183b commit c115d36

File tree

17 files changed

+15
-284
lines changed

17 files changed

+15
-284
lines changed

notes/prompt-flow.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ export interface ComponentGenerationResult {
3737
metadata: {
3838
dependencies: string[]; // Selected library modules
3939
aiSelectedDependencies: string[]; // What AI chose (before overrides)
40-
instructionalText: boolean; // Include instructions in UI
4140
demoData: boolean; // Include demo data button
4241
model: string; // AI model used
4342
timestamp: number; // Generation timestamp
@@ -57,7 +56,6 @@ export async function generateComponentWithDependencies(
5756
- Call `selectLlmsAndOptions()` with user prompt and history
5857
- AI analyzes prompt to determine:
5958
- Which UI libraries to include (React Hook Form, Lucide icons, etc.)
60-
- Whether to include instructional text
6159
- Whether to add a demo data button
6260
- Log decisions for debugging: `console.log('🎯 AI selected dependencies:', ...)`
6361

@@ -206,7 +204,6 @@ For debugging and future database storage preparation:
206204
```
207205
🎯 Component generation: AI selected dependencies: {
208206
selected: ['useFireproof', 'LucideIcons'],
209-
instructionalText: true,
210207
demoData: false,
211208
prompt: "Create a todo app",
212209
model: "anthropic/claude-sonnet-4.5"
@@ -218,7 +215,6 @@ For debugging and future database storage preparation:
218215
📦 Component metadata for storage: {
219216
dependencies: ['useFireproof', 'LucideIcons'],
220217
aiSelectedDependencies: ['useFireproof', 'LucideIcons'],
221-
instructionalText: true,
222218
demoData: false,
223219
model: "anthropic/claude-sonnet-4.5",
224220
timestamp: 1735234567890
@@ -245,4 +241,4 @@ For debugging and future database storage preparation:
245241
4. **Versioning**: Track changes to generated components
246242
5. **Sharing**: Export/import component configurations
247243

248-
This architecture makes the prompts package the true "brain" of component generation, with both apps being thin clients that consume its orchestration capabilities.
244+
This architecture makes the prompts package the true "brain" of component generation, with both apps being thin clients that consume its orchestration capabilities.

prompts/pkg/chat.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,6 @@ export interface VibeDocument {
3636
* These are displayed in the UI when user hasn't made an override.
3737
*/
3838
aiSelectedDependencies?: string[];
39-
/**
40-
* When true, enable instructional text in prompts regardless of LLM decision.
41-
* When false, disable instructional text regardless of LLM decision.
42-
* When undefined, use LLM decision.
43-
*/
44-
instructionalTextOverride?: boolean;
4539
/**
4640
* When true, enable demo data in prompts regardless of LLM decision.
4741
* When false, disable demo data regardless of LLM decision.

prompts/pkg/prompts.ts

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ export async function getDefaultDependencies(): Promise<string[]> {
5454
export interface SystemPromptResult {
5555
systemPrompt: string;
5656
dependencies: string[];
57-
instructionalText: boolean;
5857
demoData: boolean;
5958
model: string;
6059
}
@@ -113,7 +112,6 @@ async function detectModulesInHistory(
113112

114113
interface LlmSelectionDecisions {
115114
selected: string[];
116-
instructionalText: boolean;
117115
demoData: boolean;
118116
}
119117

@@ -170,7 +168,7 @@ async function selectLlmsAndOptions(
170168
{
171169
role: "system",
172170
content:
173-
'You select which library modules from a catalog should be included AND whether to include instructional UI text and a demo-data button. First analyze if the user prompt describes specific look & feel requirements. For instructional text and demo data: include them only when asked for. Read the JSON payload and return JSON with properties: "selected" (array of catalog "name" strings), "instructionalText" (boolean), and "demoData" (boolean). Only choose modules from the catalog. Include any libraries already used in history. Respond with JSON only.',
171+
'You select which library modules from a catalog should be included AND whether to include a demo-data button. First analyze if the user prompt describes specific look & feel requirements. For demo data: include it only when asked for. Read the JSON payload and return JSON with properties: "selected" (array of catalog "name" strings) and "demoData" (boolean). Only choose modules from the catalog. Include any libraries already used in history. Respond with JSON only.',
174172
},
175173
{ role: "user", content: JSON.stringify(payload) },
176174
];
@@ -185,7 +183,6 @@ async function selectLlmsAndOptions(
185183
name: "module_and_options_selection",
186184
properties: {
187185
selected: { type: "array", items: { type: "string" } },
188-
instructionalText: { type: "boolean" },
189186
demoData: { type: "boolean" },
190187
},
191188
},
@@ -230,24 +227,20 @@ async function selectLlmsAndOptions(
230227
"Module/options selection: call-ai returned undefined with schema present",
231228
);
232229
console.warn("This is a known issue in the prompts package environment");
233-
return { selected: [], instructionalText: true, demoData: true };
230+
return { selected: [], demoData: true };
234231
}
235232

236233
const parsed = JSON.parse(raw) ?? {};
237234
const selected = Array.isArray(parsed?.selected)
238235
? parsed.selected.filter((v: unknown) => typeof v === "string")
239236
: [];
240-
const instructionalText =
241-
typeof parsed?.instructionalText === "boolean"
242-
? parsed.instructionalText
243-
: true;
244237
const demoData =
245238
typeof parsed?.demoData === "boolean" ? parsed.demoData : true;
246239

247-
return { selected, instructionalText, demoData };
240+
return { selected, demoData };
248241
} catch (err) {
249242
console.warn("Module/options selection call failed:", err);
250-
return { selected: [], instructionalText: true, demoData: true };
243+
return { selected: [], demoData: true };
251244
}
252245
}
253246

@@ -290,7 +283,6 @@ export async function makeBaseSystemPrompt(
290283
const useOverride = !!sessionDoc?.dependenciesUserOverride;
291284

292285
let selectedNames: string[] = [];
293-
let includeInstructional = true;
294286
let includeDemoData = true;
295287

296288
const llmsCatalog = await getLlmCatalog(sessionDoc.fallBackUrl);
@@ -307,7 +299,6 @@ export async function makeBaseSystemPrompt(
307299
history,
308300
sessionDoc,
309301
);
310-
includeInstructional = decisions.instructionalText;
311302
includeDemoData = decisions.demoData;
312303

313304
const detected = await detectModulesInHistory(history, sessionDoc);
@@ -317,10 +308,6 @@ export async function makeBaseSystemPrompt(
317308
if (selectedNames.length === 0)
318309
selectedNames = [...(await getDefaultDependencies())];
319310
}
320-
321-
if (typeof sessionDoc?.instructionalTextOverride === "boolean") {
322-
includeInstructional = sessionDoc.instructionalTextOverride;
323-
}
324311
if (typeof sessionDoc?.demoDataOverride === "boolean") {
325312
includeDemoData = sessionDoc.demoDataOverride;
326313
}
@@ -406,7 +393,6 @@ import React, { ... } from "react"${generateImportStatements(chosenLlms)}
406393
return {
407394
systemPrompt,
408395
dependencies: selectedNames,
409-
instructionalText: includeInstructional,
410396
demoData: includeDemoData,
411397
model,
412398
};

prompts/pkg/settings.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,5 @@ export interface UserSettings {
2828

2929
dependencies?: string[];
3030

31-
instructionalTextOverride?: boolean;
32-
3331
demoDataOverride?: boolean;
3432
}

prompts/tests/prompt-builder.test.ts

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -286,33 +286,6 @@ describe("prompt builder (real implementation)", () => {
286286
expect(result.systemPrompt).not.toMatch(/vivid description of the app's purpose/i);
287287
});
288288

289-
it("makeBaseSystemPrompt: respects instructionalTextOverride=false to disable instructional text", async () => {
290-
// await preloadLlmsText();
291-
const result = await makeBaseSystemPrompt("test-model", {
292-
...opts,
293-
stylePrompt: undefined,
294-
userPrompt: undefined,
295-
history: [],
296-
instructionalTextOverride: false,
297-
});
298-
expect(result.systemPrompt).not.toMatch(/vivid description of the app's purpose/i);
299-
// Demo data should still appear (not overridden)
300-
expect(result.systemPrompt).toMatch(/include a Demo Data button/i);
301-
});
302-
303-
it("makeBaseSystemPrompt: respects instructionalTextOverride=true to force instructional text", async () => {
304-
// await preloadLlmsText();
305-
const result = await makeBaseSystemPrompt("test-model", {
306-
...opts,
307-
stylePrompt: undefined,
308-
userPrompt: undefined,
309-
history: [],
310-
instructionalTextOverride: true,
311-
});
312-
expect(result.systemPrompt).not.toMatch(/vivid description of the app's purpose/i);
313-
expect(result.systemPrompt).toMatch(/include a Demo Data button/i);
314-
});
315-
316289
it("makeBaseSystemPrompt: respects demoDataOverride=false to disable demo data", async () => {
317290
// await preloadLlmsText();
318291
const result = await makeBaseSystemPrompt("test-model", {
@@ -338,18 +311,4 @@ describe("prompt builder (real implementation)", () => {
338311
expect(result.systemPrompt).toMatch(/include a Demo Data button/i);
339312
expect(result.systemPrompt).not.toMatch(/vivid description of the app's purpose/i);
340313
});
341-
342-
it("makeBaseSystemPrompt: respects both overrides simultaneously", async () => {
343-
// await preloadLlmsText();
344-
const result = await makeBaseSystemPrompt("test-model", {
345-
...opts,
346-
stylePrompt: undefined,
347-
userPrompt: undefined,
348-
history: [],
349-
instructionalTextOverride: false,
350-
demoDataOverride: false,
351-
});
352-
expect(result.systemPrompt).not.toMatch(/vivid description of the app's purpose/i);
353-
expect(result.systemPrompt).not.toMatch(/include a Demo Data button/i);
354-
});
355314
});

prompts/tests/prompts.test.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ vi.mock("@vibes.diy/prompts", async () => {
88
makeBaseSystemPrompt: vi.fn().mockResolvedValue({
99
systemPrompt: "mocked system prompt",
1010
dependencies: ["fireproof", "callai"],
11-
instructionalText: true,
1211
demoData: true,
1312
model: "test-model",
1413
}),
@@ -17,12 +16,6 @@ vi.mock("@vibes.diy/prompts", async () => {
1716
format: '{dependencies: { "package-name": "version" }}',
1817
note: "use-fireproof is already provided, do not include it",
1918
},
20-
structure: [
21-
"Brief explanation",
22-
"Component code with proper Fireproof integration",
23-
"Real-time updates",
24-
"Data persistence",
25-
],
2619
},
2720
};
2821
});

prompts/tests/settings-prompt.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ import { callAI } from "call-ai"
7979
return {
8080
systemPrompt,
8181
dependencies: ["fireproof", "callai"],
82-
instructionalText: true,
8382
demoData: true,
8483
model,
8584
};

use-vibes/base/hooks/vibes-gen/use-vibes.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ export function useVibes(
125125
Use Fireproof for data persistence. Begin the component with the import statements.
126126
Return only the JSX code with a default export. Use modern React patterns with hooks if needed.`,
127127
dependencies: options.dependencies || ['useFireproof'],
128-
instructionalText: true,
129128
demoData: false,
130129
model: options.model || 'anthropic/claude-sonnet-4.5',
131130
};
@@ -135,7 +134,6 @@ Return only the JSX code with a default export. Use modern React patterns with h
135134
const metadata = {
136135
dependencies: result.dependencies,
137136
aiSelectedDependencies: result.dependencies,
138-
instructionalText: result.instructionalText,
139137
demoData: result.demoData,
140138
model: result.model,
141139
timestamp: Date.now(),

use-vibes/tests/useVibes-iframe.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ vi.mock('@vibes.diy/prompts', () => ({
4141
return {
4242
systemPrompt: 'You are a React component generator',
4343
dependencies: options?.dependencies || ['useFireproof'],
44-
instructionalText: true,
4544
demoData: false,
4645
model: model || 'anthropic/claude-sonnet-4.5',
4746
};

use-vibes/tests/useVibes-integration.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ vi.mock('@vibes.diy/prompts', () => ({
6363
return {
6464
systemPrompt: 'You are a React component generator',
6565
dependencies: options?.dependencies || ['useFireproof'],
66-
instructionalText: true,
6766
demoData: false,
6867
model: model || 'anthropic/claude-sonnet-4.5',
6968
};

0 commit comments

Comments
 (0)