Add dataInvention flag to PromptOptions to disable the 'generate realistic/plausible data' rule

Open Beginner friendly
#959 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript

Research direction

In lang-core, start by reading PromptOptions and buildImportantRules(), where the data-generation rule is currently appended unconditionally. Check how the existing prompt flags are handled and look for relevant tests. Done means dataInvention defaults to true, while setting it to false omits that rule without changing other prompt behavior.

Written by the indexing model from the issue text.

Description

Context

buildImportantRules() in lang-core unconditionally appends the line:

- When asked about data, generate realistic/plausible data

This is correct for generative UI (the default consumer), but harmful for description-mode consumers that describe existing UI rather than generating new UI. In that context it instructs the model to invent data — image URLs, prices, copy — that is not in the source, producing artefacts that are locally well-formed but materially false.

Current workaround

We post-process the generated prompt to excise the line:

const prompt = library.prompt(options);
return prompt.split("\n").filter(line => !line.includes("When asked about data, generate realistic/plausible data")).join("\n");

This works but is coupled to the exact wording — if lang-core rewords the rule, the excision silently stops matching.

Proposal

Add a dataInvention?: boolean flag to PromptOptions, defaulting to true (preserving current behaviour). When false, skip the line in buildImportantRules().

This mirrors the existing pattern of editMode, inlineMode, bindings, and toolCalls — feature flags that control which sections of the prompt are emitted.

Use case

backpack-openui has two consumers:

  1. Runtime (generative UI) — dataInvention: true (default)
  2. Description (describing existing prototypes) — dataInvention: false

The description consumer is the one that needs this flag. Evidence: https://github.com/Skyscanner/backpack-openui/blob/main/docs/spike-findings.md

Dominant language
TypeScript
Stars
10k
Forks
698
Avg merge
1d 2h
Merged PRs (30d)
138

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from thesysdev/openui

All issues in thesysdev/openui

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.