From d84cdc55abbd86f08739b4b1345fb9f15e0f4cbe Mon Sep 17 00:00:00 2001 From: Stephen Waits Date: Tue, 19 Aug 2025 13:53:24 -0600 Subject: [PATCH] initialize Claude --- CLAUDE.md | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..5779071 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,44 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Development Commands + +- **Build project**: `cargo build` +- **Build release**: `cargo build --release` +- **Run locally**: `cargo run -- ` (e.g., `cargo run -- add "test item"`) +- **Run tests**: `cargo test` +- **Check code**: `cargo check` +- **Format code**: `cargo fmt` +- **Lint code**: `cargo clippy` +- **Install from source**: `cargo build --release && cp target/release/ldr ~/.local/bin/` + +## Project Architecture + +LDR is a Rust CLI productivity application implementing the "append-and-review" note system. The architecture follows a clean separation of concerns: + +### Core Structure +- **main.rs**: Entry point with CLI definition using `clap`. Handles XDG-compliant data directory setup (`~/.local/share/ldr/`) for `note.txt` and `archive.txt` files +- **commands.rs**: Command implementations with terminal I/O, file operations, and colored output using `termion` +- **content.rs**: Pure functions for content manipulation without side effects - handles all core logic for text processing +- **input.rs**: Raw keyboard input handling for interactive review mode, processes ANSI escape sequences for arrow keys + +### Key Design Patterns +- **Separation of pure functions**: Core logic in `content.rs` is stateless and easily testable +- **XDG compliance**: Uses `xdg` crate for proper data directory handling +- **Terminal UI**: Interactive review mode with keyboard navigation and colored output +- **File-based storage**: Simple text files for persistence (`note.txt` for active items, `archive.txt` for completed) + +### Data Flow +1. CLI parsing extracts subcommands and arguments +2. XDG directories are resolved for data files +3. Commands delegate to pure functions in `content.rs` for logic +4. File I/O operations handle persistence +5. Terminal output provides user feedback with colors + +### Interactive Review Mode +The `scan` command provides a sophisticated interactive interface: +- Arrow key navigation with undo functionality +- Real-time state management for prioritize/archive/skip actions +- Full-screen terminal interface with progress tracking +- History system supporting multi-level undo operations \ No newline at end of file