@luquimbo/bi-superpowers 3.2.0 → 4.1.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 (91) hide show
  1. package/.claude-plugin/marketplace.json +5 -3
  2. package/.claude-plugin/plugin.json +28 -2
  3. package/.claude-plugin/skill-manifest.json +22 -6
  4. package/.plugin/plugin.json +1 -1
  5. package/AGENTS.md +52 -36
  6. package/CHANGELOG.md +295 -0
  7. package/README.md +75 -26
  8. package/bin/build-plugin.js +11 -4
  9. package/bin/cli.js +113 -16
  10. package/bin/commands/build-desktop.js +35 -16
  11. package/bin/commands/diff.js +31 -13
  12. package/bin/commands/install.js +7 -3
  13. package/bin/commands/lint.js +40 -26
  14. package/bin/commands/mcp-setup.js +3 -10
  15. package/bin/commands/update-check.js +389 -0
  16. package/bin/lib/generators/claude-plugin.js +144 -6
  17. package/bin/lib/generators/shared.js +29 -33
  18. package/bin/lib/mcp-config.js +168 -12
  19. package/bin/lib/skills.js +115 -27
  20. package/bin/postinstall.js +4 -2
  21. package/bin/utils/mcp-detect.js +2 -2
  22. package/commands/bi-start.md +218 -0
  23. package/commands/pbi-connect.md +43 -65
  24. package/commands/project-kickoff.md +393 -673
  25. package/commands/report-design.md +403 -0
  26. package/desktop-extension/manifest.json +3 -3
  27. package/package.json +7 -5
  28. package/skills/bi-start/SKILL.md +220 -0
  29. package/skills/bi-start/scripts/update-check.js +389 -0
  30. package/skills/pbi-connect/SKILL.md +45 -67
  31. package/skills/pbi-connect/scripts/update-check.js +389 -0
  32. package/skills/project-kickoff/SKILL.md +395 -675
  33. package/skills/project-kickoff/scripts/update-check.js +389 -0
  34. package/skills/report-design/SKILL.md +405 -0
  35. package/skills/report-design/references/cli-commands.md +184 -0
  36. package/skills/report-design/references/cli-setup.md +101 -0
  37. package/skills/report-design/references/close-write-open-pattern.md +80 -0
  38. package/skills/report-design/references/layouts/finance.md +65 -0
  39. package/skills/report-design/references/layouts/generic.md +46 -0
  40. package/skills/report-design/references/layouts/hr.md +48 -0
  41. package/skills/report-design/references/layouts/marketing.md +45 -0
  42. package/skills/report-design/references/layouts/operations.md +44 -0
  43. package/skills/report-design/references/layouts/sales.md +50 -0
  44. package/skills/report-design/references/native-visuals.md +341 -0
  45. package/skills/report-design/references/pbi-desktop-installation.md +87 -0
  46. package/skills/report-design/references/pbir-preview-activation.md +40 -0
  47. package/skills/report-design/references/slicer.md +89 -0
  48. package/skills/report-design/references/textbox.md +101 -0
  49. package/skills/report-design/references/themes/BISuperpowers.json +915 -0
  50. package/skills/report-design/references/troubleshooting.md +135 -0
  51. package/skills/report-design/references/visual-types.md +78 -0
  52. package/skills/report-design/scripts/apply-theme.js +243 -0
  53. package/skills/report-design/scripts/create-visual.js +878 -0
  54. package/skills/report-design/scripts/ensure-pbi-cli.sh +41 -0
  55. package/skills/report-design/scripts/update-check.js +389 -0
  56. package/skills/report-design/scripts/validate-pbir.js +322 -0
  57. package/src/content/base.md +12 -68
  58. package/src/content/mcp-requirements.json +0 -25
  59. package/src/content/routing.md +19 -74
  60. package/src/content/skills/bi-start.md +191 -0
  61. package/src/content/skills/pbi-connect.md +22 -65
  62. package/src/content/skills/project-kickoff.md +372 -673
  63. package/src/content/skills/report-design/SKILL.md +376 -0
  64. package/src/content/skills/report-design/references/cli-commands.md +184 -0
  65. package/src/content/skills/report-design/references/cli-setup.md +101 -0
  66. package/src/content/skills/report-design/references/close-write-open-pattern.md +80 -0
  67. package/src/content/skills/report-design/references/layouts/finance.md +65 -0
  68. package/src/content/skills/report-design/references/layouts/generic.md +46 -0
  69. package/src/content/skills/report-design/references/layouts/hr.md +48 -0
  70. package/src/content/skills/report-design/references/layouts/marketing.md +45 -0
  71. package/src/content/skills/report-design/references/layouts/operations.md +44 -0
  72. package/src/content/skills/report-design/references/layouts/sales.md +50 -0
  73. package/src/content/skills/report-design/references/native-visuals.md +341 -0
  74. package/src/content/skills/report-design/references/pbi-desktop-installation.md +87 -0
  75. package/src/content/skills/report-design/references/pbir-preview-activation.md +40 -0
  76. package/src/content/skills/report-design/references/slicer.md +89 -0
  77. package/src/content/skills/report-design/references/textbox.md +101 -0
  78. package/src/content/skills/report-design/references/themes/BISuperpowers.json +915 -0
  79. package/src/content/skills/report-design/references/troubleshooting.md +135 -0
  80. package/src/content/skills/report-design/references/visual-types.md +78 -0
  81. package/src/content/skills/report-design/scripts/apply-theme.js +243 -0
  82. package/src/content/skills/report-design/scripts/create-visual.js +878 -0
  83. package/src/content/skills/report-design/scripts/ensure-pbi-cli.sh +41 -0
  84. package/src/content/skills/report-design/scripts/validate-pbir.js +322 -0
  85. package/bin/commands/install.test.js +0 -289
  86. package/bin/commands/lint.test.js +0 -103
  87. package/bin/lib/generators/claude-plugin.test.js +0 -111
  88. package/bin/lib/mcp-config.test.js +0 -310
  89. package/bin/lib/microsoft-mcp.test.js +0 -115
  90. package/bin/utils/mcp-detect.test.js +0 -81
  91. package/bin/utils/tui.test.js +0 -127
@@ -0,0 +1,341 @@
1
+ # Native PBI visual types — canonical reference
2
+
3
+ **Single source of truth for every native `visualType` accepted by Power BI Desktop (March 2026, PBIR schema 2.7.0) and the shape of its `query.queryState`.**
4
+
5
+ The allowlist is implemented in `scripts/create-visual.js` (`NATIVE_VISUAL_TYPES` lookup) and enforced by `scripts/validate-pbir.js`. This doc is the human-readable mirror.
6
+
7
+ If a type isn't in this table, it's not native — `create-visual.js` will reject it, and `validate-pbir.js` will flag it on any existing visual.json.
8
+
9
+ **Related reference**: `references/visual-types.md` — tested-in-Desktop reference with render status per typeId. Cross-reference this doc when in doubt about whether a typeId actually renders on a given PBI Desktop build.
10
+
11
+ ---
12
+
13
+ ## The native visualTypes
14
+
15
+ | # | `visualType` | Category | Required roles | Optional roles | Notes |
16
+ |---|---|---|---|---|---|
17
+ | 1 | `card` | Single | Values (measure) | — | KPI clásico, un valor. |
18
+ | 2 | `cardVisual` | Single | Data (measure, multi) | — | New card March 2026. Multiple measures. |
19
+ | 3 | `kpi` | Single | Indicator (measure) | Goal (measure), TrendLine (column) | KPI con goal + trend. |
20
+ | 4 | `gauge` | Single | Y (measure) | MaxValue, TargetValue, MinValue (measures) | Arco radial. |
21
+ | 5 | `multiRowCard` | Single | Values (measure, multi) | — | Card multi-valor apilado. |
22
+ | 6 | `barChart` | Comparison | Category (column), Y (measure, multi) | Legend (column) | Agrega Legend para stacked. |
23
+ | 7 | `clusteredBarChart` | Comparison | Category, Y | Legend | Side-by-side siempre. |
24
+ | 8 | `columnChart` | Comparison | Category, Y | Legend | Agrega Legend para stacked. |
25
+ | 9 | `clusteredColumnChart` | Comparison | Category, Y | Legend | Side-by-side siempre. |
26
+ | 10 | `hundredPercentStackedBarChart` | Comparison | Category, Y, **Legend** | — | Legend es mandatorio. |
27
+ | 11 | `hundredPercentStackedColumnChart` | Comparison | Category, Y, **Legend** | — | Legend es mandatorio. |
28
+ | 12 | `lineChart` | Time | Category, Y (multi) | Legend | Time series. |
29
+ | 13 | `areaChart` | Time | Category, Y (multi) | Legend | Agrega Legend para stacked. |
30
+ | 14 | `lineClusteredColumnComboChart` | Time | Category, ColumnY, LineY (measures, multi) | Legend | ColumnY side-by-side. **Única variante combo que renderiza en Desktop** (la stacked está rota — ver blocklist). |
31
+ | 15 | `ribbonChart` | Time | Category, Y | Legend | Ranking change over time. ⚠ Puede requerir preview flag. |
32
+ | 16 | `pieChart` | Part-to-whole | Category, Y | — | Torta. |
33
+ | 17 | `donutChart` | Part-to-whole | Category, Y | — | Dona (pie con hueco). |
34
+ | 18 | `treemap` | Part-to-whole | Category, Values | — | Rectángulos proporcionales. |
35
+ | 19 | `funnelChart` | Flow | Category, Y | — | Embudo / stages. |
36
+ | 20 | `scatterChart` | Correlation | Details (column), X (measure), Y (measure) | Legend (column), Size (measure) | Con Size → bubble chart. |
37
+ | 21 | `waterfallChart` | Flow | Category, Y | Breakdown (column) | Con Breakdown desglosa cada barra. |
38
+ | 22 | `tableEx` | Tabular | Values (multi) | — | Tabla detalle. |
39
+ | 23 | `pivotTable` | Tabular | Rows (column, multi), Values (measure, multi) | Columns (column, multi) | Matriz. |
40
+ | 24 | `slicer` | Filter | Values (column) | `--slicer-mode basic\|horizontal\|dropdown\|between\|relative` | 5 modos. |
41
+ | 25 | `advancedSlicerVisual` | Filter | Values (column) | — | New slicer March 2026. |
42
+ | 26 | `listSlicer` | Filter | Values (column) | — | Legacy typeId list-only. Preferí `slicer` con `basic`. |
43
+ | 27 | `textSlicer` | Filter | Values (column) | — | Text-input slicer (filtra por substring). |
44
+ | — | `textbox` | Text | (no roles) | `--title`, `--description`, `--paragraph` | Sin query. |
45
+
46
+ `textbox` es un caso especial sin `query.queryState` — usa `objects.general[0].properties.paragraphs[]`.
47
+
48
+ ---
49
+
50
+ ## Types that look native but are NOT
51
+
52
+ These pass CLI validation (even `pbi report validate`) but Desktop rejects them as "objeto visual personalizado":
53
+
54
+ | Fake type | Real pattern |
55
+ |---|---|
56
+ | `stackedBarChart` | `barChart` con Legend (el Legend actúa como Series y PBI apila automáticamente) |
57
+ | `stackedColumnChart` | `columnChart` con Legend |
58
+ | `stackedAreaChart` | `areaChart` con Legend |
59
+ | `lineStackedColumnComboChart` | `lineClusteredColumnComboChart` (el combo clustered sí renderiza; el stacked pasa validate pero Desktop lo rechaza). Ver `visual-types.md` para el testing detrás de esta regla. |
60
+ | `funnel` | `funnelChart` (el bare `funnel` es legacy typeId). |
61
+ | `pie` | alias del CLI upstream que mapea a `donutChart` (bug) — usar `pieChart` nativo |
62
+ | `donut` | alias del CLI — usar `donutChart` nativo |
63
+ | `bar_chart`, `line_chart`, `column_chart`, `area_chart` | aliases CLI. Usar los nombres PascalCase nativos. |
64
+
65
+ `create-visual.js` conoce estos aliases erróneos y devuelve un error amigable con la corrección. `validate-pbir.js` los flaggea en visual.json existentes.
66
+
67
+ ---
68
+
69
+ ## Shape canonical de un visual.json
70
+
71
+ Todo visual.json tiene la misma estructura top-level:
72
+
73
+ ```json
74
+ {
75
+ "$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
76
+ "name": "<visualName>",
77
+ "position": {
78
+ "x": 24, "y": 24, "z": 0,
79
+ "height": 300, "width": 400,
80
+ "tabOrder": 0
81
+ },
82
+ "visual": {
83
+ "visualType": "<type>",
84
+ "query": { "queryState": { "<Role>": { "projections": [ ... ] } } },
85
+ "drillFilterOtherVisuals": true,
86
+ "visualContainerObjects": { "title": [ ... ] }
87
+ }
88
+ }
89
+ ```
90
+
91
+ ### Projection shape
92
+
93
+ Un `projection` tiene wrappers diferentes según si es Column o Measure:
94
+
95
+ **Column** (con `active: true`):
96
+ ```json
97
+ {
98
+ "field": {
99
+ "Column": {
100
+ "Expression": { "SourceRef": { "Entity": "Cuentas" } },
101
+ "Property": "Banco"
102
+ }
103
+ },
104
+ "queryRef": "Cuentas.Banco",
105
+ "nativeQueryRef": "Banco",
106
+ "active": true
107
+ }
108
+ ```
109
+
110
+ **Measure** (sin `active`):
111
+ ```json
112
+ {
113
+ "field": {
114
+ "Measure": {
115
+ "Expression": { "SourceRef": { "Entity": "_Measures" } },
116
+ "Property": "Monto"
117
+ }
118
+ },
119
+ "queryRef": "_Measures.Monto",
120
+ "nativeQueryRef": "Monto"
121
+ }
122
+ ```
123
+
124
+ ### Tablas con espacios
125
+
126
+ Si la tabla tiene espacios en el nombre (`'Categorias Finanzas'`, `'Movimientos Financieros'`), el shape del projection **NO lleva las comillas** en el `Entity`. Solo lleva el nombre raw:
127
+
128
+ ```json
129
+ { "SourceRef": { "Entity": "Categorias Finanzas" } }
130
+ ```
131
+
132
+ Pero en `queryRef` **NO** hay comillas: `Categorias Finanzas.Categoria`.
133
+
134
+ `create-visual.js` maneja ambas notaciones en el input (`Tabla[Col]` y `'Tabla Con Espacios'[Col]`) y genera el shape correcto.
135
+
136
+ ---
137
+
138
+ ## Cómo crear un visual
139
+
140
+ Siempre usar `create-visual.js`. Nunca escribir visual.json a mano (excepto para patrones que la allowlist aún no cubra — si te pasa, levantá un issue antes de improvisar).
141
+
142
+ ```bash
143
+ node <skillBundleDir>/scripts/create-visual.js \
144
+ --report-path <path>/MyProj.Report \
145
+ --page <pageName> \
146
+ --type <nativeVisualType> \
147
+ --name <visualName> \
148
+ --x <x> --y <y> --width <w> --height <h> \
149
+ --bind <role>=<Table>[<Field>] \
150
+ [--bind ...] \
151
+ [--title "<container title>"]
152
+ ```
153
+
154
+ Ejemplos por categoría (copy-paste ready):
155
+
156
+ ### KPI card
157
+
158
+ ```bash
159
+ node create-visual.js -p ./pbip-files/Foo.Report --page overview --type card \
160
+ -n kpi_revenue --x 24 --y 24 --width 280 --height 120 \
161
+ --bind values='_Measures[Total Revenue]' \
162
+ --title "Total Revenue"
163
+ ```
164
+
165
+ ### KPI con trend + goal
166
+
167
+ ```bash
168
+ node create-visual.js -p ./pbip-files/Foo.Report --page overview --type kpi \
169
+ -n kpi_savings --x 320 --y 24 --width 280 --height 120 \
170
+ --bind indicator='_Measures[Ahorro Neto]' \
171
+ --bind goal='_Measures[Budget vs Actual]' \
172
+ --bind trendline='Fecha[Fecha]'
173
+ ```
174
+
175
+ ### Bar chart stacked (con Series)
176
+
177
+ ```bash
178
+ # NO uses --type stackedBarChart. Usa barChart + Legend:
179
+ node create-visual.js -p ./pbip-files/Foo.Report --page overview --type barChart \
180
+ -n gasto_por_banco --x 24 --y 200 --width 600 --height 300 \
181
+ --bind category='Cuentas[Banco]' \
182
+ --bind y='_Measures[Gastos]' \
183
+ --bind legend="'Categorias Finanzas'[TipoMovimiento]"
184
+ ```
185
+
186
+ ### 100% stacked bar
187
+
188
+ ```bash
189
+ node create-visual.js -p ./pbip-files/Foo.Report --page overview --type hundredPercentStackedBarChart \
190
+ -n estado_okrs --x 640 --y 200 --width 400 --height 300 \
191
+ --bind category='OKRs[AreaVida]' \
192
+ --bind y='_Measures[KR Count]' \
193
+ --bind legend='OKRs[Estado]'
194
+ ```
195
+
196
+ ### Combo line + clustered column
197
+
198
+ Nota: Desktop March 2026 **no** renderiza `lineStackedColumnComboChart` — usar la variante clustered.
199
+
200
+ ```bash
201
+ node create-visual.js -p ./pbip-files/Foo.Report --page overview --type lineClusteredColumnComboChart \
202
+ -n revenue_vs_margin --x 24 --y 500 --width 800 --height 320 \
203
+ --bind category='Fecha[Fecha]' \
204
+ --bind columny='_Measures[Gastos]' \
205
+ --bind liney='_Measures[Ingresos]'
206
+ ```
207
+
208
+ ### Scatter / bubble
209
+
210
+ ```bash
211
+ # Scatter simple (sin Size):
212
+ node create-visual.js -p ./pbip-files/Foo.Report --page analysis --type scatterChart \
213
+ -n mood_vs_deepwork --x 24 --y 400 --width 600 --height 300 \
214
+ --bind details='Fecha[MesNombre]' \
215
+ --bind x='_Measures[Mood Avg]' \
216
+ --bind y='_Measures[Deep Work Avg]'
217
+
218
+ # Bubble (con Size → burbuja proporcional):
219
+ node create-visual.js ... --bind size='_Measures[Sleep Avg]'
220
+ ```
221
+
222
+ ### Waterfall con Breakdown
223
+
224
+ ```bash
225
+ node create-visual.js -p ./pbip-files/Foo.Report --page analysis --type waterfallChart \
226
+ -n balance_cascada --x 640 --y 400 --width 600 --height 300 \
227
+ --bind category="'Categorias Finanzas'[GrupoCategoria]" \
228
+ --bind y='_Measures[Monto]' \
229
+ --bind breakdown="'Categorias Finanzas'[TipoMovimiento]"
230
+ ```
231
+
232
+ ### Textbox (título + descripción)
233
+
234
+ ```bash
235
+ node create-visual.js -p ./pbip-files/Foo.Report --page overview --type textbox \
236
+ -n header --x 24 --y 0 --width 1232 --height 92 \
237
+ --title "Resumen Ejecutivo" \
238
+ --description "KPIs de finanzas personales, hábitos y OKRs del trimestre actual."
239
+ ```
240
+
241
+ ### Slicer (5 modos)
242
+
243
+ ```bash
244
+ # 1. Basic (default: vertical list)
245
+ node create-visual.js ... --type slicer --bind values='Fecha[Año]'
246
+
247
+ # 2. Horizontal (tiles)
248
+ node create-visual.js ... --type slicer --bind values='Fecha[Mes]' --slicer-mode horizontal
249
+
250
+ # 3. Dropdown (ahorra espacio)
251
+ node create-visual.js ... --type slicer --bind values="'Categorias Finanzas'[Categoria]" --slicer-mode dropdown
252
+
253
+ # 4. Between (slider de rango, numérico o fecha)
254
+ node create-visual.js ... --type slicer --bind values='Movimientos Financieros[Monto]' --slicer-mode between
255
+
256
+ # 5. Relative date (últimos N días)
257
+ node create-visual.js ... --type slicer --bind values='Fecha[Fecha]' --slicer-mode relative
258
+ ```
259
+
260
+ ---
261
+
262
+ ## Validación
263
+
264
+ Después de crear visuales, correr las dos capas de validación:
265
+
266
+ ```bash
267
+ # 1. CLI (schema sanity, existencia de archivos, JSON válido)
268
+ pbi report -p <reportPath> validate
269
+
270
+ # 2. Allowlist + role checks (lo que el CLI no detecta)
271
+ node <skillBundleDir>/scripts/validate-pbir.js <reportPath>
272
+
273
+ # 3. Apertura real en Desktop standalone (final sanity — la única que garantiza 0 "objeto visual personalizado")
274
+ powershell -Command "Start-Process -FilePath 'C:\Program Files\Microsoft Power BI Desktop\bin\PBIDesktop.exe' -ArgumentList '\"<abs-path-to.pbip>\"'"
275
+ ```
276
+
277
+ La validación 2 es la que reemplaza la confianza perdida en el CLI (ver SKILL.md → "Why this skill writes PBIR with Node scripts, not the pbi CLI").
278
+
279
+ ---
280
+
281
+ ## Agregar un tipo nuevo
282
+
283
+ Si PBI Desktop introduce un visualType nuevo (o encontrás uno nativo que falta aquí):
284
+
285
+ 1. Generar un visual.json de referencia:
286
+ - Preferido: copiarlo de un .pbip real exportado por Desktop.
287
+ - Alternativo: usar `pbi visual add --type <X>` sobre un scratch `.Report` (si el CLI lo acepta) y copiar la shape del `query.queryState` resultante.
288
+
289
+ 2. Agregar entrada en `scripts/create-visual.js` → `NATIVE_VISUAL_TYPES`:
290
+
291
+ ```js
292
+ myNewChart: {
293
+ description: '…',
294
+ roles: {
295
+ Category: { kind: 'column', required: true, multi: false },
296
+ Y: { kind: 'measure', required: true, multi: true },
297
+ // …
298
+ },
299
+ },
300
+ ```
301
+
302
+ 3. Agregar fila a la tabla de arriba en este doc.
303
+
304
+ 4. `npm run build:plugin` para regenerar `skills/...` y `commands/...`.
305
+
306
+ 5. Agregar tests en `src/content/skills/report-design/scripts/create-visual.test.js` (roles required, shape generado, error case).
307
+
308
+ 6. Re-correr `npm test` + `npm run lint`.
309
+
310
+ ---
311
+
312
+ ## Features de `visual.json` que `create-visual.js` NO soporta todavía
313
+
314
+ Descubiertos al regenerar la smoke-test "Galería de Visuales" end-to-end con el script (backlog item 2, cycle v4.1). No bloquean el authoring — la shape que emite el script pasa `pbi report validate` y `validate-pbir.js` — pero sí dejan regresiones visuales si el `visual.json` hand-written aprovechaba alguno de estos features:
315
+
316
+ 1. **`query.sortDefinition`** — sort explícito por medida/columna con dirección. `create-visual.js` no lo emite, así que un visual "ranking" tipo barChart ordenado descendente por una medida pierde el orden en la regeneración. **Workaround**: ordenar en Desktop manualmente después del `.pbip` abrir, o hand-extender el `visual.json` con `sortDefinition` post-creación. **Fix futuro**: `--sort-by "Role:Field" --sort-dir descending` en `create-visual.js`.
317
+
318
+ 2. **Textbox con tamaños custom (`fontSize`)** — el shortcut `--title TEXT --description TEXT` emite 19pt para el título y 10.5pt para el cuerpo, fijo. No hay flags para personalizar. Si necesitás una sección de 13pt o un callout de 28pt, perdés la jerarquía visual al regenerar. **Workaround**: usar `--paragraph` en vez de `--title/--description` (paragraphs planos sin estilado), y editar manualmente después si hace falta. **Fix futuro**: `--title-size 13pt --body-size 9pt` en el textbox shortcut.
319
+
320
+ 3. **`queryState.<Role>.projections[].active`** — las columnas siempre salen con `active: true`, las medidas nunca. Si un visual hand-written tenía `active: true` en una medida (para indicar que la medida es la "default Y") o `active: false` en una columna (hidden projection), el script normaliza. Rara vez significativo para el render pero cambia el shape JSON.
321
+
322
+ 4. **Formato condicional**: colores signados (positivo verde / negativo rojo), gradientes en matriz, data bars en tabla. Ninguno de estos expresa shape via `create-visual.js`. Quedó deferido a v4.1+ en `SKILL.md` PHASE 4.3.
323
+
324
+ Cualquier cambio en el script que cubra estos gaps debe: (a) agregar el flag a `parseArgs`, (b) cubrirlo con tests en `create-visual.test.js`, (c) documentarlo en este archivo, (d) regenerar la Galería para que ejercite el feature.
325
+
326
+ ---
327
+
328
+ ## Lo que este skill YA no hace via CLI
329
+
330
+ El plugin migró de `pbi-cli-tool` (MinaSaad1, upstream) a scripts Node propios para authoring PBIR, por 3 regresiones conocidas del CLI:
331
+
332
+ 1. **`pbi report set-theme`** escribe shape inválida → `apply-theme.js` la reemplaza.
333
+ 2. **`pbi visual add --type`** advertiza 5 tipos (acepta ~20 sin anunciarlos, y acepta tipos no nativos como `stackedBarChart`) → `create-visual.js` la reemplaza con allowlist explícita.
334
+ 3. **`pbi report validate`** pasa `valid: True` con tipos no nativos → `validate-pbir.js` la complementa.
335
+
336
+ Lo que el CLI SÍ sigue aportando (y no hay plan de reemplazar):
337
+
338
+ - `pbi connect` + `pbi measure list` + `pbi table list` + `pbi column list` — model introspection via XMLA endpoint. Requiere Analysis Services client libraries (pywin32), difícil de reimplementar en Node puro. Microsoft Modeling MCP cubre esta necesidad mejor — preferir ese cuando esté disponible.
339
+ - `pbi disconnect` — limpia la conexión XMLA después de las operaciones de modelo.
340
+
341
+ Los demás subcomandos (`report add-page`, `visual add/bind/update/delete`, `report validate`) están siendo reemplazados progresivamente.
@@ -0,0 +1,87 @@
1
+ # Power BI Desktop installation — standalone vs Microsoft Store
2
+
3
+ This skill **requires the standalone (installer) version of Power BI Desktop**, not the Microsoft Store version. Both look identical when running, but they behave differently for automation.
4
+
5
+ ## Why standalone is mandatory for this skill
6
+
7
+ The Microsoft Store version sandboxes file access and command-line arguments. When the skill tries to relaunch Desktop with the `.pbip` path:
8
+
9
+ ```bash
10
+ Start-Process -FilePath "...\pbidesktop.exe" -ArgumentList "<path>"
11
+ ```
12
+
13
+ the Store version rejects it with **"No se puede iniciar Power BI Desktop — Error al analizar los argumentos de la línea de comandos"**. The standalone installer build accepts the same call without issues.
14
+
15
+ ## Why standalone is also recommended for daily BI work
16
+
17
+ The "External Tools" tab in PBI Desktop only registers tools when they can write to a known install location. The Microsoft Store version blocks third-party writes to its app folder, so these tools **do not appear** under the External Tools ribbon when only the Store version is installed:
18
+
19
+ - **Tabular Editor 2 / 3** — semantic model editing, batch operations, scripting
20
+ - **DAX Studio** — DAX query analysis, performance tuning, server timings
21
+ - **ALM Toolkit** — schema diff and deploy across model versions
22
+ - **Bravo for Power BI** — model documentation and Best Practice Analyzer
23
+ - **Measure Killer** — find unused measures and columns
24
+ - **VertiPaq Analyzer** — model size and column cardinality reports
25
+
26
+ If you write DAX professionally or care about model performance, you eventually need at least one of these. The standalone installer build is the only one that integrates with all of them out of the box.
27
+
28
+ Other reasons agents prefer standalone:
29
+ - **Update control** — Store auto-updates can break workflows mid-session. Installer updates are explicit downloads.
30
+ - **Stable install path** — `C:\Program Files\Microsoft Power BI Desktop\bin\PBIDesktop.exe` doesn't change between versions. The Store path includes a versioned package ID that breaks scripts on every update.
31
+ - **Better logging** — Crash logs and traces are written to a predictable location (`%LOCALAPPDATA%\Microsoft\Power BI Desktop\Traces`) instead of the Store sandbox.
32
+
33
+ ## Detection — what the skill checks in PHASE 0
34
+
35
+ ```powershell
36
+ $standalone = "C:\Program Files\Microsoft Power BI Desktop\bin\PBIDesktop.exe"
37
+ $store = Get-ChildItem "C:\Program Files\WindowsApps" -Directory -ErrorAction SilentlyContinue |
38
+ Where-Object { $_.Name -like "Microsoft.MicrosoftPowerBIDesktop_*" }
39
+
40
+ $hasStandalone = Test-Path $standalone
41
+ $hasStore = $null -ne $store
42
+ ```
43
+
44
+ | `$hasStandalone` | `$hasStore` | Action |
45
+ |---|---|---|
46
+ | ✅ | ❌ | Continue. Use `$standalone` for all launches. |
47
+ | ✅ | ✅ | Continue, but warn: Store install can interfere if launched manually. Recommend uninstall. |
48
+ | ❌ | ✅ | **Stop.** Walk user through standalone install + Store uninstall. |
49
+ | ❌ | ❌ | **Stop.** Walk user through standalone install. |
50
+
51
+ ## Install standalone (when missing)
52
+
53
+ 1. **Download the standalone installer**: https://www.microsoft.com/en-us/download/details.aspx?id=58494
54
+ - Pick **PBIDesktopSetup_x64.exe** (64-bit, what almost everyone needs). Microsoft currently ships this as an `.exe` wrapper; `aka.ms/pbiSingleInstaller` redirects there.
55
+ - Direct shortcut: https://aka.ms/pbiSingleInstaller
56
+ 2. Run the installer with default options.
57
+ 3. Verify:
58
+ ```powershell
59
+ Test-Path "C:\Program Files\Microsoft Power BI Desktop\bin\PBIDesktop.exe"
60
+ # Should print: True
61
+ ```
62
+
63
+ ## Uninstall the Microsoft Store version (after standalone is installed)
64
+
65
+ Recommended even if you keep both — having only the standalone version eliminates ambiguity for the OS file association and external tools.
66
+
67
+ **Option A — Settings UI:**
68
+ - `Settings → Apps → Installed apps → Microsoft Power BI Desktop → ⋯ → Uninstall`
69
+
70
+ **Option B — PowerShell (one command):**
71
+ ```powershell
72
+ Get-AppxPackage *PowerBIDesktop* | Remove-AppxPackage
73
+ ```
74
+
75
+ After uninstall, log out and log back in (or restart) so Windows refreshes the file association for `.pbip` / `.pbix` files. The standalone version then becomes the default opener.
76
+
77
+ ## Recommended canonical path
78
+
79
+ Once installed, the skill always launches Desktop via:
80
+
81
+ ```powershell
82
+ Start-Process `
83
+ -FilePath "C:\Program Files\Microsoft Power BI Desktop\bin\PBIDesktop.exe" `
84
+ -ArgumentList "`"<full-path-to.pbip>`""
85
+ ```
86
+
87
+ Note the escaped inner quotes — paths with spaces (e.g. user folders, OneDrive sync folders) require the inner string to be quoted, otherwise PBI Desktop parses the path as multiple arguments and shows the "Error al analizar argumentos" dialog.
@@ -0,0 +1,40 @@
1
+ # PBIR Preview Activation
2
+
3
+ The Power BI Enhanced Report (PBIR) format is a Public Preview feature as of 2025–2026. It must be activated in Power BI Desktop before `/report-design` can write report files.
4
+
5
+ ## How to check if it's already active
6
+
7
+ If the project has a `pbip-files/{projectName}.Report/definition/` folder with files like `report.json`, `version.json`, and a `pages/` subfolder — PBIR is active.
8
+
9
+ If the `.Report/` folder is missing or contains a single `report.json` file with a lot of binary-looking content at the root (no `definition/` subfolder), PBIR is NOT active.
10
+
11
+ ## How to activate it
12
+
13
+ Ask the user to follow these steps in Power BI Desktop:
14
+
15
+ 1. **File → Options and settings → Options**
16
+ 2. In the left sidebar, select **Preview features**
17
+ 3. Check **"Power BI Project (.pbip) save format — Store report using enhanced metadata format (PBIR)"**
18
+ 4. Click **OK**
19
+ 5. **Close and reopen** Power BI Desktop for the change to take effect
20
+ 6. Re-open the `.pbip` file
21
+ 7. **File → Save** — this rewrites the file in PBIR format, creating the `definition/` folder structure
22
+
23
+ Then verify by listing the folder:
24
+
25
+ ```
26
+ pbip-files/{projectName}.Report/
27
+ ├── definition.pbir
28
+ ├── definition/
29
+ │ ├── version.json
30
+ │ ├── report.json
31
+ │ └── pages/
32
+ │ └── pages.json
33
+ └── StaticResources/
34
+ ```
35
+
36
+ Once that structure exists, `/report-design` can proceed.
37
+
38
+ ## Warning to surface to the user
39
+
40
+ PBIR is in Public Preview. Microsoft can change the schema between Power BI Desktop releases. If `/report-design` suddenly stops producing files that render, update the plugin: `super upgrade`. We keep the plugin in sync with PBIR schema changes while the feature is in preview.
@@ -0,0 +1,89 @@
1
+ # Slicer visuals — manual JSON write (CLI exception)
2
+
3
+ The `pbi-cli-tool` does not support `pbi visual add --type slicer`. The only valid `--type` values are `card`, `line_chart`, `bar_chart`, `table`, `matrix`. For slicers, the skill writes the visual.json directly — this is a **documented exception to MANDATORY RULE 2** ("never write visual.json by hand").
4
+
5
+ Verified against PBIR schema 2.7.0. The 5 most common modes are tested live in `examples/smoke-test/pbip-files/super-test.Report/definition/pages/theme/visuals/slicer_*` — all render correctly in standalone PBI Desktop 2.152.x.
6
+
7
+ ## Slicer modes
8
+
9
+ | Mode | UX in Desktop | When to use |
10
+ |---|---|---|
11
+ | List vertical (Basic) | Checkboxes apilados verticalmente | Default; 5–15 valores; user ve todas las opciones |
12
+ | List horizontal (Tile) | Botones en fila horizontal | 3–7 categorías cortas; ahorra espacio vertical (tabs-like) |
13
+ | Dropdown | Lista colapsada en dropdown | 50+ valores o cuando importa ahorrar espacio |
14
+ | Between (range) | Slider de rango con dos controles | Fechas o columnas numéricas; permite zoom a un período |
15
+ | Relative date | "Últimos N días/semanas/meses" | Dashboards en producción que siempre muestran "lo más reciente" |
16
+
17
+ ## Schema (common shape)
18
+
19
+ ```json
20
+ {
21
+ "$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
22
+ "name": "<visualName>",
23
+ "position": { "x": 16, "y": 16, "z": 0, "width": 540, "height": 360, "tabOrder": 26 },
24
+ "visual": {
25
+ "visualType": "slicer",
26
+ "query": {
27
+ "queryState": {
28
+ "Values": {
29
+ "projections": [
30
+ {
31
+ "field": {
32
+ "Column": {
33
+ "Expression": { "SourceRef": { "Entity": "<TableName>" } },
34
+ "Property": "<ColumnName>"
35
+ }
36
+ },
37
+ "queryRef": "<TableName>.<ColumnName>",
38
+ "nativeQueryRef": "<ColumnName>",
39
+ "active": true
40
+ }
41
+ ]
42
+ }
43
+ }
44
+ },
45
+ "objects": {
46
+ "data": [{ "properties": { "mode": { "expr": { "Literal": { "Value": "'<MODE>'" } } } } }],
47
+ "general": [{ "properties": { "orientation": { "expr": { "Literal": { "Value": "<N>" } } } } }]
48
+ },
49
+ "drillFilterOtherVisuals": true
50
+ }
51
+ }
52
+ ```
53
+
54
+ ## Mode → property values
55
+
56
+ | Mode | `data.mode` Value | `general.orientation` Value |
57
+ |---|---|---|
58
+ | List vertical | `'Basic'` | `1` |
59
+ | List horizontal (Tile) | `'Basic'` | `2` |
60
+ | Dropdown | `'Dropdown'` | (omit `general` block) |
61
+ | Between (numeric/date) | `'Between'` | (omit `general` block) |
62
+ | Relative date | `'Relative'` | (omit `general` block) |
63
+
64
+ For Dropdown / Between / Relative, omit the `general.orientation` block entirely — just `data` under `objects`.
65
+
66
+ ## Field semantics
67
+
68
+ - The single field goes under the **`Values`** data role (not `Category` like bar/line charts).
69
+ - For **column-based slicers** (the common case): use the `Column` projection structure shown above.
70
+ - For **measure-based slicers**: replace `Column` with `Measure` and adjust `queryRef` / `nativeQueryRef`. Rare — slicers usually filter on dim columns.
71
+ - `position.z = 0`: same plane as data visuals (slicers are interactive, not overlays).
72
+
73
+ ## Pitfalls
74
+
75
+ - For a **Between** slicer the column must be a real date or numeric column — `Transacciones[Monto]` works as a measure but not as a slicer between-range field. Use a plain numeric/date column.
76
+ - For **Relative date** mode the column must be a date type. PBI parses "last N units" relative to system time on the viewing machine.
77
+ - **Tile/Horizontal** with too many values overflows; PBI adds a horizontal scroll. Consider Dropdown for >7 values.
78
+ - After every slicer write, run `pbi report -p "<reportPath>" validate` AND verify Desktop opens the .pbip without error.
79
+
80
+ ## Pattern the skill uses
81
+
82
+ ```bash
83
+ mkdir -p "<reportPath>/definition/pages/<pageName>/visuals/<visualName>"
84
+ cat > "<reportPath>/definition/pages/<pageName>/visuals/<visualName>/visual.json" <<'EOF'
85
+ { ...substituted body from the schema above... }
86
+ EOF
87
+ ```
88
+
89
+ A reusable helper script (`scripts/write-slicer.sh`) is a v4.1 candidate; v4.0.0 ships with the heredoc pattern.
@@ -0,0 +1,101 @@
1
+ # Textbox visuals — manual JSON write (CLI exception)
2
+
3
+ The `pbi-cli-tool` does not support `pbi visual add --type textbox`. The only valid `--type` values are `card`, `line_chart`, `bar_chart`, `table`, `matrix`. For textboxes, the skill writes the visual.json directly — this is a **documented exception to MANDATORY RULE 2** ("never write visual.json by hand").
4
+
5
+ Verified against PBIR schema 2.7.0. Tested live in `examples/smoke-test/pbip-files/super-test.Report/definition/pages/theme/visuals/txt_*` — all render correctly in standalone PBI Desktop 2.152.x (March 2026 release).
6
+
7
+ ## Schema
8
+
9
+ The textbox lives at `<reportPath>/definition/pages/<pageName>/visuals/<visualName>/visual.json`:
10
+
11
+ ```json
12
+ {
13
+ "$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
14
+ "name": "<visualName>",
15
+ "position": {
16
+ "x": 16,
17
+ "y": 16,
18
+ "z": 1,
19
+ "width": 692,
20
+ "height": 80,
21
+ "tabOrder": 5
22
+ },
23
+ "visual": {
24
+ "visualType": "textbox",
25
+ "objects": {
26
+ "general": [
27
+ {
28
+ "properties": {
29
+ "paragraphs": [
30
+ {
31
+ "textRuns": [
32
+ {
33
+ "value": "Title text here",
34
+ "textStyle": {
35
+ "fontSize": "28pt",
36
+ "fontWeight": "bold"
37
+ }
38
+ }
39
+ ]
40
+ },
41
+ {
42
+ "textRuns": [{ "value": "" }]
43
+ },
44
+ {
45
+ "textRuns": [
46
+ {
47
+ "value": "Body description text.",
48
+ "textStyle": { "fontSize": "14pt" }
49
+ }
50
+ ]
51
+ }
52
+ ]
53
+ }
54
+ }
55
+ ]
56
+ }
57
+ }
58
+ }
59
+ ```
60
+
61
+ ## Field semantics
62
+
63
+ - `position.z = 1`: above other visuals on the page (data visuals default to `z = 0`).
64
+ - `position.tabOrder`: sequential per page; bump for each visual to keep tab navigation predictable.
65
+ - `objects.general[0].properties.paragraphs[]`: array of paragraphs — each becomes one display line.
66
+ - Each paragraph contains `textRuns[]` — concatenated in order; each can carry its own `textStyle`.
67
+ - An **empty paragraph** (`textRuns: [{ "value": "" }]`) inserts a blank line between paragraphs.
68
+ - `textStyle` keys we've validated: `fontSize` ("8pt"–"40pt"), `fontWeight` ("bold"). Color, italic, underline likely supported but not tested.
69
+
70
+ ## Common pitfalls
71
+
72
+ These are caught by **PBI Desktop on load**, NOT by `pbi report validate`:
73
+
74
+ - **Do NOT use `vcObjects`** — the CLI validator accepts it, but Desktop rejects with `Property 'vcObjects' has not been defined and the schema does not allow additional properties`. Use `objects` (no `vc` prefix).
75
+ - **Do NOT JSON-encode the paragraphs as a string in `expr.Literal.Value`**. The `paragraphs` field is a real array, not a serialized string.
76
+ - After every textbox write, always run `pbi report -p "<reportPath>" validate` AND verify Desktop opens the .pbip without error. CLI validate alone is insufficient.
77
+
78
+ ## Pattern the skill uses
79
+
80
+ In PHASE 4, after the data visuals are added via CLI, write each textbox via heredoc:
81
+
82
+ ```bash
83
+ mkdir -p "<reportPath>/definition/pages/<pageName>/visuals/<visualName>"
84
+ cat > "<reportPath>/definition/pages/<pageName>/visuals/<visualName>/visual.json" <<'EOF'
85
+ {
86
+ "$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
87
+ "name": "<visualName>",
88
+ "position": {"x": 16, "y": 16, "z": 1, "width": 692, "height": 80, "tabOrder": 5},
89
+ "visual": {
90
+ "visualType": "textbox",
91
+ "objects": {
92
+ "general": [{"properties": {"paragraphs": [
93
+ {"textRuns": [{"value": "Title", "textStyle": {"fontSize": "28pt", "fontWeight": "bold"}}]}
94
+ ]}}]
95
+ }
96
+ }
97
+ }
98
+ EOF
99
+ ```
100
+
101
+ A reusable helper script (`scripts/write-textbox.sh`) is a v4.1 candidate; v4.0.0 ships with the heredoc pattern.