skills/built-in/sql/SKILL.md
Write, run, and explain SQL queries, and do quick local analysis of CSV/SQLite data with the sqlite3 CLI. Use when users want a SQL query written or fixed, want to query a .db/.sqlite file, or want to analyze a CSV with SQL (joins, group by, window functions). Triggers on mentions of SQL, query, SELECT, JOIN, GROUP BY, sqlite, database table, 查询, 数据库, 写个 sql, 联表, 分组.
npx skillsauth add microclaw/microclaw sqlInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Write standard, readable SQL; when a database is available, run it to verify rather than
guessing the result. Check command -v sqlite3 before executing.
sqlite3 app.db ".tables"
sqlite3 app.db ".schema users"
sqlite3 -header -column app.db "SELECT * FROM users LIMIT 5;"
sqlite3 :memory: -cmd ".mode csv" -cmd ".import data.csv t" \
"SELECT region, COUNT(*) n, ROUND(AVG(amount),2) avg FROM t GROUP BY region ORDER BY n DESC;"
-- Join + aggregate
SELECT u.name, COUNT(o.id) AS orders, SUM(o.total) AS spent
FROM users u LEFT JOIN orders o ON o.user_id = u.id
GROUP BY u.id
HAVING orders > 0
ORDER BY spent DESC;
-- Window function: rank within group
SELECT name, dept, salary,
RANK() OVER (PARTITION BY dept ORDER BY salary DESC) AS rank_in_dept
FROM employees;
-- Upsert (SQLite / Postgres)
INSERT INTO kv(k, v) VALUES('x', 1)
ON CONFLICT(k) DO UPDATE SET v = excluded.v;
SELECT * in anything reused.LEFT JOIN when you must keep unmatched rows; WHERE on a left-joined table silently turns it into an inner join.GROUP BY every non-aggregated selected column.LIMIT/TOP, upsert).UPDATE/DELETE) first with a matching SELECT.documentation
Improve or write prose: tighten, clarify, fix grammar, and adjust tone/length while preserving the author's voice and meaning. Use when users ask to edit, proofread, rewrite, polish, shorten, or change the tone of text, or to draft something from notes. Triggers on mentions of edit, proofread, rewrite, polish, tighten, make it shorter/clearer/more formal, fix grammar, 润色, 改写, 校对, 修改, 精简, 改语气, 帮我写.
development
Look up a quick factual summary of a topic, person, place, or thing from Wikipedia via its public REST API (no API key). Use when users want a concise overview, 'who/what is X', background, or a definition-level explanation of a named entity. Triggers on mentions of who is, what is, tell me about, overview of, background on, wikipedia, 是谁, 是什么, 介绍一下, 简介, 维基.
testing
Convert between units of measurement precisely: length, mass/weight, temperature, area, volume, speed, data sizes, and time. Use when users ask to convert X to Y, 'how many cm in an inch', 'what's 70F in C', 'GB to MB', or mix metric and imperial. Triggers on mentions of convert, conversion, in inches/cm/km/miles, kg/lb, Celsius/Fahrenheit, 换算, 转换, 多少厘米, 多少公斤, 摄氏, 华氏.
development
Translate text between languages naturally, preserving meaning, tone, and formatting, with notes on nuance or ambiguity when it matters. Use when users ask to translate text, say something in another language, or localize a message. Triggers on mentions of translate, in English/Chinese/Spanish/Japanese/etc, how do you say, localize, 翻译, 译成, 用英文怎么说, 中译英, 英译中, 本地化.