Imported from mathisarends/pyrpckit (
AGENTS.md). Install upstream withnpx skills add mathisarends/pyrpckit. Copyright stays with the author.
AGENTS.md
Guidance for AI coding agents working in this repository.
Project
rpckit is a Python library, distributed on PyPI as pyrpckit. It turns
decorated channel functions and mounted service endpoints into a JSON-RPC 2.0
protocol: definition (channel.py, protocol.py), serving (service.py,
runtime.py, dispatch.py, server.py), contract generation (schema/), and
client generation (codegen/). Generated Python clients embed their runtime
from the templates under codegen/templates/python/runtime/.
Environment
- Dependency management: uv
- Supported Python versions: 3.12–3.14
- Install dependencies:
uv sync --all-groups
Workflow
- Lint:
uv run ruff check . - Format:
uv run ruff format . - Tests:
uv run pytest - Pre-commit hooks are configured in
.pre-commit-config.yaml; install withuv run pre-commit install.
Conventions
- Library code lives in
rpckit/; the public API is re-exported fromrpckit/__init__.py. - Use relative imports for all public re-exports in
rpckit/__init__.py. - No module-level docstrings. Document a class or function only where the name is not enough.
- The library stays transport-agnostic: no HTTP, WebSocket, or framework dependencies.
- Generators read the OpenRPC document, never the
RpcProtocolobject, so a new target language only needs an emitter besidecodegen/python.pyon top ofcodegen/ir.py. - Generated code must pass
ruff checkandruff formatin the consuming repository. - Tests live in
tests/and mirror the package structure. - Keep
pyproject.tomlas the single source of truth for metadata and tool config.