cfe-patch-method

Generate method interceptor skeletons for 1C extensions and write decorated methods into .bsl files.

41|5|Updated May 28, 2026
One-click install
npx skills add https://github.com/msrv-tech/skills --skill cfe-patch-method-msrv-tech
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cfe-patch-method
Source: https://github.com/msrv-tech/skills/tree/main/cfe-patch-method
Command: npx skills add https://github.com/msrv-tech/skills --skill cfe-patch-method-msrv-tech

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Генерирует перехватчик метода в расширении 1С (CFE). Создаёт декоратор перехвата и файл модуля, дописывая в существующий при необходимости. Предназначен для объектов, заимствованных в расширение (/cfe-borrow).

Core Features & Use Cases

  • Генерация декоратора перехвата и соответствующего тела метода в указанных путях модуля (ObjectModule/ManagerModule/Module.bsl и пр.).
  • Поддержка трёх типов перехвата: Before, After и ModificationAndControl; возможность указать контекст выполнения на сервере или на клиенте; поддержка функций и процедур.
  • Автоматическое создание файлов и проверка пути, совместимость с заимствованными объектами, формирование имени процедуры с префиксом из Configuration.xml.

Quick Start

Запустите скрипт cfe-patch-method.ps1 с параметрами -ExtensionPath <путь> -ModulePath "Catalog.Контрагенты.ObjectModule" -MethodName "ПриЗаписи" -InterceptorType Before.

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 method interceptor for a 1C extension?

To generate a method interceptor for a 1C extension, use a script that creates a decorator skeleton and writes the method body into the specified .bsl module file. You provide the extension path, module path, method name, and interceptor type to generate the code automatically.

What is a method interceptor in 1C CFE extensions?

A method interceptor in 1C CFE extensions is a decorator that wraps a borrowed object's method to inject custom logic. It supports Before, After, and ModificationAndControl contexts to execute pre-processing, post-processing, or modified logic during method execution.

Can I create both Before and After interceptors for 1C extension methods?

Yes, you can create both Before and After interceptors for 1C extension methods. The generation script supports Before, After, and ModificationAndControl interceptor types, allowing you to specify pre-processing, post-processing, or controlled modification contexts for the target method.

How do I add an interception decorator to an existing .bsl module file?

To add an interception decorator to an existing .bsl module file, run the generation script with the required extension and module paths. The script automatically checks the file path, creates the file if needed, and appends the decorated method body with the correct procedure prefix.

Does the 1C extension interceptor generation support client and server contexts?

Yes, the 1C extension interceptor generation supports both client and server execution contexts. You can specify the context and whether the target method is a function or procedure to tailor the generated skeleton code accurately.

What are the limitations of generating 1C extension method interceptors?

Generating 1C extension method interceptors requires specific parameters including ExtensionPath, ModulePath, MethodName, and InterceptorType. It is designed for borrowed extension objects and relies on Configuration.xml for procedure prefixing, meaning unsupported module structures may fail.