template-gallery
Use when working in the Awesome Rayfin template gallery repo — creating, validating, or updating templates under templates/, regenerating gallery manifests, or updating the templates table in README. Triggers: awesome-rayfin, template gallery, templates/, new-template.sh, generate-manifest.mjs, rayfin-template.yml, manifest.json, template metadata, templateId, template.name, template.displayName, template.description, rayfin init -t, scaffold template, gallery README, leaf manifest, root manifest
- License 许可
- MIT
- 最近更新
- 2026-11-09
- Stars
- ★ 111
- Forks
- 70
01 前言 Front Matter
- name
- template-gallery
- metadata
- { "author": "microsoft", "version": "0.1.0" }
- description
- Use when working in the Awesome Rayfin template gallery repo — creating, validating, or updating templates under templates/, regenerating gallery manifests, or updating the templates table in README. Triggers: awesome-rayfin, template gallery, templates/, new-template.sh, generate-manifest.mjs, rayfin-template.yml, manifest.json, template metadata, templateId, template.name, template.displayName, template.description, rayfin init -t, scaffold template, gallery README, leaf manifest, root manifest
03 SKILL.md 正文
Template Gallery Skill
Use this skill when working in the Awesome Rayfin template gallery repo. This is an operational checklist for creating, validating, and maintaining gallery templates.
Goal
Make changes that keep individual templates, generated manifests, and gallery documentation consistent.
Before you change anything
- Read
docs/template-guidelines.mdfor the expected template structure. - Read the root
AGENTS.mdfor gallery-specific workflow guidance. - Use the
rayfinMCP server from.mcp.jsonwhen you need Rayfin SDK or CLI docs. - Review a nearby template in
templates/if you need a working example. - Use
.scratchpad/for any temporary or working files — it is git-ignored.
Create a new template
- Run:
./scripts/new-template.sh <name> "<Display Name>" "<description>" - Open the new
templates/<name>/directory. - Customize the generated files, especially:
src/for the application UI and client logicrayfin/data/for entities and schema definitionsrayfin/rayfin.ymlfor service configuration
- Update any placeholder content in
README.md,manifest.json, andpackage.json. - Confirm
package.jsonincludes:template.nametemplate.displayNametemplate.description
- If the template adds new routes or features, make sure the README explains what the template demonstrates.
Validate a template
- Verify generated manifests are in sync:
node scripts/generate-manifest.mjs --check - Smoke-test scaffolding in a fresh scratch directory:
If the CLI supports it in your environment, point the output to a new empty directory so you can inspect the scaffolded result safely.rayfin init -t . --template-name "<name>" - Check the scaffolded output contains the expected project files, especially
package.json. - Re-open the source template's
package.jsonand confirmtemplate.name,template.displayName, andtemplate.descriptionare present and correct. - If the repo workflow or your change touches manifest generation, compare the regenerated files before finishing.
Update the gallery after template changes
After changing template metadata or adding/removing templates, run:
node scripts/generate-manifest.mjs
This regenerates:
- root
rayfin-template.yml - per-template
rayfin-template.yml - the templates table in
README.md
Do not hand-edit generated manifest content if the script owns it.
Required template structure
Each template should include these files:
package.jsonwith template metadatamanifest.jsonrayfin-template.ymlrayfin/rayfin.ymlrayfin/data/schema.tsREADME.mdindex.htmlsrc/main.tsxtsconfig.jsonvite.config.ts
If any required file is missing, add it before considering the template complete.
Common patterns
Add a data entity
- Create a new file in
rayfin/data/. - Define the entity with decorators from
@microsoft/rayfin-core. - Export the entity from
rayfin/data/schema.tsso the schema includes it. - Update any app code that reads or writes the new entity.
- Document the new data model in the template README if it changes what the template demonstrates.
Add a page
- Create the page component in
src/pages/. - Add the route in
src/App.tsx. - Link to the page from navigation or the relevant entry point.
- Verify the page works with the template's auth and data model.
Cross-platform compatibility (Windows + macOS/Linux)
Templates are used on Windows, macOS, and Linux. Check for platform issues when adding or modifying scripts:
- Prefer
.mjsover.shfor any script that end users run. Shell scripts are fine for contributor tooling only (e.g.,scripts/new-template.sh). - No Unix-only assumptions in runtime scripts: avoid hardcoded Unix socket paths (
/var/run/docker.sock), symlinks, or POSIX-only APIs without a Windows fallback. - Use
process.platformguards when behavior diverges (e.g., Docker daemon detection uses sockets on Unix but named pipes/CLI on Windows). - Use
cross-envfor environment variables in npm scripts — never rely onVAR=value cmdsyntax. - Avoid path separators in JS: use
path.join()/path.resolve()instead of string concatenation with/. &&chaining in npm scripts is safe (works in cmd, PowerShell 7+, and bash).
When reviewing or validating a template, scan scripts for:
- Hardcoded Unix paths (
/var/run/,/tmp/,~/.docker/run/) - Socket or pipe assumptions without platform checks
- Shell-specific syntax in npm scripts (backticks,
$(...),export) - File permission operations (
chmod,chown) without guards
Final checklist
- Template structure matches
docs/template-guidelines.md - Template metadata in
package.jsonis complete node scripts/generate-manifest.mjs --checkpassesrayfin init -t . --template-name "<name>"works for the changed template- Generated gallery files were refreshed with
node scripts/generate-manifest.mjswhen needed - README and manifest content reflect the actual template behavior
04 同仓库更多 Skills
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.
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.
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
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
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.
playwright-cli
Automate browser interactions, test web pages and work with Playwright tests.