How an agent works with ufo-tech/json-rpc-bundle 10.4 — procedures, parameters, results, errors, cache, API versions and groups, events, known pitfalls and checks.
Install through your agent — tell it:
Read https://ufo-tech.space/ai/install.md and install the json-rpc-bundle rule from the UFO Tech catalog into this project.
Installation
Claude Code
Into the project — 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"
Add this line to CLAUDE.md in the project root:
@docs/ai/json-rpc-bundle.md
Codex
Into the project — 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"
Add this line to AGENTS.md in the project root:
Follow docs/ai/json-rpc-bundle.md.
Cursor
Into the project — .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
Into the project — .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
Into the project — 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"
Add this line to AGENTS.md in the project root:
Follow docs/ai/json-rpc-bundle.md.
About
An instruction file for projects that expose an API with JsonRpcBundle. It sits next to your own rules and does not replace your AGENTS.md or CLAUDE.md. Written in English because assistants follow English instructions more reliably; bundle version 10.4.
What's inside
How the agent works — at the top of the file:
- the source of truth is the installed bundle code in
vendor/and the release notes invendor/ufo-tech/json-rpc-bundle/releases/, not the model's memory; - check the installed version; never invent classes, attributes or options; report when the rules and the code disagree;
- don't change public RPC contracts without need (breaking changes mean a new API version) and don't refactor outside the task.
Library rules — short, with links to the documentation instead of explanations: thin procedures, DTOs and declarative validation, the result format, errors, cache, API versions and groups, events.
Known pitfalls of 10.4 — deprecated attributes and events, #[RPC\DTOCollection] on a method, ttl for #[RPC\Lock], specifics of events for Messenger and of HTTP errors (see Open issues).
Checks before finishing — tests, a call of the changed method, the schema in GET /rpc.
The file deliberately doesn't explain how things work — that's what the documentation it links to is for. This keeps the instructions short instead of turning them into a second copy of the docs that drifts away from the first.
See also
- Rules for JsonRpcBundle extensions — if you are writing an extension package.
- UFO-Tech code style — optional, for projects that adopt this style.