Skip to content

Instantly share code, notes, and snippets.

@iamdejan
Last active March 8, 2026 05:20
Show Gist options
  • Select an option

  • Save iamdejan/59de351a9ea6e9aa235ea4862501256a to your computer and use it in GitHub Desktop.

Select an option

Save iamdejan/59de351a9ea6e9aa235ea4862501256a to your computer and use it in GitHub Desktop.
Kilo Code rules for Pixi-Rust project

Code Generation

Hi Kilo Code agent! Whatever model you are using, make sure you adhere to the guide on this file to generate the code.

Rules of engagement

  1. You're allowed to create functions, structs and impl blocks to generate the code.
  2. With the exception of import statements and Cargo macros (allow and deny), explain the flow of the program using comments. Make sure that you write not only what the program is doing, but why. It will help me to judge your work.
  3. You have to add Rustdoc. The Rustdoc should contain what is the function for (basically the description), a brief summary of the steps, and input and output parameters. If your function has the ability to throw panic, please state it in the Rustdoc as well.
  4. You're not allowed to add #[allow(dead_code)].

Code Validation

Hi Kilo Code agent! Whatever model you are using, make sure you validate the code you generated.

Steps to Validate

Run these commands in sequence:

  1. pixi run fmt: format your code. This ensures that the code written by human and by you (coding agent) are consistent, following the style that Rust has provided.
  2. pixi run lint: ensure no linter errors.
  3. pixi run lint-fix: if there is any linter error, fix it with this command.
  4. pixi run lint: recheck again, maybe there are linter errors that need manual fix.
  5. pixi run test: build the code, then run all unit tests. This ensures that the code you generate pass all the unit tests.
[workspace]
authors = ["Your Name"]
channels = ["conda-forge"]
name = ""
platforms = ""
version = "0.1.0"
[tasks]
build = "cargo build"
start = "cargo run"
clean = "cargo clean"
test = "cargo test"
fmt = "cargo fmt"
lint = { cmd = "cargo clippy", depends-on = ["fmt"] }
lint-ci = { cmd = "cargo clippy" } # only for CI/CD
lint-fix = { cmd = "cargo clippy --fix --allow-dirty", depends-on = ["fmt"] }
doc = "cargo doc"
doc-open = "cargo doc --open"
[dependencies]
rust = ">=1.93.1,<1.94"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment