Langsung ke konten
Skillpedia
Analisis & spreadsheet7.6k Β· #13152

data-programs

Fungsinya

Skill ini mengubah skrip data satu kali yang mengambil, menggabungkan, dan menjumlahkan informasi menjadi program tersimpan. Program yang tersimpan menyimpan hasilnya dan menyegarkannya sesuai jadwal, sehingga banyak layar bisa memakai ulang hasil tersebut. Skill ini untuk orang yang membangun dasbor dan laporan di aplikasi Agent-Native.

Kapan dipakai

  • βœ“Saat analisis sementara sebaiknya menjadi sumber data aktif yang bisa dipakai ulang orang lain.
  • βœ“Ketika banyak tampilan terus menjalankan pengambilan data yang sama dan Anda ingin menyimpannya di cache.
  • βœ“Saat Anda ingin grafik atau tabel menampilkan data yang dikumpulkan dari beberapa sumber.

Link skill

https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/data-programs/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/data-programs/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œBisakah Anda menyimpan skrip yang menggabungkan data penjualan dan dukungan kami sebagai sumber yang bisa disegarkan dan dipakai dasbor saya?”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Agent menulis dan menguji skrip terlebih dulu. Setelah itu skrip disimpan sebagai program data, yang berjalan, menyimpan tabel hasil kecilnya di cache, dan menyegarkannya sesuai kebijakan cache.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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

  1. Prototype the fetch/join/aggregate logic as a normal run-code script and confirm it returns the rows you expect.
  2. Change it to call emit(rows, schema?) exactly once at the end instead of returning or printing the result.
  3. Save it with save-data-program({ name, title, description, code, defaultParams?, refreshMode?, refreshTtlMs?, background? }). This dry-runs the code with defaultParams before 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.
  4. 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 its data-programs skill if you want a concrete UI wiring reference.)
  5. 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. rows must 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.log remains 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
Pertanyaan umum

Di mana hasilnya disimpan?

Hasilnya disimpan di cache di basis data SQL aplikasi sebagai sekumpulan kecil baris dan skema.

Siapa yang bisa memakai data tersimpan?

Layar aplikasi mana pun yang menampilkan hasil tersebut bisa memakainya, termasuk pengguna lain yang memiliki akses.

Apakah saya perlu mengatur sesuatu untuk setiap aplikasi?

Tidak. Fitur ini tersedia di mana pun fitur menjalankan kode diaktifkan, jadi tidak ada yang perlu dikonfigurasi lagi.

Detail

Deskripsi asli dari pembuat

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

Popularitas

Bintang GitHub
7.6k
Peringkat
#13152
Lisensi
MIT
Diperbarui
2/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa