You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 22, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: CLAUDE.md
+2-172Lines changed: 2 additions & 172 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,7 @@
8
8
## `packages/**/package.json`
9
9
10
10
- Always include relevant keywords for the packages
11
+
- All packages that are libraries should depend on peer deps for: @rivetkit/*, @hono/*, hono
11
12
12
13
## `packages/**/README.md`
13
14
@@ -27,175 +28,4 @@ Always include a README.md for new packages. The `README.md` should always follo
27
28
Apache 2.0
28
29
```
29
30
30
-
31
-
## Common Terminology
32
-
33
-
-**Actor**: A stateful, long-lived entity that processes messages and maintains state
34
-
-**Manager**: Component responsible for creating, routing, and managing actor instances
35
-
-**Remote Procedure Call (RPC)**: Method for an actor to expose callable functions to clients
36
-
-**Event**: Asynchronous message sent from an actor to connected clients
37
-
-**Alarm**: Scheduled callback that triggers at a specific time
38
-
39
-
### Coordinated Topology Terminology
40
-
41
-
-**Peer**: Individual actor instance in a coordinated network
42
-
-**Node**: Physical or logical host running one or more actor peers
43
-
44
-
## Build Commands
45
-
46
-
Run these commands from the root of the project. They depend on Turborepo, so you cannot run the commands within the package itself. Running these commands are important in order to ensure that all dependencies are automatically built.
-**Bun:** Fast JavaScript runtime alternative to Node.js
88
-
-**Rivet:** Cloud platform with built-in scaling and management
89
-
90
-
## Package Import Resolution
91
-
92
-
When importing from workspace packages, always check the package's `package.json` file under the `exports` field to determine the correct import paths:
93
-
94
-
1. Locate the package's `package.json` file
95
-
2. Find the `exports` object which maps subpath patterns to their file locations
96
-
3. Use these defined subpaths in your imports rather than direct file paths
97
-
4. For example, if you need to import from a package, check its exports to find if it exposes specific subpaths for different modules
98
-
99
-
This ensures imports resolve correctly across different build environments and prevents errors from direct file path imports that might change.
100
-
101
-
## Code Style Guidelines
102
-
103
-
-**Formatting:** Uses Biome for consistent formatting
104
-
- See biome.json for reference on formatting rules
- Instead of returning errors as raw HTTP responses with c.json, use or write an error in packages/rivetkit/src/actor/errors.ts and throw that instead. The middleware will automatically serialize the response for you.
123
-
124
-
## Project Structure
125
-
126
-
- Monorepo with pnpm workspaces and Turborepo
127
-
- Core code in `packages/core/`
128
-
- Platform implementations in `packages/platforms/`
129
-
- Driver implementations in `packages/drivers/`
130
-
131
-
## Development Notes
132
-
133
-
- Use zod for runtime type validation
134
-
- Use `assertUnreachable(x: never)` for exhaustive type checking in switch statements
135
-
- Add proper JSDoc comments for public APIs
136
-
- Ensure proper error handling with descriptive messages
137
-
- Run `pnpm check-types` regularly during development to catch type errors early. Prefer `pnpm check-types` instead of `pnpm build`.
138
-
- Use `tsx` CLI to execute TypeScript scripts directly (e.g., `tsx script.ts` instead of `node script.js`).
139
-
- Do not auto-commit changes
140
-
141
-
## Test Guidelines
142
-
143
-
- Do not check if errors are an instanceOf ActorError in tests. Many error types do not have the same prototype chain when sent over the network, but still have the same properties so you can safely cast with `as`.
144
-
145
-
## Examples
146
-
147
-
Examples live in the `examples/` folder.
148
-
149
-
### `examples/*/package.json`
150
-
151
-
- Always name the example `example-{name}`
152
-
- Always use `workspace:*` for dependencies
153
-
- Use `tsx` unless otherwise instructed
154
-
- Always have a `dev` and `check-types` scripts
155
-
-`dev` should use `tsx --watch` unless otherwise instructed
156
-
-`check-types` should use `tsc --noEmit`
157
-
158
-
### `examples/*/README.md`
159
-
160
-
Always include a README.md. The `README.md` should always follow this structure:
161
-
162
-
```md
163
-
# {human readable title} for RivetKit
164
-
165
-
Example project demonstrating {specific feature} with [RivetKit](https://rivetkit.org).
166
-
167
-
[Learn More →](https://github.com/rivet-gg/rivetkit)
0 commit comments