1.8 KiB
1.8 KiB
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Git
Always stage newly created files that permanently belong to the project with git add <file>.
Commands
./gradlew run # Run the app
./gradlew compileKotlin # Compile only
./gradlew packageDmg # Build macOS DMG
Architecture
AnyTask is a Kotlin/Compose desktop app that runs in the background and shows a task creation window via a global hotkey (Ctrl+Shift+Space).
Components
Main.kt— Entry point. Setsapple.awt.UIElement=true(no dock icon), starts the Composeapplication {}, sets up system tray and HotkeyManager.hotkey/HotkeyManager.kt— JNativeHook wrapper. Registers Ctrl+Shift+Space as a system-wide hotkey and dispatches the callback on the AWT EDT.ui/TaskWindow.kt— Compose UI with a form (title, details). Escape closes, ⌘↵ creates.api/AnyTypeApi.kt— Ktor HTTP client for the local AnyType API (localhost:31009). Currently a skeleton — API details still need to be verified.
Stack
- Kotlin 2.1.0 / Compose Multiplatform 1.7.1
- JNativeHook 2.2.2 (global hotkeys)
- Ktor 3.0.0 + kotlinx.serialization (AnyType API)
- Gradle 9.2.1
Code Style
- One class per file — file name matches the class name.
- No wildcard imports (
import foo.*). - Code, comments, and documentation in English.
macOS Notes
- Accessibility permission for JNativeHook: System Settings → Privacy & Security → Accessibility → add the app. Without this permission the global hotkey will not work.
- The tray icon appears in the menu bar (no dock icon, since
apple.awt.UIElement=true).
AnyType API
The local AnyType API runs via anytype-heart on http://localhost:31007. apiKey and spaceId are configured via anytask.yaml.