Rin
AGENTS.md3.1k starsChanged 5 months agoMITView on GitHub
The project uses a unified CLI tool located at cli/bin/rin.ts. Command implementations live under cli/src/{commands,tasks,lib}. This repository is a product monorepo, not a framework monorepo. When restructuring, prefer this target shape over a direct clone of rine: This is a direction, not a mandate to rename everything immediately. All agents must follow these rules for architecture work:
Trending
Quiet since August.thin dataabout the whole repository
Who's talking about openRin/Rin
- shuaiplus/inkstone“功能建议:增加 Blog 功能,类似 Rin【已Fork实现】”GitHub · Aug 23, 2026 · 4 reactions
- @tom-doerr.bsky.social“https://github.com/openRin/Rin”Bluesky · Aug 3, 2025 · 1 likes
- adysec/CForum“功能一般,还需努力”GitHub · Apr 8, 2026
- eslizn/typecho-cf“Mark下,关注,看看是否比Rin好”GitHub · Mar 25, 2026
- zhuima/awesome-cloudflare“推荐:博客”GitHub · Dec 6, 2024
The biggest 5 of 5 mentions linking to the repository that our crawl found. Each line is their own headline.
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,439 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
22 rules. About 0 are common, 14 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈14
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 56
If a change improves directory symmetry but does not improve dependency boundaries, it is usually the wrong refactor.
- Very specific: line 68
When restructuring, prefer this target shape over a direct clone of rine:
- Distinctive: line 89
All agents must follow these rules for architecture work:
- Very specific: line 91
Do not start by renaming client/ to apps/web or server/ to apps/worker.
- Very specific: line 92
Do not create empty framework-style packages just to mirror rine.
- Very specific: line 93
Do not introduce a renderer package unless the app actually gains SSR or shared rendering orchestration.
- Very specific: line 94
Do not split every server utility into adapters/* packages unless there are at least two credible implementations or an immediate runtime …
- Distinctive: line 95
Do not move code across the repo solely for aesthetics if imports, tests, and ownership get worse.
- Distinctive: line 102
Create real workspace packages before migrating code into them.
- Distinctive: line 103
Add missing package manifests, tsconfig files, and explicit exports.
- Distinctive: line 108
Keep app-specific composition in the app layer.
- Distinctive: line 114
If a proposed refactor skips step 1 and jumps to step 4, it should be treated as suspect.
- Distinctive: line 140
Before any non-trivial reorganization, agents must do all of the following:
- Distinctive: line 144
Search for all imports of the modules being moved.
- Distinctive: line 145
Verify whether the target package already has a real manifest and public entrypoint.
- Distinctive: line 148
If those checks are not done, the refactor is not ready.
- Distinctive: line 152
Avoid these common mistakes:
- Very specific: line 184
All test files import from bun:test.
- Distinctive: line 225
Use functional components with hooks
- Very specific: line 227
Use useMemo for expensive computations
- Very specific: line 228
Use useTranslation() hook for i18n
- Distinctive: line 240
Must follow conventional commits format:
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 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
AGENTS.md - Rin Project Guidelines
Build Commands
# Development (using Rin CLI)
bun dev # Start both client and server
bun dev:client # Client only (Vite + React)
bun dev:server # Server only (Wrangler dev server on port 11498)
bun dev:cron # Server with cron triggers enabled
# Building
bun run build # Build all workspaces (turbo)
bun run check # TypeScript type check (turbo)
# Database (using Rin CLI)
bun run db:generate # Generate Drizzle migrations
bun run db:migrate # Run local database migrations
# Formatting
bun run format:check # Check formatting
bun run format:write # Fix formatting
# Deployment (using Rin CLI)
bun run deploy # Deploy both frontend (Pages) and backend (Workers)
bun run deploy:server # Deploy backend only
bun run deploy:client # Deploy frontend only
# Release (using Rin CLI)
bun run release <version> # Create a new release (patch/minor/major/x.y.z)
# Testing
bun run test # Run all tests (client + server)
bun run test:client # Run client tests only
bun run test:server # Run server tests only
bun run test:coverage # Run tests with coverage reportRin CLI
The project uses a unified CLI tool located at cli/bin/rin.ts. Command implementations live under cli/src/{commands,tasks,lib}.
CLI Commands
bun cli/bin/rin.ts dev [options]- Start development serverbun cli/bin/rin.ts deploy [options]- Deploy to Cloudflarebun cli/bin/rin.ts db migrate- Run database migrationsbun cli/bin/rin.ts release <version>- Create a new release
Architecture Status
This repository is a product monorepo, not a framework monorepo.
rinshould learn from~/projects/rineon module boundaries and type discipline.rinshould NOT blindly copyrine'scontracts/core/renderer/adapters/appslayout.- The current repository still centers around a concrete app: React frontend, Cloudflare Worker backend, shared API package, and local CLI tooling.
- If a change improves directory symmetry but does not improve dependency boundaries, it is usually the wrong refactor.
Current Reality
client/is the web application, not a reusable package.server/is the Worker application, not a generic framework core.packages/api/is the only stable shared package today.packages/ui/exists in the tree but is not yet a real workspace package; treat it as incomplete work until it has its ownpackage.json, tsconfig, exports, and consumers.cli/is an engineering tool for this repo, not a runtime dependency of the product.
Refactor Direction
When restructuring, prefer this target shape over a direct clone of rine:
rin/
├── apps/
│ ├── web/ # current client app
│ └── worker/ # current server app
├── packages/
│ ├── api/ # shared request/response types and schemas
│ ├── ui/ # real reusable UI primitives and markdown-related UI
│ ├── web-core/ # app shell, providers, routing, layout composition
│ ├── server-core/ # app assembly, middleware, route registration, env typing
│ └── config/ # shared config keys, defaults, parsing, client-safe views
├── tools/
│ └── cli/ # current CLI moved only when boundaries are stableThis is a direction, not a mandate to rename everything immediately.
Refactor Guardrails
All agents must follow these rules for architecture work:
- Do not start by renaming
client/toapps/weborserver/toapps/worker. - Do not create empty framework-style packages just to mirror
rine. - Do not introduce a
rendererpackage unless the app actually gains SSR or shared rendering orchestration. - Do not split every server utility into
adapters/*packages unless there are at least two credible implementations or an immediate runtime boundary that justifies it. - Do not move code across the repo solely for aesthetics if imports, tests, and ownership get worse.
Required Refactor Order
For any substantial restructure, agents should work in this order:
- Stabilize boundaries.
- Create real workspace packages before migrating code into them.
- Add missing package manifests, tsconfig files, and explicit exports.
- Introduce a root TypeScript base config before broad moves.
- Extract shared logic.
- Move truly shared UI into
packages/ui. - Move shared config models and parsing into a dedicated shared package.
- Keep app-specific composition in the app layer.
- Move truly shared UI into
- Simplify application entrypoints.
- Split frontend bootstrap, providers, routes, and layout composition.
- Split backend app assembly, middleware registration, and runtime entry handling.
- Rename directories only after the dependency graph is cleaner.
If a proposed refactor skips step 1 and jumps to step 4, it should be treated as suspect.
Layering Rules
Frontend
client/src/App.tsxshould trend toward composition only: providers, routes, and top-level layout wiring.- Page initialization, session loading, config hydration, and permission gating should move into dedicated modules when touched.
- Reusable presentational components belong in
packages/uionly when they are app-agnostic. - Components that depend on
clientstate containers, Wouter routing, or app-specific permissions should remain in the app layer.
Backend
server/src/corecurrently acts as app assembly, not framework core. Keep that distinction explicit.- Route registration, middleware wiring, error mapping, and runtime entrypoints should be separated when refactoring.
- Business services stay close to the app until a stable abstraction clearly exists.
- Shared contracts and config types should move out before shared behavior moves out.
Shared Packages
packages/apiis for shared API contracts, schemas, validators, and transport-facing types.- Shared packages must not depend on
client/orserver/application modules. - Shared packages should expose explicit entrypoints and avoid deep relative imports from consumers.
Required Checks Before Structural Changes
Before any non-trivial reorganization, agents must do all of the following:
- Read this
AGENTS.md. - Inspect the current package/workspace manifests.
- Search for all imports of the modules being moved.
- Verify whether the target package already has a real manifest and public entrypoint.
- Explain why the destination layer is better than the current one.
If those checks are not done, the refactor is not ready.
Anti-Patterns
Avoid these common mistakes:
- Copying
rineabstractions intorinwithout a product need. - Moving files into
packages/while still importing app internals from them. - Creating
coremodules that actually contain product-specific assembly. - Mixing sensitive server-only configuration logic with client-safe config views.
- Leaving half-migrated directories that look shared but are not buildable or imported anywhere.
Testing
The project has comprehensive test coverage for both client and server:
Client Tests (Bun + jsdom)
- Location:
client/src/**/__tests__/*.test.ts - Runner: Bun's native test runner (
bun:test); DOM tests import the shared jsdom setup - Commands:
bun run test:client # Run tests once bun run test:client:watch # Watch mode bun run test:client:coverage # With coverage report
Server Tests (Bun)
- Location:
server/src/**/__tests__/*.test.ts,server/tests/ - Runner: Bun's native test runner (
bun:test) - Commands:
bun run test:server # Run tests once bun run test:server:coverage # With coverage report
Test Structure
- All test files import from
bun:test; do not add another test runner. - Unit tests for services, utilities, and core functionality
- Integration tests for API endpoints
- Security tests for mock isolation
- Fixtures and mocks in
server/tests/fixtures/
Code Style Guidelines
TypeScript
- Target: ESNext with ESNext modules
- Strict mode: Enabled
- Module resolution:
bundlermode - JSX:
react-jsxtransform - Allow importing
.tsextensions directly - Skip lib check for faster builds
- Unused locals/parameters: NOT enforced (set to false in server, true in client)
Imports
// External imports first (alphabetical)
import { eq, and } from "drizzle-orm";
import React from 'react';
// Internal imports (alphabetical)
import { Router } from "../core/router";
import { feeds } from "../db/schema";Naming Conventions
- Files: kebab-case (e.g.,
feed_card.tsx,ai-config.ts) - Components: PascalCase (e.g.,
FeedCard,ErrorBoundary) - Functions: camelCase (e.g.,
FeedService,createClient) - Types/Interfaces: PascalCase (e.g.,
ServiceLoader,Context) - Constants: UPPER_SNAKE_CASE for true constants
- Database tables: snake_case in schema
React Components
- Use functional components with hooks
- Props interface defined inline or as separate type
- Use
useMemofor expensive computations - Use
useTranslation()hook for i18n - Error boundaries wrap the app
Server (Cloudflare Workers)
- Service pattern: Each feature is a service function that takes a
Router - Lazy loading for heavy dependencies (WordPress import modules)
- Database via Drizzle ORM with D1
- Caching via custom CacheImpl utility
Commit Messages
Must follow conventional commits format:
feat: add new feature
chore: update dependencies
fix: resolve bug
docs: update documentation
ci: update CI configuration
style: formatting changes
test: add tests
pref: performance improvementsSetup the commit hook:
ln -s ../../cli/templates/git-commit-msg.sh .git/hooks/commit-msgError Handling
- Server: Return appropriate HTTP status codes via
set.status - Client: Use error boundaries (
GlobalErrorBoundary) - TypeScript strict null checks enabled
Project Structure
/home/xeu/projects/rin/
├── client/ # React + Vite frontend
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── page/ # Page components
│ │ ├── api/ # API client
│ │ └── utils/ # Utilities
├── server/ # Cloudflare Workers backend
│ ├── src/
│ │ ├── services/ # API route handlers
│ │ ├── db/ # Database schema
│ │ ├── core/ # Router and types
│ │ └── utils/ # Utilities
├── packages/ # Shared packages
│ └── api/ # @rin/api - Shared API types
├── cli/ # Rin CLI tool
│ └── bin/
│ └── rin.ts # CLI entry point
├── docs/ # Rspress documentation
├── cli/ # Rin CLI entrypoints, commands, tasks, templates
└── scripts/ # Compatibility wrappers around CLI tasksKey Technologies
- Client: React 18, Vite, TailwindCSS, Wouter (routing), i18next, Vitest
- Server: Hono-like router, Drizzle ORM, Cloudflare Workers/D1, bun:test
- Shared Types: @rin/api package for type-safe API communication
- Package Manager: Bun
- Build: Turbo for monorepo orchestration
- Testing: Vitest (client), Bun native test runner (server)
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.

