cfe-patch-method

Generate 1C CFE method interceptor BSL code and append it to extension module files.

33|8|Updated Mar 6, 2026
One-click install
npx skills add https://github.com/Dach-Coin/claude_rules_1c --skill cfe-patch-method-dach-coin
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cfe-patch-method
Source: https://github.com/Dach-Coin/claude_rules_1c/tree/main/.claude/skills/cfe-patch-method
Command: npx skills add https://github.com/Dach-Coin/claude_rules_1c --skill cfe-patch-method-dach-coin

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill solves the problem of manually writing repetitive boilerplate code to intercept (hook) methods in 1C extensions (CFE) when you need to run logic before, after, or instead of an inherited method.

Core Features & Use Cases

  • Generates BSL interceptor procedures/functions for 1C extension modules (CFE) with correct server/client annotations.
  • Supports three interceptor styles: Before (&Перед), After (&После), and ModificationAndControl (&ИзменениеИКонтроль with copy/modify markers).
  • Appends or creates .bsl module files in the target extension path, using the extension’s Configuration.xml NamePrefix to form the interceptor procedure name.
  • Works across multiple ModulePath patterns including Catalog/Document modules, common modules, and form modules (with a metadata presence warning for borrowed forms).

Quick Start

Tell the AI to generate a Before interceptor for Catalog.Контрагенты.ObjectModule method ПриЗаписи by running the cfe-patch-method script with your ExtensionPath, ModulePath, and MethodName.

Frequently Asked Questions about cfe-patch-method

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

FAQPage Schema
How do I generate a 1C extension method interceptor in BSL?

To generate a 1C extension method interceptor in BSL, you provide the ExtensionPath, ModulePath, and MethodName. The script reads the NamePrefix from Configuration.xml and outputs a decorated procedure or function using &Перед, &После, or &ИзменениеИКонтроль annotations.

What is the difference between &Перед, &После, and &ИзменениеИКонтроль in 1C CFE?

In 1C CFE, &Перед injects logic before an inherited method, &После runs logic after, and &ИзменениеИКонтроль modifies and controls the inherited method directly using copy and modify markers within the extension module.

Can I use this to patch form modules and common modules in 1C extensions?

Yes, you can patch form modules and common modules in 1C extensions. It supports multiple ModulePath patterns including Catalog and Document modules, and issues a metadata presence warning specifically for borrowed forms.

Does the 1C CFE interceptor generator automatically create the BSL module file?

Yes, the 1C CFE interceptor generator automatically creates or appends to the target .bsl module file. It uses the extension's Configuration.xml NamePrefix to correctly form the interceptor procedure name during file generation.

What do I need to provide to hook a method like ПриЗаписи in a 1C extension?

To hook a method like ПриЗаписи in a 1C extension, you must provide the ExtensionPath, ModulePath, and MethodName. The script reads the NamePrefix from Configuration.xml to generate the correctly decorated BSL interceptor code.

What are the limitations when intercepting borrowed form methods in 1C CFE?

When intercepting borrowed form methods in 1C CFE, the limitation involves a metadata presence warning. The script handles form ModulePaths but alerts you to verify metadata availability before appending the BSL interceptor logic.