From c3902ff0f1b276a7c0398caf9934cb80ab805f49 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 20 Mar 2025 15:10:10 +0100 Subject: [PATCH] docs: add development guidelines in CLAUDE.md - Introduce coding standards, testing commands, and tool usage. - Outline architecture notes, style, and logging conventions. - Provide guidance on modular design and authentication protocols. --- CLAUDE.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..fe6b9f5 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,24 @@ +# Vault-Hier Development Guidelines + +## Build & Test Commands +- Build & run: `cargo build && cargo run` +- Run tests: `cargo test` (or `cargo test -- --nocapture` for verbose output) +- Run single test: `cargo test test_name -- --nocapture` +- Docker test: `./test_docker.sh` (includes vault initialization) +- Local test: `./test_local.sh` (sets up local vault) +- Lint: `cargo clippy -- -D warnings` +- Format: `cargo fmt --all` + +## Code Style Guidelines +- **Formatting**: Follow rustfmt conventions (run `cargo fmt` before committing) +- **Imports**: Group by crate (stdlib → external → internal) +- **Error Handling**: Use `anyhow` with descriptive messages; propagate with `?` or `thiserror` for actionable errors +- **Naming**: Snake case for functions/variables, CamelCase for types +- **Async**: Use Tokio for async runtime with structured task management +- **Logging**: Use `tracing` macros for structured logging (`info!`, `debug!`, `error!`, `warn!`, `trace!`) +- **Documentation**: Document public APIs with doc comments (`///`) + +## Architecture Notes +- Modular design with separate services (document, vault, API) +- Hierarchical signing with department validation +- JWT-based authentication using Vault transit backend