generative-ui
यह क्या करती है
यह स्किल बताती है कि एजेंट चैट में सैंडबॉक्स्ड Alpine.js और Tailwind से बना इनलाइन इंटरैक्टिव UI कैसे दिखा सकता है। इसमें एक बार के कंट्रोल और सहेजे मिनी ऐप शामिल हैं। यह उन लोगों के लिए है जिन्हें बातचीत में त्वरित इंटरैक्टिव सहायक चाहिए।
कब इस्तेमाल करें
- ✓जब आप चैट के भीतर स्लाइडर, पिकर या कैलकुलेटर जैसा त्वरित कंट्रोल चाहते हैं।
- ✓जब बातचीत के लिए अस्थायी चार्ट या प्रीव्यू मददगार हो।
- ✓जब कोई उपयोगी विजेट सहेजा जाना चाहिए ताकि बाद में फिर खोला जा सके।
Skill का लिंक
https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/generative-ui/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“इस चैट में एक स्लाइडर दीजिए जिससे मैं कीमत बदलकर कुल योग बदलता हुआ देख सकूं।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट एक छोटा सैंडबॉक्स्ड HTML कंट्रोल इनलाइन दिखाता है। उसकी वैल्यू अगले टर्न में एजेंट को वापस भेजी जा सकती है, और सहेजा संस्करण बाद में फिर खोला जा सकता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Generative UI
Generative UI is sandboxed Alpine.js HTML rendered inline in chat. It is not a source-code change and does not go through Builder.
Pick the Lifetime
- Use
render-inline-extensionfor one-off UI that belongs only in the current chat: knobs, controls, pickers, calculators, temporary charts, and previews. - Use
create-extensionwhen the UI should be saved, reusable, or visible in the Extensions view. It also renders inline after creation. - Use
show-extension-inlineto reopen a saved extension inside chat. - Use
update-extensionto edit an existing saved extension.
Inputs From Chat
Pass initial values through the action context argument. The iframe reads them
from window.slotContext and can subscribe to changes with
window.onSlotContext(fn).
<script>
Alpine.data("controls", () => ({
threshold: 50,
init() {
this.threshold = Number(window.slotContext?.threshold ?? 50);
window.onSlotContext?.((ctx) => {
if (ctx.threshold !== undefined) {
this.threshold = Number(ctx.threshold);
}
});
},
}));
</script>
Outputs To The Agent
Use passive output when a control's current value should be visible to the agent on the next turn without requiring a submit click:
<input
type="range"
min="0"
max="100"
x-model.number="threshold"
@input="agentNative.ui.output({ threshold }, { label: 'Threshold' })"
/>
agentNative.ui.output(value, opts?) writes application state at:
inline-ui:<extensionId>:output
The id is scoped automatically; the HTML author must not pass it. When the user says "use that value", "apply the current setting", or "run it with the current selection", read the value with:
const output = await readAppState("inline-ui:<id>:output");
The stored payload includes value, updatedAt, extensionId, and
source: "inline-ui", plus optional label, context, or meta.
Use agentNative.chat.send(message, opts?) or sendToAgentChat(message, opts?)
for a visible Apply/Submit button that should send a prompt or selected value
into the chat. Pass { submit: true } explicitly for that user-triggered
action; extension messages are draft-only otherwise. Never call these helpers
from polling, refresh, or error handlers.
App Data And State
- Prefer
appAction(name, params)for template data and operations. - Use
appFetch(path, options)only for allowed framework endpoints under/_agent-native/*, including application-state reads and writes. - Do not call template
/api/*routes from generated UI. - Use
dbQuery/dbExeconly for known existing SQL tables when no action fits. - Use
extensionFetchfor external APIs through the sandbox proxy and secrets.
Transient extensionData Boundary
For saved extensions, extensionData uses the authenticated database-backed
extension data API.
For transient inline UIs, extensionData is host localStorage. The agent
cannot read it, it does not sync across devices, it does not migrate when a UI
is promoted to a saved Extension, and the server does not garbage-collect it.
Use it only for throwaway local UI state.
For anything the agent or app must observe, use agentNative.ui.output,
application state through appFetch, an appAction, or
agentNative.chat.send.
Styling
Use semantic Tailwind classes so the iframe inherits the parent app theme:
bg-background,text-foreground,border-borderbg-card,text-card-foregroundbg-primary,text-primary-foregroundtext-muted-foreground,bg-accent
Do not hardcode provider tokens, private data, or internal secrets in generated HTML. Do not call an LLM directly from the iframe; route AI work through the agent chat.
अक्सर पूछे जाने वाले सवाल
क्या यह आपके ऐप के कोड में बदलाव है?
नहीं। यह चैट में इनलाइन UI है और ऐप के सोर्स कोड को नहीं बदलता।
क्या एजेंट देख सकता है कि मैंने कंट्रोल में क्या सेट किया?
हां। वैल्यू बिना submit क्लिक के निष्क्रिय आउटपुट के रूप में एजेंट को लौटाई जा सकती है।
एक बार के और सहेजे UI में क्या अंतर है?
एक बार का UI केवल मौजूदा चैट में रहता है, जबकि सहेजा UI दोबारा इस्तेमाल हो सकता है और extensions व्यू में दिखता है।
जानकारी
लेखक का मूल विवरण
Generate transient or saved inline chat UI with Alpine/Tailwind controls, outputs, app state, and extensions. Use for knobs, pickers, calculators, dashboards, widgets, or reusable mini-apps.
repo: BuilderIO/agent-native
लोकप्रियता
- GitHub स्टार
- 7.6k
- रैंकिंग में स्थान
- #13162
- लाइसेंस
- MIT
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
design-exploration
7.6kयह आपके एजेंट को UI के कई डिज़ाइन विकल्प साथ-साथ दिखाने, आपकी पसंद चुनवाने और फिर चुने डिज़ाइन को सुधारने में मदद करती है।
visual-edit
7.6kयह आपके एजेंट को चल रहे लोकल ऐप को विज़ुअल एडिटर में खोलने देती है, ताकि आप उसकी असली स्क्रीन एक साथ देखकर संपादित कर सकें।
turn-into-app
7.6kयह किसी वर्कफ़्लो, स्प्रेडशीट या प्रोजेक्ट को भरी हुई स्क्रीन वाले विज़ुअल ऐप में बदलती है, जिसके कंट्रोल के पीछे एजेंट काम करता है।
visual-plan
7.6kयह सादे टेक्स्ट वाली योजना को डायग्राम, फ़ाइल नक्शों, कोड अंश और खुले सवालों वाली इंटरैक्टिव विज़ुअल योजना में बदलती है।
मिलती-जुलती skills
canvas
394kयह आपके एजेंट को जुड़े Mac पैनल पर होस्टेड विज़ुअल विजेट दिखाने, पैनल छिपाने या उसे दूसरे पेज पर ले जाने देती है।
control-ui
394kयह आपके एजेंट को OpenClaw Control UI को व्यवस्थित करने और उसमें आने वाली दिक्कतें सुलझाने में मदद करती है, जिसमें सेशन, डैशबोर्ड और जुड़े Gateway शामिल हैं।
diagram-maker
394kयह आपके एजेंट को प्रक्रियाओं, सिस्टम आर्किटेक्चर और व्हाइटबोर्ड स्केच के लिए SVG, HTML या संपादन योग्य Excalidraw फ़ाइलों में साफ़ डायग्राम बनाने में मदद करती है।