data-programs
यह क्या करती है
यह स्किल एक बार चलने वाली डेटा स्क्रिप्ट को सहेजे गए प्रोग्राम में बदलती है, जो जानकारी लाती है, जोड़ती है और कुल निकालती है। सहेजा प्रोग्राम अपने नतीजे रखता है और तय समय पर रीफ़्रेश होता है, ताकि कई स्क्रीन उसे दोबारा इस्तेमाल कर सकें। यह Agent-Native ऐप में डैशबोर्ड और रिपोर्ट बनाने वालों के लिए है।
कब इस्तेमाल करें
- ✓जब कोई तात्कालिक विश्लेषण ऐसा लाइव डेटा स्रोत बनना चाहिए जिसे दूसरे दोबारा इस्तेमाल कर सकें।
- ✓जब कई दृश्य बार-बार एक ही डेटा फ़ेच दोहराते हैं और आप उसे कैश करना चाहते हैं।
- ✓जब आप चाहते हैं कि चार्ट या टेबल कई स्रोतों से जुटाया डेटा दिखाए।
Skill का लिंक
https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/data-programs/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“हमारे बिक्री और सपोर्ट डेटा को जोड़ने वाली यह स्क्रिप्ट सहेजिए, ताकि मेरा डैशबोर्ड इसे रीफ़्रेश कर सके।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट पहले स्क्रिप्ट लिखकर परखता है। फिर उसे एक डेटा प्रोग्राम के रूप में सहेजता है, जो चलता है, अपनी छोटी परिणाम तालिका कैश करता है, और कैश नीति के तहत उसे रीफ़्रेश करता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Data Programs
A data program is a named, stored, agent-authored JS script that fetches,
joins, filters, or aggregates data — provider APIs via providerFetch /
providerFetchAll / providerSearchAll, app data via appAction, or
Resources-backed workspace files — and emits a small { rows, schema }
result that gets cached in SQL. Any app can render that result through its
own table/chart components; nothing about the primitive is analytics-specific.
This ships automatically wherever run-code is available — there is nothing
to mount, wire, or configure per app. If your app already has run-code
enabled, save-data-program / preview-data-program / run-data-program /
list-data-programs / get-data-program / delete-data-program are already
registered actions.
Why this exists
Without it, "build a live view of X" tends to end in one of two bad places:
a hardcoded action per vendor/query shape (brittle, doesn't scale to every
customer's custom fields), or re-running the same fetch/join logic from
scratch on every page view (slow, and it re-spends the same provider quota
every time someone looks at a chart). A data program is the middle ground:
write the fetch/join/aggregate logic once as ordinary run-code, save it, and
let the cache + refresh policy handle "how often does this actually need to
re-run."
Authoring workflow
- Prototype the fetch/join/aggregate logic as a normal
run-codescript and confirm it returns the rows you expect. - Change it to call
emit(rows, schema?)exactly once at the end instead of returning or printing the result. - Save it with
save-data-program({ name, title, description, code, defaultParams?, refreshMode?, refreshTtlMs?, background? }). This dry-runs the code withdefaultParamsbefore persisting and rejects the save with a structured error if it fails, so a broken program is never stored. On success it returns{ programId, rowCount, columns, sampleRows }— use that as proof the program produces the rows you expect. - Bind whatever UI needs the result. Your app's own read path calls
run-data-program({ programId, params?, forceRefresh?, includeRows? })and gets back rows/schema/cache metadata to hand to your own table/chart components — there is no dashboard-specific plumbing baked into the primitive itself. (The analytics template's"program"dashboard panel source is one such adoption, not a required pattern — see itsdata-programsskill if you want a concrete UI wiring reference.) - Iterate without persisting via
preview-data-program({ code, params? })— same dry-run path, no stored row.
The sandbox surface
Exactly the run-code globals (providerFetch, providerFetchAll,
providerSearchAll, appAction, webFetch, workspace* Resources helpers),
plus:
params— a frozen global object holding the params for this run. Read-only; mutating it throws.emit(rows, schema?)— call exactly once, at the end.rowsmust be an array of plain objects.schema, when provided, is{ name: string, type: string }[]; when omitted it's inferred from the first 50 rows (a column is"json"if rows disagree on primitive type, otherwise"number"/"string"/"boolean").console.logremains free for debugging and never interferes with parsing the emitted result.
Caps enforced on every run:
| Limit | Value |
|---|---|
| Max emitted rows | 10,000 (excess dropped, truncated: true) |
| Max emitted result size | 4 MiB (rows dropped from the end to fit; a single oversized row is a hard failure) |
| Max active programs per app | 200 |
| Minimum refresh TTL | 60,000 ms |
| Run rows kept per (program, params) | 5 most recent |
Truncation is always explicit (truncated: true) — never a silent drop.
Caching and refresh model
Every (programId, paramsHash) pair has its own run history:
| Situation | Behavior |
|---|---|
Fresh cache (younger than refreshTtlMs, or refreshMode: "manual" with a prior success) |
Returns cached rows instantly, cacheHit: true |
| Stale cache | Re-executes synchronously (25s budget for view-triggered reads, 120s for agent/manual calls), replacing the cache on success |
refreshMode: "manual" |
Only refreshes on explicit forceRefresh: true |
| No cache yet | Executes synchronously like a normal first fetch |
background: true program with no fresh cache |
Serves the last good run with stale: true and enqueues a du |
अक्सर पूछे जाने वाले सवाल
नतीजा कहां सहेजा जाता है?
नतीजा ऐप के SQL डेटाबेस में कुछ पंक्तियों और एक schema के रूप में कैश होता है।
सहेजा डेटा कौन इस्तेमाल कर सकता है?
नतीजा दिखाने वाली कोई भी ऐप स्क्रीन इस्तेमाल कर सकती है, जिसमें पहुंच वाले दूसरे यूज़र भी शामिल हैं।
क्या हर ऐप के लिए कुछ सेट करना होगा?
नहीं। यह वहां उपलब्ध है जहां run-code फ़ीचर चालू है, इसलिए अलग से कुछ कॉन्फ़िगर नहीं करना होता।
जानकारी
लेखक का मूल विवरण
Save a run-code fetch/join/aggregate script as a stored, refreshable data source any app's own charts/tables can render, instead of a hardcoded provider action or a per-view re-fetch. Use when an ad-hoc run-code or provider-api-request analysis should become a live, cached data source other users or panels can reuse.
repo: BuilderIO/agent-native
लोकप्रियता
- GitHub स्टार
- 7.6k
- रैंकिंग में स्थान
- #13152
- लाइसेंस
- 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
gitcrawl
394kयह आपके एजेंट को GitHub issues और pull requests के सेव आर्काइव में खोजने, मिलते-जुलते मामलों को समूह में रखने और लाइव स्थिति जांचने देती है।
slacrawl
394kयह आपके एजेंट को स्थानीय Slack आर्काइव में संदेश खोजने और गिनने, उसकी ताज़गी जांचने और ज़रूरत पड़ने पर उसे ताज़ा करने देती है।
goplaces
394kयह आपके एजेंट को Google Places से जगहें खोजने, उनका विवरण और समीक्षाएं पाने, और जगह के नाम हल करने में मदद करती है, स्क्रिप्ट के लिए JSON आउटपुट के साथ।