Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# AI Agent Guidelines for Amber CLI

Welcome, fellow agents! When working on the `amber_cli` project, please adhere to the following principles to ensure high-quality and safe contributions:

- **This is Crystal, not Ruby.** Do not use Ruby-isms or dynamic meta-programming hacks. Respect the type system and compiled nature of Crystal.
- **Always run `ameba`** to verify linting and formatting before committing. Code should conform to the standard style.
- **Always run `crystal spec`** to ensure tests pass. No PR should break the test suite.
- **Avoid unsafe `.not_nil!` assertions.** Use proper type narrowing (e.g., `if let`, `.try`, `.as?`) to handle `nil` values gracefully.
- **Prefer modern Crystal 1.20 features and modern Process API (RFC 0025)** instead of `shell: true` when spawning external commands. Ensure determinism and security.
- **Do not use deprecated `yaml_mapping` or `json_mapping`.** Use `YAML::Serializable` and `JSON::Serializable` instead.

By following these rules, we maintain robust, readable, and idiomatic Crystal code. Let's build a great CLI together!