cfe-patch-method

Generate 1C BSL method interceptor code for CFE extensions.

151|20|Updated Feb 11, 2026
One-click install
npx skills add https://github.com/Arman-Kudaibergenov/1c-ai-development-kit --skill cfe-patch-method-arman-kudaibergenov
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cfe-patch-method
Source: https://github.com/Arman-Kudaibergenov/1c-ai-development-kit/tree/main/.claude/skills/cfe-patch-method
Command: npx skills add https://github.com/Arman-Kudaibergenov/1c-ai-development-kit --skill cfe-patch-method-arman-kudaibergenov

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

It solves the problem of manually writing boilerplate to intercept (hook) methods of borrowed objects in a 1C extension so you can inject code before, after, or by modifying the original method body.

Core Features & Use Cases

  • Creates or appends interception code: Generates a ready-to-use BSL fragment and writes it into the correct extension module file for the target.
  • Supports multiple interception modes: Generates &Перед, &После, or &ИзменениеИКонтроль handlers, and optionally adds Возврат for functions.
  • Works from concrete module identification: Uses ExtensionPath + ModulePath + MethodName to locate the right .bsl file inside the CFE structure and generate the procedure with the extension NamePrefix.

Quick Start

Ask the AI to run the cfe-patch-method skill to intercept ПриЗаписи for a given module in your extension as a Before handler.

Frequently Asked Questions about cfe-patch-method

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

FAQPage Schema
How do I intercept a borrowed object method in a 1C BSL extension?

Generating a 1C BSL method interceptor creates &Перед, &После, or &ИзменениеИКонтроль handlers for borrowed object methods in CFE extensions. It automatically locates the target module .bsl file using deterministic mapping, reads the NamePrefix from Configuration.xml, and writes the hooking code in UTF-8 format.

What's the best way to add logic before or after a method call in 1C CFE?

The best way to inject logic before or after a method call in 1C CFE is to generate a &Перед (Before) or &После (After) handler. The skill appends this BSL code directly into the target extension module file, automatically applying the correct NamePrefix from Configuration.xml.

How does method interception work with ModificationAndControl in BSL?

ModificationAndControl interception in BSL works by replacing a borrowed object's method body using the &ИзменениеИКонтроль directive. The generated interceptor can optionally add a Возврат statement for functions, allowing you to fully override or wrap the original method's execution flow.

Can I use an extension to replace the body of a function in 1C?

Yes, you can replace a function body in a 1C extension by generating an &ИзменениеИКонтроль interceptor. When the IsFunction parameter is enabled, the generated BSL code automatically includes the Возврат statement to ensure the overriding function returns a value correctly.

Do I need to manually find the target .bsl file when patching a CFE method?

No, you do not need to manually find the target .bsl file. The process uses deterministic mapping of ModulePath combined with ExtensionPath to automatically locate the correct module file within the CFE structure, then writes the BSL code by creating or appending to that file.

Why does my 1C extension method interceptor need a NamePrefix?

A NamePrefix is required for 1C extension method interceptors to ensure the generated procedure does not conflict with existing methods in the configuration. The prefix is automatically read from Configuration.xml and applied to the interceptor procedure name within the target module.