framework_eng/skills/onescript/onescript/SKILL.md
Writes and structures code in OneScript (BSL without 1C). Use when working with .os files, OneScript projects, packagedef, opm, the
npx skillsauth add steelmorgan/1c-agent-based-dev-framework onescriptInstall 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.
A skill for writing and structuring code in OneScript, a cross-platform interpreter for 1C:Enterprise 8 without the 1C platform. Code is executed from text .os files, similar to Python or Node.js.
A module is a text file with the .os extension. Three sections (top to bottom):
Перем ИмяПеременной;Minimal script:
Сообщить("Привет, Мир!");
Procedures and functions:
Процедура МояПроцедура(Параметр1, Параметр2)
// операторы
КонецПроцедуры
Функция МояФункция(Параметр1, Параметр2)
Возврат Параметр1 + Параметр2;
КонецФункции
Typing is dynamic. Primitives: Строка, Число, Булево, Дата; special: Неопределено, Null.
12345.899"Текст", quote inside — "". Multiline: a new line starts with |, spaces before | are discarded.'20250212235959' or '2025-02-12 23:59:59'Condition:
Если Условие Тогда
// ...
ИначеЕсли ДругоеУсловие Тогда
// ...
Иначе
// ...
КонецЕсли;
Loops:
Для Счетчик = 0 По 10 Цикл
Сообщить(Счетчик);
КонецЦикла;
Для Каждого Элемент Из Массив Цикл
Сообщить(Элемент);
КонецЦикла;
Пока Условие Цикл
// ...
КонецЦикла;
Exceptions:
Попытка
// код
Исключение
Сообщить(ОписаниеОшибки());
ВызватьИсключение; // rethrow
КонецПопытки;
ВызватьИсключение "Текст ошибки";
Recommended directory structure:
src/ — source code (included in the distribution)src/Классы/ — .os files included as classes (created via Новый)src/Модули/ — .os files included as common modulestests/ — teststasks/ — utility scripts (build, tests)packagedef (manifest), README, LICENSEThe entry point (for example src/main.os) must import its directory:
#Использовать "."
// далее использование классов и модулей
Сообщить(МойМодуль.Метод());
At the project root there is a file without an extension, packagedef. Minimum: name, version, contents.
Описание.Имя("my-package")
.Версия("1.0.0")
.ВерсияСреды("2.0.0")
.ЗависитОт("fs", "1.0.0")
.ЗависитОт("asserts", "1.3.0")
.ВключитьФайл("packagedef")
.ВключитьФайл("src")
.ВключитьФайл("oscript_modules")
.ИсполняемыйФайл("src/my-script.os");
Main properties: Имя, Версия, ВерсияСреды, ЗависитОт, ВключитьФайл, ИсполняемыйФайл.
Include at the beginning of the module (before variables):
#Использовать json, #Использовать fs#Использовать ".", #Использовать "lib/mylib"A class from a library is a new type, created through Новый ИмяКласса(). A module is a global object with methods: ИмяМодуля.Метод().
Standard loader: files from the Классы subdirectory are registered as classes, and files from Модули as modules. The file name (without .os) = the class/module identifier.
opm build .opm push my-file.ospx --token ТОКЕНDetails of syntax, differences from 1C (Format/DF, constructor call in an expression, parameterized exceptions, rethrow with ИнформацияОбОшибке) — in reference.md.
Documentation: oscript.io/learn.
development
1C server maintenance webhooks: container restart and external component cache cleanup
development
Interactive DAP debugging of a single BSL procedure
tools
Rules for using RLM tools for project search and navigation in 1C/BSL
development
Creates web applications and routes on Winow (a web server on OneScript and Autumn). Use when working with a web server on OneScript, routing, or Winow controllers.