install
source · Clone the upstream repo
git clone https://github.com/ai-analyst-lab/ai-analyst
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ai-analyst-lab/ai-analyst "$T" && mkdir -p ~/.claude/skills && cp -r "$T/.claude/skills/switch-dataset" ~/.claude/skills/ai-analyst-lab-ai-analyst-switch-dataset && rm -rf "$T"
manifest:
.claude/skills/switch-dataset/skill.mdsource content
Skill: Switch Dataset
Purpose
Change the active dataset. Updates the active pointer, validates the target dataset exists, and confirms with a summary of what's now active.
When to Use
Invoke as
/switch-dataset {name} when the user wants to analyze a different dataset than the currently active one.
Instructions
Step 1: Validate the target dataset
- Read
to check ifdata_sources.yaml
exists as a registered source{name} - If not found, try fuzzy matching (case-insensitive, partial match)
- If still not found, list available datasets and ask user to choose
Step 2: Validate the data brain exists
- Check that
exists.knowledge/datasets/{name}/manifest.yaml - If it doesn't exist, suggest: "Dataset '{name}' is registered but has no data brain. Run
to set it up."/connect-data
Step 3: Update the active pointer
- Read
.knowledge/active.yaml - Update
toactive_dataset{name} - Append to
(cap at 20 entries, FIFO)switch_history - Write updated
.knowledge/active.yaml
Step 4: Confirm the switch
Read the target dataset's
manifest.yaml and display:
Switched to: {display_name} Tables: {table_count} Date range: {date_range} Connection: {connection.type} ({connection.database}.{connection.schema}) Last analysis: {last_used or "none"} Metrics defined: {count from metrics/index.yaml or 0}
Anti-Patterns
- Never silently switch — always confirm with a summary
- Never switch mid-analysis — if working/ has artifacts from the previous dataset, warn: "You have in-progress work for {old_dataset}. Switch anyway?"
- Never infer the dataset — only switch when explicitly requested via this skill