An Elixir toolkit for the AT Protocol. hexdocs.pm/atex
elixir bluesky atproto decentralization
at main 38 lines 1.6 kB view raw view rendered
1# Agent Guidelines for atex 2 3## Commands 4 5- **Test**: `mix test` (all), `mix test test/path/to/file_test.exs` (single 6 file), `mix test test/path/to/file_test.exs:42` (single test at line) 7- **Format**: `mix format` (auto-formats all code) 8- **Lint**: `mix credo` (static analysis, TODO checks disabled) 9- **Compile**: `mix compile` 10- **Docs**: `mix docs` 11 12## Code Style 13 14- **Imports**: Use `alias` for modules (e.g., 15 `alias Atex.Config.OAuth, as: Config`), import macros sparingly 16- **Formatting**: Elixir 1.18+, auto-formatted via `.formatter.exs` with 17 `import_deps: [:typedstruct, :peri, :plug]` 18- **Naming**: snake_case for functions/variables, PascalCase for modules, 19 descriptive names (e.g., `authorization_metadata`, not `auth_meta`) 20- **Types**: Use `@type` and `@spec` for all public functions; leverage 21 TypedStruct for structs 22- **Moduledocs**: All public modules need `@moduledoc`, public functions need 23 `@doc` with examples 24 - When writing lists in documentation, use `-` as the list character. 25- **Error Handling**: Return `{:ok, result}` or `{:error, reason}` tuples; use 26 pattern matching in case statements 27- **Pattern Matching**: Prefer pattern matching over conditionals; use guards 28 when appropriate 29- **Macros**: Use `deflexicon` macro for lexicon definitions; use `defschema` 30 (from Peri) for validation schemas 31- **Tests**: Async by default (`use ExUnit.Case, async: true`), use doctests 32 where applicable 33- **Dependencies**: Core deps include Peri (validation), Req (HTTP), JOSE 34 (JWT/OAuth), TypedStruct (structs) 35 36## Important Notes 37 38- **Update CHANGELOG.md** when adding features, changes, or fixes