Skip to content
- Be concise, avoid repeating document changes in chat
- Focus on next actions, not recaps
- I know a lot about these topics, let me decide the direction, do not assume
- Self-explanatory code > documentation
- Elegant, readable style
- Browser defaults: Use browser defaults for styling; avoid CSS frameworks like Tailwind unless explicitly required
- Use
$state() for reactive variables in Svelte 5
- Use
onclick for event handlers in Svelte 5 (not on:click)
- Concise syntax: Use single-line conditionals and expressions when they improve readability
- Self-documenting code: Use clear naming that makes comments unnecessary
- Zero non-essential comments: Do not comment on what the code does - only explain WHY when not obvious
- Minimal comments: explain “why” not “what”/“how”
- Exports: Prefer named exports over default exports
- Flat structure: Prefer flat code structure over deeply nested functions
- Types: Prefer jsdoc, don’t obsess over typescript
- Style preferences:
- Use tabs for indentation
- Use single quotes for strings
- No bracket spacing
- No semicolons
- Use lower kebab-case for filenames
- Pass primitives directly, avoid wrapper objects around simple data
- Use literal objects directly, avoid helper functions for basic object creation
- Keep logic in one focused function, avoid splitting unless there’s clear reuse
- Pass configuration objects directly, avoid ceremonial builders
- Prefer semantic HTML over custom css classes, also for styling
- Use the right semantic HTML elements (
<section>, <article>, <figure>, etc.)
- Don’t create unnecessary container
<div>s when semantic elements exist
- Only create CSS classes when really needed
- Leverage element selectors where appropriate
- Focus on styles critical for functionality
- Domain-driven names: Method names should express domain concepts directly
- Single responsibility: One method, one responsibility, ideally pure
- Direct property access: Avoid getters/setters when direct property access works
- Minimal abstraction: Keep code paths direct and clear without unnecessary layers
- Meaningful methods: Methods should do something meaningful beyond simple delegation
- Actionable errors: Show errors in UI with clear actions for recovery
- Graceful degradation: Handle error states without breaking application flow