본문으로 건너뛰기
Skillpedia
분석 및 스프레드시트7.6k · #13152

data-programs

하는 일

이 스킬은 데이터를 가져오고, 결합하고, 합산하는 일회성 스크립트를 저장된 프로그램으로 바꿉니다. 저장된 프로그램은 결과를 보관하고 일정에 따라 새로고침해, 여러 화면이 재사용할 수 있게 합니다. Agent-Native 앱에서 대시보드와 보고서를 만드는 사람을 위한 스킬입니다.

사용하는 경우

  • ✓임시 분석을 다른 사람들이 재사용할 수 있는 실시간 데이터 소스로 만들고 싶을 때.
  • ✓여러 뷰가 같은 데이터 가져오기를 계속 다시 실행해서 캐시하고 싶을 때.
  • ✓여러 출처의 데이터를 모아 차트나 표로 보여 주고 싶을 때.

스킬 링크

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

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/data-programs/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“영업 데이터와 지원 데이터를 합치는 이 스크립트를 대시보드가 새로고침할 수 있는 소스로 저장해 주실 수 있나요?”

매주 새 스킬 5개. 읽는 데 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

  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
자주 묻는 질문

결과는 어디에 저장되나요?

앱의 SQL 데이터베이스에 작은 행 묶음과 스키마로 캐시됩니다.

저장된 데이터는 누가 쓸 수 있나요?

결과를 렌더링하는 모든 앱 화면이 쓸 수 있으며, 접근 권한이 있는 다른 사용자도 포함됩니다.

앱마다 따로 설정해야 하나요?

아니요. 코드 실행 기능이 켜져 있는 곳이라면 어디서나 쓸 수 있어, 따로 설정할 것이 없습니다.

상세 정보

작성자의 원본 설명

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
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬