Skd report patterns

From SteelMorgan/1c-agent-based-dev-framework · View interactive version

Skd report patterns is an AI agent skill from the GitHub repository SteelMorgan/1c-agent-based-dev-framework. Design and analysis of standard 1C SKD reports: data sets, fields, resources, parameters, settings, variants, groupings, compiler, composition processor, and result output.

How to use this skill

Skill file

SKD Reports

Purpose

Use this skill for SKD as a data and composition mechanism:

If the report uses custom areas of the Макеты tab, also use skd-custom-layout.

Basic Chain

Typical programmatic chain:

Настройки = КомпоновщикНастроек.ПолучитьНастройки();
КомпоновщикМакета = Новый КомпоновщикМакетаКомпоновкиДанных;
МакетКомпоновки = КомпоновщикМакета.Выполнить(СхемаКомпоновкиДанных, Настройки, ДанныеРасшифровки);

ПроцессорКомпоновки = Новый ПроцессорКомпоновкиДанных;
ПроцессорКомпоновки.Инициализировать(МакетКомпоновки, ВнешниеНаборыДанных, ДанныеРасшифровки);

ПроцессорВывода = Новый ПроцессорВыводаРезультатаКомпоновкиДанныхВТабличныйДокумент;
ПроцессорВывода.УстановитьДокумент(ДокументРезультат);
ПроцессорВывода.Вывести(ПроцессорКомпоновки);

Platform graph:

СхемаКомпоновкиДанных
  -> ИсточникДоступныхНастроекКомпоновкиДанных
  -> КомпоновщикНастроекКомпоновкиДанных
      -> НастройкиКомпоновкиДанных
          -> КомпоновщикМакетаКомпоновкиДанных.Выполнить()
              -> МакетКомпоновкиДанных
                  -> ПроцессорКомпоновкиДанных.Инициализировать()
                      -> ЭлементРезультатаКомпоновкиДанных*
                          -> ПроцессорВыводаРезультатаКомпоновкиДанныхВТабличныйДокумент
                              -> ТабличныйДокумент

ДанныеРасшифровкиКомпоновкиДанных are passed into layout generation, the composition processor, and the result form. External data sets are passed to ПроцессорКомпоновкиДанных.Инициализировать().

For element-by-element output, use НачатьВывод(), the ПроцессорКомпоновки.Следующий() loop, ВывестиЭлемент(), and ЗакончитьВывод(). This mode is needed when you need to intervene in a result element before output.

SKD Capabilities

Data sets:

Use data set connections for master-detail, constraining the receiving set by a parameter, and linking query/object data sets. Make sure that the connection parameter is actually used in the receiving query; for the В operation, a parameter list must be allowed.

Use calculated fields for lightweight derived values that must participate in settings, filters, sorting, or resources. Move heavy algorithms and data access into the query or external data set preparation.

Resources are responsible for aggregation. Do not substitute a source field with a resource: the source field stores detail values, while the resource defines the aggregate expression and groupings.

If a value must be output at the grouping or total level, do not pull the "raw"

field into the grouped node as if it were already aggregated. For such a level, explicitly define a resource or calculated field with

an aggregate function, otherwise the schema may be assembled formally but fail during runtime generation because of

incorrect use of the field in the grouping.

Parameters are divided by purpose:

Авто is suitable for parameters included based on actual use. Всегда is needed for mandatory query parameters or field availability.

A settings variant fixes a specific output scenario. User settings are applied on top of the variant, and fixed settings are applied additionally through the composer.

The main output structure elements are grouping, table, chart, nested report, and detail records. With custom layouts, structure elements are linked to areas through groupTemplates; with standard output, the platform builds the result areas.

XML Map

СхемаКомпоновкиДанных is usually located in Templates/<ИмяСКД>/Ext/Template.xml.

Typical XML sections:

For XML analysis, use xml-gen skd info, not manual parsing. If the runtime breaks on formally valid XML, compare the structure with a minimal reference that opens normally and record the generation defect while working with xml-gen.

What to Check

the standard report form and the standard generation command.

Tools

xml-gen skd info <Template.xml> --mode overview
xml-gen skd info <Template.xml> --mode fields
xml-gen skd info <Template.xml> --mode resources
xml-gen skd info <Template.xml> --mode params
xml-gen skd info <Template.xml> --mode variant --name <Вариант>
xml-gen validate --type skd <Template.xml>

Use skd-dsl to create a schema. For targeted edits to an existing schema, use skd-edit.


depends_on: []


Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.