This file contains project-specific guidelines and commands for Claude Code to follow when working on this codebase.
BEFORE EVERY COMMIT, YOU MUST:
- 🎨 Format code: Run
yarn run format:fix(REQUIRED - NO EXCEPTIONS) - 🔍 Type check: Run
yarn run check - 🧹 Lint: Run
yarn run lint - 📝 Commit format: Use conventional commit format with issue number
Failure to run yarn run format:fix before committing will result in inconsistent code formatting.
For comprehensive project architecture, patterns, and development workflows, see:
- GitHub Copilot Instructions - Detailed project overview, framework stack, data architecture, and coding conventions
yarn run lintRun this command to check for TypeScript and ESLint errors. Always run this before committing changes to ensure code quality.
yarn run format:fixRun this command to automatically format code according to project standards. Always run this before committing changes.
yarn run checkRun this command to perform comprehensive TypeScript type checking and Svelte validation. Always run this before committing changes.
- Avoid JSDoc comments (
/** */with@param,@returns,@description, etc.) - Use inline
//comments for explaining complex logic - Keep code self-documenting with clear variable and function names
- TypeScript types serve as documentation - explicit JSDoc is redundant
// ❌ Don't use JSDoc
/**
* Updates a single place in the store
* @param placeId - The ID of the place
* @returns The updated place or null
*/
export const updatePlace = async (placeId: string): Promise<Place | null> => {
// ✅ Do use inline comments when needed
export const updateSinglePlace = async (placeId: string | number): Promise<Place | null> => {
// Fetch the updated place from the API
const response = await axios.get<Place>(...);yarn run format:fix before committing!
Follow Conventional Commits format for all commits:
<type>(<scope>): <description> #<issue-number>
[optional body]
🤖 Generated with [opencode](https://opencode.ai)
Note: When using opencode, we do not set a co-author attribution
feat(map): add dark mode toggle #276fix(area-page): resolve TypeScript errors #345refactor(api): optimize data fetching logic #123docs(readme): update installation instructions #456
Note: Use #123 not (#123) or [#123] for issue references.
feat: New featurefix: Bug fixrefactor: Code refactoringperf: Performance improvementstyle: Code style changes (formatting, etc.)docs: Documentation changestest: Test-related changeschore: Maintenance tasks
- Make your changes
- 🎨 MANDATORY: Run
yarn run format:fix⚠️ THIS IS REQUIRED BEFORE EVERY COMMIT⚠️ - Run
yarn run checkto perform type checking - Run
yarn run lintto verify no errors - Stage and commit with conventional format
- Include issue number if applicable (e.g.,
#276)
🚨 CRITICAL REMINDER: You MUST run yarn run format:fix before staging any commit. This is non-negotiable and ensures consistent code formatting across the entire project.
src/lib/sync/places.tsalways runs first and populates the$placesstore withPlace[]data- Use
Placetype for v4 API data,Elementtype for v2 API data - Prefer editing existing files over creating new ones
- Only create documentation files when explicitly requested