Agent skill

Remap Ghost Variables

by owid in owid/etl

Fix ghost variable warnings by remapping charts from old to new variable IDs.

MITAuto-check passedData & Analytics

Install Remap Ghost Variables

skills CLI
$ npx skills add owid/etl --skill remap-ghost-variables -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install owid/etl remap-ghost-variables --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/owid/etl.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/remap-ghost-variables .claude/skills/remap-ghost-variables && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
remap-ghost-variables
GitHub stars
158
Token cost
~1.2k tokens
SKILL.md length
376 words
Files
1
Skills in repo
35
Repo updated
First seen
Licence
MIT

At a glance

Fix ghost variable warnings by remapping charts from old to new variable IDs.

  • Works in 6 steps: Create a staging PR → Identify the affected chart and old… → Find what the chart currently uses → …
  • ETL grapher step shows Variables used in charts will not be deleted automatically
  • SKILL.md covers When This Happens, Workflow and Guidelines
  • Calls make and python

What it does

Remap Ghost Variables is an agent skill from owid/etl. Fix ghost variable warnings by remapping charts from old to new variable IDs. Use when ETL grapher step shows "Variables used in charts will not be deleted automatically", when indicator shortnames were renamed and charts still reference old variables, or when the user mentions ghost variables, orphaned indicators, or chart variable remapping.

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Data & Analytics, covering Data pipelines and ETL. The repository describes itself as: A compute graph for loading and transforming OWID's data. The licence is MIT.

When your agent uses it

  • ETL grapher step shows Variables used in charts will not be deleted automatically
  • Indicator shortnames were renamed and charts still reference old variables
  • The user mentions ghost variables
  • Orphaned indicators

Example prompts

  • “Variables used in charts will not be deleted automatically”
  • “/remap-ghost-variables”

Requirements

  • Python 3

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Create a staging PR
  2. Identify the affected chart and old variables
  3. Find what the chart currently uses
  4. Find the new replacement variables
  5. Remap via the indicator upgrader (preferred)
  6. (fallback): Remap the chart via Admin API

What it can do on your machine

Read from SKILL.md and the folder at commit bf5dc8e. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • make
    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Remap Ghost Variables loads about 1.2k tokens when it runs. Until then it costs about 92 tokens; SKILL.md has 376 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~92
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from owid/etl at commit bf5dc8e, republished under its MIT licence (© owid). 376 words, ~1,242 tokens.

Download SKILL.mdSave it as .claude/skills/remap-ghost-variables/SKILL.md (or your agent's skills folder).
name
remap-ghost-variables
description
Fix ghost variable warnings by remapping charts from old to new variable IDs. Use when ETL grapher step shows "Variables used in charts will not be deleted automatically", when indicator short_names were renamed and charts still reference old variables, or when the user mentions ghost variables, orphaned indicators, or chart variable remapping.
metadata.internal
true
metadata.owner
Marigold

Remapping Ghost Variables

Fix charts that reference old (ghost) variable IDs after indicator short_names were renamed in a garden/grapher step.

When This Happens

After running a grapher step, you see a warning like:

[warning] Variables used in charts will not be deleted automatically.
  rows=   chartId  variableId
0     1234      56789
  variables=[56780, 56781, ..., 56789]

This means someone renamed indicator shortNames in the ETL step, creating new variables while charts still reference the old ones. The ETL can't delete the old variables because charts depend on them.

Workflow

Step 1: Create a staging PR

Create a PR first — all investigation and changes happen against the staging DB.

bash
.venv/bin/etl pr "Remap chart <chart_id> ghost variables for <dataset>" data

Wait for the staging server to come up.

Step 2: Identify the affected chart and old variables

From the warning, extract:

  • Chart IDs from the rows table (e.g., chart 1234)
  • Ghost variable IDs from the variables list

All queries below use make query which automatically targets the staging DB for the current branch.

Query the old variables to understand what was renamed:

bash
make query SQL="SELECT id, name, shortName FROM variables WHERE id IN (<ghost_variable_ids>)"
Step 3: Find what the chart currently uses
bash
make query SQL="SELECT variableId FROM chart_dimensions WHERE chartId = <chart_id>"

Then get details on each:

bash
make query SQL="SELECT id, name, shortName FROM variables WHERE id IN (<chart_variable_ids>)"
Step 4: Find the new replacement variables

The new variables are in the same dataset but with different shortNames. Get the dataset ID first:

bash
make query SQL="SELECT datasetId FROM variables WHERE id = <any_ghost_variable_id>"

Then search for the new variables. Look for the pattern difference between old and new shortNames:

bash
make query SQL="SELECT id, shortName FROM variables WHERE datasetId = <dataset_id> AND shortName LIKE '<pattern_matching_new_name>' AND id NOT IN (<ghost_variable_ids>)"

Compare old vs new shortNames to confirm the mapping. Common rename patterns:

  • Encoding changes (e.g., gte_40 → gt__40)
  • Prefix/suffix changes
  • Restructured naming conventions
Show full SKILL.md (154 more words)Show less
Step 5: Remap via the indicator upgrader (preferred)

Insert the mappings, then run the upgrader — it updates dimensions, map configs, sortBy, and narrative charts, and records the mapping in wiz__variable_mapping so chart diff picks it up:

bash
STAGING=<branch> .venv/bin/python -c "
from apps.wizard.utils.db import WizardDB
WizardDB.add_variable_mapping(
    mapping={<old_id>: <new_id>},
    dataset_id_old=<old_ds_id>, dataset_id_new=<new_ds_id>,
    comments='<why>')"
STAGING=<branch> .venv/bin/python -m apps.indicator_upgrade.cli upgrade --dry-run
STAGING=<branch> .venv/bin/python -m apps.indicator_upgrade.cli upgrade

Check WizardDB.get_variable_mapping_raw() first — upgrade applies all stored mappings, not just yours.

Step 5 (fallback): Remap the chart via Admin API

If the indicator upgrader can't be used, update the chart config manually on staging with AdminAPI:

python
from apps.chart_sync.admin_api import AdminAPI
from etl.config import OWIDEnv

env = OWIDEnv.from_staging('<branch_name>')
api = AdminAPI(env)

# Get current chart config
config = api.get_chart_config(<chart_id>)

# Remap old variable IDs to new ones
REMAP = {
    <old_var_id>: <new_var_id>,
    # ... add more mappings if multiple variables need remapping
}

for dim in config.get('dimensions', []):
    if dim['variableId'] in REMAP:
        old = dim['variableId']
        dim['variableId'] = REMAP[old]
        print(f'Remapped {old} -> {REMAP[old]}')

# Update the chart
result = api.update_chart(<chart_id>, config)
assert result['success'], f"Update failed: {result}"
print('Chart updated successfully')

Guidelines

  • Always use staging — never update charts directly on production
  • Verify the data is identical — the new variable should contain the same data as the old one, just with a different shortName
  • Handle multiple charts — the warning may list multiple chartId rows; remap all of them
  • Handle multiple variables per chart — a chart may reference several ghost variables; remap all in one update
  • Check for narrative charts — ghost variables may also be referenced by narrative charts (check chart_dimensions isn't the only reference)

© owid, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/remap-ghost-variables of owid/etl.

Open the folder on GitHubat commit bf5dc8e

Compare with similar skills

Remap Ghost Variables next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Remap Ghost Variables compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Remap Ghost Variables this skillowid/etl158—~1.2kAutomated safety check: PassMIT
Crawl4AI Web Scrapingsmallnest/goclaw5981 repos~2.5kAutomated safety check: PassMIT
Glue 09 10 Migrationaws-samples/aws-glue-samples1.5k—~2.4kAutomated safety check: PassMIT-0
Migrate Glue Devendpoint To Interactive Sessionsaws-samples/aws-glue-samples1.5k—~3.6kAutomated safety check: PassMIT-0
Dbt Databricks PR Readydatabricks/dbt-databricks380—~2.8kAutomated safety check: PassApache-2.0
Mz Dbt ReleaseMaterializeInc/materialize6.4k—~1.2kAutomated safety check: PassCustom licence

Similar skills

  • Crawl4AI Web Scraping

    smallnest/goclaw

    Scrapes sites, handles JavaScript-heavy pages and extracts structured data with Crawl4AI, through its crwl CLI or Python SDK, including schema-based extraction without an LLM.

    598 GitHub starsUsed in 1 repo~2.5k tokens
    Data & AnalyticsAuto-check passed
  • Glue 09 10 Migration

    aws-samples/aws-glue-samples

    Official

    Upgrade an AWS Glue ETL job from Glue version 0.9 or 1.0 to Glue 4.0.

    1.5k GitHub stars~2.4k tokensUpdated 1 mo ago
    Data & AnalyticsAuto-check passed
  • Official

    Migrate a legacy AWS Glue development endpoint to a Glue interactive session, following the official AWS migration checklist.

    1.5k GitHub stars~3.6k tokensUpdated 1 mo ago
    Data & AnalyticsAuto-check passed
  • Dbt Databricks PR Ready

    databricks/dbt-databricks

    Official

    A skill your agent uses for an open dbt-databricks pull request, including your own PR or a fork PR, to assess merge readiness and optionally repair selected gaps on the PR head branch.

    380 GitHub stars~2.8k tokensUpdated today
    Data & AnalyticsAuto-check passed
  • Mz Dbt Release

    MaterializeInc/materialize

    Cut a dbt-materialize PyPI release: bump the version in version.py and setup.py, date the Unreleased CHANGELOG entry, and open the release PR with a Ship: <url body.

    6.4k GitHub stars~1.2k tokensUpdated today
    Data & AnalyticsAuto-check passed
  • Erd Studio Setup

    liam-machine/erd-studio

    Friendly, step-by-step setup for ERD Studio in an existing dbt project, for people who may be new to dbt or data modelling.

    165 GitHub stars~8.5k tokensUpdated today
    Data & AnalyticsAuto-check passed

More from owid/etl

All 35 skills in this repo
  • Find every OWID surface that references a chart, indicator, MDIM, or explorer — articles (links vs embeds), explorers, narrative charts, data insights, static viz, key-chart slots, MDIM views.

    158 GitHub stars~4.9k tokensUpdated today
    Auto-check passed
  • Add a scatter view (with GDP per capita on x) to existing OWID charts via the admin API, mirroring the admin UI's "Add scatter type" defaults, then retire the old standalone "X vs.

    158 GitHub stars~19k tokensUpdated today
    Auto-check passed
  • Add new survey question codes (e.g. An agent skill from owid/etl.

    158 GitHub stars~11k tokensUpdated today
    Auto-check: notes
  • Build or refresh an OWID static visualization end to end — resolve what data it needs from an old static viz image, an indicator, or a grapher chart; check both the ETL catalog and the producer's…

    158 GitHub stars~8.3k tokensUpdated today
    Auto-check passed
  • Propose redirects from (soon-to-sunset) grapher charts to the matching views of published MDIMs.

    158 GitHub stars~9.6k tokensUpdated today
    Auto-check: notes
  • Take (soon-to-sunset) OWID explorers to redirected MDIMs, end to end.

    158 GitHub stars~7.3k tokensUpdated today
    Auto-check: notes

Questions about Remap Ghost Variables

What does Remap Ghost Variables do?

Fix ghost variable warnings by remapping charts from old to new variable IDs. Remap Ghost Variables is an agent skill from owid/etl. Fix ghost variable warnings by remapping charts from old to new variable IDs.

When should I use Remap Ghost Variables?

Remap Ghost Variables fits situations like: ETL grapher step shows Variables used in charts will not be deleted automatically; indicator shortnames were renamed and charts still reference old variables; the user mentions ghost variables; orphaned indicators.

How do I install Remap Ghost Variables in Claude Code?

Run `npx skills add owid/etl --skill remap-ghost-variables -a claude-code`. Or copy the skill folder (.claude/skills/remap-ghost-variables in owid/etl) into .claude/skills/remap-ghost-variables in your project. Claude Code loads it when a task matches its description.

How do I install Remap Ghost Variables in Codex?

Run `npx skills add owid/etl --skill remap-ghost-variables -a codex`. Or copy the skill folder (.claude/skills/remap-ghost-variables in owid/etl) into .agents/skills/remap-ghost-variables in your project. Codex loads it when a task matches its description.

Can I use Remap Ghost Variables in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add owid/etl --skill remap-ghost-variables -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/remap-ghost-variables, .gemini/skills/remap-ghost-variables, .github/skills/remap-ghost-variables and .opencode/skills/remap-ghost-variables in your project.

What does Remap Ghost Variables need to run?

Going by SKILL.md and its folder, Remap Ghost Variables needs the command-line tools its instructions call (make and python). Our summary lists: Python 3.

Does Remap Ghost Variables access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Remap Ghost Variables safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Remap Ghost Variables use?

Remap Ghost Variables is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Remap Ghost Variables use?

About 1.2k tokens (SKILL.md is roughly 5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Remap Ghost Variables?

Skills that share tags, products or a category with Remap Ghost Variables: Crawl4AI Web Scraping (smallnest/goclaw, 598 stars), Glue 09 10 Migration (aws-samples/aws-glue-samples, 1.5k stars), Migrate Glue Devendpoint To Interactive Sessions (aws-samples/aws-glue-samples, 1.5k stars) and Dbt Databricks PR Ready (databricks/dbt-databricks, 380 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Remap Ghost Variables?

owid (a GitHub organization) maintains it in owid/etl, which has 158 GitHub stars. The repository holds 35 skills in this directory. The repository was last updated on October 8, 2026.

Source: owid/etl on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.