Awesome-omni-skill tableau-cleanup
Clean up Tableau workbooks by standardizing captions, adding comments, and organizing into folders.
install
source · Clone the upstream repo
git clone https://github.com/diegosouzapw/awesome-omni-skill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/diegosouzapw/awesome-omni-skill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/development/tableau-cleanup" ~/.claude/skills/diegosouzapw-awesome-omni-skill-tableau-cleanup && rm -rf "$T"
manifest:
skills/development/tableau-cleanup/SKILL.mdsource content
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 |
|---|---|
| Backup before editing |
| Unzip packaged workbook |
| List all calcs as JSON |
| Check all rules, output errors |
| Check XML validity |
| Repackage to .twbx |
Safety Rules
- Backup first - Always run backup_workbook.py
- Never modify
attributes - Only editnamecaption - Escape XML:
->&
,&
->'' - Create
copy - Don't overwrite original_cleaned
What You CAN and CANNOT Edit
CAN EDIT (Safe)
| Element | Attribute | What to do |
|---|---|---|
| | Change to Title Case, remove underscores, remove c_ prefix |
| | ADD at START (only if formula attribute already exists) |
| (whole element) | CREATE if missing, add folders |
| | Use exact names from Folder Rules with HTML entity codes |
| , | Reference calculation names |
| | Set to |
CANNOT EDIT (Will Corrupt Workbook)
| Element | What NOT to do | Why |
|---|---|---|
| Change attribute | Breaks all references to this field |
| Add attribute | Bin/group calcs use XML structure, not formulas |
| Add attribute | Same - bins don't have formulas |
Any without | Add attribute | These are special calc types |
Formulas with | Remove or change these | These are valid XML-encoded newlines |
Formulas with | Change to | Already properly encoded |
| Change , , | Breaks field behavior |
| Change or structure | Breaks data connections |
STOP Conditions
If you encounter these, STOP and report - do NOT try to fix:
- Validator says "newline not XML-encoded" but you see
in raw XML - Validator bug - Validator says "unescaped &" but you see
in raw XML - Validator bug& - Validator says "missing comment" on a calc with no
attribute - Can't add commentformula - Any error on
orcategorical-bin
calculations - Skip thesequantitative-bin
Example: What a Proper Edit Looks Like
BEFORE:
<column caption='c_total_sales' name='[Calculation_123]'> <calculation formula='SUM([Sales])' /> </column>
AFTER:
<column caption='Total Sales' name='[Calculation_123]'> <calculation formula='// Aggregates all sales for the selected period SUM([Sales])' /> </column>
NOTICE:
changed (safe)caption
has comment ADDED at start (safe)formula
attribute UNCHANGED (critical!)name
used for newline (correct XML encoding)
Reference Documents
Before starting, read these guides in the skill's
resources/ folder:
- How to write meaningful comments (REQUIRED for M3)resources/comment-guide.md
- 50+ real examples by categoryresources/good-comments.md
- How to create folders in XMLresources/xml-folders-guide.md
Workflow
- Backup workbook
- Extract if .twbx
- Run
to see all errorsvalidate_cleanup.py - Fix errors one category at a time
- Run validation again
- Repeat until 0 errors
- Repackage if .twbx
- Report changes
Caption Rules
- Title Case with spaces (no underscores)
- No
prefixc_ - Preserve acronyms: ID, YTD, MTD, KPI, ROI, YOY, MOM, WOW, LOD
- No double parentheses
()()
Comment Rules
Add
// comment explaining PURPOSE at start of formula:
formula='// Flags at-risk accounts for dashboard highlight [Score] < 50'
Use
for newlines. Escape & as &.
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:
- too generic// Calculated field
- too short (only 3 chars)// Sum
(if caption is "Total Revenue") - restates caption// Total Revenue
See
resources/comment-guide.md for detailed guidance.
Batch Processing (Recommended)
Use
scripts/batch_comments.py to process calculations 10 at a time:
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):
<folders-common> <folder name='📊 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 | | KPIs, totals, margins, revenue, percentages, averages, growth |
| Dates | | Date calcs, periods, fiscal, YTD/MTD/QTD, year, month, quarter |
| Filters | | Booleans, flags, is_, has_, visibility, include/exclude, parameters |
| Display | | Labels, tooltips, formatting, colors, text, UI elements, rankings |
| Projections | | Forecasts, targets, goals, budgets, predictions, estimates |
| Security | | 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