Bpa RulesSAFE
Power BI AI skills and Power BI agents for Claude Code and GitHub Copilot: a plugin marketplace of Power BI skills, subagents, and hooks for semantic models, DAX, TMDL, reports, and AI dashboards. Includes Microsoft Fabric skills and Fabric agents. Weekly updates.
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
This directory contains example BPA rule sets for Tabular Editor.
Important: Tabular Editor Compatibility
Line Endings (CRLF)
Tabular Editor on Windows requires CRLF line endings (\r\n). Files with Unix line endings (LF only) may fail to load or show empty rule collections.
To convert a file to CRLF:
# macOS/Linux sed -i 's/$/\r/' rules.json # Or use the validation script with --fix flag python validate_rules.py --fix rules.json
File Paths
When adding rule files in Tabular Editor:
- Use absolute paths (e.g.,
C:\BPARules\my-rules.json) - Avoid relative paths with
..\..\..- TE may fail to resolve these - URLs work fine (e.g.,
https://raw.githubusercontent.com/...)
JSON Format Requirements
- No
_commentfields - TE's JSON parser doesn't allow extra properties - Avoid
nullvalues for optional fields - omit the field entirely instead - Use standard JSON encoding (UTF-8, no BOM)
Files
power-query-operations-rules.json
Comprehensive BPA rules for detecting Power Query anti-patterns:
Duplicate Detection (3 rules):
PQ_AVOID_TABLE_DISTINCT- Detects Table.Distinct operationsPQ_AVOID_REMOVE_DUPLICATES- Detects Table.RemoveDuplicates operationsPQ_DUPLICATE_DETECTION_COMPREHENSIVE- Comprehensive rule covering all duplicate removal
Join/Merge Operations (4 rules):
PQ_AVOID_TABLE_NESTEDJOIN- Detects Table.NestedJoin (severity 3)PQ_AVOID_TABLE_JOIN- Detects Table.Join (severity 3)PQ_AVOID_FUZZY_JOINS- Detects fuzzy join operations (severity 3)PQ_MERGE_OPERATIONS_COMPREHENSIVE- Comprehensive rule covering all join/merge patterns
Advanced Patterns (3 rules):
PQ_TABLE_COMBINE_WITH_DISTINCT- Detects Table.Combine + duplicate removal patternsPQ_BUFFER_BEFORE_JOINS- Detects Table.Buffer usage before joinsPQ_EXPAND_AFTER_NESTEDJOIN- Detects expand column operations after nested joins
course-3-business-case-bpa-rules.json
B
b8d9b0f3c97aOBSERVED · 2026-10-13What it tells the agent
The instruction file, verbatim from the audited commit — this is the text the model reads, and the surface the audit's instruction layer examines. Quoted here so you can judge it without cloning anything.
--- name: bpa-rules description: Interactive BPA rule generation for Power BI semantic models; guided discovery, model investigation, and expert rule authoring. Automatically invoke when the user mentions "BPA rule", "Best Practice Analyzer", or asks to "create a BPA rule", "audit BPA rules", "recommend BPA rules", "set up BPA for my team", "check model for best practices", "validate BPA rules", "improve a BPA expression". --- # Best Practice Analyzer Rules Expert guidance for creating and improving BPA (Best Practice Analyzer) rules for Tabular Editor and Power BI semantic models. ## When to Use This Skill Activate automatically when tasks involve: - Creating new BPA rules for semantic model validation - Recommending or choosing BPA rules for a model, team, or organization - Improving or debugging BPA rule expressions - Writing FixExpression to auto-remediate rule violations - Understanding BPA annotations in TMDL files - Analyzing a semantic model against best practices - Converting ad-hoc checks into reusable BPA rules - Auditing or discovering all BPA rules across sources (built-in, URL, model, user, machine) ## Primary Workflow: Interactive Q&A Discovery (Double Diamond) **CRITICAL: Do NOT generate BPA rules immediately.** This is a requirements-gathering exercise. Use the `AskUserQuestion` tool to conduct an iterative, back-and-forth conversation with the user across multiple rounds. Continue asking questions until sufficient context about the user's business, team, model, and priorities has been gathered. Only then move to rule generation. The workflow follows a **double-diamond** pattern: 1. **Diverge** -- broadly explore the user's context, organization, and goals 2. **Converge** -- narrow down to specific priorities and constraints 3. **Diverge** -- explore the model structure and identify candidate rule areas 4. **Converge** -- select and generate the final tailored rule set ### Diamond 1: Requirements Gathering (Phases 1-2) #### Phase 1: Understand the User and Organization Call `AskUserQuestion` with 2-4 questions per round. After each round, review the answers and ask follow-up questions. **Do not proceed to Phase 2 until the organizational context is clear.** Continue rounds until satisfied. **Round 1 -- Goal and audience:** Ask about the primary goal and who will use the rules. Example AskUserQuestion call: - Question 1: "What is the primary goal for these BPA rules?" -- options: "Set up BPA for my team", "Improve a specific model", "Create governance/compliance rules", (Other) - Question 2: "Who will use these rules?" -- options: "Solo developer", "Small team (2-5)", "Large org / multiple teams", (Other) - Question 3: "What tooling do you use?" -- options: "Tabular Editor 3", "Tabular Editor 2", "TE CLI in CI/CD", "Fabric notebooks" **Round 2 -- Standards and existing rules:** Based on Round 1 answers, ask about conventions and existing rules. Example: - Question 1: "Do you have existing naming conventions?" -- options: "Yes, documented", "Yes, informal/ad-hoc", "No conventions yet", (Other) - Question 2: "Are there BPA rules already in use?" -- options: "Yes, in Tabular Editor", "Yes, from a URL/repo", "No existing rules", (Other) - Question 3: "Which categories matter most?" -- multiSelect: true -- options: "Performance", "Metadata/Documentation", "DAX quality", "Naming conventions" **Round 3+ -- Follow-ups as needed:** If the user has existing rules, ask for the file path or URL and read them. If they have naming conventions, ask for specifics. If they mentioned CI/CD, ask about the pipeline setup. **Keep calling AskUserQuestion until the organizational picture is clear.** #### Phase 2: Investigate the Model After Phase 1, use `AskUserQuestion` to determine how to access the model: - Question: "How is your semantic model available?" -- options: "Published to Fabric / Power BI Service", "Local as PBIP (.tmdl files)", "Local as .pbix file", "I have a model.bim file" **Then investigate the model based on the answer:** | Answer | Action | |--------|--------| | **Published to Fabric** | Use `AskUserQuestion` to get workspace and model name. Then use `fab` CLI to inspect remotely -- load the `fabric-cli` skill and read `references/model-investigation.md` for specific commands. | | **Local as PBIP** | Use `AskUserQuestion` to get the path to the `.SemanticModel/definition/` folder. Then read TMDL files directly with Read/Grep tools. | | **Local as .pbix only** | Guide the user to save as PBIP: **File > Save as > Power BI Project (*.pbip)** in Power BI Desktop. Then ask for the resulting folder path. See `references/model-investigation.md` for detailed steps. | | **model.bim file** | Use `AskUserQuestion` to get the file path. Then parse with `jq` or read directly. | | **No model yet** | Skip model investigation; generate general-purpose rules based on organizational context only. | **What to extract from the model** (read files, grep patterns, count objects): - Table count, measure count, column count - Storage mode (Import, DirectQuery, Direct Lake, mixed) - Metadata completeness (descriptions, display folders, format strings) - DAX patterns in use (CALCULATE, FILTER/ALL, calculation groups, UDFs) - Relationship patterns (bi-directional, many-to-many, inactive) - RLS roles defined - Naming conventions currently in use - Existing BPA annotations already embedded in model.tmdl After model investigation, **summarize findings to the user** and use `AskUserQuestion` to confirm the analysis is accurate and ask if anything was missed. ### Diamond 2: Rule Generation (Phases 3-4) #### Phase 3: Prioritize and Recommend Based on everything gathered, present a prioritized recommendation of rule categories. Use `AskUserQuestion` to let the user confirm or adjust before generating any rules. **Present categories ranked by relevance to the user's context.** For example: If the model has many measures without descriptions and the user cares about governance: 1.
Trust audit
SAFEgrade B · trust 89/100 Nothing in the source contradicts what it says it does. Grade A is reserved for packages that have also passed the behavioural sandbox.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | PASS |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | PASS |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- none-observed
- Network
- none-observed
- Shell
- none-observed
- Dependencies
- pinned
- Secrets in source
- none-found
Findings (0)
No findings outside the package's declared scope.
Gates applied: no_behavioural_pass.
b8d9b0f3c97afull audit observations/trust-audit/skill/data-goblin__bpa-rules.json · Report an issue / request a re-scanAudit history
Every audit this skill has had.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-13 | b8d9b0f3c97a | SAFE | B | 89 | first audit |
Questions
What does the Bpa Rules skill do?
Power BI AI skills and Power BI agents for Claude Code and GitHub Copilot: a plugin marketplace of Power BI skills, subagents, and hooks for semantic models, DAX, TMDL, reports, and AI dashboards. Includes Microsoft Fabric skills and Fabric agents. Weekly updates.
Is Bpa Rules safe to install?
The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean skill reads B.
What can Bpa Rules access on my machine?
The audit observed no filesystem, network or shell use at all in its source.
How current is this page?
The grade is for one exact copy of the source (b8d9b0f3c97a), read on 2026-10-13. The repository is watched, and a new audit runs when it changes — this is the first audit.