This repository is a template with sensible defaults for building Tauri React apps.
- Read @docs/tasks.md for task management
- Review
docs/developer/architecture-guide.mdfor high-level patterns - Check
docs/developer/README.mdfor the full documentation index - Check git status and project structure
CRITICAL: Follow these strictly:
- Use npm only: This project uses
npm, NOTpnpm. Always usenpm install,npm run, etc. - Read Before Editing: Always read files first to understand context
- Follow Established Patterns: Use patterns from this file and
docs/developer - Senior Architect Mindset: Consider performance, maintainability, testability
- Batch Operations: Use multiple tool calls in single responses
- Match Code Style: Follow existing formatting and patterns
- Test Coverage: Write comprehensive tests for business logic
- Quality Gates: Run
npm run check:allafter significant changes - No Dev Server: Ask user to run and report back
- No Unsolicited Commits: Only when explicitly requested
- Documentation: Update relevant
docs/developer/files for new patterns - Removing files: Always use
rm -f
CRITICAL: Use Tauri v2 docs only. Always use modern Rust formatting: format!("{variable}")
useState (component) → Zustand (global UI) → TanStack Query (persistent data)
Decision: Is data needed across components? → Does it persist between sessions?
// ✅ GOOD: Selector syntax - only re-renders when specific value changes
const leftSidebarVisible = useUIStore(state => state.leftSidebarVisible)
// ❌ BAD: Destructuring causes render cascades (caught by ast-grep)
const { leftSidebarVisible } = useUIStore()
// ✅ GOOD: Use getState() in callbacks for current state
const handleAction = () => {
const { data, setData } = useStore.getState()
setData(newData)
}- React Compiler: Handles memoization automatically - no manual
useMemo/useCallbackneeded - ast-grep: Enforces architecture patterns (e.g., no Zustand destructuring). See
docs/developer/static-analysis.md - Knip/jscpd: Periodic cleanup tools. Use
/cleanupcommand (Claude Code)
- Rust → React:
app.emit("event-name", data)→listen("event-name", handler) - React → Rust: Use typed commands from
@/lib/tauri-bindings(tauri-specta) - Commands: All actions flow through centralized command system
// ✅ GOOD: Type-safe commands with Result handling
import { commands } from '@/lib/tauri-bindings'
const result = await commands.loadPreferences()
if (result.status === 'ok') {
console.log(result.data.theme)
}
// ❌ BAD: String-based invoke (no type safety)
const prefs = await invoke('load_preferences')Adding commands: See docs/developer/tauri-commands.md
// ✅ GOOD: Use useTranslation hook in React components
import { useTranslation } from 'react-i18next'
function MyComponent() {
const { t } = useTranslation()
return <h1>{t('myFeature.title')}</h1>
}
// ✅ GOOD: Non-React contexts - bind for many calls, or use directly
import i18n from '@/i18n/config'
const t = i18n.t.bind(i18n) // Bind once for many translations
i18n.t('key') // Or call directly for occasional use- Translations: All strings in
/locales/*.json - RTL Support: Use CSS logical properties (
text-startnottext-left) - Adding strings: See
docs/developer/i18n-patterns.md
- Context7 First: Always use Context7 for framework docs before WebSearch
- Version Requirements: Tauri v2.x, shadcn/ui v4.x, Tailwind v4.x, React 19.x, Zustand v5.x, Vite v7.x, Vitest v4.x
For complete patterns and detailed guidance, see docs/developer/README.md.
Key documents:
architecture-guide.md- Mental models, security, anti-patternsstate-management.md- State onion, getState() pattern detailstauri-commands.md- Adding new Rust commandsstatic-analysis.md- All linting tools and quality gates
These are specific to Claude Code but documented here for context.
/check- Check work against architecture, runnpm run check:all, suggest commit message/cleanup- Run static analysis (knip, jscpd, check:all), get structured recommendations/init- One-time template initialization
Task-focused agents that leverage separate context for focused work:
plan-checker- Validate implementation plans against documented architecturedocs-reviewer- Review developer docs for accuracy and codebase consistencyuserguide-reviewer- Review user guide against actual system featurescleanup-analyzer- Analyze static analysis output (used by/cleanup)