

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
1# AGENTS.md23Repository instructions for AI coding agents. Keep this file short, concrete, and tied to commands that actually work in this4repo. If a fact here conflicts with source files or CI config, trust the source file and update this guide.56## Project Snapshot78Memos is a self-hosted note-taking app.910- Backend: Go 1.26.2, Echo v5, Connect RPC, gRPC-Gateway, Protocol Buffers.11- Frontend: React 19, TypeScript 6, Vite 8, Tailwind CSS v4, React Query v5.12- Storage: SQLite, MySQL, PostgreSQL.13- Generated API outputs: `proto/gen/` for Go/OpenAPI, `web/src/types/proto/` for TypeScript.1415## Working Rules1617- Read relevant code before editing; prefer local patterns over new abstractions.18- Keep diffs scoped. Do not do repo-wide cleanup, dependency churn, or generated-file rewrites unless the task requires it.19- Do not hand-edit generated proto outputs. Change `.proto` files, then run `buf generate`.20- Add migrations for all database drivers when schema changes, and update each driver's `LATEST.sql`.21- Add public API endpoints to `server/router/api/v1/acl_config.go`.22- Ask before adding heavy dependencies, changing auth/token behavior, or altering Docker/release workflows.2324## Commands2526Run from the repository root unless a command starts with `cd`.2728```bash29# Backend30go run ./cmd/memos --port 8081 # Start backend dev server31go test ./... # Run all Go tests32go test -v ./store/... # Store tests, including DB drivers via TestContainers33go test -v -race ./server/... # Server tests with race detector34go test -v -race ./internal/... # Internal package tests with race detector35go test -v -run TestFoo ./pkg/... # Run matching Go tests36go mod tidy -go=1.26.2 # Match CI tidy check37golangci-lint run # Go lint, config: .golangci.yaml38golangci-lint run --fix # Auto-fix lint, including goimports3940# Frontend41cd web && pnpm install # Install dependencies42cd web && pnpm dev # Dev server on :3001, proxying API to :808143cd web && pnpm lint # Type check + Biome lint44cd web && pnpm test # Vitest unit tests45cd web && pnpm build # Production build46cd web && pnpm release # Build SPA into server/router/frontend/dist4748# Protocol Buffers49cd proto && buf generate # Regenerate Go + TypeScript + OpenAPI50cd proto && buf lint # Lint proto files51cd proto && buf format -w # Format proto files52```5354## Code Map5556| Path | Purpose |57| --- | --- |58| `cmd/memos/main.go` | Cobra/Viper CLI setup and server startup |59| `server/server.go` | Echo HTTP server and background runner wiring |60| `server/auth/` | JWT access tokens, refresh tokens, PAT handling |61| `server/router/api/v1/` | Connect/gRPC-Gateway services, ACL config, SSE hub |62| `server/router/frontend/` | Static SPA serving |63| `server/router/fileserver/` | Native HTTP file serving, thumbnails, range requests |64| `server/runner/` | Background memo processing and S3 presign refresh |65| `store/` | Store facade, cache, migrations, driver interface |66| `store/db/{sqlite,mysql,postgres}/` | Database-specific drivers and SQL |67| `proto/api/v1/` | Public API service definitions |68| `proto/store/` | Internal storage proto messages |69| `internal/` | App-private packages: scheduler, cron, email, CEL filter, markdown, idp, S3 |70| `web/src/connect.ts` | Connect RPC clients, auth interceptor, access-token refresh |71| `web/src/auth-state.ts` | Token storage and BroadcastChannel cross-tab sync |72| `web/src/hooks/` | React Query hooks for server state |73| `web/src/contexts/` | React context for client/UI state |74| `web/src/components/` | Radix/Tailwind UI components and feature components |75| `web/src/themes/` | CSS themes using OKLch color tokens |7677## Change Routing7879| Change | Update | Verify |80| --- | --- | --- |81| Go service or router behavior | Service code under `server/`, tests near package | `go test -v -race ./server/...` |82| Store or migration behavior | `store/`, all three DB driver migrations, `LATEST.sql` | `go test -v ./store/...` |83| Internal package logic | Relevant `internal/` package tests | `go test -v -race ./internal/...` |84| Frontend behavior | Components/hooks/contexts under `web/src/` | `cd web && pnpm lint && pnpm test` |85| Frontend production output | Vite config or release-sensitive UI | `cd web && pnpm build` or `pnpm release` |86| Proto API | `.proto` source plus generated outputs | `cd proto && buf generate && buf lint` |87| Public unauthenticated route | `server/router/api/v1/acl_config.go` | Targeted server test or manual route check |8889## Go Conventions9091- Wrap errors with `errors.Wrap(err, "context")` from `github.com/pkg/errors`; do not use `fmt.Errorf`.92- Return service errors with `status.Errorf(codes.X, "message")`.93- Keep imports grouped as stdlib, third-party, then `github.com/usememos/memos`; goimports is run by golangci-lint.94- Add doc comments for exported identifiers; godot enforces exported comment punctuation.95- Avoid package-level mutable state unless the surrounding package already uses that pattern.9697## Frontend Conventions9899- Use `@/` for absolute imports.100- Follow Biome formatting: 2-space indent, double quotes, semicolons, 140-character line width.101- Put server data in React Query hooks under `web/src/hooks/`; keep UI-only state in contexts or component state.102- Use Tailwind CSS v4 utilities, `cn()` for class merging, and CVA for variants.103- Reuse Radix primitives and existing components before adding new UI primitives.104- Keep generated proto TypeScript under `web/src/types/proto/` out of manual edits and Biome rewrites.105106## Database And Proto Rules107108- Schema changes require SQLite, MySQL, and PostgreSQL migrations plus `LATEST.sql` updates.109- Fresh-install SQL and incremental migrations must stay equivalent.110- Proto field changes must preserve compatibility unless the task explicitly allows a breaking API change.111- Regenerate after proto edits and include both Go/OpenAPI and TypeScript generated outputs.112113## Verification Policy114115- Run the narrowest relevant checks while iterating.116- Before finishing, run the checks that match the changed surface from "Change Routing".117- For docs-only changes, `git diff --check` is sufficient unless the docs include runnable examples that should be tested.118- If a required check cannot run locally, report the reason and the exact command that remains.119120## CI Reference121122- Backend CI: Go 1.26.2, `go mod tidy -go=1.26.2`, golangci-lint v2.11.3, test groups `store`, `server`, `internal`, `other`.123- Frontend CI: Node 24, pnpm 11.0.1, `pnpm lint`, `pnpm test`, `pnpm build`.124- Proto CI: `buf lint` and `buf format` check.125- Docker: `scripts/Dockerfile`, Alpine 3.21 runtime, non-root user, port 5230, multi-arch amd64/arm64/arm/v7.126
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| n8n-io/n8npackages/@n8n/agents/AGENTS.md · 201k | AGENTS.md | buildteststylearch+3 | 100/100 | 14 days ago | |
| duckduckgo/content-scope-scriptsspecial-pages/AGENTS.md · 70 | AGENTS.md | buildteststylearch+3 | 100/100 | 14 days ago | |
| deepseek-ai/deepseek-harnessnative/landlock-run/AGENTS.md · 104k | AGENTS.md | setupteststylearch+3 | 100/100 | today | |
| code-yeongyu/oh-my-openagentpackages/web/AGENTS.md · 68k | AGENTS.md | setupbuildtestlint-format+6 | 100/100 | 13 days ago | |
| TryGhost/Ghoste2e/AGENTS.md · 55k | AGENTS.md | setupteststylearch+2 | 100/100 | today | |
| mui/material-uiAGENTS.md · 99k | AGENTS.md | setupbuildtestlint-format+9 | 100/100 | 14 days ago | |
| ethereum/go-ethereumAGENTS.md · 51k | AGENTS.md | buildtestlint-formatgit+1 | 100/100 | 14 days ago | |
| elastic/elasticsearchx-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/AGENTS.md · 78k | AGENTS.md | buildtestlint-formatstyle+2 | 100/100 | 14 days ago |
A badge carrying the measured quality of the strongest agent config file in this repository, out of 100. It reads from this index every time somebody loads your page, so it changes when the measurement changes and there is nothing to keep up to date. Free, no account, and the value is not something you or we can set by hand.
[](https://rulestack.kynth.studio/configs/usememos-memos-agents)Would rather not hotlink us? Every badge is also served in shields.io’s endpoint schema, so shields renders the image and your readers never talk to our domain:
Published by Toolproof, the masthead over this index and eight others. The method behind the number is at toolproof.kynth.studio/methodology, and the whole thing is readable as JSON with no key at /api.