1c-coding-standards

Coding standards for BSL, the programming language used by the 1C business software platform. They cover naming, method documentation, database queries, collections, client-server code, and performance practices.

In plain words
What is it for?
Use it when creating or editing BSL or OS files. It helps with method headers, query placement, data access, caching, compiler directives, and asynchronous client-server work.
Why use it?
It gives the agent consistent rules for writing and reviewing 1C code, while helping avoid slow database access and unclear or misleading comments.

Cursor rule

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.

agentmods
npx agentmods add rules/desko77/cursor-1c-skills/1c-coding-standards
Clone the repo
git clone --depth 1 https://github.com/Desko77/cursor-1c-skills
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 7,881 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found 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 $0.00000 $0.07881
Opus 5 $0.00000 $0.03941
Sonnet 5 $0.00000 $0.01576
Haiku 4.5 $0.00000 $0.00788

Measured yesterday against content hash 045f745d4af3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

1c-coding-standards 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 yesterday.

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.

rules/1c-coding-standards.mdc · 602 lines

How it starts

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

1C Coding Standards

Стандарты написания кода на платформе 1С:Предприятие (BSL).

Применяется: при работе с кодом 1С (*.bsl, *.os).

Правила производительности (запросы в цикле, реквизиты через точку, кеширование), клиент-серверного взаимодействия (директивы компиляции, минимизация переходов, асинх-методы) и анти-паттерны описаны в anti_patterns.md и form_module_rules.md - здесь не дублируются.


Комментарии

Шапка метода - ОБЯЗАТЕЛЬНА и пишется ПО СТАНДАРТУ. Каждая процедура и функция (включая неэкспортные и обработчики форм) начинается с комментария-описания. Эталонный формат и порядок блоков - "Документация методов" ниже. Шапка - часть кода: правила про минимум комментариев ее НЕ отменяют, при "чистке комментариев" она НЕ удаляется.

Шапка описывает КОНТРАКТ метода, а не факт его существования. Запрещено: пересказ имени метода (// Решение о продлении отпусков перед Функция РешениеОПродленииОтпусков), пустые формулировки (// Выполняет обработку, // Служебная функция), выдуманные параметры и типы. Не знаешь тип параметра - посмотри фактический вызов и определение, а не угадывай.

В теле метода комментарии НЕ добавляй по умолчанию. Код должен быть понятен без них. Комментарий в теле допускается только когда добавляет ценность, которую невозможно выразить самим кодом:

  • Мотивация неочевидного решения (почему выбран именно такой подход)
  • Нетривиальный алгоритм (суть, а не пересказ кода)
  • Ограничения и граничные случаи
  • Технический долг (TODO, FIXME)

Запрещено:

  • Комментарии вида // Получаем данные, // Проверяем условие, // Записываем результат - они дублируют код
  • Комментарии к каждой строке или блоку - код не нуждается в построчном пересказе
  • Комментарии-разделители (// ---, // ***) вместо #Область
  • Ссылки на артефакты разработки: // Задача B: ..., // Шаг 3, // Этап загрузки, // по п.3.2 плана - маркеры нашего внутреннего плана (и пунктов ТЗ) в код не попадают, они нужны только на время разработки; раздел кода метит #Область, факт правки - аудиторский маркер проекта

Read the full file on GitHub · 602 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. yesterday First seen · 602 lines · 0 tokens per session scan A 045f745d4af3

Subscribe to this mod's changes

1c-coding-standards is a cursor rule published in the GitHub repository Desko77/cursor-1c-skills (53 stars, last pushed 4d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 7,881 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.