JsonRpcBundle rules

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 in vendor/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.

Why this is not documentation

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

<div class="docs-page-votes" data-page-votes hidden data-endpoint="/votes" role="group" aria-label="Rate this page"> <button class="docs-page-votes__button" type="button" data-vote="1" aria-pressed="false" title="Helpful"> <span aria-hidden="true">👍</span> <span class="visually-hidden">Helpful</span> <span data-vote-count>0</span> </button> <button class="docs-page-votes__button" type="button" data-vote="-1" aria-pressed="false" title="Not helpful"> <span aria-hidden="true">👎</span> <span class="visually-hidden">Not helpful</span> <span data-vote-count>0</span> </button> </div> <p class="docs-page-counters" data-page-counters hidden data-endpoint="/_e/page" data-label-total="Viewed {count} {times}" data-label-now="Viewing now: {count}" data-times="{&quot;one&quot;:&quot;time&quot;,&quot;few&quot;:&quot;times&quot;,&quot;many&quot;:&quot;times&quot;,&quot;other&quot;:&quot;times&quot;}"> <span data-page-counters-total></span> <span aria-hidden="true">·</span> <span data-page-counters-now></span> </p>