Run SQL over your AWS data lake with Athena.
From the AWS agent toolkit. Your agent runs and manages Amazon Athena SQL queries across default and federated catalogs such as Glue, S3 Tables and Redshift.
Install this skill
npx skills add https://github.com/aws/agent-toolkit-for-aws --skill querying-data-lakeRuns the open-source skills CLI in your own terminal. It asks which agents to add the skill to. Read what it tells your agent to do before you install it.
Install for your agent
Claude Code
Run this in your project
npx skills add https://github.com/aws/agent-toolkit-for-aws --skill querying-data-lake -a claude-codeAdd
-gto install it for every project instead.Or ask Claude Code to do it
Install the "querying-data-lake" skill from https://github.com/aws/agent-toolkit-for-aws for Claude Code. Copy the skill folder (the one containing SKILL.md, with any scripts or reference files next to it) into .claude/skills/ in this project. Before copying, show me the SKILL.md and list any scripts it includes, and wait for me to confirm.
Or copy the folder yourself
Unzip the download into
.claude/skills/for this project, or~/.claude/skills/for all your projects.Picked up in the current session, no restart needed.
Claude Code skills docsClaude.aiNot supported
This skill is marked as not working in Claude.ai, usually because it needs a terminal or files that Claude.ai does not have.
Claude.ai skills docsChatGPTNot supported
This skill is marked as not working in ChatGPT, usually because it needs a terminal or files that ChatGPT does not have.
ChatGPT skills docsCodex
Run this in your project
npx skills add https://github.com/aws/agent-toolkit-for-aws --skill querying-data-lake -a codexAdd
-gto install it for every project instead.Or ask Codex to do it
Install the "querying-data-lake" skill from https://github.com/aws/agent-toolkit-for-aws for Codex. Copy the skill folder (the one containing SKILL.md, with any scripts or reference files next to it) into .agents/skills/ in this project. Before copying, show me the SKILL.md and list any scripts it includes, and wait for me to confirm.
Or copy the folder yourself
Unzip the download into
.agents/skills/for this project, or~/.agents/skills/for all your projects.Restart Codex if the skill does not show up.
Codex skills docsCursor
Run this in your project
npx skills add https://github.com/aws/agent-toolkit-for-aws --skill querying-data-lake -a cursorAdd
-gto install it for every project instead.Or ask Cursor to do it
Install the "querying-data-lake" skill from https://github.com/aws/agent-toolkit-for-aws for Cursor. Copy the skill folder (the one containing SKILL.md, with any scripts or reference files next to it) into .cursor/skills/ in this project. Before copying, show me the SKILL.md and list any scripts it includes, and wait for me to confirm.
Or copy the folder yourself
Unzip the download into
.cursor/skills/for this project, or~/.cursor/skills/for all your projects.Run it by typing / and the skill name in chat.
Cursor skills docsGitHub Copilot
Run this in your project
npx skills add https://github.com/aws/agent-toolkit-for-aws --skill querying-data-lake -a github-copilotAdd
-gto install it for every project instead.Or ask GitHub Copilot to do it
Install the "querying-data-lake" skill from https://github.com/aws/agent-toolkit-for-aws for GitHub Copilot. Copy the skill folder (the one containing SKILL.md, with any scripts or reference files next to it) into .github/skills/ in this project. Before copying, show me the SKILL.md and list any scripts it includes, and wait for me to confirm.
Or copy the folder yourself
Unzip the download into
.github/skills/for this project, or~/.copilot/skills/for all your projects.Works in Copilot CLI, the cloud agent and agent mode in VS Code and JetBrains.
GitHub Copilot skills docsAntigravity
Run this in your project
npx skills add https://github.com/aws/agent-toolkit-for-aws --skill querying-data-lake -a antigravityAdd
-gto install it for every project instead.Or ask Antigravity to do it
Install the "querying-data-lake" skill from https://github.com/aws/agent-toolkit-for-aws for Antigravity. Copy the skill folder (the one containing SKILL.md, with any scripts or reference files next to it) into .agents/skills/ in this project. Before copying, show me the SKILL.md and list any scripts it includes, and wait for me to confirm.
Antigravity skills docsOr copy the folder yourself
Unzip the download into
.agents/skills/for this project, or~/.gemini/config/skills/for all your projects.Gemini CLI
Run this in your project
npx skills add https://github.com/aws/agent-toolkit-for-aws --skill querying-data-lake -a gemini-cliAdd
-gto install it for every project instead.Or ask Gemini CLI to do it
Install the "querying-data-lake" skill from https://github.com/aws/agent-toolkit-for-aws for Gemini CLI. Copy the skill folder (the one containing SKILL.md, with any scripts or reference files next to it) into .gemini/skills/ in this project. Before copying, show me the SKILL.md and list any scripts it includes, and wait for me to confirm.
Or copy the folder yourself
Unzip the download into
.gemini/skills/for this project, or~/.gemini/skills/for all your projects.Run /skills to check it was found.
Gemini CLI skills docs
- Installs
- 5.2K via skills.sh
- GitHub
- 2.6K stars ↗
- Last updated
- 11 Sept 2026
- Licence
- Apache-2.0
Security checks
Run by independent scanners and published on skills.sh. Their results, not a Viberation review.
- 14 May 2026
Gen Agent Trust Hub Pass
This skill provides a structured framework for managing and executing Amazon Athena SQL queries. It emphasizes security best practices, such as classifying SQL statements to identify potentially destructive operations and requiring user confirmation before execution. No security issues were detected.
- 14 May 2026
Socket Pass
No alerts
- 14 May 2026
Snyk Pass
Risk: LOW · No issues
What's inside (3 files)
references/query-patterns.md5K charsreferences/workgroup-selection.md3.9K charsSKILL.md7.7K chars
SKILL.md, first part. Shown as plain text.
---
name: querying-data-lake
description: >-
Execute and manage Athena SQL queries across default and federated catalogs (Glue,
S3 Tables, Redshift). Triggers on phrases like: query data, run SQL, athena query,
analyze table, SQL query, workgroup status, profile table, query Redshift catalog,
query S3 Tables. Do NOT use for finding specific data assets (use finding-data-lake-assets),
full catalog audits (use exploring-data-catalog), importing data (use ingesting-into-data-lake).
metadata:
version: "1"
argument-hint: "'[SQL-query|query-name|workgroup-name|catalog-name|''profile TABLE_NAME'']'"
---
# Query Data Lake
Execute SQL queries on Amazon Athena across default and federated catalogs (Glue, S3 Tables, Redshift) with workgroup selection, statement classification, and error recovery.
## Overview
Executes and manages Athena SQL queries across default and federated catalogs. Selects a workgroup, resolves target assets (delegating fuzzy references to `finding-data-lake-assets`), classifies statements for safety, and reports cost and data scanned. Use the AWS MCP server for sandboxed execution and audit logging; the same AWS CLI commands work directly when the MCP server is not available.
**Constraints for parameter acquisition:**
- You MUST accept a single optional argument: SQL text, a named-query name, a workgroup name, a catalog name, or `profile TABLE_NAME`
- You MUST accept the argument as direct text or a pointer to a file containing SQL
- You MUST ask the user for the target AWS region if not already set
- You MUST confirm the output S3 location before executing any non-trivial query
- You MUST respect the user's decision to abort at any step
## Common Tasks
### 1. Verify Dependencies
Check for required tools and AWS access before running queries.
**Constraints:**
- You MUST verify AWS MCP server tools are available (`aws___call_aws`) and run queries through them when present; fall back to AWS CLI only if the MCP server is unavailable
- You MUST NOT fall back to shell or Bash for query execution — results must be captured via the MCP tool or `aws athena` CLI so output location and cost are tracked
- You MUST confirm credentials with `aws sts get-caller-identity` and inform the user about any missing tools
### 2. Resolve Workgroup
Check caller identity, list workgroups, auto-select the best one (see [workgroup-selection.md](references/workgroup-selection.md)).
**Constraints:**
- You MUST select a workgroup before submitting any query (prevents output-location errors)
- You MUST present the selected workgroup and its output location to the user
- You MUST NOT auto-escalate to a different workgroup on failure without user confirmation
### 3. Resolve the Target Asset
If the user refers to a table by name, by business concept ("our quarterly report", "the sales data"), by S3 path, or by catalog without specifying the table, delegate to `finding-data-lake-assets` to return the concrete `database.table` (and catalog if non-default).
**Constraints:**
- You MUST NOT attempt to resolve fuzzy asset references with `athena list-data-catalogs` or by iterating `get-tables` — those miss federated catalogs and waste tokens
- You SHOULD skip this step only when the user provides a fully-qualified reference (exact `database.table`) or raw SQL they want executed as-is
- You MUST state the resolved asset explicitly before building the query: "Found [table] in [catalog]. Using this for the query."
- You SHOULD default to the default Glue catalog unless the user mentions "federated", "Redshift", "S3 Tables", or `finding-data-lake-assets` returns a different catalog
### 4. Discover Schema
For analytical queries, You SHOULD profile the target table before building the final query. You MUST show sample rows (`SELECT ... LIMIT 5`) as part of profiling.
### 5. Build Query
Table addressing depends on catalog type:
- Default Glue catalog: `database.table` (omit the catalog prefix for single-catalog queries). In Key info
- Pricing
- Open source
- Category
- Skills
Related reading
- Fundamentals
Row level security is the security boundary
If your database rows are protected by a check in your application code, they are not protected. Anything holding a key can talk to the database directly, an…
Expert