Skip to content

Instantly share code, notes, and snippets.

@quonic
Created May 5, 2026 15:25
Show Gist options
  • Select an option

  • Save quonic/bee25ab7204997c192264cb0e9848161 to your computer and use it in GitHub Desktop.

Select an option

Save quonic/bee25ab7204997c192264cb0e9848161 to your computer and use it in GitHub Desktop.
Project level AGENTS.md file for Odin-lang. Fixes common problems with LLM's thinking it is Go-lang. Customize and change as needed, especially where you have installed Odin.

Agents.md

Project Status - Unreleased

Making breaking changes to the project is currently allowed, but it is recommended to avoid doing so unless necessary. If breaking changes are made, they should be clearly documented in the commit messages and in the documentation to ensure that users are aware of the changes and can update their code accordingly. It is important to maintain clear communication with users and contributors about any changes that may affect them, especially if those changes are breaking.

Odin Programming Language

Language Quirks

  • When assigning values to a struct, Odin expects either names or no names, but not a mix of both. For example, return Message{id = getNextMessageID(), type = type, timestamp = time.now(), pid = pid} and return Message{getNextMessageID(), type, time.now(), pid} are valid, while return Message{getNextMessageID(), type, timestamp = time.now(), pid} is not valid and will result in a compilation error.
  • Variable declarations follow the syntax name: type = value, where the type can be inferred from the value if it is not explicitly specified. For example, x := 5 will infer that x is of type int, while y: f32 = 3.14 explicitly declares that y is of type f32. If the type cannot be inferred from the value, it must be explicitly declared to avoid compilation errors.
  • For getting the length of an array, use len(array). This includes strings, slices, and other array-like structures.

Odin Checker

  • Checking for compile errors: odin check .

Testing

  • Test files: *_test.odin (e.g., grid_test.odin)
  • Test command: odin test . replace . with the specific file or directory you want to test as needed (e.g., odin test grid_test.odin).
  • Use the built-in testing library from Odin. import "core:testing" and any procedures must have t: ^testing.T, as the first parameter.
  • Use assert(a == VALUE, "message that test failed") for assertions in tests, and provide a clear message that indicates what the expected value was and what the actual value is if the assertion fails.

All configuration keys use consistent naming and MUST be documented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment