agentleFS
MicrosoftKnown publishermicrosoft/rayfin/samples/universal-app/template/.agents/skills/connectors/SKILL.md

connectors

Skill646 starsChanged 37 days agoMITView on GitHub

Connect a Universal App to existing Fabric data sources: a Warehouse, SQL database, Lakehouse SQL analytics endpoint, or Power BI semantic model. Use whenever the user says "connect to", names an existing Fabric item, asks to query data that already exists, or needs to discover available sources. This skill owns the Universal App pack, source routing, and the handoff to the installed Rayfin connector catalog and package docs. It does not cover app-owned CRUD data (use `data-modeling`) or arbitrary external APIs (use `functions-capability`).

  • Installs packages

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

25 rules. 0 are common, 11 are distinctive, and 14 are very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 11

    Distinctive

    This author's own choices. Worth a look.

  • 14

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do not copy connector capabilities, operations, package versions, or client APIs from this skill.

    line 33
  2. Distinctive:

    Read the installed, version-matched contracts before authoring:

    line 35
  3. Very specific:

    Run npx rayfin connector types --json for the live type catalog.

    line 37
  4. Very specific:

    After connector add, read the installed connector package's package.json, follow its rayfinDocs.dir, and use its entity-generation and …

    line 41
  5. Distinctive:

    Do not substitute a nearby source type or sample data when the requested type is unavailable.

    line 62
  6. Distinctive:

    If the user named a source but did not provide explicit IDs, search for it:

    line 69
  7. Very specific:

    Before deployment there is no workspace scope to infer.

    line 75
  8. Very specific:

    Use --all-workspaces for a tenant-wide scan, or replace it with --workspace-id <id> when the workspace is known.

    line 76
  9. Very specific:

    Prefer --json so you can compare displayName, workspaceName, workspaceId, itemId, and connectorType without parsing a table.

    line 79
  10. Distinctive:

    No match: say what you searched for and ask for a corrected name or explicit IDs.

    line 86
  11. Distinctive:

    Never guess a source.

    line 89
  12. Very specific:

    Use a short lower-camel-case alias such as salesWarehouse.

    line 98
  13. Distinctive:

    Do not install them at the workspace root or create a nested lockfile.

    line 108
  14. Very specific:

    Use rayfin/connectors/<alias>/metadata.json only through the installed package's generation contract.

    line 113
  15. Distinctive:

    Do not recreate those package-owned contracts from memory.

    line 118
  16. Very specific:

    After the aggregate schema exports <Name>Schema and connectorConfig, take ownership before editing by deleting that generated-marker line.

    line 127
  17. Very specific:

    import <Name>Schema and connectorConfig from the aggregate schema.ts.

    line 131
  18. Very specific:

    add <alias>: <Name>Schema to AppConnectorsSchema.

    line 132
  19. Very specific:

    Do not rerun rayfin connector add --yes after authoring entities: --yes opts in to replacing the hand-authored aggregate schema.ts with a …

    line 136
  20. Distinctive:

    If the CLI later reports manual wiring, merge its printed maps into the Builder-owned file instead of restoring the generated marker.

    line 138
  21. Very specific:

    Use the typed client surface documented by the installed connector package for application reads and writes.

    line 150
  22. Distinctive:

    Treat connector errors as configuration, permissions, or query errors to fix, not warnings to bypass.

    line 159
  23. Distinctive:

    After wiring application code, run the normal project gates from the workspace root:

    line 162
  24. Very specific:

    Before browser validation, follow the connector deployment-outcome invariant in app-deployment.

    line 172
  25. Very specific:

    Do not treat overall rayfin up success as proof that a required connector was generated and applied.

    line 174

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Connect to an existing Fabric data source

First install the app-side connector support:

npm run pack:add -- connectors

The rayfin connector command group is always available and requires no pack or service flag. This pack adds the frontend connector SDK and seeds packages/frontend/src/lib/connectors.ts plus the composable Rayfin client. It does not add services.connectors or declare a data source. rayfin connector add owns the top-level connectors: configuration and the per-source files under rayfin/connectors/. Re-applying the pack is safe.

Read the live connector contracts

Do not copy connector capabilities, operations, package versions, or client APIs from this skill. Read the installed, version-matched contracts before authoring:

  1. Run npx rayfin connector types --json for the live type catalog.
  2. Read node_modules/@microsoft/rayfin-guide/assets/docs/cli/connectors/index.md and the page for the command you are about to run.
  3. After connector add, read the installed connector package's package.json, follow its rayfinDocs.dir, and use its entity-generation and typed-client pages.

The guide routes Category A details to @microsoft/rayfin-connector-fabric-graphql. Its installed docs own metadata.json, entity generation, aggregate schema.ts, authorization, typed queries, and mutation behavior.

Route by source type

User's sourceConnector type or route
Fabric Warehousefabric-warehouse
Fabric SQL databasefabric-sqldatabase
Lakehouse SQL analytics endpointfabric-sqlanalytics
Power BI semantic modelnpm run pack:add -- connectors, then npm run pack:add -- analytics
Kusto / KQL databaseCheck the live catalog; if it is absent, say it is unavailable and stop
External API, custom model endpoint, or Fabric data agentnpm run pack:add -- functions, then follow functions-capability

The Lakehouse route is its SQL analytics endpoint, not direct access to files. Do not substitute a nearby source type or sample data when the requested type is unavailable.

Discover before connecting

Set <source-type> to the exact value from the table and confirm it still appears in connector types --json. If the user named a source but did not provide explicit IDs, search for it:

npx rayfin connector search "<name>" --type <source-type> --all-workspaces --json

Before deployment there is no workspace scope to infer. Use --all-workspaces for a tenant-wide scan, or replace it with --workspace-id <id> when the workspace is known. Both explicit scopes require --type. Prefer --json so you can compare displayName, workspaceName, workspaceId, itemId, and connectorType without parsing a table. Each result also carries a ready-to-run addCommand; prefer that command over reconstructing connector add flags by hand.

  • One unambiguous match: use it.
  • Several plausible matches: show the workspace names and ask which one.
  • No match: say what you searched for and ask for a corrected name or explicit IDs.

Never guess a source.

Add the connector

npx rayfin connector add --type <source-type> \
  --workspace-id <workspaceId> --item-id <itemId> --name <alias>

Use a short lower-camel-case alias such as salesWarehouse. add records the connection in rayfin/rayfin.yml, creates a placeholder rayfin/connectors/<alias>/schema.ts plus metadata.json when schema discovery succeeds, and prints version-pinned package specifications. Install those exact versions into the frontend workspace from the app root:

npm install -w @rayfin-app/frontend <printed-packages-and-versions>

Do not install them at the workspace root or create a nested lockfile.

Generate and wire Category A entities

connector add discovers metadata but does not emit the entity files. Use rayfin/connectors/<alias>/metadata.json only through the installed package's generation contract. Follow the installed @microsoft/rayfin-connector-fabric-graphql docs to generate only the entities the app needs and replace the placeholder aggregate schema.ts. Do not recreate those package-owned contracts from memory.

The CLI-generated packages/frontend/src/lib/connectors.ts carries this ownership marker:

// @generated by `rayfin connector add` — do not edit below this line.

After the aggregate schema exports <Name>Schema and connectorConfig, take ownership before editing by deleting that generated-marker line. Then add the same connector name in all matching locations:

  • import <Name>Schema and connectorConfig from the aggregate schema.ts;
  • add <alias>: <Name>Schema to AppConnectorsSchema;
  • add <alias>: connectorConfig to connectorConfigs.

Category A needs no connectorRuntimes entry. Do not rerun rayfin connector add --yes after authoring entities: --yes opts in to replacing the hand-authored aggregate schema.ts with a placeholder. If the CLI later reports manual wiring, merge its printed maps into the Builder-owned file instead of restoring the generated marker.

Sample the source before building UI

List the real entities, then sample one through the read-only inspection path:

npx rayfin connector inspect --name <alias>
npx rayfin connector inspect --name <alias> --entity <entity> --rows 1

Use the typed client surface documented by the installed connector package for application reads and writes. That is the generated client.connectors.<alias>.<Entity> surface, not a raw query operation invented in application code. Category A SQL connectors do not use connector invoke as their authoring workflow. This CLI sample proves source access and shape only. It does not replace deployed browser validation from app-validation. Treat connector errors as configuration, permissions, or query errors to fix, not warnings to bypass.

After wiring application code, run the normal project gates from the workspace root:

npm run typecheck
npm run build
npm run lint
npm test

Before browser validation, follow the connector deployment-outcome invariant in app-deployment. Do not treat overall rayfin up success as proof that a required connector was generated and applied.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.