query
Skill14 starsChanged 8 months agoApache-2.0View on GitHub
Run SQL queries against registered tables or ad-hoc against files using datafusion-cli. Accepts raw SQL or natural language questions. Supports Parquet, CSV, JSON, and Arrow IPC files.
27 other projects use a version of this, 3 of them edited.
Adopted by
Most recently taken up by
- HurricaHjz/second-yourselftheir own version, first seen Oct 1, 2026
- MetamusicX/zissa-wikitheir own version, first seen Sep 26, 2026
- eddmann/agent-toolkittheir own version, first seen Sep 22, 2026
- ARCASSystems/FounderOStheir own version, first seen Sep 12, 2026
- factor241/ketos-bottheir own version, first seen Sep 3, 2026
- johnfkoo951/cmds-llm-wikitheir own version, first seen Aug 26, 2026
Used with
Projects with it also use lint, ingest and 2 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
Microsoft AzureSkilllint
Run all linting and spell checking for TypeScript and Rust code. Run this before committing to catch style issues, clippy warnings, and misspellings.
Also in 10 projects that use this
raven-souravSkillingest
Also in 9 projects that use this
seongjaeryuSkillsave
Complete and save your current thinking to Bindly
Also in 3 projects that use this
DockerSkillresearch
Research a documentation topic — locate affected files, understand the problem, identify what to change. Use when investigating an issue, a question, or a topic before writing a fix. Triggers on: "research issue 1234", "investigate what needs changing for #500", "what files are affected by #200", "where is X documented", "is our docs page about Y accurate", "look into how we document Z".
Also in 4 projects that use this
Other versions27 projects use a version of this.
Word for word · 0
None found.
Edited · 3
- duckdb/duckdb-skills★ 59814% same
- Jylhis/skills★ 110% same
- Kaalia0912/dsh-data-analysis-mode★ 114% same
Wrote their own version · 24
- NeoLabHQ/context-engineering-kit★ 1.7ksame name
- ArtemXTech/claude-code-obsidian-starter★ 225same name
- romarayt/raytsystem-public-os★ 150same name
- HurricaHjz/second-yourself★ 105same name
- johnfkoo951/cmds-llm-wiki★ 90same name
- StarRocks/starrocks-debug-skills★ 77same name
- MetamusicX/zissa-wiki★ 58same name
- honeydew-ai/honeydew-ai-coding-agents-plugins★ 42same name
- owenliang60-ship-it/knowledge-mgmt★ 37same name
- pinecone-io/gemini-cli-extension★ 23same name
14 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository6 other files it gives its agents.
- create-tableSkill
- datafusion-docsSkill
- explain-planSkill
- install-datafusionSkill
- materialized-viewSkill
- read-fileSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. 0 are common, 7 are distinctive, and 8 are very specific to this project.
0
Common
Most of the 23 edited versions we read keep these.
7
Distinctive
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
Follow these steps in order.
- Distinctive: line 19
Look for an existing state file:
- Distinctive: line 29
If found, verify the state file is valid:
- Very specific: line 37
Ad-hoc mode: if: the --file flag is present, or the SQL references file paths (e.g.
- Very specific: line 38
Session mode: if: STATE_DIR is set and the input references table names, is natural language, or is SQL without file references.
- Distinctive: line 40
If no state file exists and no file is referenced, fall back to ad-hoc mode.
- Very specific: line 48
If not found, delegate to /datafusion-skills:install-datafusion and then continue.
- Distinctive: line 52
If the input is natural language (not valid SQL), generate SQL.
- Distinctive: line 68
When generating SQL, keep these DataFusion-specific features in mind:
- Very specific: line 89
EXPLAIN: Use EXPLAIN or EXPLAIN ANALYZE to see query plans
- Distinctive: line 93
Before executing, check if the query might produce too many rows.
- Very specific: line 95
If the query has no LIMIT and might return a large result, wrap it:
- Very specific: line 101
If total_rows > 1000, add LIMIT 100 and inform the user.
- Very specific: line 157
Session state: If a state.sql exists, tables registered by /datafusion-skills:create-table are automatically available
- Very specific: line 158
Error troubleshooting: Use /datafusion-skills:datafusion-docs for persistent errors
“Common” is measured: kept by at least 6 in 10 of the 23 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
You are helping the user query data using Apache DataFusion.
Input: $@
Follow these steps in order.
Step 1 — Resolve state and determine the mode
Look for an existing state file:
STATE_DIR=""
test -f .datafusion-skills/state.sql && STATE_DIR=".datafusion-skills"
PROJECT_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || echo "$PWD")"
PROJECT_ID="$(echo "$PROJECT_ROOT" | tr '/' '-')"
test -f "$HOME/.datafusion-skills/$PROJECT_ID/state.sql" && STATE_DIR="$HOME/.datafusion-skills/$PROJECT_ID"If found, verify the state file is valid:
datafusion-cli --file "$STATE_DIR/state.sql" -c "SELECT 1;"Now determine the mode:
- Ad-hoc mode if: the
--fileflag is present, or the SQL references file paths (e.g.FROM 'data.parquet'), orSTATE_DIRis empty. - Session mode if:
STATE_DIRis set and the input references table names, is natural language, or is SQL without file references.
If no state file exists and no file is referenced, fall back to ad-hoc mode.
Step 2 — Check datafusion-cli is installed
command -v datafusion-cliIf not found, delegate to /datafusion-skills:install-datafusion and then continue.
Step 3 — Generate SQL if needed
If the input is natural language (not valid SQL), generate SQL.
In session mode, first retrieve the schema to inform query generation:
datafusion-cli --file "$STATE_DIR/state.sql" -c "SHOW TABLES;"Then for relevant tables:
datafusion-cli --file "$STATE_DIR/state.sql" -c "DESCRIBE <table_name>;"DataFusion SQL reference
When generating SQL, keep these DataFusion-specific features in mind:
- File queries:
SELECT * FROM 'path/to/file.parquet'works for Parquet files directly - CREATE EXTERNAL TABLE: Register any file as a table
CREATE EXTERNAL TABLE t STORED AS PARQUET LOCATION 'data.parquet'; CREATE EXTERNAL TABLE t STORED AS CSV LOCATION 'data.csv' OPTIONS ('has_header' 'true'); CREATE EXTERNAL TABLE t STORED AS JSON LOCATION 'data.json'; CREATE EXTERNAL TABLE t STORED AS ARROW LOCATION 'data.arrow'; CREATE EXTERNAL TABLE t STORED AS AVRO LOCATION 'data.avro'; - COPY TO: Export query results to files
COPY (SELECT * FROM t WHERE x > 10) TO 'output.parquet' STORED AS PARQUET; - Window functions: Full support for
ROW_NUMBER,RANK,LAG,LEAD, etc. - CTEs:
WITHclauses are fully supported - UNNEST: Expand arrays into rows
- Aggregate functions:
COUNT,SUM,AVG,MIN,MAX,MEDIAN,APPROX_PERCENTILE_CONT, etc. - String functions:
LENGTH,LOWER,UPPER,TRIM,SUBSTR,REGEXP_MATCH, etc. - Date/time:
NOW(),DATE_TRUNC,DATE_PART,INTERVAL,TO_TIMESTAMP, etc. - EXPLAIN: Use
EXPLAINorEXPLAIN ANALYZEto see query plans
Step 4 — Estimate result size
Before executing, check if the query might produce too many rows.
If the query has no LIMIT and might return a large result, wrap it:
SELECT COUNT(*) AS total_rows FROM (<original_query>);If total_rows > 1000, add LIMIT 100 and inform the user.
Step 5 — Execute the query
Important: datafusion-cli -c only accepts one SQL statement per flag. Use multiple
-c flags for multiple statements, or write a .sql file and use --file.
Session mode:
datafusion-cli --file "$STATE_DIR/state.sql" -c "<SQL_QUERY>"Ad-hoc mode with file:
DataFusion v44+ can query Parquet, CSV, and JSON files directly by path:
datafusion-cli -c "SELECT * FROM '<file_path>' LIMIT 10;"For Arrow IPC or Avro, create a temporary external table using a .sql file:
cat > /tmp/_df_query.sql << SQL
CREATE EXTERNAL TABLE _tmp STORED AS ARROW LOCATION '<file_path>';
<SQL_QUERY using _tmp>;
SQL
datafusion-cli --file /tmp/_df_query.sqlAd-hoc mode without file:
datafusion-cli -c "<SQL_QUERY>"Step 6 — Handle errors
datafusion-cli: command not found→ invoke/datafusion-skills:install-datafusionand retry- File not found → check the path, suggest using absolute path
- Schema error → run
DESCRIBEon the table/file and show the user available columns - Unsupported file format → suggest creating an external table with explicit format
- Persistent or unclear error → use
/datafusion-skills:datafusion-docs <error keywords>to search documentation
Step 7 — Present results
Present the query results clearly. If the result is a table, format it nicely.
Suggest next steps if appropriate:
- For exploratory queries → suggest more specific filters or aggregations
- For ad-hoc file queries → suggest
/datafusion-skills:create-tableto register the file for repeated use - For complex pipelines → suggest
/datafusion-skills:materialized-viewto persist results
Cross-skill integration
- Session state: If a
state.sqlexists, tables registered by/datafusion-skills:create-tableare automatically available - Error troubleshooting: Use
/datafusion-skills:datafusion-docsfor persistent errors - Performance: Suggest
/datafusion-skills:explain-planfor slow queries
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.

