/reports:modifying-theme-jsonfrom reports
Design, enforce, audit and validate Power BI report themes. Helps create, apply, standardize themes and clear visual formatting overrides to reduce formatting debt.
Ships in reports. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
A report without a well-designed theme accumulates formatting debt. Every visual ends up with its own bespoke title size, shadow toggle, border style, and hardcoded colors in visual.json. This creates three problems:
Reports using the default Power BI theme or a minimal custom theme (just dataColors and a name) are leaving most formatting to Power BI's built-in defaults, which change between Desktop releases. A well-designed theme locks in the intended appearance.
Signs a theme needs attention:
objects or visualContainerObjects with redundant formattingvisualStyles entriesTooling preference: Use
pbirCLI when available (pbir theme colors,pbir visuals clear-formatting). Fall back to directjqmodification when unavailable. Always validate after every write.
Tip: Theme JSON files can be 75KB+ and 2000+ lines. Do not read the full monolithic file. Use
pbir theme serializeto split into small editable files (see Author/Modify workflow below), or usejqto extract only specific keys. Serialized fragments from the serialize/build workflow are small and safe to read directly.
For PBIR JSON mechanics (property names, filter pane selectors, ThemeDataColor syntax, jq patterns), see the pbir-format skill (pbip plugin) -> references/theme.md.
Power BI applies visual formatting through a four-level cascade. Each level overrides the level above it:
Level 1 Power BI built-in defaults
|
Level 2 Theme wildcard visualStyles["*"]["*"] applies to ALL visuals
|
Level 3 Theme visual-type visualStyles["lineChart"]["*"] overrides wildcard for that type
|
Level 4 Visual instance visual.json objects + overrides everything
visualContainerObjects
A visual that selects a named style preset adds a step between levels 3 and 4: the preset
(visualStyles["<type>"]["<preset>"]) overrides the type's "*" style, and level 4 still wins over
it. See references/style-presets.md.
Push as much formatting as possible into levels 2 and 3. A well-designed theme means:
Visual-level overrides (level 4) should exist only for true one-offs: content-specific formatting, exceptions to the visual-type default, or conditional formatting expressions.
When a visual renders unexpectedly, walk up the cascade:
visual.json → objects and visualContainerObjects (level 4 always wins)visualContainerObjects.stylePreset), then theme visualStyles["<type>"]["*"] for that visual type (level 3)visualStyles["*"]["*"] wildcard (level 2)visualStyles: a size or hex set there beats your text classes and color slots (references/advanced-theme-features.md)Use when assessing whether a report's visuals are inheriting from the theme or have accumulated stale overrides.
Step 1 — Locate the custom theme:
THEME_NAME=$(jq -r '.themeCollection.customTheme.name' Report.Report/definition/report.json)
THEME="Report.Report/StaticResources/RegisteredResources/$THEME_NAME"
Step 2 — Review what the theme sets at wildcard level:
# Preferred
pbir theme colors "Report.Report"
pbir theme text-classes "Report.Report"
# Fallback
jq '.visualStyles["*"]["*"] | keys' "$THEME"
Step 3 — Continue with full audit process — see references/theme-compliance.md for the complete workflow: scanning all visuals for bespoke overrides, classifying stale vs intentional vs CF, severity levels, and fix decision tree.
After applying a new theme or making significant theme changes, stale visual-level overrides prevent the new theme from rendering correctly.
With pbir CLI (preferred):
# Clears bespoke formatting while preserving conditional formatting expressions
pbir visuals clear-formatting "Report.Report/**/*.Visual" --keep-cf -f
With jq (manual, per-visual):
# Safe: clear container chrome only (title, border, background, shadow, padding)
# Does NOT touch chart-specific objects or conditional formatting
jq 'del(.visual.visualContainerObjects)' visual.json > tmp && mv tmp visual.json
# Aggressive: clear everything including chart-specific overrides
# WARNING: also removes conditional formatting — only use if CF is confirmed absent
jq 'del(.visual.objects) | del(.visual.visualContainerObjects)' visual.json > tmp && mv tmp visual.json
# Always validate after
jq empty visual.json
When in doubt, clear
visualContainerObjectsonly. Leaveobjectsunless you have confirmed no conditional formatting exists in that visual.
Swapping a report from one theme to another is a migration, and editing only the theme JSON leaves theme residue: surviving level-4 overrides that still win at the cascade, plus colors that were correct under the old polarity and break (often invisible text) under the new one. Re-theming sits between apply and enforce: build an old-to-new color map first, then apply the theme, sweep overrides, remap surviving literals, and run the polarity gate so foreground text survives the new background. See references/re-theming.md.
When building or substantially revising a theme, use the serialize/build workflow via pbir CLI. This splits the monolithic theme JSON into small, focused files that are easy to read and edit without loading 2000+ lines of JSON into context.
IMPORTANT: Serialize to a temporary folder outside the
.Report/directory. The PBIR validation hooks monitor.Report/for JSON changes and will flag the serialized fragments as invalid PBIR files. Use/tmp/, a sibling folder, or the-oflag to place the.Themefolder elsewhere.
Step 1 — Serialize the theme into editable files:
# From a report (outputs to a .Theme folder)
pbir theme serialize "Report.Report" -o /tmp/MyTheme.Theme
# From a standalone theme JSON file
pbir theme serialize theme.json -o /tmp/MyTheme.Theme
This produces small, focused files: _config.json (colors, text classes, named colors), _wildcards.json (wildcard visual styles), and one file per visual-type override (e.g., slicer.json, page.json).
Step 2 — Edit the serialized files. Each file is small enough to read and edit directly. Focus on:
_config.json — dataColors, semantic colors, textClasses, background/foreground variants_wildcards.json — container defaults (title, border, shadow, padding)Step 3 — Build and apply back to the report:
# Build only (produces a merged theme.json)
pbir theme build /tmp/MyTheme.Theme
# Build and apply directly to the report
pbir theme build /tmp/MyTheme.Theme -o "Report.Report" -f --clean
The --clean flag removes the .Theme folder after building.
For small, targeted changes, use the CLI directly without serializing:
pbir theme set-colors "Report.Report" --good "#00B050" --bad "#FF0000"
pbir theme set-text-classes "Report.Report" title --font-size 14 --font-face "Segoe UI Semibold"
pbir theme set-formatting "Report.Report" "*.*.dropShadow.show" --value false
See the pbir-cli skill → references/modifying-theme.md for full CLI command reference.
Whether using serialize/build or direct CLI commands, follow this order:
pbir theme apply-template), the SQLBI/Data Goblins theme, or a community template. Do not author from an empty {}.dataColors, semantic colors, background/foreground variants). Color decisions cascade everywhere.textClasses) — font face and size for title, header, label, callout, dataTitle. Stick to Segoe UI / Segoe UI Semibold; custom fonts will not render on other users' machines.visualStyles["*"]["*"]): title visibility/font/size, dropShadow.show: false, padding, border, filter pane.textbox and image to suppress title/border/background/shadow.pbir theme validate "Report.Report", deploy, and visually verify.For detailed design guidance, see references/theme-authoring.md. For visual-type override patterns, see references/visual-type-overrides.md.
When a visual.json has formatting that should become a theme default — either for that visual type or for all visuals — promote it.
With pbir CLI (preferred):
# Preview what would be pushed from a well-formatted visual into the theme
pbir theme push-visual "Report.Report/Page.Page/Card.Visual" --dry-run
# Push formatting to theme as the default for that visual type
pbir theme push-visual "Report.Report/Page.Page/Card.Visual"
# Push only specific components (title, background, border, etc.)
pbir theme push-visual "Report.Report/Page.Page/Card.Visual" --components title,background,border
Manual process (when CLI is unavailable):
visual.objects (chart-specific) and visual.visualContainerObjects (container chrome)["*"]["*"]) or a visual-type section (["lineChart"]["*"])Both objects and visualContainerObjects properties map to the same visualStyles[type][state] section in the theme. The distinction in visual.json doesn't exist in the theme.
For complete property mapping tables, wildcard vs visual-type decision guide, color handling, and batch promotion across many visuals, see references/promoting-formatting.md.
With pbir CLI (preferred):
# Validate a report's theme (checks JSON syntax, structure, and completeness)
pbir theme validate "Report.Report"
# Validate a standalone theme file
pbir theme validate "theme.json"
# Validate a serialized .Theme folder before building
pbir theme validate "MyTheme.Theme"
Manual validation (when CLI is unavailable):
# 1. JSON syntax
jq empty "$THEME" && echo "JSON valid"
# 2. Required top-level keys
jq '{dataColors: (.dataColors | type), visualStyles: (.visualStyles | type), textClasses: (.textClasses | type)}' "$THEME"
# 3. Wildcard section
jq 'if .visualStyles["*"]["*"] then "wildcard exists" else "MISSING wildcard" end' "$THEME"
# 4. Valid hex colors
jq '[.dataColors[] | select(test("^#[0-9A-Fa-f]{6}$") | not)]' "$THEME"
# 5. No null visual-type sections
jq '[.visualStyles | to_entries[] | select(.value == null) | .key]' "$THEME"
After validation, deploy and visually verify:
The official theme JSON schema, the Microsoft Learn pages on report themes, the community theme
templates and the PBIR item schemas are linked in references/schema-and-docs.md.
Resolve the current schema version at author time rather than hardcoding a number:
gh api repos/microsoft/powerbi-desktop-samples/contents/"Report Theme JSON Schema" \
--jq '.[].name' | sort | tail -1
$schema)Add a $schema property to the theme JSON to enable autocomplete and validation in VS Code. Use the versioned raw GitHub URL, not the generic powerbi.com marker:
{
"$schema": "https://raw.githubusercontent.com/microsoft/powerbi-desktop-samples/main/Report%20Theme%20JSON%20Schema/reportThemeSchema-2.154.json",
"name": "MyTheme",
"dataColors": ["#1971c2", "..."]
}
Power BI validates an imported theme against the schema baked into the Desktop build. Validation is reject-unknown-fields: one misspelled key refuses the entire theme. A theme passing jq validation can still fail Desktop import on a typo. See references/theme-authoring.md for the full schema version guidance.
name: string # display name shown in Power BI UI
dataColors: string[] # ordered hex palette for data series
# Semantic CF colors (flat hex keys; CF measures return these names as strings)
good / bad / neutral: string
# Gradient CF colors (flat hex keys; "null" is the key name, not JSON null)
maximum / center / minimum / null: string
# Structural colors (non-data chrome: gridlines, axis labels, filter-card bg, etc.)
# Use level-N names for new themes; CLI alias equivalents shown in parentheses
firstLevelElements: string # (foreground)
secondLevelElements: string # (foregroundNeutralSecondary)
thirdLevelElements: string # (backgroundLight)
fourthLevelElements: string # (foregroundNeutralTertiary)
background: string
secondaryBackground: string # (backgroundNeutral)
tableAccent: string
# Extended surface/foreground palette
foregroundLight / foregroundDark: string
backgroundLight / backgroundNeutral / backgroundDark: string
textClasses: object # typography per semantic role (title, label, callout, header, boldLabel, etc.)
visualStyles: object # [visualType][state] formatting cascade
For textClasses: 4 primary classes you set; 8 secondary classes that derive automatically. See references/theme-authoring.md.
For visualStyles: named style presets are a second key alongside "*" inside a visual-type section; they surface in the Format pane Style dropdown. See references/advanced-theme-features.md.
references/theme-authoring.md — Color system design (data colors, semantic, structural, null gradient), text class inheritance, $id filter-card states, wildcard minimum set, schema version guidancereferences/style-presets.md: named style presets per visual type, the default preset, selecting a preset on visuals and authoring presets with pbirreferences/advanced-theme-features.md — Named style presets (Format-pane dropdown), base theme layering model, organizational theme distribution, mobile-only formatting overridesreferences/serialize-build.md — Serialize/build workflow: splitting themes into editable files, editing, rebuilding, validation, temporary folder guidancereferences/applying-themes.md — Applying templates, post-apply enforcement, clearing visual overrides, normalizing hardcoded colorsreferences/re-theming.md — Switching a report to a new theme without leaving residue: old-to-new color map, inline-override sweep on shapes/textboxes/buttons, the polarity-flip foreground-text sweep, dark-mode checklist, slicer header role-preserving remapreferences/copying-themes.md — Copying themes between reports, extracting/downloading themes, comparing themes, consolidating across a portfolioreferences/promoting-formatting.md — Promoting bespoke visual.json formatting to theme: push-visual CLI, objects vs visualContainerObjects, wildcard vs visual-type, property mapping tablesreferences/theme-compliance.md — Systematic audit workflow, stale override classification, severity levels, fix decision treereferences/visual-type-overrides.md — Override patterns for textbox, image, shape, card, kpi, slicer, lineChart, barChart, tableEx, and matrixreferences/schema-and-docs.md: links to the official theme schema, the Microsoft Learn theme pages, community templates and the PBIR item schemaspbir-cli → references/modifying-theme.md — Full CLI command reference for theme operations (serialize/build, set-colors, set-text-classes, set-formatting, push-visual, fonts, background, icons, diff)pbir-cli → references/apply-theme.md — Applying templates, copying themes between reports, clearing visual overridespbir-format (pbip plugin) — Full theme mechanics: ThemeDataColor syntax, filter pane selectors, jq modification patterns, clearing overridespbi-report-design — Report design principles: 3-30-300 rule, layout, chart selection, how Power BI applies colorexamples/DataGoblins2021.json (opens in a new tab)examples/Fluent2-CY26SU03.json (opens in a new tab)examples/visualTypes/actionButton.md (opens in a new tab)examples/visualTypes/advancedSlicerVisual.md (opens in a new tab)examples/visualTypes/aiNarratives.md (opens in a new tab)examples/visualTypes/areaChart.md (opens in a new tab)examples/visualTypes/azureMap.md (opens in a new tab)examples/visualTypes/barChart.md (opens in a new tab)examples/visualTypes/bookmarkNavigator.md (opens in a new tab)examples/visualTypes/card.md (opens in a new tab)examples/visualTypes/cardVisual.md (opens in a new tab)examples/visualTypes/clusteredBarChart.md (opens in a new tab)examples/visualTypes/clusteredColumnChart.md (opens in a new tab)examples/visualTypes/columnChart.md (opens in a new tab)examples/visualTypes/decompositionTreeVisual.md (opens in a new tab)examples/visualTypes/donutChart.md (opens in a new tab)examples/visualTypes/filledMap.md (opens in a new tab)examples/visualTypes/filter.md (opens in a new tab)examples/visualTypes/funnel.md (opens in a new tab)examples/visualTypes/gauge.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
power-bi, report-themes, formatting-debt, visual-consistency
npx claudepluginhub insightfulanalytics/pbi_agentic_dev --plugin reports10 skills in this plugin
/create-pbi-reportStep-by-step workflow for creating complete Power BI reports from scratch using pbir CLI. Covers model discovery, report creation, page layout, theme setup, visual placement, field binding, filtering, formatting, validation, and publishing. Automatically invoke when the user asks to "create a new report", "build a report from scratch", "make a dashboard", "set up a report with KPIs", "create an executive dashboard", "add pages and visuals to a new report"./desktop-screen-captureScreenshot what is on this Windows screen, the whole desktop or one window found by title, and save a PNG the agent can Read. Use whenever you need to SEE a GUI such as Power BI Desktop, a dialog, a display symptom or a browser, especially when `pbir desktop screenshot` or the Desktop Bridge is unavailable. Triggers include "what's on screen", "screenshot Power BI", "look at my screen"./pbi-planPlan a multi-session Power BI report or model build as a numbered ticket map with an HTML plan board. Use when the user asks to plan a build, map out a report, or resume a build that spans more than one session. User-invoked only, via /pbi-plan./pbir-cliThis skill should be used whenever the user mentions "pbir", "pbir-cli", "Power BI reports", or "PBI reports", works with .pbir, .pbip, or .pbix files, or wants to refresh, screenshot, or visually verify a report that is open in Power BI Desktop. Covers creating, exploring, formatting, validating, and publishing Power BI reports through the pbir CLI and object model, plus driving Power BI Desktop (canvas reload, page screenshots) and querying connected or local semantic models./pbi-report-designThe Power BI report design canon covering design identity, visual hierarchy and the 3-30-300 rule, page shapes, layout and alignment, chart selection, KPI and card design, tables and matrices, and how Power BI applies color and alt text. The shared reference home for report design judgment, routed to by the create-pbi-report, pbir-cli, review-report, modifying-theme-json, and custom-visual skills. Load when committing a design identity or making a layout, chart-selection, KPI or conditional-formatting decision for a report./pbi-verify-loopVisually verify Power BI report edits against a running Power BI Desktop. Refresh the canvas from disk, wait until rendering is stable, screenshot the page, and optionally diff against a mockup. Use after ANY edit to PBIR visual.json, pages or theme while Desktop is open, and when the user asks to "check the report", "verify the change" or "screenshot the page".Other plugins' skills for the same job