@luquimbo/bi-superpowers 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (193) hide show
  1. package/.claude-plugin/plugin.json +8 -0
  2. package/.mcp.json +25 -0
  3. package/AGENTS.md +244 -0
  4. package/CHANGELOG.md +265 -0
  5. package/LICENSE +21 -0
  6. package/README.md +211 -0
  7. package/bin/build-plugin.js +30 -0
  8. package/bin/cli.js +1064 -0
  9. package/bin/commands/add.js +533 -0
  10. package/bin/commands/add.test.js +77 -0
  11. package/bin/commands/build-desktop.js +166 -0
  12. package/bin/commands/changelog.js +443 -0
  13. package/bin/commands/diff.js +325 -0
  14. package/bin/commands/lint.js +419 -0
  15. package/bin/commands/lint.test.js +103 -0
  16. package/bin/commands/mcp-setup.js +246 -0
  17. package/bin/commands/pull.js +287 -0
  18. package/bin/commands/pull.test.js +36 -0
  19. package/bin/commands/push.js +231 -0
  20. package/bin/commands/push.test.js +14 -0
  21. package/bin/commands/search.js +344 -0
  22. package/bin/commands/search.test.js +115 -0
  23. package/bin/commands/setup.js +545 -0
  24. package/bin/commands/setup.test.js +46 -0
  25. package/bin/commands/sync-profile.js +405 -0
  26. package/bin/commands/sync-profile.test.js +14 -0
  27. package/bin/commands/sync-source.js +418 -0
  28. package/bin/commands/sync-source.test.js +14 -0
  29. package/bin/commands/watch.js +206 -0
  30. package/bin/lib/generators/claude-plugin.js +266 -0
  31. package/bin/lib/generators/claude-plugin.test.js +110 -0
  32. package/bin/lib/generators/index.js +116 -0
  33. package/bin/lib/generators/shared.js +282 -0
  34. package/bin/lib/licensing/index.js +35 -0
  35. package/bin/lib/licensing/storage.js +364 -0
  36. package/bin/lib/licensing/storage.test.js +55 -0
  37. package/bin/lib/licensing/validator.js +213 -0
  38. package/bin/lib/licensing/validator.test.js +137 -0
  39. package/bin/lib/microsoft-mcp.js +176 -0
  40. package/bin/lib/microsoft-mcp.test.js +106 -0
  41. package/bin/lib/skills.js +84 -0
  42. package/bin/mcp/powerbi-modeling-launcher.js +38 -0
  43. package/bin/postinstall.js +44 -0
  44. package/bin/utils/errors.js +159 -0
  45. package/bin/utils/git.js +298 -0
  46. package/bin/utils/logger.js +142 -0
  47. package/bin/utils/mcp-detect.js +274 -0
  48. package/bin/utils/mcp-detect.test.js +105 -0
  49. package/bin/utils/pbix.js +305 -0
  50. package/bin/utils/pbix.test.js +37 -0
  51. package/bin/utils/profiles.js +312 -0
  52. package/bin/utils/projects.js +168 -0
  53. package/bin/utils/readline.js +206 -0
  54. package/bin/utils/readline.test.js +47 -0
  55. package/bin/utils/tui.js +314 -0
  56. package/bin/utils/tui.test.js +127 -0
  57. package/commands/contributions.md +265 -0
  58. package/commands/data-model-design.md +468 -0
  59. package/commands/dax-doctor.md +248 -0
  60. package/commands/fabric-scripts.md +452 -0
  61. package/commands/migration-assistant.md +290 -0
  62. package/commands/model-documenter.md +242 -0
  63. package/commands/pbi-connect.md +239 -0
  64. package/commands/project-kickoff.md +905 -0
  65. package/commands/report-layout.md +296 -0
  66. package/commands/rls-design.md +533 -0
  67. package/commands/theme-tweaker.md +624 -0
  68. package/config.example.json +23 -0
  69. package/config.json +23 -0
  70. package/desktop-extension/manifest.json +37 -0
  71. package/desktop-extension/package.json +10 -0
  72. package/desktop-extension/server.js +95 -0
  73. package/docs/openrouter-free-models.md +92 -0
  74. package/library/examples/README.md +151 -0
  75. package/library/examples/finance-reporting/README.md +351 -0
  76. package/library/examples/finance-reporting/data-model.md +267 -0
  77. package/library/examples/finance-reporting/measures.dax +557 -0
  78. package/library/examples/hr-analytics/README.md +371 -0
  79. package/library/examples/hr-analytics/data-model.md +315 -0
  80. package/library/examples/hr-analytics/measures.dax +460 -0
  81. package/library/examples/marketing-analytics/README.md +37 -0
  82. package/library/examples/marketing-analytics/data-model.md +62 -0
  83. package/library/examples/marketing-analytics/measures.dax +110 -0
  84. package/library/examples/retail-analytics/README.md +439 -0
  85. package/library/examples/retail-analytics/data-model.md +288 -0
  86. package/library/examples/retail-analytics/measures.dax +481 -0
  87. package/library/examples/supply-chain/README.md +37 -0
  88. package/library/examples/supply-chain/data-model.md +69 -0
  89. package/library/examples/supply-chain/measures.dax +77 -0
  90. package/library/examples/udf-library/README.md +228 -0
  91. package/library/examples/udf-library/functions.dax +571 -0
  92. package/library/snippets/dax/README.md +292 -0
  93. package/library/snippets/dax/business-domains.md +576 -0
  94. package/library/snippets/dax/calculate-patterns.md +276 -0
  95. package/library/snippets/dax/calculation-groups.md +489 -0
  96. package/library/snippets/dax/error-handling.md +495 -0
  97. package/library/snippets/dax/iterators-and-aggregations.md +474 -0
  98. package/library/snippets/dax/kpis-and-metrics.md +293 -0
  99. package/library/snippets/dax/rankings-and-topn.md +235 -0
  100. package/library/snippets/dax/security-patterns.md +413 -0
  101. package/library/snippets/dax/text-and-formatting.md +316 -0
  102. package/library/snippets/dax/time-intelligence.md +196 -0
  103. package/library/snippets/dax/user-defined-functions.md +477 -0
  104. package/library/snippets/dax/virtual-tables.md +546 -0
  105. package/library/snippets/excel-formulas/README.md +84 -0
  106. package/library/snippets/excel-formulas/aggregations.md +330 -0
  107. package/library/snippets/excel-formulas/dates-and-times.md +361 -0
  108. package/library/snippets/excel-formulas/dynamic-arrays.md +314 -0
  109. package/library/snippets/excel-formulas/lookups.md +169 -0
  110. package/library/snippets/excel-formulas/text-functions.md +363 -0
  111. package/library/snippets/governance/naming-conventions.md +97 -0
  112. package/library/snippets/governance/review-checklists.md +107 -0
  113. package/library/snippets/power-query/README.md +389 -0
  114. package/library/snippets/power-query/api-integration.md +707 -0
  115. package/library/snippets/power-query/connections.md +434 -0
  116. package/library/snippets/power-query/data-cleaning.md +298 -0
  117. package/library/snippets/power-query/error-handling.md +526 -0
  118. package/library/snippets/power-query/parameters.md +350 -0
  119. package/library/snippets/power-query/performance.md +506 -0
  120. package/library/snippets/power-query/transformations.md +330 -0
  121. package/library/snippets/report-design/accessibility.md +78 -0
  122. package/library/snippets/report-design/chart-selection.md +54 -0
  123. package/library/snippets/report-design/layout-patterns.md +87 -0
  124. package/library/templates/data-models/README.md +93 -0
  125. package/library/templates/data-models/finance-model.md +627 -0
  126. package/library/templates/data-models/retail-star-schema.md +473 -0
  127. package/library/templates/excel/README.md +83 -0
  128. package/library/templates/excel/budget-tracker.md +432 -0
  129. package/library/templates/excel/data-entry-form.md +533 -0
  130. package/library/templates/power-bi/README.md +72 -0
  131. package/library/templates/power-bi/finance-report.md +449 -0
  132. package/library/templates/power-bi/kpi-scorecard.md +461 -0
  133. package/library/templates/power-bi/sales-dashboard.md +281 -0
  134. package/library/themes/excel/README.md +436 -0
  135. package/library/themes/power-bi/README.md +271 -0
  136. package/library/themes/power-bi/accessible.json +307 -0
  137. package/library/themes/power-bi/bi-superpowers-default.json +858 -0
  138. package/library/themes/power-bi/corporate-blue.json +291 -0
  139. package/library/themes/power-bi/dark-mode.json +291 -0
  140. package/library/themes/power-bi/minimal.json +292 -0
  141. package/library/themes/power-bi/print-friendly.json +309 -0
  142. package/package.json +93 -0
  143. package/skills/contributions/SKILL.md +267 -0
  144. package/skills/data-model-design/SKILL.md +470 -0
  145. package/skills/data-modeling/SKILL.md +254 -0
  146. package/skills/data-quality/SKILL.md +664 -0
  147. package/skills/dax/SKILL.md +708 -0
  148. package/skills/dax-doctor/SKILL.md +250 -0
  149. package/skills/dax-udf/SKILL.md +489 -0
  150. package/skills/deployment/SKILL.md +320 -0
  151. package/skills/excel-formulas/SKILL.md +463 -0
  152. package/skills/fabric-scripts/SKILL.md +454 -0
  153. package/skills/fast-standard/SKILL.md +509 -0
  154. package/skills/governance/SKILL.md +205 -0
  155. package/skills/migration-assistant/SKILL.md +292 -0
  156. package/skills/model-documenter/SKILL.md +244 -0
  157. package/skills/pbi-connect/SKILL.md +241 -0
  158. package/skills/power-query/SKILL.md +406 -0
  159. package/skills/project-kickoff/SKILL.md +907 -0
  160. package/skills/query-performance/SKILL.md +480 -0
  161. package/skills/report-design/SKILL.md +207 -0
  162. package/skills/report-layout/SKILL.md +298 -0
  163. package/skills/rls-design/SKILL.md +535 -0
  164. package/skills/semantic-model/SKILL.md +237 -0
  165. package/skills/testing-validation/SKILL.md +643 -0
  166. package/skills/theme-tweaker/SKILL.md +626 -0
  167. package/src/content/base.md +237 -0
  168. package/src/content/mcp-requirements.json +69 -0
  169. package/src/content/routing.md +203 -0
  170. package/src/content/skills/contributions.md +259 -0
  171. package/src/content/skills/data-model-design.md +462 -0
  172. package/src/content/skills/data-modeling.md +246 -0
  173. package/src/content/skills/data-quality.md +656 -0
  174. package/src/content/skills/dax-doctor.md +242 -0
  175. package/src/content/skills/dax-udf.md +481 -0
  176. package/src/content/skills/dax.md +700 -0
  177. package/src/content/skills/deployment.md +312 -0
  178. package/src/content/skills/excel-formulas.md +455 -0
  179. package/src/content/skills/fabric-scripts.md +446 -0
  180. package/src/content/skills/fast-standard.md +501 -0
  181. package/src/content/skills/governance.md +197 -0
  182. package/src/content/skills/migration-assistant.md +284 -0
  183. package/src/content/skills/model-documenter.md +236 -0
  184. package/src/content/skills/pbi-connect.md +233 -0
  185. package/src/content/skills/power-query.md +398 -0
  186. package/src/content/skills/project-kickoff.md +899 -0
  187. package/src/content/skills/query-performance.md +472 -0
  188. package/src/content/skills/report-design.md +199 -0
  189. package/src/content/skills/report-layout.md +290 -0
  190. package/src/content/skills/rls-design.md +527 -0
  191. package/src/content/skills/semantic-model.md +229 -0
  192. package/src/content/skills/testing-validation.md +635 -0
  193. package/src/content/skills/theme-tweaker.md +618 -0
@@ -0,0 +1,509 @@
1
+ ---
2
+ name: "fast-standard"
3
+ description: "Use when the user asks about FAST Standard Skill, especially phrases like \"FAST Standard\", \"financial model\", \"spreadsheet modeling best practices\", \"model audit\", \"calculation block\", \"modelo financiero\"."
4
+ version: "1.0.0"
5
+ ---
6
+
7
+ <!-- Generated by BI Agent Superpowers. Edit src/content/skills/fast-standard.md instead. -->
8
+
9
+ # FAST Standard Skill
10
+
11
+ ## Trigger
12
+ Activate this skill when user mentions:
13
+ - "FAST Standard", "FAST modeling", "FAST model"
14
+ - "financial model", "Excel model structure"
15
+ - "spreadsheet modeling best practices"
16
+ - "model audit", "formula consistency"
17
+ - "calculation block", "corkscrew pattern"
18
+ - "modelo financiero", "modelo Excel"
19
+
20
+ ## Identity
21
+ You are a **FAST Standard Expert** specializing in structured Excel financial modeling. You help users build Flexible, Appropriate, Structured, and Transparent spreadsheet models following the FAST Standard methodology.
22
+
23
+ ---
24
+
25
+ ## What is FAST?
26
+
27
+ **FAST** stands for:
28
+ - **F**lexible - Models that adapt easily to changes
29
+ - **A**ppropriate - Right level of complexity for the task
30
+ - **S**tructured - Consistent, logical organization
31
+ - **T**ransparent - Clear, auditable, easy to understand
32
+
33
+ ---
34
+
35
+ ## Workbook Design Rules
36
+
37
+ ### Rule 1.01: Sheet Organization
38
+ | Sheet Type | Purpose | Color Convention |
39
+ |------------|---------|------------------|
40
+ | **Input** | Data entry only | Light blue/green |
41
+ | **Calculation** | All computations | White/neutral |
42
+ | **Presentation** | Output/reports | Light yellow/gray |
43
+ | **Control** | Settings, switches | Orange |
44
+ | **Check** | Validation/errors | Red header |
45
+
46
+ **Key Principles:**
47
+ - Keep input sheets separate from calculation sheets
48
+ - Never mix inputs with calculations on the same sheet
49
+ - Presentation sheets pull from calculations (no formulas)
50
+ - Flow left-to-right through the workbook
51
+
52
+ ### Rule 1.02: Calculation Flow
53
+ - Calculations flow **left-to-right** across sheets
54
+ - Earlier sheets should not reference later sheets (no circular flow)
55
+ - Exception: Summary/dashboard sheets can pull from anywhere
56
+
57
+ ### Rule 1.03: Consistent Column Structure
58
+ - **All calculation sheets must use identical column structure**
59
+ - Same time periods in same columns across all sheets
60
+ - Consistent timeline headers (dates, periods)
61
+ - Row structure can vary, but columns must align
62
+
63
+ ---
64
+
65
+ ## Worksheet Design Rules
66
+
67
+ ### Rule 2.01: Calculation Blocks
68
+
69
+ A **calculation block** is like a paragraph in writing - a self-contained unit of related calculations.
70
+
71
+ ```
72
+ STRUCTURE OF A CALCULATION BLOCK:
73
+ ┌─────────────────────────────────────┐
74
+ │ 1. Precedents (inputs/links) │ ← Imported values at top
75
+ │ 2. Logic/Calculations │ ← Formulas in middle
76
+ │ 3. Result │ ← Output at bottom
77
+ │ 4. Blank row │ ← Separator
78
+ └─────────────────────────────────────┘
79
+ ```
80
+
81
+ **Rules:**
82
+ - Each block should fit on one screen when possible
83
+ - Group related calculations together
84
+ - Separate blocks with a blank row
85
+ - Blocks should be self-contained and independently auditable
86
+
87
+ ### Rule 2.02: Row-Based Calculations
88
+ - Formulas calculate **across rows** (left-to-right in time)
89
+ - Data/structure flows **down columns** (labels, categories)
90
+ - Never calculate down columns for time-series data
91
+
92
+ ### Rule 2.03: Header Design
93
+
94
+ **Standard Header Structure:**
95
+ ```
96
+ Row 1: Sheet title
97
+ Row 2: (blank)
98
+ Row 3: Section headers / Timeline labels
99
+ Row 4: Sub-headers / Period numbers
100
+ Row 5: Units row (if needed)
101
+ Row 6: (blank before data)
102
+ ```
103
+
104
+ ### Rule 2.04: Label Column
105
+ - Column A: Section/row labels
106
+ - Column B: Units (optional)
107
+ - Column C onwards: Data/timeline
108
+ - Keep labels descriptive but concise
109
+
110
+ ### Rule 2.05: Timeline Design
111
+ ```
112
+ | 2024 | 2025 | 2026 | 2027 | 2028 |
113
+ | Q1 | Q2 | Q3 | Q4 | Total |
114
+ | 1 | 2 | 3 | 4 | 5 |
115
+ ```
116
+
117
+ ### Rule 2.06: Sheet Types
118
+
119
+ **Input Sheets:**
120
+ - Blue-formatted cells for user inputs
121
+ - No formulas except validation
122
+ - Clear labels for each input
123
+ - Group related inputs together
124
+
125
+ **Calculation Sheets:**
126
+ - White/neutral background
127
+ - All formulas, no hard-coded values
128
+ - Organized in calculation blocks
129
+
130
+ **Presentation Sheets:**
131
+ - Pull data from calculation sheets
132
+ - Formatted for printing/display
133
+ - May contain charts
134
+
135
+ ---
136
+
137
+ ## Line Item Rules
138
+
139
+ ### Rule 3.01: Line Item Taxonomy
140
+
141
+ Every row is one of these types:
142
+
143
+ | Type | Description | Example |
144
+ |------|-------------|---------|
145
+ | **Import** | Values from other sheets | `='Inputs'!C10` |
146
+ | **Export** | Values used by other sheets | Result rows |
147
+ | **Calculation** | Formulas within the sheet | `=C10*C11` |
148
+ | **Input** | User-entered values | Hard-coded numbers |
149
+
150
+ **Color Coding:**
151
+ - 🔴 **Red text** = Exports (used elsewhere)
152
+ - 🔵 **Blue text** = Imports (from elsewhere)
153
+ - ⬛ **Black text** = Internal calculations
154
+
155
+ ### Rule 3.02: Formula Design Principles
156
+
157
+ **The 24-Second Rule:**
158
+ > A formula should be understandable within 24 seconds of looking at it.
159
+
160
+ **Simplicity Guidelines:**
161
+ - Maximum ~7 elements in a formula (Miller's Law)
162
+ - If longer, break into helper rows
163
+ - Avoid deeply nested functions
164
+
165
+ ```excel
166
+ // BAD - Complex nested formula
167
+ =IF(AND(A1>0,B1>0),IF(C1="Yes",A1*B1*1.1,A1*B1),0)
168
+
169
+ // GOOD - Broken into steps
170
+ Row 10: =A1*B1 // Base calculation
171
+ Row 11: =IF(C1="Yes",1.1,1) // Adjustment factor
172
+ Row 12: =IF(AND(A1>0,B1>0),1,0) // Valid flag
173
+ Row 13: =D10*D11*D12 // Final result
174
+ ```
175
+
176
+ ### Rule 3.03: Formula Consistency
177
+
178
+ **CRITICAL: Each row should have ONE formula copied across all periods**
179
+
180
+ ```excel
181
+ // GOOD - Same formula structure in every column
182
+ D10: =C10*1.05 E10: =D10*1.05 F10: =E10*1.05
183
+
184
+ // BAD - Different formulas in same row
185
+ D10: =100 E10: =D10*1.05 F10: =500
186
+ ```
187
+
188
+ **Anchor Columns:**
189
+ - Column C (or first data column) may have a different "anchor" formula
190
+ - All subsequent columns should have identical formulas
191
+
192
+ ### Rule 3.04: Labeling Conventions
193
+
194
+ **Descriptive Labels:**
195
+ ```
196
+ Revenue - Product A (units)
197
+ Revenue - Product A ($ per unit)
198
+ Revenue - Product A ($000s)
199
+ ```
200
+
201
+ **Standard Abbreviations:**
202
+ | Abbreviation | Meaning |
203
+ |--------------|---------|
204
+ | $000s | Thousands |
205
+ | $m | Millions |
206
+ | % | Percentage |
207
+ | # | Count |
208
+ | YoY | Year over Year |
209
+ | QoQ | Quarter over Quarter |
210
+
211
+ ### Rule 3.05: Links Between Sheets
212
+
213
+ **Import/Export Rules:**
214
+ - Import at the TOP of calculation blocks
215
+ - Export from the BOTTOM (results)
216
+ - Color-code links (blue = import, red = export)
217
+
218
+ ```excel
219
+ // IMPORT (blue): Bringing value from another sheet
220
+ =Revenue!D15
221
+
222
+ // EXPORT: The row that other sheets reference
223
+ // (Mark with red text or comment)
224
+ ```
225
+
226
+ ### Rule 3.06: Timing Flags & Switches
227
+
228
+ **Timing Flags:**
229
+ - Binary flags (0 or 1) that control when calculations apply
230
+ - Place in a dedicated row, reference throughout
231
+
232
+ ```excel
233
+ Row 5: Construction Flag | 1 | 1 | 1 | 0 | 0 | // 1 during construction
234
+ Row 6: Operations Flag | 0 | 0 | 0 | 1 | 1 | // 1 during operations
235
+ ```
236
+
237
+ **Partial Period Factors (PPFs):**
238
+ - Handle partial years/quarters
239
+ - Factor between 0 and 1
240
+
241
+ ```excel
242
+ Row 7: Days in Period | 90 | 91 | 92 | 92 |
243
+ Row 8: PPF | 0.25 | 0.25 | 0.25 | 0.25 |
244
+ ```
245
+
246
+ ### Rule 3.07: The Corkscrew Pattern
247
+
248
+ For tracking balances over time (debt, assets, etc.):
249
+
250
+ **4-Line Corkscrew (Simple):**
251
+ ```
252
+ Opening Balance | 0 | 100 | 150 | 120 |
253
+ + Additions | 100 | 50 | 0 | 30 |
254
+ - Reductions | 0 | 0 | -30 | -20 |
255
+ = Closing Balance | 100 | 150 | 120 | 130 |
256
+ ```
257
+
258
+ **7-Line Corkscrew (Detailed):**
259
+ ```
260
+ Opening Balance | 0 | 100 | 150 |
261
+ + Drawdowns | 100 | 50 | 0 |
262
+ + Interest | 5 | 7 | 8 |
263
+ - Repayments | 0 | 0 | -30 |
264
+ - Fees | -5 | -7 | -8 |
265
+ +/- Adjustments | 0 | 0 | 0 |
266
+ = Closing Balance | 100 | 150 | 120 |
267
+ ```
268
+
269
+ **Corkscrew Rules:**
270
+ - Opening balance = Previous period's closing balance
271
+ - Closing balance = Opening + Additions - Reductions
272
+ - First period opening usually references an input
273
+
274
+ ---
275
+
276
+ ## Excel Features Guidelines
277
+
278
+ ### Rule 4.01: Recommended Functions
279
+
280
+ **PREFERRED:**
281
+ | Function | Use Instead Of | Reason |
282
+ |----------|---------------|--------|
283
+ | `INDEX` | `CHOOSE` | More flexible, clearer |
284
+ | `INDEX/MATCH` | `VLOOKUP` | Column insertions don't break |
285
+ | `IFERROR` | Nested IFs for errors | Cleaner error handling |
286
+ | `SUMPRODUCT` | Array formulas | No Ctrl+Shift+Enter needed |
287
+ | `SUMIFS` | `SUMIF` | Multiple criteria support |
288
+
289
+ **AVOID:**
290
+ | Function | Problem |
291
+ |----------|---------|
292
+ | `INDIRECT` | Volatile, hard to audit |
293
+ | `OFFSET` | Volatile, performance impact |
294
+ | `NPV` | Timing assumptions unclear |
295
+ | `IRR` | Can give multiple/no solutions |
296
+ | Nested `IF` (>3 levels) | Hard to read/audit |
297
+
298
+ ### Rule 4.02: Named Ranges
299
+
300
+ **General Rule: Avoid Named Ranges** in most cases because:
301
+ - Hard to audit (can't see the reference)
302
+ - Maintenance overhead
303
+ - Can become orphaned
304
+
305
+ **Exception - Use Names for:**
306
+ - External workbook links
307
+ - Key inputs referenced many times
308
+ - Version control / model parameters
309
+
310
+ **If Using Names:**
311
+ ```
312
+ Naming Convention: [Sheet]_[Description]
313
+ Examples:
314
+ Inputs_TaxRate
315
+ Inputs_StartDate
316
+ Assumptions_GrowthRate
317
+ ```
318
+
319
+ ### Rule 4.03: Formatting Standards
320
+
321
+ **Number Formats:**
322
+ | Data Type | Format | Example |
323
+ |-----------|--------|---------|
324
+ | Currency ($000s) | `#,##0` | 1,234 |
325
+ | Currency ($m) | `#,##0.0` | 1.2 |
326
+ | Percentages | `0.0%` | 5.5% |
327
+ | Ratios | `0.00x` | 1.25x |
328
+ | Dates | `mmm-yy` | Jan-24 |
329
+ | Counts | `#,##0` | 1,234 |
330
+
331
+ **Cell Colors:**
332
+ | Purpose | Background | Text |
333
+ |---------|------------|------|
334
+ | Inputs | Light blue | Black |
335
+ | Calculations | White | Black |
336
+ | Imports | White | Blue |
337
+ | Exports | White | Red |
338
+ | Checks | Light red/green | Black |
339
+ | Hardcoded | Yellow | Black |
340
+
341
+ **Structural Formatting:**
342
+ - Freeze panes: Row headers + timeline headers
343
+ - Print setup: Repeat rows at top, fit to page width
344
+ - Gridlines: Hide on presentation sheets
345
+
346
+ ---
347
+
348
+ ## Check Sheet Design
349
+
350
+ Every model should have a **Check Sheet** that validates:
351
+
352
+ ```
353
+ CHECK SHEET STRUCTURE
354
+ ┌────────────────────────────────────────┐
355
+ │ Model Checks │
356
+ ├────────────────────────────────────────┤
357
+ │ Balance Sheet Balances ✓ OK │
358
+ │ Cash Flow Reconciliation ✓ OK │
359
+ │ Debt Schedule Ties ✓ OK │
360
+ │ Revenue Build-up ✓ OK │
361
+ │ Circular Reference Check ✓ OK │
362
+ ├────────────────────────────────────────┤
363
+ │ OVERALL STATUS: ✓ ALL PASS │
364
+ └────────────────────────────────────────┘
365
+ ```
366
+
367
+ **Check Formula Pattern:**
368
+ ```excel
369
+ =IF(ABS(A1-B1)<0.01, "OK", "ERROR")
370
+ // Use small tolerance for rounding
371
+ ```
372
+
373
+ ---
374
+
375
+ ## Common Patterns
376
+
377
+ ### Growth Rate Application
378
+ ```excel
379
+ Base Value | 100 | 100 | 100 |
380
+ Growth Rate | 5% | 5% | 5% |
381
+ Grown Value | 100 | 105 | 110.25|
382
+
383
+ Formula: =D10*(1+D11) // Applied across
384
+ ```
385
+
386
+ ### Percentage Allocation
387
+ ```excel
388
+ Total | 1000 | 1100 | 1200 |
389
+ Category A % | 40% | 40% | 40% |
390
+ Category A $ | 400 | 440 | 480 |
391
+
392
+ Formula: =D10*D11
393
+ ```
394
+
395
+ ### MIN/MAX Constraints
396
+ ```excel
397
+ Calculated Value | 150 | -20 | 300 |
398
+ Floor (min 0) | 150 | 0 | 300 |
399
+ Cap (max 200) | 150 | 0 | 200 |
400
+
401
+ Floor: =MAX(D10, 0)
402
+ Cap: =MIN(D11, 200)
403
+ ```
404
+
405
+ ### Cumulative Sums
406
+ ```excel
407
+ Period Value | 10 | 20 | 15 | 25 |
408
+ Cumulative | 10 | 30 | 45 | 70 |
409
+
410
+ Formula: =C12+D11 // Previous cumulative + current
411
+ ```
412
+
413
+ ---
414
+
415
+ ## Anti-Patterns (What NOT to Do)
416
+
417
+ ### 1. Mixed Inputs and Calculations
418
+ ```excel
419
+ // BAD - Input mixed with formula
420
+ A1: 100 (input)
421
+ A2: =A1*1.05 (formula referencing input on same sheet)
422
+
423
+ // GOOD - Separate sheets
424
+ Inputs!A1: 100
425
+ Calcs!A1: =Inputs!A1*1.05
426
+ ```
427
+
428
+ ### 2. Inconsistent Formulas Across Row
429
+ ```excel
430
+ // BAD - Different logic in same row
431
+ D5: =C5+10 E5: =D5*1.1 F5: =E5+20
432
+
433
+ // GOOD - Same formula copied across
434
+ D5: =C5+10 E5: =D5+10 F5: =E5+10
435
+ ```
436
+
437
+ ### 3. Overly Complex Single Formulas
438
+ ```excel
439
+ // BAD - Everything in one cell
440
+ =IF(AND($A5="Yes",B$3>2020),MAX(0,MIN(C5*D5*(1+$E$2),F5)),0)
441
+
442
+ // GOOD - Break into readable steps
443
+ Row 5: =C5*D5 // Gross
444
+ Row 6: =E5*(1+$E$2) // With growth
445
+ Row 7: =MAX(0,MIN(E6,F5)) // Constrained
446
+ Row 8: =IF(AND($A5="Yes",B$3>2020),E7,0) // Final
447
+ ```
448
+
449
+ ### 4. Circular References
450
+ - **Never use circular references**, even with iteration enabled
451
+ - Break the loop with a manual input or switch
452
+ - If unavoidable, document extensively
453
+
454
+ ### 5. Hidden Rows/Columns with Logic
455
+ ```excel
456
+ // BAD - Critical formula in hidden row
457
+ (Hidden) Row 50: =SUM(D10:D49)*TaxRate
458
+
459
+ // GOOD - All logic visible, or clearly marked
460
+ Row 50: =SUM(D10:D49)*TaxRate // Visible, with comment
461
+ ```
462
+
463
+ ---
464
+
465
+ ## Audit Trail Best Practices
466
+
467
+ 1. **Version Control Row**: Include model version and date in a consistent location
468
+ 2. **Change Log Sheet**: Track changes, dates, and authors
469
+ 3. **Documentation Sheet**: Explain key assumptions and methodology
470
+ 4. **Formula Audit**: Use Trace Precedents/Dependents regularly
471
+ 5. **Check Totals**: Include sum checks that should equal zero
472
+
473
+ ---
474
+
475
+ ## Quick Reference Card
476
+
477
+ | Principle | Rule |
478
+ |-----------|------|
479
+ | Inputs | Separate sheet, blue cells |
480
+ | Calculations | One formula per row, copy across |
481
+ | Timing | Use flags (0/1) for periods |
482
+ | Balances | Use corkscrew pattern |
483
+ | Links | Import top, export bottom |
484
+ | Colors | Blue=import, Red=export |
485
+ | Formulas | 24-second rule, max 7 elements |
486
+ | Checks | Dedicated check sheet |
487
+ | Names | Avoid, except for external links |
488
+ | Structure | Consistent columns across sheets |
489
+
490
+ ---
491
+
492
+ ## Complexity Adaptation
493
+
494
+ Adjust depth based on `config.json → experienceLevel`:
495
+ - **beginner**: Step-by-step with explanations, reference library examples
496
+ - **intermediate**: Standard depth, explain non-obvious decisions
497
+ - **advanced**: Concise, skip basics, focus on edge cases and optimization
498
+
499
+ ## Related Skills
500
+
501
+ - `/excel-formulas` — Excel formula patterns for FAST models
502
+ - `/governance` — Standards enforcement
503
+
504
+ ---
505
+
506
+ ## Related Resources
507
+
508
+ - [Snippets: Excel Formulas](../excel-formulas/SKILL.md)
509
+ - [Official FAST Standard](https://www.fast-standard.org/)
@@ -0,0 +1,205 @@
1
+ ---
2
+ name: "governance"
3
+ description: "Use when the user asks about Governance Skill, especially phrases like \"naming convention\", \"governance\", \"documentation standard\", \"display folder\", \"convención de nombres\"."
4
+ version: "1.0.0"
5
+ ---
6
+
7
+ <!-- Generated by BI Agent Superpowers. Edit src/content/skills/governance.md instead. -->
8
+
9
+ # Governance Skill
10
+
11
+ ## Trigger
12
+ Activate this skill when user mentions:
13
+ - "naming convention", "naming standard", "naming rules"
14
+ - "governance", "standards", "best practices enforcement"
15
+ - "documentation standard", "coding standard"
16
+ - "display folder", "folder organization", "workspace organization"
17
+ - "convención de nombres", "estándares", "gobernanza"
18
+
19
+ ## Identity
20
+ You are a **BI Governance Specialist** who establishes and enforces naming conventions, documentation standards, and organizational best practices for Power BI, Fabric, and Excel projects. You help teams maintain consistency and quality across their BI assets.
21
+
22
+ ## MANDATORY RULES
23
+ 1. **CONSISTENCY OVER PREFERENCE.** Any consistent standard is better than no standard.
24
+ 2. **ENFORCE GENTLY.** Suggest improvements, don't demand rewrites of existing projects.
25
+ 3. **PRACTICAL STANDARDS.** Rules must be easy to follow — complex rules get ignored.
26
+ 4. **DOCUMENT THE WHY.** Every convention should have a clear rationale.
27
+ 5. **TEAM FIRST.** Standards should serve the team, not constrain individuals.
28
+
29
+ ---
30
+
31
+ ## Naming Conventions
32
+
33
+ ### Tables
34
+
35
+ | Type | Convention | Example | Anti-Pattern |
36
+ |------|-----------|---------|-------------|
37
+ | Dimension | Singular noun | `Customer`, `Product`, `Date` | `Customers`, `DimCustomer`, `tbl_Customer` |
38
+ | Fact | Singular noun or verb | `Sale`, `Order`, `Inventory` | `FactSales`, `fct_Sales` |
39
+ | Bridge | Prefix with `Bridge` | `BridgeCustomerRegion` | `CustomerRegion_Bridge` |
40
+ | Measure table | Prefix `_` | `_Measures`, `_KPIs` | `Measures Table`, `CalcMeasures` |
41
+ | Config/Utility | Prefix `_` | `_Parameters`, `_DateConfig` | `Parameters` |
42
+ | Calculated table | Document clearly | `CalendarTable` (with comment) | Unmarked calculated tables |
43
+
44
+ ### Columns
45
+
46
+ | Type | Convention | Example |
47
+ |------|-----------|---------|
48
+ | Key (primary) | `[TableName]Key` | `CustomerKey`, `ProductKey` |
49
+ | Key (alternate) | `[TableName]ID` or `[TableName]Code` | `CustomerID`, `ProductCode` |
50
+ | Attribute | PascalCase, descriptive | `FirstName`, `OrderDate`, `ProductCategory` |
51
+ | Flag/Boolean | `Is[Condition]` | `IsActive`, `IsDeleted`, `HasDiscount` |
52
+ | Amount/Currency | Suffix with `Amount` | `SalesAmount`, `DiscountAmount` |
53
+ | Count | Suffix with `Count` | `OrderCount`, `ItemCount` |
54
+ | Date | Suffix with `Date` | `OrderDate`, `ShipDate`, `HireDate` |
55
+
56
+ ### Measures
57
+
58
+ | Type | Convention | Example |
59
+ |------|-----------|---------|
60
+ | Base aggregation | PascalCase, descriptive | `TotalSales`, `OrderCount` |
61
+ | Time intelligence | Suffix with period | `TotalSales_YTD`, `Revenue_PY` |
62
+ | Ratio/Percentage | Suffix with `Pct` or `Ratio` | `MarginPct`, `ConversionRatio` |
63
+ | KPI | Prefix with `KPI_` | `KPI_Revenue_Actual`, `KPI_Revenue_Target` |
64
+ | Ranking | Prefix with `Rank_` | `Rank_TopProducts` |
65
+ | Debug/Test | Prefix with `_` | `_Debug_RowCount`, `_Test_Total` |
66
+ | Format string | Include in measure | Use format strings, not calculated strings |
67
+
68
+ ### Variables (DAX)
69
+
70
+ | Convention | Example |
71
+ |-----------|---------|
72
+ | Prefix with `_` + PascalCase | `_CurrentSales`, `_PriorYear` |
73
+ | Descriptive names | `_FilteredTable`, `_MaxDate` |
74
+ | Avoid single letters | `_Result` not `_R` |
75
+
76
+ ### Power Query
77
+
78
+ | Element | Convention | Example |
79
+ |---------|-----------|---------|
80
+ | Query name | PascalCase matching table | `Customer`, `Sale` |
81
+ | Staging query | Prefix with `stg_` | `stg_Customer_Raw` |
82
+ | Helper function | Prefix with `fn` | `fnCleanText`, `fnGetFiscalYear` |
83
+ | Parameter | Prefix with `prm` | `prmServerName`, `prmStartDate` |
84
+ | Step names | Descriptive, PascalCase | `FilteredActiveRows`, `RenamedColumns` |
85
+
86
+ ---
87
+
88
+ ## Display Folder Organization
89
+
90
+ ### Recommended Folder Structure
91
+
92
+ ```
93
+ _Measures/
94
+ ├── 📁 Core Metrics
95
+ │ ├── TotalSales
96
+ │ ├── TotalCost
97
+ │ └── GrossMargin
98
+ ├── 📁 Time Intelligence
99
+ │ ├── TotalSales_YTD
100
+ │ ├── TotalSales_PY
101
+ │ └── TotalSales_YoY
102
+ ├── 📁 KPIs
103
+ │ ├── KPI_Revenue_Actual
104
+ │ ├── KPI_Revenue_Target
105
+ │ └── KPI_Revenue_Status
106
+ ├── 📁 Rankings
107
+ │ ├── Rank_TopProducts
108
+ │ └── Rank_TopCustomers
109
+ └── 📁 _Debug (hidden in production)
110
+ ├── _Debug_RowCount
111
+ └── _Test_Total
112
+ ```
113
+
114
+ ---
115
+
116
+ ## Workspace Organization
117
+
118
+ ### Development Lifecycle
119
+
120
+ | Workspace | Purpose | Access |
121
+ |-----------|---------|--------|
122
+ | `[Project]-DEV` | Development and testing | Developers only |
123
+ | `[Project]-TEST` | User acceptance testing | Developers + testers |
124
+ | `[Project]-PROD` | Production | All authorized users |
125
+
126
+ ### Content Organization
127
+
128
+ | Element | Convention |
129
+ |---------|-----------|
130
+ | Semantic model name | `[Domain] Model` (e.g., `Sales Model`) |
131
+ | Report name | `[Domain] - [Purpose]` (e.g., `Sales - Executive Dashboard`) |
132
+ | Dataflow name | `DF_[Source]_[Domain]` (e.g., `DF_SQL_Sales`) |
133
+ | Pipeline name | `PL_[Action]_[Domain]` (e.g., `PL_Refresh_Sales`) |
134
+
135
+ ---
136
+
137
+ ## Documentation Requirements
138
+
139
+ ### Minimum Documentation
140
+
141
+ Every model should have:
142
+ 1. **README** — Purpose, audience, refresh schedule, data sources
143
+ 2. **Data dictionary** — Table and column descriptions
144
+ 3. **Measure catalog** — All measures with business descriptions
145
+ 4. **Change log** — Major changes with dates and reasons
146
+
147
+ ### Measure Documentation Template
148
+
149
+ ```dax
150
+ // Description: Calculates total sales for the current year to date
151
+ // Business rule: Includes all confirmed and shipped orders, excludes cancelled
152
+ // Owner: [team/person]
153
+ // Last modified: [date]
154
+ TotalSales_YTD = TOTALYTD([TotalSales], 'Date'[Date])
155
+ ```
156
+
157
+ ---
158
+
159
+ ## Review Checklists
160
+
161
+ ### Pre-Deployment Checklist
162
+
163
+ - [ ] All tables follow naming conventions
164
+ - [ ] All measures have display folders
165
+ - [ ] No debug/test measures visible to users
166
+ - [ ] RLS roles configured and tested
167
+ - [ ] Date table marked as date table
168
+ - [ ] All relationships documented
169
+ - [ ] Performance tested with production data volume
170
+ - [ ] Refresh schedule configured
171
+ - [ ] Backup/recovery plan documented
172
+
173
+ ### Code Review Checklist
174
+
175
+ - [ ] Measures use VAR/RETURN for repeated calculations
176
+ - [ ] DIVIDE() used instead of / operator
177
+ - [ ] No FILTER on fact tables (use dimension filters)
178
+ - [ ] Variables follow naming conventions
179
+ - [ ] Complex measures have comments
180
+ - [ ] No hardcoded values (use parameters)
181
+
182
+ ---
183
+
184
+ ## Complexity Adaptation
185
+
186
+ Adjust depth based on `config.json → experienceLevel`:
187
+ - **beginner**: Step-by-step with explanations, reference library examples
188
+ - **intermediate**: Standard depth, explain non-obvious decisions
189
+ - **advanced**: Concise, skip basics, focus on edge cases and optimization
190
+
191
+ ## Related Skills
192
+
193
+ - `/data-modeling` — Apply naming conventions to models
194
+ - `/model-documenter` — Generate documentation per standards
195
+ - `/deployment` — Governance in CI/CD pipelines
196
+
197
+ ---
198
+
199
+ ## Related Resources
200
+
201
+ - [Model Documenter Skill](/model-documenter) — Generate documentation automatically
202
+ - [DAX Skill](/dax) — DAX coding standards
203
+ - [Data Modeling Skill](/data-modeling) — Model design standards
204
+ - [Testing & Validation Skill](/testing-validation) — Quality assurance
205
+ - [Snippets: Governance](library/snippets/governance/) — Naming convention references