Ugh
This commit is contained in:
78
AGENT.md
78
AGENT.md
@@ -2,25 +2,53 @@
|
||||
|
||||
**IMPORTANT:** Prefer to use the `write_file` tool if the edit is for the majority of a file, or if you are correcting previous problems made edits from other tools.
|
||||
|
||||
## Commands
|
||||
## Tools
|
||||
|
||||
**IMPORTANT:** Always export `TERM=dumb`.
|
||||
**IMPORTANT**: Be very careful when quoting text in tool calls to add the right amount of escaping.
|
||||
|
||||
### `write_file`
|
||||
|
||||
When editing files use the `write_file` tool to output the complete version of the corrected file.
|
||||
**IMPORTANT**: You must provide the whole file to `write_file`, even the unchanged parts.
|
||||
|
||||
## Build/Test Commands
|
||||
|
||||
**IMPORTANT**: Do not run application, start the web server, or the trunk server.
|
||||
**IMPORTANT:** The cargo command cannot be ran in parallel.
|
||||
|
||||
### Build
|
||||
- Build: `TERM=dumb cargo build`
|
||||
- Build release: `TERM=dumb cargo build --release`
|
||||
```bash
|
||||
# Check project
|
||||
TERM=dumb cargo check
|
||||
|
||||
### Test
|
||||
- Run all tests: `TERM=dumb cargo test`
|
||||
- Run specific test: `TERM=dumb cargo test TEST_NAME`
|
||||
- Run tests with output: `TERM=dumb cargo test -- --nocapture`
|
||||
# Build project
|
||||
TERM=dumb cargo build
|
||||
|
||||
### Lint/Format Commands
|
||||
- Check formatting: `TERM=dumb cargo fmt --check`
|
||||
- Format code: `TERM=dumb cargo fmt`
|
||||
- Lint: `TERM=dumb cargo clippy`
|
||||
- Lint with errors: `TERM=dumb cargo clippy -- -D warnings`
|
||||
# DO NOT RUN RUN APPLICATION (native)
|
||||
# TERM=dumb cargo run
|
||||
|
||||
# Run all tests
|
||||
TERM=dumb cargo test
|
||||
|
||||
# Run specific test (by name substring)
|
||||
TERM=dumb cargo test test_function_name
|
||||
|
||||
# Run specific test with verbose output
|
||||
TERM=dumb cargo test test_function_name -- --nocapture
|
||||
|
||||
# Check formatting
|
||||
TERM=dumb cargo fmt --check
|
||||
|
||||
# Apply formatting
|
||||
TERM=dumb cargo fmt
|
||||
|
||||
# Lint with clippy
|
||||
TERM=dumb cargo clippy -- -D warnings
|
||||
|
||||
# Build for release
|
||||
TERM=dumb cargo build --release
|
||||
```
|
||||
|
||||
Prefix commands with `TERM=dumb` for consistent output.
|
||||
|
||||
## Code Style Guidelines
|
||||
|
||||
@@ -28,29 +56,9 @@
|
||||
- Group imports in order: standard library, external crates, local modules
|
||||
- Use explicit imports over glob imports (`use std::fs::File;` not `use std::fs::*;`)
|
||||
|
||||
### Formatting
|
||||
- Use rustfmt (configured via rustfmt.toml if exists)
|
||||
- Max line length: 100 characters
|
||||
- Indent with 4 spaces
|
||||
|
||||
### Types
|
||||
- Prefer explicit types in public API
|
||||
- Use `&str` for string literals, `String` for owned strings
|
||||
- Use `Option<T>` for optional values, `Result<T, E>` for error handling
|
||||
|
||||
### Naming Conventions
|
||||
- Use snake_case for variables and functions
|
||||
- Use PascalCase for types and traits
|
||||
- Use UPPER_SNAKE_CASE for constants and statics
|
||||
|
||||
### Error Handling
|
||||
- Use `anyhow::Result` for most error handling
|
||||
- Use `anyhow::Context` to add context to errors
|
||||
- Avoid `unwrap()` in production code
|
||||
|
||||
### Documentation
|
||||
- Document all public APIs with rustdoc
|
||||
- Use examples in documentation when helpful
|
||||
- Use examples in documentation only when helpful
|
||||
|
||||
## Procedures
|
||||
|
||||
|
||||
Reference in New Issue
Block a user