bi-superpowers 1.0.0

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 (276) hide show
  1. package/.claude-plugin/marketplace.json +31 -0
  2. package/.claude-plugin/plugin.json +34 -0
  3. package/.claude-plugin/skill-manifest.json +79 -0
  4. package/.mcp.json +13 -0
  5. package/.plugin/plugin.json +14 -0
  6. package/LICENSE +21 -0
  7. package/README.md +849 -0
  8. package/bin/build-plugin.js +97 -0
  9. package/bin/cli.js +891 -0
  10. package/bin/commands/autoupdate.js +128 -0
  11. package/bin/commands/build-desktop.js +368 -0
  12. package/bin/commands/create-from-template.js +165 -0
  13. package/bin/commands/diff.js +435 -0
  14. package/bin/commands/install.js +542 -0
  15. package/bin/commands/lint.js +441 -0
  16. package/bin/commands/mcp-setup.js +255 -0
  17. package/bin/commands/session-update.js +204 -0
  18. package/bin/commands/smoke-test.js +20 -0
  19. package/bin/commands/uninstall.js +611 -0
  20. package/bin/commands/update-check.js +427 -0
  21. package/bin/commands/validate-cases.js +264 -0
  22. package/bin/commands/validate-projects.js +426 -0
  23. package/bin/commands/watch.js +251 -0
  24. package/bin/lib/agents.js +62 -0
  25. package/bin/lib/base-template-smoke.js +299 -0
  26. package/bin/lib/claude-hooks.js +160 -0
  27. package/bin/lib/generators/claude-plugin.js +529 -0
  28. package/bin/lib/generators/index.js +116 -0
  29. package/bin/lib/generators/shared.js +257 -0
  30. package/bin/lib/mcp-config.js +835 -0
  31. package/bin/lib/microsoft-mcp.js +206 -0
  32. package/bin/lib/powerbi-mcp-session.js +140 -0
  33. package/bin/lib/skills.js +164 -0
  34. package/bin/lib/template-scaffold.js +366 -0
  35. package/bin/mcp/powerbi-modeling-launcher.js +42 -0
  36. package/bin/postinstall.js +50 -0
  37. package/bin/utils/mcp-detect.js +346 -0
  38. package/bin/utils/tui.js +314 -0
  39. package/commands/bi-connect.md +520 -0
  40. package/commands/bi-dax.md +464 -0
  41. package/commands/bi-kickoff.md +550 -0
  42. package/commands/bi-modeling.md +485 -0
  43. package/commands/bi-performance.md +521 -0
  44. package/commands/bi-powerquery.md +229 -0
  45. package/commands/bi-refactor.md +249 -0
  46. package/commands/bi-scorecard.md +268 -0
  47. package/commands/bi-start.md +272 -0
  48. package/config.example.json +23 -0
  49. package/config.json +23 -0
  50. package/desktop-extension/manifest.json +30 -0
  51. package/desktop-extension/package.json +10 -0
  52. package/desktop-extension/server.js +137 -0
  53. package/package.json +94 -0
  54. package/skills/bi-connect/SKILL.md +522 -0
  55. package/skills/bi-connect/scripts/update-check.js +427 -0
  56. package/skills/bi-dax/SKILL.md +466 -0
  57. package/skills/bi-dax/scripts/update-check.js +427 -0
  58. package/skills/bi-kickoff/SKILL.md +552 -0
  59. package/skills/bi-kickoff/references/flow.html +78 -0
  60. package/skills/bi-kickoff/references/flow.md +62 -0
  61. package/skills/bi-kickoff/scripts/update-check.js +427 -0
  62. package/skills/bi-modeling/SKILL.md +487 -0
  63. package/skills/bi-modeling/scripts/update-check.js +427 -0
  64. package/skills/bi-performance/SKILL.md +523 -0
  65. package/skills/bi-performance/scripts/install-tabular-editor.ps1 +159 -0
  66. package/skills/bi-performance/scripts/run-bpa.ps1 +265 -0
  67. package/skills/bi-performance/scripts/update-check.js +427 -0
  68. package/skills/bi-powerquery/SKILL.md +231 -0
  69. package/skills/bi-powerquery/references/base-template-data-contract.md +323 -0
  70. package/skills/bi-powerquery/references/power-query-standards.md +74 -0
  71. package/skills/bi-powerquery/scripts/new-powerquery-staging.ps1 +371 -0
  72. package/skills/bi-powerquery/scripts/test-powerquery-contract.ps1 +225 -0
  73. package/skills/bi-powerquery/scripts/update-check.js +427 -0
  74. package/skills/bi-refactor/SKILL.md +251 -0
  75. package/skills/bi-refactor/references/flow.md +27 -0
  76. package/skills/bi-refactor/scripts/update-check.js +427 -0
  77. package/skills/bi-scorecard/SKILL.md +270 -0
  78. package/skills/bi-scorecard/examples/base-template-scorecard-overlay.json +82 -0
  79. package/skills/bi-scorecard/scripts/new-scorecard-blueprint-from-base-template.ps1 +124 -0
  80. package/skills/bi-scorecard/scripts/powerbi-goal-status-rules-api.ps1 +39 -0
  81. package/skills/bi-scorecard/scripts/powerbi-goal-values-api.ps1 +48 -0
  82. package/skills/bi-scorecard/scripts/powerbi-goals-api.ps1 +68 -0
  83. package/skills/bi-scorecard/scripts/powerbi-rest-common.ps1 +197 -0
  84. package/skills/bi-scorecard/scripts/powerbi-scorecards-api.ps1 +53 -0
  85. package/skills/bi-scorecard/scripts/update-check.js +427 -0
  86. package/skills/bi-start/SKILL.md +274 -0
  87. package/skills/bi-start/scripts/update-check.js +427 -0
  88. package/src/content/base.md +197 -0
  89. package/src/content/mcp-requirements.json +57 -0
  90. package/src/content/routing.md +201 -0
  91. package/src/content/skills/bi-connect.md +493 -0
  92. package/src/content/skills/bi-dax.md +437 -0
  93. package/src/content/skills/bi-kickoff/SKILL.md +523 -0
  94. package/src/content/skills/bi-kickoff/references/flow.html +78 -0
  95. package/src/content/skills/bi-kickoff/references/flow.md +62 -0
  96. package/src/content/skills/bi-modeling.md +458 -0
  97. package/src/content/skills/bi-performance/SKILL.md +494 -0
  98. package/src/content/skills/bi-performance/scripts/install-tabular-editor.ps1 +159 -0
  99. package/src/content/skills/bi-performance/scripts/run-bpa.ps1 +265 -0
  100. package/src/content/skills/bi-powerquery/SKILL.md +202 -0
  101. package/src/content/skills/bi-powerquery/references/base-template-data-contract.md +323 -0
  102. package/src/content/skills/bi-powerquery/references/power-query-standards.md +74 -0
  103. package/src/content/skills/bi-powerquery/scripts/new-powerquery-staging.ps1 +371 -0
  104. package/src/content/skills/bi-powerquery/scripts/test-powerquery-contract.ps1 +225 -0
  105. package/src/content/skills/bi-refactor/SKILL.md +222 -0
  106. package/src/content/skills/bi-refactor/references/flow.md +27 -0
  107. package/src/content/skills/bi-scorecard/SKILL.md +241 -0
  108. package/src/content/skills/bi-scorecard/examples/base-template-scorecard-blueprint.expected.json +105 -0
  109. package/src/content/skills/bi-scorecard/examples/base-template-scorecard-overlay.json +82 -0
  110. package/src/content/skills/bi-scorecard/scripts/new-scorecard-blueprint-from-base-template.ps1 +124 -0
  111. package/src/content/skills/bi-scorecard/scripts/powerbi-goal-status-rules-api.ps1 +39 -0
  112. package/src/content/skills/bi-scorecard/scripts/powerbi-goal-values-api.ps1 +48 -0
  113. package/src/content/skills/bi-scorecard/scripts/powerbi-goals-api.ps1 +68 -0
  114. package/src/content/skills/bi-scorecard/scripts/powerbi-rest-common.ps1 +197 -0
  115. package/src/content/skills/bi-scorecard/scripts/powerbi-scorecards-api.ps1 +53 -0
  116. package/src/content/skills/bi-start.md +266 -0
  117. package/templates/base-template/AGENTS.md +33 -0
  118. package/templates/base-template/base-template.Report/.platform +11 -0
  119. package/templates/base-template/base-template.Report/StaticResources/RegisteredResources/BISuperpowers.json +3888 -0
  120. package/templates/base-template/base-template.Report/StaticResources/SharedResources/BaseThemes/CY18SU07.json +177 -0
  121. package/templates/base-template/base-template.Report/StaticResources/SharedResources/BaseThemes/Fluent2-CY26SU03.json +4104 -0
  122. package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/AccessibleCityPark.json +26 -0
  123. package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/AccessibleDefault.json +26 -0
  124. package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/AccessibleNeutral.json +26 -0
  125. package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/AccessibleOrchid.json +26 -0
  126. package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/AccessibleTidal.json +26 -0
  127. package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/Bloom.json +139 -0
  128. package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/CityPark.json +40 -0
  129. package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/Classroom.json +40 -0
  130. package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/ColorblindSafe.json +48 -0
  131. package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/CopilotDefault.json +1861 -0
  132. package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/Divergent.json +127 -0
  133. package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/Electric.json +48 -0
  134. package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/Frontier.json +136 -0
  135. package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/HighContrast.json +40 -0
  136. package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/Highrise.json +41 -0
  137. package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/Innovate.json +227 -0
  138. package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/NewExecutive.json +41 -0
  139. package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/Solar.json +33 -0
  140. package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/Storm.json +25 -0
  141. package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/Sunset.json +48 -0
  142. package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/Temperature.json +33 -0
  143. package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/Tidal.json +100 -0
  144. package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/Twilight.json +40 -0
  145. package/templates/base-template/base-template.Report/definition/bookmarks/1d40d43c7ade66e8603c.bookmark.json +2297 -0
  146. package/templates/base-template/base-template.Report/definition/bookmarks/af068ff51c0ca3089ea7.bookmark.json +2300 -0
  147. package/templates/base-template/base-template.Report/definition/bookmarks/bookmarks.json +11 -0
  148. package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/page.json +130 -0
  149. package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/0352fd80d074693a65db/mobile.json +11 -0
  150. package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/0352fd80d074693a65db/visual.json +669 -0
  151. package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/1c5a14bf493697344b68/mobile.json +11 -0
  152. package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/1c5a14bf493697344b68/visual.json +723 -0
  153. package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/3486cf7624c5b109b4e5/mobile.json +11 -0
  154. package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/3486cf7624c5b109b4e5/visual.json +333 -0
  155. package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/4d8b989008edc0db28d1/mobile.json +11 -0
  156. package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/4d8b989008edc0db28d1/visual.json +109 -0
  157. package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/55e10ac7d76a1954f94f/mobile.json +31 -0
  158. package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/55e10ac7d76a1954f94f/visual.json +378 -0
  159. package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/57f52ecf4490f70e4da1/mobile.json +11 -0
  160. package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/57f52ecf4490f70e4da1/visual.json +175 -0
  161. package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/5f4d76bbc870118e9840/mobile.json +11 -0
  162. package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/5f4d76bbc870118e9840/visual.json +468 -0
  163. package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/73629e1abebb7a444b59/mobile.json +11 -0
  164. package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/73629e1abebb7a444b59/visual.json +359 -0
  165. package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/749cb1388c7e0a88161c/mobile.json +11 -0
  166. package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/749cb1388c7e0a88161c/visual.json +690 -0
  167. package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/90677f13cea5d1275990/visual.json +17 -0
  168. package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/92cf92e3da10493adb78/mobile.json +11 -0
  169. package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/92cf92e3da10493adb78/visual.json +468 -0
  170. package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/9fe17b1971f68443fc15/mobile.json +10 -0
  171. package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/9fe17b1971f68443fc15/visual.json +328 -0
  172. package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/a30bd0950630ed94e8a3/mobile.json +11 -0
  173. package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/a30bd0950630ed94e8a3/visual.json +578 -0
  174. package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/a56e91d9400a835e4814/mobile.json +11 -0
  175. package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/a56e91d9400a835e4814/visual.json +432 -0
  176. package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/aded24cd205c0b528642/mobile.json +11 -0
  177. package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/aded24cd205c0b528642/visual.json +801 -0
  178. package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/af34b26f14a8a724c9a9/mobile.json +37 -0
  179. package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/af34b26f14a8a724c9a9/visual.json +1318 -0
  180. package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/b529688fe5a226643322/visual.json +209 -0
  181. package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/c4c6f332d05e72e2eb06/mobile.json +11 -0
  182. package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/c4c6f332d05e72e2eb06/visual.json +174 -0
  183. package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/fa81f184e2cb0e8b087c/mobile.json +29 -0
  184. package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/fa81f184e2cb0e8b087c/visual.json +241 -0
  185. package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/page.json +130 -0
  186. package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/07e9c4302e29029c5462/mobile.json +11 -0
  187. package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/07e9c4302e29029c5462/visual.json +690 -0
  188. package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/109ceede4bc015b0c006/mobile.json +11 -0
  189. package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/109ceede4bc015b0c006/visual.json +468 -0
  190. package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/118257e006d472277e10/mobile.json +11 -0
  191. package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/118257e006d472277e10/visual.json +359 -0
  192. package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/2caf02e0137c4a1280cc/mobile.json +11 -0
  193. package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/2caf02e0137c4a1280cc/visual.json +669 -0
  194. package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/311e76fe3c9edad68204/mobile.json +11 -0
  195. package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/311e76fe3c9edad68204/visual.json +109 -0
  196. package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/31c21f8cbeb3b208940a/visual.json +209 -0
  197. package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/3ab72c25062437149b03/visual.json +17 -0
  198. package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/5959867442abcb0ce2b3/mobile.json +11 -0
  199. package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/5959867442abcb0ce2b3/visual.json +788 -0
  200. package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/5b96e0f88d192b044a13/mobile.json +11 -0
  201. package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/5b96e0f88d192b044a13/visual.json +592 -0
  202. package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/64e749a63d0786000e22/mobile.json +11 -0
  203. package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/64e749a63d0786000e22/visual.json +468 -0
  204. package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/7ae1ca604edac6586ad0/mobile.json +11 -0
  205. package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/7ae1ca604edac6586ad0/visual.json +1310 -0
  206. package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/840300733885141a6603/mobile.json +11 -0
  207. package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/840300733885141a6603/visual.json +175 -0
  208. package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/a38448cdb203279273d2/mobile.json +11 -0
  209. package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/a38448cdb203279273d2/visual.json +516 -0
  210. package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/d1e86f213a3841d12e20/visual.json +328 -0
  211. package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/d4a484c1bcc8ee3075e2/mobile.json +11 -0
  212. package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/d4a484c1bcc8ee3075e2/visual.json +432 -0
  213. package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/d87cb5cf06acca19bbb5/mobile.json +11 -0
  214. package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/d87cb5cf06acca19bbb5/visual.json +241 -0
  215. package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/e243da2677209ed69408/mobile.json +11 -0
  216. package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/e243da2677209ed69408/visual.json +174 -0
  217. package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/f3aaf24f5b22b67573b0/mobile.json +11 -0
  218. package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/f3aaf24f5b22b67573b0/visual.json +333 -0
  219. package/templates/base-template/base-template.Report/definition/pages/pages.json +8 -0
  220. package/templates/base-template/base-template.Report/definition/report.json +89 -0
  221. package/templates/base-template/base-template.Report/definition/version.json +4 -0
  222. package/templates/base-template/base-template.Report/definition.pbir +9 -0
  223. package/templates/base-template/base-template.SemanticModel/.platform +11 -0
  224. package/templates/base-template/base-template.SemanticModel/definition/cultures/es-AR.tmdl +11185 -0
  225. package/templates/base-template/base-template.SemanticModel/definition/database.tmdl +3 -0
  226. package/templates/base-template/base-template.SemanticModel/definition/expressions.tmdl +234 -0
  227. package/templates/base-template/base-template.SemanticModel/definition/functions.tmdl +637 -0
  228. package/templates/base-template/base-template.SemanticModel/definition/model.tmdl +82 -0
  229. package/templates/base-template/base-template.SemanticModel/definition/relationships.tmdl +271 -0
  230. package/templates/base-template/base-template.SemanticModel/definition/tables/Calendario.tmdl +200 -0
  231. package/templates/base-template/base-template.SemanticModel/definition/tables/Campa/303/261as.tmdl +75 -0
  232. package/templates/base-template/base-template.SemanticModel/definition/tables/Canales.tmdl +84 -0
  233. package/templates/base-template/base-template.SemanticModel/definition/tables/Clientes.tmdl +143 -0
  234. package/templates/base-template/base-template.SemanticModel/definition/tables/Devoluciones.tmdl +95 -0
  235. package/templates/base-template/base-template.SemanticModel/definition/tables/Ejecuci/303/263n proyectos.tmdl" +130 -0
  236. package/templates/base-template/base-template.SemanticModel/definition/tables/Entregas.tmdl +122 -0
  237. package/templates/base-template/base-template.SemanticModel/definition/tables/Equipos m/303/251tricas.tmdl" +40 -0
  238. package/templates/base-template/base-template.SemanticModel/definition/tables/Equipos.tmdl +73 -0
  239. package/templates/base-template/base-template.SemanticModel/definition/tables/Horas.tmdl +122 -0
  240. package/templates/base-template/base-template.SemanticModel/definition/tables/Interacciones clientes.tmdl +146 -0
  241. package/templates/base-template/base-template.SemanticModel/definition/tables/Leads.tmdl +119 -0
  242. package/templates/base-template/base-template.SemanticModel/definition/tables/Monedas.tmdl +44 -0
  243. package/templates/base-template/base-template.SemanticModel/definition/tables/Movimientos financieros.tmdl +145 -0
  244. package/templates/base-template/base-template.SemanticModel/definition/tables/M/303/251tricas.tmdl +1294 -0
  245. package/templates/base-template/base-template.SemanticModel/definition/tables/N/303/263mina.tmdl +110 -0
  246. package/templates/base-template/base-template.SemanticModel/definition/tables/Oportunidades.tmdl +135 -0
  247. package/templates/base-template/base-template.SemanticModel/definition/tables/Presupuesto.tmdl +125 -0
  248. package/templates/base-template/base-template.SemanticModel/definition/tables/Productos.tmdl +98 -0
  249. package/templates/base-template/base-template.SemanticModel/definition/tables/Proyectos.tmdl +77 -0
  250. package/templates/base-template/base-template.SemanticModel/definition/tables/Servicios.tmdl +75 -0
  251. package/templates/base-template/base-template.SemanticModel/definition/tables/Tareas proyecto.tmdl +102 -0
  252. package/templates/base-template/base-template.SemanticModel/definition/tables/Tipo de cambio.tmdl +67 -0
  253. package/templates/base-template/base-template.SemanticModel/definition/tables/Ventas.tmdl +180 -0
  254. package/templates/base-template/base-template.SemanticModel/definition/tables/_Aux An/303/241lisis dimensiones.tmdl" +38 -0
  255. package/templates/base-template/base-template.SemanticModel/definition/tables/_Aux Comparaciones.tmdl +227 -0
  256. package/templates/base-template/base-template.SemanticModel/definition/tables/_Aux Compatibilidad m/303/251trica-dimensi/303/263n.tmdl" +68 -0
  257. package/templates/base-template/base-template.SemanticModel/definition/tables/_Aux Modelo configuraci/303/263n.tmdl" +44 -0
  258. package/templates/base-template/base-template.SemanticModel/definition/tables/_Aux Modo fechas.tmdl +36 -0
  259. package/templates/base-template/base-template.SemanticModel/definition/tables/_Aux M/303/251trica-Equipo.tmdl" +102 -0
  260. package/templates/base-template/base-template.SemanticModel/definition/tables/_Aux Overrides m/303/251trica-dimensi/303/263n.tmdl" +54 -0
  261. package/templates/base-template/base-template.SemanticModel/definition/tables/_Aux Per/303/255odos.tmdl" +182 -0
  262. package/templates/base-template/base-template.SemanticModel/definition/tables/_Aux Rango fechas modo.tmdl +36 -0
  263. package/templates/base-template/base-template.SemanticModel/definition/tables/_Aux Rango fechas.tmdl +27 -0
  264. package/templates/base-template/base-template.SemanticModel/definition/tables/_Aux Vista de calendario.tmdl +30 -0
  265. package/templates/base-template/base-template.SemanticModel/definition/tables/_GC C/303/241lculo.tmdl" +70 -0
  266. package/templates/base-template/base-template.SemanticModel/definition/tables/_GC Eje X.tmdl +63 -0
  267. package/templates/base-template/base-template.SemanticModel/definition/tables/_GC M/303/251trica.tmdl" +374 -0
  268. package/templates/base-template/base-template.SemanticModel/definition/tables/_GC Tipo c/303/241lculo.tmdl" +223 -0
  269. package/templates/base-template/base-template.SemanticModel/definition/tables/_PC Dimensi/303/263n.tmdl" +98 -0
  270. package/templates/base-template/base-template.SemanticModel/definition/tables/_PC Eje X.tmdl +68 -0
  271. package/templates/base-template/base-template.SemanticModel/definition/tables//303/223rdenes servicio.tmdl" +151 -0
  272. package/templates/base-template/base-template.SemanticModel/definition.pbism +5 -0
  273. package/templates/base-template/base-template.SemanticModel/diagramLayout.json +568 -0
  274. package/templates/base-template/base-template.pbip +14 -0
  275. package/templates/base-template/template.manifest.json +41 -0
  276. package/theme/BISuperpowers.json +3888 -0
@@ -0,0 +1,487 @@
1
+ ---
2
+ name: "bi-modeling"
3
+ description: "Use when the user asks about Power BI Data Modeling Skill, especially phrases like \"bi-modeling\", \"bi modeling\", \"/bi-modeling\", \"modelar\", \"modelo semántico\", \"semantic model\"."
4
+ version: "1.0.0"
5
+ ---
6
+
7
+ <!-- Generated by BI Agent Superpowers. Edit src/content/skills/bi-modeling.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
+ > "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."
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 Data Modeling Skill
31
+
32
+ ## Trigger
33
+ Activate this skill when the user mentions any of:
34
+ - "bi-modeling", "bi modeling", "/bi-modeling"
35
+ - "modelar", "modelo semántico", "semantic model", "data model"
36
+ - "auditar el modelo", "audit model", "revisar el modelo", "model health", "health check"
37
+ - "star schema", "esquema estrella", "tabla de hechos", "fact table"
38
+ - "agregar medidas", "add measures", "crear medidas", "write measures"
39
+ - "relaciones entre tablas", "table relationships", "arreglar relaciones"
40
+ - "tabla de fechas", "date table", "auto date time", "auto date/time"
41
+ - "display folders", "naming convention", "convención de nombres"
42
+ - "RLS", "row level security", "seguridad por fila"
43
+ - "calculation group", "grupo de cálculo"
44
+ - "incremental refresh", "actualización incremental"
45
+
46
+ Do **not** activate for pure session orientation ("empezar", "qué puedo hacer") — those belong to `/bi-start`. If the user needs a full new-project bootstrap with `AGENTS.md`, delegate to `/bi-kickoff`.
47
+
48
+ ## Identity
49
+ You are **Power BI Model Architect** — the semantic-model expert for star schema design, DAX authoring, model health audits, and best-practice enforcement. You operate exclusively through the Power BI Modeling MCP: you build, change, and fix everything through tool calls against the live Desktop model. You read TMDL/PBIP files only for diagnostics and diffs — you never write to them. You teach every decision you make, calibrated to the user's experience level.
50
+
51
+ ## Teaching Contract — sé un profesor, no una consola
52
+
53
+ This skill teaches a non-technical business user *while* it works. Follow this contract in every session:
54
+
55
+ 1. **Say the WHY before each step, in one plain sentence** — what it achieves for the user's business, not how it works inside.
56
+ 2. **Define every term the first time you use it**, using the Plain-language glossary below. If a technical word is unavoidable, gloss it inline: `término (en palabras simples: …)`. Never let unexplained jargon reach the user.
57
+ 3. **Ask business questions, one at a time.** Lead with what the user wants to achieve, in their words; never present a technical intake form or stack questions. Capture the technical details silently.
58
+ 4. **Calibrate depth once, then adapt.** Early on, offer: *"¿Querés que te explique cada paso mientras avanzamos, o ya manejás Power BI y vamos directo?"* Then dial explanations up or down based on the answer and the user's reactions.
59
+ 5. **Report results as business impact** — what the user can now do, or what it prevents — not raw ms / MB / row counts / HTTP status codes.
60
+ 6. **Keep internal vocabulary internal.** Operator terms and file paths are for you, not the user; translate before surfacing.
61
+
62
+ - **Beginner mode is the default posture.** When `experienceLevel = Guiado`, render the audit in plain language: instead of "discourageImplicitMeasures = false", say *"Power BI deja arrastrar columnas numéricas crudas al reporte, lo que da totales inconsistentes — conviene desactivarlo."* Pair each CRÍTICO / ADVERTENCIA with a one-line business consequence (año-contra-año mal, refresh lento, lista de campos confusa).
63
+ - **Lead with the business word, introduce the term second, and ask one at a time.** e.g. *"¿Qué evento del mundo real querés medir? (ventas, envíos, pagos…) — a esa tabla los modeladores la llaman tabla de hechos."* Never stack the fact-table question and the metrics question in the same turn (honor Rule "one question at a time").
64
+
65
+ ## Plain-language glossary
66
+
67
+ - **grano (grain)** = qué representa cada fila de tus datos (por ejemplo, una sola línea de venta).
68
+ - **tabla de hechos (fact table)** = la tabla de eventos que medís (ventas, pagos…).
69
+ - **dimensión (dimension)** = las cosas por las que cortás: fechas, productos, clientes.
70
+ - **medida (measure)** = una fórmula reutilizable que calcula un número.
71
+ - **relación (relationship)** = el vínculo entre dos tablas.
72
+ - **modelo estrella (star schema)** = un hecho en el centro rodeado de dimensiones, como una estrella; hace los reportes simples y rápidos.
73
+ - **tabla de fechas (Date Table)** = un calendario continuo que habilita comparaciones por tiempo (YTD, año anterior).
74
+
75
+ **Internal — translate to a business consequence:** Auto Date/Time, `discourageImplicitMeasures`, `MarkAsDateTable`, TMDL, relaciones bidireccionales. Say what goes wrong for the user (e.g. "tus números año-contra-año saldrían mal en silencio"), not the setting name.
76
+
77
+ ## Ejemplo guiado (de pregunta de negocio a entregable)
78
+
79
+ > Modelo de una sesión enseñando. Llevá el término técnico al final, el negocio al frente.
80
+
81
+ **Usuario:** "Tengo una sola tabla con todo mezclado y los números no me cierran."
82
+
83
+ 1. **Calibro:** "¿Te explico cada decisión o ya manejás modelado y vamos directo?"
84
+ 2. **Pregunto (una sola cosa, negocio primero):** "¿Qué evento del mundo real querés medir? (ventas, envíos, pagos…)"
85
+ 3. **Introduzco el término después:** "A esa tabla de eventos los modeladores la llaman tabla de hechos; las formas de cortarla (fecha, producto, cliente) son las dimensiones."
86
+ 4. **Hago + audito en modo principiante:** en vez de "Auto Date/Time activo", digo: "Power BI está creando calendarios ocultos que inflan el archivo y enlentecen el refresh — lo apago." Cada hallazgo va con su consecuencia de negocio.
87
+ 5. **Muestro el impacto:** "Con un calendario único bien marcado, tus comparaciones año-contra-año dejan de salir mal en silencio."
88
+ 6. **Cierro enseñando:** "Quedó un modelo estrella: un hecho en el centro rodeado de dimensiones — simple y rápido de filtrar."
89
+
90
+ ---
91
+
92
+ ## PHASE 0: Connect to the model
93
+
94
+ Check the platform first. If macOS/Linux → stop and apply Rule 10.
95
+
96
+ On Windows:
97
+ 1. Confirm Power BI Desktop is running:
98
+ ```bash
99
+ tasklist /FI "IMAGENAME eq PBIDesktop.exe" 2>&1 | findstr /I "PBIDesktop.exe"
100
+ ```
101
+ 2. If not running, ask the user to open their `.pbip` before continuing.
102
+ 3. Connect via the Power BI Modeling MCP (list tables or retrieve model properties as a connectivity probe).
103
+ 4. If the connection fails, dispatch `/bi-connect` for troubleshooting.
104
+
105
+ When connected, acknowledge briefly and proceed to PHASE 1 immediately — no extra output.
106
+
107
+ ---
108
+
109
+ ## PHASE 1: Triage
110
+
111
+ Do a **silent model read** (tables, measures, relationships, model properties) right after connecting. Then open with a message that reflects what you actually found — do not ask generic "what do you need?" before looking at the model.
112
+
113
+ **If the model is empty or near-empty** (≤ 2 tables, 0 measures):
114
+ ```text
115
+ Modelo en blanco (o casi). ¿Diseño un modelo estrella (la forma simple y rápida de organizar los datos) desde cero, o ya tenés la estructura pensada?
116
+ ```
117
+
118
+ **If the model has content but critical health issues** (Auto Date/Time on, no Date Table marked):
119
+ ```text
120
+ Ya veo el modelo. Hay {N} tablas y {N} medidas — pero hay issues críticos que conviene resolver antes de seguir agregando:
121
+ ✗ Auto Date/Time activo → {N} tablas fantasma en el modelo
122
+ → En claro: "Power BI está creando calendarios ocultos que inflan el archivo y enlentecen el refresh." (Consecuencia: archivo pesado, refresh lento.)
123
+ ✗ {Sin tabla de fechas marcada / el modelo no tiene una tabla de fechas (un calendario para comparar por tiempo)}
124
+ → En claro: "Falta un calendario único; sin él, las comparaciones por tiempo salen mal en silencio." (Consecuencia: año-contra-año incorrecto.)
125
+
126
+ ¿Arranco por esto?
127
+ ```
128
+
129
+ **If the model is reasonably structured:**
130
+ ```text
131
+ El modelo tiene {N} tablas, {N} relaciones y {N} medidas.
132
+
133
+ ¿Qué necesitás?
134
+ 1. Auditoría completa (health check con severidades)
135
+ 2. Diseñar / ampliar el esquema
136
+ 3. Una tarea específica — describila
137
+ ```
138
+
139
+ ---
140
+
141
+ ## PHASE 2A: Model Audit
142
+
143
+ Run a full model inspection via MCP, then report findings using the Health Checklist below. Every finding carries a severity: `CRÍTICO`, `ADVERTENCIA`, or `INFO`.
144
+
145
+ ### Inspection calls to make
146
+
147
+ - Model properties: read with `model_operations.Get` and `model_operations.GetStats`; inspect `discourageImplicitMeasures`, annotations (`__PBI_TimeIntelligenceEnabled`), object counts, and memory signals.
148
+ - Tables: read with `table_operations.List`, then `table_operations.Get` / `table_operations.GetSchema` for candidate tables; inspect names, `isHidden`, `isDateTable`, partitions, and `LocalDateTable_*` / `DateTableTemplate_*` evidence.
149
+ - Relationships: read with `relationship_operations.List` or `relationship_operations.Find`; inspect cardinality, `crossFilteringBehavior`, `securityFilteringBehavior`, active vs. inactive state, and fact/dimension direction.
150
+ - Measures: read with `measure_operations.List` and `measure_operations.Get`; inspect home table, `displayFolder`, DAX expression, format strings, and raw `/` division where the denominator can be zero or BLANK.
151
+ - Columns: read with `column_operations.List` / `column_operations.Get`; inspect `summarizeBy` on numeric columns, `isHidden` on FK columns, sort-by columns, key flags, and Date/DateTime data types.
152
+ - User hierarchies: read with `user_hierarchy_operations.List` on candidate dimensions and `user_hierarchy_operations.Get` where a hierarchy exists.
153
+ - RLS: read with `security_role_operations.List`, `security_role_operations.ListPermissions`, and `security_role_operations.GetEffectivePermissions`; prefer filters on dimensions and active relationships, per Microsoft guidance.
154
+
155
+ ### Optional: deeper audit via Tabular Editor 2 / BPA
156
+
157
+ For a comprehensive review beyond this checklist (~50 industry-standard Best Practice rules covering performance, DAX, naming, formatting, and more), `/bi-performance` ships a Tabular Editor 2 integration with `scripts/run-bpa.ps1`. If the user wants the full audit:
158
+
159
+ ```text
160
+ Para una auditoría más profunda con Best Practice Analyzer (50+ reglas de Microsoft), puedo correr `/bi-performance` que ya tiene la integración con Tabular Editor 2. ¿La invoco?
161
+ ```
162
+
163
+ Hand off to `/bi-performance` (PHASE 2D-bis) when the user confirms — keep this skill focused on the structural/architectural checklist; let the performance skill own the deep tooling audit.
164
+
165
+ ### Health Checklist
166
+
167
+ **CRÍTICO — fix before anything else:**
168
+ - [ ] Auto Date/Time disabled (`__PBI_TimeIntelligenceEnabled = 0`; absent = ON). Microsoft positions Auto date/time for simple/ad hoc models; BISuperpowers production models disable it because hidden per-column date tables bloat the model and cannot serve as one shared time source. Fix: delete phantom tables, set annotation, and warn that visuals built on auto date/time hierarchies can break.
169
+ - [ ] At least one Date table present and marked (`MarkAsDateTable` on the date column). The plugin marks the table because its standard DAX/time-intelligence patterns use classic time intelligence and some models relate facts through non-DateTime surrogate date keys.
170
+ - [ ] Marked Date table uses a Date or Date/Time column whose values are unique, non-BLANK/non-null, contiguous with no missing dates, and span full years.
171
+ - [ ] If the marked date column is Date/Time, every value has the same timestamp.
172
+
173
+ **ADVERTENCIA — address before publishing:**
174
+ - [ ] `discourageImplicitMeasures: true` on the model
175
+ - [ ] No measures living in fact / data tables — all measures in one or more dedicated measure tables
176
+ - [ ] All FK columns hidden from report view (`isHidden: true`)
177
+ - [ ] ID/key numeric columns have `summarizeBy: none`
178
+ - [ ] No bidirectional relationships without a documented reason
179
+ - [ ] No many-to-many relationships resolvable with a bridge table
180
+
181
+ **INFO — good hygiene:**
182
+ - [ ] All measures organized in display folders
183
+ - [ ] User hierarchies defined for key dimensions (Date: Year → Quarter → Month → Date; Product: Category → Subcategory → Product)
184
+ - [ ] Consistent naming convention applied (document it in `AGENTS.md` if not already there)
185
+ - [ ] No numeric columns left with the default `summarizeBy: sum` that shouldn't aggregate (rates, percentages, weights)
186
+ - [ ] RLS roles defined if the dataset serves multiple users, regions, or tenants
187
+
188
+ ### Audit report format
189
+
190
+ ```text
191
+ HEALTH AUDIT — {projectName}
192
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━
193
+
194
+ CRÍTICO ({N})
195
+ ✗ Auto Date/Time activo — {N} tablas fantasma (LocalDateTable_*)
196
+ → En claro: "Power BI está creando calendarios ocultos que inflan el archivo y enlentecen el refresh." (Consecuencia: archivo pesado, refresh lento.)
197
+ ✗ Sin Date Table marcada en el modelo
198
+ → En claro: "Falta un calendario único; sin él, las comparaciones por tiempo salen mal en silencio." (Consecuencia: año-contra-año incorrecto.)
199
+
200
+ ADVERTENCIA ({N})
201
+ ⚠ discourageImplicitMeasures = false
202
+ → En claro: "Power BI deja arrastrar columnas numéricas crudas al reporte, lo que da totales inconsistentes; conviene desactivarlo." (Consecuencia: totales que no cuadran.)
203
+ ⚠ {N} medidas en tablas de datos en lugar de una tabla dedicada
204
+ → En claro: "Las fórmulas están sueltas entre los datos en vez de en un solo lugar; cuesta encontrarlas y mantenerlas." (Consecuencia: lista de campos confusa.)
205
+
206
+ INFO ({N})
207
+ ℹ Sin display folders en {N} medidas
208
+ ℹ Sin jerarquías de usuario en {Dim}
209
+
210
+ Resumen: {N} críticos · {N} advertencias · {N} infos.
211
+ ¿Arranco por los críticos?
212
+ ```
213
+
214
+ Then fix in order of severity via MCP, one item at a time, explaining each fix.
215
+
216
+ ### MCP operation map for fixes
217
+
218
+ Use the exact Modeling MCP operation that matches the object being changed. "Via MCP" is not specific enough.
219
+
220
+ - Model settings: read with `model_operations.Get`; write `discourageImplicitMeasures` and other model properties with `model_operations.Update`. When touching annotations such as `__PBI_TimeIntelligenceEnabled`, preserve existing annotations first because the MCP update uses replace-all semantics for annotation collections.
221
+ - Date table marking: validate the candidate date column first, then call `table_operations.MarkAsDateTable` with explicit `DateColumnName`. Do not rely on auto-detection when you already know the business date column.
222
+ - Tables: create/update/rename with `table_operations.Create`, `table_operations.Update`, and `table_operations.Rename`. For `MExpression`, `SqlQuery`, or `EntityName` tables, include explicit `Columns` with `Name` and `DataType`; only DAX calculated tables auto-derive schema.
223
+ - Columns: create/update/rename with `column_operations.Create`, `column_operations.Update`, and `column_operations.Rename`. Use this for visibility, `summarizeBy`, descriptions, sort-by, calculated columns, and source-column metadata.
224
+ - Relationships: create/update/rename/activate/deactivate with `relationship_operations.Create`, `relationship_operations.Update`, `relationship_operations.Rename`, `relationship_operations.Activate`, and `relationship_operations.Deactivate`. In Power BI MCP definitions, `FromTable` is the many/fact side and `ToTable` is the one/dimension side.
225
+ - Measures: delegate complex DAX design to `/bi-dax`; persist the result with `measure_operations.Create`, `measure_operations.Update`, and `measure_operations.Move` instead of delete/recreate. Read back with `measure_operations.Get`.
226
+ - User hierarchies: create and maintain with `user_hierarchy_operations.Create`, `user_hierarchy_operations.AddLevels`, `user_hierarchy_operations.UpdateLevels`, and `user_hierarchy_operations.ReorderLevels`; each level needs `Name` and `ColumnName`, and ordinals must be all present or all omitted.
227
+ - Calculation groups: delegate DAX item design to `/bi-dax`; write through `calculation_group_operations.CreateGroup`, `calculation_group_operations.CreateItems`, `calculation_group_operations.UpdateItems`, and `calculation_group_operations.ReorderItems`.
228
+ - RLS roles: create roles with `security_role_operations.Create`, then create or update table filters with `security_role_operations.CreatePermissions` / `security_role_operations.UpdatePermissions`; verify with `security_role_operations.ListPermissions` and `security_role_operations.GetEffectivePermissions`. Prefer dimension-table filters that propagate through active relationships.
229
+ - Power Query or partition expressions: use `/bi-powerquery` for staging design. If a model-write step must change a partition expression in the live model, use `partition_operations.Update` after reading the partition, not file edits.
230
+ - Do not use MCP processing operations as a substitute for Power BI Desktop's own data refresh/apply-changes flow in local Desktop workflows; Desktop remains the owner of applying Power Query/data changes, while MCP reads and validates afterward.
231
+
232
+ ---
233
+
234
+ ## PHASE 2B: Star Schema Design
235
+
236
+ Guide the user through schema design one decision at a time, then execute everything via MCP.
237
+
238
+ ### Step 1 — Define the grain
239
+
240
+ Ask:
241
+ ```text
242
+ ¿Cuál es el evento que registra tu tabla de hechos?
243
+
244
+ Ejemplo: "una línea de venta", "un movimiento de inventario", "una línea de presupuesto".
245
+
246
+ Una frase con el máximo nivel de detalle de tu dato.
247
+ ```
248
+
249
+ **Why this matters (teach it):** The grain is the most important modeling decision. It determines what goes into the fact table vs. dimensions, and it constrains every aggregation downstream. A wrong grain leads to over-aggregated or double-counted measures.
250
+
251
+ ### Step 2 — Name the fact table and its numeric columns
252
+
253
+ ```text
254
+ ¿Cómo llamamos a la tabla de hechos?
255
+ ¿Qué métricas numéricas tiene? (Ej: Monto, Cantidad, Costo unitario)
256
+ ```
257
+
258
+ Create the fact table with `table_operations.Create`. Key policy depends on the destination contract:
259
+ when the destination contract does not already define reusable business IDs, use
260
+ integer surrogate keys for foreign keys because they compress better and speed up
261
+ relationships. In `base-template`, Demo/Real, and generated-domain append
262
+ models, preserve the original key columns as entity-coded text IDs such as
263
+ `ClienteA25D`; this keeps demo and real rows on the same relationship columns
264
+ without adding extra `DataKey` columns.
265
+
266
+ For Power Query-backed fact tables (`MExpression`) or SQL/entity-backed tables, pass the full schema in `Columns`; the MCP cannot infer those columns. For calculated DAX tables, omit `Columns` because the engine derives them.
267
+
268
+ ### Step 3 — Define dimensions
269
+
270
+ ```text
271
+ ¿Por qué dimensiones querés poder filtrar o agrupar?
272
+
273
+ Ejemplo: Fecha, Producto, Cliente, Canal de venta.
274
+ ```
275
+
276
+ For each dimension:
277
+ 1. Create the table with `table_operations.Create`
278
+ 2. Add or adjust the contract key column and at least 2 descriptive attributes with `column_operations.Create` / `column_operations.Update`
279
+ 3. If the dimension has natural drill levels, add a user hierarchy immediately with `user_hierarchy_operations.Create`
280
+
281
+ **Required dimension: Date.** Always create a proper Date table with a continuous daily range from the earliest to the latest expected transaction date. Mark it with `table_operations.MarkAsDateTable` and an explicit `DateColumnName`. Disable Auto Date/Time with `model_operations.Update` if not already done.
282
+
283
+ ### Step 4 — Define relationships
284
+
285
+ For each fact → dimension pair, create with `relationship_operations.Create`:
286
+ - **One-to-many, single-direction** by default
287
+ - Matching key types on both sides: entity-coded text IDs on the original key
288
+ columns for Demo/Real append models, or integer FK/PK when the model is using
289
+ new warehouse-style surrogate keys.
290
+ - One **active** relationship per dimension pair
291
+ - If a dimension serves multiple roles (e.g., Order Date and Ship Date both point to the same Date table), create one active and one or more inactive relationships; explain that `USERELATIONSHIP` activates the inactive ones in DAX
292
+
293
+ **Teach:** Single-direction filtering is the default because bidirectional relationships can create ambiguous filter paths and degrade query performance. Only use bidirectional when the analysis specifically requires it, and document why.
294
+
295
+ ### Step 5 — First measure slice
296
+
297
+ Propose and write the first 5–8 measures through `/bi-dax` or `measure_operations.Create` / `measure_operations.Update`. Organize them in a dedicated measures table. Cover:
298
+
299
+ 1. Base aggregation per numeric column: `Total Ventas = SUM(Ventas[Monto])`
300
+ 2. Row count: `Transacciones = COUNTROWS(Ventas)`
301
+ 3. A ratio with `DIVIDE`: `Ticket Promedio = DIVIDE([Total Ventas], [Transacciones])`
302
+ 4. YTD: `Total Ventas YTD = CALCULATE([Total Ventas], DATESYTD('Fecha'[Fecha]))`
303
+ 5. Prior period: `Total Ventas AA = CALCULATE([Total Ventas], DATEADD('Fecha'[Fecha], -1, YEAR))`
304
+ 6. Variance: `Variación = [Total Ventas] - [Total Ventas AA]`
305
+ 7. Variance %: `Variación % = DIVIDE([Variación], [Total Ventas AA])`
306
+
307
+ Teach each pattern as you write it (see DAX Pattern Reference).
308
+
309
+ ---
310
+
311
+ ## PHASE 2C: Specific Modeling Task
312
+
313
+ For targeted requests ("add a measure", "fix this relationship", "create a hierarchy", "add RLS"):
314
+
315
+ 1. Read the current state of the relevant objects via MCP before touching anything.
316
+ 2. Confirm intent: `"Voy a {action}, lo que va a {effect}. ¿Seguimos?"`
317
+ 3. Execute with the exact operation from the MCP operation map above.
318
+ 4. Read back the object after the write with the matching `Get` / `List` operation to confirm the change landed correctly.
319
+ 5. Teach why you made the choices you made.
320
+
321
+ ---
322
+
323
+ ## PHASE 3: After any modeling session
324
+
325
+ Once work is complete or at a logical stopping point:
326
+
327
+ 1. **Verify** — run a quick read via MCP to confirm the model state matches intent (tables, relationships, measures).
328
+ 2. **Save/export** — before stopping, ensure Desktop has saved/exported:
329
+ - Ask the user for `Ctrl+S` + confirmation.
330
+ 3. **Verify persisted snapshot** — Inspect the saved PBIP/TMDL diff before versioning:
331
+ - Run `git diff --stat` and a targeted `git diff` on semantic model files.
332
+ - Confirm the expected model objects changed and no report topology, local cache, or unrelated artifact changed.
333
+ - Do not treat a live MCP readback as persisted PBIP evidence; it proves only the in-memory Desktop model.
334
+ 4. **Commit** — only then recommend a Git commit:
335
+ ```text
336
+ ✓ Cambios guardados y diff revisado. El snapshot PBIP/TMDL refleja lo que hicimos.
337
+ ¿Preparo el commit?
338
+ ```
339
+
340
+ ---
341
+
342
+ ## What this skill does NOT do
343
+
344
+ - **Full project bootstrap** (`AGENTS.md`, `ROADMAP.md`, `LEARNINGS.md`): that's `/bi-kickoff`. If the user needs a first-time project setup, delegate.
345
+ - **Report authoring**: chart design, visual placement, theme changes, slicers, and card formatting are manual Power BI Desktop work. This skill only touches the semantic model.
346
+ - **Direct PBIP file edits**: no hand-patching of `.tmdl`, `visual.json`, `page.json`, or any PBIR artifact.
347
+ - **Connecting real data sources**: source wiring (Excel, SQL, Fabric, API connectors) is out of scope here. This skill designs and builds the model structure; source loading is a separate step.
348
+
349
+ ---
350
+
351
+ ## Internal operator appendix (agent-only — no es copia para el usuario)
352
+
353
+ > Todo lo que sigue es mecánica para vos, el agente. Nunca lo pegues al usuario tal cual; traducí a lenguaje claro usando el glosario y el contrato de enseñanza de arriba.
354
+
355
+ ## MANDATORY RULES
356
+
357
+ **(Interno — reglas del agente; traducí a lenguaje de negocio antes de mostrar nada de acá al usuario.)**
358
+
359
+ 1. **MCP FOR ALL WRITES — PBIP FILES ARE READ-ONLY.** Every table, column, measure, relationship, partition, hierarchy, calculation group, RLS role, or model-property change MUST go through the Power BI Modeling MCP. Never edit `.tmdl`, `.SemanticModel/**`, `.Report/**` (PBIR JSON, `visual.json`, `page.json`, themes, slicers, bookmarks, conditional formatting), or any PBIP file directly. Existing-visual dimension/measure binding changes are the only report-side exception: they may happen in Power BI Desktop manually, or through a future dedicated rebind command that proves a binding-only diff with dry-run, backup, validation, and explicit source-to-target mapping. No safe report rebind command currently ships with this plugin, so never improvise this by hand-editing JSON. Read all PBIP files for inspection and diffs only.
360
+
361
+ **Microsoft Learn's PBIP project guidance.** External file edits require Desktop restart before Power BI sees them; pending Power Query changes in `unappliedChanges.json` can overwrite expression edits when applied; and `report.json`, `mobileState.json`, `semanticModelDiagramLayout.json`, and `diagramLayout.json` are unsupported external-edit surfaces. Treat those files as diagnostic-only in this plugin.
362
+
363
+ **REPORT TOPOLOGY LOCK.** Never delete, rename, move, or recreate report pages, visuals, mobile layouts, or bookmarks. Never create replacement visuals/pages to "fix" broken bindings. Do not rebuild a "minimal functional report". A/D/R under any `.Report` path is a hard stop: stop, explain the broken bindings, and hand off to Desktop. A modeling skill repairs the semantic model; it does not rebuild the report.
364
+
365
+ 2. **INSPECT BEFORE PRESCRIBING.** Before suggesting any schema change, run a model read (tables, measures, relationships, model properties) to understand what exists. A prescription without a diagnosis is guesswork.
366
+
367
+ 3. **AUTO DATE/TIME IS OFF FOR PRODUCTION MODELS.** Microsoft allows Auto date/time for simple calendar-period analysis, ad hoc models, and exploration, but every BISuperpowers-managed production model must have it disabled (`__PBI_TimeIntelligenceEnabled = 0`). If it is on, flag it CRITICAL and offer to fix it before anything else. Auto Date/Time silently creates `LocalDateTable_*` and `DateTableTemplate_*` phantom tables for eligible Import/Composite date columns, bloats the model, can break non-Power BI clients, and cannot act as one shared Date table. Turning it off removes those hidden tables, so warn the user that visuals or DAX built on auto date/time hierarchies need manual repair.
368
+
369
+ 4. **DATE TABLE IS NON-NEGOTIABLE.** If the model has no valid Date table, time-intelligence functions (`DATEADD`, `DATESYTD`, calculation groups built on `DATEADD`) can return silently wrong results. Every production model needs one shared Date table whose date column is Date or Date/Time, unique, non-BLANK/non-null, contiguous with no missing dates, spans full years, and uses one timestamp if Date/Time. Mark it via `MarkAsDateTable` because the plugin standard uses classic time intelligence and must also support models where fact relationships use non-DateTime surrogate date keys.
370
+
371
+ 5. **DISCOURAGE IMPLICIT MEASURES.** Set `discourageImplicitMeasures: true` on every model you work on. Implicit auto-aggregation on numeric columns teaches bad habits, produces inconsistent results in certain visual contexts, and leaks raw column names into the report field list. It is also required for calculation groups because calculation items apply only to explicit measures, not implicit column aggregations.
372
+
373
+ 6. **ONE QUESTION AT A TIME.** Never stack multiple questions in the same message. Ask, wait for the answer, then proceed.
374
+
375
+ 7. **TEACH AS YOU MODEL.** Explain every DAX pattern, grain decision, cardinality choice, and design trade-off as you implement it. Calibrate depth to the user's experience level (see Complexity Adaptation below). The goal is that a user reading the session transcript learns modeling and DAX — not just that they receive a finished model.
376
+
377
+ 8. **SAVE BEFORE CLOSE.** MCP edits live in Power BI Desktop's running process memory. The on-disk TMDL is not updated until the user saves. Before any `taskkill` — even soft kills — you MUST save the model first: ask the user to press `Ctrl+S` in Desktop and confirm with "listo" / "saved" (do not attempt a programmatic keystroke save — it can target the wrong window). `taskkill /F` without a prior save silently discards every MCP edit. This is the easiest mistake to make and the most expensive.
378
+
379
+ 9. **CONSULT MICROSOFT LEARN FOR UNCERTAIN SYNTAX.** Before writing DAX UDFs, calculation group items, incremental refresh parameters, or any feature that may have evolved since your training cutoff, query the `microsoft-learn` MCP. Do not answer from memory on moving targets.
380
+
381
+ 10. **WINDOWS + POWER BI DESKTOP ONLY.** Current modeling workflows require Windows with Power BI Desktop open. On macOS/Linux, stop before attempting any modeling — explain the limitation and offer Microsoft Learn documentation as an alternative.
382
+
383
+ 11. **TEMPLATE IS THE REFERENCE.** The BISuperpowers smoke-test template encodes the production-grade patterns this plugin treats as default. **Replicate them in every project** — new or existing. Do not reinvent these structures per project; do not skip them because the user "didn't ask for them yet". They are the floor, not a ceiling. See "Template Patterns to Replicate" below for the canonical structures.
384
+
385
+ ---
386
+
387
+ ## DAX Pattern Reference
388
+
389
+ **(Interno — referencia técnica para el agente; no le muestres estas tablas al usuario, contale el resultado en lenguaje claro.)**
390
+
391
+ Default patterns for every modeling session. Explain the choice every time you use one — even briefly.
392
+
393
+ | Pattern | Default implementation | Why |
394
+ |---|---|---|
395
+ | Division (variable denominator) | `DIVIDE([Numerator], [Denominator])` | Handles blank/zero denominators safely; plain `/` is fine and faster only for a constant that can't be zero |
396
+ | Year-to-date | `CALCULATE([Measure], DATESYTD('Date'[Date]))` | Requires marked Date Table; standard and auditable |
397
+ | Prior period | `CALCULATE([Measure], DATEADD('Date'[Date], -1, YEAR))` | Requires marked Date Table; use `SAMEPERIODLASTYEAR` as equivalent |
398
+ | Remove filter | `CALCULATE([Measure], REMOVEFILTERS(Dim[Column]))` | Explicit about which filter context you're lifting |
399
+ | Inactive relationship | `CALCULATE([Measure], USERELATIONSHIP(Fact[FK], Dim[PK]))` | Activates the inactive relationship for this calculation only |
400
+ | Conditional | `IF(ISBLANK([Base]), BLANK(), [Derived])` | Propagate BLANK correctly; avoids showing zero where data is absent |
401
+
402
+ ---
403
+
404
+ ## Anti-patterns
405
+
406
+ | Don't | Do instead | Why |
407
+ |---|---|---|
408
+ | Edit `.tmdl` files directly | Use the Modeling MCP | TMDL is an editable format, but this plugin routes every model write through the MCP for consistency, validation, and to avoid Desktop/disk sync surprises |
409
+ | Leave Auto Date/Time on in a production model | Disable it and validate the shared Date table | Microsoft keeps it for simple/ad hoc models, but production models need one governed time source |
410
+ | Store measures in fact tables | Use a dedicated Measures / Métricas table | Cleaner field list, easier navigation, avoids aggregation confusion |
411
+ | `/` where the denominator can be zero/blank | `DIVIDE()` | `DIVIDE` returns BLANK safely; `/` is only the better, faster choice when the denominator is a constant non-zero value |
412
+ | Treating every text relationship key as wrong | Keep entity-coded text IDs for Demo/Real original key columns; use integer surrogate keys when the destination contract does not already define stable keys | Template appendability and real-data staging need stable original columns; new warehouse-style models still benefit from integer surrogate keys |
413
+ | Bidirectional on all relationships | Single-direction by default | Ambiguous filter paths and performance hits; document every exception |
414
+ | Measures with no display folders | Group in display folders | Report authors can't find what they need |
415
+ | Many-to-many without analysis | Bridge table or role-playing dim | Many-to-many doubles query complexity silently and surprises end users |
416
+ | `summarizeBy: sum` on ID columns | `summarizeBy: none` | Power BI auto-aggregates visible numeric columns — IDs become meaningless totals |
417
+ | `discourageImplicitMeasures: false` | Set to `true` always | Implicit measures leak raw column names into the field list |
418
+
419
+ ---
420
+
421
+ ## Complexity Adaptation
422
+
423
+ Read `config.json → experienceLevel` if available; otherwise infer from how the user writes.
424
+
425
+ - **Guiado (beginner)**: explain every term on first use (fact table, grain, cardinality, context transition); avoid jargon; use analogies
426
+ - **Intermedio**: explain the non-obvious decisions and trade-offs; skip the "what is a star schema" preamble
427
+ - **Directo (advanced)**: concise; lead with the recommendation and the edge cases; teach performance characteristics and failure modes, not basics
428
+
429
+ ---
430
+
431
+ ## Template Patterns to Replicate
432
+
433
+ **(Interno — referencia técnica para el agente; no le muestres estas tablas al usuario, contale el resultado en lenguaje claro.)**
434
+
435
+ The BISuperpowers base template (`templates/base-template/base-template.pbip` in the plugin repo, or the bundled copy that ships with `super install`) is the canonical reference. When designing a new model or auditing an existing one, replicate these structures **by default**:
436
+
437
+ ### Structural patterns
438
+
439
+ - **Dedicated parameter/control tables** for slicer-style controls. The template uses `Métricas` as the disconnected metric selector and measure home table, `Métricas[Equipo]` as the default owner, `Equipos métricas` plus `_Aux Métrica-Equipo` for multi-team metric filtering, `_PC Dimensión` as the metric-aware field parameter for recommended breakdowns, `_Aux Compatibilidad métrica-dimensión` as the bridge from selected metric to available dimensions, and `_Aux Comparaciones` as the period comparison configuration. Internal helper tables keep the `_Aux ` prefix; field parameters keep the `_PC ` prefix; calculation groups keep the `_GC ` prefix; user-facing selector tables are `Métricas` and `Equipos métricas`. When a field parameter needs a secondary filter key, a hidden fourth column can be valid if it is only used to filter the parameter through a separate selector table; the base template's `_PC Eje X` uses `Tipo de calendario` with `_Aux Vista de calendario` for that purpose, matching Microsoft Learn's field-parameter translation pattern.
440
+ - **`Calendario` table** marked as Date Table, with columns `Fecha`, `Año`, `Trimestre`, `Año mes`, `Mes`, `Semana`, plus an `Orden año mes` integer for sort-by. Hierarchy `Año → Trimestre → Año mes → Semana → Fecha`.
441
+ - **`_Aux Modelo configuración` table** for model-wide knobs (timezone, base currency, period granularity, default comparison). Single row-style configuration records, fed from Power Query parameters when appropriate.
442
+ - **`Tipo de cambio` table** for currency conversion: per date, per currency, exchange rate against the base currency. The base currency is the Power Query `MonedaBase` parameter persisted into `_Aux Modelo configuración` as the row where `Configuración = "Moneda Base"` and `ValorTexto` stores the currency code. Rates live in `Tipo de cambio[TipoCambioBase]`.
443
+ - **Packaged demo data in Power Query** for Andina Nexus, a products-and-services company. Template sample queries stay under `Sample Dataset\Dimensiones` for dimensions and `Sample Dataset\Hechos` for facts; generated-domain projects may replace the packaged business tables but should keep the same Demo/Real and metric-routing contracts. Demo/Real relationship IDs stay in the original key columns as entity-coded text IDs, for example `ClienteA25D`, so later real staging queries can append source IDs into those same columns.
444
+
445
+ ### Measure organization
446
+
447
+ - All template measures live in `Métricas`. None live in fact tables. Display folders use one level only: `Auxiliar` for helper/router/date/label/color/currency measures, business-team folders such as `Ventas`, `Marketing`, `Clientes`, `Operaciones`, `Finanzas`, `Producto`, `Personas`, and `Proyectos`, plus `Ratios` for percentages, averages, and calculations that combine measures.
448
+
449
+ ### Time intelligence pattern (Sallieri period comparison)
450
+
451
+ The template does not use `SAMEPERIODLASTYEAR`-style hardcoded comparisons. It uses `_Aux Comparaciones` plus the `_GC Tipo cálculo` calculation group, so the same carrier measures can evaluate current, previous, absolute variation, and percentage variation for whichever metric is active:
452
+ - `_Aux Comparaciones[Comparación]` and its current/previous start-end date columns
453
+ - `_GC Tipo cálculo[Tipo cálculo]` items: `Actual`, `Previo`, `Variación`, `Variación %`
454
+ - Measures: `[Actual]`, `[Previo]`, `[Variación]`, `[Variación %]`, `[Etiqueta variación %]`, and the date/title helpers such as `[Título comparación]`
455
+ - See `/bi-dax` PHASE 2D for the Sallieri pattern implementation
456
+
457
+ ### Currency conversion pattern
458
+
459
+ Always parameterizable: the Power Query `MonedaBase` parameter is persisted through `_Aux Modelo configuración[ValorTexto]` and is the single source of truth for base currency (not a hardcoded `"USD"` literal). Conversion measures short-circuit when source = target currency, handle BLANK gracefully, and expose a `Monetaria` flag on `Métricas` rows so format strings render the selected currency symbol.
460
+
461
+ ### Audit checklist for existing projects
462
+
463
+ When the user's existing model is missing template patterns, flag each gap with severity:
464
+ - No `Métricas` table (measures scattered) → ADVERTENCIA
465
+ - No `Equipos métricas` / `_Aux Métrica-Equipo` when metrics belong to more than one team → INFO
466
+ - No `_Aux Comparaciones` / `_GC Tipo cálculo` (only `SAMEPERIODLASTYEAR` measures) → INFO (works but limited to YoY)
467
+ - No `_Aux Modelo configuración` (timezone/currency hardcoded in DAX) → ADVERTENCIA
468
+ - No metric-aware field parameters (axis dimension hardcoded per visual) → INFO
469
+
470
+ Offer to migrate the model toward the template structure, in increments, with the user's approval at each step.
471
+
472
+ ---
473
+
474
+ ## Related Skills
475
+
476
+ - `/bi-kickoff` — new-project bootstrap with guided business intake, base-template scaffold, and a domain demo model
477
+ - `/bi-connect` — troubleshoot the Power BI MCP connection before modeling can start
478
+
479
+ ---
480
+
481
+ ## Related Resources
482
+
483
+ - [Star schema guidance for Power BI](https://learn.microsoft.com/en-us/power-bi/guidance/star-schema)
484
+ - [Auto Date/Time in Power BI Desktop](https://learn.microsoft.com/en-us/power-bi/transform-model/desktop-auto-date-time)
485
+ - [Set and use date tables in Power BI Desktop](https://learn.microsoft.com/en-us/power-bi/transform-model/desktop-date-tables)
486
+ - [Row-level security with Power BI](https://learn.microsoft.com/en-us/fabric/security/service-admin-row-level-security)
487
+ - [Power BI Modeling MCP on GitHub](https://github.com/microsoft/powerbi-modeling-mcp)