···5566### project management
7788-- tools like Node.js, Bun and pnpm are managed by mise, to run them, use `mise exec -- pnpm ...`
88+- pnpm is managed by mise, to run commands, use `mise exec -- pnpm ...`
99+- install dependencies with `pnpm install`
1010+- run dev server with `pnpm dev`
1111+- build with `pnpm build`
1212+- preview production build with `pnpm preview`
1313+- format via `pnpm run format` (prettier)
1414+- lint via `pnpm run lint` (prettier --check)
1515+- typecheck via `pnpm run check` (svelte-check)
1616+- database commands: `pnpm db:push`, `pnpm db:generate`, `pnpm db:migrate`, `pnpm db:studio`
1717+- check `pnpm view <package>` before adding a new dependency
9181019### code writing
11201221- new files should be in kebab-case
1322- use tabs for indentation, spaces allowed for diagrams in comments
1423- use single quotes and add trailing commas
1515-- prefer arrow functions
2424+- prefer arrow functions, but use regular methods in classes unless arrow functions are necessary
2525+ (e.g., when passing the method as a callback that needs `this` binding)
1626- use braces for control statements, even single-line bodies
1727- use bare blocks `{ }` to group related code and limit variable scope
1828- use template literals for user-facing strings and error messages
2929+- avoid barrel exports (index files that re-export from other modules); import directly from source
3030+- use `// #region <name>` and `// #endregion` to denote regions when a file needs to contain a lot
3131+ of code
3232+- prefer required parameters over optional ones; optional parameters are acceptable when:
3333+ - the default is obvious and used by the vast majority of callers (e.g., `encoding = 'utf-8'`)
3434+ - it's a configuration value with a sensible default (e.g., `timeout = 5000`)
3535+- avoid optional parameters that change behavioral modes or make the function do different things
3636+ based on presence/absence; prefer separate functions instead
3737+- when adding optional parameters for backwards compatibility, consider whether a new function with
3838+ a clearer name would be better
19392040### documentation
21412222-- documentations include README, code comments, commit messages, changesets
2323-- any writing should be in lowercase, except for proper nouns, acronyms and 'I'
4242+- documentations include README, code comments, commit messages
4343+- any writing should be in lowercase, except for proper nouns, acronyms and 'I'; this does not apply
4444+ to public-facing interfaces like web UI
2445- only comment non-trivial code, focusing on _why_ rather than _what_
2546- write comments and JSDoc in lowercase (except proper nouns, acronyms, and 'I')
2626-- add JSDoc comments to newly exported functions, methods, classes, fields, and enums
4747+- add JSDoc comments to new publicly exported functions, methods, classes, fields, and enums
2748- JSDoc should include proper annotations:
2849 - use `@param` for parameters (no dashes after param names)
2950 - use `@returns` for return values
3051 - use `@throws` for exceptions when applicable
3152 - keep descriptions concise but informative
32533333-### misc
5454+### agentic coding
34553535-- Claude Code's Bash tool persists directory changes (`cd`) across calls
3636-- the `.research/` directory serves as a workspace for temporary experiments, analysis, and planning
3737- materials. create it if necessary (it's gitignored). this directory may contain cloned
3838- repositories or other reference materials that can help inform implementation decisions
5656+- `.research/` directory in the project root serves as a workspace for temporary experiments,
5757+ analysis, and planning materials. create if not present (it's gitignored). this directory may
5858+ contain cloned repositories or other reference materials that can help inform implementation
5959+ decisions
6060+- this document is intentionally incomplete; discover everything else in the repo
3961- don't make assumptions or speculate about code, plans, or requirements without exploring first;
4062 pause and ask for clarification when you're still unsure after looking into it
4141-- during plan mode, discuss the plans before finalizing/exiting plan mode to allow for additional
4242- context or follow-up questions to be provided
6363+- in plan mode, present the plan for review before exiting to allow for feedback or follow-up
6464+ questions
6565+- when debugging problems, isolate the root cause first before attempting fixes: add logging,
6666+ reproduce the issue, narrow down the scope, and confirm the exact source of the problem
6767+6868+### Claude Code-specific
6969+7070+- Explore tool (subagents for exploration, planning, etc.) may not always be accurate; verify
7171+ subagent findings when needed
7272+7373+### cgr
7474+7575+use `@oomfware/cgr` to ask questions about external repositories.
7676+7777+```
7878+npx @oomfware/cgr ask [options] <repo>[#branch] <question>
7979+8080+options:
8181+ -m, --model <model> model to use: opus, sonnet, haiku (default: haiku)
8282+ -d, --deep clone full history (enables git log/blame/show)
8383+ -w, --with <repo> additional repository to include, supports #branch (repeatable)
8484+```
8585+8686+useful repositories:
8787+8888+- `github.com/sveltejs/kit` for SvelteKit framework, routing, load functions, hooks
8989+- `github.com/sveltejs/svelte` for Svelte 5 reactivity, runes, components
9090+- `github.com/mary-ext/atcute` for atcute AT Protocol client libraries
9191+- `github.com/bluesky-social/atproto` for AT Protocol reference implementation
9292+- `github.com/drizzle-team/drizzle-orm` for Drizzle ORM, database schema, queries
9393+- `github.com/vitejs/vite` for Vite dev server, build tooling, plugin API
9494+9595+cgr works best with detailed questions. include file/folder paths when you know them, and reference
9696+details from previous answers in follow-ups.
9797+9898+run `npx @oomfware/cgr --help` for more options.