SQL Query Analyzer
A pure-Python skill that parses a batch 1C query into subqueries and temp tables, builds a dependency graph and returns it as JSON
Low risk
We rate an entry low when it mostly gives the agent instructions and reference material.
Why this level
- Only parses query text, never touches a database or executes queries
- The output is a local JSON file or console output
Install
In your terminal, with SkillFoxx CLI
npx skillfoxx add skills/sql-query-analyzerDetects the agents on your machine, checks the risk and pins the version.
Other ways to install
Run in a terminal in the project folder
npx skills add lytkinam/sql-query-analyzer --skill sql-query-analyzer -a claude-code -yThe skills tool installs the current version from the repository. Add the -g flag to use the skill in every project.
Without third-party tools, from commit 949a20a
tmp=$(mktemp -d)
git clone --filter=blob:none --no-checkout https://github.com/lytkinam/sql-query-analyzer.git "$tmp"
git -C "$tmp" sparse-checkout set --no-cone /skill/
git -C "$tmp" checkout 949a20a9dacb7ca2f6adcd66da7c048ca0de4d8b
mkdir -p .claude/skills
cp -R "$tmp/skill" .claude/skills/sql-query-analyzerCommands for macOS and Linux, on Windows run them in Git Bash.
Run in a terminal in the project folder
npx skills add lytkinam/sql-query-analyzer --skill sql-query-analyzer -a cursor -yThe skills tool installs the current version from the repository. Add the -g flag to use the skill in every project.
Without third-party tools, from commit 949a20a
tmp=$(mktemp -d)
git clone --filter=blob:none --no-checkout https://github.com/lytkinam/sql-query-analyzer.git "$tmp"
git -C "$tmp" sparse-checkout set --no-cone /skill/
git -C "$tmp" checkout 949a20a9dacb7ca2f6adcd66da7c048ca0de4d8b
mkdir -p .agents/skills
cp -R "$tmp/skill" .agents/skills/sql-query-analyzerCommands for macOS and Linux, on Windows run them in Git Bash.
Run in a terminal in the project folder
npx skills add lytkinam/sql-query-analyzer --skill sql-query-analyzer -a github-copilot -yThe skills tool installs the current version from the repository. Add the -g flag to use the skill in every project.
Without third-party tools, from commit 949a20a
tmp=$(mktemp -d)
git clone --filter=blob:none --no-checkout https://github.com/lytkinam/sql-query-analyzer.git "$tmp"
git -C "$tmp" sparse-checkout set --no-cone /skill/
git -C "$tmp" checkout 949a20a9dacb7ca2f6adcd66da7c048ca0de4d8b
mkdir -p .github/skills
cp -R "$tmp/skill" .github/skills/sql-query-analyzerCommands for macOS and Linux, on Windows run them in Git Bash.
Run in a terminal in the project folder
npx skills add lytkinam/sql-query-analyzer --skill sql-query-analyzer -a codex -yThe skills tool installs the current version from the repository. Add the -g flag to use the skill in every project.
Without third-party tools, from commit 949a20a
tmp=$(mktemp -d)
git clone --filter=blob:none --no-checkout https://github.com/lytkinam/sql-query-analyzer.git "$tmp"
git -C "$tmp" sparse-checkout set --no-cone /skill/
git -C "$tmp" checkout 949a20a9dacb7ca2f6adcd66da7c048ca0de4d8b
mkdir -p .agents/skills
cp -R "$tmp/skill" .agents/skills/sql-query-analyzerCommands for macOS and Linux, on Windows run them in Git Bash.
Run in a terminal in the project folder
npx skills add lytkinam/sql-query-analyzer --skill sql-query-analyzer -a gemini-cli -yThe skills tool installs the current version from the repository. Add the -g flag to use the skill in every project.
Without third-party tools, from commit 949a20a
tmp=$(mktemp -d)
git clone --filter=blob:none --no-checkout https://github.com/lytkinam/sql-query-analyzer.git "$tmp"
git -C "$tmp" sparse-checkout set --no-cone /skill/
git -C "$tmp" checkout 949a20a9dacb7ca2f6adcd66da7c048ca0de4d8b
mkdir -p .agents/skills
cp -R "$tmp/skill" .agents/skills/sql-query-analyzerCommands for macOS and Linux, on Windows run them in Git Bash.
Run in a terminal in the project folder
tmp=$(mktemp -d)
git clone --filter=blob:none --no-checkout https://github.com/lytkinam/sql-query-analyzer.git "$tmp"
git -C "$tmp" sparse-checkout set --no-cone /skill/
git -C "$tmp" checkout 949a20a9dacb7ca2f6adcd66da7c048ca0de4d8b
mkdir -p .devin/skills
cp -R "$tmp/skill" .devin/skills/sql-query-analyzerCommands for macOS and Linux, on Windows run them in Git Bash.
Formerly Windsurf.
Run in a terminal in the project folder
npx skills add lytkinam/sql-query-analyzer --skill sql-query-analyzer -a cline -yThe skills tool installs the current version from the repository. Add the -g flag to use the skill in every project.
Without third-party tools, from commit 949a20a
tmp=$(mktemp -d)
git clone --filter=blob:none --no-checkout https://github.com/lytkinam/sql-query-analyzer.git "$tmp"
git -C "$tmp" sparse-checkout set --no-cone /skill/
git -C "$tmp" checkout 949a20a9dacb7ca2f6adcd66da7c048ca0de4d8b
mkdir -p .cline/skills
cp -R "$tmp/skill" .cline/skills/sql-query-analyzerCommands for macOS and Linux, on Windows run them in Git Bash.
Run in a terminal in the project folder
npx skills add lytkinam/sql-query-analyzer --skill sql-query-analyzer -a roo -yThe skills tool installs the current version from the repository. Add the -g flag to use the skill in every project.
Without third-party tools, from commit 949a20a
tmp=$(mktemp -d)
git clone --filter=blob:none --no-checkout https://github.com/lytkinam/sql-query-analyzer.git "$tmp"
git -C "$tmp" sparse-checkout set --no-cone /skill/
git -C "$tmp" checkout 949a20a9dacb7ca2f6adcd66da7c048ca0de4d8b
mkdir -p .roo/skills
cp -R "$tmp/skill" .roo/skills/sql-query-analyzerCommands for macOS and Linux, on Windows run them in Git Bash.
A fork of Roo Code, same .roo folders.
Run in a terminal in the project folder
npx skills add lytkinam/sql-query-analyzer --skill sql-query-analyzer -a opencode -yThe skills tool installs the current version from the repository. Add the -g flag to use the skill in every project.
Without third-party tools, from commit 949a20a
tmp=$(mktemp -d)
git clone --filter=blob:none --no-checkout https://github.com/lytkinam/sql-query-analyzer.git "$tmp"
git -C "$tmp" sparse-checkout set --no-cone /skill/
git -C "$tmp" checkout 949a20a9dacb7ca2f6adcd66da7c048ca0de4d8b
mkdir -p .agents/skills
cp -R "$tmp/skill" .agents/skills/sql-query-analyzerCommands for macOS and Linux, on Windows run them in Git Bash.
Run in a terminal in the project folder
tmp=$(mktemp -d)
git clone --filter=blob:none --no-checkout https://github.com/lytkinam/sql-query-analyzer.git "$tmp"
git -C "$tmp" sparse-checkout set --no-cone /skill/
git -C "$tmp" checkout 949a20a9dacb7ca2f6adcd66da7c048ca0de4d8b
mkdir -p .agents/skills
cp -R "$tmp/skill" .agents/skills/sql-query-analyzerCommands for macOS and Linux, on Windows run them in Git Bash.
Run in a terminal in the project folder
tmp=$(mktemp -d)
git clone --filter=blob:none --no-checkout https://github.com/lytkinam/sql-query-analyzer.git "$tmp"
git -C "$tmp" sparse-checkout set --no-cone /skill/
git -C "$tmp" checkout 949a20a9dacb7ca2f6adcd66da7c048ca0de4d8b
mkdir -p .agents/skills
cp -R "$tmp/skill" .agents/skills/sql-query-analyzerCommands for macOS and Linux, on Windows run them in Git Bash.
Copy the skill/ folder from the lytkinam/sql-query-analyzer repo into your agent's skills directory, no dependencies to install, then run python analyze_1c_query.py <file.sql> --detailed --summary from scripts/.
Other ways from the author
git clone https://github.com/lytkinam/sql-query-analyzer.gitNo dependencies, only the Python 3.8+ standard library.
This is third-party code. Review the repository files before installing.
What it does
The tool parses a monolithic batch 1C query language statement (or equivalent SQL) with ПОМЕСТИТЬ/INTO, ИЗ/FROM, СОЕДИНЕНИЕ/JOIN, ОБЪЕДИНИТЬ ВСЕ/UNION ALL, УНИЧТОЖИТЬ/DROP commands and nested subqueries into a manageable set of nodes and builds a dependency graph over temp tables. The result is JSON with nodes (name, type: temp table, result or subquery, expanded text, parent, children, tables it reads, an unused-stub flag) and dependency edges between them, plus a list of dropped temp tables. It works as an importable Python module, as a CLI reading from a file or stdin, and with a detailed mode that splits UNION into parts. It has no dependencies beyond the Python 3.8+ standard library. A separate SKILL.md packages the project as a skill with ready analysis and Markdown report generation scripts.
Who it is for. For 1C developers and analysts who need to quickly break a multi-layer reporting query into its parts and see which temp table depends on which.
Good fit when
- You need to break a long batch reporting query into subqueries and see the temp table dependency graph
- You need a JSON format to further automate processing of the query structure
- You need to find unused temp tables that are created but never read
Not a fit when
- You need to execute the query or optimize its execution plan, not just parse its text structure
- The query uses syntax outside the supported command set, so parsing may be incomplete
Example request
Break down this batch reporting query into temp tables and show the dependency graphLimitations
The supported syntax is limited to the table in the README: temp tables, sources, joins, unions, drops, aliases, comments and nested subqueries; more complex 1C query language constructs may not parse correctly. The tool is purely structural: it does not check the query for execution errors and never touches a database.
How to disable. Delete the skill folder from your agent's skills directory or the repo clone.
Security check
- Only parses query text, never touches a database or executes queries
- The output is a local JSON file or console output
README in short
The README gives a table mapping 1C and SQL syntax, dependency-free installation, three ways to run it (Python module, CLI from a file or stdin, detailed mode), the analyze_sql_query function parameters, and a full description of the result format's node and edge fields. It separately mentions tests via tests.py and a four-file project layout. The README does not explicitly state a license.
SKILL.md
--- name: sql-query-analyzer description: | Анализатор пакетных SQL/1C-запросов. Разбирает запрос на подзапросы, строит граф зависимостей по временным таблицам (ВТ) и возвращает JSON. Применяется для структурного разбора сложных 1С-запросов отчетов НПО (в частности, форма 0420258 и других многослойных запросов). --- # SQL-QUERY-ANALYZER - Skill анализа 1C/SQL-запросов ## Назначение Разбор монолитных пакетных запросов 1С (ВЫБРАТЬ / SELECT с ПОМЕСТИТЬ / INTO) на управляемый набор компонентов с построением графа зависимостей.
FAQ
Do I need external libraries?
No, the tool uses only the Python 3.8+ standard library.
What does detailed mode do?
It splits ОБЪЕДИНИТЬ ВСЕ/UNION ALL nodes into child Часть_N nodes instead of one combined node.
Related
A skills library that gives coding agents a development process: brainstorming, planning, TDD, subagents and code review
Skills for real engineers by Matt Pocock
Skills For Real Engineers
Small composable skills for engineering with agents: plan grilling, TDD, bug diagnosis, code review and architecture
GitHub toolkit for spec-driven development: the specify CLI adds agent commands and skills to a project, from principles to implementation
Reference MCP servers
Model Context Protocol servers
Official reference MCP servers: Filesystem, Fetch, Git, Memory, Sequential Thinking, Time and Everything