Commit Graph

83 Commits

Author SHA1 Message Date
Nick Shirokov 151d1d77cb Add /skd-edit skill for atomic DCS modifications
New skill for point editing of existing Template.xml: add-field,
add-total, add-calculated-field, add-parameter (with @autoDates),
add-filter, set-query. Uses XmlDocument+PreserveWhitespace pattern
from form-edit and shorthand parsers from skd-compile.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 16:56:02 +03:00
Nick Shirokov 70bb5074c8 Update SKD DSL spec and guide with new features documentation
Add conditionalAppearance, multi-group totalField, viewMode flags
(@normal, @inaccessible), userSettingPresentation, dataParameters
table. Update guide with @autoDates, structure/filter shorthand,
and modern examples.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 16:19:31 +03:00
Nick Shirokov 91d254b718 Add DCS template type, conditional appearance, filter/total enhancements
- epf-add-template: support DataCompositionSchema template type with
  minimal DCS scaffold (dataSource + Local)
- skd-compile: add conditionalAppearance with auto-detect value types
  (Color, LocalStringType, Boolean), selection, filter, presentation
- skd-compile: add @normal, @inaccessible viewMode shorthand flags
- skd-compile: add userSettingPresentation for filters and dataParameters
- skd-compile: support multiple group elements in totalField (array form)
- skd-compile SKILL.md: document all new features with examples

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 16:12:47 +03:00
Nick Shirokov 1382194201 Fix @period role to emit periodNumber/periodType instead of period
Real DCS files use <dcscom:periodNumber>1</dcscom:periodNumber> and
<dcscom:periodType>Main</dcscom:periodType> for period fields.
The element <dcscom:period> does not exist in the XDTO schema and
causes build failures.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 13:22:35 +03:00
Nick Shirokov 7e587b9a3e Emit Auto items only at group level, not top-level settings
Real DCS files place SelectedItemAuto and OrderItemAuto exclusively
inside StructureItem elements (groups, tables, charts), never at the
top-level settings. Added -skipAuto switch to Emit-Selection and
Emit-Order, applied at settings level.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 12:48:52 +03:00
Nick Shirokov 4594c74d21 Document d5p1: inline namespace for reference types in DCS spec
Reference types in valueType use inline xmlns:d5p1 declaration with
URI http://v8.1c.ru/8.1/data/enterprise/current-config, not a
root-level cfg: prefix. Added XML example and supported type list.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 11:47:04 +03:00
Nick Shirokov 2650b1a063 Fix reference types to use d5p1: namespace instead of cfg:
Real DCS files use inline xmlns:d5p1="http://v8.1c.ru/8.1/data/
enterprise/current-config" for reference types like CatalogRef.XXX.
Using cfg: prefix caused XDTO errors because the namespace was
undeclared. With correct d5p1: namespace, EPF builds successfully
in both empty and config-aware bases.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 11:45:01 +03:00
Nick Shirokov f23a3e5536 Add MIT license
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 11:35:47 +03:00
Nick Shirokov eb6f8379e6 Skip cfg: reference types in DCS valueType to fix XDTO build errors
Real 1C DCS files (12,495 analyzed) never include cfg:CatalogRef.XXX
in <valueType> — the platform infers field types from query metadata.
Emitting them causes XDTO exceptions when building EPF. Reference
types in JSON DSL still set field roles but no longer emit valueType.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 11:32:17 +03:00
Nick Shirokov 91e4e1948f Add comprehensive XML escaping to skd-compile
Wrap all user-provided values in Esc-Xml() for safe XML output:
- ValueType references (CatalogRef, DocumentRef, etc.)
- Emit-ParamValue (all type branches: StandardPeriod, dateTime, boolean, decimal)
- DataParameters (variant, boolean, dateTime values, viewMode, userSettingID)
- Filter items (field, comparisonType, viewMode, userSettingID)
- Selection fields, Order fields, GroupItems fields
- GroupTemplates templateType, HorizontalAlign appearance value
- Parameter use element

Verified against 12,495 real DCS files: standard XML entity escaping
(&amp; &lt; &gt; &quot;) matches 1C platform behavior exactly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 09:44:23 +03:00
Nick Shirokov f4d60d67bf Add DSL v2 shorthand improvements to skd-compile
Type synonyms (число/строка/булево/дата/СправочникСсылка, case-insensitive),
@autoDates for auto-generating ДатаНачала/ДатаОкончания from StandardPeriod,
string shorthand for structure ("Организация > details"), filter shorthand
("Организация = _ @off @user"), dataParameters shorthand ("Период = LastMonth
@user"), and default selection/order ["Auto"] on all structure levels.
Compression ratio improved from 3.9x to 5.8x on the medium example.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 22:09:03 +03:00
Nick Shirokov b67f4b21e6 Add SKD group to README, create skd-guide.md
- README: add СКД row to skills table, specs section, directory tree
- docs/skd-guide.md: usage guide with workflow, DSL examples, scenarios

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 21:32:29 +03:00
Nick Shirokov d573f84c9d Add skd-compile and skd-validate skills for DCS schema generation
- skd-compile: JSON DSL → Template.xml (DataCompositionSchema)
  Shorthand parsers for fields, totals, parameters, calculated fields.
  Full type system, settings variants with selection/filter/order/structure.
- skd-validate: structural validation of Template.xml (~30 checks)
  DataSources, DataSets, fields, links, params, templates, variants.
- docs/skd-dsl-spec.md: full DSL specification

Tested on compiled examples and 5+ real DCS from acc_8.3.24 (0 errors).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 21:27:19 +03:00
Nick Shirokov c306d18648 Add templates mode for DCS template binding analysis
- Map (without -Name): field bindings with non-trivial expression
  detection, group bindings organized by group name (groupTemplate,
  groupHeaderTemplate, groupFooterTemplate, fieldTemplate)
- Detail (-Name <group|field>): template content with rows, cells
  (static text and parameters), non-trivial expressions only
- Trivial filter: Field=Field and Field=Представление(Field) hidden
- Updated overview: shows binding type counts, templates hint in Next

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 19:56:56 +03:00
Nick Shirokov d72dd1678e Extract detailed mode examples into modes-reference.md
SKILL.md: 288 -> 72 lines. Compact table of modes with
progressive disclosure pattern, typical workflow, command
reference. Detailed output examples moved to modes-reference.md
(loaded on demand via Read tool, not on every skill invocation).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 19:01:16 +03:00
Nick Shirokov 0ca6d3f089 Add variant list mode, fix stale SKILL.md references
- variant without -Name now shows variant list (progressive disclosure)
- Fix Mode parameter: totals -> calculated, resources
- Fix fields -Name example: dataset name -> field name
- Improved error message when variant not found

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 18:52:20 +03:00
Nick Shirokov dddb9e3dac Make fields -Name drill into specific field for consistency
fields -Name now takes a field dataPath (like calculated -Name and
resources -Name) instead of a dataset name. Shows field detail:
dataset, title, type, role, restrict, format, presentationExpression.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 18:45:15 +03:00
Nick Shirokov f211ffa2f0 Split totals into calculated and resources modes
Each concept now has its own mode with clear naming that matches
the overview labels. Overview now shows "Resources:" instead of
"Totals:" for consistency.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 18:40:50 +03:00
Nick Shirokov 21dded4d1c Add trace mode for field origin analysis
New mode traces a field from title/name to its full origin:
dataset fields, calculated expression with operands, resource
formulas. Searches by dataPath, exact title, or title substring.
Collapses 5-7 manual calls into one.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 18:34:12 +03:00
Nick Shirokov 941fa73803 Add progressive disclosure to fields and totals modes
Without -Name, both modes now show a compact map (field names
per dataset / calculated+resource names). With -Name, they
drill down to full detail. Totals -Name shows both calculated
expression and resource formula when field appears in both.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 18:23:02 +03:00
Nick Shirokov 24358f212f Split fields mode into fields, links, and totals modes
Separate concerns for cleaner output: fields shows only dataset
field tables, links shows dataset connections, totals shows
calculated fields and resources.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 18:00:30 +03:00
Nick Shirokov d210d21079 Add full link details to fields mode
Show dataSetLink field-level mappings (source.field -> dest.field
param=X) at the top of -Mode fields output. Overview keeps compact
dataset-pair summary, fields provides the detail.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 17:46:29 +03:00
Nick Shirokov 2949682ce8 Update SKILL.md examples to match simplified overview
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 17:39:42 +03:00
Nick Shirokov e86620dbd7 Simplify /skd-info overview to pure navigation map
Overview now shows only counts for calculated/totals/templates.
Links compressed to dataset pairs. Params split into visible/hidden
with only visible names listed. Add "Next:" hints with available
modes and dataset names to guide further exploration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 17:39:16 +03:00
Nick Shirokov 9922f118d1 Improve /skd-info overview for large schemas
Switch to multi-line/compact format when element counts are high:
totals (>5) show grouped by field name, calculated (>10) truncated,
templates (>10) show counts, links (>2) multi-line, variant structure
groups identical items (e.g. "17x Group(...)"). Fix query mode to
prefer nested Query datasets over parent Union with same name.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 17:31:30 +03:00
Nick Shirokov 8c833f042c Add /skd-info skill for DCS (Data Composition Schema) analysis
Implements 5 modes: overview (compact TOC), query (raw SQL with batch
splitting), fields (field table with roles/restrictions), params
(parameter table with types/defaults), variant (structure tree with
filters and output settings). Update DCS spec with totalField group info.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 17:24:43 +03:00
Nick Shirokov be216cd064 Document CatalogRef XDTO build failure in empty database
Verified experimentally: EPF build with CatalogRef/DocumentRef
types fails with XDTO exception in empty database (not silent
UUID substitution as previously documented). Updated epf-build,
form-compile, and build-spec accordingly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 14:11:23 +03:00
Nick Shirokov e229fc4873 Auto-register role in Configuration.xml
role-compile: after generating files, automatically inserts
<Role>Name</Role> into Configuration.xml ChildObjects (idempotent).
role-validate: checks that the role is registered, warns if not.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 13:29:50 +03:00
Nick Shirokov 3a4c1905f4 Fix Cyrillic encoding in role-info console output
Add [Console]::OutputEncoding = UTF8, matching role-compile
and role-validate scripts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 13:21:00 +03:00
Nick Shirokov 7aaa9fc070 Remove @use preset, merge DataProcessor/Report into @view
The @use preset name conflicted with the Use right semantics.
DataProcessor and Report require Use+View together (View cannot
be set without Use), so @view is the natural fit. Services
(WebService, HTTPService, IntegrationService) use explicit rights.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 13:18:08 +03:00
Nick Shirokov 8b8bc1225a Refactor role-compile SKILL.md with progressive disclosure
Extract detailed preset tables, Russian synonym tables, and extra
examples into dsl-reference.md (318 lines). Compact SKILL.md from
340 to 107 lines. Add role-dsl-spec.md project spec.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 13:13:59 +03:00
Nick Shirokov dc10422f10 Add script-based /role-compile and /role-validate skills
Convert /role-compile from instruction-based to PowerShell script with JSON DSL:
- Presets (@view, @edit, @use) for common right sets
- String shorthand and object form with RLS support
- Russian synonym translation for object types and rights
- Auto UUID generation, UTF-8 BOM output

Add /role-validate for structural validation of Rights.xml:
- XML well-formedness, namespace, global flags
- Right name validation per object type with typo suggestions
- RLS condition and template checks
- Optional metadata validation (UUID, Name, Synonym)

Update README and role-guide with new skills documentation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 10:29:59 +03:00
Nick Shirokov 65afdf2e55 Add 1C Data Composition Schema (DCS) XML format specification
Comprehensive spec covering DataCompositionSchema format based on
analysis of 930 schemas from accounting configuration (8.3.24):
dataSource, dataSet (Query/Object/Union), fields with roles and
restrictions, parameters, dataset links, calculated/total fields,
area templates, and settings variants with structure items.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 09:32:33 +03:00
Nick Shirokov 6681758121 Add /form-add skill for configuration objects
Create forms (metadata XML + Form.xml + Module.bsl) for Document,
Catalog, InformationRegister and other configuration object types.
Supports Object/List/Choice/Record purposes with automatic
ChildObjects registration and DefaultForm setup.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 22:53:13 +03:00
Nick Shirokov 89f0788585 Rename form-add to form-edit for clarity
The skill modifies existing forms (adds elements/attributes/commands),
not creates new ones. "form-edit" better reflects its purpose.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 22:05:33 +03:00
Nick Shirokov d27dfbf8e1 Add role-guide.md and update README with role skills
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 21:54:52 +03:00
Nick Shirokov fc24524c75 Add /role-info and /role-compile skills
role-info: PS1 script parsing Rights.xml into compact summary grouped
by object type. Supports -ShowDenied and -OutFile for UTF-8 output.
78K lines XML -> 1924 lines for largest role, ~100 for typical ones.

role-compile: Template-based SKILL.md (no script) with XML templates,
rights catalog per object type, and typical right sets.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 21:21:04 +03:00
Nick Shirokov 2c96c90d45 Add 1C role XML format specification
Complete reference: file structure, rights catalog by object type,
nested object rights, RLS conditions, restriction templates.
Verified across platform versions 8.3.20/8.3.24/8.3.27 and
both ACC and ERP configurations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 21:06:01 +03:00
Nick Shirokov ecfb473827 Add /form-patterns skill for loading layout guide into context
Self-contained SKILL.md with all patterns inlined (no external file
dependencies). Archetypes, naming conventions, ERP patterns, DSL examples.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 19:02:00 +03:00
Nick Shirokov dc9e1fe3db Add advanced ERP patterns to form layout guide
Collapsible groups, status banners, popup menus, custom command bars,
hyperlink labels — with DSL examples for each pattern.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 18:35:02 +03:00
Nick Shirokov 5c07dec82c Add form layout patterns guide with real-world conventions
Design patterns extracted from 1C:Accounting 8.3.24 forms:
- 5 archetypes: document, processor, list, catalog, wizard
- Naming conventions for groups, elements, event handlers
- Layout principles (2-column header, footer totals, filter pairs)
- Two complete DSL examples (processing form, list with filters)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 18:12:17 +03:00
Nick Shirokov c5fa794cf3 Add event validation and element-level stdCommand support
- stdCommand dot syntax: "Товары.Add" → Form.Item.Товары.StandardCommand.Add
- Event name validation: warn on unknown events per element type (13 types, ~60 events)
- Form-level event validation (19 known events)
- Document events reference and popup element in SKILL.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 17:39:29 +03:00
Nick Shirokov 7e0e30730c Add unknown key warnings to form-add, update form-guide.md
form-add: warn about unrecognized DSL keys in element definitions,
matching the same validation added to form-compile earlier.

form-guide.md: update form-info output examples to reflect new
Title-in-header format and DSL-friendly command display
(-> Name [cmd], -> Close [std]).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 16:03:17 +03:00
Nick Shirokov ad412dffa2 Expand form-compile SKILL.md with full DSL reference and patterns
Replace minimal docs with comprehensive reference:
- Per-element-type property tables (input, check, label, group,
  table, pages, button, cmdBar) with all supported keys
- Top-level structure documentation (title, properties, events, etc.)
- Table+attribute linkage section explaining the ValueTable pattern
- Three pattern examples: file import dialog, wizard with steps,
  list with filter and table
- Attribute and command definition examples

This helps the model generate correct JSON DSL from natural language
requirements on the first attempt without guessing undocumented keys.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 15:58:15 +03:00
Nick Shirokov c665800916 Improve form skills: validation, docs, round-trip consistency
form-compile: warn about unknown DSL keys in element definitions,
document stdCommand/command button keys and EPF-specific notes.

form-validate: check that form-level Title uses multilingual XML,
not plain text (which causes XDTO errors at build time).

form-add: warn about duplicate element names, clarify after-not-found
message when using into+after together.

form-info: show Title in header instead of Properties line, display
commands as DSL-friendly format (-> Name [cmd], -> Close [std])
instead of raw Form.Command/Form.StandardCommand paths.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 15:44:32 +03:00
Nick Shirokov d05199d048 Replace hidden/disabled with visible/enabled in form DSL
Rename DSL keys to match 1C property names (Visible, Enabled):
- form-compile/form-add: accept "visible": false and "enabled": false
  as primary keys, keep hidden/disabled as synonyms
- form-info: output [visible:false] and [enabled:false] flags
- Update SKILL.md docs and form-guide.md

Improves round-trip consistency: form-info output now directly maps
to form-compile/form-add input keys.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 15:05:14 +03:00
Nick Shirokov a9e59265dd Fix ID scanning in form-add and title emission in form-compile
form-add: Scan column IDs (same pool as attribute IDs) to prevent
duplicate ID collisions. Use XPath .//*[@id] instead of ChildItems
recursion to capture companion element IDs (ExtendedTooltip, ContextMenu).

form-compile: Extract title from properties and route through Emit-MLText
instead of generic Emit-Properties, which produced plain text <Title>
rejected by 1C XDTO schema.

Found during E2E testing of full pipeline (epf-init → form-compile →
form-add → epf-build).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 14:40:23 +03:00
Nick Shirokov 99f57a5ff2 Add form-add skill for modifying existing Form.xml
Adds elements, attributes, and commands to existing managed forms
via JSON input. Supports positional insertion (into/after), auto ID
allocation from correct pools, companion generation, and event handlers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 13:34:56 +03:00
Nick Shirokov a813c7fd46 Add form-validate skill for structural validation of Form.xml
Checks: unique IDs (per pool), companion elements, DataPath→attribute
refs, button→command refs, event handlers, command actions, MainAttribute.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 12:13:51 +03:00
Nick Shirokov cc2595b57a Add form-compile skill for generating Form.xml from JSON DSL
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 11:57:58 +03:00