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