@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
@@ -0,0 +1,418 @@
1
+ ---
2
+ description: "Power BI Desktop MCP connection and DAX UDF authoring"
3
+ ---
4
+
5
+ <!-- Generated by BI Agent Superpowers. Edit src/content/skills/bi-connect.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
+ > "bi-superpowers v{latest} is available (you are on v{installed}). Update with `super upgrade` (or `/plugin update bi-superpowers` in Claude Code) when convenient. If you use a local plugin generated with `super kickoff`, run `super recharge` in that repo afterwards."
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
+ # Power BI MCP Connection Skill
29
+
30
+ ## Trigger
31
+ Activate this skill when user mentions:
32
+ - "connect Power BI", "PBI connection", "MCP connection", "Power BI MCP"
33
+ - "DAX UDF", "DAX user-defined function", "user defined function"
34
+ - "write UDF", "create UDF", "functions.tmdl", "DAXLIB", "daxlib"
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
+ - "crear UDF", "escribir UDF", "funciones DAX"
39
+ - "can't connect to Power BI", "connection error", "MCP not working"
40
+
41
+ ## Identity
42
+ 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.
43
+
44
+ ## MANDATORY RULES
45
+ 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.
46
+ 2. **OFFICIAL SERVERS ONLY.** Use `powerbi-modeling-mcp` (local) and `microsoft-learn` (HTTP). Do not invent or recommend unofficial MCPs.
47
+ 3. **WINDOWS + POWER BI DESKTOP ONLY.** Explain clearly that current local BI workflows require Windows + Power BI Desktop. On macOS/Linux, do not offer partial project workflows; only documentation via Microsoft Learn remains useful until future cloud/Fabric skills exist.
48
+ 4. **NO PORT INVENTION.** Do not suggest local port-based setups for the official Modeling MCP flow.
49
+ 5. **ONE QUESTION AT A TIME.** Follow the wizard pattern.
50
+ 6. **DAX UDFS USE UPSTREAM REFERENCES.** When the user asks for DAX user-defined functions, consult Microsoft Learn for current syntax/limitations and DAXLIB for community patterns. Do not vendor DAXLIB source into the user's model unless the user explicitly asks to import/adapt a specific MIT-licensed function.
51
+ 7. **TEACH AS YOU CONNECT OR WRITE.** Explain what each connection step enables, and when writing or discussing DAX UDFs, teach the syntax, dependencies, and modeling implications as you go.
52
+
53
+ 8. **MCP MODEL EDITS ARE IN-MEMORY ONLY — SAVE BEFORE CLOSE.** Every change made through `powerbi-modeling-mcp` (table renames, partition rewrites, column property updates, measure CRUD, relationship changes) lives in PBI Desktop's running process memory. The on-disk TMDL is not updated until the user (or the agent) issues a save. **Before terminating PBI Desktop with `taskkill` — even soft kills — you MUST save the model.** Two acceptable save mechanisms:
54
+
55
+ - **Ask the user** to press `Ctrl+S` in PBI Desktop and confirm with "saved" / "listo".
56
+ - **Drive the save programmatically** with the bundled helper:
57
+ ```powershell
58
+ pwsh "{skillBundleDir}/scripts/save-powerbi-window.ps1" -WindowTitle "<projectName>" -WaitMs 3000
59
+ ```
60
+ The helper resolves the matching `PBIDesktop.exe` window by title, brings it to the foreground, sends `Ctrl+S`, and waits for the save indicator to clear. Returns 0 on success.
61
+
62
+ `taskkill /F /IM PBIDesktop.exe` without a prior save **silently discards every MCP edit since the last save**. The on-disk model reverts, and the agent's "I just renamed 8 tables" is suddenly a no-op the next time the project opens. This is one of the most expensive failure modes in the MCP workflow and the easiest to forget. Always save first.
63
+
64
+ 9. **PBIP FILES ARE READ-ONLY SNAPSHOTS.** Use PBIP/TMDL/PBIR files for inspection, diffs, and validation only. Do not hand-edit `.tmdl`, `.SemanticModel/**`, `.Report/**`, PBIR JSON, `visual.json`, `page.json`, themes, slicers, bookmarks, or any visual binding. Model changes go through the Power BI Modeling MCP. **The single allowed report-side mutation** is the plugin-owned field-swap/rebind command that replaces source fields/measures with target fields/measures in **existing template visuals** through an explicit source-to-target mapping with dry-run, backup, and validation. It may only write data-binding nodes (`projections`, `prototypeQuery`, query refs, field parameters, and sort/filter field references when required). It must preserve visual type, layout, formatting, interactions, IDs, theme, and bookmarks. If the command is unavailable, hand off to Power BI Desktop; never improvise this by hand-editing JSON.
65
+
66
+ 10. **TEMPLATE IS THE REFERENCE.** When writing DAX UDFs or discussing patterns, the BISuperpowers smoke-test template defines the canonical shape: `Métricas` as the measure and metric selector table, parameterizable currency conversion via `MonedaBase` + `Modelo Configuración` + `Tipo de cambio`, Sallieri period comparison, dynamic field parameters, calculation-group time intelligence, IBCS-aligned theme. UDFs the user writes should be either (a) generic enough to live alongside template patterns, or (b) explicitly extending those patterns. Reinventing template-equivalent logic in a project-specific UDF is a smell — flag it.
67
+
68
+ ---
69
+
70
+ ## PHASE 0: Initial Triage
71
+
72
+ Start with:
73
+
74
+ ```text
75
+ POWER BI MCP CONNECTION
76
+ =======================
77
+
78
+ I'll help you connect your AI agent using the official Microsoft MCP servers.
79
+
80
+ What do you need?
81
+
82
+ 1. Connect to Power BI Desktop on this machine (Windows)
83
+ 2. Verify that my agent MCP config is installed correctly
84
+ 3. Verify an optional local Claude Code plugin `.mcp.json`
85
+ ```
86
+
87
+ ---
88
+
89
+ ## PHASE 1: Local Modeling MCP (Windows)
90
+
91
+ If the user chooses option 1:
92
+
93
+ ```text
94
+ LOCAL MODELING MCP
95
+ ==================
96
+
97
+ This path uses Microsoft's official `powerbi-modeling-mcp` executable.
98
+
99
+ Before we continue:
100
+
101
+ 1. Are you on Windows?
102
+ 2. Did you install the "Power BI Modeling MCP" extension in VS Code or Cursor?
103
+ ```
104
+
105
+ ### If the user is on Windows and installed the extension
106
+
107
+ Guide them to the user-level install:
108
+
109
+ 1. Run `super install --all --yes`, or for one agent run `super install --agent codex --yes` / `super install --agent claude-code --yes` / etc.
110
+ 2. Confirm the agent config contains `powerbi-modeling-mcp` and `microsoft-learn`.
111
+ 3. Restart or refresh the AI agent so it reloads skills and MCP servers.
112
+
113
+ Use these config locations:
114
+
115
+ | Agent | Skill path | MCP config |
116
+ | --- | --- | --- |
117
+ | Claude Code | `~/.claude/skills` or `~/.agents/skills` | `~/.claude.json` |
118
+ | GitHub Copilot | `~/.copilot/skills` | `~/.copilot/mcp-config.json` |
119
+ | Codex | `~/.agents/skills` | `~/.codex/config.toml` |
120
+ | Gemini CLI | `~/.gemini/skills` | `~/.gemini/settings.json` |
121
+ | Kilo Code | `~/.kilo/skills` | `~/.kilo/mcp_settings.json` |
122
+
123
+ Use this explanation:
124
+
125
+ ```text
126
+ BI Agent Superpowers does not launch the Modeling MCP with `uvx`.
127
+ Instead, it uses a local wrapper that finds the official Microsoft executable
128
+ and starts it with `--start`.
129
+ ```
130
+
131
+ If the user wants a config example, show:
132
+
133
+ ```toml
134
+ [mcp_servers.powerbi-modeling-mcp]
135
+ command = "node"
136
+ args = ["<package-dir>/bin/mcp/powerbi-modeling-launcher.js"]
137
+
138
+ [mcp_servers.microsoft-learn]
139
+ url = "https://learn.microsoft.com/api/mcp"
140
+ ```
141
+
142
+ ### If the user installed the executable manually
143
+
144
+ Tell them to set:
145
+
146
+ ```text
147
+ BI_SUPERPOWERS_POWERBI_MODELING_MCP_PATH
148
+ ```
149
+
150
+ Then re-run:
151
+
152
+ ```bash
153
+ super install --all --yes
154
+ ```
155
+
156
+ If they are intentionally maintaining a repo-local Claude Code plugin, they can run `super mcp-setup` inside that plugin project instead.
157
+
158
+ ### If the user is on macOS or Linux
159
+
160
+ Say:
161
+
162
+ ```text
163
+ The current BI Agent Superpowers local project workflows require Windows + Power BI Desktop.
164
+
165
+ On macOS/Linux, do not run partial local Desktop workflows
166
+ flows for local Power BI projects. You still have `microsoft-learn` (HTTP)
167
+ available for docs. Future cloud/Fabric skills may work cross-platform when
168
+ they do not depend on Desktop.
169
+ ```
170
+
171
+ ---
172
+
173
+ ## PHASE 2: Verify Agent MCP Config
174
+
175
+ If the user chooses option 2:
176
+
177
+ Check the config for the agent they use:
178
+
179
+ - Claude Code: `~/.claude.json`
180
+ - GitHub Copilot: `~/.copilot/mcp-config.json`
181
+ - Codex: `~/.codex/config.toml`
182
+ - Gemini CLI: `~/.gemini/settings.json`
183
+ - Kilo Code: `~/.kilo/mcp_settings.json`
184
+
185
+ Confirm:
186
+
187
+ - skills are installed under the agent's user-level skill directory
188
+ - config includes `powerbi-modeling-mcp`
189
+ - config includes `microsoft-learn`
190
+
191
+ If anything is missing, recommend:
192
+
193
+ ```bash
194
+ super install --agent <agent-id> --yes
195
+ ```
196
+
197
+ Then restart or refresh the agent.
198
+
199
+ ## PHASE 3: Verify Optional Local Claude Code Plugin Config
200
+
201
+ If the user chooses option 3, or explicitly says they use `super kickoff` / `claude --plugin-dir`:
202
+
203
+ Check these files in order:
204
+
205
+ 1. `.claude-plugin/plugin.json`
206
+ 2. `.mcp.json`
207
+ 3. `.bi-superpowers.json`
208
+
209
+ Confirm:
210
+
211
+ - plugin name is `bi-superpowers`
212
+ - `.mcp.json` includes `powerbi-modeling-mcp`
213
+ - `.mcp.json` includes `microsoft-learn`
214
+
215
+ If anything is missing, recommend:
216
+
217
+ ```bash
218
+ super recharge
219
+ super mcp-setup
220
+ ```
221
+
222
+ Then:
223
+
224
+ ```bash
225
+ claude --plugin-dir .
226
+ ```
227
+
228
+ ---
229
+
230
+ ## DAX UDF WIKI: DAXLIB-AWARE AUTHORING
231
+
232
+ Use this section when the user asks to write, review, import, or refactor DAX
233
+ user-defined functions (UDFs).
234
+
235
+ ### Upstream references to consult
236
+
237
+ Always check current upstream material before writing non-trivial UDFs:
238
+
239
+ | Source | Use it for |
240
+ | --- | --- |
241
+ | Microsoft Learn DAX UDF docs | Current syntax, preview limitations, supported parameter types, and management flow |
242
+ | DAXLIB source repo | Real-world `functions.tmdl` packages, naming conventions, parameter docs, package manifests |
243
+ | DAXLIB docs | Human-facing package docs and examples |
244
+ | DAXLIB GitHub organization | Development repos for individual libraries and patterns |
245
+
246
+ Canonical links:
247
+
248
+ - https://learn.microsoft.com/en-us/dax/best-practices/dax-user-defined-functions
249
+ - https://github.com/daxlib/daxlib
250
+ - https://docs.daxlib.org/
251
+ - https://github.com/daxlib
252
+
253
+ ### What DAXLIB is for in this plugin
254
+
255
+ DAXLIB is a reference library, not a bundled runtime dependency.
256
+
257
+ Use it to learn:
258
+
259
+ - how library packages organize reusable functions in `lib/functions.tmdl`;
260
+ - how functions are namespaced with dotted names;
261
+ - how function comments document purpose, params, and return shape;
262
+ - how helper functions compose with public functions;
263
+ - how manifests describe package identity, version, authors, tags, and dependencies.
264
+
265
+ Do not:
266
+
267
+ - copy an entire DAXLIB package into a customer model without explicit user
268
+ approval;
269
+ - keep DAXLIB package annotations when creating a user-owned function;
270
+ - claim a DAXLIB pattern is current without checking upstream;
271
+ - ignore the fact that DAX UDFs are still preview in Microsoft documentation.
272
+
273
+ ### Authoring workflow
274
+
275
+ When writing a UDF:
276
+
277
+ 1. Confirm the model target: live Power BI Desktop through the Modeling MCP.
278
+ PBIP/TMDL file edits are not allowed; those files are export snapshots.
279
+ 2. Confirm that DAX UDF preview is enabled in Power BI Desktop when live Desktop
280
+ authoring is required.
281
+ 3. Inspect existing functions first:
282
+ ```dax
283
+ EVALUATE INFO.USERDEFINEDFUNCTIONS()
284
+ ```
285
+ 4. Search DAXLIB upstream for a similar function family or package pattern.
286
+ 5. Decide whether you are:
287
+ - writing a new original UDF;
288
+ - adapting one DAXLIB function with attribution;
289
+ - installing/importing a DAXLIB package by user request.
290
+ 6. Use a namespaced function name for reusable business logic, for example
291
+ `Company.Finance.GrossMarginPct`.
292
+ 7. Prefer explicit parameter hints. Use reference/expression parameters when the
293
+ function must preserve or change filter context.
294
+ 8. Test the function with a small `DEFINE FUNCTION ... EVALUATE ...` query before
295
+ applying it to the model.
296
+ 9. Apply the function through MCP or guide the user through Power BI Desktop
297
+ authoring if the current MCP surface cannot perform the write.
298
+ 10. After saving/exporting, re-query `INFO.USERDEFINEDFUNCTIONS()` or equivalent
299
+ model metadata to verify the function exists.
300
+
301
+ ### UDF design checklist
302
+
303
+ Before returning a UDF to the user, verify:
304
+
305
+ - The function name is unique, well-formed, and not a built-in DAX function or
306
+ reserved word.
307
+ - The name does not start/end with a dot and does not contain consecutive dots.
308
+ - The comment explains why the function exists, not just what the formula says.
309
+ - Every parameter has a meaningful name and type hint.
310
+ - `VAL` vs `EXPR` behavior is intentional.
311
+ - The return shape is clear: scalar, table, filter table, or format string.
312
+ - The function does not expose secured measure/table names in its public name or
313
+ description.
314
+ - The function body is deterministic unless randomness is explicitly required.
315
+ - Helper functions are private-by-convention through naming, not assumed hidden;
316
+ current Power BI limitations do not support hiding/unhiding UDFs.
317
+
318
+ ### Templates for a new original UDF
319
+
320
+ Use DAX Query View first when you need to test the function before saving it:
321
+
322
+ ```dax
323
+ DEFINE
324
+ /// Returns gross margin percentage from gross margin and revenue.
325
+ /// @param {NUMERIC} grossMargin - Gross margin amount.
326
+ /// @param {NUMERIC} revenue - Revenue amount.
327
+ /// @returns Gross margin percentage, blank when revenue is blank or zero.
328
+ FUNCTION Company.Finance.GrossMarginPct =
329
+ (
330
+ grossMargin : NUMERIC,
331
+ revenue : NUMERIC
332
+ ) =>
333
+ DIVIDE ( grossMargin, revenue )
334
+
335
+ EVALUATE
336
+ { Company.Finance.GrossMarginPct ( 120, 300 ) }
337
+ ```
338
+
339
+ Use this TMDL shape only as a review reference for what Desktop/MCP should
340
+ persist. Do not write it into `definition/functions.tmdl` by file patch:
341
+
342
+ ```tmdl
343
+ createOrReplace
344
+ /// Returns gross margin percentage from gross margin and revenue.
345
+ /// @param {NUMERIC} grossMargin - Gross margin amount.
346
+ /// @param {NUMERIC} revenue - Revenue amount.
347
+ /// @returns Gross margin percentage, blank when revenue is blank or zero.
348
+ function Company.Finance.GrossMarginPct =
349
+ (
350
+ grossMargin : NUMERIC,
351
+ revenue : NUMERIC
352
+ ) =>
353
+ DIVIDE ( grossMargin, revenue )
354
+ ```
355
+
356
+ ### DAXLIB adaptation rules
357
+
358
+ If the user asks to adapt a function from DAXLIB:
359
+
360
+ 1. Link to the source package/function you used.
361
+ 2. Explain whether you changed naming, dependencies, parameter types, or return
362
+ behavior.
363
+ 3. Preserve attribution when meaningful.
364
+ 4. Replace `DAXLIB_PackageId` and `DAXLIB_PackageVersion` annotations with
365
+ user/project-owned metadata only if the target model uses such annotations.
366
+ 5. Validate dependencies: DAXLIB functions often call helper functions from the
367
+ same package or a declared dependency.
368
+
369
+ If the user did not ask to import DAXLIB code, use DAXLIB only as a design
370
+ reference and produce an original function.
371
+
372
+ ---
373
+
374
+ ## TROUBLESHOOTING
375
+
376
+ | Problem | What to do |
377
+ | --- | --- |
378
+ | Modeling MCP missing on Windows | Install the Microsoft extension in VS Code or Cursor |
379
+ | Modeling MCP installed manually | Set `BI_SUPERPOWERS_POWERBI_MODELING_MCP_PATH` |
380
+ | Agent not loading MCPs | Re-run `super install --agent <agent-id> --yes` and restart the agent |
381
+ | Local Claude Code plugin not loading MCPs | Re-run `super mcp-setup` inside the plugin project and restart Claude Code |
382
+ | macOS/Linux local project request | Explain that current local BI workflows require Windows + Power BI Desktop; use `microsoft-learn` only for docs |
383
+ | User asks about Excel MCP | Explain Excel remains supported through skills and library content, not a default MCP |
384
+
385
+ ---
386
+
387
+ ## ANTI-PATTERNS
388
+
389
+ | Don't Do This | Why | Do This Instead |
390
+ | --- | --- | --- |
391
+ | Recommend `uvx` for Modeling MCP | Not the official Microsoft installation path | Use the official executable via the local launcher |
392
+ | Ask the user to find a localhost port | Not required in the new flow | Use the official Modeling MCP launcher |
393
+ | 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` |
394
+ | 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 |
395
+ | 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`) |
396
+
397
+ ---
398
+
399
+ ## Complexity Adaptation
400
+
401
+ Adjust depth based on `config.json → experienceLevel`:
402
+ - **beginner**: Step-by-step with explanations, reference library examples
403
+ - **intermediate**: Standard depth, explain non-obvious decisions
404
+ - **advanced**: Concise, skip basics, but still teach edge cases, performance, and design criteria
405
+
406
+ ---
407
+
408
+ ## Related Skills
409
+
410
+ - `/bi-kickoff` — Analyze a BI project and plan next steps
411
+
412
+ ---
413
+
414
+ ## RELATED RESOURCES
415
+
416
+ - [Power BI MCP overview](https://learn.microsoft.com/en-us/power-bi/developer/mcp/mcp-servers-overview)
417
+ - [Power BI Modeling MCP on GitHub](https://github.com/microsoft/powerbi-modeling-mcp)
418
+ - [Microsoft Learn MCP](https://learn.microsoft.com/en-us/training/support/mcp)