code-patch

Insert or replace BSL code in 1C XML Configuration and Extension modules.

1|2|Updated Jul 19, 2026
One-click install
npx skills add https://github.com/IngvarConsulting/unica-marketplace --skill code-patch-ingvarconsulting
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-patch
Source: https://github.com/IngvarConsulting/unica-marketplace/tree/main/plugins/unica/skills/code-patch
Command: npx skills add https://github.com/IngvarConsulting/unica-marketplace --skill code-patch-ingvarconsulting

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Editing BSL modules in 1C:Enterprise XML source exports by hand is error-prone: paths must be resolved from logical metadata addresses, edits must stay byte-exact, and unsafe changes can corrupt a module. This Skill performs one verified insert or replace operation through the unica MCP tool with mandatory dry-run preview before any write. ## Core Features & Use Cases - Targeted insert and replace: Place BSL content before or after a selected method or anchor, replace a selected span, or append to the end of a module when no selector is given. - Dry-run validation: Every call runs with dryRun first, returning pre/post hashes, a byte-exact diff, the changed range, and BSL parse status before anything is published. - Selector safety: Method selectors match whole procedures or functions including annotations; anchor selectors must match exactly once, and ambiguous requests are rejected before writing. - Use Case: Add a logging statement after a specific anchor line in a CommonModule of a 1C Extension source set, preview the exact diff, then apply the identical call with dryRun set to false. ## Quick Start Ask the assistant to insert a BSL procedure into CommonModule.Example.Module of the main source set using the code-patch skill, previewing the diff first and applying only after you confirm.

Frequently Asked Questions about code-patch

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I insert BSL code into a 1C module safely?

Call unica.code.patch with operation insert, a method or anchor selector, and dryRun set to true to preview the exact diff and hashes. Apply the same call with dryRun false only after the user explicitly confirms the change.

How do I append code to the end of a BSL module?

Omit the selector entirely when calling unica.code.patch with operation insert; the content is appended to the end of the module. This also works for a module that holds no method yet, and the position parameter is refused in this mode.

Can code-patch create new metadata objects or edit EDT files?

No. The tool only edits modules of existing metadata objects in supported Platform XML Configuration or Extension source sets. It cannot create metadata objects, batch-edit files, delete whole modules, edit EDT or external files, or synchronize with an infobase.

What is the difference between method and anchor selectors?

A method selector matches an entire procedure or function including its annotations. An anchor selector is an exact text string that must match exactly once inside a BSL method, with LF and CRLF differences normalized while returned ranges stay byte-exact.

Why was my patch request rejected before writing?

Requests are rejected when the selector would become ambiguous, the resulting edit could not be proven a no-op on repeat, or legacy path fields are used. Preview, no-op, and failed validation never publish a module-change event.