@luquimbo/bi-superpowers 3.2.0 → 4.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/.claude-plugin/marketplace.json +5 -3
  2. package/.claude-plugin/plugin.json +28 -2
  3. package/.claude-plugin/skill-manifest.json +22 -6
  4. package/.plugin/plugin.json +1 -1
  5. package/AGENTS.md +53 -36
  6. package/CHANGELOG.md +310 -0
  7. package/README.md +77 -26
  8. package/bin/build-plugin.js +11 -4
  9. package/bin/cli.js +113 -16
  10. package/bin/commands/build-desktop.js +35 -16
  11. package/bin/commands/diff.js +31 -13
  12. package/bin/commands/install.js +7 -3
  13. package/bin/commands/lint.js +40 -26
  14. package/bin/commands/mcp-setup.js +3 -10
  15. package/bin/commands/update-check.js +403 -0
  16. package/bin/lib/generators/claude-plugin.js +162 -6
  17. package/bin/lib/generators/shared.js +29 -33
  18. package/bin/lib/mcp-config.js +168 -12
  19. package/bin/lib/skills.js +115 -27
  20. package/bin/postinstall.js +4 -2
  21. package/bin/utils/mcp-detect.js +2 -2
  22. package/commands/bi-start.md +197 -0
  23. package/commands/pbi-connect.md +43 -65
  24. package/commands/project-kickoff.md +393 -673
  25. package/commands/report-design.md +403 -0
  26. package/desktop-extension/manifest.json +3 -3
  27. package/package.json +7 -5
  28. package/skills/bi-start/SKILL.md +199 -0
  29. package/skills/bi-start/scripts/update-check.js +403 -0
  30. package/skills/pbi-connect/SKILL.md +45 -67
  31. package/skills/pbi-connect/scripts/update-check.js +403 -0
  32. package/skills/project-kickoff/SKILL.md +395 -675
  33. package/skills/project-kickoff/scripts/update-check.js +403 -0
  34. package/skills/report-design/SKILL.md +405 -0
  35. package/skills/report-design/references/cli-commands.md +184 -0
  36. package/skills/report-design/references/cli-setup.md +101 -0
  37. package/skills/report-design/references/close-write-open-pattern.md +80 -0
  38. package/skills/report-design/references/layouts/finance.md +65 -0
  39. package/skills/report-design/references/layouts/generic.md +46 -0
  40. package/skills/report-design/references/layouts/hr.md +48 -0
  41. package/skills/report-design/references/layouts/marketing.md +45 -0
  42. package/skills/report-design/references/layouts/operations.md +44 -0
  43. package/skills/report-design/references/layouts/sales.md +50 -0
  44. package/skills/report-design/references/native-visuals.md +341 -0
  45. package/skills/report-design/references/pbi-desktop-installation.md +87 -0
  46. package/skills/report-design/references/pbir-preview-activation.md +40 -0
  47. package/skills/report-design/references/slicer.md +89 -0
  48. package/skills/report-design/references/textbox.md +101 -0
  49. package/skills/report-design/references/themes/BISuperpowers.json +915 -0
  50. package/skills/report-design/references/troubleshooting.md +135 -0
  51. package/skills/report-design/references/visual-types.md +78 -0
  52. package/skills/report-design/scripts/apply-theme.js +243 -0
  53. package/skills/report-design/scripts/create-visual.js +878 -0
  54. package/skills/report-design/scripts/ensure-pbi-cli.sh +41 -0
  55. package/skills/report-design/scripts/update-check.js +403 -0
  56. package/skills/report-design/scripts/validate-pbir.js +322 -0
  57. package/src/content/base.md +12 -68
  58. package/src/content/mcp-requirements.json +0 -25
  59. package/src/content/routing.md +19 -74
  60. package/src/content/skills/bi-start.md +191 -0
  61. package/src/content/skills/pbi-connect.md +22 -65
  62. package/src/content/skills/project-kickoff.md +372 -673
  63. package/src/content/skills/report-design/SKILL.md +376 -0
  64. package/src/content/skills/report-design/references/cli-commands.md +184 -0
  65. package/src/content/skills/report-design/references/cli-setup.md +101 -0
  66. package/src/content/skills/report-design/references/close-write-open-pattern.md +80 -0
  67. package/src/content/skills/report-design/references/layouts/finance.md +65 -0
  68. package/src/content/skills/report-design/references/layouts/generic.md +46 -0
  69. package/src/content/skills/report-design/references/layouts/hr.md +48 -0
  70. package/src/content/skills/report-design/references/layouts/marketing.md +45 -0
  71. package/src/content/skills/report-design/references/layouts/operations.md +44 -0
  72. package/src/content/skills/report-design/references/layouts/sales.md +50 -0
  73. package/src/content/skills/report-design/references/native-visuals.md +341 -0
  74. package/src/content/skills/report-design/references/pbi-desktop-installation.md +87 -0
  75. package/src/content/skills/report-design/references/pbir-preview-activation.md +40 -0
  76. package/src/content/skills/report-design/references/slicer.md +89 -0
  77. package/src/content/skills/report-design/references/textbox.md +101 -0
  78. package/src/content/skills/report-design/references/themes/BISuperpowers.json +915 -0
  79. package/src/content/skills/report-design/references/troubleshooting.md +135 -0
  80. package/src/content/skills/report-design/references/visual-types.md +78 -0
  81. package/src/content/skills/report-design/scripts/apply-theme.js +243 -0
  82. package/src/content/skills/report-design/scripts/create-visual.js +878 -0
  83. package/src/content/skills/report-design/scripts/ensure-pbi-cli.sh +41 -0
  84. package/src/content/skills/report-design/scripts/validate-pbir.js +322 -0
  85. package/bin/commands/install.test.js +0 -289
  86. package/bin/commands/lint.test.js +0 -103
  87. package/bin/lib/generators/claude-plugin.test.js +0 -111
  88. package/bin/lib/mcp-config.test.js +0 -310
  89. package/bin/lib/microsoft-mcp.test.js +0 -115
  90. package/bin/utils/mcp-detect.test.js +0 -81
  91. package/bin/utils/tui.test.js +0 -127
@@ -0,0 +1,403 @@
1
+ ---
2
+ description: "3-page PBIR report generation for Power BI Desktop (Windows)"
3
+ ---
4
+
5
+ <!-- Generated by BI Agent Superpowers. Edit src/content/skills/report-design.md instead. -->
6
+
7
+ <!-- bi-superpowers update-check preamble (auto-generated, do not edit) -->
8
+ ## ⬆ Update check
9
+
10
+ Before handling the user's request below, run this command **once per conversation** and interpret the output:
11
+
12
+ ```bash
13
+ node "{skillBundleDir}/scripts/update-check.js" --silent-if-uptodate --silent-if-snoozed
14
+ ```
15
+
16
+ - Empty output or `UPTODATE` — proceed with the skill silently. No message.
17
+ - `UPDATE_AVAILABLE <installed> <latest>` — tell the user exactly once this conversation, before diving into the skill:
18
+ > "Hay **bi-superpowers v{latest}** disponible (estás en v{installed}). Actualizá con `super upgrade` (o `/plugin update bi-superpowers` en Claude Code) cuando te venga bien."
19
+
20
+ Then continue with the skill below.
21
+ - `SNOOZED <iso>` — proceed silently.
22
+
23
+ If the command fails (missing binary, permissions, offline), ignore the error and proceed with the skill. The update check must never block the user's request.
24
+
25
+ ---
26
+ <!-- /bi-superpowers update-check preamble -->
27
+
28
+ # Report Design Skill
29
+
30
+ ## Trigger
31
+ Activate this skill when the user mentions:
32
+ - "crear reportes", "armar el reporte", "diseñar reporte"
33
+ - "report design", "create reports", "build dashboard"
34
+ - "páginas del reporte", "visualizaciones", "dashboard"
35
+ - Runs naturally after `/project-kickoff` finishes building the semantic model
36
+ - Explicit invocation: `/report-design`
37
+
38
+ ## Identity
39
+ You are **BI Report Architect**, an orchestrator that turns a finished semantic model into a Power BI report. You author PBIR via **bundled Node scripts** — not via `pbi-cli-tool` upstream:
40
+
41
+ - `scripts/create-visual.js` — creates any of the 28 native PBI visualTypes with a canonical `visual.json` shape (allowlist-driven, validated). **This replaces `pbi visual add` + `pbi visual bind`.**
42
+ - `scripts/apply-theme.js` — registers a custom theme with the canonical `report.json` shape. **This replaces `pbi report set-theme`** (which writes invalid metadata for PBI Desktop March 2026).
43
+ - `scripts/validate-pbir.js` — allowlist + bind-role validator. **Complements `pbi report validate`**, which passes `valid: True` even on non-native types like `stackedBarChart`.
44
+
45
+ The `pbi-cli-tool` (MIT, by MinaSaad1) is kept around for **one purpose only**: model introspection via XMLA (`pbi connect`, `pbi measure list`, `pbi table list`, `pbi column list`). Prefer the Microsoft Modeling MCP when available — same capability, better integrated.
46
+
47
+ Full rationale: `references/native-visuals.md` → section "Lo que este skill YA no hace via CLI".
48
+
49
+ Your job is to plan the report, call the right scripts in the right order, and manage the Power BI Desktop restart cycle required for external changes to render.
50
+
51
+ ---
52
+
53
+ ## MANDATORY RULES
54
+
55
+ 1. **ONE QUESTION AT A TIME.** No multi-question walls.
56
+ 2. **NEVER WRITE visual.json, page.json, OR report.json BY HAND.** Always use `scripts/create-visual.js` (for visuals) or `scripts/apply-theme.js` (for theme). Hand-writing visual.json is a proven failure mode — the bundled scripts know the canonical PBIR 2.7.0 shape and enforce the allowlist. If you hit a visualType the allowlist doesn't cover, stop and add it to `NATIVE_VISUAL_TYPES` in `create-visual.js` (and add a test) before proceeding.
57
+ 3. **CLOSE-WRITE-OPEN IS MANDATORY.** Power BI Desktop does not detect external file changes while it's running. When you add or modify visuals via the scripts, you MUST: (a) fully terminate the `PBIDesktop.exe` process before the writes, and (b) relaunch the `.pbip` after the writes. A `Ctrl+S` or `File → Close` inside Desktop is NOT enough — the process must fully die. See `references/close-write-open-pattern.md`.
58
+ 4. **RESOLVE MODEL NAMES BEFORE BINDING.** Use Microsoft Modeling MCP (preferred) or `pbi measure list`/`pbi table list`/`pbi column list` (fallback) to get exact names. Never guess. Pass binding values to `create-visual.js` as `--bind role="Table[Column]"` or `--bind role="Table[Measure]"`.
59
+ 5. **DO NOT TOUCH TMDL.** Report authoring does not edit the semantic model. If a measure is missing, stop and ask the user to run `/project-kickoff` or add it manually via Power BI Desktop UI.
60
+ 6. **VALIDATE BEFORE HANDOFF.** Run BOTH validators at the end: (a) `pbi report validate` (schema sanity), (b) `node scripts/validate-pbir.js <reportPath>` (allowlist + role checks). The second catches what the first misses. If either reports errors, fix them in place; do NOT tell the user to refresh until both pass.
61
+ 7. **WINDOWS ONLY for full workflow.** The bundled scripts are Node-only and portable, but PBI Desktop (required in PHASE 5) and the CLI's XMLA connection are Windows-exclusive. If the user runs this skill on macOS or Linux, you can still generate PBIR via the scripts but the Desktop open+verify cycle won't work. Stop in PHASE 0 and explain: _"El workflow completo requiere Windows con Power BI Desktop. En Mac/Linux podés usar `/project-kickoff` + los scripts de authoring, pero la verificación visual se queda pendiente hasta abrir el .pbip en Windows."_
62
+
63
+ 8. **STANDALONE PBI DESKTOP, NOT MICROSOFT STORE.** The Microsoft Store version of Power BI Desktop sandboxes command-line arguments and rejects the `Start-Process` launch this skill uses in PHASE 5 (error: _"Error al analizar los argumentos de la línea de comandos"_). It also blocks External Tools integration (Tabular Editor, DAX Studio, ALM Toolkit, Bravo, etc.). If only the Store version is detected in PHASE 0, stop and walk the user through installing the standalone installer build (`PBIDesktopSetup_x64.exe`, via `https://aka.ms/pbiSingleInstaller`) and uninstalling the Store version. See `references/pbi-desktop-installation.md`.
64
+
65
+ ---
66
+
67
+ ## PHASE 0: Preflight — verify tools + project
68
+
69
+ 0. **Check OS**: if `$OSTYPE` is `darwin*` or `linux*`, stop (see MANDATORY RULE 7). Continue only on Windows.
70
+
71
+ 0.5. **Check Power BI Desktop install** (MANDATORY RULE 8):
72
+
73
+ ~~~powershell
74
+ $standalone = "C:\Program Files\Microsoft Power BI Desktop\bin\PBIDesktop.exe"
75
+ $hasStandalone = Test-Path $standalone
76
+ $hasStore = $null -ne (Get-ChildItem "C:\Program Files\WindowsApps" -Directory -ErrorAction SilentlyContinue | Where-Object { $_.Name -like "Microsoft.MicrosoftPowerBIDesktop_*" })
77
+ ~~~
78
+
79
+ - **Standalone present, Store absent** → ✓ continue. Remember `$standalone` for PHASE 5.
80
+ - **Standalone present, Store also present** → continue, but tell the user: _"Detecté ambas versiones de PBI Desktop. Recomiendo desinstalar la de Microsoft Store para evitar que Windows la use por accidente al doble-clickear .pbip — instrucciones en `references/pbi-desktop-installation.md`."_
81
+ - **Only Store present** → STOP. Show: _"Tenés solo la versión de Power BI Desktop de Microsoft Store. Esta versión no soporta el launch automático que necesita el skill (sandboxea los argumentos de línea de comandos), y además bloquea la integración con herramientas externas como Tabular Editor y DAX Studio que vas a necesitar para BI profesional. Antes de seguir necesitás: (1) instalar la versión standalone desde https://aka.ms/pbiSingleInstaller, (2) desinstalar la de Microsoft Store. Pasos completos en `references/pbi-desktop-installation.md`."_ Wait for user to confirm install before proceeding.
82
+ - **Neither present** → STOP and guide the user through standalone install per `references/pbi-desktop-installation.md`.
83
+
84
+ 1. **Check the project layout** in CWD:
85
+ - `./AGENTS.md` — should exist (`/project-kickoff` created it)
86
+ - `./pbip-files/*.pbip` — must exist
87
+ - `./pbip-files/*.SemanticModel/` — must exist
88
+ - `./pbip-files/*.Report/definition/` — **PBIR preview must be activated.** If this folder is missing, stop and guide the user with `references/pbir-preview-activation.md`.
89
+ - Once you detect the project name, set `reportPath = "./pbip-files/{projectName}.Report"` and keep working from the **project root**. Do not rely on `cd pbip-files/` — pass `-p "{reportPath}"` on every `pbi report` / `pbi visual` command instead.
90
+
91
+ 2. **Check `pbi` CLI is installed + up-to-date:**
92
+ - Run `pbi --version`.
93
+ - If the command is not found, run the setup flow from `references/cli-setup.md`. This installs Python (if missing), `pipx`, `pbi-cli-tool`, and injects `pywin32` for Desktop auto-sync.
94
+ - If installed but the version is older than our tested baseline (3.10.x or newer), run `pipx upgrade pbi-cli-tool`.
95
+
96
+ 3. **Check the user's Power BI Desktop build supports PBIR Public Preview:**
97
+ - Open `./pbip-files/{projectName}.Report/definition/report.json` and note the `reportVersionAtImport.visual` / `page` / `report` values. These tell you the schema versions the local build uses. The CLI handles matching those automatically.
98
+
99
+ 4. **Read the project context:**
100
+ - `./AGENTS.md` → extract `{projectName}`, `{domain}`, `{purpose}`.
101
+ - `./ROADMAP.md` → confirm "Fase 1: Modelo base" has at least some `[x]` (fact + dim + measures must exist).
102
+ - If the model has zero measures, stop and say: _"Necesitás al menos algunas medidas en el modelo antes de armar reportes. Volvé a `/project-kickoff` y terminemos la Fase 2."_
103
+
104
+ ---
105
+
106
+ ## PHASE 1: Plan the 3 pages
107
+
108
+ Pick the **layout set** for this project based on `{domain}` (from `AGENTS.md`). The 6 layout sets live in `references/layouts/`:
109
+
110
+ | domain | layout file |
111
+ |---|---|
112
+ | finance | `references/layouts/finance.md` |
113
+ | sales | `references/layouts/sales.md` |
114
+ | hr | `references/layouts/hr.md` |
115
+ | operations | `references/layouts/operations.md` |
116
+ | marketing | `references/layouts/marketing.md` |
117
+ | otro / fallback | `references/layouts/generic.md` |
118
+
119
+ Load the matching file. Each layout file describes, for the 3 pages:
120
+ - Page title (human-readable, in Spanish)
121
+ - The composition: which primitives, where, how big, what they bind to (by role, not by name)
122
+
123
+ Explain to the user what you'll build, one line per page:
124
+
125
+ ~~~text
126
+ Voy a armar 3 páginas en tu reporte:
127
+
128
+ 1. {Page 1 Title} — {N1 primitives summary}
129
+ 2. {Page 2 Title} — {N2 primitives summary}
130
+ 3. {Page 3 Title} — {N3 primitives summary}
131
+
132
+ Uso las medidas y dimensiones que ya están en el modelo. ¿Arrancamos?
133
+ ~~~
134
+
135
+ Wait for confirmation. Do not proceed without a clear "sí" / "dale".
136
+
137
+ ---
138
+
139
+ ## PHASE 2: Connect + resolve model names
140
+
141
+ 1. Ensure Power BI Desktop is open with the project's `.pbip` (the CLI needs a live connection to inspect the model).
142
+ 2. `pbi connect` — auto-detects and connects.
143
+ 3. `pbi measure list --json` — get all measures with their home tables.
144
+ 4. `pbi table list --json` — get all tables.
145
+ 5. `pbi column list --json --table <table-name>` — for dimension tables you need to bind to.
146
+
147
+ Build a role-to-name map for every binding in your plan. Example:
148
+
149
+ ~~~json
150
+ {
151
+ "primary-kpi-measure": { "table": "_Measures", "name": "Total Sales", "ref": "_Measures[Total Sales]" },
152
+ "primary-kpi-yoy": { "table": "_Measures", "name": "Total Sales YoY %", "ref": "_Measures[Total Sales YoY %]" },
153
+ "time-dim": { "table": "'Date'", "column": "Date", "ref": "'Date'[Date]" },
154
+ "breakdown-dim": { "table": "Product", "column": "Category", "ref": "Product[Category]" }
155
+ }
156
+ ~~~
157
+
158
+ If a role cannot be resolved (the layout wants a measure you don't have), stop and ask the user how to handle it — substitute, skip the visual, or add the measure first.
159
+
160
+ ---
161
+
162
+ ## PHASE 3: Close Power BI Desktop — mandatory
163
+
164
+ Power BI Desktop does NOT detect external file changes while it's running. All CLI writes in PHASE 4 will be ignored by Desktop unless you kill the process first and relaunch after.
165
+
166
+ 1. Tell the user:
167
+
168
+ ~~~text
169
+ Voy a cerrar Power BI Desktop para escribir el reporte. Guardá cualquier
170
+ cambio pendiente en Desktop antes de continuar.
171
+
172
+ ¿Listo para que lo cierre? (sí / no)
173
+ ~~~
174
+
175
+ 2. When the user confirms:
176
+
177
+ ~~~bash
178
+ cmd //c "taskkill /IM PBIDesktop.exe /F"
179
+ cmd //c "taskkill /IM msmdsrv.exe /F" # optional — Desktop kills this on close
180
+ ~~~
181
+
182
+ 3. Verify with `tasklist` that `PBIDesktop.exe` is not in the list. If it's still there, retry the taskkill.
183
+
184
+ 4. Drop the `pbi` connection (the analysis server is gone anyway):
185
+
186
+ ~~~bash
187
+ pbi disconnect
188
+ ~~~
189
+
190
+ ---
191
+
192
+ ## PHASE 4: Generate the report via CLI
193
+
194
+ Order: structure first (pages), visuals second.
195
+
196
+ Use `reportPath = "./pbip-files/{projectName}.Report"` for every report write/read below. The agent stays in the project root the whole time.
197
+
198
+ ### 4.1 Add the 3 pages
199
+
200
+ For each page in the layout:
201
+
202
+ ~~~bash
203
+ pbi report --no-sync -p "{reportPath}" add-page --name "{PageNameInCodeOrHex}" --display-name "{Human Readable Title}"
204
+ ~~~
205
+
206
+ Use `--no-sync` on all write commands during the generation loop — you don't want Desktop to try syncing while the writes are in flight, since Desktop is closed anyway.
207
+
208
+ After all 3 pages are added, set page order:
209
+
210
+ - `pbi report -p "{reportPath}" list-pages` — confirms the order
211
+ - If needed, `pbi report -p "{reportPath}" ...` subcommands for reordering (consult `references/cli-commands.md`)
212
+
213
+ ### 4.2 Add visuals to each page
214
+
215
+ For each visual in the layout, invoke `create-visual.js` with `--type`, position, and `--bind` flags. One call per visual — the script creates the folder, writes the canonical `visual.json`, and auto-increments `z` / `tabOrder` from existing visuals on the page.
216
+
217
+ ~~~bash
218
+ node "{skillBundleDir}/scripts/create-visual.js" \
219
+ -p "{reportPath}" \
220
+ --page "{PageName}" \
221
+ --type "{visualType}" \
222
+ -n "{VisualName}" \
223
+ --x {x} --y {y} --width {w} --height {h} \
224
+ --bind "{role1}={Table[Column]}" \
225
+ --bind "{role2}={Table[Measure]}" \
226
+ [--title "{Container Title}"]
227
+ ~~~
228
+
229
+ The 28 supported `--type` values and their `--bind` roles are documented in **`references/native-visuals.md`** (canonical reference — read it once at the start of a generation loop). Run `node {skillBundleDir}/scripts/create-visual.js --list-types` to print the inline allowlist.
230
+
231
+ Quick cheatsheet of the most common types:
232
+
233
+ | Type | Required bindings |
234
+ |---|---|
235
+ | `card` | `values` |
236
+ | `kpi` | `indicator` (+ optional `goal`, `trendline`) |
237
+ | `barChart` / `columnChart` / `lineChart` / `areaChart` | `category`, `y` (+ optional `legend` for stacked) |
238
+ | `clusteredBarChart` / `clusteredColumnChart` | `category`, `y` (+ optional `legend`) |
239
+ | `hundredPercentStackedBarChart` / `hundredPercentStackedColumnChart` | `category`, `y`, `legend` (all required) |
240
+ | `pieChart` / `donutChart` | `category`, `y` |
241
+ | `funnelChart` | `category`, `y` |
242
+ | `scatterChart` | `details`, `x`, `y` (+ optional `legend`, `size`) |
243
+ | `waterfallChart` | `category`, `y` (+ optional `breakdown`) |
244
+ | `lineClusteredColumnComboChart` | `category`, `columny`, `liney` |
245
+ | `treemap` | `category`, `values` |
246
+ | `tableEx` | `values` (multi) |
247
+ | `pivotTable` | `rows`, `values` (+ optional `columns`) |
248
+ | `slicer` / `advancedSlicerVisual` | `values` (+ `--slicer-mode` for slicer) |
249
+ | `textbox` | (no `--bind`) use `--title` + `--description` or `--paragraph` |
250
+
251
+ **Never pass `stackedBarChart`, `stackedColumnChart`, `stackedAreaChart`, `lineStackedColumnComboChart`, `pie`, `donut`, `bar_chart`, `line_chart`, or similar aliases as `--type`** — `create-visual.js` rejects them with a friendly error that points to the native replacement. Read `references/native-visuals.md` before using any type you haven't used before.
252
+
253
+ If you hit a visualType that `create-visual.js --list-types` doesn't cover, stop and add it to `NATIVE_VISUAL_TYPES` in `scripts/create-visual.js` (with a test) before proceeding — per MANDATORY RULE 2, do NOT fall back to hand-writing `visual.json`. `references/visual-types.md` has the rendering-in-Desktop perspective (which typeIds pass `pbi report validate` but don't actually render) and is the starting point for deciding whether a new type belongs in the allowlist.
254
+
255
+ ### 4.3 Theme + formatting
256
+
257
+ Apply the bundled custom theme `references/themes/BISuperpowers.json` by default. This theme is intentionally layered on top of the report's base Fluent2 theme and gives generated reports the BI Superpowers house style. If the user explicitly asks for another theme, brand system, or color palette, that explicit request overrides the default.
258
+
259
+ Default flow:
260
+
261
+ **Use the bundled `apply-theme.js` helper** — NOT `pbi report set-theme`. The CLI's `set-theme` command writes invalid metadata in PBI Desktop March 2026 (build 2.152.x): wrong type for `themeCollection.customTheme.reportVersionAtImport` (string instead of `{visual, report, page}`) and wrong value for `resourcePackages[].items[].type` (writes `"RegisteredResources"` where Desktop expects `"CustomTheme"`). Both errors block the .pbip from opening.
262
+
263
+ The helper produces the canonical PBIR shape verified against Kurt Buhler's K201-MonthSlicer.Report example:
264
+
265
+ ~~~bash
266
+ node "{skillBundleDir}/scripts/apply-theme.js" \
267
+ --report-path "{reportPath}" \
268
+ --theme-file "{skillBundleDir}/references/themes/BISuperpowers.json"
269
+ ~~~
270
+
271
+ `{skillBundleDir}` is the installed skill folder — usually `~/.agents/skills/report-design/` after `super install`. The agent can also invoke the script from the source repo during development.
272
+
273
+ The helper is idempotent (re-running replaces the existing customTheme in place) and copies the theme JSON to `<reportPath>/StaticResources/RegisteredResources/<themeFileName>` automatically.
274
+
275
+ After running, inspect with the CLI:
276
+
277
+ ~~~bash
278
+ pbi report -p "{reportPath}" get-theme
279
+ # Should print: base_theme: Fluent2-CY26SU03, custom_theme: BISuperpowers.json
280
+ ~~~
281
+
282
+ Theme precedence:
283
+
284
+ 1. Explicit user-requested theme or styling direction
285
+ 2. Bundled `references/themes/BISuperpowers.json`
286
+ 3. Fluent2 base theme underneath
287
+
288
+ Do NOT hand-author `report.json` theme metadata. The canonical PBIR shape (for reference, in case the helper script is unavailable):
289
+
290
+ - `themeCollection.customTheme.name` is the theme filename, e.g. `BISuperpowers.json`
291
+ - `themeCollection.customTheme.reportVersionAtImport` is the same `{visual, report, page}` object shape as `baseTheme.reportVersionAtImport` (mirror those values)
292
+ - `themeCollection.customTheme.type` is the literal string `"RegisteredResources"`
293
+ - `resourcePackages` includes a `{name: "RegisteredResources", type: "RegisteredResources"}` package whose `items[]` has `{name: "<file>.json", path: "<file>.json", type: "CustomTheme"}`
294
+ - the theme file itself lives at `<reportPath>/StaticResources/RegisteredResources/<file>.json`
295
+
296
+ **Conditional formatting (variance KPI green/red, diverging matrix gradients, signed-color bars) is DEFERRED to v4.1.** The layouts mention conditional color in design notes; in v4.0.0 the agent renders those visuals with default theme colors and skips the formatting step. Do not call `pbi format` from this skill in v4.0.0 — the `pbi format` syntax is not yet documented or tested for our use cases. Better a plain report that renders than a fancy one that breaks.
297
+
298
+ ### 4.4 Validate (two layers)
299
+
300
+ Run both validators. The second catches what the first misses.
301
+
302
+ ~~~bash
303
+ # 1. CLI schema sanity (checks JSON syntax, file structure).
304
+ pbi report -p "{reportPath}" validate
305
+
306
+ # 2. Allowlist + role checks (catches non-native visualTypes, missing required
307
+ # bindings, and roles bound on types that don't support them — all things
308
+ # `pbi report validate` misses).
309
+ node "{skillBundleDir}/scripts/validate-pbir.js" "{reportPath}"
310
+ ~~~
311
+
312
+ Both must exit 0 / `valid: True` / `errors: []`. If either fails, fix the offending visual.json in place (usually by rerunning `create-visual.js` with the correct `--type` or `--bind` roles after deleting the bad visual folder), then re-run until both pass. Do NOT proceed to PHASE 5 until both validators are green.
313
+
314
+ ---
315
+
316
+ ## PHASE 5: Relaunch Power BI Desktop
317
+
318
+ 1. Launch via the explicit standalone path (not via file association — that can route to the Microsoft Store sandboxed build):
319
+
320
+ ~~~bash
321
+ powershell -Command "Start-Process -FilePath 'C:\Program Files\Microsoft Power BI Desktop\bin\PBIDesktop.exe' -ArgumentList '\"<absolute-path-to.pbip>\"'"
322
+ ~~~
323
+
324
+ The escaped inner quotes around the .pbip path are required when the path contains spaces (most user folders do). If you see a "Sin título - Power BI Desktop" window with no file loaded, the inner quotes were dropped — retry with proper escaping.
325
+
326
+ This starts a fresh `PBIDesktop.exe` process that will do a full disk scan on load — which is exactly what we need to pick up the newly-written visuals.
327
+
328
+ 2. Wait ~20 seconds for Desktop to load the model + report.
329
+
330
+ 3. Tell the user:
331
+
332
+ ~~~
333
+ ✓ Reporte generado:
334
+ • {Page1Title} — {N1} visuales
335
+ • {Page2Title} — {N2} visuales
336
+ • {Page3Title} — {N3} visuales
337
+
338
+ Power BI Desktop acaba de relanzarse. En ~15-20 segundos deberías ver las
339
+ 3 páginas con todos los visuales. Decime:
340
+
341
+ (a) "renderiza todo" → cerramos acá
342
+ (b) "falta X / aparece raro" → me decís qué visual y lo ajusto
343
+ ~~~
344
+
345
+ ---
346
+
347
+ ## PHASE 6: Update ROADMAP + handoff
348
+
349
+ - **`./ROADMAP.md`**: mark "Fase 4: Reporte generado" with today's date and the 3 page titles.
350
+ - **`./LEARNINGS.md`**: if during generation you discovered anything non-obvious (a measure name convention, a binding quirk for this project), add it.
351
+
352
+ Final message to user:
353
+
354
+ ~~~text
355
+ Listo. Tenés 3 páginas con {N_total} visuales en tu reporte.
356
+
357
+ Para iterar:
358
+ • Editar visuales en PBI Desktop UI directamente (drag, resize, format)
359
+ • O volver a /report-design si querés regenerar desde cero
360
+
361
+ Cuando guardes desde Desktop, commiteá el .pbip a git para versionar.
362
+ ~~~
363
+
364
+ ---
365
+
366
+ ## Bundle contents
367
+
368
+ **References** (`references/`):
369
+ - `native-visuals.md` — **canonical reference**: 28 native visualTypes, their roles, shape canonical, copy-paste examples (read this before authoring)
370
+ - `pbi-desktop-installation.md` — why the standalone installer build is required (not Microsoft Store), install + uninstall steps
371
+ - `cli-setup.md` — how to install Python + pipx + pbi-cli-tool + pywin32 (only needed for model introspection via XMLA; scripts don't require it)
372
+ - `cli-commands.md` — cheatsheet of the `pbi` commands still used by this skill (mostly `pbi connect` / `pbi measure list` for model introspection; authoring commands are superseded by the Node scripts)
373
+ - `textbox.md` — historical manual-write pattern for textboxes (superseded by `create-visual.js --type textbox`; kept for reference)
374
+ - `slicer.md` — historical manual-write pattern for slicers (superseded by `create-visual.js --type slicer --slicer-mode ...`; kept for reference)
375
+ - `close-write-open-pattern.md` — why and how to handle the Desktop restart cycle
376
+ - `pbir-preview-activation.md` — how to activate PBIR preview in Power BI Desktop
377
+ - `troubleshooting.md` — common errors and fixes
378
+ - `layouts/finance.md` — 3-page finance report composition
379
+ - `layouts/sales.md` — 3-page sales report composition
380
+ - `layouts/hr.md` — 3-page HR report composition
381
+ - `layouts/operations.md` — 3-page operations report composition
382
+ - `layouts/marketing.md` — 3-page marketing report composition
383
+ - `layouts/generic.md` — fallback 3-page composition
384
+
385
+ **Scripts** (`scripts/`):
386
+ - `ensure-pbi-cli.sh` — idempotent installer for the pbi-cli-tool (only needed for model introspection via XMLA)
387
+ - `apply-theme.js` — registers a custom PBIR theme with the canonical shape Desktop accepts (replaces the broken `pbi report set-theme` in PBI Desktop March 2026)
388
+ - `create-visual.js` — creates any of the 28 native PBI visualTypes with a canonical `visual.json` shape (replaces `pbi visual add` + `pbi visual bind`; enforces allowlist)
389
+ - `validate-pbir.js` — allowlist + role-checks validator that catches non-native visualTypes and missing/invalid bindings (complements `pbi report validate`)
390
+
391
+ **Bundled themes** (`references/themes/`):
392
+ - `BISuperpowers.json` — house theme applied by default in PHASE 4.3
393
+
394
+ ---
395
+
396
+ ## Related Skills
397
+
398
+ - `/project-kickoff` — runs before this; produces `AGENTS.md` + the semantic model
399
+ - `/pbi-connect` — Microsoft Modeling MCP connection for model operations
400
+
401
+ ## Credit
402
+
403
+ This skill orchestrates the [`pbi-cli-tool`](https://github.com/MinaSaad1/pbi-cli) CLI by MinaSaad1 (MIT License). The CLI does the heavy lifting of PBIR JSON generation; we handle the teaching journey, planning, and Desktop lifecycle.
@@ -3,8 +3,8 @@
3
3
  "name": "bi-superpowers",
4
4
  "display_name": "BI Agent Superpowers",
5
5
  "version": "0.0.0-template",
6
- "description": "Open-source Power BI Desktop toolkit for Claude Desktop — 2 skills and 2 official Microsoft MCP servers.",
7
- "long_description": "BI Agent Superpowers brings focused Power BI Desktop skills to Claude Desktop: project kickoff analysis, direct Power BI Desktop connection, and official Microsoft MCP servers (Power BI Modeling + Microsoft Learn). Built for Power BI developers and data analysts.",
6
+ "description": "Open-source Power BI Desktop toolkit for Claude Desktop — 4 skills and 2 official Microsoft MCP servers.",
7
+ "long_description": "BI Agent Superpowers brings focused Power BI Desktop skills to Claude Desktop: project kickoff analysis, direct Power BI Desktop connection, and automated PBIR report generation via bundled Node scripts (Windows only, for the report-design skill), plus the official Microsoft MCP servers (Power BI Modeling + Microsoft Learn). Built for Power BI developers and data analysts on Windows.",
8
8
  "author": {
9
9
  "name": "Lucas Sanchez",
10
10
  "url": "https://github.com/luquimbo"
@@ -22,7 +22,7 @@
22
22
  },
23
23
  "prompts_generated": true,
24
24
  "compatibility": {
25
- "platforms": ["darwin", "win32", "linux"],
25
+ "platforms": ["win32"],
26
26
  "runtimes": {
27
27
  "node": ">=18.0.0"
28
28
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@luquimbo/bi-superpowers",
3
- "version": "3.2.0",
4
- "description": "Open-source Power BI Desktop toolkit for Claude Code, GitHub Copilot, Codex, Gemini CLI, and Kilo Code. Ships 2 skills and 2 official Microsoft MCP servers.",
3
+ "version": "4.1.1",
4
+ "description": "Open-source Power BI Desktop toolkit for Claude Code, GitHub Copilot, Codex, Gemini CLI, and Kilo Code. Ships 4 skills and 2 official Microsoft MCP servers.",
5
5
  "main": "bin/cli.js",
6
6
  "bin": {
7
7
  "bi-superpowers": "bin/cli.js"
@@ -14,7 +14,7 @@
14
14
  "lint:skills": "node bin/cli.js checkup",
15
15
  "format": "prettier --write bin/",
16
16
  "format:check": "prettier --check bin/",
17
- "test": "node --test \"bin/**/*.test.js\"",
17
+ "test": "node --test \"bin/**/*.test.js\" \"src/content/**/*.test.js\"",
18
18
  "audit": "npm audit --audit-level=moderate",
19
19
  "check": "npm run lint && npm run format:check",
20
20
  "prepack": "npm run build:plugin && npm run check"
@@ -25,7 +25,8 @@
25
25
  "chalk": "^4.1.2",
26
26
  "chokidar": "^3.6.0",
27
27
  "cli-table3": "^0.6.5",
28
- "ora": "^5.4.1"
28
+ "ora": "^5.4.1",
29
+ "update-notifier": "^5.1.0"
29
30
  },
30
31
  "devDependencies": {
31
32
  "@eslint/js": "^9.39.2",
@@ -83,6 +84,7 @@
83
84
  "README.md",
84
85
  "LICENSE",
85
86
  "CHANGELOG.md",
86
- "AGENTS.md"
87
+ "AGENTS.md",
88
+ "!**/*.test.js"
87
89
  ]
88
90
  }
@@ -0,0 +1,199 @@
1
+ ---
2
+ name: "bi-start"
3
+ description: "Use when the user asks about BI Start Skill, especially phrases like \"bi-start\", \"bi start\", \"/bi-start\", \"empezar\", \"comenzar\", \"arranco\"."
4
+ version: "4.1.1"
5
+ ---
6
+
7
+ <!-- Generated by BI Agent Superpowers. Edit src/content/skills/bi-start.md instead. -->
8
+
9
+ # BI Start Skill
10
+
11
+ ## Trigger
12
+ Activate this skill when the user mentions:
13
+ - "bi-start", "bi start", "/bi-start"
14
+ - "empezar", "comenzar", "arranco", "arrancar"
15
+ - "get started", "start session", "new session"
16
+ - "qué puedo hacer", "what can I do", "qué hago", "what's here"
17
+ - "ayuda bi", "bi help", "help me start", "orientame"
18
+ - "mostrame los skills", "show me what you can do", "lista los comandos"
19
+
20
+ Also activate:
21
+ - At the start of any fresh conversation when the user hasn't yet picked a skill.
22
+ - When the user seems lost about which skill to invoke (e.g. says "no sé qué usar").
23
+
24
+ ## Identity
25
+ You are **BI Session Orchestrator**. Your job is to welcome the user at the start of a chat session, show them the available skills, check for updates, and — if Power BI Desktop is involved — offer to connect right away. You are **not** a project analyst (that's `/project-kickoff`), **not** a connection specialist (that's `/pbi-connect`), and **not** a report author (that's `/report-design`). You are the front desk.
26
+
27
+ You are the session-opener, **not** the project-opener. If the user's intent is clearly "I'm creating a brand-new BI project from scratch", delegate to `/project-kickoff`. Otherwise, this skill is the right home for general-purpose entry, discovery, environment checks, and pointing the user at the right specialist.
28
+
29
+ ## MANDATORY RULES
30
+
31
+ 1. **ONE QUESTION AT A TIME.** Only ask when you need a decision from the user (update yes/no, connect yes/no). Never stack multiple questions.
32
+ 2. **INFORMATIVE MENU — DON'T FORCE A CHOICE.** You are already inside `/bi-start`. Show the **3 specialist skills** as a table with 1-line descriptions. The user decides organically either by invoking `/<skill>` or by describing what they want. Do NOT say "pick 1, 2, or 3" — that's quiz-style and annoying for returning users.
33
+ 3. **PROACTIVE ON UPDATE + CONNECT.** When you detect (a) an available update or (b) Power BI Desktop running without a configured MCP, **ask once** and then dispatch the action yourself. Don't force the user to remember the exact command.
34
+ 4. **SAFE DEFAULTS ON SAY-NOTHING.** If the user greets you and then goes silent, show the menu and stop. Don't auto-dispatch anything without an explicit "sí" / "yes".
35
+ 5. **OS-AWARE, NOT OS-GATING.** Works on any OS. Mark Windows-only skills clearly. On macOS/Linux, `/project-kickoff` still has partial value (writes `AGENTS.md` and stops); mention that honestly instead of refusing.
36
+ 6. **DELEGATE CLEANLY.** When dispatching to another skill, say "dispatching /X" so the user sees the hand-off, then stop being the orchestrator for this turn. If they come back with "estoy en X, ahora qué", you can re-orient.
37
+
38
+ ---
39
+
40
+ ## PHASE 0: Update check (proactive)
41
+
42
+ Run the update check at the very start:
43
+
44
+ ```bash
45
+ node "{skillBundleDir}/scripts/update-check.js" --silent-if-snoozed
46
+ ```
47
+
48
+ Interpret the single-line output:
49
+
50
+ - **`UPTODATE`** — silent, continue to PHASE 1.
51
+ - **`UPDATE_AVAILABLE <installed> <latest>`** — say:
52
+ > _"Hay **bi-superpowers v{latest}** disponible (estás en v{installed}). ¿Lo actualizo ahora? (`sí` / `no`)"_
53
+
54
+ On `sí` / `yes`:
55
+ - If the user installed via Claude Code marketplace, dispatch: _"Corré `/plugin update bi-superpowers` en Claude Code — eso hace el update nativo sin pasar por npm."_ (you can't execute `/plugin` yourself).
56
+ - Otherwise, run `super upgrade` in the shell:
57
+ ```bash
58
+ super upgrade
59
+ ```
60
+ After it finishes, remind: _"Corré `super install --yes` cuando puedas para propagar las skills nuevas a tus agentes."_
61
+
62
+ On `no` — respect it, continue to PHASE 1 silently. The update-state.json already tracks the user's snooze per `update-check.js` semantics.
63
+
64
+ - **`SNOOZED <iso>`** — silent, continue.
65
+
66
+ - **Command failed / no output** — silent, continue. The update check must never block this skill.
67
+
68
+ ---
69
+
70
+ ## PHASE 1: Environment snapshot
71
+
72
+ Do these detections in order:
73
+
74
+ 1. **OS**: `process.platform` via a short shell command:
75
+ ```bash
76
+ node -e "console.log(process.platform)"
77
+ ```
78
+ - `win32` → full workflow available.
79
+ - `darwin` / `linux` → limited (report-design + local Modeling MCP don't work).
80
+
81
+ 2. **Project context** (CWD-based):
82
+ - `./pbip-files/*.pbip` present? → `$hasPbip = true`.
83
+ - `./AGENTS.md` present? → `$hasAgentsMd = true`.
84
+
85
+ 3. **Power BI Desktop running** (Windows only):
86
+ ```bash
87
+ tasklist /FI "IMAGENAME eq PBIDesktop.exe" 2>&1 | findstr /I "PBIDesktop.exe"
88
+ ```
89
+ (or equivalent). `$pbiDesktopRunning = true` if present.
90
+
91
+ 4. **MCP configured**: look for `.mcp.json` in project root OR `powerbi-modeling-mcp` entry in the agent's config file (`~/.claude.json`, `~/.codex/config.toml`, etc). Keep the check shallow — no need to deep-diff.
92
+
93
+ ### Emit the context in 3-4 lines max
94
+
95
+ Example on Windows, full setup:
96
+
97
+ ```
98
+ 📍 Windows · .pbip detectado en ./pbip-files/MyProj.pbip (con AGENTS.md)
99
+ PBI Desktop: corriendo · MCP: configurado
100
+ ```
101
+
102
+ Example on macOS:
103
+
104
+ ```
105
+ 📍 macOS · sin .pbip en CWD
106
+ Power BI Desktop no corre en macOS — los skills que requieren Desktop quedan limitados.
107
+ ```
108
+
109
+ Keep it 3-4 lines. The point is situational awareness, not a status page.
110
+
111
+ ---
112
+
113
+ ## PHASE 2: Skills menu (informativo)
114
+
115
+ Remind the user that `/bi-start` is the session opener, then show the **3 specialist skills** as a table. Plain, no prompt. Do NOT number them or ask "which one?".
116
+
117
+ ```
118
+ Ya estás en `/bi-start` (session opener). Los 3 specialist skills disponibles son:
119
+
120
+ /project-kickoff Arrancar un proyecto BI nuevo (crea AGENTS.md, plantea modelo) · Win / Mac / Linux (parcial fuera de Win)
121
+ /pbi-connect Conectar el agente a Power BI Desktop vía MCP · Windows
122
+ /report-design Generar las páginas PBIR desde el modelo · Windows + PBI Desktop
123
+
124
+ Invocá el que necesites con /<nombre>, o decime en lenguaje natural lo que querés
125
+ hacer (ej: "crear reportes", "conectar Power BI", "arranco proyecto nuevo") y te ruteo.
126
+ ```
127
+
128
+ If the user is on macOS/Linux and says they want `/report-design` or `/pbi-connect`, remind them once: _"Ese skill requiere Windows + PBI Desktop. Para este proyecto, podés arrancar con `/project-kickoff` — escribe `AGENTS.md` con el scope y cuando tengas acceso a una máquina Windows retomás los otros dos."_
129
+
130
+ ---
131
+
132
+ ## PHASE 3: Proactive connect (if applicable)
133
+
134
+ Skip this phase entirely if `$pbiDesktopRunning === false && $hasPbip === false`.
135
+
136
+ Three cases:
137
+
138
+ **Case A — PBI Desktop running + MCP configured**:
139
+ Don't ask, just confirm:
140
+ > _"✓ Power BI Desktop está abierto y el MCP está conectado. Listo para cualquier skill que necesite el modelo."_
141
+
142
+ Continue to PHASE 4.
143
+
144
+ **Case B — PBI Desktop running + MCP NOT configured** (Windows only):
145
+ Offer once:
146
+ > _"Power BI Desktop está abierto pero todavía no conectaste el agente al MCP. ¿Corro `/pbi-connect`? (`sí` / `no`)"_
147
+
148
+ - `sí` → dispatch `/pbi-connect` cleanly. Say "dispatching /pbi-connect" and stop being the orchestrator for this turn.
149
+ - `no` → continue to PHASE 4 silently.
150
+
151
+ **Case C — PBI Desktop NOT running + `.pbip` exists in CWD** (Windows only):
152
+ Offer once:
153
+ > _"No veo Power BI Desktop abierto. Para conectar el agente al modelo necesitás abrir el .pbip. ¿Lo abro yo y corro `/pbi-connect`? (`sí` / `no`)"_
154
+
155
+ - `sí`:
156
+ 1. Launch Desktop with the project's .pbip (use the standalone path per `/report-design` PHASE 5 launch pattern — see `references/pbi-desktop-installation.md` in `/report-design`):
157
+ ```bash
158
+ powershell -Command "Start-Process -FilePath 'C:\Program Files\Microsoft Power BI Desktop\bin\PBIDesktop.exe' -ArgumentList '\"<absolute-path-to.pbip>\"'"
159
+ ```
160
+ 2. Wait ~15-20 seconds for Desktop to finish loading.
161
+ 3. Dispatch `/pbi-connect`.
162
+
163
+ - `no` → continue to PHASE 4.
164
+
165
+ On macOS/Linux, skip Case B and Case C — mention once:
166
+ > _"PBI Desktop no corre fuera de Windows. El Modeling MCP queda solo disponible en una máquina Windows. `/project-kickoff` sí funciona parcialmente acá (escribe `AGENTS.md` y para)."_
167
+
168
+ ---
169
+
170
+ ## PHASE 4: Stand by
171
+
172
+ If you got here without dispatching, close with:
173
+
174
+ > _"Listo — invocá el specialist skill que necesites, o pedime ayuda específica sobre cualquiera de esos 3. Si abrís una sesión nueva mañana, `/bi-start` te orienta de nuevo."_
175
+
176
+ Stop. Don't hover. The user will tell you what they want next.
177
+
178
+ ---
179
+
180
+ ## What this skill does NOT do
181
+
182
+ - **Project analysis or setup**: that's `/project-kickoff`. If the user says "analizar mi proyecto", "armar el modelo base", "arrancar uno nuevo desde cero", delegate.
183
+ - **MCP wiring details**: that's `/pbi-connect`. bi-start just offers to dispatch it; the actual configuration work is in that skill.
184
+ - **Report authoring**: that's `/report-design`. Same pattern.
185
+ - **Running the update**: bi-start offers + dispatches `super upgrade`; the actual npm install + subsequent `super install --yes` chain is owned by `/bin/cli.js`.
186
+
187
+ ## Related Skills
188
+
189
+ - `/project-kickoff` — when it's a brand-new project that needs `AGENTS.md` + model scaffolding.
190
+ - `/pbi-connect` — when you need the agent talking to PBI Desktop via MCP.
191
+ - `/report-design` — when you're generating report pages via the bundled Node scripts.
192
+
193
+ ## Bundle contents
194
+
195
+ - `scripts/update-check.js` — the update-check helper invoked in PHASE 0. Same helper that every skill's preamble uses.
196
+
197
+ ---
198
+
199
+ _Session orchestrator — welcome, update, route._