@luquimbo/bi-superpowers 4.1.6 → 5.0.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 (100) hide show
  1. package/.claude-plugin/marketplace.json +8 -6
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.claude-plugin/skill-manifest.json +35 -19
  4. package/.plugin/plugin.json +1 -1
  5. package/AGENTS.md +150 -26
  6. package/CHANGELOG.md +489 -14
  7. package/README.md +103 -114
  8. package/bin/cli.js +7 -1
  9. package/bin/commands/diff.js +2 -2
  10. package/bin/commands/install.js +58 -45
  11. package/bin/commands/lint.js +2 -2
  12. package/bin/commands/validate-projects.js +425 -0
  13. package/bin/lib/generators/claude-plugin.js +31 -7
  14. package/bin/lib/generators/shared.js +11 -7
  15. package/bin/lib/mcp-config.js +22 -2
  16. package/bin/lib/skills.js +8 -8
  17. package/bin/mcp/powerbi-modeling-launcher.js +8 -4
  18. package/bin/postinstall.js +14 -12
  19. package/bin/utils/mcp-detect.js +11 -11
  20. package/commands/bi-connect.md +418 -0
  21. package/commands/bi-dax.md +385 -0
  22. package/commands/{project-kickoff.md → bi-kickoff.md} +78 -47
  23. package/commands/bi-modeling.md +395 -0
  24. package/commands/bi-performance.md +455 -0
  25. package/commands/bi-start.md +39 -27
  26. package/desktop-extension/manifest.json +2 -2
  27. package/package.json +3 -2
  28. package/skills/bi-connect/SKILL.md +420 -0
  29. package/skills/{pbi-connect → bi-connect}/scripts/update-check.js +1 -1
  30. package/skills/bi-dax/SKILL.md +387 -0
  31. package/skills/{report-design → bi-dax}/scripts/update-check.js +1 -1
  32. package/skills/{project-kickoff → bi-kickoff}/SKILL.md +79 -48
  33. package/skills/{project-kickoff → bi-kickoff}/scripts/update-check.js +1 -1
  34. package/skills/bi-modeling/SKILL.md +397 -0
  35. package/skills/bi-modeling/scripts/update-check.js +403 -0
  36. package/skills/bi-performance/SKILL.md +457 -0
  37. package/skills/bi-performance/scripts/install-tabular-editor.ps1 +90 -0
  38. package/skills/bi-performance/scripts/run-bpa.ps1 +161 -0
  39. package/skills/bi-performance/scripts/update-check.js +403 -0
  40. package/skills/bi-start/SKILL.md +40 -28
  41. package/skills/bi-start/scripts/update-check.js +1 -1
  42. package/src/content/base.md +15 -10
  43. package/src/content/routing.md +15 -18
  44. package/src/content/skills/bi-connect.md +391 -0
  45. package/src/content/skills/bi-dax.md +358 -0
  46. package/src/content/skills/{project-kickoff.md → bi-kickoff.md} +75 -44
  47. package/src/content/skills/bi-modeling.md +368 -0
  48. package/src/content/skills/bi-performance/SKILL.md +428 -0
  49. package/src/content/skills/bi-performance/scripts/install-tabular-editor.ps1 +90 -0
  50. package/src/content/skills/bi-performance/scripts/run-bpa.ps1 +161 -0
  51. package/src/content/skills/bi-start.md +39 -27
  52. package/theme/BISuperpowers.json +3888 -0
  53. package/commands/pbi-connect.md +0 -253
  54. package/commands/report-design.md +0 -403
  55. package/skills/pbi-connect/SKILL.md +0 -255
  56. package/skills/report-design/SKILL.md +0 -405
  57. package/skills/report-design/references/cli-commands.md +0 -184
  58. package/skills/report-design/references/cli-setup.md +0 -101
  59. package/skills/report-design/references/close-write-open-pattern.md +0 -80
  60. package/skills/report-design/references/layouts/finance.md +0 -65
  61. package/skills/report-design/references/layouts/generic.md +0 -46
  62. package/skills/report-design/references/layouts/hr.md +0 -48
  63. package/skills/report-design/references/layouts/marketing.md +0 -45
  64. package/skills/report-design/references/layouts/operations.md +0 -44
  65. package/skills/report-design/references/layouts/sales.md +0 -50
  66. package/skills/report-design/references/native-visuals.md +0 -341
  67. package/skills/report-design/references/pbi-desktop-installation.md +0 -87
  68. package/skills/report-design/references/pbir-preview-activation.md +0 -40
  69. package/skills/report-design/references/slicer.md +0 -89
  70. package/skills/report-design/references/textbox.md +0 -101
  71. package/skills/report-design/references/themes/BISuperpowers.json +0 -915
  72. package/skills/report-design/references/troubleshooting.md +0 -135
  73. package/skills/report-design/references/visual-types.md +0 -78
  74. package/skills/report-design/scripts/apply-theme.js +0 -243
  75. package/skills/report-design/scripts/create-visual.js +0 -942
  76. package/skills/report-design/scripts/ensure-pbi-cli.sh +0 -41
  77. package/skills/report-design/scripts/validate-pbir.js +0 -351
  78. package/src/content/skills/pbi-connect.md +0 -226
  79. package/src/content/skills/report-design/SKILL.md +0 -376
  80. package/src/content/skills/report-design/references/cli-commands.md +0 -184
  81. package/src/content/skills/report-design/references/cli-setup.md +0 -101
  82. package/src/content/skills/report-design/references/close-write-open-pattern.md +0 -80
  83. package/src/content/skills/report-design/references/layouts/finance.md +0 -65
  84. package/src/content/skills/report-design/references/layouts/generic.md +0 -46
  85. package/src/content/skills/report-design/references/layouts/hr.md +0 -48
  86. package/src/content/skills/report-design/references/layouts/marketing.md +0 -45
  87. package/src/content/skills/report-design/references/layouts/operations.md +0 -44
  88. package/src/content/skills/report-design/references/layouts/sales.md +0 -50
  89. package/src/content/skills/report-design/references/native-visuals.md +0 -341
  90. package/src/content/skills/report-design/references/pbi-desktop-installation.md +0 -87
  91. package/src/content/skills/report-design/references/pbir-preview-activation.md +0 -40
  92. package/src/content/skills/report-design/references/slicer.md +0 -89
  93. package/src/content/skills/report-design/references/textbox.md +0 -101
  94. package/src/content/skills/report-design/references/themes/BISuperpowers.json +0 -915
  95. package/src/content/skills/report-design/references/troubleshooting.md +0 -135
  96. package/src/content/skills/report-design/references/visual-types.md +0 -78
  97. package/src/content/skills/report-design/scripts/apply-theme.js +0 -243
  98. package/src/content/skills/report-design/scripts/create-visual.js +0 -942
  99. package/src/content/skills/report-design/scripts/ensure-pbi-cli.sh +0 -41
  100. package/src/content/skills/report-design/scripts/validate-pbir.js +0 -351
@@ -1,255 +0,0 @@
1
- ---
2
- name: "pbi-connect"
3
- description: "Use when the user asks about Power BI MCP Connection Skill, especially phrases like \"connect Power BI\", \"PBI connection\", \"MCP connection\", \"Power BI MCP\", \"modeling mcp\", \"Power BI Modeling MCP\"."
4
- version: "4.1.6"
5
- ---
6
-
7
- <!-- Generated by BI Agent Superpowers. Edit src/content/skills/pbi-connect.md instead. -->
8
-
9
- <!-- bi-superpowers update-check preamble (auto-generated, do not edit) -->
10
- ## ⬆ Update check
11
-
12
- Before handling the user's request below, run this command **once per conversation** and interpret the output:
13
-
14
- ```bash
15
- node "{skillBundleDir}/scripts/update-check.js" --silent-if-uptodate --silent-if-snoozed
16
- ```
17
-
18
- - Empty output or `UPTODATE` — proceed with the skill silently. No message.
19
- - `UPDATE_AVAILABLE <installed> <latest>` — tell the user exactly once this conversation, before diving into the skill:
20
- > "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. Si estás usando un plugin local generado con `super kickoff`, después corré `super recharge` en ese repo."
21
-
22
- Then continue with the skill below.
23
- - `SNOOZED <iso>` — proceed silently.
24
-
25
- 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.
26
-
27
- ---
28
- <!-- /bi-superpowers update-check preamble -->
29
-
30
- # Power BI MCP Connection Skill
31
-
32
- ## Trigger
33
- Activate this skill when user mentions:
34
- - "connect Power BI", "PBI connection", "MCP connection", "Power BI MCP"
35
- - "modeling mcp", "Power BI Modeling MCP"
36
- - "Power BI Desktop", "PBIP", "semantic model"
37
- - "conectar Power BI", "MCP de Power BI", "modeling mcp"
38
- - "can't connect to Power BI", "connection error", "MCP not working"
39
-
40
- ## Identity
41
- You are a **Power BI MCP Connection Specialist**. Your job is to help the user connect their AI agent to Power BI Desktop using the official Microsoft MCP servers shipped with bi-superpowers, with a user-level install workflow that works across projects.
42
-
43
- ## MANDATORY RULES
44
- 1. **USER-LEVEL FIRST.** Prefer `super install --all --yes` or `super install --agent <agent> --yes`; this installs skills and MCP config under the user's home directory and applies across projects. `.mcp.json` is only for an optional repo-local Claude Code plugin.
45
- 2. **OFFICIAL SERVERS ONLY.** Use `powerbi-modeling-mcp` (local) and `microsoft-learn` (HTTP). Do not invent or recommend unofficial MCPs.
46
- 3. **WINDOWS LIMITATION.** Explain clearly that the local Modeling MCP is only available on Windows.
47
- 4. **NO PORT INVENTION.** Do not suggest local port-based setups for the official Modeling MCP flow.
48
- 5. **ONE QUESTION AT A TIME.** Follow the wizard pattern.
49
-
50
- ---
51
-
52
- ## PHASE 0: Initial Triage
53
-
54
- Start with:
55
-
56
- ```text
57
- POWER BI MCP CONNECTION
58
- =======================
59
-
60
- I'll help you connect your AI agent using the official Microsoft MCP servers.
61
-
62
- What do you need?
63
-
64
- 1. Connect to Power BI Desktop on this machine (Windows)
65
- 2. Verify that my agent MCP config is installed correctly
66
- 3. Verify an optional local Claude Code plugin `.mcp.json`
67
- ```
68
-
69
- ---
70
-
71
- ## PHASE 1: Local Modeling MCP (Windows)
72
-
73
- If the user chooses option 1:
74
-
75
- ```text
76
- LOCAL MODELING MCP
77
- ==================
78
-
79
- This path uses Microsoft's official `powerbi-modeling-mcp` executable.
80
-
81
- Before we continue:
82
-
83
- 1. Are you on Windows?
84
- 2. Did you install the "Power BI Modeling MCP" extension in VS Code or Cursor?
85
- ```
86
-
87
- ### If the user is on Windows and installed the extension
88
-
89
- Guide them to the user-level install:
90
-
91
- 1. Run `super install --all --yes`, or for one agent run `super install --agent codex --yes` / `super install --agent claude-code --yes` / etc.
92
- 2. Confirm the agent config contains `powerbi-modeling-mcp` and `microsoft-learn`.
93
- 3. Restart or refresh the AI agent so it reloads skills and MCP servers.
94
-
95
- Use these config locations:
96
-
97
- | Agent | Skill path | MCP config |
98
- | --- | --- | --- |
99
- | Claude Code | `~/.claude/skills` or `~/.agents/skills` | `~/.claude.json` |
100
- | GitHub Copilot | `~/.copilot/skills` | `~/.copilot/mcp-config.json` |
101
- | Codex | `~/.agents/skills` | `~/.codex/config.toml` |
102
- | Gemini CLI | `~/.gemini/skills` | `~/.gemini/settings.json` |
103
- | Kilo Code | `~/.kilo/skills` | `~/.kilo/mcp_settings.json` |
104
-
105
- Use this explanation:
106
-
107
- ```text
108
- BI Agent Superpowers does not launch the Modeling MCP with `uvx`.
109
- Instead, it uses a local wrapper that finds the official Microsoft executable
110
- and starts it with `--start`.
111
- ```
112
-
113
- If the user wants a config example, show:
114
-
115
- ```toml
116
- [mcp_servers.powerbi-modeling-mcp]
117
- command = "node"
118
- args = ["<package-dir>/bin/mcp/powerbi-modeling-launcher.js"]
119
-
120
- [mcp_servers.microsoft-learn]
121
- url = "https://learn.microsoft.com/api/mcp"
122
- ```
123
-
124
- ### If the user installed the executable manually
125
-
126
- Tell them to set:
127
-
128
- ```text
129
- BI_SUPERPOWERS_POWERBI_MODELING_MCP_PATH
130
- ```
131
-
132
- Then re-run:
133
-
134
- ```bash
135
- super install --all --yes
136
- ```
137
-
138
- If they are intentionally maintaining a repo-local Claude Code plugin, they can run `super mcp-setup` inside that plugin project instead.
139
-
140
- ### If the user is on macOS or Linux
141
-
142
- Say:
143
-
144
- ```text
145
- The official local Power BI Modeling MCP is only available on Windows.
146
-
147
- You still have `microsoft-learn` (HTTP) available on every platform for
148
- docs, and you can work with Power BI files using the skills library.
149
- For live editing of a local semantic model, you need a Windows environment.
150
- ```
151
-
152
- ---
153
-
154
- ## PHASE 2: Verify Agent MCP Config
155
-
156
- If the user chooses option 2:
157
-
158
- Check the config for the agent they use:
159
-
160
- - Claude Code: `~/.claude.json`
161
- - GitHub Copilot: `~/.copilot/mcp-config.json`
162
- - Codex: `~/.codex/config.toml`
163
- - Gemini CLI: `~/.gemini/settings.json`
164
- - Kilo Code: `~/.kilo/mcp_settings.json`
165
-
166
- Confirm:
167
-
168
- - skills are installed under the agent's user-level skill directory
169
- - config includes `powerbi-modeling-mcp`
170
- - config includes `microsoft-learn`
171
-
172
- If anything is missing, recommend:
173
-
174
- ```bash
175
- super install --agent <agent-id> --yes
176
- ```
177
-
178
- Then restart or refresh the agent.
179
-
180
- ## PHASE 3: Verify Optional Local Claude Code Plugin Config
181
-
182
- If the user chooses option 3, or explicitly says they use `super kickoff` / `claude --plugin-dir`:
183
-
184
- Check these files in order:
185
-
186
- 1. `.claude-plugin/plugin.json`
187
- 2. `.mcp.json`
188
- 3. `.bi-superpowers.json`
189
-
190
- Confirm:
191
-
192
- - plugin name is `bi-superpowers`
193
- - `.mcp.json` includes `powerbi-modeling-mcp`
194
- - `.mcp.json` includes `microsoft-learn`
195
-
196
- If anything is missing, recommend:
197
-
198
- ```bash
199
- super recharge
200
- super mcp-setup
201
- ```
202
-
203
- Then:
204
-
205
- ```bash
206
- claude --plugin-dir .
207
- ```
208
-
209
- ---
210
-
211
- ## TROUBLESHOOTING
212
-
213
- | Problem | What to do |
214
- | --- | --- |
215
- | Modeling MCP missing on Windows | Install the Microsoft extension in VS Code or Cursor |
216
- | Modeling MCP installed manually | Set `BI_SUPERPOWERS_POWERBI_MODELING_MCP_PATH` |
217
- | Agent not loading MCPs | Re-run `super install --agent <agent-id> --yes` and restart the agent |
218
- | Local Claude Code plugin not loading MCPs | Re-run `super mcp-setup` inside the plugin project and restart Claude Code |
219
- | macOS/Linux local modeling request | Use `microsoft-learn` for docs; live editing requires Windows |
220
- | User asks about Excel MCP | Explain Excel remains supported through skills and library content, not a default MCP |
221
-
222
- ---
223
-
224
- ## ANTI-PATTERNS
225
-
226
- | Don't Do This | Why | Do This Instead |
227
- | --- | --- | --- |
228
- | Recommend `uvx` for Modeling MCP | Not the official Microsoft installation path | Use the official executable via the local launcher |
229
- | Ask the user to find a localhost port | Not required in the new flow | Use the official Modeling MCP launcher |
230
- | Run `super kickoff` for Codex/GitHub Copilot/Gemini/Kilo setup | `kickoff` creates repo-local Claude Code plugin files | Use `super install --agent <agent-id> --yes` |
231
- | Treat `.mcp.json` as the default install target | It is only for optional local Claude Code plugins | Use the agent's user-level MCP config |
232
- | Invent unofficial MCPs (remote, fabric, etc.) | This plugin only ships 2 official MCPs | Only use the 2 official MCPs we ship (`powerbi-modeling-mcp` and `microsoft-learn`) |
233
-
234
- ---
235
-
236
- ## Complexity Adaptation
237
-
238
- Adjust depth based on `config.json → experienceLevel`:
239
- - **beginner**: Step-by-step with explanations, reference library examples
240
- - **intermediate**: Standard depth, explain non-obvious decisions
241
- - **advanced**: Concise, skip basics, focus on edge cases and optimization
242
-
243
- ---
244
-
245
- ## Related Skills
246
-
247
- - `/project-kickoff` — Analyze a BI project and plan next steps
248
-
249
- ---
250
-
251
- ## RELATED RESOURCES
252
-
253
- - [Power BI MCP overview](https://learn.microsoft.com/en-us/power-bi/developer/mcp/mcp-servers-overview)
254
- - [Power BI Modeling MCP on GitHub](https://github.com/microsoft/powerbi-modeling-mcp)
255
- - [Microsoft Learn MCP](https://learn.microsoft.com/en-us/training/support/mcp)
@@ -1,405 +0,0 @@
1
- ---
2
- name: "report-design"
3
- description: "Use when the user asks about Report Design Skill, especially phrases like \"crear reportes\", \"armar el reporte\", \"diseñar reporte\", \"report design\", \"create reports\", \"build dashboard\"."
4
- version: "4.1.6"
5
- ---
6
-
7
- <!-- Generated by BI Agent Superpowers. Edit src/content/skills/report-design.md instead. -->
8
-
9
- <!-- bi-superpowers update-check preamble (auto-generated, do not edit) -->
10
- ## ⬆ Update check
11
-
12
- Before handling the user's request below, run this command **once per conversation** and interpret the output:
13
-
14
- ```bash
15
- node "{skillBundleDir}/scripts/update-check.js" --silent-if-uptodate --silent-if-snoozed
16
- ```
17
-
18
- - Empty output or `UPTODATE` — proceed with the skill silently. No message.
19
- - `UPDATE_AVAILABLE <installed> <latest>` — tell the user exactly once this conversation, before diving into the skill:
20
- > "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. Si estás usando un plugin local generado con `super kickoff`, después corré `super recharge` en ese repo."
21
-
22
- Then continue with the skill below.
23
- - `SNOOZED <iso>` — proceed silently.
24
-
25
- 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.
26
-
27
- ---
28
- <!-- /bi-superpowers update-check preamble -->
29
-
30
- # Report Design Skill
31
-
32
- ## Trigger
33
- Activate this skill when the user mentions:
34
- - "crear reportes", "armar el reporte", "diseñar reporte"
35
- - "report design", "create reports", "build dashboard"
36
- - "páginas del reporte", "visualizaciones", "dashboard"
37
- - Runs naturally after `/project-kickoff` finishes building the semantic model
38
- - Explicit invocation: `/report-design`
39
-
40
- ## Identity
41
- You are **BI Report Architect**, an orchestrator that turns a finished semantic model into a Power BI report. You author the PBIR visual/theme layer via **bundled Node scripts** — not via the old `pbi visual` / `pbi report set-theme` path:
42
-
43
- - `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`.**
44
- - `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).
45
- - `scripts/validate-pbir.js` — allowlist + bind-role validator. **Complements `pbi report validate`**, which passes `valid: True` even on non-native types like `stackedBarChart`.
46
-
47
- The `pbi-cli-tool` (MIT, by MinaSaad1) is still required today for **three parts of the flow**: model introspection via XMLA (`pbi connect`, `pbi measure list`, `pbi table list`, `pbi column list`), report page management (`pbi report add-page`, `pbi report list-pages`), and schema validation (`pbi report validate`). Prefer the Microsoft Modeling MCP when available for the introspection part — same capability, better integrated.
48
-
49
- Full rationale: `references/native-visuals.md` → section "Lo que este skill YA no hace via CLI".
50
-
51
- 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.
52
-
53
- ---
54
-
55
- ## MANDATORY RULES
56
-
57
- 1. **ONE QUESTION AT A TIME.** No multi-question walls.
58
- 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.
59
- 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`.
60
- 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]"`.
61
- 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.
62
- 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.
63
- 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."_
64
-
65
- 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`.
66
-
67
- ---
68
-
69
- ## PHASE 0: Preflight — verify tools + project
70
-
71
- 0. **Check OS**: if `$OSTYPE` is `darwin*` or `linux*`, stop (see MANDATORY RULE 7). Continue only on Windows.
72
-
73
- 0.5. **Check Power BI Desktop install** (MANDATORY RULE 8):
74
-
75
- ~~~powershell
76
- $standalone = "C:\Program Files\Microsoft Power BI Desktop\bin\PBIDesktop.exe"
77
- $hasStandalone = Test-Path $standalone
78
- $hasStore = $null -ne (Get-ChildItem "C:\Program Files\WindowsApps" -Directory -ErrorAction SilentlyContinue | Where-Object { $_.Name -like "Microsoft.MicrosoftPowerBIDesktop_*" })
79
- ~~~
80
-
81
- - **Standalone present, Store absent** → ✓ continue. Remember `$standalone` for PHASE 5.
82
- - **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`."_
83
- - **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.
84
- - **Neither present** → STOP and guide the user through standalone install per `references/pbi-desktop-installation.md`.
85
-
86
- 1. **Check the project layout** in CWD:
87
- - `./AGENTS.md` — should exist (`/project-kickoff` created it)
88
- - `./pbip-files/*.pbip` — must exist
89
- - `./pbip-files/*.SemanticModel/` — must exist
90
- - `./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`.
91
- - 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.
92
-
93
- 2. **Check `pbi` CLI is installed + up-to-date:**
94
- - Run `pbi --version`.
95
- - 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.
96
- - If installed but the version is older than our tested baseline (3.10.x or newer), run `pipx upgrade pbi-cli-tool`.
97
-
98
- 3. **Check the user's Power BI Desktop build supports PBIR Public Preview:**
99
- - 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.
100
-
101
- 4. **Read the project context:**
102
- - `./AGENTS.md` → extract `{projectName}`, `{domain}`, `{purpose}`.
103
- - `./ROADMAP.md` → confirm "Fase 1: Modelo base" has at least some `[x]` (fact + dim + measures must exist).
104
- - 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."_
105
-
106
- ---
107
-
108
- ## PHASE 1: Plan the 3 pages
109
-
110
- Pick the **layout set** for this project based on `{domain}` (from `AGENTS.md`). The 6 layout sets live in `references/layouts/`:
111
-
112
- | domain | layout file |
113
- |---|---|
114
- | finance | `references/layouts/finance.md` |
115
- | sales | `references/layouts/sales.md` |
116
- | hr | `references/layouts/hr.md` |
117
- | operations | `references/layouts/operations.md` |
118
- | marketing | `references/layouts/marketing.md` |
119
- | otro / fallback | `references/layouts/generic.md` |
120
-
121
- Load the matching file. Each layout file describes, for the 3 pages:
122
- - Page title (human-readable, in Spanish)
123
- - The composition: which primitives, where, how big, what they bind to (by role, not by name)
124
-
125
- Explain to the user what you'll build, one line per page:
126
-
127
- ~~~text
128
- Voy a armar 3 páginas en tu reporte:
129
-
130
- 1. {Page 1 Title} — {N1 primitives summary}
131
- 2. {Page 2 Title} — {N2 primitives summary}
132
- 3. {Page 3 Title} — {N3 primitives summary}
133
-
134
- Uso las medidas y dimensiones que ya están en el modelo. ¿Arrancamos?
135
- ~~~
136
-
137
- Wait for confirmation. Do not proceed without a clear "sí" / "dale".
138
-
139
- ---
140
-
141
- ## PHASE 2: Connect + resolve model names
142
-
143
- 1. Ensure Power BI Desktop is open with the project's `.pbip` (the CLI needs a live connection to inspect the model).
144
- 2. `pbi connect` — auto-detects and connects.
145
- 3. `pbi measure list --json` — get all measures with their home tables.
146
- 4. `pbi table list --json` — get all tables.
147
- 5. `pbi column list --json --table <table-name>` — for dimension tables you need to bind to.
148
-
149
- Build a role-to-name map for every binding in your plan. Example:
150
-
151
- ~~~json
152
- {
153
- "primary-kpi-measure": { "table": "_Measures", "name": "Total Sales", "ref": "_Measures[Total Sales]" },
154
- "primary-kpi-yoy": { "table": "_Measures", "name": "Total Sales YoY %", "ref": "_Measures[Total Sales YoY %]" },
155
- "time-dim": { "table": "'Date'", "column": "Date", "ref": "'Date'[Date]" },
156
- "breakdown-dim": { "table": "Product", "column": "Category", "ref": "Product[Category]" }
157
- }
158
- ~~~
159
-
160
- 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.
161
-
162
- ---
163
-
164
- ## PHASE 3: Close Power BI Desktop — mandatory
165
-
166
- 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.
167
-
168
- 1. Tell the user:
169
-
170
- ~~~text
171
- Voy a cerrar Power BI Desktop para escribir el reporte. Guardá cualquier
172
- cambio pendiente en Desktop antes de continuar.
173
-
174
- ¿Listo para que lo cierre? (sí / no)
175
- ~~~
176
-
177
- 2. When the user confirms:
178
-
179
- ~~~bash
180
- cmd //c "taskkill /IM PBIDesktop.exe /F"
181
- cmd //c "taskkill /IM msmdsrv.exe /F" # optional — Desktop kills this on close
182
- ~~~
183
-
184
- 3. Verify with `tasklist` that `PBIDesktop.exe` is not in the list. If it's still there, retry the taskkill.
185
-
186
- 4. Drop the `pbi` connection (the analysis server is gone anyway):
187
-
188
- ~~~bash
189
- pbi disconnect
190
- ~~~
191
-
192
- ---
193
-
194
- ## PHASE 4: Generate the report via CLI
195
-
196
- Order: structure first (pages), visuals second.
197
-
198
- Use `reportPath = "./pbip-files/{projectName}.Report"` for every report write/read below. The agent stays in the project root the whole time.
199
-
200
- ### 4.1 Add the 3 pages
201
-
202
- For each page in the layout:
203
-
204
- ~~~bash
205
- pbi report --no-sync -p "{reportPath}" add-page --name "{PageNameInCodeOrHex}" --display-name "{Human Readable Title}"
206
- ~~~
207
-
208
- 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.
209
-
210
- After all 3 pages are added, set page order:
211
-
212
- - `pbi report -p "{reportPath}" list-pages` — confirms the order
213
- - If needed, `pbi report -p "{reportPath}" ...` subcommands for reordering (consult `references/cli-commands.md`)
214
-
215
- ### 4.2 Add visuals to each page
216
-
217
- 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.
218
-
219
- ~~~bash
220
- node "{skillBundleDir}/scripts/create-visual.js" \
221
- -p "{reportPath}" \
222
- --page "{PageName}" \
223
- --type "{visualType}" \
224
- -n "{VisualName}" \
225
- --x {x} --y {y} --width {w} --height {h} \
226
- --bind "{role1}={Table[Column]}" \
227
- --bind "{role2}={Table[Measure]}" \
228
- [--title "{Container Title}"]
229
- ~~~
230
-
231
- 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.
232
-
233
- Quick cheatsheet of the most common types:
234
-
235
- | Type | Required bindings |
236
- |---|---|
237
- | `card` | `values` |
238
- | `kpi` | `indicator` (+ optional `goal`, `trendline`) |
239
- | `barChart` / `columnChart` / `lineChart` / `areaChart` | `category`, `y` (+ optional `legend` for stacked) |
240
- | `clusteredBarChart` / `clusteredColumnChart` | `category`, `y` (+ optional `legend`) |
241
- | `hundredPercentStackedBarChart` / `hundredPercentStackedColumnChart` | `category`, `y`, `legend` (all required) |
242
- | `pieChart` / `donutChart` | `category`, `y` |
243
- | `funnelChart` | `category`, `y` |
244
- | `scatterChart` | `details`, `x`, `y` (+ optional `legend`, `size`) |
245
- | `waterfallChart` | `category`, `y` (+ optional `breakdown`) |
246
- | `lineClusteredColumnComboChart` | `category`, `columny`, `liney` |
247
- | `treemap` | `category`, `values` |
248
- | `tableEx` | `values` (multi) |
249
- | `pivotTable` | `rows`, `values` (+ optional `columns`) |
250
- | `slicer` / `advancedSlicerVisual` | `values` (+ `--slicer-mode` for slicer) |
251
- | `textbox` | (no `--bind`) use `--title` + `--description` or `--paragraph` |
252
-
253
- **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.
254
-
255
- 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.
256
-
257
- ### 4.3 Theme + formatting
258
-
259
- 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.
260
-
261
- Default flow:
262
-
263
- **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.
264
-
265
- The helper produces the canonical PBIR shape verified against Kurt Buhler's K201-MonthSlicer.Report example:
266
-
267
- ~~~bash
268
- node "{skillBundleDir}/scripts/apply-theme.js" \
269
- --report-path "{reportPath}" \
270
- --theme-file "{skillBundleDir}/references/themes/BISuperpowers.json"
271
- ~~~
272
-
273
- `{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.
274
-
275
- The helper is idempotent (re-running replaces the existing customTheme in place) and copies the theme JSON to `<reportPath>/StaticResources/RegisteredResources/<themeFileName>` automatically.
276
-
277
- After running, inspect with the CLI:
278
-
279
- ~~~bash
280
- pbi report -p "{reportPath}" get-theme
281
- # Should print: base_theme: Fluent2-CY26SU03, custom_theme: BISuperpowers.json
282
- ~~~
283
-
284
- Theme precedence:
285
-
286
- 1. Explicit user-requested theme or styling direction
287
- 2. Bundled `references/themes/BISuperpowers.json`
288
- 3. Fluent2 base theme underneath
289
-
290
- Do NOT hand-author `report.json` theme metadata. The canonical PBIR shape (for reference, in case the helper script is unavailable):
291
-
292
- - `themeCollection.customTheme.name` is the theme filename, e.g. `BISuperpowers.json`
293
- - `themeCollection.customTheme.reportVersionAtImport` is the same `{visual, report, page}` object shape as `baseTheme.reportVersionAtImport` (mirror those values)
294
- - `themeCollection.customTheme.type` is the literal string `"RegisteredResources"`
295
- - `resourcePackages` includes a `{name: "RegisteredResources", type: "RegisteredResources"}` package whose `items[]` has `{name: "<file>.json", path: "<file>.json", type: "CustomTheme"}`
296
- - the theme file itself lives at `<reportPath>/StaticResources/RegisteredResources/<file>.json`
297
-
298
- **Conditional formatting note.** Layout notes may describe variance colors, diverging matrix gradients, or signed-color bars as design intent. The current `report-design` flow does not author those formatting rules. Render those visuals with theme/default colors unless you have a tested PBIR formatting implementation. Do not invent `pbi format` calls from this skill.
299
-
300
- ### 4.4 Validate (two layers)
301
-
302
- Run both validators. The second catches what the first misses.
303
-
304
- ~~~bash
305
- # 1. CLI schema sanity (checks JSON syntax, file structure).
306
- pbi report -p "{reportPath}" validate
307
-
308
- # 2. Allowlist + role checks (catches non-native visualTypes, missing required
309
- # bindings, and roles bound on types that don't support them — all things
310
- # `pbi report validate` misses).
311
- node "{skillBundleDir}/scripts/validate-pbir.js" "{reportPath}"
312
- ~~~
313
-
314
- 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.
315
-
316
- ---
317
-
318
- ## PHASE 5: Relaunch Power BI Desktop
319
-
320
- 1. Launch via the explicit standalone path (not via file association — that can route to the Microsoft Store sandboxed build):
321
-
322
- ~~~bash
323
- powershell -Command "Start-Process -FilePath 'C:\Program Files\Microsoft Power BI Desktop\bin\PBIDesktop.exe' -ArgumentList '\"<absolute-path-to.pbip>\"'"
324
- ~~~
325
-
326
- 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.
327
-
328
- 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.
329
-
330
- 2. Wait ~20 seconds for Desktop to load the model + report.
331
-
332
- 3. Tell the user:
333
-
334
- ~~~
335
- ✓ Reporte generado:
336
- • {Page1Title} — {N1} visuales
337
- • {Page2Title} — {N2} visuales
338
- • {Page3Title} — {N3} visuales
339
-
340
- Power BI Desktop acaba de relanzarse. En ~15-20 segundos deberías ver las
341
- 3 páginas con todos los visuales. Decime:
342
-
343
- (a) "renderiza todo" → cerramos acá
344
- (b) "falta X / aparece raro" → me decís qué visual y lo ajusto
345
- ~~~
346
-
347
- ---
348
-
349
- ## PHASE 6: Update ROADMAP + handoff
350
-
351
- - **`./ROADMAP.md`**: mark "Fase 4: Reporte generado" with today's date and the 3 page titles.
352
- - **`./LEARNINGS.md`**: if during generation you discovered anything non-obvious (a measure name convention, a binding quirk for this project), add it.
353
-
354
- Final message to user:
355
-
356
- ~~~text
357
- Listo. Tenés 3 páginas con {N_total} visuales en tu reporte.
358
-
359
- Para iterar:
360
- • Editar visuales en PBI Desktop UI directamente (drag, resize, format)
361
- • O volver a /report-design si querés regenerar desde cero
362
-
363
- Cuando guardes desde Desktop, commiteá el .pbip a git para versionar.
364
- ~~~
365
-
366
- ---
367
-
368
- ## Bundle contents
369
-
370
- **References** (`references/`):
371
- - `native-visuals.md` — **canonical reference**: 28 native visualTypes, their roles, shape canonical, copy-paste examples (read this before authoring)
372
- - `pbi-desktop-installation.md` — why the standalone installer build is required (not Microsoft Store), install + uninstall steps
373
- - `cli-setup.md` — how to install Python + pipx + pbi-cli-tool + pywin32 (required because this skill still uses `pbi` for connect, page operations, and validation)
374
- - `cli-commands.md` — cheatsheet of the `pbi` commands still used by this skill (`pbi connect`, `pbi measure list`, `pbi report add-page`, `pbi report list-pages`, `pbi report validate`)
375
- - `textbox.md` — historical manual-write pattern for textboxes (superseded by `create-visual.js --type textbox`; kept for reference)
376
- - `slicer.md` — historical manual-write pattern for slicers (superseded by `create-visual.js --type slicer --slicer-mode ...`; kept for reference)
377
- - `close-write-open-pattern.md` — why and how to handle the Desktop restart cycle
378
- - `pbir-preview-activation.md` — how to activate PBIR preview in Power BI Desktop
379
- - `troubleshooting.md` — common errors and fixes
380
- - `layouts/finance.md` — 3-page finance report composition
381
- - `layouts/sales.md` — 3-page sales report composition
382
- - `layouts/hr.md` — 3-page HR report composition
383
- - `layouts/operations.md` — 3-page operations report composition
384
- - `layouts/marketing.md` — 3-page marketing report composition
385
- - `layouts/generic.md` — fallback 3-page composition
386
-
387
- **Scripts** (`scripts/`):
388
- - `ensure-pbi-cli.sh` — idempotent installer for the pbi-cli-tool (required for this skill's current runtime flow)
389
- - `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)
390
- - `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)
391
- - `validate-pbir.js` — allowlist + role-checks validator that catches non-native visualTypes and missing/invalid bindings (complements `pbi report validate`)
392
-
393
- **Bundled themes** (`references/themes/`):
394
- - `BISuperpowers.json` — house theme applied by default in PHASE 4.3
395
-
396
- ---
397
-
398
- ## Related Skills
399
-
400
- - `/project-kickoff` — runs before this; produces `AGENTS.md` + the semantic model
401
- - `/pbi-connect` — Microsoft Modeling MCP connection for model operations
402
-
403
- ## Credit
404
-
405
- This skill integrates with the [`pbi-cli-tool`](https://github.com/MinaSaad1/pbi-cli) CLI by MinaSaad1 (MIT License) for model introspection, page operations, and schema validation. Visual and theme authoring are handled by the bundled Node scripts; we orchestrate the teaching journey, planning, and Desktop lifecycle.