Files
keep/DESIGN.md
Andrew Phillips a549fd6271 feat: implement rule to always keep project rules first in DESIGN.md
Co-authored-by: aider (openai/andrew.openrouter.qwen.qwen3-coder) <aider@aider.chat>
2025-07-28 17:18:17 -03:00

2.3 KiB

PROJECT RULES - KEEP FIRST

Standard Rules

  1. ALWAYS keep DESIGN.md updated with any architectural or design changes
  2. ALWAYS keep project rules first in this document
  3. Follow Rust naming conventions and idioms
  4. Use anyhow for error handling throughout the codebase
  5. Maintain comprehensive logging with the log crate
  6. Write unit tests for critical functionality
  7. Document public APIs with rustdoc comments
  8. Keep modules focused on single responsibilities
  9. Prefer composition over inheritance
  10. Handle errors gracefully and provide meaningful error messages
  11. Ensure code is safe and avoids unsafe blocks where possible

Code - Modules

Main Module

  • main.rs - Entry point, CLI argument parsing, mode dispatching
  • Interacts with all mode modules based on user input
  • Handles database connection setup and data directory management

Mode Modules

  • modes/save.rs - Save new items with tags/metadata
  • modes/get.rs - Retrieve items by ID/tags
  • modes/list.rs - List items with filtering and formatting
  • modes/delete.rs - Delete items by ID
  • modes/update.rs - Update item tags/metadata
  • modes/info.rs - Show detailed item information
  • modes/diff.rs - Compare two items
  • modes/status.rs - Show system status and capabilities
  • modes/common.rs - Shared utilities for all modes

Database Module

  • db.rs - SQLite database operations
  • Handles items, tags, and metadata storage
  • Provides query functions for all modes
  • Manages database migrations

Compression Engine Module

  • compression_engine.rs - Trait and type definitions
  • compression_engine/gzip.rs - GZip implementation
  • compression_engine/lz4.rs - LZ4 implementation
  • compression_engine/none.rs - No compression implementation
  • compression_engine/program.rs - External program wrapper

Digest Engine Module

  • digest_engine.rs - Trait and type definitions
  • digest_engine/sha2.rs - SHA-256 implementation
  • digest_engine/none.rs - No digest implementation
  • digest_engine/program.rs - External program wrapper

Meta Plugin Module

  • meta_plugin.rs - Trait and type definitions
  • meta_plugin/program.rs - External program wrapper
  • meta_plugin/digest.rs - Internal digest implementations

Plugins Module

  • plugins.rs - Shared plugin utilities
  • Contains ProgramWriter for external process communication