write-query by anthropics/knowledge-work-plugins
npx skills add https://github.com/anthropics/knowledge-work-plugins --skill write-query如果您看到不熟悉的占位符或需要检查连接了哪些工具,请参阅 CONNECTORS.md。
根据自然语言描述编写 SQL 查询,针对您特定的 SQL 方言进行优化并遵循最佳实践。
/write-query <您所需数据的描述>
解析用户的描述以确定:
如果用户的 SQL 方言未知,询问他们使用哪种:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
在同一会话中记住该方言以备后续查询使用。
如果连接了数据仓库 MCP 服务器:
遵循以下最佳实践:
结构:
daily_signups、active_users、revenue_by_product)性能:
SELECT * —— 仅指定需要的列EXISTS 而非 IN可读性:
a、b、c)特定方言优化:
sql-queries 技能)提供:
如果已连接数据仓库,提供运行查询并分析结果的选项。如果用户希望自行运行,查询已准备好供复制粘贴。
简单聚合:
/write-query 过去 30 天按状态统计的订单数量
复杂分析:
/write-query 队列留存分析——按用户注册月份分组,然后显示在注册后 1、3、6 和 12 个月仍活跃(至少有一个事件)的用户百分比
性能关键型:
/write-query 我们有一个按日期分区的 5 亿行事件表。找出过去 7 天内事件数量最多的前 100 名用户及其最近的事件类型。
每周安装次数
215
代码仓库
GitHub 星标数
10.3K
首次出现
12 天前
安全审计
安装于
gemini-cli205
codex204
opencode204
cursor204
github-copilot203
amp203
If you see unfamiliar placeholders or need to check which tools are connected, see CONNECTORS.md.
Write a SQL query from a natural language description, optimized for your specific SQL dialect and following best practices.
/write-query <description of what data you need>
Parse the user's description to identify:
If the user's SQL dialect is not already known, ask which they use:
Remember the dialect for future queries in the same session.
If a data warehouse MCP server is connected:
Follow these best practices:
Structure:
daily_signups, active_users, revenue_by_product)Performance:
SELECT * in production queries -- specify only needed columnsEXISTS over IN for subqueries with large result setsReadability:
a, b, c)Dialect-specific optimizations:
sql-queries skill for details)Provide:
If a data warehouse is connected, offer to run the query and analyze the results. If the user wants to run it themselves, the query is ready to copy-paste.
Simple aggregation:
/write-query Count of orders by status for the last 30 days
Complex analysis:
/write-query Cohort retention analysis -- group users by their signup month, then show what percentage are still active (had at least one event) at 1, 3, 6, and 12 months after signup
Performance-critical:
/write-query We have a 500M row events table partitioned by date. Find the top 100 users by event count in the last 7 days with their most recent event type.
Weekly Installs
215
Repository
GitHub Stars
10.3K
First Seen
12 days ago
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
gemini-cli205
codex204
opencode204
cursor204
github-copilot203
amp203
AI Elements:基于shadcn/ui的AI原生应用组件库,快速构建对话界面
60,400 周安装