Agent Guidelines
Universal guidelines for AI agents and developers. This file is used verbatim across multiple projects.
Branches
- Work in feature branches, never directly on
mainormaster - Use descriptive names (e.g.,
feature/add-login,fix/memory-leak)
Pull Requests
- Use
gh pr create --title "Your title" --body "Description"to open PRs - PR titles should follow the same Conventional Commits format as commit messages (see below)
- Link related issues when applicable
Commits
Follow Conventional Commits:
<type>[optional scope]: <description>
Types: feat, fix, docs, style, refactor, perf, test, build, ci, chore
Examples:
feat: add user authentication
fix(auth): resolve null pointer in login
docs: update installation guide
Design Guidelines
Pinned Dependencies
Pinning dependencies is vital for reproducible builds and reducing bit rot.
Examples:
- Using Nix for reproducible environments
- Pinning the exact channel in
rust-toolchain.toml - Pinning GitHub Actions runners (e.g.,
ubuntu-24.04instead ofubuntu-latest) - Pinning CVE databases (used by tools like
cargo-audit) - Committing lock files (e.g.,
package-lock.json,Cargo.lock)
Automatic Linting
Enforced linting vastly improves the quality, readability, and conformity of code. Linters should always be used and strictly enforced in CI. If a language has tooling for static analysis, it should be used.
Examples:
- Use
shellcheckfor shell scripts - Use
statixfor Nix files - Use
cargo clippyfor Rust files - Use
hlintfor Haskell files - Use
markdownlintfor Markdown files - Use
yamllintfor YAML files - Use
actionlintfor GitHub Actions workflow files - Use
commitlintfor commit messages
Code Formatting
Consistent code formatting improves readability and reduces friction during code reviews. Formatters should be enforced in CI alongside linters.
Examples:
- Use
alejandrafor Nix files - Use
rustfmtfor Rust files - Use
leptosfmtfor Leptos view! macros - Use
prettierfor JavaScript/TypeScript/JSON/Markdown files - Use
shfmtfor shell scripts
Secure by Design
- Never build SQL with naive string interpolation—always use parameterized queries.
- Run CVE scanners (e.g.,
cargo audit) with pinned CVE databases that auto-update at least monthly. - Validate inputs on the server; client-side checks are only for UX and must not be relied on for security.
- Keep passwords, tokens, and secrets out of git entirely (including private repos); manage them with dedicated secret-management systems.