partykit
AGENTS.md1.3k starsChanged 9 months agoISCView on GitHub
This document provides essential information for AI coding agents working in the PartyServer monorepo. PartyServer is a monorepo using npm workspaces with multiple packages:
Trending
Less talk lately.about the whole repository
Who's talking about cloudflare/partykit
- be-automata/automata“chore(deps): bump the minor-and-patch group with 87 updates”GitHub · Sep 7, 2026 · 1 reactions
- yanneves/browser.icu“chore(deps-dev): Bump the dev-dependencies group across 1 directory with 16 updates”GitHub · Feb 23, 2026 · 1 reactions
- yanneves/browser.icu“chore(deps-dev): Bump the dev-dependencies group across 1 directory with 15 updates”GitHub · Feb 20, 2026 · 1 reactions
- yanneves/browser.icu“chore(deps-dev): Bump the dev-dependencies group across 1 directory with 8 updates”GitHub · Feb 2, 2026 · 1 reactions
- yanneves/browser.icu“chore(deps-dev): Bump the dev-dependencies group across 1 directory with 7 updates”GitHub · Jan 30, 2026 · 1 reactions
The biggest 5 of 46 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 46
Talked about on GitHub (46 times).
On GitHub · 46
- Sep 7, 2026chore(deps): bump the minor-and-patch group with 87 updates — be-automata/automata1 reaction · 10 comments
- Feb 23, 2026chore(deps-dev): Bump the dev-dependencies group across 1 directory with 16 updates — yanneves/browser.icu1 reaction · 3 comments
- Feb 20, 2026chore(deps-dev): Bump the dev-dependencies group across 1 directory with 15 updates — yanneves/browser.icu1 reaction · 4 comments
- Feb 2, 2026chore(deps-dev): Bump the dev-dependencies group across 1 directory with 8 updates — yanneves/browser.icu1 reaction · 1 comment
- Jan 30, 2026chore(deps-dev): Bump the dev-dependencies group across 1 directory with 7 updates — yanneves/browser.icu1 reaction · 3 comments
41 more on GitHub
- Dec 22, 2025chore(deps-dev): Bump the dev-dependencies group with 4 updates — yanneves/browser.icu1 reaction · 1 comment
- Aug 18, 2025Make McpAgent extend Agent + Streaming HTTP protocol features — cloudflare/agents1 reaction · 14 comments
- Oct 4, 2026chore(deps): bump the remaining-patch-minor group across 1 directory with 29 updates — Rory-X/intro-builder0 reactions · 1 comment
- Sep 30, 2026chore(deps): bump the production group across 1 directory with 8 updates — alveusgg/control-api0 reactions
- Sep 29, 2026chore(deps): bump the minor-and-patch group with 13 updates — ovaxio/pokrr0 reactions · 1 comment
- Sep 28, 2026build(deps): bump the npm-minor-patch group across 1 directory with 11 updates — kspiteri/pixmaler0 reactions
- Sep 22, 2026build(deps): bump the npm-minor-patch group with 12 updates — kspiteri/pixmaler0 reactions · 1 comment
- Sep 22, 2026build(deps): bump partysocket from 1.1.19 to 1.3.0 — kspiteri/pixmaler0 reactions · 1 comment
- Sep 22, 2026build(deps): bump partyserver from 0.5.8 to 0.5.10 — kspiteri/pixmaler0 reactions
- Sep 8, 2026chore(deps): bump the production-minor-and-patch group across 1 directory with 11 updates — msinclair25/mdevolved0 reactions · 1 comment
- Sep 7, 2026chore(deps): bump the production-minor-and-patch group across 1 directory with 12 updates — msinclair25/mdevolved0 reactions · 1 comment
- Sep 1, 2026chore(deps): bump the production-minor-and-patch group across 1 directory with 13 updates — msinclair25/mdevolved0 reactions · 1 comment
- Aug 31, 2026chore(deps): bump the production-minor-and-patch group across 1 directory with 12 updates — msinclair25/mdevolved0 reactions · 1 comment
- Aug 31, 2026deps(deps): bump partyserver from 0.5.9 to 0.5.10 — filmnt/chat0 reactions · 1 comment
- Aug 24, 2026chore(deps): bump the production-minor-and-patch group across 1 directory with 10 updates — msinclair25/mdevolved0 reactions · 1 comment
- Aug 18, 2026deps: bump the yjs group in /collab-server with 2 updates — leo1oel/lattice0 reactions · 4 comments
- Aug 17, 2026chore(deps): bump the all-dependencies group across 1 directory with 19 updates — alanbasilio/mathler-arcade0 reactions · 1 comment
- Aug 17, 2026deps(deps): bump partyserver from 0.5.9 to 0.5.10 — filmnt/chat0 reactions · 1 comment
- Aug 17, 2026chore(deps): bump partysocket from 1.0.1 to 1.3.0 — tutors-sdk/tutors-mono-repo0 reactions · 5 comments
- Aug 12, 2026chore(deps): bump partysocket from 1.1.19 to 1.3.0 — unclemattmakes/king-tide0 reactions · 1 comment
- Aug 11, 2026build(deps): bump partyserver from 0.5.8 to 0.5.10 — phaethix/polished-arcade-shooter0 reactions
- Aug 10, 2026chore(deps): bump the production-minor-and-patch group across 1 directory with 8 updates — msinclair25/mdevolved0 reactions · 1 comment
- Aug 10, 2026chore(deps): bump the npm-minor-patch group across 1 directory with 20 updates — Dillonmcewan/loco_retro0 reactions
- Aug 8, 2026chore(deps): bump the production-minor-and-patch group across 1 directory with 7 updates — msinclair25/mdevolved0 reactions · 1 comment
- Aug 7, 2026chore(deps): bump the production-dependencies group across 1 directory with 7 updates — yerdaulet-damir/liminal0 reactions
- Aug 4, 2026build(deps): bump partyserver from 0.5.8 to 0.5.9 — phaethix/polished-arcade-shooter0 reactions · 1 comment
- Aug 3, 2026chore(deps): bump partyserver from 0.5.5 to 0.5.9 in /server — gleontev/yaos0 reactions
- Aug 3, 2026deps(deps): bump partyserver from 0.5.8 to 0.5.9 — filmnt/chat0 reactions · 1 comment
- Jul 13, 2026Bump partysocket from 1.1.10 to 1.3.0 — Lucky-ESA/ioBroker.lg-webos0 reactions
- Jul 11, 2026build(deps): bump partysocket from 1.1.19 to 1.3.0 — YKDZ/cat0 reactions
- Jul 1, 2026Bump partysocket from 1.1.18 to 1.3.0 — tomo-x7/JetstreamProxy0 reactions
- Jun 29, 2026Bump partysocket from 1.1.16 to 1.3.0 in /server — Hum2a/imposter-game0 reactions · 2 comments
- Jun 29, 2026build(deps): Bump partysocket from 1.1.19 to 1.3.0 — reactor-team/reactor-queue0 reactions · 1 comment
- Jun 15, 2026chore(deps): bump partyserver from 0.5.5 to 0.5.8 in /server — gleontev/yaos0 reactions · 1 comment
- May 20, 2026build(deps): bump partysocket from 1.1.18 to 1.1.19 in /extension — Sapient-Artifice/magelab-cli0 reactions · 1 comment
- Apr 21, 2026build(deps): bump the all-npm-dependencies group across 1 directory with 6 updates — jaydonkrooss/remote-office-hours-queue0 reactions
- Feb 1, 2026Bump the dev-dependencies group across 1 directory with 5 updates — mycelial-systems/__old_mergeparty0 reactions · 1 comment
- Feb 1, 2026Bump the dev-dependencies group across 1 directory with 6 updates — mycelial-systems/mergeparty0 reactions · 1 comment
- Sep 29, 2025chore(deps): bump partysocket from 1.1.5 to 1.1.6 — barkleesanders/VA0 reactions
- Sep 29, 2025chore(deps): bump partyserver from 0.0.72 to 0.0.75 — barkleesanders/VA0 reactions
- Sep 29, 2025Bump hono-party from 0.0.12 to 0.0.17 in /apps/server — mshaaran/spaceemail0 reactions
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
26 rules. About 0 are common, 11 are distinctive, and 15 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
15
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 64
Run npm run format before committing
- Very specific: line 76
Run npm run check:lint to verify
- Very specific: line 84
Use noEmit: true (compilation handled by tsdown)
- Very specific: line 141
Use // TODO: for action items
- Distinctive: line 142
Use JSDoc for public API documentation
- Distinctive: line 143
Prefer descriptive names over comments
- Very specific: line 144
Use oxlint-disable-next-line or @ts-expect-error with explanations when necessary:
- Very specific: line 154
Use readonly for constructor parameters when appropriate
- Distinctive: line 155
Prefer composition over inheritance
- Distinctive: line 156
Keep files focused (single responsibility)
- Distinctive: line 160
Use Vitest for all tests
- Very specific: line 161
Place tests in src/tests/ directory
- Very specific: line 162
Use @vitest-environment jsdom directive when needed
- Distinctive: line 164
Write descriptive test names
- Very specific: line 165
Use beforeAll, afterAll, beforeEach, afterEach for setup/teardown
- Very specific: line 169
Use Changesets for version management (.changeset/)
- Distinctive: line 170
Write clear, descriptive commit messages
- Distinctive: line 171
Keep commits focused on a single change
- Distinctive: line 178
Run oxfmt on generated output files (handled by build scripts)
- Very specific: line 179
Use tsdown for building packages
- Very specific: line 180
Verify exports with scripts/check-exports.ts
- Very specific: line 184
Avoid forEach where performance matters (but allowed by linter)
- Very specific: line 185
Use optional chaining (?.) and nullish coalescing (??)
- Very specific: line 186
Prefer const over let when possible
- Distinctive: line 191
Use EventTarget for event handling in browser/Node compatibility
- Distinctive: line 193
Use exponential backoff for reconnection logic
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.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
PartyServer Agent Guidelines
This document provides essential information for AI coding agents working in the PartyServer monorepo.
Repository Structure
PartyServer is a monorepo using npm workspaces with multiple packages:
packages/partyserver- Core library for Durable Objects with WebSocket supportpackages/partysocket- Reconnecting WebSocket client librarypackages/y-partyserver- Yjs CRDT support for PartyServerpackages/partysub- Pub/sub at scalepackages/partysync- State synchronization (experimental)packages/partywhen- Task scheduling at scalepackages/hono-party- Hono middlewarefixtures/*- Self-contained examples
Build & Development Commands
Root-level commands (from /Users/sunilpai/code/partyserver)
npm run build # Build all packages
npm run check # Run all checks (format, lint, type, test)
npm run format # Format code with Oxfmt
npm run check:format # Check code formatting with Oxfmt
npm run check:lint # Run Oxlint linter
npm run check:type # Type-check all packages
npm run check:test # Run all tests
npm run check:repo # Run sherif (monorepo consistency)Package-level commands (from packages/[package-name]/)
npm run build # Build the package (uses tsdown)
npm run check:test # Run tests with vitestRunning tests
# Run all tests in a package
cd packages/partysocket && npm run check:test
# Run a single test file
npx vitest src/tests/reconnecting.test.ts
# Run tests in watch mode
npx vitest --watch
# Run tests with specific pattern
npx vitest reconnectingCode Style Guidelines
Formatting
- Formatter: Oxfmt (configured in
.oxfmtrc.json) - Quote style: Double quotes (
") - Trailing commas: None
- Print width: 80
- Run
npm run formatbefore committing
Linting
- Linter: Oxlint (configured in
.oxlintrc.json) - Plugins:
react,jsx-a11y,typescript,react-hooks - Key rules:
no-explicit-any: offno-non-null-assertion: offno-redeclare: offno-unused-vars: error (with^_ignore patterns for args/vars/caught)react-hooks/exhaustive-deps: warn
- Run
npm run check:lintto verify
TypeScript
- Target: ESNext
- Module: ESNext with Bundler resolution
- Strict mode: Enabled
- JSX: react-jsx
- Use
noEmit: true(compilation handled by tsdown) - Use
verbatimModuleSyntax: true - Use
isolatedModules: true skipLibCheck: truefor performance
Import Conventions
// 1. Import from relative modules first
import ReconnectingWebSocket from "./ws";
// 2. Then type imports (prefer `import type`)
import type * as RWS from "./ws";
import type { Connection } from "./types";
// 3. Use type-only imports when importing only types
// This helps with tree-shaking and clarityNaming Conventions
- Classes: PascalCase (e.g.,
PartySocket,ReconnectingWebSocket) - Functions/methods: camelCase (e.g.,
getPartyInfo,_handleOpen) - Private methods: Prefix with underscore (e.g.,
_connect,_debugLogger) - Constants: UPPER_SNAKE_CASE for true constants (e.g.,
PORT,DEFAULT) - Types/Interfaces: PascalCase (e.g.,
PartySocketOptions,EventHandlerOptions) - Type aliases: PascalCase for complex types, camelCase for simple utilities
Error Handling
// Use console.error for critical errors with helpful context
console.error(`‼️ No WebSocket implementation available...`);
// Use console.warn for warnings
console.warn(`PartySocket: party name "${name}" contains forward slash...`);
// For debug logging, use the debug flag pattern
private _debug(...args: unknown[]) {
if (this._options.debug) {
this._debugLogger("RWS>", ...args);
}
}
// Throw errors with descriptive messages
throw new Error("path must not start with a slash");
// Use assert for internal invariants
function assert(condition: unknown, msg?: string): asserts condition {
if (!condition) {
throw new Error(msg);
}
}Comments
- Use
// TODO:for action items - Use JSDoc for public API documentation
- Prefer descriptive names over comments
- Use
oxlint-disable-next-lineor@ts-expect-errorwith explanations when necessary:// oxlint-disable-next-line no-explicit-any // @ts-expect-error ws types are weird
Code Organization
- Group related functionality together
- Public methods before private methods
- Use
readonlyfor constructor parameters when appropriate - Prefer composition over inheritance
- Keep files focused (single responsibility)
Testing Guidelines
- Use Vitest for all tests
- Place tests in
src/tests/directory - Use
@vitest-environment jsdomdirective when needed - Mock external dependencies appropriately
- Write descriptive test names
- Use
beforeAll,afterAll,beforeEach,afterEachfor setup/teardown
Git & Versioning
- Use Changesets for version management (
.changeset/) - Write clear, descriptive commit messages
- Keep commits focused on a single change
- Test before committing
Package Publishing
- Dual format: ESM and CommonJS
- Generate both
.d.tsand.d.ctsdeclaration files - Run oxfmt on generated output files (handled by build scripts)
- Use
tsdownfor building packages - Verify exports with
scripts/check-exports.ts
Performance Notes
- Avoid
forEachwhere performance matters (but allowed by linter) - Use optional chaining (
?.) and nullish coalescing (??) - Prefer
constoverletwhen possible - Be mindful of bundle size (tree-shaking friendly exports)
Common Patterns
- Use EventTarget for event handling in browser/Node compatibility
- Clone events when re-dispatching them
- Use exponential backoff for reconnection logic
- Provide both callback and event listener APIs
- Support both string and function-based configuration
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.

