|
1 | 1 | ## LLM Rules to follow |
2 | | -- For tests, set the env var `DATABASE_URL=postgresql://localhost/tamanu_meta`. |
3 | | -- NEVER hardcode database credentials. Always use the environment variable or existing client. |
4 | 2 | - When adding or changing features, or when fixing bugs, add tests whenever possible. |
5 | 3 | - Never write documentation files or readmes. |
6 | 4 | - Always run `cargo clippy` and `cargo fmt` before committing changes. |
|
12 | 10 | - Prefer using small dependencies instead of reimplementing the wheel. Ask the user to pick a dependency if there is no obvious choice. |
13 | 11 | - Use `--no-pager` with `git log`, `git diff`, etc commands. The option goes before the subcommand, e.g. `git --no-pager log`. NEVER use any interactive commands, including commands that require an editor. You can't use those and they'll just block you. |
14 | 12 | - Imports: merge them and group them by std, then third-party/workspace, then local (crate, super, self). |
| 13 | +- `use` statements always go before `mod` statements. |
15 | 14 | - Ask the user instead of making an assumption if there's a major detail missing from instructions that could affect code quality or implementation design. |
16 | | -- For tests, set the env var `DATABASE_URL=postgresql://localhost/tamanu_meta`. ENSURE YOU DO THIS INSTEAD OF SKIPPING DATABASE TESTS. |
17 | | -- When writing parsers, unless very trivial, implement them using winnow or chumsky. |
| 15 | +- When writing parsers, unless very trivial, implement them using winnow. |
18 | 16 | - Use the newer `foo.rs` / `foo/sub.rs` style of modules. |
19 | | -- `use` statements always go before `mod` statements. |
20 | 17 | - ALWAYS use the edit tool to edit or write file, NEVER use "cat >> EOF". YOU WILL LOSE DATA. |
21 | 18 | - Never write long summaries at the end of responses. Maximum 50 words if absolutely necessary. |
22 | 19 | - To silence a warning, use `#[expect(..., reason = "...")]` instead of `#[allow(...)]`. |
23 | | -- When changing Windows-specific code, run `cargo check` with a Windows GNU target (unless currently running on Windows). |
24 | 20 | <!-- end rules --> |
0 commit comments