Agent skill power bi dashboard
Claude agent skill for authoring Power BI PBIP dashboards as source-controlled files — verified template, scaffolder, report-edit CLI, deterministic linter, evals.
npx -y skills add k-sandhu/agent-skill-power-bi-dashboardAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Build, modify, validate, and package Power BI PBIP dashboard/report projects by directly authoring PBIP, TMDL semantic model, PBIR report, Power Query M, data, validation, and manifest files. Use when an AI agent is asked to create, repair, or iterate on Power BI dashboard/report artifacts, PBIP projects, Power BI Desktop-compatible project artifacts, TMDL models tied to PBIP deliverables, PBIR reports, report visual references, Power Query source bindings, schema validation outputs, or Power BI artifact packages. Do not use for general Power BI advice, isolated DAX formula help, or simple conceptual questions unless the user wants files changed or generated.
SKILL.md
9.9 KB, ~2.1k tokens by cl100k_base, as published. Nobody here has run it
Power BI Dashboard
Produce Power BI PBIP projects that open in Power BI Desktop on the first try. The strategy is simple: never author fragile file formats from memory. Start every new build from the bundled template (already proven to render in Desktop), make every report edit through the helper CLI or validated snippets, and run the deterministic linter after each change so mistakes surface immediately, not at delivery.
Core Loop
1. Resolve requirements without stalling
Read the request for: data source, pages, KPIs/metrics, and audience. Where the prompt is silent, choose a sensible default and record it as an assumption in the manifest instead of asking:
- No data source given: generate deterministic mock data and say so prominently.
- Pages: default to a single overview page; add detail pages when the request implies them.
- Calendar: calendar year. Capacity: Pro. Refresh: import with manual refresh. RLS: none.
Only stop to ask when the task is impossible to do safely: a named source file/endpoint is missing, credentials would have to be embedded, or RLS is requested without rules.
2. Start from a proven baseline
New project: scaffold from the bundled template — a complete PBIP project (Sales fact, Product dimension, marked Date dimension, one Overview page with title, cards, slicer, line chart, bar chart, table) that has been opened and rendered in Power BI Desktop:
python scripts/scaffold_pbip.py --name <ProjectName> --dest <short-path-outside-OneDrive>
It copies the template, renames everything, rewrites Power Query paths, and lints. Then transform the scaffold into the requested dashboard: rename/replace tables, swap the sample data, adjust measures and visuals. Renaming a healthy project beats authoring PBIP/TMDL/report metadata from scratch — from-scratch report JSON regularly passes schema checks yet fails Desktop hydration.
Existing project: edit in place with the smallest safe diff. Read files before editing, preserve unknown-but-valid files and existing object names, and never rewrite whole artifacts for small changes. Match the project's existing report format: PBIR folder projects (definition.pbir version 4.0+ with definition/) stay PBIR; only projects already using root report.json stay PBIR-Legacy.
3. Wire the data
Replace the template's sample CSVs or partition source expressions per source mode
(patterns in references/model-report-rules.md): File.Contents + parser for local
files, Folder.Files for folders, Web.Contents with RelativePath/Query for
APIs, connector expressions for databases. Two non-negotiables: no secrets in any
file ever (ApiKeyName names keys; values live in Power BI credential storage), and
prefer build-time local extracts under data/ for demos — live refresh only when
explicitly requested, because it adds credential prompts and breaks reproducibility.
Keep generated M mechanically simple (the linter checks this): single row selectors,
nested {name, type} lists for Table.TransformColumnTypes, list arguments for
Table.ExpandTableColumn.
4. Shape the model
Edit TMDL directly, following the template's idiom: tabs for indentation, measures
with single-line DAX expressions and format strings, summarizeBy: none on
non-aggregatable columns, hidden keys, single-direction relationships, marked Date
table. Read references/model-report-rules.md before modeling beyond these patterns
(date table spec, DAX rules, chart/slicer selection, Desktop-compatible TMDL subset).
Never name a measure the same as any column — Desktop refuses to load the model
(PFE_XL_MEASURE_COLUMN_ALREADY_EXIST). The linter catches this.
5. Author the report
For PBIR-Legacy reports (the template's format), make every edit through the helper CLI so the stringified-JSON-in-JSON shapes stay correct:
python scripts/powerbi_report_helpers.py add-page <report.json> --name ReportSectionX --display "X"
python scripts/powerbi_report_helpers.py add-textbox <report.json> --section ... --name ... --text ...
python scripts/powerbi_report_helpers.py add-visual <report.json> --section ... --name ... --type lineChart \
--column "Date.YearMonth=Category" --measure "Sales.Total Revenue=Y" --x 24 --y 216 --width 608 --height 240
python scripts/powerbi_report_helpers.py validate <report.json>
Roles, raw shapes, slicer modes, and the layout grid are in
references/visual-snippets.md. Use only visual types listed there or found in
Desktop-generated examples — guessed visual type strings render as errors. Pick chart
types and slicer modes from the data shape (rules in model-report-rules.md), give
every visual a unique name and tab order, and keep bounding boxes non-overlapping.
For PBIR folder reports (existing Desktop-created projects), edit the per-page and
per-visual JSON files, validating each against its own declared $schema, and keep
folder names exactly matching JSON name fields.
6. Validate continuously
python scripts/powerbi_lint.py <project-root> --format json --output <project>/validation/powerbi_lint.json
Run after every meaningful change — it is fast, and a lint error caught next to its cause costs one fix instead of a debugging session at the end. It checks project shape, TMDL presence and hazards, M red flags, measure/column collisions, visual references against the model, layout overlap, tab order, naming, privacy, and more. Zero errors is the bar; surface warnings in the manifest.
When Power BI Desktop is installed and the deliverable targets Desktop, run the smoke test after lint passes (skip only if the user opts out, and then say so):
powershell -NoProfile -ExecutionPolicy Bypass -File scripts/powerbi_desktop_smoke.ps1 \
-ReportPath <project.pbip> -OutputDir <project>/validation -TimeoutSeconds 300 -CloseWhenDone
Add -Refresh to also prove data loads. Only a JSON status of PASS (which
requires the window to bind to the project, not just open) counts as Desktop
evidence. On any Desktop error, look it up in the triage table in
references/powerbi-desktop-compatibility.md before changing anything — most errors
have a known one-line remediation.
7. Deliver honestly
Write a BUILD_MANIFEST.md (structure in references/validation-and-delivery.md)
recording what was built, the source mode, assumptions, what passed, what was NOT
RUN and why, and next steps. Final report ends with exactly one status label:
DRAFT— files exist, but a required check failed, was skipped, or was unavailable.VALIDATED— lint passes with zero errors and all statically checkable gates pass; Desktop validation may still be NOT RUN.DESKTOP_VERIFIED— VALIDATED, plus the Desktop smoke (or an equivalent loader) proved the project opens with pages and visuals rendering; with-Refresh, data load was also proven.
Never imply an unavailable validator passed. NOT RUN is an acceptable answer; implied success is not.
Hard Rules
- Never embed secrets, tokens, passwords, or credential-bearing connection strings in any file — projects get committed and shared.
- Never create a measure whose name matches a column name (model will not load).
- Keep generated measure DAX on the same line as
measure <name> =— multi-line expressions can deserialize with TMDL metadata polluting the DAX. - Never emit relationship
cardinality:, culturecontentType:, or table-leveldescription:in TMDL — Desktop rejects them as unsupported properties. - If TMDL uses
queryGroup:, declare the matchingqueryGroupobject (or omit both). - Never validate TMDL as JSON; use the linter's static checks (or a TOM/TMDL parser when available).
- Never invent PBIR/report JSON shapes or visual type strings; copy from the template, snippets, or Desktop-generated files.
- Schema-valid does not mean Desktop-renders; only open validation proves rendering.
- Save all project text files as UTF-8 without BOM; keep paths short (<260 chars) and build outside OneDrive/SharePoint folders.
- Never package or commit
.pbi/cache.abfor.pbi/localSettings.json; surface.pbi/unappliedChanges.jsonwhen present (applying it can overwrite external edits). - Preserve unknown-but-valid files and Desktop-generated object names when editing existing projects.
- Auto date/time stays disabled; the model uses an explicit, marked Date table.
References
Read on demand, not upfront:
references/visual-snippets.md— when adding or changing report visuals.references/model-report-rules.md— when modeling beyond the template (M patterns, date table, DAX, chart/slicer selection, TMDL subset, anti-patterns).references/powerbi-desktop-compatibility.md— when Desktop throws any error (triage table), or when choosing report format for unusual cases.references/validation-and-delivery.md— when packaging: manifest structure, deliverable layout, escalation triggers.references/microsoft-docs.md— when file contracts or Desktop behavior may have changed, or the user asks about current/latest compatibility.
Reported Output
End every build with: status label, project path, source mode and classification, table/measure/page/visual counts, lint summary, Desktop/open validation result (or NOT RUN with reason), assumptions, known limitations, and next steps.
What ships with it: 64 files
210.0 KB alongside SKILL.md, 4 of them executable
agents/
- openai.yaml377 B
assets/
- template/data/generated/date.csv16.7 KB
- template/data/generated/product.csv226 B
- template/data/generated/sales.csv21.1 KB
- template/.gitignore45 B
- template/Starter.pbip274 B
- template/Starter.Report/definition.pbir234 B
- template/Starter.Report/report.json8.3 KB
- template/Starter.SemanticModel/definition/database.tmdl35 B
- template/Starter.SemanticModel/definition/model.tmdl343 B
- template/Starter.SemanticModel/definition.pbism167 B
- template/Starter.SemanticModel/definition/relationships.tmdl153 B
- template/Starter.SemanticModel/definition/tables/Date.tmdl1.4 KB
- template/Starter.SemanticModel/definition/tables/Product.tmdl693 B
- template/Starter.SemanticModel/definition/tables/Sales.tmdl1.0 KB
evals/
- evals.json3.9 KB
references/
- microsoft-docs.md12.0 KB
- model-report-rules.md7.8 KB
- powerbi-desktop-compatibility.md6.5 KB
- validation-and-delivery.md5.6 KB
- visual-snippets.md7.3 KB
scripts/
- powerbi_desktop_smoke.ps1runs15.1 KB
- powerbi_lint.pyruns59.5 KB
- powerbi_report_helpers.pyruns20.9 KB
- scaffold_pbip.pyruns4.9 KB
tests/
- fixtures/m_and_measure_lint_failures/Bad.pbip218 B
- fixtures/m_and_measure_lint_failures/Bad.Report/definition.pbir230 B
- fixtures/m_and_measure_lint_failures/Bad.Report/report.json800 B
- fixtures/m_and_measure_lint_failures/Bad.SemanticModel/definition/database.tmdl39 B
- fixtures/m_and_measure_lint_failures/Bad.SemanticModel/definition/model.tmdl168 B
- fixtures/m_and_measure_lint_failures/Bad.SemanticModel/definition.pbism149 B
- fixtures/m_and_measure_lint_failures/Bad.SemanticModel/definition/tables/DataTable.tmdl381 B
- fixtures/m_and_measure_lint_failures/.gitignore45 B
- fixtures/measure_column_collision/Collision.pbip224 B
- fixtures/measure_column_collision/Collision.Report/definition.pbir236 B
- fixtures/measure_column_collision/Collision.Report/report.json800 B
- fixtures/measure_column_collision/Collision.SemanticModel/definition/database.tmdl45 B
- .gitattributes38 B
- .gitignore154 B
- README.md7.0 KB
24 more files not listed here. See all 64 in the repository.