@luquimbo/bi-superpowers 3.2.0 → 4.1.1

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