diff --git a/CLAUDE.md b/CLAUDE.md index 5de7524..c6459de 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -141,6 +141,37 @@ When developing new features, always add corresponding tests: The goal is to maintain our near-100% coverage as the codebase grows, so future refactoring and changes can be made with confidence! +## Quality Assurance + +Before committing any changes, **always run the full test suite**: + +```bash +./check-all.sh +``` + +This script runs all checks in the correct order: + +1. Frontend linting (ESLint) +2. Frontend formatting (Prettier) +3. Frontend type checking (svelte-check) +4. Frontend tests with coverage (Vitest) +5. Backend linting (Clippy with strict rules) +6. Backend tests with coverage (cargo test + llvm-cov) + +**Important**: The script requires Node.js and Rust toolchains to be available: + +- **Node.js tools** (pnpm, npm): Source nvm first if needed: `source ~/.nvm/nvm.sh` +- **Rust tools** (cargo, clippy): Should be in PATH via `~/.cargo/bin/` + +If `check-all.sh` reports any failures: + +1. Read the error messages carefully - they usually explain what needs fixing +2. Fix the issues (linting errors, test failures, etc.) +3. Run `check-all.sh` again to verify the fixes +4. Only commit once all checks pass ✨ + +**Never commit code that doesn't pass `check-all.sh`** - this ensures code quality and prevents broken builds! + ## Project Context Hikari Desktop is a Tauri-based desktop application that wraps Claude Code with a visual anime character (Hikari) who appears on screen. This is a personal project where Hikari can sign her work and act as herself! diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 1be5dcd..d7a39e8 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -1636,7 +1636,7 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hikari-desktop" -version = "1.4.0" +version = "1.5.0" dependencies = [ "chrono", "dirs 5.0.1", diff --git a/src-tauri/src/wsl_bridge.rs b/src-tauri/src/wsl_bridge.rs index 1c18302..1e6b1dc 100644 --- a/src-tauri/src/wsl_bridge.rs +++ b/src-tauri/src/wsl_bridge.rs @@ -129,6 +129,11 @@ impl WslBridge { return Err("Process already running".to_string()); } + // Check if Claude binary is installed before attempting to start + if Command::new("which").arg("claude").output().ok().is_none_or(|output| !output.status.success()) { + return Err("Claude Code is not installed. Please install it using:\n\ncurl -fsSL https://claude.ai/install.sh | bash".to_string()); + } + // Load saved achievements and stats when starting a new session let app_clone = app.clone(); let stats = self.stats.clone(); @@ -1868,6 +1873,22 @@ mod tests { assert!(!bridge.is_running()); } + #[test] + fn test_claude_binary_check_command_structure() { + // Test that we're using the correct command to check for Claude binary + let output = Command::new("which").arg("claude").output(); + + // The command should execute successfully (even if claude is not found) + // We're just verifying the command structure is valid + assert!(output.is_ok(), "which command should execute without error"); + + // Verify the check logic returns a boolean + // This is the same logic used in start() to check if claude is installed + let _result = output.ok().is_none_or(|o| !o.status.success()); + // If claude is not installed, _result will be true (show error) + // If claude is installed, _result will be false (proceed with connection) + } + #[test] fn test_create_shared_bridge_manager() { use crate::bridge_manager::create_shared_bridge_manager;