1c-test-runner

Invoke when the user says “write tests”, “test module”, or “run 1C unit tests”. Should also be called to validate business logic implemented via the 1c-ai-debug MCP. Must not be used for UI tests; use playwright-test or 1c-web-session for those.

Last repository push
GitHub Stars
173
Forks
22
Issues / PRs
5

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "1c-test-runner" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-1a3e3c8e19d564e2798637a6a3bd832463c1785f42cf390f2a5007180076344c. Verify the upstream source and version against https://github.com/Arman-Kudaibergenov/1c-ai-development-kit before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

github.com

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Invoke when the user says “write tests”, “test module”, or “run 1C unit tests”. Should also be called to validate business logic implemented via the 1c-ai-debug MCP. Must not be used for UI tests; use playwright-test or 1c-web-session for those.

0 Downloads

Introduction source: third_party · Arman-Kudaibergenov · 0.0.1 Reference

SkillPi interpretation

Tasks
Workflow для автономного тестирования бизнес-логики 1С: AI создаёт тестовые данные через `1c-ai-debug` MCP (CRUD) AI пишет тест — CommonModule с суффиксом `_Test` Тест загружается в базу через `/db-load-xml` + `/db-update` AI запускает через MCP инструмент `run_unit_tests` Результат возвращается текстом/JSON — без скриншотов, без vanessa-runner
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: 1c-test-runner
description: >
  Этот скилл MUST быть вызван когда пользователь говорит "напиши тест", "протестируй модуль", "запусти unit-тесты" для 1С.
  SHOULD также вызывать после реализации бизнес-логики для верификации через 1c-ai-debug MCP.
  Do NOT использовать для UI-тестов — используй playwright-test или 1c-web-session.
allowed-tools: Read, Write, Edit, Glob, Grep, Bash, mcp__1c-ai-debug__run_unit_tests, mcp__1c-ai-debug__execute_1c_code

/1c-test-runner — AI-тестирование 1С без внешних зависимостей

Workflow для автономного тестирования бизнес-логики 1С:

  • AI создаёт тестовые данные через 1c-ai-debug MCP (CRUD)
  • AI пишет тест — CommonModule с суффиксом _Test
  • Тест загружается в базу через /db-load-xml + /db-update
  • AI запускает через MCP инструмент run_unit_tests
  • Результат возвращается текстом/JSON — без скриншотов, без vanessa-runner

Предварительные требования

  • 1c-ai-debug MCP подключён к проекту
  • Расширение AI_Debug установлено и опубликовано в базе

Стек

Claude → 1c-ai-debug MCP (run_unit_tests) → 1С база
              ↑
         BSL: CommonModule *_Test (пишет Claude)
              ↑
         CRUD: create_catalog_item, create_document, post_document

Шаг 1 — Создать тестовые данные

{"name": "create_catalog_item", "arguments": {"catalogName": "Контрагенты", "data": {"Наименование": "TEST-001"}}}

{"name": "create_document", "arguments": {
  "documentType": "ПоступлениеТоваровУслуг",
  "header": {"Контрагент": "<ref>", "Дата": "2026-01-01T00:00:00"},
  "tables": {"Товары": [{"Номенклатура": "<ref>", "Количество": 10, "Цена": 100}]}
}}

{"name": "post_document", "arguments": {"documentType": "ПоступлениеТоваровУслуг", "documentRef": "<ref>"}}

Шаг 2 — Написать тест

Тест — CommonModule с суффиксом _Test. Пример модуля AI_SelfTest_Test уже в составе AI_Debug.

// CommonModules/ТестПроведенияПоступления_Test/Ext/Module.bsl

#Область СлужебныйПрограммныйИнтерфейс

Процедура ИсполняемыеСценарии() Экспорт
    ЮТТесты.ДобавитьТест("ПроведениеПоступленияФормируетДвижения");
КонецПроцедуры

Процедура ПроведениеПоступленияФормируетДвижения() Экспорт
    // Arrange — ссылка из шага 1
    ДокументСсылка = ПредопределённоеЗначение("...");  // или передать через параметры

    // Act + Assert
    Движения = РегистрыНакопления.ТоварыНаСкладах.СоздатьНаборЗаписей();
    Движения.Отбор.Регистратор.Установить(ДокументСсылка);
    Движения.Прочитать();

    ЮТУтверждения.Больше(Движения.Количество(), 0, "Ожидаются движения по регистру");
КонецПроцедуры

#КонецОбласти

API ЮТУтверждения (прямые вызовы)

ЮТУтверждения.Равно(Факт, Ожидаемое, "комментарий")
ЮТУтверждения.НеРавно(Факт, НеОжидаемое)
ЮТУтверждения.ЭтоИстина(Условие, "комментарий")
ЮТУтверждения.ЭтоЛожь(Условие)
ЮТУтверждения.Больше(Значение, Порог, "комментарий")
ЮТУтверждения.Меньше(Значение, Порог)
ЮТУтверждения.НеЗаполнено(Значение)
ЮТУтверждения.Заполнено(Значение)
ЮТУтверждения.ИмеетДлину(Коллекция, N)

⚠️ Fluent-стиль (ЮТУтверждения.Что(X).Равно(Y)) не работает в CommonModule — нет self-reference.

Добавить тест в конфигурацию

<!-- Configuration.xml → ChildObjects -->
<CommonModule>ТестПроведенияПоступления_Test</CommonModule>

CommonModule флаги: Server=true, ClientManagedApplication=false.


Шаг 3 — Загрузить в базу

/db-load-xml <configDir> -Mode Partial -Files "CommonModules/ТестПроведенияПоступления_Test.xml,CommonModules/ТестПроведенияПоступления_Test/Ext/Module.bsl"
/db-update

Шаг 4 — Запустить тесты

// Все _Test модули
{"name": "run_unit_tests", "arguments": {}}

// Конкретный модуль
{"name": "run_unit_tests", "arguments": {"moduleName": "ТестПроведенияПоступления_Test"}}

Формат результата

{
  "success": true,
  "total": 3,
  "passed": 3,
  "failed": 0,
  "summary": "[OK] ПроведениеПоступленияФормируетДвижения\n[OK] ..."
}

При failed > 0 — success: false, в summary строки [FAIL] ИмяТеста: текст ошибки.


Шаг 5 — Cleanup

{"name": "delete_object", "arguments": {"objectType": "Documents", "objectName": "ПоступлениеТоваровУслуг", "objectRef": "<ref>"}}
{"name": "delete_object", "arguments": {"objectType": "Catalogs", "objectName": "Контрагенты", "objectRef": "<ref>"}}

Полный пример (end-to-end)

1. create_catalog_item(Номенклатура, {Наименование: "TEST-001"}) → ref_ном
2. create_document(ПоступлениеТоваровУслуг, {Товары: [{Номенклатура: ref_ном, Кол: 5, Цена: 200}]}) → ref_doc
3. post_document(ПоступлениеТоваровУслуг, ref_doc) → success: true
4. Claude пишет BSL тест → /db-load-xml + /db-update
5. run_unit_tests({moduleName: "ТестПроведенияПоступления_Test"}) → {success: true, passed: 1}
6. delete_object x2 (cleanup)

Ограничения

  • Тесты только серверная бизнес-логика: расчёты, движения, проведение — не UI
  • Тест загружается в базу до запуска через /db-load-xml + /db-update
  • Ссылки между объектами — GUID-строки из ответов create_*
  • post_document требует РежимЗаписиДокумента.Проведение — база должна допускать проведение

Связанные скилы

  • /db-load-xml — загрузить тест-модуль в базу
  • /db-update — применить к БД
  • 1c-ai-debug MCP — CRUD данных и запуск run_unit_tests

Version history

  1. v1.2.0 GitHub ↗
    Original release notes

    ## What's New ### Skills Catalog (SKILLS.md) - New `SKILLS.md` in project root listing all 52 project skills + 11 global skills - Organized by category: Configuration, Metadata, Database, Extensions, Forms, EPF/ERF, MXL, DCS, Subsystems/Roles, Web/Testing, Knowledge/Planning - Quick Reference table mapping common tasks to skill combinations ### Context Guard - New `scripts/context-monitor.ps1` — PostToolUse hook that estimates token usage and warns at 70%/85% - `.claude/settings.local.json` updated with PostToolUse hook configuration ### Session Management (3 new skills) - `/session-save` — save session state to `session-notes.md` - `/session-restore` — restore session and auto-continue from saved state - `/session-retro` — quick retrospective of session outcomes - `scripts/rotate-session.ps1` — open new terminal tab with fresh Claude session - `docs/guides/session-management.md` — setup guide and workflow reference ### Notes - No RLM dependency — all session state stored locally - `session-notes.md` added to `.gitignore`

  2. v1.1.0 GitHub ↗
    Original release notes

    ## Changes - **Skill consolidation**: 14 granular skills merged into 5 expert-* skills - epf-expert (replaces 6 EPF/ERF skills) - mxl-expert (replaces 3 MXL/template skills) - role-expert (replaces role-compile) - subsystem-expert (replaces 3 subsystem/interface skills) - inspect (replaces 7 *-info skills) - validate (replaces 11 *-validate skills) - Total skill count: 80 -> 52 (leaner, less overlap) - Docs: no changes Full skill list in .claude/skills/

Current listing version

0.0.1

Verify the source revision ↗

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value78/100

Highlights

  • 提供 1С 单元测试的完整端到端自动化流程,实用性强
  • 明确区分业务逻辑测试与 UI 测试,定位清晰
Trigger Precision92/100

Highlights

  • 触发词明确且覆盖多种变体(编写测试、测试模块、运行1C单元测试)
  • 明确排除 UI 测试场景,边界清晰
Structure and Standards95/100

Highlights

  • Phase/步骤划分清晰,包含完整的端到端示例
  • frontmatter 完整,文档结构规范
Execution Reliability88/100

Highlights

  • 工具来源明确(1c-ai-debug MCP),参数示例正确
  • 覆盖主要异常情况,不可逆操作有确认和清理机制
Evidence Verifiability (mean of the first four)88/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.