Agent Skillslangchain-ai/deepagents › schema-exploration

schema-exploration

GitHub

用于探索数据库结构,列出表、查看列类型、主外键及实体关系映射。适用于查询表结构、ERD或数据模型分析场景。

examples/text-to-sql-agent/skills/schema-exploration/SKILL.md langchain-ai/deepagents

Trigger Scenarios

查询数据库有哪些表 查看特定表的字段和数据类型 分析表之间的关联关系 生成或理解数据库ERD

Install

npx skills add langchain-ai/deepagents --skill schema-exploration -g -y
More Options

Non-standard path

npx skills add https://github.com/langchain-ai/deepagents/tree/main/examples/text-to-sql-agent/skills/schema-exploration -g -y

Use without installing

npx skills use langchain-ai/deepagents@schema-exploration

指定 Agent (Claude Code)

npx skills add langchain-ai/deepagents --skill schema-exploration -a claude-code -g -y

安装 repo 全部 skill

npx skills add langchain-ai/deepagents --all -g -y

预览 repo 内 skill

npx skills add langchain-ai/deepagents --list

SKILL.md

Frontmatter
{
    "name": "schema-exploration",
    "description": "Lists tables, describes columns and data types, identifies foreign key relationships, and maps entity relationships in a database. Use when the user asks about database schema, table structure, column types, what tables exist, ERD, foreign keys, or how entities relate."
}

Schema Exploration Skill

Workflow

1. List All Tables

Use sql_db_list_tables tool to see all available tables in the database.

This returns the complete list of tables you can query.

2. Get Schema for Specific Tables

Use sql_db_schema tool with table names to examine:

  • Column names - What fields are available
  • Data types - INTEGER, TEXT, DATETIME, etc.
  • Sample data - 3 example rows to understand content
  • Primary keys - Unique identifiers for rows
  • Foreign keys - Relationships to other tables

3. Map Relationships

Identify how tables connect:

  • Look for columns ending in "Id" (e.g., CustomerId, ArtistId)
  • Foreign keys link to primary keys in other tables
  • Document parent-child relationships

4. Answer the Question

Provide clear information about:

  • Available tables and their purpose
  • Column names and what they contain
  • How tables relate to each other
  • Sample data to illustrate content

Example: "What tables are available?"

Step 1: Use sql_db_list_tables

Response:

The Chinook database has 11 tables:
1. Artist - Music artists
2. Album - Music albums
3. Track - Individual songs
4. Genre - Music genres
5. MediaType - File formats (MP3, AAC, etc.)
6. Playlist - User-created playlists
7. PlaylistTrack - Tracks in playlists
8. Customer - Store customers
9. Employee - Store employees
10. Invoice - Customer purchases
11. InvoiceLine - Individual items in invoices

Example: "What columns does the Customer table have?"

Step 1: Use sql_db_schema with table name "Customer"

Response:

The Customer table has these columns:

- CustomerId (INTEGER) - Primary key, unique customer ID
- FirstName (NVARCHAR) - Customer's first name
- LastName (NVARCHAR) - Customer's last name
- Company (NVARCHAR) - Company name (optional)
- Address, City, State, Country, PostalCode - Location fields
- Phone (NVARCHAR) - Phone number
- Fax (NVARCHAR) - Fax number
- Email (NVARCHAR) - Email address
- SupportRepId (INTEGER) - Foreign key to Employee table

Sample data shows customers like:
- Luís Gonçalves from Brazil
- Leonie Köhler from Germany
- François Tremblay from Canada

Example: "How do I find revenue by artist?"

Step 1: Identify tables needed

  • Artist (has artist names)
  • Album (links artists to tracks)
  • Track (links albums to sales)
  • InvoiceLine (has sales data)
  • Invoice (has revenue totals)

Step 2: Map relationships

Artist (ArtistId)
  ↓ 1:many
Album (ArtistId, AlbumId)
  ↓ 1:many
Track (AlbumId, TrackId)
  ↓ 1:many
InvoiceLine (TrackId, UnitPrice, Quantity)

Response:

To find revenue by artist, you'll need to:
1. Start with the Artist table
2. JOIN to Album on ArtistId
3. JOIN to Track on AlbumId
4. JOIN to InvoiceLine on TrackId
5. SUM the revenue (UnitPrice * Quantity)
6. GROUP BY artist name

This requires the query-writing skill to execute.

Quality Guidelines

For "list tables" questions:

  • Show all table names
  • Add brief descriptions of what each contains
  • Group related tables (e.g., music catalog, transactions, people)

For "describe table" questions:

  • List all columns with data types
  • Explain what each column contains
  • Show sample data for context
  • Note primary and foreign keys
  • Explain relationships to other tables

For "how do I query X" questions:

  • Identify required tables
  • Map the JOIN path
  • Explain the relationship chain
  • Suggest next steps (use query-writing skill)

Version History

  • 1e4f507 Current 2026-08-20 16:33

Same Skill Collection

.agents/skills/textual-screenshot/SKILL.md
examples/content-builder-agent/skills/blog-post/SKILL.md
examples/content-builder-agent/skills/social-media/SKILL.md
examples/deploy-coding-agent/skills/code-review/SKILL.md
examples/deploy-coding-agent/skills/coding-prefs/SKILL.md
examples/deploy-coding-agent/skills/planning/SKILL.md
examples/deploy-content-writer/skills/blog-post/SKILL.md
examples/deploy-content-writer/skills/social-media/SKILL.md
examples/deploy-gtm-agent/skills/competitor-analysis/SKILL.md
examples/nvidia_deep_agent/skills/cudf-analytics/SKILL.md
examples/nvidia_deep_agent/skills/cuml-machine-learning/SKILL.md
examples/nvidia_deep_agent/skills/data-visualization/SKILL.md
examples/nvidia_deep_agent/skills/gpu-document-processing/SKILL.md
examples/text-to-sql-agent/skills/query-writing/SKILL.md
libs/cli/examples/skills/arxiv-search/SKILL.md
libs/cli/examples/skills/langgraph-docs/SKILL.md
libs/cli/examples/skills/web-research/SKILL.md
libs/code/deepagents_code/built_in_skills/deepagents-thread-inspector/SKILL.md
libs/code/deepagents_code/built_in_skills/remember/SKILL.md
libs/code/examples/skills/arxiv-search/SKILL.md
libs/code/examples/skills/langgraph-docs/SKILL.md
libs/code/examples/skills/web-research/SKILL.md
libs/cli/examples/skills/skill-creator/SKILL.md
libs/code/deepagents_code/built_in_skills/skill-creator/SKILL.md
libs/code/examples/skills/skill-creator/SKILL.md

Metadata

Files
0
Version
28e5218
Hash
8560156d
Indexed
2026-08-20 16:33

inicio - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-30 05:52
浙ICP备14020137号-1 $mapa de visitantes$