AGENT SKILL

数据应用构建工作流

build-workflow

在构建、修改或迭代数据应用或 dashboard 时从这里开始。定义快速迭代的「time to wow」工作流:先交付一个真实的主视觉,用实时数据预览每个视觉,再扩展广度并打磨细节。使用 `rayfin up` 部署以供审查。它编排 dax、fabric-data、visuals、headless-preview 和 app-design 等技能,这样你就不必一开始就把它们全部加载。

License 许可
MIT
最近更新
2026-11-14
Stars
★ 114
Forks
70

01 前言 Front Matter

name
build-workflow
description
START HERE when building, modifying, or iterating on a data app or dashboard. Defines the fast, iterative "time to wow" workflow: ship one real hero visual first, preview every visual against live data, then expand breadth and polish. Deploy with `rayfin up` for review. Orchestrates the dax, fabric-data, visuals, headless-preview, and app-design skills so you don't front-load all of them.

02 资源文件 1

03 SKILL.md 正文

Build Workflow — Ship fast, then iterate

Optimize time to wow: the time until the user sees a real, compelling result in the deployed app. Build a thin vertical slice, preview it, then iterate. Do not front-load exhaustive schema discovery, perfect DAX, or perfect theming before anything is visible — that is the slowest possible path.

Headless preview is the agent validation loop. Preview each visual against live data (npm run preview → PNG + report), wire it into the app, and deploy with rayfin up to ship the result for review.

The loop

Edit → preview each visual (headless) → wire it in → (milestone) deploy with rayfin up → review → refine. Keep each edit/preview loop small and local: the headless preview is your fast inner loop, so rayfin up is a milestone step, not a per-visual one. One reviewed change beats a big-bang build every time.

  • All visuals: render the spec headlessly against live data to a PNG + report — npm run preview — and critique it before it ships. Use it to choose a visual type, check the data fits, and catch clipping/overlap/contrast. (→ headless-preview)

Phases

Phase 1 — Hero slice (time to wow)

Get ONE compelling, real visual wired to live data, previewed, and on screen — as fast as possible.

Scaffold first, then start here. npm run pack:add -- analytics already gave you the dashboard kit + a runnable demo (src/demo). Don't re-read setup or re-copy files — go straight to the hero slice, then swap the demo for it.

  1. Pick an archetype — decide the dashboard's shape from the request: executive summary, operational monitoring, or analytical deep-dive. This frames the hero tile and the breadth that follows. Default to executive summary when unsure. (→ app-design: Dashboard archetypes)
  2. Minimum schema scan — discover just enough to find one compelling metric: one scope probe + the one or two tables/measures behind your hero visual. Don't enumerate the whole model. (→ dax: Fast path)
  3. One hero query — write a single DAX query at the visual's grain, quick-test it once, ship it. (→ dax: Fast path)
  4. One hero visual — render it the simplest way: map the hero query with toChartData, author one Graphein spec, and pass it to a ChartCard (or render a KpiCard / DataTableCard with a table / matrix spec) — pass the mapped spec + loading/error, don't hand-write chart code. (→ visuals: Fast path)
  5. Preview it against live data — npm run preview -- --spec hero.json --query <alias> --dax-file q.dax, view the PNG + report, and tune the spec until it reads well. KPI/table/matrix/slicers/dashboard rasterize to PNG too, so preview them before shipping. (→ headless-preview)
  6. Sensible default theme — pick a characterful font pairing + a primary color and move on. Do not perfect theming yet. (→ app-design: Fast path)
  7. Drop the hero tile into src/App.tsx — the scaffold renders a bundled all-Graphein demo (src/demo/) so a fresh app is never blank; delete src/demo/** and replace <DemoDashboard /> with your hero visual (its providers + slicers + cross-filter wiring are the pattern to copy). Deploy with rayfin up for review.

Stop after the hero slice and use user feedback before going further.

Phase 2 — Breadth

Add the rest of what the user asked for — more KPIs, charts, table/matrix specs, filters. Preview each new visual against live data as you author it — not once at the end. Pull in interactivity (cross-filtering / cross-highlighting) only when the user actually needs it. (→ dax, visuals, headless-preview)

Phase 3 — Polish

Now refine, driven by what the running app actually shows:

  • Theme/typography depth, layout rhythm, and the app-design Final Audit.
  • Loading / empty / error states for every async visual.
  • Edge-case DAX correctness, number/date formatting, dark mode.

(→ app-design and dax reference files — read on demand.)

Rules

  • Preview every visual before it ships. A npm run preview against live data is the validation loop for getting one visual right.
  • Validate visuals headlessly before you deploy. A npm run preview against live data catches problems far faster than a deploy round-trip.
  • Deploy sparingly — rayfin up is a slow round-trip. Use it for milestone review: once after the hero slice, then after a batch of Phase 2 work — never per visual. Headless preview is the per-visual loop, so a "simple dashboard" should reach the user in one or two deploys, not one per tile.
  • One reviewed change at a time. Small loops surface problems immediately.
  • Read references lazily. The sibling skills carry deep references (DAX patterns, visual recipes, style recipes). Open them only when a specific problem demands it — not as upfront reading.
  • Don't gold-plate Phase 1. Exhaustive discovery and perfect theming are Phase 3 concerns; they must never block the first ship.

Skill read order

Don't load every skill upfront. Pull each one in as its phase needs it, and stop at its Fast path section until you genuinely need more.

When Skill How much
Phase 1 — pick a shape app-design Dashboard archetypes
Phase 1 — find a metric dax Fast path only
Phase 1 — write the hero query dax Fast path only
Phase 1 — render it visuals Fast path only
Phase 1 — check it vs live data headless-preview for each visual
Phase 1 — quick default look app-design Fast path only
Phase 2 — breadth & interactivity dax, visuals deeper sections
Phase 2 — vet each new visual headless-preview per visual
Phase 3 — polish & correctness app-design, dax references, on demand
Connections / data plumbing fabric-data only if not already wired

04 同仓库更多 Skills

microsoft
microsoft/awesome-rayfin

visuals

Use when user wants to incorporate charts, graphs, data grid, or other visual representations of data into their project. Use VegaVisual and DataGrid components to create these visuals, utilizing the shared DataTable input, formatting, theme, and interactivity. Covers the onInteraction selection/click events host apps consume, named multi-table data input for layered overlays and reference lines, and Vega-Lite native selections.

★ 114
microsoft
microsoft/awesome-rayfin

schema-discovery

Explore Power BI semantic model schemas using DAX INFO functions. Progressive metadata discovery strategy, scope estimation, and narrowing techniques for tables, columns, measures, and relationships.

★ 114
microsoft
microsoft/awesome-rayfin

rayfin

Use when doing ANY task involving Rayfin — scaffolding, data models, decorators, auth, deployment, CLI commands, or client setup. Triggers: rayfin, rayfin init, rayfin up, rayfin login, RayfinClient, @entity, @role, @anonymous, @authenticated, @text, @uuid, @int, @decimal, @boolean, @date, @email, @set, @one, @many, DAB, Data API Builder, rayfin.yml, publishableKey, signUp, signIn, signOut, sendMagicLink, handleMagicLinkCallback, ensureSignedInWithFabric, Fabric SSO, Entra ID, rayfin up db apply, rayfin up staticapp deploy, schema.ts, OpaqueSession, onSessionChange, GraphQL select, GraphQL create, GraphQL update, GraphQL delete, findById, executePaginated, RLS policy, row-level security, claims.sub, claims.email, TC39 decorators, config generation, dialect, mssql, postgresql

★ 114
microsoft
microsoft/awesome-rayfin

rayfin-connectors

Use for Rayfin connectors that wire existing Fabric SQL data sources (Lakehouse, Warehouse, SQL Database) into an app as GraphQL-backed entities. Triggers: rayfin connector, rayfin up connector apply, connectors:, fabric-sqlanalytics, fabric-warehouse, fabric-sqldatabase, kusto, kql, eventhouse, workspaceId, itemId, operations:, AppConnectorsSchema, ConnectorsSchema, rayfin/connectors/, metadata.json, connector @role policy, connector claims.sub filter, connector claims.email filter, ConnectorsRayfinClient, rayfin-client.ts, client.connectors, connectorConfig, GraphQLBackedConnector, RestrictedDataApi, schema.ts aggregate, generate entities from metadata, add a use case on specific entities, wire connector into client, call a connector from the SDK, rayfin connector inspect, inspect connector data, sample connector rows, fabric-semanticmodel, --entity, --query, DAX EVALUATE, read-only sample query, rayfin connector search, discover connectable sources, find fabric sources to add, --all-workspaces, --workspace-id, connector search interactive picker, rayfin connector invoke, invoke a connector operation, run executeQuery, --input, --file, RAYFIN_FEATURE_FLAGS, resultSetRowCountLimit, limit rows, row limit, cap rows, too many rows, overflow

★ 114
microsoft
microsoft/awesome-rayfin

query-design

Separates DAX data-fetching from TypeScript presentation. Guides when to use DAX vs. TypeScript vs. Vega-Lite for aggregation, total rows, FORMAT(), SELECTCOLUMNS, BLANK handling, filtering, multi-grain queries, cross-filtering and cross-highlight subset/overlay queries, and format strings.

★ 114
microsoft
microsoft/awesome-rayfin

playwright-cli

Automate browser interactions, test web pages and work with Playwright tests.

★ 114