Query Builder
thalysjuvenal/advpl-specialist
A skill your agent uses when the user needs to build, choose the pattern for, or optimize a SQL query against Protheus ERP tables -- covering Workarea (DbSelectArea/DbSeek) vs Embedded SQL vs…
Agent skill
by Impertio-Studio in Impertio-Studio/Frappe_Claude_Skill_Package
A skill your agent uses when building database queries with frappe.qb in Frappe v14-v16.
$ npx skills add Impertio-Studio/Frappe_Claude_Skill_Package --skill frappe-syntax-query-builder -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install Impertio-Studio/Frappe_Claude_Skill_Package frappe-syntax-query-builder --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/Impertio-Studio/Frappe_Claude_Skill_Package.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/source/syntax/frappe-syntax-query-builder .claude/skills/frappe-syntax-query-builder && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "frappe-syntax-query-builder" agent skill from https://github.com/Impertio-Studio/Frappe_Claude_Skill_Package/tree/main/skills/source/syntax/frappe-syntax-query-builder into .claude/skills/frappe-syntax-query-builder/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "frappe-syntax-query-builder", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/Impertio-Studio/Frappe_Claude_Skill_Package/tree/main/skills/source/syntax/frappe-syntax-query-builderType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add Impertio-Studio/Frappe_Claude_Skill_Package --skill frappe-syntax-query-builder -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install Impertio-Studio/Frappe_Claude_Skill_Package frappe-syntax-query-builder --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/Impertio-Studio/Frappe_Claude_Skill_Package.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/source/syntax/frappe-syntax-query-builder .agents/skills/frappe-syntax-query-builder && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "frappe-syntax-query-builder" agent skill from https://github.com/Impertio-Studio/Frappe_Claude_Skill_Package/tree/main/skills/source/syntax/frappe-syntax-query-builder into .agents/skills/frappe-syntax-query-builder/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "frappe-syntax-query-builder", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add Impertio-Studio/Frappe_Claude_Skill_Package --skill frappe-syntax-query-builder -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install Impertio-Studio/Frappe_Claude_Skill_Package frappe-syntax-query-builder --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/Impertio-Studio/Frappe_Claude_Skill_Package.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/source/syntax/frappe-syntax-query-builder .cursor/skills/frappe-syntax-query-builder && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "frappe-syntax-query-builder" agent skill from https://github.com/Impertio-Studio/Frappe_Claude_Skill_Package/tree/main/skills/source/syntax/frappe-syntax-query-builder into .cursor/skills/frappe-syntax-query-builder/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "frappe-syntax-query-builder", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/Impertio-Studio/Frappe_Claude_Skill_Package.git --path skills/source/syntax/frappe-syntax-query-builder--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add Impertio-Studio/Frappe_Claude_Skill_Package --skill frappe-syntax-query-builder -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install Impertio-Studio/Frappe_Claude_Skill_Package frappe-syntax-query-builder --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/Impertio-Studio/Frappe_Claude_Skill_Package.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/source/syntax/frappe-syntax-query-builder .gemini/skills/frappe-syntax-query-builder && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "frappe-syntax-query-builder" agent skill from https://github.com/Impertio-Studio/Frappe_Claude_Skill_Package/tree/main/skills/source/syntax/frappe-syntax-query-builder into .gemini/skills/frappe-syntax-query-builder/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "frappe-syntax-query-builder", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install Impertio-Studio/Frappe_Claude_Skill_Package frappe-syntax-query-builderInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add Impertio-Studio/Frappe_Claude_Skill_Package --skill frappe-syntax-query-builder -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/Impertio-Studio/Frappe_Claude_Skill_Package.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/source/syntax/frappe-syntax-query-builder .github/skills/frappe-syntax-query-builder && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "frappe-syntax-query-builder" agent skill from https://github.com/Impertio-Studio/Frappe_Claude_Skill_Package/tree/main/skills/source/syntax/frappe-syntax-query-builder into .github/skills/frappe-syntax-query-builder/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "frappe-syntax-query-builder", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add Impertio-Studio/Frappe_Claude_Skill_Package --skill frappe-syntax-query-builder -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install Impertio-Studio/Frappe_Claude_Skill_Package frappe-syntax-query-builder --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/Impertio-Studio/Frappe_Claude_Skill_Package.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/source/syntax/frappe-syntax-query-builder .opencode/skills/frappe-syntax-query-builder && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "frappe-syntax-query-builder" agent skill from https://github.com/Impertio-Studio/Frappe_Claude_Skill_Package/tree/main/skills/source/syntax/frappe-syntax-query-builder into .opencode/skills/frappe-syntax-query-builder/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "frappe-syntax-query-builder", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
frappe-syntax-query-builderA skill your agent uses when building database queries with frappe.qb in Frappe v14-v16.
Frappe Syntax Query Builder is an agent skill from Impertio-Studio/Frappe_Claude_Skill_Package. Use when building database queries with frappe.qb in Frappe v14-v16. Covers the PyPika-based query builder: SELECT, INSERT, UPDATE, DELETE, joins, aggregation, subqueries, cross-DB compatibility (MariaDB/PostgreSQL), and migration from raw SQL. Prevents SQL injection and DB-specific bugs. Keywords: frappe.qb, query builder, DocType, Field, pypika, join,, frappe.qb example, how to write query, join tables, SQL replacement, parameterized query. aggregate, ImportMapper, cross-database, parameterized query.
Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including reference files (for example `references/cross-db-patterns.md`, `references/functions-reference.md` and `references/migration-from-sql.md`). Compatibility notes: Claude Code, Claude.ai Projects, Claude API. Frappe v14-v16.
It sits in Databases, covering ORMs and data access, SQL and Web application vulnerabilities. It works with SQL, MariaDB and PostgreSQL. The repository describes itself as: 60 deterministic Claude AI skills for Frappe Framework & ERPNext v14-v16 development and operations. The licence is MIT.
6 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 36cfa80. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are python).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Claude Code, Claude.ai Projects, Claude API. Frappe v14-v16.
From compatibility in the SKILL.md frontmatter.
Frappe Syntax Query Builder loads about 1.7k tokens when it runs, and up to ~5.2k if it reads all its reference files. Until then it costs about 134 tokens; SKILL.md has 185 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from Impertio-Studio/Frappe_Claude_Skill_Package at commit 36cfa80, republished under its MIT licence (© Impertio-Studio). 185 words, ~1,671 tokens.
.claude/skills/frappe-syntax-query-builder/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.from frappe.query_builder import DocType, Field
from frappe.query_builder.functions import Count, Sum, IfNull
from frappe.query_builder.custom import ConstantColumn, GROUP_CONCAT
from frappe.query_builder.terms import SubQuery
from frappe.query_builder.utils import ImportMapper, db_type_is
from pypika.terms import Case, ValueWrapper
from pypika import CustomFunction, Order| Action | Pattern |
|---|---|
| SELECT | frappe.qb.from_("DocType").select("field1", "field2") |
| WHERE | .where(Field("status") == "Open") |
| ORDER | .orderby("creation", order=Order.desc) |
| LIMIT | .limit(10).offset(0) |
| JOIN | .left_join(dt2).on(dt2.name == dt1.parent) |
| COUNT | .select(Count("*")) |
| INSERT | frappe.qb.into("DocType").columns("f1", "f2").insert("v1", "v2") |
| UPDATE | frappe.qb.update("DocType").set("field", "value").where(...) |
| DELETE | frappe.qb.from_("DocType").delete().where(...) |
| RUN | .run() (tuples) / .run(as_dict=True) (dicts) |
Need to query the database?
│
├─ Simple get/list → frappe.db.get_value(), frappe.get_all()
│ (See frappe-core-database skill)
│
├─ Complex query with joins/aggregates/subqueries → frappe.qb ✓
│
├─ Very complex SQL not expressible in qb → frappe.db.sql()
│ (ALWAYS use parameterized values: frappe.db.sql(query, values))
│
└─ Need cross-DB compatibility → frappe.qb + ImportMapper ✓
Using frappe.qb?
│
├─ Table reference → DocType("Sales Order") — NEVER use Table()
├─ Field reference → dt.field_name or Field("field_name")
├─ Execute → .run() for tuples, .run(as_dict=True) for dicts
├─ DB-specific function → ImportMapper({db_type_is.MARIADB: X, db_type_is.POSTGRES: Y})
└─ Get SQL string → query.get_sql() — NEVER pass to frappe.db.sql()# ALWAYS use DocType() for table references — adds "tab" prefix
so = frappe.qb.DocType("Sales Order")
soi = frappe.qb.DocType("Sales Order Item")
orders = (
frappe.qb.from_(so)
.select(so.name, so.customer, so.grand_total)
.where(so.status == "To Deliver and Bill")
.where(so.docstatus == 1)
.orderby(so.creation, order=Order.desc)
.limit(20)
.run(as_dict=True)
)result = (
frappe.qb.from_(so)
.left_join(soi).on(soi.parent == so.name)
.select(so.name, so.customer, soi.item_code, soi.qty)
.where(so.docstatus == 1)
.where(soi.item_code.like("ITEM-%"))
.run(as_dict=True)
)from frappe.query_builder.functions import Count, Sum
gl = frappe.qb.DocType("GL Entry")
result = (
frappe.qb.from_(gl)
.select(gl.account, Sum(gl.debit).as_("total_debit"), Count("*").as_("entries"))
.where(gl.docstatus == 1)
.groupby(gl.account)
.run(as_dict=True)
)
# Shortcut aggregation methods
total = frappe.qb.sum("GL Entry", "debit", filters={"account": "Sales"})
max_qty = frappe.qb.max("Stock Ledger Entry", "actual_qty", filters={"item_code": "ITEM-001"})# INSERT
frappe.qb.into("Activity Log").columns("user", "action").insert("admin", "login").run()
# UPDATE
customer = frappe.qb.DocType("Customer")
(frappe.qb.update(customer)
.set(customer.status, "Active")
.where(customer.name == "CUST-001")
.run())
# DELETE
frappe.qb.from_("Error Log").delete().where(Field("creation") < "2024-01-01").run()dt = frappe.qb.DocType("Sales Order")
# Equality
.where(dt.status == "Open")
# OR (pipe operator)
.where((dt.status == "Open") | (dt.status == "Draft"))
# AND (chain .where() calls)
.where(dt.status == "Open")
.where(dt.docstatus == 1)
# LIKE
.where(dt.customer.like("CUST-%"))
# IN
.where(dt.status.isin(["Open", "Draft"]))
# BETWEEN (bracket syntax)
.where(dt.creation[start_date:end_date])
# NULL checks
.where(dt.email.isnotnull())
.where(dt.phone.isnull())
# Comparison
.where(dt.grand_total > 1000)
.where(dt.grand_total >= 500)
.where(dt.status != "Cancelled")from frappe.query_builder.utils import ImportMapper, db_type_is
from frappe.query_builder.custom import GROUP_CONCAT, STRING_AGG
# ImportMapper selects correct function per database
GroupConcat = ImportMapper({
db_type_is.MARIADB: GROUP_CONCAT,
db_type_is.POSTGRES: STRING_AGG,
})
dt = frappe.qb.DocType("Has Role")
result = (
frappe.qb.from_(dt)
.select(dt.parent, GroupConcat(dt.role))
.groupby(dt.parent)
.run(as_dict=True)
)| MariaDB | PostgreSQL | Use ImportMapper |
|---|---|---|
GROUP_CONCAT | STRING_AGG | Yes |
MATCH...AGAINST | TO_TSVECTOR | Yes |
Locate | Strpos | Yes |
Timestamp | Extract-based | Auto-handled |
frappe.db.sql() — bypasses parameterizationTable() for DocTypes — use DocType() (adds tab prefix).run() — without it you get a query object, not resultsfrappe.get_all(fields=[...]) — use dict syntaxImportMapper for DB-specific functions.run(as_dict=True) when you need dicts — default is tuples| Feature | v14 | v15 | v16 |
|---|---|---|---|
| Core qb API | Introduced | Yes | Yes |
| ImportMapper | Yes | Yes | Yes |
| SQLite backend | -- | -- | Added |
| Masked fields | -- | -- | Added |
| Union queries (.walk) | -- | Added | Yes |
| Child query execution | -- | -- | Added |
© Impertio-Studio, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 3 other files (references) in skills/source/syntax/frappe-syntax-query-builder of Impertio-Studio/Frappe_Claude_Skill_Package.
Open the folder on GitHubat commit 36cfa80
Frappe Syntax Query Builder next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Frappe Syntax Query Builder this skillImpertio-Studio/Frappe_Claude_Skill_Package | 187 | — | ~1.7k | Automated safety check: Pass | MIT | |
| Query Builderthalysjuvenal/advpl-specialist | 186 | — | ~594 | Automated safety check: Pass | MIT | |
| Tsh SQL And Database UnderstandingTheSoftwareHouse/copilot-collections | 284 | — | ~11k | Automated safety check: Pass | MIT | |
| Safe SQL Executionsupabase/supabase | 111k | — | ~4.2k | Automated safety check: Pass | Apache-2.0 | |
| Releaserogerpadilla/uql | 125 | — | ~842 | Automated safety check: Pass | MIT | |
| Database FundamentalsDanielPodolsky/ownyourcode | 290 | 1 repos | ~1.6k | Automated safety check: Pass | MIT |
thalysjuvenal/advpl-specialist
A skill your agent uses when the user needs to build, choose the pattern for, or optimize a SQL query against Protheus ERP tables -- covering Workarea (DbSelectArea/DbSeek) vs Embedded SQL vs…
TheSoftwareHouse/copilot-collections
SQL writing and database engineering patterns, standards, and procedures.
supabase/supabase
A skill your agent uses whenever code will build, return, fetch, or execute SQL that runs against a user's real Postgres database — even when the request reads like an ordinary feature or bug fix…
rogerpadilla/uql
Cut and publish a uql release - review the change, changelog entry, commit, version bump and tag, GitHub Release, npm publish, docs site.
DanielPodolsky/ownyourcode
Reviews schema design, SQL queries, ORM patterns. An agent skill from DanielPodolsky/ownyourcode.
unxed/f4
Comprehensive guide for Go database access — parameterized queries, struct scanning, NULLable columns, transactions, isolation levels, SELECT FOR UPDATE, connection pool, batch processing, context…
Impertio-Studio/Frappe_Claude_Skill_Package
A skill your agent uses when receiving vague or unclear ERPNext/Frappe development requests that need interpretation.
Impertio-Studio/Frappe_Claude_Skill_Package
Deploy HTML/CSS websites to ERPNext/Frappe (v15/v16) as Web Pages via the REST API.
Impertio-Studio/Frappe_Claude_Skill_Package
A skill your agent uses when building ERPNext/Frappe API integrations (v14/v15/v16) including REST API, RPC API, authentication, webhooks, and rate limiting.
Impertio-Studio/Frappe_Claude_Skill_Package
A skill your agent uses when debugging or handling API errors in Frappe/ERPNext v14/v15/v16.
Impertio-Studio/Frappe_Claude_Skill_Package
A skill your agent uses when implementing hooks.py configurations in a Frappe custom app.
Impertio-Studio/Frappe_Claude_Skill_Package
A skill your agent uses when building API endpoints with @frappe.whitelist() in Frappe.
Works with
Categories
A skill your agent uses when building database queries with frappe.qb in Frappe v14-v16. Frappe Syntax Query Builder is an agent skill from Impertio-Studio/Frappe_Claude_Skill_Package.qb in Frappe v14-v16.
Frappe Syntax Query Builder fits situations like: building database queries with frappe.qb in Frappe v14-v16; tasks that involve ORMs and data access; tasks that involve SQL.
Run `npx skills add Impertio-Studio/Frappe_Claude_Skill_Package --skill frappe-syntax-query-builder -a claude-code`. Or copy the skill folder (skills/source/syntax/frappe-syntax-query-builder in Impertio-Studio/Frappe_Claude_Skill_Package) into .claude/skills/frappe-syntax-query-builder in your project. Claude Code loads it when a task matches its description.
Run `npx skills add Impertio-Studio/Frappe_Claude_Skill_Package --skill frappe-syntax-query-builder -a codex`. Or copy the skill folder (skills/source/syntax/frappe-syntax-query-builder in Impertio-Studio/Frappe_Claude_Skill_Package) into .agents/skills/frappe-syntax-query-builder in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Impertio-Studio/Frappe_Claude_Skill_Package --skill frappe-syntax-query-builder -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/frappe-syntax-query-builder, .gemini/skills/frappe-syntax-query-builder, .github/skills/frappe-syntax-query-builder and .opencode/skills/frappe-syntax-query-builder in your project.
SKILL.md names no scripts, command-line tools or credentials: Frappe Syntax Query Builder is instructions for the agent only. Our summary lists: Python 3. Compatibility (from SKILL.md): Claude Code, Claude.ai Projects, Claude API. Frappe v14-v16..
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Frappe Syntax Query Builder is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.7k tokens (SKILL.md is roughly 6.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 3.5k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Frappe Syntax Query Builder: Query Builder (thalysjuvenal/advpl-specialist, 186 stars), Tsh SQL And Database Understanding (TheSoftwareHouse/copilot-collections, 284 stars), Safe SQL Execution (supabase/supabase, 111k stars) and Release (rogerpadilla/uql, 125 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
Impertio-Studio (a GitHub organization) maintains it in Impertio-Studio/Frappe_Claude_Skill_Package, which has 187 GitHub stars. The repository holds 61 skills in this directory. The repository was last updated on September 17, 2026.
Source: Impertio-Studio/Frappe_Claude_Skill_Package on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.