docs: add project docs, GitHub DX, fire-tools stamp
- 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
This commit is contained in:
31
.claude/rules/coding-standards.md
Normal file
31
.claude/rules/coding-standards.md
Normal file
@@ -0,0 +1,31 @@
|
||||
---
|
||||
description: Coding conventions — read when writing or reviewing any code file
|
||||
---
|
||||
|
||||
# Coding Standards
|
||||
|
||||
## DO
|
||||
- Use TypeScript strict mode (`"strict": true` in 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 `type` imports for framer-motion's `Variants` type to avoid widening issues
|
||||
- Cast TanStack Router `params` as `as never` for cross-route navigation
|
||||
|
||||
## NEVER
|
||||
- Use `any` — use `unknown` and narrow explicitly
|
||||
- Inline Honcho base URL — always read from `loadConfig()` in `src/lib/config.ts`
|
||||
- Use Tailwind color classes for theme-sensitive values — use CSS `var(--*)` instead
|
||||
- Use `React.FormEvent` (deprecated in TS6) — use `React.SyntheticEvent<HTMLFormElement>`
|
||||
- Add `as const` to framer-motion variant objects — annotate with `const 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
|
||||
50
.claude/rules/workflows.md
Normal file
50
.claude/rules/workflows.md
Normal file
@@ -0,0 +1,50 @@
|
||||
---
|
||||
description: Recurring task patterns — read when fixing issues, adding features, or running tests
|
||||
---
|
||||
|
||||
# Workflows
|
||||
|
||||
## Add a Feature
|
||||
|
||||
1. Read `docs/architecture.md` to understand where new code belongs
|
||||
2. Write the test first (failing)
|
||||
3. Implement minimum code to pass
|
||||
4. `pnpm test` — full suite
|
||||
5. `pnpm lint:fix` — Biome
|
||||
6. Commit: `feat: <description>`
|
||||
|
||||
## Fix a Bug
|
||||
|
||||
1. Grep codebase for identifiers mentioned in the bug report
|
||||
2. Read the 2–3 most relevant files
|
||||
3. Write a failing test that reproduces the problem
|
||||
4. Implement the minimal fix
|
||||
5. `pnpm vitest run <path/to/test.ts>` — verify test passes
|
||||
6. `pnpm lint:fix` — pass lint
|
||||
7. Commit: `fix: <description>`
|
||||
|
||||
## Regenerate API Types
|
||||
|
||||
Run after updating `openapi.json`:
|
||||
|
||||
```bash
|
||||
pnpm generate:api
|
||||
# → overwrites src/api/schema.d.ts
|
||||
# Do not edit schema.d.ts manually
|
||||
```
|
||||
|
||||
## Run Targeted Tests
|
||||
|
||||
```bash
|
||||
pnpm vitest run src/path/to/file.test.ts
|
||||
pnpm vitest run --testNamePattern="<substring>"
|
||||
pnpm vitest src/path/to/file.test.ts # watch mode
|
||||
```
|
||||
|
||||
## Add a New Route
|
||||
|
||||
1. Create `src/routes/<flat-route-name>.tsx` using TanStack Router flat-route syntax
|
||||
2. Export `const Route = createFileRoute("/<path>")({ component: Foo })`
|
||||
3. Vite plugin auto-regenerates `src/routeTree.gen.ts` on save
|
||||
4. Add nav link to `src/components/layout/Sidebar.tsx` if top-level
|
||||
5. Cast all `navigate()` / `<Link>` params as `as never`
|
||||
Reference in New Issue
Block a user