tableau-cleanup

Clean up Tableau workbooks by standardizing captions, adding comments, and organizing into folders.

16 stars

Best use case

tableau-cleanup is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Clean up Tableau workbooks by standardizing captions, adding comments, and organizing into folders.

Teams using tableau-cleanup should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/tableau-cleanup/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/development/tableau-cleanup/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/tableau-cleanup/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How tableau-cleanup Compares

Feature / Agenttableau-cleanupStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Clean up Tableau workbooks by standardizing captions, adding comments, and organizing into folders.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Tableau Workbook Cleanup

Clean up Tableau workbooks (.twb/.twbx) by editing XML. Run validation, fix errors, repeat until clean.

## Scratchpad

Use `.cleanup/` directory. Track progress in `.cleanup/status.json`.

## Scripts

| Script | Purpose |
|--------|---------|
| `scripts/backup_workbook.py <input>` | Backup before editing |
| `scripts/extract_twbx.py <input.twbx>` | Unzip packaged workbook |
| `scripts/list_calculations.py <file.twb>` | List all calcs as JSON |
| `scripts/validate_cleanup.py <file.twb>` | **Check all rules, output errors** |
| `scripts/validate_xml.py <file.twb>` | Check XML validity |
| `scripts/repackage_twbx.py <dir> <output.twbx>` | Repackage to .twbx |

## Safety Rules

1. **Backup first** - Always run backup_workbook.py
2. **Never modify `name` attributes** - Only edit `caption`
3. **Escape XML**: `&` -> `&amp;`, `'` -> `&apos;`
4. **Create `_cleaned` copy** - Don't overwrite original

## What You CAN and CANNOT Edit

### CAN EDIT (Safe)

| Element | Attribute | What to do |
|---------|-----------|------------|
| `<column>` | `caption` | Change to Title Case, remove underscores, remove c_ prefix |
| `<calculation>` | `formula` | ADD `// comment` at START (only if formula attribute already exists) |
| `<folders-common>` | (whole element) | CREATE if missing, add folders |
| `<folder>` | `name` | Use exact names from Folder Rules with HTML entity codes |
| `<folder-item>` | `name`, `type` | Reference calculation names |
| `<layout>` | `show-structure` | Set to `'true'` |

### CANNOT EDIT (Will Corrupt Workbook)

| Element | What NOT to do | Why |
|---------|----------------|-----|
| `<column>` | Change `name` attribute | Breaks all references to this field |
| `<calculation class='categorical-bin'>` | Add `formula` attribute | Bin/group calcs use XML structure, not formulas |
| `<calculation class='quantitative-bin'>` | Add `formula` attribute | Same - bins don't have formulas |
| Any `<calculation>` without `formula` | Add `formula` attribute | These are special calc types |
| Formulas with `&#13;&#10;` | Remove or change these | These are valid XML-encoded newlines |
| Formulas with `&amp;` | Change to `&amp;amp;` | Already properly encoded |
| `<column>` | Change `datatype`, `role`, `type` | Breaks field behavior |
| `<datasource>` | Change `name` or structure | Breaks data connections |

### STOP Conditions

If you encounter these, STOP and report - do NOT try to fix:
1. Validator says "newline not XML-encoded" but you see `&#13;&#10;` in raw XML - Validator bug
2. Validator says "unescaped &" but you see `&amp;` in raw XML - Validator bug
3. Validator says "missing comment" on a calc with no `formula` attribute - Can't add comment
4. Any error on `categorical-bin` or `quantitative-bin` calculations - Skip these

### Example: What a Proper Edit Looks Like

**BEFORE:**
```xml
<column caption='c_total_sales' name='[Calculation_123]'>
  <calculation formula='SUM([Sales])' />
</column>
```

**AFTER:**
```xml
<column caption='Total Sales' name='[Calculation_123]'>
  <calculation formula='// Aggregates all sales for the selected period&#13;&#10;SUM([Sales])' />
</column>
```

**NOTICE:**
- `caption` changed (safe)
- `formula` has comment ADDED at start (safe)
- `name` attribute UNCHANGED (critical!)
- `&#13;&#10;` used for newline (correct XML encoding)

## Reference Documents

Before starting, read these guides in the skill's `resources/` folder:
- `resources/comment-guide.md` - How to write meaningful comments (REQUIRED for M3)
- `resources/good-comments.md` - 50+ real examples by category
- `resources/xml-folders-guide.md` - How to create folders in XML

## Workflow

1. Backup workbook
2. Extract if .twbx
3. Run `validate_cleanup.py` to see all errors
4. Fix errors one category at a time
5. Run validation again
6. Repeat until 0 errors
7. Repackage if .twbx
8. Report changes

## Caption Rules

- Title Case with spaces (no underscores)
- No `c_` prefix
- Preserve acronyms: ID, YTD, MTD, KPI, ROI, YOY, MOM, WOW, LOD
- No double parentheses `()()`

## Comment Rules

Add `//` comment explaining PURPOSE at start of formula:
```xml
formula='// Flags at-risk accounts for dashboard highlight&#13;&#10;[Score] < 50'
```

Use `&#13;&#10;` for newlines. Escape `&` as `&amp;`.

### Comment Quality Requirements (M3 Validation)

Comments MUST:
- Be **15+ characters** of explanation
- Explain **WHY** (purpose), not just WHAT (formula description)
- NOT just restate the caption

Comments that FAIL M3:
- `// Calculated field` - too generic
- `// Sum` - too short (only 3 chars)
- `// Total Revenue` (if caption is "Total Revenue") - restates caption

See `resources/comment-guide.md` for detailed guidance.

### Batch Processing (Recommended)

Use `scripts/batch_comments.py` to process calculations 10 at a time:

```bash
python batch_comments.py workbook.twb init    # Create batches
python batch_comments.py workbook.twb next    # Show next 10 calcs
python batch_comments.py workbook.twb done 1  # Mark batch complete
python batch_comments.py workbook.twb status  # Check progress
```

This ensures you READ each formula before commenting.

## Folder Rules

Insert `<folders-common>` BEFORE `<layout>` with exactly 6 broad folders (use HTML entity codes):

```xml
<folders-common>
  <folder name='&#x1F4CA; Metrics'>
    <folder-item name='[Calculation_XXX]' type='field' />
  </folder>
</folders-common>
```

**6 Folders Only** (use HTML entity codes to avoid encoding issues):
| Folder | Entity Code | Contains |
|--------|-------------|----------|
| Metrics | `&#x1F4CA;` | KPIs, totals, margins, revenue, percentages, averages, growth |
| Dates | `&#x1F4C5;` | Date calcs, periods, fiscal, YTD/MTD/QTD, year, month, quarter |
| Filters | `&#x1F6A6;` | Booleans, flags, is_, has_, visibility, include/exclude, parameters |
| Display | `&#x1F3A8;` | Labels, tooltips, formatting, colors, text, UI elements, rankings |
| Projections | `&#x1F52E;` | Forecasts, targets, goals, budgets, predictions, estimates |
| Security | `&#x1F512;` | RLS, user-based filters, permissions, access control |

**IMPORTANT:** Use `&#x` entity format, NOT raw emoji characters (prevents encoding corruption).

**Note:** LOD calcs (FIXED/INCLUDE/EXCLUDE) go in the folder matching their PURPOSE, not technique.

## Report

```
=== Tableau Cleanup Complete ===
Workbook: <name>
Errors fixed: X
Output: <path>_cleaned.twbx
```

Related Skills

codebase-cleanup-tech-debt

16
from diegosouzapw/awesome-omni-skill

You are a technical debt expert specializing in identifying, quantifying, and prioritizing technical debt in software projects. Analyze the codebase to uncover debt, assess its impact, and create acti

ai-code-cleanup

16
from diegosouzapw/awesome-omni-skill

Remove AI-generated code slop from branches. Use after AI-assisted coding sessions to clean up defensive bloat, unnecessary comments, type casts, and style inconsistencies. Focuses on identifying and removing AI artifacts that degrade code quality.

codebase-cleanup-refactor-clean

16
from diegosouzapw/awesome-omni-skill

You are a code refactoring expert specializing in clean code principles, SOLID design patterns, and modern software engineering best practices. Analyze and refactor the provided code to improve its...

bgo

10
from diegosouzapw/awesome-omni-skill

Automates the complete Blender build-go workflow, from building and packaging your extension/add-on to removing old versions, installing, enabling, and launching Blender for quick testing and iteration.

Coding & Development

ui-ux-pro-max

16
from diegosouzapw/awesome-omni-skill

UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 9 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind, shadcn/ui). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient. Integrations: Component search and examples.

ui ux

16
from diegosouzapw/awesome-omni-skill

UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 9 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind, shadcn/ui). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient. Integrations: shadcn/ui MCP for component search and examples.

ui-ux-design

16
from diegosouzapw/awesome-omni-skill

UI/UX design reference database. 50+ styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient.

ui-skills

16
from diegosouzapw/awesome-omni-skill

Opinionated constraints for building better interfaces with agents.

ui-patterns

16
from diegosouzapw/awesome-omni-skill

Plaited UI patterns for templates, behavioral elements, and styling. Use when creating bElements or FunctionalTemplates, writing stories for testing, using createStyles, building form controls, or coordinating cross-island communication.

ui-engineering

16
from diegosouzapw/awesome-omni-skill

Expert system for creating high-quality, brand-aligned user interfaces. Use this skill when asked to design websites, create components, or implement specific visual styles. It contains specifications for major tech companies, design trends, and specific site types like blogs or presentations.

ui-development

16
from diegosouzapw/awesome-omni-skill

Generate production-ready Next.js projects with TypeScript, Tailwind CSS, shadcn/ui, and API integration. Use when the user asks to build, create, develop, or scaffold a Next.js application, web app, full-stack project, or frontend with backend integration. Prioritizes modern stack (Next.js 14+, TypeScript, shadcn/ui, axios, react-query) and best practices. Also triggers on requests to add features, integrate APIs, or extend existing Next.js projects.

ui-design

16
from diegosouzapw/awesome-omni-skill

Opinionated constraints for building better interfaces with agents. Use when building UI components, implementing animations, designing layouts, reviewing frontend accessibility, or working with Tailwind CSS, motion/react, or accessible primitives like Radix/Base UI.