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
data_sources.yamlto check if{name}exists as a registered source - •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
.knowledge/datasets/{name}/manifest.yamlexists - •If it doesn't exist, suggest: "Dataset '{name}' is registered but has no data brain. Run
/connect-datato set it up."
Step 3: Update the active pointer
- •Read
.knowledge/active.yaml - •Update
active_datasetto{name} - •Append to
switch_history(cap at 20 entries, FIFO) - •Write updated
.knowledge/active.yaml
Step 4: Confirm the switch
Read the target dataset's manifest.yaml and display:
code
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