agentscope-examples/agents/harness-examples/harness-example-local/src/main/resources/workspace/skills/query-writing/SKILL.md
Writes and executes SQL queries ranging from simple single-table SELECTs to complex multi-table JOINs, aggregations, window functions, and subqueries. Use when the user asks to query the database, retrieve data, filter records, rank results, or generate reports.
npx skillsauth add agentscope-ai/agentscope-java query-writingInstall 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.
Use query-writing when the user:
sql_get_schema to confirm column names.sql_execute_query.SELECT COUNT(*) AS canadian_customers
FROM Customer
WHERE Country = 'Canada';
Break the query into subtasks:
- [ ] Identify all required tables
- [ ] Inspect schemas to find join columns
- [ ] Draft the JOIN structure
- [ ] Add aggregations and grouping
- [ ] Validate and run
Call sql_get_schema for EACH table involved to find the exact foreign key column names.
SELECT
<grouping columns>,
<aggregates>
FROM <primary table>
[INNER | LEFT] JOIN <table2> ON <fk> = <pk>
[JOIN ...]
WHERE <filters>
GROUP BY <non-aggregate columns>
HAVING <post-aggregation filters> -- optional
ORDER BY <sort column> [DESC]
LIMIT 10; -- always limit unless all rows requested
Before executing, verify:
Call sql_execute_query, then show:
SELECT
Artist.Name AS artist,
SUM(InvoiceLine.UnitPrice * InvoiceLine.Quantity) AS total_revenue
FROM Artist
JOIN Album ON Album.ArtistId = Artist.ArtistId
JOIN Track ON Track.AlbumId = Album.AlbumId
JOIN InvoiceLine ON InvoiceLine.TrackId = Track.TrackId
GROUP BY Artist.ArtistId, Artist.Name
ORDER BY total_revenue DESC
LIMIT 10;
SELECT
strftime('%Y-%m', InvoiceDate) AS month,
ROUND(SUM(Total), 2) AS monthly_revenue
FROM Invoice
WHERE strftime('%Y', InvoiceDate) = '2013'
GROUP BY month
ORDER BY month;
SELECT
e.FirstName || ' ' || e.LastName AS employee,
COUNT(c.CustomerId) AS customer_count
FROM Employee e
LEFT JOIN Customer c ON c.SupportRepId = e.EmployeeId
GROUP BY e.EmployeeId
ORDER BY customer_count DESC;
| Symptom | Action | |----------------------|--------| | Empty result | Check WHERE condition values (case-sensitive strings). Verify column exists. | | Syntax error | Re-read schema. Check GROUP BY includes all non-aggregate SELECT columns. | | Wrong row count | Look for duplicate rows caused by missing JOIN conditions. | | Result seems too high | Check for fan-out from multiple JOINs; may need DISTINCT or subquery. |
LIMIT (default 10) unless the user explicitly asks for all rows.e, c, inv) for readability in multi-table queries.SELECT * — name the columns you need.ROUND(SUM(Total), 2).tools
Expert Java developer skill for AgentScope Java framework - a reactive, message-driven multi-agent system built on Project Reactor. Use when working with reactive programming, LLM integration, agent orchestration, multi-agent systems, or when the user mentions AgentScope, ReActAgent, Mono/Flux, Project Reactor, or Java agent development. Specializes in non-blocking code, tool integration, hooks, pipelines, and production-ready agent applications.
documentation
四层技能合成、技能市场、自学习闭环
documentation
Four-layer skill composition, skill marketplaces, the self-learning loop
tools
# 技能(Skill) 一个 skill 就是一份写好的能力包:一个目录里放一份 `SKILL.md`(说明用途、给 agent 看的指令),可以再带一些参考文档、脚本或样例。写好后丢给 agent,它会在合适的时候自己用。 harness 让你从两个地方装 skill: - **接 skill 市场**:Git 仓库、Nacos、MySQL、classpath、或者自己写的后端 - **放在工作区**:项目里 `workspace/skills/` 下的就所有人共用;放在 `<userId>/skills/` 下的只有那个用户看得到 两类来源同时生效,不需要二选一。 > 关于 skill 自身的结构、`SKILL.md` 写法、资源加载、tool 绑定、代码执行这些通用概念,见 [Agent Skill](../task/agent-skill.md)。本文只讲 harness 这一层的用法。 --- ## 一个例子 把团队的 skill 仓库接进来,agent 立刻就能用: ```java HarnessAgent agent = HarnessAgent.bui