1c-query-optimization

1c-query-optimization is a skill for Claude Code, Codex from Desko77/cursor-1c-skills. It costs 38 tokens per session (795 once invoked), scanned A, a copy of 1c-query-optimization, MIT.

A set of advanced patterns for improving complex 1C database queries. It covers temporary tables, joins, subqueries, large-data processing, and queries used by configurable reports.

In plain words
What is it for?
Use it when refactoring multi-step queries, joining several data sources, reusing intermediate results, or optimizing report queries.
Why use it?
It helps address slow or difficult queries by choosing more suitable ways to combine and process data.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when refactoring multi-step queries, joining several data sources, reusing intermediate results, or optimizing report queries.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/desko77/cursor-1c-skills/1c-query-optimization
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Desko77/cursor-1c-skills --skill 1c-query-optimization
Clone the repo
git clone --depth 1 https://github.com/Desko77/cursor-1c-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for 1c-query-optimization

README.md
[![agentmods](https://agentmods.dev/badge/skills/desko77/cursor-1c-skills/1c-query-optimization.svg)](https://agentmods.dev/skills/desko77/cursor-1c-skills/1c-query-optimization)
Your own site
<a href="https://agentmods.dev/skills/desko77/cursor-1c-skills/1c-query-optimization"><img src="https://agentmods.dev/badge/skills/desko77/cursor-1c-skills/1c-query-optimization.svg" alt="Measured on agentmods" height="20"></a>
Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 795 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium analysis-evasion · line 1
    Suspicious Unicode normalization or mixed-script content
    Fix: Review the flagged content for security risks. Ensure no credentials, secrets, or sensitive data are exposed.
How audits are shown
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00038 $0.00795
Opus 5 $0.00019 $0.00398
Sonnet 5 $0.00008 $0.00159
Haiku 4.5 $0.00004 $0.00080

Measured 4d ago against content hash f66f42cfbbe1, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

1c-query-optimization scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to 1c-query-optimization — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/1c-query-optimization/SKILL.md · 73 lines

How it starts

The opening of the file, as written. The whole thing — 73 lines — stays where its author put it; the contents beside it link to each section on GitHub.

1C Query Optimization Skill (Advanced Patterns)

Продвинутые паттерны оптимизации запросов. Базовые оптимизации (ВЫРАЗИТЬ, ПРЕДСТАВЛЕНИЕ, ВТ вместо подзапросов, ОБЪЕДИНИТЬ ВСЕ, индексы, СКД) - см. правило query-optimization-tips.md. Анти-паттерны (запрос в цикле, обращение через точку) - см. anti_patterns.md.

Validate Query via AI-EDT

Если сервер AI-EDT подключен (инструменты ai-edt доступны), проверяй оптимизированный запрос через validate_query - убедись, что после рефакторинга нет синтаксических/семантических ошибок. Для запросов СКД: dcsMode=true.

When to Use

Invoke this skill when:

  • Working with complex multi-step data processing
  • Optimizing joins and subqueries
  • Implementing DCS reports
  • Processing large datasets in portions

Temporary Tables - When to Use

Use temporary tables for:

  • Complex multi-step data processing
  • Joining data from multiple sources
  • Reusing intermediate results

Join vs Subquery (basic choice)

// PREFERRED: Join (usually faster)
"ВЫБРАТЬ
|	Заказы.Ссылка КАК Заказ,
|	Контрагенты.ИНН КАК ИНН
|ИЗ
|	Документ.ЗаказКлиента КАК Заказы
|		ЛЕВОЕ СОЕДИНЕНИЕ Справочник.Контрагенты КАК Контрагенты
|		ПО Заказы.Контрагент = Контрагенты.Ссылка"

// AVOID: Subquery in SELECT (N+1 problem)
"ВЫБРАТЬ
|	Заказы.Ссылка КАК Заказ,
|	(ВЫБРАТЬ К.ИНН ИЗ Справочник.Контрагенты КАК К
|	 ГДЕ К.Ссылка = Заказы.Контрагент) КАК ИНН
|ИЗ
|	Документ.ЗаказКлиента КАК Заказы"

Avoid Aggregation in Subqueries

// SLOW: Subquery with aggregation
"ВЫБРАТЬ
|	Номенклатура.Ссылка,
|	(ВЫБРАТЬ СУММА(Остатки.Количество) ...) КАК Остаток
|ИЗ
|	Справочник.Номенклатура КАК Номенклатура"

// FAST: Join with pre-aggregated data
"ВЫБРАТЬ
|	Номенклатура.Ссылка КАК Номенклатура,
|	ЕСТЬNULL(Остатки.КоличествоОстаток, 0) КАК Остаток
|ИЗ
|	Справочник.Номенклатура КАК Номенклатура
|		ЛЕВОЕ СОЕДИНЕНИЕ РегистрНакопления.ТоварыНаСкладах.Остатки КАК Остатки
|		ПО Номенклатура.Ссылка = Остатки.Номенклатура"

Reference: ITS Query Optimization Standards

Read the full file on GitHub · 73 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 73 lines · 38 tokens per session scan A f66f42cfbbe1

Subscribe to this mod's changes

1c-query-optimization is a skill published in the GitHub repository Desko77/cursor-1c-skills (55 stars, last pushed 5d ago), licensed MIT. It adds 38 tokens to every session and 795 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to 1c-query-optimization, differing in 0 lines, and is treated as a copy.