Trash Sim Development Rules
Cursor rules for the Trash Sim project. This skill enforces code quality standards, tech stack conventions, and development workflows for a Bun-powered React application.
Tech Stack
**Runtime**: Bun**Language**: TypeScript**Build Tool**: Vite**Framework**: React**UI Components**: shadcn/ui**Styling**: Tailwind CSS**Statistics**: @stdlib/stats**Code Quality**: Biome (formatting & linting)Project Structure
Source code in `src/`UI components in `components/ui/`Use path alias `@/` for project rootCode Quality Standards
Before completing any code changes:
1. **Format code** - Run `bun run format` to apply Biome formatting rules
2. **Lint code** - Run `bun run lint` to check and auto-fix linting issues
3. **Type check** - Run `bun run check` to ensure TypeScript type safety
4. **Fix all issues** - Resolve any formatting, linting, or type errors before finalizing changes
All code must pass these checks before being handed over for review.
Development Workflow
Package Management
Use `bun` for all package operations:
Install dependencies: `bun install`Add packages: `bun add <package>`Remove packages: `bun remove <package>`Available Scripts
`bun run dev` - Start Vite development server`bun run build` - Build production bundle`bun run preview` - Preview production build`bun run check` - TypeScript type checking`bun run format` - Format code with Biome`bun run lint` - Lint and auto-fix with BiomeDevelopment Process
1. Start dev server: `bun run dev`
2. Make changes with hot module reloading
3. Before committing:
- Run `bun run format`
- Run `bun run lint`
- Run `bun run check`
- Fix any issues reported
Component Guidelines
Use shadcn/ui components from `components/ui/`Style with Tailwind CSS utility classesImport using `@/` path alias (e.g., `import { Button } from '@/components/ui/button'`)Ensure components are properly typed with TypeScriptStatistics & Data
Use `@stdlib/stats` for statistical calculationsType all data structures and function parametersEnsure statistical functions have proper error handlingNotes
Biome replaces ESLint and Prettier for unified code quality toolingAll code must be TypeScript - no JavaScript filesFollow React best practices (hooks, functional components, proper key usage)Maintain consistent formatting and style across the codebase