switch-dataset
Skill304 starsChanged 2 months agoMITView on GitHub
Change the active dataset to switch between different data sources for analysis. Use this skill whenever the user wants to analyze a different dataset, switch to another database, change data sources, work with different tables, or explicitly invokes /switch-dataset. This skill handles the full switch workflow: validating the target dataset exists, checking for in-progress work that might be lost, updating the active pointer, and confirming the switch with a summary of the new dataset. Apply when users say things like "switch to sales data", "use the other dataset", "change to production database", "work with the marketing tables instead", "let's look at last month's data instead", "/switch-dataset analytics", or any request to change which dataset is currently being analyzed. Also trigger when starting a new analysis if the user mentions a dataset name that differs from the currently active one.
In this repository65 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- always-compareSkill
- analysis-designSkill
- analyst-coreSkill
- archaeologySkill
- archive-analysisSkill
- auth-preflightSkill
- businessSkill
- causalSkill
- chart-to-driveSkill
- close-the-loopSkill
- codex-reviewSkill
- compare-datasetsSkill
- connect-dataSkill
- connect-snowflakeSkill
- context-compareSkill
- context-traceSkill
- data-inspectSkill
- data-mapSkill
- data-profilingSkill
- data-quality-checkSkill
- datasetsSkill
- distribution-profilerSkill
- evalSkill
- evaluate-graderSkill
- experiment-briefSkill
- experimentSkill
- exploreSkill
- exportSkill
- forecastSkill
- google-doc-exportSkill
- google-slides-exportSkill
- guardrailsSkill
- historySkill
- improve-contextSkill
- knowledge-bootstrapSkill
- log-correctionSkill
- maintain-contextSkill
- metric-specSkill
- metricsSkill
- monitor-evalsSkill
- notion-exportSkill
- paceSkill
- patternsSkill
- question-framingSkill
- question-routerSkill
- reliabilitySkill
- resume-pipelineSkill
- run-pipelineSkill
- runsSkill
- score-analysisSkill
- session-handoffSkill
- setup-dev-contextSkill
- setup-notionSkill
- setupSkill
- setup-slackSkill
- setup-snowflakeSkill
- srm-checkSkill
- stakeholder-communicationSkill
- stress-testSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
19 rules. About 0 are common, 10 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 21
If {name} matches exactly (case-insensitive), proceed to Step 2
- Distinctive: line 22
If not found, try fuzzy matching:
- Very specific: line 23
Check if {name} is a substring of any dataset name (e.g., "marketing" would match "marketing-prod")
- Distinctive: line 25
If exactly one match found, use that dataset and inform user: "Matched '{name}' to '{actual_dataset_name}'"
- Distinctive: line 26
If multiple matches found, list all matches and ask user to choose
- Very specific: line 27
If still not found, list all available datasets with brief descriptions (from manifests) and ask user to choose or suggest running …
- Very specific: line 31
Read .knowledge/active.yaml to get the current active_dataset
- Very specific: line 32
If {name} matches the current active dataset (case-insensitive):
- Distinctive: line 36
STOP here (do not proceed to Step 3)
- Very specific: line 40
Check that .knowledge/datasets/{name}/manifest.yaml exists
- Very specific: line 41
If it doesn't exist, suggest: "Dataset '{name}' directory exists but has no manifest.
- Distinctive: line 42
If manifest is missing, STOP (do not proceed)
- Distinctive: line 51
If 3 or more files exist:
- Distinctive: line 57
If user says "no" or "cancel" or "wait": STOP immediately and inform them the switch was cancelled
- Distinctive: line 58
If user says "yes" or "continue" or "proceed": Continue to Step 5
- Distinctive: line 59
If fewer than 3 files exist, proceed directly to Step 5 (no confirmation needed — minimal risk of context loss)
- Very specific: line 64
Update active_dataset to {name} (use the exact case from the manifest)
- Very specific: line 69
Read the target dataset's manifest.yaml and display a confirmation summary using this format:
- Distinctive: line 90
If the user had in-progress work and proceeded anyway, add a reminder for how to switch back:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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
- List available datasets by checking
.knowledge/datasets/directory for subdirectories withmanifest.yamlfiles - Normalize the target name to lowercase for comparison (handles SALES-DATA → sales-data)
- If
{name}matches exactly (case-insensitive), proceed to Step 2 - If not found, try fuzzy matching:
- Check if
{name}is a substring of any dataset name (e.g., "marketing" would match "marketing-prod") - Case-insensitive partial match
- If exactly one match found, use that dataset and inform user: "Matched '{name}' to '{actual_dataset_name}'"
- If multiple matches found, list all matches and ask user to choose
- Check if
- If still not found, list all available datasets with brief descriptions (from manifests) and ask user to choose or suggest running
/connect-datato add a new dataset
Step 2: Check if already active
- Read
.knowledge/active.yamlto get the currentactive_dataset - If
{name}matches the current active dataset (case-insensitive):- Inform the user: "The {name} dataset is already active."
- Display the current dataset summary (same format as Step 6)
- List other available datasets they could switch to instead
- STOP here (do not proceed to Step 3)
Step 3: Validate the data brain exists
- Check that
.knowledge/datasets/{name}/manifest.yamlexists - If it doesn't exist, suggest: "Dataset '{name}' directory exists but has no manifest. Run
/connect-datato set it up." - If manifest is missing, STOP (do not proceed)
Step 4: Check for in-progress work (CRITICAL SAFETY CHECK)
This step prevents accidental loss of analytical work. When you switch datasets, files in working/ become contextually orphaned — they contain SQL queries, charts, and data tied to the OLD dataset's schema and tables, which won't match the NEW dataset's structure. This doesn't delete the files, but it makes resuming that work much harder because the context has changed.
Why explicit confirmation is required: Users often have hours of work in the working/ directory. A dataset switch mid-analysis can make that work difficult or impossible to resume without manually reconnecting the artifacts to the original dataset.
- List all files in
working/directory (exclude.gitkeepand hidden files like.DS_Store) - If 3 or more files exist:
- Warn: "⚠️ You have {count} files in progress for {old_dataset}, including: [list first 3-5 files]. Switching datasets now may make that work harder to resume. Continue anyway?"
- Provide two explicit options:
- "Type 'yes' to proceed with the switch"
- "Type 'no' to cancel and stay on {old_dataset}"
- HALT and wait for user response
- If user says "no" or "cancel" or "wait": STOP immediately and inform them the switch was cancelled
- If user says "yes" or "continue" or "proceed": Continue to Step 5
- If fewer than 3 files exist, proceed directly to Step 5 (no confirmation needed — minimal risk of context loss)
Step 5: Update the active pointer
- Read
.knowledge/active.yaml - Update
active_datasetto{name}(use the exact case from the manifest) - Write updated
.knowledge/active.yaml
Step 6: Confirm the switch
Read the target dataset's manifest.yaml and display a confirmation summary using this format:
✓ Switched to: {name}
Tables: {count of tables in manifest}
Date range: {date_range.start} to {date_range.end} (or "not specified" if missing)
Connection: {connection_type}
Last analysis: {last_used or "never"}
Row counts: {summary of top 3 tables by row count with table names, or list all if ≤3 tables}Example:
✓ Switched to: analytics_prod
Tables: 6
Date range: 2024-01-01 to 2026-03-31
Connection: snowflake
Last analysis: 2026-04-01
Row counts: fct_orders (245K), fct_sessions (1.2M), dim_users (89K)If the user had in-progress work and proceeded anyway, add a reminder for how to switch back:
→ To return to {old_dataset}, run: /switch-dataset {old_dataset}Anti-Patterns
- Never silently switch — always confirm with a summary
- Never skip the in-progress work check — if working/ has 3+ artifacts, HALT and require explicit user confirmation before proceeding
- Never infer the dataset — only switch when explicitly requested via this skill
- Never fail on case mismatch — normalize to lowercase for comparison (SALES-DATA should match sales-data)
- Never assume data_sources.yaml exists or is populated — it may be empty, use
.knowledge/datasets/directory listing as source of truth - Never re-switch to an already-active dataset — detect this in Step 2 and inform user instead of performing redundant operations
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

