- CLAUDE.md with commands, structure, key constraints - .claude/rules/ coding standards + workflows - docs/architecture.md with design decisions - .github/ CI workflow, issue templates, PR template - LICENSE (MIT) - .fire-tools.json initialization stamp - README.md rewritten with features, quick start, stack table
1.4 KiB
1.4 KiB
description
| description |
|---|
| Coding conventions — read when writing or reviewing any code file |
Coding Standards
DO
- Use TypeScript strict mode (
"strict": truein tsconfig) - Use Zod only at user-input boundaries (settings form) — not for internal types
- Use named constants — never magic numbers or strings
- Keep components focused; co-locate sub-components in the same file if < 80 lines
- Use
typeimports for framer-motion'sVariantstype to avoid widening issues - Cast TanStack Router
paramsasas neverfor cross-route navigation
NEVER
- Use
any— useunknownand narrow explicitly - Inline Honcho base URL — always read from
loadConfig()insrc/lib/config.ts - Use Tailwind color classes for theme-sensitive values — use CSS
var(--*)instead - Use
React.FormEvent(deprecated in TS6) — useReact.SyntheticEvent<HTMLFormElement> - Add
as constto framer-motion variant objects — annotate withconst x: Variants = {}
Test Standards
- One assertion per test case
- Test behavior, not implementation
- Run targeted:
pnpm vitest run src/path/to/file.test.ts - Never mock internal modules — mock only external API boundaries (openapi-fetch client)
API Query Patterns
- All data fetching via TanStack Query hooks in
src/api/queries.ts - POST body shapes are fixed per the openapi schema — do not guess field names
- Use
client.current(getter) to always get fresh config at call time