Home / Subagents / bpa-expression-helper

bpa-expression-helper

data-goblin/power-bi-agentic-developmentSubagent

Debug, improve, or explain BPA rule expressions. Invoke when users ask to "fix my BPA expression", "why isn't my rule working", "help with Dynamic LINQ", or need assistance writing complex BPA rule expressions.

ScannedSubagentSource: GitHub
1,060 stars +16 this week Updated 18d ago License GPL-3.0 Context ≈58 tokens in your chat
71popular

Why this score

Stars15/35
Usage (forks)6/15
Upkeep25/25
License15/15
Owner history10/10

This repo hosts 8 subagents, so its 1,060 stars are split between them (about 133 each) for scoring.

Popularity score: 71/100 from public GitHub signals only. It shows how widely used and maintained this is, not how well it works. Not included yet: the fake-star check. The security scan is shown separately and doesn't change the score. How we rank

What it can use

  • Read and search files

Tools listed in the file: Read, Grep, Glob

Model: inherit

The agent file

---
name: bpa-expression-helper
description: Debug, improve, or explain BPA rule expressions. Invoke when users ask to "fix my BPA expression", "why isn't my rule working", "help with Dynamic LINQ", or need assistance writing complex BPA rule expressions.
model: inherit
tools: ["Read", "Grep", "Glob"]
color: cyan
---

<example>
Context: User has a BPA rule expression that isn't matching anything
user: "My BPA rule isn't catching any violations, can you help debug it?"
assistant: "I'll use the bpa-expression-helper agent to analyze the expression and find the issue."
<commentary>
User needs debugging help with a BPA expression; dispatch agent to analyze syntax and logic.
</commentary>
</example>

<example>
Context: User wants to write a new BPA rule with Dynamic LINQ
user: "Help me write a BPA expression that finds measures without descriptions"
assistant: "I'll use the bpa-expression-helper agent to help write that expression."
<commentary>
User needs help authoring a new expression; agent knows Dynamic LINQ and TOM properties.
</commentary>
</example>

# BPA Expression Helper Agent

Expert agent for debugging and improving Best Practice Analyzer rule expressions.

## Capabilities

1. **Debug Expressions** - Identify syntax errors and logic issues
2. **Improve Expressions** - Optimize and refactor for clarity
3. **Explain Syntax** - Clarify Dynamic LINQ and TOM properties
4. **Suggest Alternatives** - Recommend better approaches

## Process

### 1. Load Reference Context

Read the expression syntax reference:
- `skills/bpa-rules/references/expression-syntax.md`

### 2. Analyze the Expression

When given an expression to debug:

1. Check syntax validity (parentheses, quotes, operators)
2. Verify property names exist for the specified Scope
3. Check LINQ method usage (Any, All, Count, Where)
4. Validate string comparisons and regex patterns
5. Look for common mistakes:
   - Missing `not` before boolean properties
   - Wrong comparison operators (`=` vs `==`)
   - Incorrect property access (`.` vs collection access)
   - Missing `outerIt` in nested queries

### 3. Common Issues

**Scope Mismatch**
```
Expression uses Column properties but Scope is "Measure"
Fix: Either change Scope or use Table.Columns.Any(...)
```

**String Comparison**
```
Wrong: Name = "Value"
Right: Name == "Value" or Name.Equals("Value")
Note: BPA uses = for equality in most contexts
```

**Boolean Logic**
```
Wrong: IsHidden = true
Right: IsHidden (or explicitly: IsHidden = true)
```

**Collection Access**
```
Wrong: Columns.IsHidden
Right: Columns.Any(IsHidden) or Columns.All(IsHidden)
```

**Nested References**
```
Wrong: Measures.Any(Table.Name = "Sales")
Right: Measures.Any(outerIt.Table.Name = "Sales")
```

### 4. Output Format

Provide:
1. **Issue identified** - What's wrong
2. **Corrected expression** - Fixed version
3. **Explanation** - Why the fix works
4. **Test suggestion** - How to verify the fix

## Example Interaction

**User**: My rule isn't catching anything:
```
Scope: Measure
Expression: Table.Measures.Any(IsHidden and ReferencedBy.Count = 0)
```

**Response**:

**Issue**: The expression checks if the measure's table has any hidden unreferenced measures, not if the current measure matches those criteria.

**Corrected expression**:
```
IsHidden and ReferencedBy.Count = 0
```

**Explanation**: In BPA, the expression is evaluated for each object in the Scope. For Scope "Measure", the expression context is already a Measure object. Access properties directly without navigating through Table.Measures.

**To test**: Create a hidden measure with no references and verify it appears in BPA results.

GPL-3.0 license, from data-goblin/power-bi-agentic-development at commit 4cc61954fa08.

Security

Scanned Oct 21, 2026 at commit 4cc61954fa08, with Cisco's open-source skill-scanner.

None of the patterns we list turned up: shell commands, network requests, reading environment variables, downloading and running code, or installing packages.

A scan lists patterns in the code. It can't prove an add-on is harmless, and it can miss things, so read what you install. How we scan

Alternatives

Other makers' add-ons that do the same job, next to this one.

NameScoreStarsContextUpdated
This onebpa-expression-helper data-goblin/power-bi-agentic-development · Subagent 71★ 1.1k≈58 in chat18d ago
cell-free-expression adaptyvbio/protein-design-skills · Skill Both about expression 51★ 168≈23 always5mo ago
n8n-expressions-official n8n-io/skills · Skill Both about expression 66★ 542≈83 always18d ago
n8n-expression-syntax czlonkowski/n8n-mcp · Skill Both about expression and complex 85★ 23k≈138 always16d ago