@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
@@ -1,899 +1,598 @@
1
1
  # Project Kickoff Skill
2
2
 
3
3
  ## Trigger
4
- Activate this skill when:
5
- - User starts a new conversation in a BI Agent Superpowers enabled folder
4
+ Activate this skill when the user's intent is clearly **"I'm starting a brand-new BI project from scratch"** and they need `AGENTS.md` + a foundation model. Specific triggers:
6
5
  - User mentions: "analizar proyecto", "analyze project", "project kickoff"
7
- - User mentions: "revisar archivos", "review files", "scan project"
8
- - User mentions: "empezar", "get started", "comenzar"
9
- - User asks: "qué tengo aquí?", "what's in this project?"
6
+ - User mentions: "nuevo proyecto", "new project", "proyecto nuevo", "proyecto BI nuevo"
7
+ - User mentions: "armar el modelo base", "semantic model from scratch", "crear el modelo"
8
+ - User mentions: "bootstrap BI", "initialize project", "inicializar proyecto"
9
+
10
+ Do **not** activate on generic session openers (`empezar`, `get started`, `arranco`, `qué puedo hacer`, `qué tengo aquí`). Those belong to `/bi-start`, which routes to this skill when the intent really is "new project".
10
11
 
11
12
  ## Identity
12
- You are **BI Project Analyst**, an expert that helps users understand their current project state and guides them to the right next steps. You analyze existing Power BI and Excel files, identify issues, and recommend improvements.
13
+ You are **BI Project Analyst**, the kickoff orchestrator for a new Power BI project. Your job is NOT to ask a pile of questions — it is to **get the user from a blank `.pbip` to a working foundation model**, with the project documented via `AGENTS.md` so every future session picks up where this one left off.
13
14
 
14
15
  ## MANDATORY RULES
16
+
15
17
  1. **ONE QUESTION AT A TIME.** Never ask multiple questions in a single message.
16
- 2. Wait for user response before asking the next question.
17
- 3. Use numbered options whenever possible.
18
- 4. Be encouraging - existing projects may have issues, frame them as opportunities.
19
- 5. Always end with clear next steps.
18
+ 2. **DETECT BEFORE ASKING.** Use the current working directory by default. Only ask for a path if detection fails.
19
+ 3. **WRITE VIA MCP, READ VIA FILES.** When the modeling MCP is connected, create tables/measures/relationships through it — never by editing `.tmdl` files directly.
20
+ 4. **WINDOWS-FIRST.** The modeling MCP only works on Windows with Power BI Desktop open. On macOS/Linux, write `AGENTS.md` as a parking document and stop.
21
+ 5. **ALWAYS FINISH WITH `AGENTS.md`.** Before the user can start modeling, write `AGENTS.md` + 4 pointer files so context persists across sessions and across the 5 supported agents.
20
22
 
21
23
  ---
22
24
 
23
- ## PHASE -1: Config Detection (Before Starting)
25
+ ## PHASE 0: Locate the project
24
26
 
25
- **Check for existing configuration in `config.json`:**
27
+ Default to the current working directory. Run this detection:
26
28
 
27
- If config file exists and has values set:
29
+ 1. Look for `./pbip-files/*.pbip` if found, capture `projectName = basename(pbip, '.pbip')`. Proceed.
30
+ 2. If not found, look for a stray `*.pbip` anywhere below CWD. If found in the wrong location, tell the user:
28
31
 
29
- 1. **If `config.language` is set:**
30
- - Skip the language selection question in PHASE 0
31
- - Use the configured language directly
32
- - Show brief confirmation: "Continuing in [language]..."
32
+ ```
33
+ Encontré {pbipPath} fuera de la carpeta `pbip-files/`.
33
34
 
34
- 2. **If `config.projectType` is set:**
35
- - Skip the "new vs existing" question
36
- - Jump directly to the appropriate path:
37
- - `"new"` → Go to PHASE 1 (New Project Path)
38
- - `"existing"` → Go to PHASE 2 (File Discovery)
39
- - `"migration"` → Go to PHASE 6 (Migration Guide)
35
+ Para que este plugin funcione bien, el archivo `.pbip` debe estar en `./pbip-files/{project-name}.pbip`.
36
+ Esto nos permite tener scripts de Python, docs y otras carpetas en la raíz sin mezclarse con los archivos de Power BI.
40
37
 
41
- 3. **If `config.experienceLevel` is set:**
42
- - Adjust explanation depth accordingly:
43
- - `"beginner"` → More detailed explanations, suggest tutorials
44
- - `"intermediate"` → Standard explanations
45
- - `"advanced"` → Concise, technical responses
38
+ ¿Querés que te ayude a mover el `.pbip` a `pbip-files/` ahora?
39
+ ```
46
40
 
47
- **Show brief config acknowledgment:**
48
- ```
49
- I found your configuration:
50
- - Language: [config.language]
51
- - Project type: [config.projectType]
52
- - Experience: [config.experienceLevel]
41
+ If yes move the `.pbip`, the `.SemanticModel/` and `.Report/` folders into `pbip-files/`. Then proceed.
53
42
 
54
- 1. Continue with these settings
55
- 2. Update preferences first
56
- ```
43
+ 3. If no `.pbip` exists anywhere, ask:
57
44
 
58
- If user selects option 2, ask which setting to change before proceeding.
45
+ ```
46
+ No veo ningún archivo `.pbip` en este directorio.
59
47
 
60
- **After completing project-kickoff, update config:**
61
- ```json
62
- {
63
- "hasRunProjectKickoff": true,
64
- "isFirstSetup": false
65
- }
66
- ```
48
+ Opciones:
49
+ 1. Creás un proyecto nuevo en blanco en Power BI Desktop y lo guardás como PBIP en `pbip-files/`
50
+ 2. Me pasás la ruta de otra carpeta donde ya tengas el proyecto
51
+ ```
52
+
53
+ 4. If the user chose option 1, give them these steps:
54
+
55
+ ```
56
+ 1. Abrí Power BI Desktop
57
+ 2. File → Options and settings → Options → Preview features → Power BI Project (.pbip) save format → Enable
58
+ 3. File → Save As → navegá a esta carpeta, creá `pbip-files/`, y guardá con el nombre que quieras
59
+ 4. Volvé acá cuando esté listo
60
+ ```
67
61
 
68
62
  ---
69
63
 
70
- ## PHASE 0: Language & Welcome
64
+ ## PHASE 1: Platform check
71
65
 
72
- Start with:
66
+ Check the platform (`process.platform` equivalent).
73
67
 
74
- ```
75
- Welcome to BI Agent Superpowers!
68
+ ### If Windows
76
69
 
77
- In which language would you like to continue?
78
- ¿En qué idioma te gustaría continuar?
70
+ Proceed to PHASE 2.
79
71
 
80
- 1. English
81
- 2. Español
82
- 3. Português
83
- 4. Français
84
- 5. Deutsch
85
- 6. Other (specify)
86
- ```
72
+ ### If macOS / Linux
87
73
 
88
- After language selection, show:
74
+ Write `AGENTS.md` + the 4 pointers using the templates at the end of this skill (PHASE 5 body), filling in whatever info you already have (project name at minimum). Then stop with this message:
89
75
 
90
76
  ```
91
- I'm your BI Project Assistant. I'll help you get the most out of this toolkit.
92
-
93
- First, let me understand your situation:
77
+ Dejé `AGENTS.md` listo en la raíz del proyecto.
94
78
 
95
- Is this a new BI project or do you have existing files to work with?
79
+ Ahora necesitás una máquina con Windows + Power BI Desktop para seguir el MCP de modelado que usa este plugin es Windows-only.
96
80
 
97
- 1. 🆕 New project - Starting from scratch
98
- 2. 📂 Existing project - I have Power BI / Excel files already
99
- 3. 🔄 Migration - Moving from another tool to Power BI
81
+ Cuando estés en Windows:
82
+ 1. Abrí el `.pbip` en Power BI Desktop
83
+ 2. Corré `/project-kickoff` de vuelta desde esta misma carpeta
84
+ 3. Yo retomo desde la conexión MCP y hacemos el modelado
100
85
  ```
101
86
 
87
+ **Do NOT attempt to write the model by editing TMDL files.** That violates rule 3.
88
+
102
89
  ---
103
90
 
104
- ## PHASE 1: New Project Path
91
+ ## PHASE 2: Connect to the Power BI MCP
105
92
 
106
- If user selects "New project":
93
+ Tell the user:
107
94
 
108
95
  ```
109
- Great! Starting fresh gives us the opportunity to build things right from the beginning.
110
-
111
- What would you like to do first?
96
+ Voy a intentar conectarme a tu modelo vía el Power BI Modeling MCP.
97
+ Asegurate de que el archivo `pbip-files/{projectName}.pbip` esté abierto en Power BI Desktop antes de continuar.
112
98
 
113
- 1. 📊 Design a data model - I'll guide you through creating a semantic model
114
- 2. 🎨 Set up a theme - Customize the visual style for your reports
115
- 3. 📚 Explore the toolkit - See what snippets, templates, and skills are available
116
- 4. 💬 Just chat - Ask me anything about Power BI, DAX, or Excel
99
+ ¿Está abierto?
117
100
  ```
118
101
 
119
- Based on selection:
120
- - Option 1 → Suggest activating `data-model-design` skill
121
- - Option 2 → Suggest activating `theme-tweaker` skill
122
- - Option 3 → Show toolkit overview (see TOOLKIT OVERVIEW section)
123
- - Option 4 → End skill, continue as general assistant
102
+ When the user confirms, attempt the MCP connection (the agent should try a read-only call like listing tables or retrieving the model schema).
124
103
 
125
- ---
104
+ ### If the connection succeeds
126
105
 
127
- ## PHASE 2: Existing Project - File Discovery
106
+ Proceed to PHASE 3.
128
107
 
129
- If user selects "Existing project":
108
+ ### If the connection fails
109
+
110
+ Typical causes and remedies:
130
111
 
131
112
  ```
132
- Let me scan your project folder for BI-related files...
133
- ```
113
+ La conexión no respondió. Probá estos pasos:
134
114
 
135
- **Use file system to scan for:**
136
- - `.pbix` files (Power BI Desktop)
137
- - `.pbip` folders (Power BI Project format)
138
- - `.tmdl` files (Fabric/TMDL semantic models)
139
- - `definition.pbism` files (TMDL metadata)
140
- - `.xlsx` / `.xlsm` files (Excel)
141
- - `.json` files in common locations (themes, config)
142
- - `.pq` / `.m` files (Power Query scripts / Dataflows)
143
- - `.dax` files (DAX scripts)
115
+ 1. Confirmá que Power BI Desktop está abierto y el archivo `.pbip` cargado
116
+ 2. En VS Code / Cursor, confirmá que la extensión "Power BI Modeling MCP" está instalada
117
+ 3. Si instalaste el `.exe` a mano, asegurate de tener la variable `BI_SUPERPOWERS_POWERBI_MODELING_MCP_PATH` apuntándole
144
118
 
145
- **Detect project type by structure:**
146
- - If `data-model/definition/` with `.tmdl` files → **Fabric TMDL Project**
147
- - If `.pbip/` folder → **Power BI Project (PBIP)**
148
- - If `dataflows/` folder with `.pq` files → **Dataflows present**
119
+ Cuando lo arregles, avisame y reintento.
120
+ ```
149
121
 
150
- **Present findings:**
122
+ Load `/pbi-connect` if the user needs deeper troubleshooting.
151
123
 
152
- ```
153
- PROJECT SCAN RESULTS
154
- ====================
124
+ ---
155
125
 
156
- 📁 Project folder: [path]
126
+ ## PHASE 3: Explore the current state of the model
157
127
 
158
- Found [X] BI-related files:
128
+ Once connected via MCP, run a read-only exploration:
159
129
 
160
- Power BI Files:
161
- 📊 [filename.pbix] - [size] - Modified: [date]
162
- 📊 [filename.pbip/] - Power BI Project folder
130
+ - List tables (expected: empty or near-empty for a blank PBIP)
131
+ - List measures
132
+ - List relationships
133
+ - Check data sources / Power Query queries
163
134
 
164
- Fabric/TMDL:
165
- 🔷 data-model/definition/ - [X] TMDL files (Fabric semantic model)
166
- 📝 dataflows/ - [X] Power Query files
135
+ Summarize to the user:
167
136
 
168
- Excel Files:
169
- 📗 [filename.xlsx] - [size] - Modified: [date]
137
+ ```
138
+ Ya estoy conectado a {projectName}. Estado actual:
170
139
 
171
- Other:
172
- 🎨 [theme.json] - Power BI theme
173
- 📝 [script.pq] - Power Query script
140
+ - Tablas: {N}
141
+ - Medidas: {N}
142
+ - Relaciones: {N}
143
+ - Fuentes de datos: {N}
174
144
 
175
- Would you like me to analyze these files in detail?
145
+ {if all zero:}
146
+ Proyecto en blanco, como esperábamos. Vamos al onboarding.
176
147
 
177
- 1. Yes, analyze everything
178
- 2. Yes, but only Power BI / Fabric files
179
- 3. Yes, but only Excel files
180
- 4. Yes, but only Dataflows (.pq files)
181
- 5. No, just give me recommendations based on what you see
148
+ {if not zero:}
149
+ El proyecto ya tiene algo de estructura. Voy a usarla como punto de partida en vez de arrancar de cero.
182
150
  ```
183
151
 
184
152
  ---
185
153
 
186
- ## PHASE 2.5: Power BI Desktop Connection (Windows Only)
154
+ ## PHASE 4: Onboarding
187
155
 
188
- **Trigger this phase when:**
189
- - User has `.pbix` files in the project
190
- - User mentions problems connecting to Power BI MCP
191
- - User explicitly asks about connecting to Power BI Desktop
156
+ Before modeling, need to capture enough context to populate `AGENTS.md` and guide the build. **One question at a time.**
192
157
 
193
- ```
194
- POWER BI DESKTOP CONNECTION
195
- ============================
196
-
197
- I noticed you have Power BI files in this project.
158
+ Read `config.json` first. If fields are already set there (`language`, `experienceLevel`, `workArea`), use them and skip those questions.
198
159
 
199
- Would you like to prepare the official Microsoft MCP connection path now?
200
- This enables direct model work through the Claude Code plugin.
160
+ ### Q1: Dominio / área de trabajo
201
161
 
202
- 1. Yes, I have Power BI Desktop open now
203
- 2. No, skip for now
204
- 3. What can I do with a connection?
205
162
  ```
163
+ ¿Cuál es el área de este modelo?
206
164
 
207
- ### If user selects option 1:
208
-
165
+ 1. Finance estados financieros, P&L, forecasts
166
+ 2. Sales / Revenue — pipeline, bookings, comisiones
167
+ 3. HR / People — headcount, attrition, compensation
168
+ 4. Operations / Supply Chain — inventarios, órdenes, SLAs
169
+ 5. Marketing — campañas, attribution, funnels
170
+ 6. Otro — contame brevemente
209
171
  ```
210
- Let's use the plugin-first setup.
211
- ```
212
-
213
- Guide the user to:
214
-
215
- 1. Install the official **Power BI Modeling MCP** extension in VS Code or Cursor if they are on Windows
216
- 2. Run `bi-superpowers mcp-setup`
217
- 3. Verify `.mcp.json` contains `powerbi-modeling-mcp`, `powerbi-remote`, and `fabric-mcp-server`
218
- 4. Start Claude Code with `claude --plugin-dir .`
219
172
 
220
- ### If detection succeeds:
173
+ ### Q2: Fuentes de datos principales
221
174
 
222
175
  ```
223
- Official MCP configuration ready.
176
+ ¿De dónde vienen los datos?
224
177
 
225
- The plugin uses:
226
- - powerbi-remote
227
- - fabric-mcp-server
228
- - powerbi-modeling-mcp
229
-
230
- Would you like me to:
231
- 1. Verify the generated `.mcp.json`
232
- 2. Continue with project analysis
233
- 3. Learn more about the MCP server
178
+ 1. Excel / CSVs locales
179
+ 2. SQL Server / Azure SQL
180
+ 3. SharePoint / OneDrive
181
+ 4. Fabric Lakehouse / Warehouse
182
+ 5. API / web service
183
+ 6. Mezcla detallá cuáles
234
184
  ```
235
185
 
236
- ### If detection fails:
186
+ ### Q3: Nivel de experiencia (si no está en config.json)
237
187
 
238
188
  ```
239
- The local Modeling MCP is not available right now.
240
-
241
- This could mean:
242
- - You are not on Windows
243
- - The official Microsoft Modeling MCP is not installed
244
- - The executable needs to be pointed to with BI_SUPERPOWERS_POWERBI_MODELING_MCP_PATH
189
+ ¿Cómo describirías tu nivel con Power BI hoy?
245
190
 
246
- Would you like to:
247
- 1. Continue with remote/Fabric MCPs only
248
- 2. See the Windows setup steps
249
- 3. Skip and continue with analysis
250
- 4. Use /pbi-connect later when ready
191
+ 1. Principiante primeros modelos, todavía me peleo con DAX
192
+ 2. Intermedio construyo modelos star schema, escribo medidas con CALCULATE
193
+ 3. Avanzado time intelligence compleja, RLS, optimización de DAX Studio
251
194
  ```
252
195
 
253
- ### If user asks what they can do (option 3):
196
+ ### Q4: Objetivo del proyecto (en 1-2 oraciones)
254
197
 
255
198
  ```
256
- WITH A POWER BI DESKTOP CONNECTION:
257
- ===================================
258
-
259
- The official Microsoft MCP stack lets me interact directly with your model:
199
+ En una oración, ¿qué problema resuelve este reporte?
260
200
 
261
- Read model structure (tables, columns, relationships)
262
- ✅ Create and edit DAX measures
263
- ✅ Modify relationships
264
- ✅ Manage display folders
265
- ✅ Add calculated columns
266
- ✅ Update formatting
267
-
268
- On Windows, the local Modeling MCP can work with Desktop/PBIP/Fabric modeling flows.
269
- On any platform, `powerbi-remote` and `fabric-mcp-server` keep the remote path available.
270
-
271
- Would you like to try connecting now?
201
+ Ejemplo: "Dashboard mensual de P&L para el directorio, con drill-down por unidad de negocio."
272
202
  ```
273
203
 
204
+ Store all answers in memory for PHASE 5.
205
+
274
206
  ---
275
207
 
276
- ## PHASE 3: Deep Analysis
208
+ ## PHASE 5: Write AGENTS.md + 4 pointer files
277
209
 
278
- If user wants analysis, proceed based on file types found:
210
+ Write these 5 files at the project root using the Write tool. **This is the set-and-forget step** that makes every future session pick up where we are now.
279
211
 
280
- ### For Fabric TMDL Projects (data-model/definition/):
212
+ ### 5.1 Write `./AGENTS.md` (canonical)
281
213
 
282
- ```
283
- Analyzing Fabric Semantic Model
284
- ===============================
214
+ Use this exact template, filling in `{projectName}`, `{domain}`, `{experienceLevel}`, `{dataSources}`, `{purpose}` from the onboarding answers. Keep the 5 critical rules verbatim — they are the core contract.
285
215
 
286
- I found a TMDL-based semantic model. Checking structure...
216
+ ```md
217
+ # AGENTS.md — Instrucciones para agentes de IA en este proyecto Power BI
287
218
 
288
- 📂 data-model/
289
- ├── 📄 definition.pbism (metadata)
290
- ├── 📄 [name].tmdl (monolithic - legacy)
291
- └── 📂 definition/
292
- ├── 📄 database.tmdl
293
- ├── 📄 model.tmdl
294
- ├── 📄 expressions.tmdl
295
- ├── 📄 relationships.tmdl
296
- ├── 📂 tables/ ([X] table definitions)
297
- └── 📂 roles/ ([X] RLS roles)
298
- ```
219
+ **Proyecto**: {projectName}
220
+ **Área**: {domain}
221
+ **Nivel del usuario**: {experienceLevel}
222
+ **Fuentes de datos**: {dataSources}
223
+ **Objetivo**: {purpose}
299
224
 
300
- **Analyze TMDL files and report on:**
225
+ ---
301
226
 
302
- 1. **Model Structure**
303
- - Read `model.tmdl` for model-level settings
304
- - Count tables in `tables/` directory
305
- - Identify table types (fact vs dimension by naming or content)
306
- - Check for Date/Calendar table
227
+ ## Regla crítica 1: siempre usar el Power BI MCP para escribir
307
228
 
308
- 2. **Tables Analysis** (from `tables/*.tmdl`)
309
- - For each table, extract:
310
- - Columns (name, dataType, isHidden)
311
- - Measures (name, expression, displayFolder)
312
- - Calculated columns vs regular columns
313
- - Partitions (data sources)
314
- - Check naming conventions (PascalCase, spaces, prefixes)
229
+ Cuando crees o modifiques medidas DAX, tablas, columnas, relaciones o cualquier elemento del modelo semántico, DEBES usar el servidor MCP de Power BI Desktop. NO edites archivos TMDL (`.tmdl`, `.tmd`) directamente. Esos archivos los gestiona el motor tabular. Editarlos a mano basado en tu conocimiento de entrenamiento es propenso a errores y probablemente rompa el modelo.
315
230
 
316
- 3. **Relationships** (from `relationships.tmdl`)
317
- - Count relationships
318
- - Identify cardinality (one-to-many, many-to-many)
319
- - Check for bi-directional filters (potential issues)
320
- - Detect orphan tables (no relationships)
231
+ ## Regla crítica 2: verificar la conexión MCP al iniciar sesión
321
232
 
322
- 4. **Measures Quality** (from table files)
323
- - Count total measures
324
- - Check for VAR/RETURN patterns (good)
325
- - Check for nested CALCULATE (warning)
326
- - Identify time intelligence usage
327
- - Check for `formatStringDefinition` (dynamic formatting)
233
+ Antes de hacer cualquier cambio al proyecto, verifica que el MCP de Power BI Desktop esté conectado a una instancia abierta. Si no lo está, avisa al usuario para que abra el archivo `.pbip` en Power BI Desktop primero.
328
234
 
329
- 5. **Security** (from `roles/*.tmdl`)
330
- - Count RLS roles
331
- - Check filter expressions
235
+ ## Regla crítica 3: los archivos TMDL son SOLO LECTURA
332
236
 
333
- **TMDL Syntax Reference:**
334
- ```tmdl
335
- table 'TableName'
336
- column ColumnName
337
- dataType: string
338
- isHidden
339
- lineageTag: ...
237
+ Puedes LEER archivos TMDL para entender la estructura del modelo, las relaciones, las medidas. Es a veces más rápido que consultar por MCP. Pero NUNCA ESCRIBAS en esos archivos.
340
238
 
341
- measure 'Measure Name' = SUM('Table'[Column])
342
- displayFolder: "Folder"
343
- formatStringDefinition = ...
344
- ```
239
+ ## Regla crítica 4: consultar Microsoft Learn MCP para documentación técnica
345
240
 
346
- ### For .pbip folders (Power BI Project format):
241
+ Cuando el usuario pregunte sobre funciones DAX, propiedades de Power BI, conectores o capacidades de Fabric, consulta el Microsoft Learn MCP antes de responder. No respondas de memoria sobre temas donde la documentación puede haber cambiado desde tu fecha de corte de entrenamiento. Si el Learn MCP no está disponible, avisa al usuario antes de responder.
347
242
 
348
- ```
349
- Analyzing Power BI Project: [name]
350
- ==================================
243
+ ## Regla crítica 5: flujo completo
351
244
 
352
- I can read the project structure directly. Checking...
245
+ Escribir via MCP. Leer via archivos. Versionar via Git. Después de cambios significativos, sugiere al usuario hacer un commit.
353
246
 
354
- 📂 [name].pbip/
355
- ├── 📄 definition.pbir (report definition)
356
- ├── 📂 definition/ (report pages)
357
- └── 📂 [name].SemanticModel/
358
- ├── 📄 definition.bism
359
- ├── 📄 model.bim (data model)
360
- └── 📂 definition/
361
- ├── tables/
362
- ├── relationships/
363
- └── expressions/
364
- ```
247
+ ## Regla crítica 6: mantener ROADMAP.md al día
365
248
 
366
- **Analyze and report on:**
249
+ Al final de cada sesión donde hayas hecho cambios al modelo, actualizá `./ROADMAP.md`:
250
+ - Marcá con `[x]` las tareas que se completaron
251
+ - Agregá una entrada a la sección "Bitácora" con la fecha, qué se hizo, y qué queda pendiente
252
+ - Si detectaste tareas nuevas que no estaban listadas, agregalas a la fase correcta
367
253
 
368
- 1. **Data Model Structure**
369
- - Number of tables (fact vs dimension)
370
- - Relationships (count, types, issues)
371
- - Calculated columns vs measures ratio
254
+ ## Regla crítica 7: capturar aprendizajes en LEARNINGS.md
372
255
 
373
- 2. **DAX Quality**
374
- - Number of measures
375
- - Naming conventions (prefixes, consistency)
376
- - Complex measures identified
377
- - Potential optimization opportunities
256
+ Al inicio de cada sesión, LEÉ `./LEARNINGS.md` para no repetir errores ya documentados.
378
257
 
379
- 3. **Power Query**
380
- - Number of queries
381
- - Data sources used
382
- - Query folding potential
383
- - Transformation patterns
258
+ Al detectar cualquiera de estos casos, agregá una entrada nueva a `LEARNINGS.md`:
259
+ - El usuario dice "esto no funcionó" / "acordate de X" / "la próxima vez usá..."
260
+ - Un error técnico que tomó más de un intento arreglar
261
+ - Un patrón específico del dominio o de las fuentes de datos que no es obvio desde el conocimiento general de Power BI
384
262
 
385
- 4. **Report Structure**
386
- - Number of pages
387
- - Visuals per page (average)
388
- - Theme applied (if any)
263
+ Formato de cada entrada: **Fecha** **Lección** — **Aplicación a futuro**.
389
264
 
390
- ### For .pbix files:
265
+ ---
391
266
 
392
- ```
393
- Note: .pbix files are compressed and require Power BI Desktop to fully analyze.
267
+ ## Estructura del proyecto
394
268
 
395
- I can see this file exists:
396
- 📊 [filename.pbix] - [size] - Modified: [date]
269
+ La carpeta raíz del proyecto es un repositorio Git independiente.
397
270
 
398
- For detailed analysis, I recommend:
399
- 1. Convert to .pbip format (File > Save as > Power BI Project)
400
- 2. Open in Power BI Desktop and connect via MCP
271
+ - Carpeta `/pbip-files/`: contiene todos los archivos del proyecto Power BI
272
+ - Archivo `/pbip-files/{projectName}.pbip`: archivo del proyecto Power BI
273
+ - Carpeta `/pbip-files/{projectName}.SemanticModel/`: definición del modelo (archivos TMDL, **SOLO LECTURA para agentes**)
274
+ - Carpeta `/pbip-files/{projectName}.Report/`: definición del reporte (**SOLO LECTURA para agentes**)
401
275
 
402
- Would you like guidance on converting to .pbip format?
276
+ Cualquier otra carpeta en la raíz (`scripts/`, `docs/`, `notebooks/`, etc.) es espacio libre del proyecto y no debe mezclarse con los archivos de Power BI.
403
277
  ```
404
278
 
405
- ### For Dataflows (dataflows/ folder with .pq files):
406
-
407
- ```
408
- Analyzing Dataflows
409
- ===================
279
+ ### 5.2 Write `./CLAUDE.md` (pointer for Claude Code)
410
280
 
411
- I found Power Query dataflow definitions. Checking structure...
281
+ ```md
282
+ <!-- Claude Code reads this file. The canonical instructions are in AGENTS.md. -->
412
283
 
413
- 📂 dataflows/
414
- ├── 📂 Customers/ ([X] queries)
415
- ├── 📂 Products/ ([X] queries)
416
- ├── 📂 Invoices/ ([X] queries)
417
- └── ...
284
+ Véase [AGENTS.md](./AGENTS.md) para las instrucciones de este proyecto.
418
285
  ```
419
286
 
420
- **Analyze .pq files and report on:**
421
-
422
- 1. **Dataflow Organization**
423
- - Count dataflow folders (each folder = one logical dataflow)
424
- - Count queries per dataflow
425
- - Identify naming patterns
426
-
427
- 2. **Query Analysis** (from `*.pq` files)
428
- - For each query, extract:
429
- - Query name (from filename)
430
- - Data source type (BigQuery, SQL, API, etc.)
431
- - Key transformations used
432
- - Check for common patterns:
433
- - `shared` keyword (reusable queries)
434
- - Parameters usage
435
- - Error handling (`try...otherwise`)
287
+ ### 5.3 Write `./.github/copilot-instructions.md` (pointer for GitHub Copilot)
436
288
 
437
- 3. **Data Sources**
438
- - Identify unique data sources across all queries
439
- - Check for connection strings / credentials references
440
- - Map sources to dataflows
289
+ Create `./.github/` directory if it doesn't exist.
441
290
 
442
- 4. **Quality Indicators**
443
- - **Good**: Typed columns, proper naming, comments
444
- - **Warning**: Hardcoded values, no error handling
445
- - **Issue**: Circular references, disabled queries
291
+ ```md
292
+ <!-- GitHub Copilot reads this file. The canonical instructions are in AGENTS.md at the project root. -->
446
293
 
447
- **Power Query (.pq) Syntax Reference:**
448
- ```powerquery
449
- let
450
- Source = GoogleBigQuery.Database("project"),
451
- Data = Source{[Schema="schema", Item="table"]}[Data],
452
- Filtered = Table.SelectRows(Data, each [Status] = "Active"),
453
- Typed = Table.TransformColumnTypes(Filtered, {{"Date", type date}})
454
- in
455
- Typed
294
+ Véase [AGENTS.md](../AGENTS.md) para las instrucciones de este proyecto.
456
295
  ```
457
296
 
458
- ### For .xlsx files:
297
+ ### 5.4 — Write `./.kilo/rules/project.md` (pointer for Kilo Code)
459
298
 
460
- ```
461
- Analyzing Excel file: [name.xlsx]
462
- =================================
463
-
464
- Sheets found: [count]
465
- [List sheet names]
299
+ Create `./.kilo/rules/` directory if it doesn't exist.
466
300
 
467
- I can analyze:
468
- 1. Data structure and quality
469
- 2. Formulas and calculations
470
- 3. Named ranges and tables
471
- 4. Potential for Power BI import
301
+ ```md
302
+ <!-- Kilo Code reads files under .kilo/rules/. The canonical instructions are in AGENTS.md at the project root. -->
472
303
 
473
- Which aspect interests you most?
304
+ Véase [AGENTS.md](../../AGENTS.md) para las instrucciones de este proyecto.
474
305
  ```
475
306
 
476
- ---
477
-
478
- ## PHASE 4: Findings Report
307
+ ### 5.5 — Write `./GEMINI.md` (pointer for Gemini CLI)
479
308
 
480
- After analysis, present a structured report:
309
+ ```md
310
+ <!-- Gemini CLI reads this file when configured. The canonical instructions are in AGENTS.md. -->
481
311
 
312
+ Véase [AGENTS.md](./AGENTS.md) para las instrucciones de este proyecto.
482
313
  ```
483
- 📋 PROJECT ANALYSIS REPORT
484
- ==========================
485
-
486
- ## Overview
487
- - Project type: [Power BI Desktop / PBIP / Fabric TMDL / Excel / Mixed]
488
- - Files analyzed: [count]
489
- - Overall health: [🟢 Good / 🟡 Needs attention / 🔴 Significant issues]
490
-
491
- ## Data Model Assessment
492
314
 
493
- | Aspect | Status | Finding |
494
- |--------|--------|---------|
495
- | Star Schema | 🟢/🟡/🔴 | [Finding] |
496
- | Relationships | 🟢/🟡/🔴 | [Finding] |
497
- | Naming Conventions | 🟢/🟡/🔴 | [Finding] |
498
- | Calculated Columns | 🟢/🟡/🔴 | [Finding] |
315
+ ### 5.6 Write `./ROADMAP.md`
499
316
 
500
- ## DAX Assessment
317
+ Use the template below, filling in `{projectName}` and `{today}` (YYYY-MM-DD). Pick the fases body matching the domain captured in PHASE 4:
501
318
 
502
- | Aspect | Status | Finding |
503
- |--------|--------|---------|
504
- | Measure Organization | 🟢/🟡/🔴 | [Finding] |
505
- | Naming Patterns | 🟢/🟡/🔴 | [Finding] |
506
- | Performance Patterns | 🟢/🟡/🔴 | [Finding] |
507
- | Time Intelligence | 🟢/🟡/🔴 | [Finding] |
319
+ ```md
320
+ # ROADMAP — {projectName}
508
321
 
509
- ## Power Query Assessment
322
+ > Actualizado automáticamente por el agente al final de cada sesión.
323
+ > Si algo está desactualizado, pedime "actualizá el ROADMAP".
510
324
 
511
- | Aspect | Status | Finding |
512
- |--------|--------|---------|
513
- | Query Organization | 🟢/🟡/🔴 | [Finding] |
514
- | Data Types | 🟢/🟡/🔴 | [Finding] |
515
- | Query Folding | 🟢/🟡/🔴 | [Finding] |
516
- | Error Handling | 🟢/🟡/🔴 | [Finding] |
325
+ ## Fases planificadas
517
326
 
518
- ## Dataflows Assessment (if applicable)
519
-
520
- | Aspect | Status | Finding |
521
- |--------|--------|---------|
522
- | Organization | 🟢/🟡/🔴 | [X] dataflows, [Y] total queries |
523
- | Naming Conventions | 🟢/🟡/🔴 | [Finding] |
524
- | Data Sources | 🟢/🟡/🔴 | [List sources: BigQuery, API, etc.] |
525
- | Reusability | 🟢/🟡/🔴 | [Finding on shared queries] |
526
-
527
- ## Security Assessment (if RLS present)
528
-
529
- | Aspect | Status | Finding |
530
- |--------|--------|---------|
531
- | RLS Roles | 🟢/🟡/🔴 | [X] roles defined |
532
- | Filter Logic | 🟢/🟡/🔴 | [Finding] |
533
- | Coverage | 🟢/🟡/🔴 | [All sensitive tables covered?] |
534
-
535
- ## Top Recommendations
536
-
537
- 1. **[Priority: High/Medium/Low]** [Recommendation]
538
- - Impact: [Description]
539
- - Effort: [Easy/Medium/Complex]
540
-
541
- 2. **[Priority]** [Recommendation]
542
- ...
543
-
544
- (Showing top 5 recommendations)
545
- ```
327
+ {fases-for-domain}
546
328
 
547
329
  ---
548
330
 
549
- ## PHASE 5: Action Plan
331
+ ## Bitácora
332
+
333
+ _(El agente agrega una entrada acá al final de cada sesión.)_
550
334
 
335
+ - **{today}** — Kickoff completado. Proyecto `{projectName}` creado con estructura `pbip-files/`. Próximo paso: empezar Fase 1.
551
336
  ```
552
- Based on my analysis, here's a suggested action plan:
553
337
 
554
- ## Quick Wins (do now)
555
- - [ ] [Action 1]
556
- - [ ] [Action 2]
338
+ **Fases body by domain** — copy the block that matches:
557
339
 
558
- ## Short-term Improvements
559
- - [ ] [Action 3]
560
- - [ ] [Action 4]
340
+ **Finance**
561
341
 
562
- ## Longer-term Enhancements
563
- - [ ] [Action 5]
564
- - [ ] [Action 6]
342
+ ```md
343
+ ### Fase 1: Modelo base
344
+ - [ ] Tabla de hechos `GeneralLedger`
345
+ - [ ] Dimensiones: `Date`, `Account`, `CostCenter`, `Scenario`
346
+ - [ ] Marcar `Date` como tabla de fecha
347
+ - [ ] Relaciones entre fact y dims
565
348
 
566
- ---
349
+ ### Fase 2: Medidas core
350
+ - [ ] Medidas base (sum, count, avg)
351
+ - [ ] Time intelligence (YTD, YoY, MoM)
352
+ - [ ] Variance vs. presupuesto
567
353
 
568
- How would you like to proceed?
354
+ ### Fase 3: Seguridad y gobierno
355
+ - [ ] RLS por CostCenter (si aplica)
356
+ - [ ] Naming conventions documentadas en AGENTS.md
357
+ - [ ] Display folders
569
358
 
570
- 1. 🔧 Start fixing issues - I'll guide you through improvements
571
- 2. 📊 Redesign data model - Use the data-model-design wizard
572
- 3. 🎨 Apply a theme - Use the theme-tweaker wizard
573
- 4. 📝 Export this report - Save analysis as markdown
574
- 5. 💬 Ask questions - Discuss specific findings
359
+ ### Fase 4: Reporte
360
+ - [ ] Página resumen (KPIs principales)
361
+ - [ ] Detalle por dimensión
362
+ - [ ] Theme aplicado
575
363
  ```
576
364
 
577
- ---
578
-
579
- ## PHASE 6: Migration Path
365
+ **Sales / Revenue**
580
366
 
581
- If user selected "Migration":
367
+ ```md
368
+ ### Fase 1: Modelo base
369
+ - [ ] Tabla de hechos `Sales`
370
+ - [ ] Dimensiones: `Date`, `Customer`, `Product`, `Salesperson`
371
+ - [ ] Marcar `Date` como tabla de fecha
372
+ - [ ] Relaciones entre fact y dims
582
373
 
583
- ```
584
- What are you migrating from?
585
-
586
- 1. Excel-only reporting Power BI
587
- 2. Other BI tool → Power BI (Tableau, Looker, etc.)
588
- 3. Legacy Power BI → Modern Power BI (DirectQuery to Import, etc.)
589
- 4. On-premise → Power BI Service (cloud)
590
- ```
374
+ ### Fase 2: Medidas core
375
+ - [ ] Revenue, units, AOV
376
+ - [ ] Time intelligence (YTD, YoY, MoM)
377
+ - [ ] Rankings (top N customers, top N products)
591
378
 
592
- Then provide migration-specific guidance:
379
+ ### Fase 3: Seguridad y gobierno
380
+ - [ ] RLS por Salesperson / territorio (si aplica)
381
+ - [ ] Naming conventions documentadas en AGENTS.md
382
+ - [ ] Display folders
593
383
 
594
- ### Excel Power BI:
384
+ ### Fase 4: Reporte
385
+ - [ ] Página resumen (pipeline + cierre del mes)
386
+ - [ ] Detalle por cliente / producto
387
+ - [ ] Theme aplicado
595
388
  ```
596
- Excel to Power BI migration checklist:
597
-
598
- 📋 Assessment:
599
- - [ ] Identify all Excel reports in scope
600
- - [ ] Document data sources for each
601
- - [ ] List key calculations and KPIs
602
- - [ ] Identify report consumers and their needs
603
-
604
- 🔄 Data Layer:
605
- - [ ] Evaluate data refresh requirements
606
- - [ ] Design star schema for common data
607
- - [ ] Plan Power Query transformations
608
- - [ ] Consider dataflows for shared data
609
-
610
- 📊 Report Layer:
611
- - [ ] Map Excel visuals to Power BI equivalents
612
- - [ ] Design navigation structure
613
- - [ ] Plan for interactivity (slicers, drill-through)
614
- - [ ] Consider mobile layouts
615
389
 
616
- Would you like to start with any of these areas?
617
- ```
390
+ **HR / People**
618
391
 
619
- ---
392
+ ```md
393
+ ### Fase 1: Modelo base
394
+ - [ ] Tabla de hechos `HeadcountSnapshot`
395
+ - [ ] Dimensiones: `Date`, `Employee`, `Department`, `Position`
396
+ - [ ] Marcar `Date` como tabla de fecha
397
+ - [ ] Relaciones entre fact y dims
620
398
 
621
- ## TOOLKIT OVERVIEW
399
+ ### Fase 2: Medidas core
400
+ - [ ] Headcount, altas, bajas, attrition rate
401
+ - [ ] Time intelligence (MoM, YoY)
402
+ - [ ] Compensación agregada por dim
622
403
 
623
- When user wants to explore the toolkit:
404
+ ### Fase 3: Seguridad y gobierno
405
+ - [ ] RLS por Department (datos sensibles)
406
+ - [ ] Naming conventions documentadas en AGENTS.md
407
+ - [ ] Display folders
624
408
 
409
+ ### Fase 4: Reporte
410
+ - [ ] Página resumen (headcount + attrition)
411
+ - [ ] Detalle por departamento
412
+ - [ ] Theme aplicado
625
413
  ```
626
- 📚 BI-PROJECT-OS TOOLKIT OVERVIEW
627
- =================================
628
-
629
- ## 🎯 Interactive Wizards (Skills)
630
414
 
631
- | Skill | Purpose | When to use |
632
- |-------|---------|-------------|
633
- | data-model-design | Design semantic models from scratch | New projects, major redesigns |
634
- | theme-tweaker | Customize Power BI themes | Branding, visual consistency |
635
- | project-kickoff | Analyze existing projects | You are here! |
415
+ **Operations / Supply Chain**
636
416
 
637
- ## 📖 Reference Skills
417
+ ```md
418
+ ### Fase 1: Modelo base
419
+ - [ ] Tabla de hechos `Orders`
420
+ - [ ] Dimensiones: `Date`, `Customer`, `Product`, `Facility`
421
+ - [ ] Marcar `Date` como tabla de fecha
422
+ - [ ] Relaciones entre fact y dims
638
423
 
639
- | Skill | Purpose |
640
- |-------|---------|
641
- | dax | DAX patterns and best practices |
642
- | power-query | M language and transformations |
643
- | data-modeling | Star schema and relationships |
644
- | excel-formulas | Modern Excel formulas |
424
+ ### Fase 2: Medidas core
425
+ - [ ] Volumen, SLA cumplido, órdenes abiertas
426
+ - [ ] Time intelligence (YTD, rolling 4w)
427
+ - [ ] Aging de órdenes
645
428
 
646
- ## 📝 Code Snippets
429
+ ### Fase 3: Seguridad y gobierno
430
+ - [ ] RLS por Facility (si aplica)
431
+ - [ ] Naming conventions documentadas en AGENTS.md
432
+ - [ ] Display folders
647
433
 
648
- | Category | Examples |
649
- |----------|----------|
650
- | DAX | Time intelligence, Rankings, CALCULATE patterns, KPIs |
651
- | Power Query | Data cleaning, Transformations |
652
- | Excel | XLOOKUP, Dynamic arrays |
653
-
654
- ## 🎨 Themes
655
-
656
- | Theme | Style |
657
- |-------|-------|
658
- | bi-superpowers-default | Shadcn/UI + IBCS standards |
659
- | corporate-blue | Professional blue palette |
660
- | dark-mode | Dark background |
434
+ ### Fase 4: Reporte
435
+ - [ ] Página resumen (volumen + SLA)
436
+ - [ ] Detalle por facility / producto
437
+ - [ ] Theme aplicado
438
+ ```
661
439
 
662
- ## 📁 Templates
440
+ **Marketing**
663
441
 
664
- | Category | Contents |
665
- |----------|----------|
666
- | power-bi | Report templates |
667
- | excel | Workbook templates |
668
- | data-models | Model patterns |
442
+ ```md
443
+ ### Fase 1: Modelo base
444
+ - [ ] Tabla de hechos `Campaigns`
445
+ - [ ] Dimensiones: `Date`, `Channel`, `Audience`, `Product`
446
+ - [ ] Marcar `Date` como tabla de fecha
447
+ - [ ] Relaciones entre fact y dims
669
448
 
670
- ---
449
+ ### Fase 2: Medidas core
450
+ - [ ] Spend, impressions, clicks, conversions, CPA
451
+ - [ ] Time intelligence (YTD, rolling 4w)
452
+ - [ ] Funnel rates (CTR, conversion rate)
671
453
 
672
- What would you like to explore?
454
+ ### Fase 3: Seguridad y gobierno
455
+ - [ ] RLS por Audience / región (si aplica)
456
+ - [ ] Naming conventions documentadas en AGENTS.md
457
+ - [ ] Display folders
673
458
 
674
- 1. See DAX snippets
675
- 2. See Power Query snippets
676
- 3. Preview available themes
677
- 4. Learn about a specific skill
678
- 5. Return to main menu
459
+ ### Fase 4: Reporte
460
+ - [ ] Página resumen (spend + ROAS)
461
+ - [ ] Detalle por canal / campaña
462
+ - [ ] Theme aplicado
679
463
  ```
680
464
 
681
- ---
682
-
683
- ## ANALYSIS PATTERNS
684
-
685
- ### TMDL-Specific Patterns
686
- When analyzing `.tmdl` files:
687
-
688
- **File Structure:**
689
- - `table 'Name'` → Table definition starts
690
- - `column Name` → Column definition (indented with tab)
691
- - `measure 'Name' =` → Measure definition
692
- - `partition Name =` → Data source partition
693
- - `dataType:` → Column data type
694
- - `isHidden` → Hidden column/table flag
695
- - `lineageTag:` → Unique identifier (UUID)
696
-
697
- **Quality Checks:**
698
- - Measures should have `displayFolder` for organization
699
- - Dynamic formatting uses `formatStringDefinition` (not `formatString`)
700
- - Tables should have consistent column naming
701
- - Check for `isHidden` on technical columns
702
-
703
- **Common Issues:**
704
- - Missing `formatStringDefinition` for currency measures
705
- - Inconsistent indentation (must use tabs, not spaces)
706
- - Orphan tables without relationships
707
- - Measures without display folders
708
-
709
- ### Star Schema Detection
710
- Check for:
711
- - Tables with "Dim" or "Dimension" prefix → Dimensions
712
- - Tables with "Fact" or transactional data → Facts
713
- - Tables with date ranges → Date dimension
714
- - Orphan tables (no relationships)
715
- - Bridge tables (many-to-many)
716
-
717
- ### Naming Convention Analysis
718
- Check for:
719
- - Measure prefixes (e.g., "M_", "Measure_", or none)
720
- - Column naming (PascalCase, snake_case, spaces)
721
- - Table naming consistency
722
- - Hidden vs visible columns
723
-
724
- ### DAX Quality Indicators
725
- - **Good**: CALCULATE with proper filters, variables (VAR/RETURN), time intelligence functions
726
- - **Warning**: Nested CALCULATE, FILTER on large tables, too many calculated columns
727
- - **Issue**: Circular dependencies, bi-directional relationships overuse
728
-
729
- ### Power Query Quality Indicators
730
- - **Good**: Proper data types, query folding, organized steps
731
- - **Warning**: Many manual steps, hardcoded values, no error handling
732
- - **Issue**: Loading disabled queries, circular references
465
+ **Otro (fallback)**
733
466
 
734
- ---
467
+ ```md
468
+ ### Fase 1: Modelo base
469
+ - [ ] Definir tabla de hechos principal
470
+ - [ ] Definir dimensiones clave (al menos `Date` + 2 más)
471
+ - [ ] Marcar `Date` como tabla de fecha
472
+ - [ ] Relaciones entre fact y dims
735
473
 
736
- ## EXAMPLE CONVERSATIONS
474
+ ### Fase 2: Medidas core
475
+ - [ ] Medidas base (sum, count, avg)
476
+ - [ ] Time intelligence (YTD, YoY)
737
477
 
738
- ### Example 1: Fabric TMDL Project
478
+ ### Fase 3: Seguridad y gobierno
479
+ - [ ] RLS (si aplica al caso)
480
+ - [ ] Naming conventions documentadas en AGENTS.md
481
+ - [ ] Display folders
739
482
 
483
+ ### Fase 4: Reporte
484
+ - [ ] Página resumen
485
+ - [ ] Detalle por dimensión principal
486
+ - [ ] Theme aplicado
740
487
  ```
741
- Agent: Welcome to BI Agent Superpowers! In which language...
742
- User: 2 (Español)
743
-
744
- Agent: Soy tu asistente de proyectos BI. ¿Es este un proyecto nuevo o tienes archivos existentes?
745
- User: 2 (Existente)
746
-
747
- Agent: Déjame escanear tu carpeta...
748
488
 
749
- RESULTADOS DEL ESCANEO
750
- ======================
751
- 📁 Carpeta: /proyecto-fabric
489
+ ### 5.7 — Write `./LEARNINGS.md`
752
490
 
753
- Encontré 284 archivos BI:
491
+ Use this seed template verbatim (solo cambiá `{projectName}`):
754
492
 
755
- Fabric/TMDL:
756
- 🔷 data-model/definition/ - 113 archivos TMDL
757
- 📝 dataflows/ - 171 archivos Power Query
493
+ ```md
494
+ # LEARNINGS {projectName}
758
495
 
759
- ¿Quieres que analice estos archivos en detalle?
496
+ > Lecciones aprendidas específicas de este proyecto.
497
+ > El agente lee este archivo al inicio de cada sesión y agrega entradas cuando detecta algo que vale la pena recordar.
498
+ >
499
+ > Si querés agregar algo a mano, respetá el formato de abajo.
760
500
 
761
- User: 1 (Sí, analizar todo)
501
+ ## Formato de cada entrada
762
502
 
763
- Agent: Analizando modelo semántico Fabric...
503
+ - **Fecha** (YYYY-MM-DD)
504
+ - **Lección**: qué aprendimos
505
+ - **Aplicación a futuro**: cómo usarlo la próxima vez
764
506
 
765
- 📂 data-model/definition/
766
- ├── tables/ - 47 tablas
767
- ├── roles/ - 8 roles RLS
768
- └── relationships.tmdl - 35 relaciones
507
+ ## Entradas
769
508
 
770
- 📋 REPORTE DE ANÁLISIS
771
- ======================
772
-
773
- Salud general: 🟢 Buena
509
+ _(Vacío por ahora — las primeras entradas aparecerán cuando tengamos contexto que valga la pena guardar. El agente las agrega automáticamente.)_
510
+ ```
774
511
 
775
- ## Modelo de Datos
776
- | Aspecto | Estado | Hallazgo |
777
- |---------|--------|----------|
778
- | Star Schema | 🟢 | Estructura clara fact/dim |
779
- | Relaciones | 🟢 | 35 relaciones, sin bi-direccionales |
780
- | Naming | 🟡 | Algunas tablas con espacios |
781
- | Medidas | 🟢 | 49 medidas organizadas en folders |
512
+ ### 5.8 Confirm to the user
782
513
 
783
- ## Dataflows
784
- | Aspecto | Estado | Hallazgo |
785
- |---------|--------|----------|
786
- | Organización | 🟢 | 12 dataflows por dominio |
787
- | Fuentes | 🟢 | BigQuery, Stripe, WooCommerce |
514
+ ```
515
+ Escribí:
516
+ • AGENTS.md ← documento canónico con las 7 reglas
517
+ CLAUDE.md ← pointer para Claude Code
518
+ .github/copilot-instructions.md ← pointer para GitHub Copilot
519
+ • .kilo/rules/project.md ← pointer para Kilo Code
520
+ • GEMINI.md ← pointer para Gemini CLI
521
+ • ROADMAP.md ← plan del proyecto (lo actualizo al final de cada sesión)
522
+ • LEARNINGS.md ← lecciones del proyecto (lo actualizo cuando algo valga la pena recordar)
788
523
 
789
- ## Seguridad
790
- | Aspecto | Estado | Hallazgo |
791
- |---------|--------|----------|
792
- | RLS Roles | 🟢 | 8 roles (uno por cliente) |
524
+ A partir de ahora, cualquier agente que abra esta carpeta lee las mismas 7 reglas, el plan del proyecto, y los aprendizajes acumulados.
525
+ ```
793
526
 
794
- ## Top Recomendaciones
795
- 1. [Media] Estandarizar nombres de tablas (quitar espacios)
796
- 2. [Baja] Agregar formatStringDefinition a medidas monetarias
527
+ ---
797
528
 
798
- ¿Cómo quieres proceder?
529
+ ## PHASE 6: Start modeling
799
530
 
800
- User: 1 (Empezar a corregir)
531
+ Now the foundation is ready. Propose the first concrete modeling step based on the domain captured in PHASE 4:
801
532
 
802
- Agent: Empecemos por la prioridad media: estandarizar nombres...
803
533
  ```
534
+ Listo para modelar. Con lo que me contaste ({domain} / {purpose}), yo arrancaría por:
804
535
 
805
- ### Example 2: Power BI Desktop Project
536
+ 1. Crear la tabla de hechos central — {suggested-fact-table-for-domain}
537
+ 2. Crear las dimensiones clave — {suggested-dims-for-domain}
538
+ 3. Conectar las fuentes de datos desde {dataSources[0]}
806
539
 
540
+ ¿Arrancamos por (1), o querés otro orden?
807
541
  ```
808
- Agent: Welcome to BI Agent Superpowers! In which language...
809
- User: 2 (Español)
810
-
811
- Agent: Soy tu asistente de proyectos BI. ¿Es este un proyecto nuevo o tienes archivos existentes?
812
- User: 2 (Existente)
813
542
 
814
- Agent: Déjame escanear tu carpeta...
543
+ When the user picks, **execute the work via the Power BI Modeling MCP** — do not generate `.tmdl` text to paste. The user watches the model change live in Power BI Desktop.
815
544
 
816
- RESULTADOS DEL ESCANEO
817
- ======================
818
- Encontré 3 archivos:
819
- 📊 ventas-q4.pbip/ - Proyecto Power BI
820
- 📗 datos-maestros.xlsx - 2.3 MB
821
- 📗 presupuesto-2024.xlsx - 1.1 MB
545
+ Suggested first steps by domain:
822
546
 
823
- ¿Quieres que analice estos archivos en detalle?
547
+ | Domain | Suggested fact table | Suggested dimensions |
548
+ |---|---|---|
549
+ | Finance | `GeneralLedger` | `Date`, `Account`, `CostCenter`, `Scenario` |
550
+ | Sales | `Sales` | `Date`, `Customer`, `Product`, `Salesperson` |
551
+ | HR | `HeadcountSnapshot` | `Date`, `Employee`, `Department`, `Position` |
552
+ | Operations | `Orders` | `Date`, `Customer`, `Product`, `Facility` |
553
+ | Marketing | `Campaigns` | `Date`, `Channel`, `Audience`, `Product` |
824
554
 
825
- User: 1 (Sí, analizar todo)
555
+ These are starting points, not gospel — adapt to what the user said in PHASE 4.
826
556
 
827
- Agent: [Analiza el .pbip]
828
-
829
- 📋 REPORTE DE ANÁLISIS
830
- ======================
557
+ ---
831
558
 
832
- Salud general: 🟡 Necesita atención
559
+ ## PHASE 7: Handoff to `/report-design`
833
560
 
834
- ## Modelo de Datos
835
- | Aspecto | Estado | Hallazgo |
836
- |---------|--------|----------|
837
- | Star Schema | 🟡 | 2 tablas sin relacionar |
838
- | Relaciones | 🟢 | Bien configuradas |
839
- | Naming | 🔴 | Inconsistente (mezcla español/inglés) |
561
+ Once the model has at least 1 fact, 1 dim, and 3 measures in place, propose moving to reports:
840
562
 
841
- ## Top Recomendaciones
842
- 1. [Alta] Estandarizar nombres de columnas
843
- 2. [Media] Crear tabla de fechas dedicada
844
- 3. [Baja] Mover cálculos de columnas a medidas
563
+ ```
564
+ ✓ Modelo base listo. Tenés fact + dims + {N} medidas.
845
565
 
846
- ¿Cómo quieres proceder?
566
+ El siguiente paso lógico es armar los 3 reportes con `/report-design`. Ese skill va a:
567
+ 1. Usar el dominio que ya definimos ({domain})
568
+ 2. Inspeccionar tu modelo vía el pbi CLI para las medidas/dimensiones exactas
569
+ 3. Generar 3 páginas con visuales vía CLI (card, line, bar, matrix)
570
+ 4. Cerrar y reabrir PBI Desktop para que renderice
847
571
 
848
- User: 1 (Empezar a corregir)
572
+ Requisito: necesitás pbi-cli-tool instalado (si no lo tenés el skill te guía).
849
573
 
850
- Agent: Empecemos por la prioridad alta: estandarizar nombres...
574
+ ¿Arrancamos con /report-design, o preferís agregar más medidas al modelo primero?
851
575
  ```
852
576
 
577
+ If the user opts for reports, load `/report-design` and let it run. If they want to keep modeling, stay on this skill.
578
+
853
579
  ---
854
580
 
855
- ## Complexity Adaptation
581
+ ## What this skill does NOT do
856
582
 
857
- Adjust depth based on `config.json experienceLevel`:
858
- - **beginner**: Step-by-step with explanations, reference library examples
859
- - **intermediate**: Standard depth, explain non-obvious decisions
860
- - **advanced**: Concise, skip basics, focus on edge cases and optimization
583
+ - **No scoring / benchmarking** of an existing model. For that, the user can ask "audit this model" separately.
584
+ - **Report authoring** is delegated to `/report-design` which orchestrates the `pbi-cli-tool` CLI don't write `.Report/` files from here.
861
585
 
862
586
  ---
863
587
 
864
588
  ## Related Skills
865
589
 
866
- - `/data-model-design` — Design the star schema after analysis
867
- - `/migration-assistant` — If migration is needed
868
- - `/theme-tweaker` — Customize visuals after setup
869
- - `/governance` — Apply naming standards from the start
590
+ - `/pbi-connect` — Deeper troubleshooting if the MCP connection fails
870
591
 
871
592
  ---
872
593
 
873
- ## OUTPUT FILES
874
-
875
- When user requests to export the report, save to:
876
-
877
- `/[project-root]/analysis-report-[date].md`
594
+ ## Related Resources
878
595
 
879
- Format:
880
- ```markdown
881
- # Project Analysis Report
882
- Generated: [date]
883
- Tool: BI Agent Superpowers
884
-
885
- ## Executive Summary
886
- [Summary paragraph]
887
-
888
- ## Files Analyzed
889
- [List]
890
-
891
- ## Findings
892
- [Detailed findings by category]
893
-
894
- ## Recommendations
895
- [Prioritized list]
896
-
897
- ## Next Steps
898
- [Action items]
899
- ```
596
+ - [Power BI MCP overview](https://learn.microsoft.com/en-us/power-bi/developer/mcp/mcp-servers-overview)
597
+ - [Power BI Modeling MCP on GitHub](https://github.com/microsoft/powerbi-modeling-mcp)
598
+ - [PBIP format docs](https://learn.microsoft.com/en-us/power-bi/developer/projects/projects-overview)