@eonui/ai-prompts
v0.1.1
Published
`@eonui/ai-prompts` is the prompt-asset package for EonUI-driven generation workflows. It packages system rules, task templates, guardrails, and example request/output pairs so AI-assisted flows can stay aligned with the EonUI component system instead of
Readme
@eonui/ai-prompts
@eonui/ai-prompts is the prompt-asset package for EonUI-driven generation workflows. It packages system rules, task templates, guardrails, and example request/output pairs so AI-assisted flows can stay aligned with the EonUI component system instead of drifting into invented tags, props, or layouts.
Workspace Note
This folder currently documents the published package surface. The implementation source for @eonui/ai-prompts is not mirrored into revamp/eonui/packages/ai-prompts yet, so this README is the local documentation home for the package.
Docs And Live Reference
Use this README for package-level guidance, export details, and implementation examples. For broader product context, visual references, and the evolving EonUI platform story, refer to https://eonui.com.
Purpose
Use this package when you need to:
- build prompts for EonUI page generation
- constrain AI output to documented components
- seed few-shot examples for forms or dashboards
- keep prompt rules shared across tools and runtimes
It is especially useful for layout builders, AI Studio features, CMS copilots, and internal automation that should emit Eon-flavored UI instead of generic HTML.
What The Package Exposes Today
The current package ships:
systemRulespagePromptTemplateformPromptTemplatedashboardPromptTemplateaiPromptLibraryaiPromptGuide
The packaged library currently includes:
- a system-rules block focused on documented Eon components
- page, form, and dashboard templates
- guardrails that prevent invented props or non-manifest component usage
- natural-language request/output examples
Install
npm install @eonui/ai-promptsRecommended Usage Pattern
The cleanest way to use this package is:
- start with
systemRules - choose the closest template such as
pagePromptTemplate,formPromptTemplate, ordashboardPromptTemplate - inject your real product constraints such as domain, target user, allowed components, and success criteria
- keep the expected output format explicit so the downstream system can validate or parse it
This package is especially useful when you want consistent AI generation behavior across:
- internal page builders
- layout copilots
- prompt-backed prototyping workflows
- content or UI generation experiments that should stay aligned with the Eon design language
Example 1: Build a full prompt for page generation
import {
systemRules,
pagePromptTemplate
} from '@eonui/ai-prompts';
const userRequest = 'Create a responsive analytics landing page with a KPI row and activity feed.';
const prompt = [
systemRules.trim(),
pagePromptTemplate.trim(),
`User request: ${userRequest}`
].join('\n\n');
console.log(prompt);Use this when:
- sending prompts to a model at runtime
- generating screens from product requirements
- keeping page generation consistent across multiple tools
Example 2: Pull a specific template from the prompt library
import { aiPromptLibrary } from '@eonui/ai-prompts';
const dashboardPrompt = aiPromptLibrary.templates.dashboard;
console.log(aiPromptLibrary.guardrails);
console.log(dashboardPrompt);Use this when:
- you want prompt templates keyed by intent
- a UI flow needs to switch between page, form, and dashboard generation
- you are building an internal prompt registry
Example 3: Reuse the few-shot examples
import { aiPromptLibrary } from '@eonui/ai-prompts';
for (const example of aiPromptLibrary.naturalLanguageExamples) {
console.log(example.request);
console.log(example.output);
}Use this when:
- bootstrapping few-shot prompts
- building evaluation datasets
- testing whether a model stays inside EonUI composition rules
Example 4: Show prompt coverage in a docs or admin screen
import { aiPromptGuide } from '@eonui/ai-prompts';
console.log(aiPromptGuide.templates);
console.log(aiPromptGuide.exampleCount);
console.log(aiPromptGuide.guardrails);Use this when:
- documenting what the prompt package supports
- checking prompt inventory in CI or release tooling
- exposing prompt system capabilities in admin UI
Troubleshooting And Prompt Quality Notes
If the model output feels inconsistent, the usual issue is not the package itself but prompt assembly.
- If the model ignores structure, restate the response contract near the end of the prompt.
- If the model invents unsupported components, append an allowlist from your manifest or component registry.
- If outputs are too generic, inject stronger product context such as audience, data shape, and required states.
- If results vary too much across runs, keep examples and evaluation criteria stable and version your prompt composition logic.
Where This Package Fits
@eonui/ai-prompts works best alongside:
@eonui/manifestfor documented component and chart structure@eonui/corefor the actual component vocabulary@eonui/angular,@eonui/react, or@eonui/vuewhen generation targets a specific framework shell
Current Limitations
- it is a prompt asset package, not a model SDK
- it does not perform validation by itself
- templates are intentionally generic and should usually be paired with manifest data
- prompt selection and provider orchestration still belong in application code or an API layer
Future Prospects
Strong next steps for this package include:
- prompt packs by feature area such as auth, settings, analytics, and commerce
- manifest-aware prompt composition helpers
- structured evaluation sets for regression testing
- framework-specific generation templates
- richer guardrails around charts, slots, and theme behavior
