org-app-parsing
Skill1 starsChanged 6 months agoMITView on GitHub
Parse a Power BI Org App envelope returned by the org-app-fetch skill into the OrgAppManifest shape this template consumes. Use after org-app-fetch to extract the workspace ID, ordered `nav` (interleaved markdown content pages + recursive sections of reports, paginated reports, embedded + new-tab links), logo, and theme, then write src/config/orgAppManifest.ts.
In this repository7 other files it gives its agents.
- AGENTS.mdAGENTS.md
- app-designSkill
- app-validationSkill
- org-app-fetchSkill
- org-app-themingSkill
- playwright-cliSkill
- powerbi-secure-embedSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 113
After mapping, drop sections whose items is empty (e.g.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill 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
org-app-parsing
When to use this skill
Immediately after org-app-fetch succeeds — you have an $envelope object and $tenantId, and need to write src/config/orgAppManifest.ts.
Envelope shape (input)
The relevant top-level fields from the artifact envelope:
{
"objectId": "1b663c51-...", // becomes manifest.orgAppId
"artifactType": "OrgApp",
"displayName": "Reach DRI",
"description": "...", // optional
"folderObjectId": "a8ecb0b7-...", // becomes manifest.workspaceId
"payloadContentType": "InlineJson",
"workloadPayload": "{ ... JSON-encoded OrgApp definition ... }"
}Two-stage parse
workloadPayload is a JSON string — parse it a second time:
$payload = $envelope.workloadPayload | ConvertFrom-Json$payload has shape:
{
"settings": {
"logo": "data:image/png;base64,...", // optional inline image
"theme": {
"background": "#1e6668",
"foreground": "#ffffff",
"backgroundHover": "#2a7375",
"backgroundSelected": "#3a8082",
"backgroundPressed": "#175558"
}
},
"elements": [
// Top-level elements appear in source order — content pages and
// sections may be freely interleaved. An app may have zero, one, or
// many of each. Examples:
{ "elementType": "overview", "elementId": "...", "displayName": "Welcome",
"header": { "title": "Welcome", "body": "...markdown...", "showTheme": true } },
{ "elementType": "section", "elementId": "...", "displayName": "Group A",
"elements": [
// Section children — same envelope shape, mixed types:
{ "elementType": "item", "itemType": "report", "elementId": "...",
"itemId": "...", "displayName": "..." },
{ "elementType": "item", "itemType": "rdlreport", "elementId": "...",
"itemId": "...", "displayName": "..." },
{ "elementType": "link", "linkType": "embedded", "elementId": "...",
"url": "https://...",
"displayName": "..." },
{ "elementType": "link", "linkType": "newtab", "elementId": "...",
"url": "https://...",
"displayName": "..." },
// Kusto and bare datasets — DROP these (no rendering path):
{ "elementType": "item", "itemType": "KustoDashboard", ... },
{ "elementType": "item", "itemType": "dataset", ... },
// Sections may nest other sections — RECURSE:
{ "elementType": "section", "elementId": "...", "displayName": "Subgroup",
"elements": [ ... ] }
] },
// ...another overview content page may come after sections:
{ "elementType": "overview", "elementId": "...", "displayName": "Reference",
"header": { "title": "Reference", "body": "...markdown...", "showTheme": false } }
]
}The model permits arbitrary section nesting; the template renders the tree recursively.
Output model
The template consumes a single ordered nav array — a discriminated union of two entry kinds:
{ kind: "contentPage", elementId, displayName, title, body, showTheme }— author-supplied markdown page rendered at/page/:elementId.{ kind: "section", elementId, displayName, items }— sidebar group whoseitemsare routable leaves (reports, RDL, link-embed, link-newtab) or nested sections.
The auto-generated Overview cards landing at /overview is synthesized by the template at runtime from nav's sections — do not emit it.
Mapping table
Apply these rules in order, preserving source order at every level. Use arrays (not maps) end-to-end. Every top-level element pushes one entry into nav.
| Source element | Maps to | Notes |
elementType: "overview" (top-level) | Push { kind: "contentPage", elementId, displayName, title, body, showTheme } to nav | Read root displayName. Read header.title, header.body, header.showTheme from the nested header object. Multiple are allowed. |
elementType: "section" (top-level) | Push { kind: "section", elementId, displayName, items } to nav | Recurse into .elements to build .items. |
elementType: "section" (nested inside .elements) | { kind: "section", elementId, displayName, items } | Same recursion. |
elementType: "item" + itemType: "report" | { kind: "report", elementId, itemId, displayName } | Power BI PBIX report → /report/:itemId. |
elementType: "item" + itemType: "rdlreport" | { kind: "rdlreport", elementId, itemId, displayName } | Paginated report → /rdl/:itemId. |
elementType: "link" + linkType: "embedded" | { kind: "linkEmbed", elementId, url, displayName } | Iframe at /embed/:elementId. URL passed verbatim. |
elementType: "link" + linkType: "newtab" | { kind: "linkNewtab", elementId, url, displayName } | Sidebar <a target="_blank">, no in-app route. |
elementType: "item" + itemType: "KustoDashboard" | DROP | No rendering path in this template. |
elementType: "item" + itemType: "dataset" | DROP | Datasets are consumed by reports, never user-facing. |
elementType: "item" + any other itemType | DROP + warn | Unknown artifact type. Tell the user. |
After mapping, drop sections whose items is empty (e.g. a section that only contained Kusto dashboards). Apply this drop recursively bottom-up. Do not drop content pages.
settings.logo (if present) → manifest.logo verbatim (it's already a data: URL).
settings.theme → manifest.theme. If settings.theme is missing, keep the defaults already in the file.
Output: src/config/orgAppManifest.ts
Overwrite the file with the populated manifest. Preserve the file's header copyright block and the trailing isUnconfigured export. Example showing two content pages interleaved with a section:
import type { OrgAppManifest } from "@/types/orgAppManifest";
export const orgAppManifest: OrgAppManifest = {
workspaceId: "<envelope.folderObjectId>",
orgAppId: "<envelope.objectId>",
tenantId: "<$tenantId from org-app-fetch>",
displayName: "<envelope.displayName>",
description: "<envelope.description ?? '' >",
logo: "<payload.settings.logo ?? undefined>",
nav: [
{
kind: "contentPage",
elementId: "...",
displayName: "Welcome",
title: "Welcome",
body: "...markdown...",
showTheme: true,
},
{
kind: "section",
elementId: "...",
displayName: "Group A",
items: [
{ kind: "report", elementId: "...", itemId: "...", displayName: "..." },
{ kind: "rdlreport", elementId: "...", itemId: "...", displayName: "..." },
{ kind: "linkEmbed", elementId: "...", url: "https://...", displayName: "..." },
{ kind: "linkNewtab", elementId: "...", url: "https://...", displayName: "..." },
],
},
{
kind: "contentPage",
elementId: "...",
displayName: "Reference",
title: "Reference",
body: "...markdown...",
showTheme: false,
},
],
theme: {
background: "<payload.settings.theme.background>",
foreground: "<payload.settings.theme.foreground>",
backgroundHover: "<payload.settings.theme.backgroundHover>",
backgroundSelected: "<payload.settings.theme.backgroundSelected>",
backgroundPressed: "<payload.settings.theme.backgroundPressed>",
},
};
export const isUnconfigured = (m: OrgAppManifest) => m.orgAppId === "";After writing
Hand off theme to the org-app-theming skill — it patches src/global.css so the Tailwind --color-app-* tokens resolve to the Org App's brand colors.
Edge cases
| Situation | What to do |
payload.settings.theme missing | Leave the defaults already in the file. |
payload.settings.logo missing | Omit the logo field (the Topbar falls back to its Sparkles icon). |
payload.elements empty | Write nav: []. The app will land on the auto-generated /overview page, which will render only the app header — warn the user. |
| All elements drop out after filtering | Same as above. |
Element has no displayName | Fall back to the artifact type label plus the last 4 chars of elementId / itemId. For content pages, fall back to header.title if root displayName is missing. |
Duplicate elementId values | Should never happen; if it does, keep the first and warn. |
Multiple top-level overview elements | All supported — emit one contentPage entry per element, in source order. Each is reachable at /page/:elementId. |
linkEmbed URL points at a different host | Pass it verbatim. Authentication against the embedded host is the user's responsibility (matches the portal). |
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.

