AgentSkillsCN

1c-form-edit

分析1C托管表单结构(Form.xml)——包括元素、属性、命令与事件。在对表单进行修改前,或在处理大型表单时,此功能可帮助您清晰掌握表单布局,提升操作效率。

SKILL.md
--- frontmatter
name: 1c-form-edit
description: "Add elements, attributes, and commands to an existing 1C managed form (Form.xml). Use when modifying an existing form by inserting new UI elements, data attributes, or commands."

1C Form Edit — Modify Existing Forms

Adds elements, attributes, and/or commands to an existing Form.xml. Automatically allocates IDs from the correct pool, generates companion elements (ContextMenu, ExtendedTooltip, etc.) and event handlers.

Usage

code
1c-form-edit <FormPath> <JsonPath>
ParameterRequiredDescription
FormPathyesPath to existing Form.xml
JsonPathyesPath to JSON with additions

Command

powershell
powershell.exe -NoProfile -File skills/1c-form-edit/scripts/form-edit.ps1 -FormPath "<path>" -JsonPath "<path>"

JSON Format

json
{
  "into": "HeaderGroup",
  "after": "Contractor",
  "elements": [
    { "input": "Warehouse", "path": "Object.Warehouse", "on": ["OnChange"] }
  ],
  "attributes": [
    { "name": "TotalAmount", "type": "decimal(15,2)" }
  ],
  "commands": [
    { "name": "Calculate", "action": "CalculateHandler" }
  ]
}

Element Positioning

KeyDefaultDescription
intoroot ChildItemsName of group/table/page to insert into
afterat endName of element to insert after

Element Types

Same DSL keys as in 1c-form-compile:

KeyXML TagCompanions
inputInputFieldContextMenu, ExtendedTooltip
checkCheckBoxFieldContextMenu, ExtendedTooltip
labelLabelDecorationContextMenu, ExtendedTooltip
labelFieldLabelFieldContextMenu, ExtendedTooltip
groupUsualGroupExtendedTooltip
tableTableContextMenu, AutoCommandBar, Search*, ViewStatus*
pagesPagesExtendedTooltip
pagePageExtendedTooltip
buttonButtonExtendedTooltip

Groups and tables support children/columns for nested elements.

Buttons: command and stdCommand

  • "command": "CommandName"Form.Command.CommandName
  • "stdCommand": "Close"Form.StandardCommand.Close
  • "stdCommand": "Items.Add"Form.Item.Items.StandardCommand.Add (standard item command)

Allowed Events (on)

The compiler warns about errors in event names. Main events:

  • input: OnChange, StartChoice, ChoiceProcessing, Clearing, AutoComplete, TextEditEnd
  • check: OnChange
  • table: OnStartEdit, OnEditEnd, OnChange, Selection, BeforeAddRow, BeforeDeleteRow, OnActivateRow
  • label/picture: Click, URLProcessing
  • pages: OnCurrentPageChange
  • button: Click

Type System (for attributes)

string, string(100), decimal(15,2), boolean, date, dateTime, CatalogRef.XXX, DocumentObject.XXX, ValueTable, DynamicList, Type1 | Type2 (composite).

Output

code
=== form-edit: FormName ===

Added elements (into HeaderGroup, after Contractor):
  + [Input] Warehouse -> Object.Warehouse {OnChange}

Added attributes:
  + TotalAmount: decimal(15,2) (id=12)

---
Total: 1 element(s) (+2 companions), 1 attribute(s)
Run 1c-form-validate to verify.

When to Use

  • After 1c-form-compile: add elements not included in the original JSON
  • Modifying existing forms: add a field, attribute, or command to a form from configuration
  • Batch additions: one JSON can contain elements + attributes + commands

Workflow

  1. 1c-form-info — view current form structure
  2. Create JSON with addition descriptions
  3. 1c-form-edit — add to form
  4. 1c-form-validate — verify correctness
  5. 1c-form-info — confirm additions are correct

MCP Integration

Use search_metadata MCP tool to verify attribute types and object names. Use 1c-form-info skill to analyze form structure before editing.