fabric-org-app-template
AGENTS.md1 starsChanged 6 months agoMITView on GitHub
Instructions for the migration agent that turns this template into a working app for the user's Power BI Org App. This file is auto-loaded by GitHub Copilot CLI (and by other agentic tools that read AGENTS.md). Migrate a Power BI Org App into this template. Inputs from the user: Before doing anything, confirm with the user: where <WORKSPACE_GUID> is the workspace that hosts the Org App. Always pass --workspace-id explicitly — the interactive workspace search often fails when many workspaces…
- Reads credentials
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 35,266 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository7 other files it gives its agents.
- app-designSkill
- app-validationSkill
- org-app-fetchSkill
- org-app-parsingSkill
- org-app-themingSkill
- playwright-cliSkill
- powerbi-secure-embedSkill
The file
We split this AGENTS.md into the rules it gives an agent
9 rules. About 0 are common, 6 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 19
All validation gates passing (pnpm tsc --noEmit, pnpm build)
- Distinctive: line 27
Before doing anything, confirm with the user:
- Very specific: line 33
Rayfin is connected to the workspace that hosts the Org App: Check .env.local for VITE_FABRIC_API_URL, VITE_FABRIC_PORTAL_URL, and …
- Distinctive: line 39
If any are missing, ask for them.
- Very specific: line 60
Update the five --color-app-* tokens in src/global.css's @theme block
- Distinctive: line 71
All must pass before declaring success.
- Distinctive: line 95
If the user asks for UI polish, load the app-design skill.
- Distinctive: line 97
If the user asks to verify the migration end-to-end in a browser, load the playwright-cli skill.
- Distinctive: line 99
If a report fails to load, load the powerbi-secure-embed skill for the debugging checklist.
≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md
Instructions for the migration agent that turns this template into a working app for the user's Power BI Org App.
This file is auto-loaded by GitHub Copilot CLI (and by other agentic tools that read AGENTS.md).
Primary task
Migrate a Power BI Org App into this template. Inputs from the user:
- Org App ID — a GUID like
1b663c51-10f8-4fdf-8863-d24e49622988
Outputs:
src/config/orgAppManifest.tspopulated with workspace ID, reports, tenant ID, themesrc/global.css@themeblock patched with Org App brand colors- All validation gates passing (
pnpm tsc --noEmit,pnpm build)
Workflow
Step 1 — Confirm prerequisites
Before doing anything, confirm with the user:
- They have viewer access to the Org App
- They are signed in to Azure CLI in the same tenant as the Org App
- Run:
az account show --query "{user: user.name, tenantId: tenantId}"
- Run:
- They have provided the Org App ID (GUID)
- Rayfin is connected to the workspace that hosts the Org App. Check
.env.localforVITE_FABRIC_API_URL,VITE_FABRIC_PORTAL_URL, andVITE_RAYFIN_API_KEY. If any are missing, ask the user to run:
wherenpx rayfin up --workspace-id <WORKSPACE_GUID><WORKSPACE_GUID>is the workspace that hosts the Org App. Always pass--workspace-idexplicitly — the interactive workspace search often fails when many workspaces match the user's filter.
If any are missing, ask for them. Do not proceed until all four are confirmed.
Step 2 — Fetch the Org App envelope
Load and follow the org-app-fetch skill. It will produce:
$envelope— the parsed JSON response frommetadata/artifacts/{orgAppId}$tenantId— fromaz account show
Step 3 — Parse into the manifest
Load and follow the org-app-parsing skill. It will:
- Two-stage parse
$envelope.workloadPayload - Filter
elementsfor reports only - Write
src/config/orgAppManifest.ts
Step 4 — Patch the theme
Load and follow the org-app-theming skill. It will:
- Update the five
--color-app-*tokens insrc/global.css's@themeblock
Step 5 — Validate
Load and follow the app-validation skill. It runs:
pnpm tsc --noEmitpnpm build- Manifest sanity checks
- Theme tokens patched check
All must pass before declaring success.
Step 6 — Tell the user
Once validation passes:
✅ Done. Your Org App is migrated.
Next steps:
- Run
pnpm dev- Open http://localhost:5173
- Sign in with your work account
- You'll land on the home page with a tile for every report.
A few things to try:
- Click the gear icon (top-right) → Theme to switch between the Org App brand colors and any built-in Power BI theme (Default, Executive, Frontier, Innovate, Bloom, Tidal, Sunset, Storm). Your choice is remembered per browser.
- Same menu → Configuration shows the source Org App metadata and the raw manifest. To pull in changes from the source app later, just run
copilotagain and ask for a re-migrate.- Collapse the sidebar with the toggle in the top-left to give reports the full width.
- Hover any sidebar report (or any home-page tile) and use the ↗ button to jump to the same report in the Power BI portal.
Optional follow-ups
If the user asks for UI polish, load the app-design skill.
If the user asks to verify the migration end-to-end in a browser, load the playwright-cli skill.
If a report fails to load, load the powerbi-secure-embed skill for the debugging checklist.
Skills available
| Skill | Path | Purpose |
| org-app-fetch | .agents/skills/org-app-fetch/SKILL.md | Pull Org App envelope from internal Power BI API |
| org-app-parsing | .agents/skills/org-app-parsing/SKILL.md | Turn envelope into manifest |
| org-app-theming | .agents/skills/org-app-theming/SKILL.md | Patch global.css with Org App colors |
| powerbi-secure-embed | .agents/skills/powerbi-secure-embed/SKILL.md | Reference for the embed iframe |
| app-design | .agents/skills/app-design/SKILL.md | Fabric design tokens / Segoe UI conventions |
| app-validation | .agents/skills/app-validation/SKILL.md | Final acceptance gates |
| playwright-cli | .agents/skills/playwright-cli/SKILL.md | Browser automation for E2E validation |
Hard constraints
- Tenant boundary. Cross-tenant migration is not supported. The user's
az logintenant must match the Org App's tenant. - Reports only. Datasets, dashboards, folders, and other element types are not added to the sidebar. (User confirmed this at template design time.)
- Static manifest. The manifest is written at migration time and committed to source control. No runtime fetch of the Org App definition.
- Secure embed only. This template uses
autoAuth=trueiframe embed — no embed token, no service principal. If the user needs embed tokens, that is a separate refactor.
Failure modes
| Failure | Action |
az not signed in | Ask the user to run az login --tenant <tenant-id>. Do not proceed. |
401/403 from metadata API | Verify token resource is https://analysis.windows.net/powerbi/api and the user has viewer access. |
404 from metadata API | Re-check the Org App ID with the user. Confirm the tenant matches. |
artifactType !== "OrgApp" | The ID is for a different artifact type. Ask the user to verify the ID is from the Org App URL in the Power BI portal. |
pnpm tsc --noEmit fails after manifest write | Re-run org-app-parsing — the manifest shape drifted from OrgAppManifest. Do not hand-fix; regenerate. |
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
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.

