

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
1# Before starting work23- Run `lat search` to find sections relevant to your task. Read them to understand the design intent before writing code.4- Run `lat expand` on user prompts to expand any `[[refs]]` — this resolves section names to file locations and provides context.56# Post-task checklist (REQUIRED — do not skip)78After EVERY task, before responding to the user:910- [ ] Update `lat.md/` if you added or changed any functionality, architecture, tests, or behavior11- [ ] Run `lat check` — all wiki links and code refs must pass12- [ ] Do not skip these steps. Do not consider your task done until both are complete.1314---1516# What is lat.md?1718This project uses [lat.md](https://www.npmjs.com/package/lat.md) to maintain a structured knowledge graph of its architecture, design decisions, and test specs in the `lat.md/` directory. It is a set of cross-linked markdown files that describe **what** this project does and **why** — the domain concepts, key design decisions, business logic, and test specifications. Use it to ground your work in the actual architecture rather than guessing.1920## Development Commands (wodsmith-start)2122Run these from `apps/wodsmith-start/`:2324### Build and Development2526- `pnpm dev` - Start development server27- `pnpm build` - Build TanStack Start application28- `pnpm preview` - Preview production build with Cloudflare2930### Code Quality3132- `pnpm lint` - Run Biome linter33- `pnpm format` - Format code with Biome34- `pnpm check` - Run Biome check (lint + format)35- `pnpm type-check` - Run TypeScript type checking3637### Database Operations3839- `pnpm db:push` - Push schema changes to PlanetScale dev branch (use during development)40- `pnpm db:generate --name=X` - Generate migration (only before merging to main)41- `pnpm db:studio` - Open Drizzle Studio42- `pnpm db:migrate:local` - Apply migrations locally4344### Testing4546- `pnpm test` - Run all tests with Vitest (single run mode)47- Test files are located in `test/` directory4849### Cloudflare5051- `pnpm cf-typegen` - Generate Cloudflare types (run after wrangler.jsonc changes)52- `npx alchemy deploy` - Deploy using Alchemy IaC53- `pnpm alchemy:dev` - Deploy local dev environment with Alchemy (required after changing env vars in `.dev.vars`)5455## Architecture Overview (wodsmith-start)5657### Tech Stack5859- **Framework**: TanStack Start (React 19, TypeScript, Vinxi/Vite)60- **Database**: PlanetScale (MySQL) with Drizzle ORM via Hyperdrive61- **Authentication**: Custom auth with KV sessions62- **Deployment**: Cloudflare Workers via Alchemy IaC63- **UI**: Tailwind CSS, Shadcn UI, Radix primitives64- **State**: Zustand (client), TanStack Router loaders (server)65- **API**: TanStack Start server functions (`createServerFn`)6667### Project Structure (wodsmith-start)6869```70apps/wodsmith-start/src/71├── routes/ # TanStack Router file-based routes72│ ├── api/ # API routes (server handlers)73│ └── compete/ # Competition features74├── components/ # React components75├── db/ # Database schema and migrations76│ ├── schema.ts # Main schema exports77│ └── migrations/ # Auto-generated migrations78├── server/ # Server-only business logic79├── server-fns/ # Server functions (createServerFn)80├── lib/ # Shared utilities81│ ├── env.ts # Server-only env access (getAppUrl, etc.)82│ └── stripe.ts # Server-only Stripe client83├── utils/ # Shared utilities84├── state/ # Client state (Zustand)85└── schemas/ # Zod validation schemas86```8788### Multi-Tenancy8990- Team-based data isolation with `teamId` filtering91- Role-based permissions (admin, member roles)92- Team switching via team-switcher component93- All database operations must include team context9495### Database Schema9697Database is modularly structured in `src/db/schemas/`:9899- `users.ts` - User accounts and authentication100- `teams.ts` - Team/organization management101- `workouts.ts` - Workout management system102- `programming.ts` - Programming tracks and scheduling103- `billing.ts` - Credit billing system104- `scaling.ts` - Workout scaling options105- `scheduling.ts` - Schedule templates and scheduling106- Main schema exports from `src/db/schema.ts`107108## Development Guidelines109110### Code Style111112- Use TypeScript everywhere, prefer interfaces over types113- Functional components, avoid classes114- Server Components by default, `use client` only when necessary115- Add `import "server-only"` to server-only files (except page.tsx)116- Use semantic commit messages: `feat:`, `fix:`, `chore:`117- Use `pnpm` as package manager118119### Database120121- **Local development**: Use `pnpm db:push` to apply schema changes directly (no migration files)122- **Before merging**: Generate migrations with `pnpm db:generate --name=feature-name`123- **Never write SQL migrations manually** - always use drizzle-kit124- Use `db.transaction()` when multiple writes need to be atomic (PlanetScale supports transactions)125- Never pass `id` when inserting (auto-generated with CUID2)126- Always filter by `teamId` for multi-tenant data127- Use helper functions in `src/server/` for business logic128- Use standard Drizzle queries with `inArray()` directly — PlanetScale has no restrictive parameter limits129130### Authentication & Authorization131132- Session handling: `getSessionFromCookie()` for server components133- Client session: `useSession()` from `src/utils/auth-client.ts`134- Team authorization utilities in `src/utils/team-auth.ts`135- Protect routes with team context validation136- When checking roles use available roles from `src/db/schemas/teams.ts`137138### State Management139140- Server state: React Server Components141- Client state: Zustand stores in `src/state/`142- URL state: NUQS for search parameters143- Forms: React Hook Form with Zod validation144145### API Patterns146147- Server functions with TanStack Start: `createServerFn` (see below)148- Named object parameters for functions with >1 parameter149- Consistent error handling with proper HTTP status codes150- Rate limiting on auth endpoints151152### TanStack Start Server Functions (wodsmith-start)153154#### Environment Variables155156**ALWAYS** use `env` from `cloudflare:workers` - never use `process.env`:157158```typescript159import {env} from 'cloudflare:workers'160161env.HYPERDRIVE // PlanetScale via Hyperdrive162env.KV_SESSION // KV namespace binding163env.APP_URL // Environment variable164env.STRIPE_SECRET_KEY // Secret165```166167**TypeScript not recognizing env vars?** If you've added new bindings in `alchemy.run.ts` and deployed with `pnpm alchemy:dev`, but TypeScript doesn't see them, run:168169```bash170lat locate "Section Name" # find a section by name (exact, fuzzy)171lat refs "file#Section" # find what references a section172lat search "natural language" # semantic search across all sections173lat expand "user prompt text" # expand [[refs]] to resolved locations174lat check # validate all links and code refs175```176177Run `lat --help` when in doubt about available commands or options.178179If `lat search` fails because no API key is configured, explain to the user that semantic search requires a key provided via `LAT_LLM_KEY` (direct value), `LAT_LLM_KEY_FILE` (path to key file), or `LAT_LLM_KEY_HELPER` (command that prints the key). Supported key prefixes: `sk-...` (OpenAI) or `vck_...` (Vercel). If the user doesn't want to set it up, use `lat locate` for direct lookups instead.180181# Syntax primer182183- **Section ids**: `lat.md/path/to/file#Heading#SubHeading` — full form uses project-root-relative path (e.g. `lat.md/tests/search#RAG Replay Tests`). Short form uses bare file name when unique (e.g. `search#RAG Replay Tests`, `cli#search#Indexing`).184- **Wiki links**: `[[target]]` or `[[target|alias]]` — cross-references between sections. Can also reference source code: `[[src/foo.ts#myFunction]]`.185- **Source code links**: Wiki links in `lat.md/` files can reference functions, classes, constants, and methods in TypeScript/JavaScript/Python/Rust/Go/C files. Use the full path: `[[src/config.ts#getConfigDir]]`, `[[src/server.ts#App#listen]]` (class method), `[[lib/utils.py#parse_args]]`, `[[src/lib.rs#Greeter#greet]]` (Rust impl method), `[[src/app.go#Greeter#Greet]]` (Go method), `[[src/app.h#Greeter]]` (C struct). `lat check` validates these exist.186- **Code refs**: `// @lat: [[section-id]]` (JS/TS/Rust/Go/C) or `# @lat: [[section-id]]` (Python) — ties source code to concepts187188# Test specs189190Key tests can be described as sections in `lat.md/` files (e.g. `tests.md`). Add frontmatter to require that every leaf section is referenced by a `// @lat:` or `# @lat:` comment in test code:191192```markdown193---194lat:195 require-code-mention: true196---197# Tests198199Authentication and authorization test specifications.200201## User login202203Verify credential validation and error handling for the login endpoint.204205### Rejects expired tokens206Tokens past their expiry timestamp are rejected with 401, even if otherwise valid.207208### Handles missing password209Login request without a password field returns 400 with a descriptive error.210```211212Every section MUST have a description — at least one sentence explaining what the test verifies and why. Empty sections with just a heading are not acceptable. (This is a specific case of the general leading paragraph rule below.)213214Each test in code should reference its spec with exactly one comment placed next to the relevant test — not at the top of the file:215216```python217# @lat: [[tests#User login#Rejects expired tokens]]218def test_rejects_expired_tokens():219 ...220221# @lat: [[tests#User login#Handles missing password]]222def test_handles_missing_password():223 ...224```225226Do not duplicate refs. One `@lat:` comment per spec section, placed at the test that covers it. `lat check` will flag any spec section not covered by a code reference, and any code reference pointing to a nonexistent section.227228# Section structure229230Every section in `lat.md/` **must** have a leading paragraph — at least one sentence immediately after the heading, before any child headings or other block content. The first paragraph must be ≤250 characters (excluding `[[wiki link]]` content). This paragraph serves as the section's overview and is used in search results, command output, and RAG context — keeping it concise guarantees the section's essence is always captured.231232```markdown233# Good Section234235Brief overview of what this section documents and why it matters.236237More detail can go in subsequent paragraphs, code blocks, or lists.238239## Child heading240241Details about this child topic.242```243244```markdown245# Bad Section246247## Child heading248249Details about this child topic.250```251252The second example is invalid because `Bad Section` has no leading paragraph. `lat check` validates this rule and reports errors for missing or overly long leading paragraphs.253254<!-- intent-skills:start -->255# Skill mappings - when working in these areas, load the linked skill file into context.256skills:257 - task: "TanStack Router core concepts, route trees, createRouter, createRoute, file naming conventions"258 load: "node_modules/@tanstack/router-core/skills/router-core/SKILL.md"259 - task: "Route protection, auth guards, beforeLoad redirects, RBAC, authenticated layouts"260 load: "node_modules/@tanstack/router-core/skills/router-core/auth-and-guards/SKILL.md"261 - task: "Code splitting, lazy routes, .lazy.tsx, autoCodeSplitting, getRouteApi"262 load: "node_modules/@tanstack/router-core/skills/router-core/code-splitting/SKILL.md"263 - task: "Route data loading, loaders, loaderDeps, staleTime, pendingComponent, Await, deferred data"264 load: "node_modules/@tanstack/router-core/skills/router-core/data-loading/SKILL.md"265 - task: "Link component, useNavigate, preloading, navigation blocking, scroll restoration"266 load: "node_modules/@tanstack/router-core/skills/router-core/navigation/SKILL.md"267 - task: "notFound handling, errorComponent, CatchBoundary, route masking"268 load: "node_modules/@tanstack/router-core/skills/router-core/not-found-and-errors/SKILL.md"269 - task: "Dynamic path params, splat routes, optional params, useParams"270 load: "node_modules/@tanstack/router-core/skills/router-core/path-params/SKILL.md"271 - task: "Search params validation, Zod adapters, search middlewares, retainSearchParams"272 load: "node_modules/@tanstack/router-core/skills/router-core/search-params/SKILL.md"273 - task: "SSR, streaming, renderRouterToStream, HeadContent, Scripts, head route option, meta tags"274 load: "node_modules/@tanstack/router-core/skills/router-core/ssr/SKILL.md"275 - task: "Router type safety, Register declaration, from narrowing, strict mode, LinkProps"276 load: "node_modules/@tanstack/router-core/skills/router-core/type-safety/SKILL.md"277<!-- intent-skills:end -->278279<!-- gitnexus:start -->280# GitNexus — Code Intelligence281282This project is indexed by GitNexus as **thewodapp** (53782 symbols, 88590 relationships, 300 execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely.283284> If any GitNexus tool warns the index is stale, run `npx gitnexus analyze` in terminal first.285286## Always Do287288- **MUST run impact analysis before editing any symbol.** Before modifying a function, class, or method, run `gitnexus_impact({target: "symbolName", direction: "upstream"})` and report the blast radius (direct callers, affected processes, risk level) to the user.289- **MUST run `gitnexus_detect_changes()` before committing** to verify your changes only affect expected symbols and execution flows.290- **MUST warn the user** if impact analysis returns HIGH or CRITICAL risk before proceeding with edits.291- When exploring unfamiliar code, use `gitnexus_query({query: "concept"})` to find execution flows instead of grepping. It returns process-grouped results ranked by relevance.292- When you need full context on a specific symbol — callers, callees, which execution flows it participates in — use `gitnexus_context({name: "symbolName"})`.293294## Never Do295296- NEVER edit a function, class, or method without first running `gitnexus_impact` on it.297- NEVER ignore HIGH or CRITICAL risk warnings from impact analysis.298- NEVER rename symbols with find-and-replace — use `gitnexus_rename` which understands the call graph.299- NEVER commit changes without running `gitnexus_detect_changes()` to check affected scope.300301## Resources302303| Resource | Use for |304|----------|---------|305| `gitnexus://repo/thewodapp/context` | Codebase overview, check index freshness |306| `gitnexus://repo/thewodapp/clusters` | All functional areas |307| `gitnexus://repo/thewodapp/processes` | All execution flows |308| `gitnexus://repo/thewodapp/process/{name}` | Step-by-step execution trace |309310## CLI311312| Task | Read this skill file |313|------|---------------------|314| Understand architecture / "How does X work?" | `.claude/skills/gitnexus/gitnexus-exploring/SKILL.md` |315| Blast radius / "What breaks if I change X?" | `.claude/skills/gitnexus/gitnexus-impact-analysis/SKILL.md` |316| Trace bugs / "Why is X failing?" | `.claude/skills/gitnexus/gitnexus-debugging/SKILL.md` |317| Rename / extract / split / refactor | `.claude/skills/gitnexus/gitnexus-refactoring/SKILL.md` |318| Tools, resources, schema reference | `.claude/skills/gitnexus/gitnexus-guide/SKILL.md` |319| Index, status, clean, wiki CLI commands | `.claude/skills/gitnexus/gitnexus-cli/SKILL.md` |320321<!-- gitnexus:end -->322
One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| wodsmith/thewodappAGENTS.md · 2 | AGENTS.md | teststylearchdo-not+1 | 73/100 | 14 days ago | |
| wodsmith/thewodapp.claude/hooks/CLAUDE.md · 2 | CLAUDE.md | setupteststyle | 73/100 | 14 days ago | |
| wodsmith/thewodapp.cursorrules · 2 | .cursorrules | testlint-formatstylearch+4 | 64/100 | 14 days ago |
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| bagisto/bagistoCLAUDE.md · 28k | CLAUDE.md | setupbuildteststyle+5 | 100/100 | 7 days ago | |
| Adit-Jain-srm/NightmareNetCLAUDE.md · 46 | CLAUDE.md | buildtestlint-formatstyle+6 | 100/100 | 14 days ago | |
| tyrchen/geektime-bootcamp-aiw7/genslides/backend/CLAUDE.md · 230 | CLAUDE.md | testlint-formatstylearch+6 | 100/100 | 9 days ago | |
| nimbalyst/nimbalystpackages/android/CLAUDE.md · 1.5k | CLAUDE.md | setupbuildstylearch+2 | 100/100 | 14 days ago | |
| dotCMS/corecore-web/CLAUDE.md · 949 | CLAUDE.md | teststylearchtesting-strategy+3 | 100/100 | 14 days ago | |
| microsoft/playwrightCLAUDE.md · 95k | CLAUDE.md | buildtestlint-formatstyle+7 | 100/100 | 7 days ago | |
| tphakala/birdnet-goCLAUDE.md · 1.6k | CLAUDE.md | buildtestlint-formatstyle+8 | 100/100 | today | |
| dotCMS/coreCLAUDE.md · 949 | CLAUDE.md | setupbuildteststyle+7 | 99/100 | today |
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/wodsmith-thewodapp-claude)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.