Як агенту працювати з ufo-tech/json-rpc-bundle 10.4 — процедури, параметри, результати, помилки, кеш, версії й групи API, події, відомі пастки й перевірка результату.
Встановити через агента — скажіть йому:
Прочитай https://ufo-tech.space/ai/install.md і встанови правило json-rpc-bundle з каталогу UFO Tech у цей проєкт.
Встановлення
Claude Code
У проєкт — docs/ai/json-rpc-bundle.md
macOS, Linux, WSL, Git Bash
mkdir -p "docs/ai"
curl -fsSL https://ufo-tech.space/ai/files/rule/json-rpc-bundle/universal/json-rpc-bundle.md -o "docs/ai/json-rpc-bundle.md"
Windows PowerShell
New-Item -ItemType Directory -Force "docs\ai" | Out-Null
Invoke-WebRequest https://ufo-tech.space/ai/files/rule/json-rpc-bundle/universal/json-rpc-bundle.md -OutFile "docs\ai\json-rpc-bundle.md"
Додайте в CLAUDE.md у корені проєкту рядок:
@docs/ai/json-rpc-bundle.md
Codex
У проєкт — docs/ai/json-rpc-bundle.md
macOS, Linux, WSL, Git Bash
mkdir -p "docs/ai"
curl -fsSL https://ufo-tech.space/ai/files/rule/json-rpc-bundle/universal/json-rpc-bundle.md -o "docs/ai/json-rpc-bundle.md"
Windows PowerShell
New-Item -ItemType Directory -Force "docs\ai" | Out-Null
Invoke-WebRequest https://ufo-tech.space/ai/files/rule/json-rpc-bundle/universal/json-rpc-bundle.md -OutFile "docs\ai\json-rpc-bundle.md"
Додайте в AGENTS.md у корені проєкту рядок:
Follow docs/ai/json-rpc-bundle.md.
Cursor
У проєкт — .cursor/rules/json-rpc-bundle.mdc
macOS, Linux, WSL, Git Bash
mkdir -p ".cursor/rules"
curl -fsSL https://ufo-tech.space/ai/files/rule/json-rpc-bundle/universal/json-rpc-bundle.md -o ".cursor/rules/json-rpc-bundle.mdc"
Windows PowerShell
New-Item -ItemType Directory -Force ".cursor\rules" | Out-Null
Invoke-WebRequest https://ufo-tech.space/ai/files/rule/json-rpc-bundle/universal/json-rpc-bundle.md -OutFile ".cursor\rules\json-rpc-bundle.mdc"
Prepend Cursor frontmatter: description (one line), globs (if the rule targets specific paths), alwaysApply: false.
GitHub Copilot
У проєкт — .github/instructions/json-rpc-bundle.instructions.md
macOS, Linux, WSL, Git Bash
mkdir -p ".github/instructions"
curl -fsSL https://ufo-tech.space/ai/files/rule/json-rpc-bundle/universal/json-rpc-bundle.md -o ".github/instructions/json-rpc-bundle.instructions.md"
Windows PowerShell
New-Item -ItemType Directory -Force ".github\instructions" | Out-Null
Invoke-WebRequest https://ufo-tech.space/ai/files/rule/json-rpc-bundle/universal/json-rpc-bundle.md -OutFile ".github\instructions\json-rpc-bundle.instructions.md"
Prepend frontmatter with applyTo, e.g. applyTo: "src/**".
AGENTS.md
У проєкт — docs/ai/json-rpc-bundle.md
macOS, Linux, WSL, Git Bash
mkdir -p "docs/ai"
curl -fsSL https://ufo-tech.space/ai/files/rule/json-rpc-bundle/universal/json-rpc-bundle.md -o "docs/ai/json-rpc-bundle.md"
Windows PowerShell
New-Item -ItemType Directory -Force "docs\ai" | Out-Null
Invoke-WebRequest https://ufo-tech.space/ai/files/rule/json-rpc-bundle/universal/json-rpc-bundle.md -OutFile "docs\ai\json-rpc-bundle.md"
Додайте в AGENTS.md у корені проєкту рядок:
Follow docs/ai/json-rpc-bundle.md.
Опис
Файл інструкцій для проєктів, що надають API через JsonRpcBundle. Він підключається поруч із вашими правилами й не замінює ваш AGENTS.md чи CLAUDE.md. Написано англійською, бо асистенти стабільніше виконують англомовні інструкції; версія бандла — 10.4.
Що всередині
Як агенту працювати — на початку файлу:
- джерело правди — встановлений код бандла у
vendor/і описи релізів уvendor/ufo-tech/json-rpc-bundle/releases/, а не пам'ять моделі; - перевіряти встановлену версію; не вигадувати класи, атрибути, опції; про суперечність правил і коду — повідомляти;
- не змінювати публічні RPC-контракти без потреби (несумісні зміни — нова версія API) і не рефакторити поза задачею.
Правила бібліотеки — коротко, з посиланнями на документацію замість пояснень: тонкі процедури, DTO і декларативна валідація, формат результату, помилки, кеш, версії та групи API, події.
Відомі пастки 10.4 — застарілі атрибути й події, #[RPC\DTOCollection] на методі, ttl для #[RPC\Lock], особливості подій для Messenger і помилок HTTP (див. Актуальні помилки).
Перевірка перед завершенням — тести, виклик зміненого методу, схема в GET /rpc.
Файл навмисно не пояснює, як працюють механізми, — для цього є документація, на яку він посилається. Так інструкція лишається короткою і не перетворюється на другу копію документації, яка з часом розійдеться з першою.
Разом з цим
- Правила для розширень JsonRpcBundle — якщо ви пишете пакет-розширення.
- Стиль коду UFO-Tech — необов'язково, для проєктів, що приймають цей стиль.