kotlinx-rpc
CLAUDE.md1.1k starsChanged 5 days agoApache-2.0View on GitHub
The skill from https://mr3zee.github.io/code-doc-writer/ must be installed and used in every session that adds/changes committed files. kotlinx-rpc is a Kotlin Multiplatform library for building RPC services. Version catalog: versions-root/libs.versions.toml EXTREMELY IMPORTANT. This library is a protocol agnostic library. It can be called a Kotlin RPC toolkit. It hosts different protocols: - kRPC (custom protocol) - gRPC (HTTP/2 + Protocol Buffers) They are not TRANSPORTS. Each protocol has its own client and server implementations, as well as code generation patterns. IMPORTANT:…
We split this CLAUDE.md into the rules it gives an agent
8 rules. About 0 are common, 4 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Always operate at maximum effort level.
- Very specific: line 28
Use the running_gradle_tests skill.
- Very specific: line 38
Use the running_gradle_builds skill for these tasks:
- Distinctive: line 136
All published modules require explicit return types and visibility
- Distinctive: line 137
All public types require KDoc
- Distinctive: line 145
Use gradle-conventions and gradle-conventions-settings for all Gradle project changes when the change is either large or is intended for …
- Very specific: line 158
Gradle: Use the running_gradle_builds skill with clean, then --stop via Bash, then re-run the task with --rerun-tasks …
- Very specific: line 159
JS/WASM: delete package-lock.json + build/{js,wasm}, then use the running_gradle_builds skill to run …
≈ “Common” is an estimate: at least 1 in 5 of the 25,680 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
The skill from https://mr3zee.github.io/code-doc-writer/ must be installed and used in every session that adds/changes committed files.
kotlinx-rpc is a Kotlin Multiplatform library for building RPC services.
Version catalog: versions-root/libs.versions.toml
Effort Level
Always operate at maximum effort level. Do not ask about effort preferences.
Protocols
EXTREMELY IMPORTANT. This library is a protocol agnostic library. It can be called a Kotlin RPC toolkit. It hosts different protocols:
- kRPC (custom protocol)
- gRPC (HTTP/2 + Protocol Buffers)
They are not TRANSPORTS. Each protocol has its own client and server implementations, as well as code generation patterns.
Build & Test
IMPORTANT: Always use Gradle skills (running_gradle_builds, running_gradle_tests, managing_gradle_dependencies, introspecting_gradle_projects, gradle_expert, etc.) instead of running ./gradlew directly.
Gradle skills provide structured feedback, failure diagnostics, and background orchestration that raw shell commands lack.
Testing
Use the running_gradle_tests skill. Example tasks:
<module>:jvmTest --tests "TestClass.testMethod"-- Single test<module>:jvmTest-- All JVM tests for a module
Building
Use the running_gradle_builds skill. Example tasks:
<module>:build-- Build a moduleassemble-- Assemble all modules
Validation
Use the running_gradle_builds skill for these tasks:
checkLegacyAbi-- Binary compatibility (formerly BCV apiCheck)detekt-- Static analysis (does NOT fail build, check console):jpms-check:compileJava-- Java module system checkkotlinUpgradeYarnLock-- Fix JS dependency lockskotlinWasmUpgradeYarnLock-- Fix WASM dependency locks
Non-Gradle validation:
./scripts/validate_published_artifacts.sh -s # Artifact validation (-v verbose, --dump update)Other specialized commands
./scripts/publish_local.sh # Publish to build/repo/ for local testingGenerated Code — Do Not Edit Manually
Several checked-in files are machine-generated.
Never modify them by hand — always run the appropriate regeneration task and commit the output.
This includes .api and .klib.api ABI dump files (use updateLegacyAbi),
conformance test output, WKT generated code, implicit import lists, and other.
Hand-editing these files produces incorrect results (e.g., klib dump sort order
differs from what's intuitive).
Module Map
The most important modules have brief READMEs in their directories, read when you need to work with the module.
Core (multiplatform)
:core-- RPC abstractions (@Rpc,RpcClient,RpcServer,RpcCall, descriptors):utils-- Shared utilities
kRPC transport (multiplatform)
:krpc:krpc-core,:krpc:krpc-client,:krpc:krpc-server-- Protocol, client, server:krpc:krpc-logging,:krpc:krpc-test-- Logging, test utilities:krpc:krpc-serialization:krpc-serialization-{core,json,cbor,protobuf}-- Serialization formats:krpc:krpc-ktor:krpc-ktor-{core,server,client}-- Ktor integration
gRPC transport (experimental KMP)
:grpc:grpc-{core,client,server,ktor-server,marshaller,marshaller-kotlinx-serialization}
Protobuf (mainly used with gRPC)
:protobuf:protobuf-{api,wkt,core}
Native shims (standalone Gradle build)
native-deps/shims/grpc/-- gRPC cinterop shim KLIB (:kotlinx-rpc-grpc-core-shim)native-deps/shims/protobuf/-- Protobuf cinterop shim KLIB (:kotlinx-rpc-protobuf-shim)native-deps/shims/annotation/-- Shared opt-in markers (:kotlinx-rpc-native-shims-annotation)native-deps/grpc-c-prebuilt/-- Prebuilt gRPC static archives and headers
Included builds (separate Gradle projects)
compiler-plugin/-- Kotlin K2 compiler plugin (FIR diagnostics + IR codegen)gradle-plugin/-- Gradle plugin (org.jetbrains.kotlinx.rpc.plugin)protoc-gen/-- Protobuf code generatordokka-plugin/-- Documentation plugin
Tests (not published)
:tests:compiler-plugin-tests-- Compiler plugin box/diagnostic tests (skipped for Kotlin master builds):tests:krpc-compatibility-tests,:tests:krpc-protocol-compatibility-tests-- Protocol compat:tests:protobuf-conformance-- Protobuf spec conformance (not on Windows):tests:protobuf-unittest,:tests:grpc-test-server,:tests:test-protos
Architecture
RPC Call Flow
- User defines
@Rpcinterface withsuspendmethods and/orFlowreturn types - Compiler plugin generates stub class: each method creates
RpcCall(descriptor, methodName, args, serviceId)and delegates toRpcClient.call()(unary) orRpcClient.callServerStreaming()(streaming) - Client serializes the call and sends over wire
- Server deserializes, looks up
RpcServiceDescriptor, invokesRpcInvokator.call(serviceImpl, args) - Response flows back through the same layers
- Client and Server are bound to RPC protocols (kRPC or gRPC)
Key abstractions (core/src/commonMain/kotlin/kotlinx/rpc/)
@Rpcannotation on interface -- triggers compiler pluginRpcServiceDescriptor<T>-- generated per-service metadata + stub factoryRpcCallable-- per-method metadata +RpcInvokator(eitherUnaryResponseorFlowResponse)RpcCall-- single invocation payload: descriptor + method name + args + service IDRpcClient/RpcServer-- protocol-agnostic client and server interfaces
kRPC protocol
Custom protocol.
gRPC protocol
HTTP/2 + Protocol Buffers. Code generated from .proto files via protoc-gen/. Uses @Grpc annotation.
Compiler Plugin
Module structure
compiler-plugin-common-- Shared between backend and k2compiler-plugin-k2-- FIR frontend: diagnostics, declaration generationcompiler-plugin-backend-- IR backend: codegen (stub classes, descriptors)compiler-plugin-cli-- Entrypoint, combines backend and k2
Conventions
- All published modules require explicit return types and visibility
- All public types require KDoc
- Internal APIs shared across modules: annotate with
@InternalRpcApi - Dependencies go in
versions-root/libs.versions.toml, never inline - New modules:
includePublic()insettings.gradle.ktsfor published,include()for internal - Published modules auto-prefixed with
kotlinx-rpc- - Module families: common prefix +
corefor shared (e.g.,krpc-core,krpc-client,krpc-server) - Filesystem paths: OS-agnostic only --
Path.of("a", "b")notPath.of("a/b") - Disable KMP targets per module:
kotlinx.rpc.exclude.<target>=truein module'sgradle.properties - Use gradle-conventions and gradle-conventions-settings for all Gradle project changes when the change is either large or is intended for more than one subproject. Keep actual build files clean.
Testing
- Framework: JUnit 5 + kotlin-test + coroutines-test
- KMP source sets:
commonTest,jvmTest,jsTest,nativeTest, etc.
Documentation
Uses Writerside, lives in docs/pages/.
Troubleshooting
- Gradle: Use the
running_gradle_buildsskill withclean, then--stopvia Bash, then re-run the task with--rerun-tasks --no-configuration-cache --no-build-cacheflags via the skill - JS/WASM: delete
package-lock.json+build/{js,wasm}, then use therunning_gradle_buildsskill to runkotlinUpgradeYarnLock/kotlinWasmUpgradeYarnLock
References
- Documentation site: https://kotlin.github.io/kotlinx-rpc/
Trending
Quiet since September.about the whole repository
Who's talking about Kotlin/kotlinx-rpc
- bright-room/mindstock“fix(deps): update kotlinx.rpc to v0.10.4”GitHub · Sep 25, 2026
- bright-room/mindstock“fix(deps): update kotlinx.rpc to v0.10.3”GitHub · Jul 10, 2026
- modelix/modelix.editor“fix(deps): update kotlinx.rpc to v0.10.4”GitHub · Jul 6, 2026
- ktorio/ktor-plugin-registry“Bump the all-gradle group with 11 updates”GitHub · Jun 30, 2026
- DerTyp7214/synara-api“chore(deps): bump kotlinx-rpc from 0.10.2 to 0.10.3”GitHub · Jun 27, 2026
The biggest 5 of 16 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 16
Talked about on GitHub (16 times).
On GitHub · 16
- Sep 25, 2026fix(deps): update kotlinx.rpc to v0.10.4 — bright-room/mindstock0 reactions · 1 comment
- Jul 10, 2026fix(deps): update kotlinx.rpc to v0.10.3 — bright-room/mindstock0 reactions
- Jul 6, 2026fix(deps): update kotlinx.rpc to v0.10.4 — modelix/modelix.editor0 reactions · 1 comment
- Jun 30, 2026Bump the all-gradle group with 11 updates — ktorio/ktor-plugin-registry0 reactions
- Jun 27, 2026chore(deps): bump kotlinx-rpc from 0.10.2 to 0.10.3 — DerTyp7214/synara-api0 reactions · 1 comment
11 more on GitHub
- May 3, 2026Add compiler plugin implementation and Kotlin External FIR Support — TBSten/cream0 reactions
- Mar 30, 2026build(deps): bump kotlinx-rpc from 0.10.1 to 0.10.2 — modelix/modelix.editor0 reactions · 5 comments
- Jan 17, 2026chore(deps): bump kotlinx-rpc from 0.10.1 to 0.10.2 — DerTyp7214/synara-api0 reactions · 2 comments
- Dec 20, 2025build(deps): bump org.jetbrains.kotlinx:kotlinx-rpc-krpc-ktor-client from 0.10.0 to 0.10.1 — DerTyp7214/synara-api0 reactions · 1 comment
- Dec 20, 2025build(deps): bump org.jetbrains.kotlinx:kotlinx-rpc-krpc-ktor-server from 0.10.0 to 0.10.1 — DerTyp7214/synara-api0 reactions · 1 comment
- Jul 3, 2025Update kxrpc tutorial to 0.8.0 — ktorio/ktor-documentation0 reactions · 2 comments
- Jul 3, 2025Update kxrpc to 0.8.0 — ktorio/ktor-plugin-registry0 reactions · 1 comment
- Apr 4, 2025Update kxrpc to 0.6.0 — ktorio/ktor-plugin-registry0 reactions · 1 comment
- Jan 28, 2025Update kxrpc to 0.5.0 — ktorio/ktor-plugin-registry0 reactions
- Jan 7, 2025Migrate cloud-run server to RPC ProtoBuf — ashdavies/playground.ashdavies.dev0 reactions
- May 26, 2024KotlinでRemote Procedure Calls (RPC) を簡単に行えるライブラリkotlinx.rpc — AndroidDagashi/AndroidDagashi0 reactions
In this repository19 other files it gives its agents.
- commit-changesSkill
- file-youtrack-issueSkill
- fix-issueSkill
- gh-stackSkill
- gradle_expertSkill
- interacting_with_project_runtimeSkill
- introspecting_gradle_projectsSkill
- managing_gradle_dependenciesSkill
- researching_gradle_internalsSkill
- run-local-verificationsSkill
- running_gradle_buildsSkill
- running_gradle_testsSkill
- searching_dependency_sourcesSkill
- update-docSkill
- update-shimSkill
- use-develocitySkill
- use-teamcitySkill
- use-youtrackSkill
- verify-compiler-plugin-compatibilitySkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

