genbi
它能做什么
这个技能指导从 Wren 项目构建基于浏览器的商业智能应用,并将其部署到 Vercel 或 Cloudflare,附带可分享的链接。适合希望在无需数据库登录的情况下与同事分享数据视图的分析师。
适用场景
- ✓当你希望从 Wren 数据构建一个可分享的仪表板或报告应用时。
- ✓当你需要在数据快照和与数据仓库的实时连接之间做选择时。
- ✓当你希望把应用部署到你自己的 Vercel 或 Cloudflare 账户时。
技能链接
https://github.com/Canner/WrenAI/blob/main/core/wren/src/wren/skills_content/genbi/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请把我的 Wren 销售项目转化为一个可分享的仪表板应用,使用数据快照,并部署好让我获得一个链接。”
每周 5 个新技能,1 分钟读完。
工作原理
该技能让 CLI 生成构建说明,由你的智能体在其自己的文件夹中编写应用,然后注册、验证并部署应用,生成一个公开链接。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Wren GenBI App — Agent Workflow Guide
This guide is served by the
wrenCLI (wren skills get genbi), so it always matches your installed wrenai version.
Turn a Wren context layer into a shareable GenBI app — from a natural-language request to a public URL in one conversation.
Division of labor: the CLI owns the authoritative build instruction (it
knows the live project facts and the pinned wren-core-wasm version) and all
deterministic state (index, verify, deploy). You — the agent — author the app
code by following the instruction. Never hand-write .wren/apps.yml.
Preconditions
- A Wren project is discoverable (
wren_project.ymlin cwd/ancestors, or ask for the path and pass-p). - The context layer exists. If
target/mdl.jsonis missing,wren genbi buildcompiles it implicitly — no separate step needed. wrenCLI ≥ the version that ships thegenbicommand group (wren genbi --helpworks).
Workflow
1. Resolve the app name and data mode
- App name: short kebab-case derived from the request (e.g.
sales-overview). - Data mode:
snapshot(default) — data is bundled with the app as parquet/duckdb and queried client-side. Fully serverless. Right for demos, reports, small data, and dlt-pipeline output.live— the app calls back to the user's warehouse/API at view time. Right for production-scale or always-fresh data. Requires a CORS-enabled endpoint and carries strict no-credentials rules.
- Ask the user ONLY if the choice is genuinely ambiguous.
2. Get the build instruction
wren genbi build <name> --prompt "<the user's request, verbatim>" --data-mode <mode>
For long or multi-line prompts use --prompt-file <file> or pipe to
--prompt -. The command prints the authoritative build instruction —
wasm wiring (pinned version, CDN load), the project's model/column inventory,
data-mode guidance, acceptance criteria, and the target folder. It writes no
app files — the only thing it may touch is target/mdl.json, which it compiles
first if missing (see Precondition 2).
3. Author the app
Follow the instruction exactly. Key conventions:
- Write everything under
apps/<name>/— never outside it. - Copy the compiled MDL into the app as
apps/<name>/mdl.json. - Load
wren-core-wasmfrom the CDN given in the instruction; never bundle the ~68MB binary. - snapshot: export the data the dashboard needs into
apps/<name>/data/as parquet (verifyrequires at least one.parquet/.duckdbasset). See Snapshot data export below for the recipe and where the data comes from. - live: write an endpoint-only connection config. NEVER inline credentials —
verifyscans for them (best-effort) anddeploygates onverify, but the rule is on you: a public static host exposes every shipped file. - Design the dashboard to actually answer the user's request: pick the right charts/tables for the question, not a generic template.
Snapshot data export
The CLI hands you the build instruction, but the snapshot bytes still have to be exported into the app folder — that step is yours.
Where the data comes from:
- DuckDB-backed project (incl. anything loaded by the
dlt-connectorskill — its pipelines always land in a.duckdbfile): the project's DuckDB file is your snapshot source. If the user is connecting SaaS data (HubSpot, Stripe, Salesforce, …) and has no project yet, run the SaaS→project flow first:wren skills get dlt-connector. Then come back here to ship it. - Warehouse-backed project (Postgres, BigQuery, Snowflake, …): run the
query/queries the dashboard needs through the MDL layer and write the result
to parquet. Keep snapshots small — snapshot mode is for demos/reports, not
full warehouse extracts; use
livemode for large or always-fresh data.
Recipe (DuckDB → parquet):
# from the project root; <db> is the project's DuckDB file (see wren_project.yml)
python - <<'PY'
import duckdb
con = duckdb.connect("<db>.duckdb", read_only=True)
con.execute(
"COPY (SELECT * FROM <table>) "
"TO 'apps/<name>/data/<table>.parquet' (FORMAT parquet)"
)
PY
Only export the columns/rows the dashboard uses. The compiled mdl.json you
copied in keeps the context layer intact regardless of how you bundle data.
4. Register and verify
wren genbi register <name> --data-mode <mode>
wren genbi verify <name>
If verify fails: fix the reported problems and
常见问题
快照模式和实时模式有什么区别?
快照会把数据与应用打包在一起并在浏览器中运行;而实时模式每次有人查看时都会回调数据仓库。
支持哪些托管平台?
该技能部署到用户自己的 Vercel 或 Cloudflare 账户。
谁来编写应用代码?
你的智能体根据 CLI 的构建说明编写应用,而 CLI 负责索引、检查和部署。
详情
作者的原始描述
Turn a Wren project's context layer into a shareable, browser-side GenBI web app and deploy it to the user's Vercel or Cloudflare account. Orchestrates the full flow: `wren genbi build` returns a project-hydrated build instruction, the agent authors the app from scratch into apps/<name>/, then register → verify → deploy produce a shareable URL. Use this skill whenever the user wants to: build a dashboard from their Wren project, make a shareable analytics app, deploy their context layer as a web app, host a GenBI app on Vercel or Cloudflare Pages, or asks for a 'genbi app'.
repo: Canner/WrenAI
热度
- GitHub 星标
- 18k
- 排名
- #10726
- 许可证
- —
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
dlt-connector
18k帮你的智能体把 HubSpot、Stripe 等 SaaS 工具的数据加载到本地 DuckDB 文件中,以便用 Wren SQL 进行分析。
enrich-context
18k帮你的智能体为 Wren 数据项目补充业务含义,例如单位、枚举值、同义词和标准指标。
generate-mdl
18k帮你的智能体通过探索数据库结构、规范化类型并生成 YAML 文件,来创建 Wren 语义项目。
onboarding
18k帮你的智能体从零开始设置 Wren Engine:检查环境、创建项目、连接数据库并运行第一条查询。