Professional Definition: The ability to identify which database, table bundle, or evidence-bearing source should be queried before any SQL is written, especially when the user question is asked in an open-domain or multi-database setting.
Dimension Hierarchy: Environment Grounding->Retrieval and Alignment->source retrieval
Real Case
[Case 1]
Initial Environment: A large open collection of tabular sources is available, but the relevant table is not preselected. The agent starts only with the natural-language question and a retrieval interface over many candidate tables.
Real Question: What is the highest eligible free rate for K-12 students in the schools in Alameda County?
Real Answer: The agent must first retrieve the correct school-related table for Alameda County before the final SQL can be written and executed.
Why this demonstrates the capability: This task is not hard because of exotic SQL syntax alone. It tests whether the agent can localize the correct source table from a larger corpus, avoid semantically nearby but irrelevant tables, and only then translate the question into executable SQL. A SQL agent that skips this retrieval step will often produce syntactically plausible but evidentially ungrounded queries.
[Case 2]
Initial Environment: A multi-database environment contains several semantically similar schemas. The agent receives a user request but the target database is not explicitly named.
Real Question: which semester the master and the bachelor both got enrolled in
Real Trajectory: Retrieve candidate databases, inspect returned schema fragments, notice that a required degree_program relation is missing from the current candidate set, expand retrieval, and only then write the final SQL.
Real Answer: A correct answer requires bringing the missing target database schema into context before composing SQL.
Why this demonstrates the capability: The question is deceptively short and underspecified. It demonstrates source retrieval because the key failure mode is not merely choosing the wrong column but failing to recall the correct database at all. The successful trajectory therefore begins with retrieval repair rather than immediate SQL drafting.
Pipeline Execution Instructions
To synthesize data for this capability, you must strictly follow a 3-phase pipeline. Do not hallucinate steps. Read the corresponding reference file for each phase sequentially:
Phase 1: Environment Exploration
Read the exploration guidelines to discover raw knowledge seeds:
references/EXPLORATION.md
Phase 2: Trajectory Selection
Once Phase 1 is complete, read the selection criteria to evaluate the trajectory:
references/SELECTION.md
Phase 3: Data Synthesis
Once a trajectory passes Phase 2, read the synthesis instructions to generate the final data:
references/SYNTHESIS.md
1---2name: source-retrieval-23description: Skill: source retrieval4---56# Skill: source retrieval78## 1. Capability Definition & Real Case9* **Professional Definition**: The ability to identify which database, table bundle, or evidence-bearing source should be queried before any SQL is written, especially when the user question is asked in an open-domain or multi-database setting.10* **Dimension Hierarchy**: Environment Grounding->Retrieval and Alignment->source retrieval1112### Real Case13**[Case 1]**14* **Initial Environment**: A large open collection of tabular sources is available, but the relevant table is not preselected. The agent starts only with the natural-language question and a retrieval interface over many candidate tables.15* **Real Question**: What is the highest eligible free rate for K-12 students in the schools in Alameda County?16* **Real Answer**: The agent must first retrieve the correct school-related table for Alameda County before the final SQL can be written and executed.17* **Why this demonstrates the capability**: This task is not hard because of exotic SQL syntax alone. It tests whether the agent can localize the correct source table from a larger corpus, avoid semantically nearby but irrelevant tables, and only then translate the question into executable SQL. A SQL agent that skips this retrieval step will often produce syntactically plausible but evidentially ungrounded queries.1819---20**[Case 2]**21* **Initial Environment**: A multi-database environment contains several semantically similar schemas. The agent receives a user request but the target database is not explicitly named.22* **Real Question**: which semester the master and the bachelor both got enrolled in23* **Real Trajectory**: Retrieve candidate databases, inspect returned schema fragments, notice that a required degree_program relation is missing from the current candidate set, expand retrieval, and only then write the final SQL.24* **Real Answer**: A correct answer requires bringing the missing target database schema into context before composing SQL.25* **Why this demonstrates the capability**: The question is deceptively short and underspecified. It demonstrates source retrieval because the key failure mode is not merely choosing the wrong column but failing to recall the correct database at all. The successful trajectory therefore begins with retrieval repair rather than immediate SQL drafting.2627## Pipeline Execution Instructions28To synthesize data for this capability, you must strictly follow a 3-phase pipeline. **Do not hallucinate steps.** Read the corresponding reference file for each phase sequentially:29301. **Phase 1: Environment Exploration**31 Read the exploration guidelines to discover raw knowledge seeds:32 `references/EXPLORATION.md`33342. **Phase 2: Trajectory Selection**35 Once Phase 1 is complete, read the selection criteria to evaluate the trajectory:36 `references/SELECTION.md`37383. **Phase 3: Data Synthesis**39 Once a trajectory passes Phase 2, read the synthesis instructions to generate the final data:40 `references/SYNTHESIS.md`
Run npx skillmds@latest add dingxingdi/source-retrieval-2 in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Skill: source retrieval It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
dingxingdi (@dingxingdi) published this skill. Their other Agent Skills are listed on their SkillMD profile.