Module Placement
MCP routing
- Preferred path: use MCP
unicatoolsunica.view {},unica.viewon the object node,unica.apply,unica.viewon the subsystem node,unica.search,unica.check, andunica.run. - Runtime идёт через
unica.run: вызов безopотдаёт словарь операций и контракт каждой —argsSchema,execution,previewRequired,ifRevRequiredOnApply. Контракт вызова бери оттуда, а не из этого текста; выбирай только операцию сimplemented: trueи не выдумывай аргументов записи сargsSchema: null; превью исполнением не является. Не обходи контракт прямым runner-ом. - Use
unica.docswithsource: "development-standard"for the standards about module hosting: 455, 469, 474, 486, 556, 679, 697, 724, 746, and diagnostics АПК:73, АПК:80, АПК:85, АПК:90, АПК:125, АПК:363, АПК:435-439, АПК:444, АПК:1245. These are standards, not evidence of runtime behavior; confirm the wording before citing one. - Use
unica.viewon the role node when the module enters privileged mode or carries the privileged flag. - Do not call internal analyzer, runtime, standards, or package adapters directly. They are hidden behind MCP
unica.
Scope boundary
This skill owns where code lives: which module hosts it and what that module may do. Classifying an exported method as public, service, or overridable interface, and judging what a change does to compatibility, belongs to api-design. Form module directives and the server-call budget inside a form belong to form-events. Object write handlers belong to object-events.
References
- Read
../../references/platform/module-placement.mdfor the hosting decision, the four common module contexts, the server call flag, cached modules, presentation handlers, and first launch. - Read
../../references/platform/form-events.mdwhen the code is going into a form module. - Read
../../references/platform/object-events.mdwhen it is an object event handler.
Core model
One question per module kind (std486):
- Instance state — works with
ЭтотОбъектand module variables, including before the object is written → object module. Calling its exported code from elsewhere usually costs aПолучитьОбъект(), which reads the whole object with its tabular sections. - Static for the metadata object — about the set of objects, or about an already-written one passed as a reference → manager module. It must not require an instance.
- Cannot be attributed to one metadata object → common module, grouped by one subsystem or one functional purpose.
Then pick exactly one of the four common module contexts (std469) and name it by its postfix. Anything outside those four is АПК:125.
| Context | Клиент (упр.) | Сервер | Внеш. соед. | Клиент (обычн.) | Вызов сервера | Postfix |
|---|---|---|---|---|---|---|
| Server | – | yes | yes | yes | – | none / Сервер |
| Server for client calls | – | yes | – | – | yes | ВызовСервера |
| Client | yes | – | – | yes | – | Клиент / Глобальный |
| Client-server | yes | yes | yes | yes | – | КлиентСервер |
Workflow
- Answer the three std486 questions before opening any module. The answer, not convenience, picks the host.
- Map the neighbourhood with
unica.view {}andunica.viewon the subsystem node: an existing module for the same subsystem or purpose is a reason to extend rather than add. - Find the callers with
unica.searchby the method name before moving anything (a call graph is not on the v0.13 surface) — a move that changes the module context changes what the callers may pass. - When adding a common module, choose the context row first, then
unica.applywith the matching flags and postfix. - Set
Вызов сервераonly for API genuinely called from the client, and state what it exposes. - Apply code with
unica.apply, one verifiable step at a time. - Verify statically with
unica.checkon the module node (test runs are outside the v0.13 surface) and report runtime behavior as unverified.
Design rules
- A server module keeps
Вызов сервераoff so procedures taking mutable types work correctly; exported procedures in aВызовСервераmodule must not take mutable types (std469). Вызов сервераis an exposure decision, not a convenience (std679). The exposed API must not reveal data the user cannot see or perform actions they are not allowed. A server calculation returns the result, not the source data.- In a managed application, object instances are worked with on the server. Do not create or fetch them from client common modules, including under
ТолстыйКлиентУправляемоеПриложение(std679). - Cache what comes from the database, an external source, or expensive computation — never what is computed faster than it is retrieved (std724, АПК:435 and its siblings). An exported procedure in a cached module is АПК:444.
- A cached value has a bounded lifetime and is also dropped on memory pressure, worker process restart, or a client switching worker process. Keep the parameter range narrow so the cache is actually read back.
- Presentation handlers in the manager module run on every presentation request: no queries, no fetching objects, no dotted access to reference attributes, and no predefined items that exchange may not have loaded yet (std746, std697).
- First launch and release update must be idempotent, and in a distributed infobase must not recreate or unconditionally rewrite data in a subordinate node (std556).
Review checklist
- The module kind matches the std486 question the code actually answers.
- The common module carries exactly one of the four valid flag combinations.
- The name matches the context postfix:
Клиент,КлиентСервер,ВызовСервера,ПовтИсп,ПолныеПрава,Глобальный— and a global module does not also carryКлиент(АПК:363). - The name avoids generic words like
Процедуры,Обработчики,Функциональность(АПК:73). Вызов сервераis set only where a client caller exists, and what it returns is safe to show that caller.- No cached function returns a constant, and none is keyed by a value with an unbounded range.
- Presentation handlers contain no query, no object fetch, and no dereferencing.
- First-launch and update handlers check for existence before creating.
Stop rules
- Do not set
Вызов сервераto make a call compile. - Do not move code between module kinds without checking callers first.
- Do not add a cached function without naming what it reads and how often it is read back.
- Do not create data unconditionally in a first-launch or update handler.
Contract gaps
If public MCP unica cannot inspect the module, its flags, its callers, or the diagnostics needed for the task, report a Unica MCP contract gap with the missing operation.