# c-sharp-scripting

c-sharp-scripting is a Claude Code skill that runs C# scripts through Tabular Editor 2/3 to automate bulk changes to Power BI measures, columns, calculation groups, and model security.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf (Devin Desktop), Claude.ai · ★ 1104 repo stars
- Author: Kurt Buhler
- License: GPL-3.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/data-goblin/power-bi-agentic-development/tree/HEAD/plugins/tabular-editor/skills/c-sharp-scripting/SKILL.md
- Updated: 2026-10-28
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/c-sharp-scripting

## What it does

This skill exposes the full Tabular Object Model API and LINQ methods for Power BI objects. Write C# scripts directly in Claude Code and run them locally via Tabular Editor CLI or IDE. The skill activates automatically when you mention C# scripts, macros, TOM API, or ask to automate model changes.

Core libraries are pre-loaded: System, System.Linq, System.Data, Newtonsoft.Json, TabularEditor.TOMWrapper, and Microsoft.AnalysisServices.Tabular. Scripts access the `Model` object to read and modify tables, measures, calculated columns, security roles, and DAX expressions. WinForms dialogs and output methods let you build interactive scripts and display results.

Key constraints: every C# statement requires a semicolon, strings use double quotes with backslash escaping, folder paths use forward slashes. Test scripts on a copy of your model first; changes are reversible via Ctrl+Z in the Tabular Editor UI, but the CLI cannot undo writes.

## Requirements
- Works with: Power BI

## Install

### Claude Code (native platform)

1. **Plugin marketplace**
In the agent chat (not a shell):
```text
/plugin marketplace add data-goblin/power-bi-agentic-development
```
In the agent chat (not a shell):
```text
/plugin install tabular-editor@power-bi-agentic-development
```
This installs the whole tabular-editor plugin with all its skills

2. **Skills CLI (Vercel)**
```bash
npx skills add data-goblin/power-bi-agentic-development --skill c-sharp-scripting -a claude-code
```

3. **Manually: put the files in place**
- File: `~/.claude/skills/c-sharp-scripting/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/c-sharp-scripting/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add data-goblin/power-bi-agentic-development --skill c-sharp-scripting -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/c-sharp-scripting/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add data-goblin/power-bi-agentic-development --skill c-sharp-scripting -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/c-sharp-scripting/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install data-goblin/power-bi-agentic-development plugins/tabular-editor/skills/c-sharp-scripting
```

2. **Manually: put the files in place**
- File: `.github/skills/c-sharp-scripting/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add data-goblin/power-bi-agentic-development --skill c-sharp-scripting -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/data-goblin/power-bi-agentic-development --path plugins/tabular-editor/skills/c-sharp-scripting
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/c-sharp-scripting/SKILL.md` — The legacy .windsurf/skills/ path still works

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/data-goblin/power-bi-agentic-development/tree/HEAD/plugins/tabular-editor/skills/c-sharp-scripting/SKILL.md

## When to use it
- Apply a single formula or format to dozens of measures without editing each one manually
- Create and populate a calculation group with multiple calculation items
- Set up row-level and object-level security across several tables in one operation
- Standardize measure names, display folders, and number formats across the entire model
- Export model metadata (properties, descriptions, DAX formulas) to a file for version control

## Example prompts
- Write a C# script that applies format string `$#,0` to all measures with 'Amount' in their name
- Create a Tabular Editor macro that moves all calculated columns into a Display Folder called Utility
- Write a TOM script to list all tables and columns in the model and save the list to `metadata.txt`

## Similar
- [power-bi-security-rls-best-practices](https://affpapa.org/en/nevibecode/rules/power-bi-security-rls-best-practices.md) — rule · ★ 41430 repo stars
- [powerbi-modeling](https://affpapa.org/en/nevibecode/skills/powerbi-modeling.md) — skill · 9934 installs
- [logifleet-pulse-supply-chain-analytics](https://affpapa.org/en/nevibecode/skills/logifleet-pulse-supply-chain-analytics.md) — skill · 659 installs
- [power-bi-retail-analytics-salespulse360](https://affpapa.org/en/nevibecode/skills/power-bi-retail-analytics-salespulse360.md) — skill · 659 installs
- [DAX Terminal](https://affpapa.org/en/nevibecode/prompts/dax-terminal.md) — prompt · ★ 178201 repo stars
- [SemanticOps MCP (for Power BI)](https://affpapa.org/en/nevibecode/mcp/semanticops-mcp-for-power-bi.md) — MCP server · ★ 256 repo stars

From the same set: [data-goblin/power-bi-agentic-development](https://affpapa.org/en/nevibecode/by/data-goblin/power-bi-agentic-development.md) — 59 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
