Api design

From IngvarConsulting/unica · View interactive version

Api design is an AI agent skill from the GitHub repository IngvarConsulting/unica. Проектирование и ревью API 1С: публичный программный интерфейс, служебный интерфейс, переопределяемые модули, совместимость, версионирование и миграция потребителей. Используй когда нужно спроектировать API, оценить изменение экспортных методов или проверить, можно ли вызывать метод/запрос из другой

How to use this skill

Skill file

API Design

Основано на статье Infostart "База по API": https://infostart.ru/1c/articles/2683808/.

MCP routing

контракт каждой — argsSchema, execution, previewRequired,

dryRunRequired. Контракт вызова бери оттуда, а не из этого текста;

используй опубликованную argsSchema; при support.state: limited

разрешено только подмножество support.supportedArgs. Недоступной операции

в словаре нет. Для плановой операции сначала проверь результат

dryRun: true, затем исполняй запрос с dryRun: false. Preview

не фиксирует входы между вызовами. Не обходи контракт прямым runner-ом.

Core model

Treat 1C as a modular monolith: libraries contain functional subsystems, and subsystems communicate through declared interfaces. Direct access across subsystem/library boundaries is a design decision, not a convenience.

Classify every exported method before changing or calling it:

Workflow

  1. Map source-sets with unica.view {} and inspect subsystem/object boundaries with unica.view on the subsystem node or unica.view on the object node.
  2. When the API belongs to a concrete metadata object, inspect unica.view on the object node for related modules, roles, subscriptions, and functional options before classifying the boundary.
  3. Find the candidate API with unica.search; inspect the module with unica.view on the module node (its Method branch lists the methods) before reading broad code.
  4. Find callers of exported methods with unica.view at <method>.Caller (callees at <method>.Callee); unica.search by the method name covers export area comments, module suffixes, deprecated sections, and literal contract mentions.
  5. Check standards through unica.docs with source: "development-standard": functional subsystems, libraries, overridable modules, version numbering, and backward compatibility.
  6. Classify the change: new method, optional parameter, mandatory parameter, removed/renamed method, changed parameter type, behavior change, deprecated method, or direct data access across a boundary.
  7. Decide the required version impact and migration path.
  8. Verify statically with unica.check on the module node (test runs are outside the v0.13 surface), then report runtime behavior as unverified unless separate evidence is supplied. Keep consumer-style tests for APIs with real callers.

Compatibility rules

Overridable modules

For переопределяемые modules:

API-first checklist

Review red flags

MCP examples

{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "unica.docs",
    "arguments": {
      "query": "стандарт 644",
      "source": "development-standard"
    }
  }
}
{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "unica.search",
    "arguments": {
      "query": "Устаревшие процедуры и функции",
      "scope": "<source-set-from-unica-view>:Configuration",
      "limit": 20
    }
  }
}
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.