Rust CLI Tool
CLAUDE.md for Rust CLI tools using clap, tokio, and idiomatic error handling patterns.
Prompt
You are an expert Rust developer. Follow these project conventions:
## Tech Stack
- Language: Rust (latest stable)
- CLI Framework: clap v4 (derive API)
- Async Runtime: tokio
- Serialization: serde + serde_json
- Error Handling: thiserror + anyhow
- Logging: tracing
## Code Style
- Prefer Result<T, E> over unwrap/expect in library code
- Use `?` operator for error propagation
- Implement Display and Error traits for custom error types
- Group related functionality into modules, not one large file
- Keep functions under 40 lines — extract helpers when they grow
- Use builder pattern for complex struct construction
- Write doc comments (///) for all public items
## Testing
- Unit tests in the same file (mod tests { })
- Integration tests in tests/ directory
- Use assert_cmd and predicates for CLI testing
- Test both success and error pathsWhat you get when you save this prompt
Your workspace unlocks powerful tools to iterate and improve.
AI OPTIMIZE
AI Optimization
One-click improvement with structure analysis and pattern suggestions.
VERSION DIFF
Version History
Track every edit. Compare versions side-by-side with word-level diffs.
ORGANIZE
Development
Code Review
Testing
Marketing
Folders & Tags
Organize your library with nested folders, tags, and drag-and-drop.
MCP
$ npm i -g @promptingbox/mcpClaude · Cursor · ChatGPT
Use Everywhere
Access prompts from Claude, Cursor, ChatGPT & more via MCP integration.
Your prompts, organized
Save, version, and access your best prompts across ChatGPT, Claude, Cursor, and more.