Add tool versions and update project guidelines

- Introduced `.tool-versions` file for Erlang and Elixir versions. - Updated references from "Banker" to "IbanEx" in
project guidelines.
This commit is contained in:
2025-11-29 15:34:14 -05:00
parent 7bce4f8051
commit ab78006932
3 changed files with 8 additions and 54 deletions

2
.tool-versions Normal file
View File

@@ -0,0 +1,2 @@
erlang 28.0.2
elixir 1.18.4-otp-28

View File

@@ -3,46 +3,8 @@ This is a web application written using the Phoenix web framework.
## Project guidelines
- Use `mix check` alias when you are done with all changes and fix any pending issues
- Use the already included and available `:req` (`Req`) library for HTTP requests, **avoid** `:httpoison`, `:tesla`, and `:httpc`. Req is included by default and is the preferred HTTP client for Banker
- Use the already included and available Elixir native JSON module to encode and decode JSON, **avoid** `:jason`, `:poison`, and other. JSON is a part of Elixir standard library and is the preferred JSON parser and generator for Banker
<!-- elixir-toolkit-commands--execution-start -->
## Command Execution
**🔴 CRITICAL: ALWAYS prefix mix, iex commands with environment variables:**
**For Development:**
```bash
env $(cat .dev.env | xargs) mix <COMMAND>
env $(cat .dev.env | xargs) iex -S mix
```
**For Testing:**
```bash
env $(cat .test.env | xargs) mix test
env $(cat .test.env | xargs) iex -S mix
```
**Examples:**
```bash
# Development
env $(cat .dev.env | xargs) mix test
env $(cat .dev.env | xargs) mix compile
env $(cat .dev.env | xargs) mix phx.server
# Testing
env $(cat .test.env | xargs) mix test
env $(cat .test.env | xargs) mix test test/banker/assistants/invoice_data_assistant_test.exs
env $(cat .test.env | xargs) iex -S mix
```
**NEVER run mix commands without the appropriate ENV file prefix** - will fail with missing ENV variable errors.
- Use `.dev.env` for development commands
- Use `.test.env` for test commands
<!-- elixir-toolkit-commands--execution-end -->
- Use the already included and available `:req` (`Req`) library for HTTP requests, **avoid** `:httpoison`, `:tesla`, and `:httpc`. Req is included by default and is the preferred HTTP client for IbanEx
- Use the already included and available Elixir native JSON module to encode and decode JSON, **avoid** `:jason`, `:poison`, and other. JSON is a part of Elixir standard library and is the preferred JSON parser and generator for IbanEx
<!-- tool-usage-start -->
## Tool Usage Guidelines
@@ -50,7 +12,7 @@ env $(cat .test.env | xargs) iex -S mix
<!-- tool-usage:code-start -->
### Code base analysys and semantic code search
Register project to make Tree Sitter tool available for analyzing the Banker codebase and get next posibilities:
Register project to make Tree Sitter tool available for analyzing the IbanEx codebase and get next posibilities:
- **Search codebase**: Find files, functions, or patterns
- **Understand architecture**: Explore modules, domains, resources
@@ -58,7 +20,7 @@ Register project to make Tree Sitter tool available for analyzing the Banker cod
- **Quality analysis**: Detect complexity, duplication, dependencies
- **Strategic exploration**: Understand domain structure and relationships
**Always use tree_sitter_banker tool** for:
**Always use tree_sitter_iban_ex tool** for:
1. **Code Navigation**: Extract functions, classes, modules. Find where symbols are used. Search with regex patterns. Read file contents efficiently. Get abstract syntax trees
2. **Analysis Tools**: Measure cyclomatic complexity. Find imports and dependencies. Detect code duplication. Execute tree-sitter queries
@@ -71,16 +33,6 @@ Register project to make Tree Sitter tool available for analyzing the Banker cod
- **Always use HEXDocs tool** to get and analyze **actual documentation** for Elixir, Elixir libraries and Phoenix framework
<!-- tool-usage:documentation-end -->
<!-- tool-usage:database-start -->
### Database Access
- **Use only** postgres_banker_dev tool to comunicate with development database
- **Use only** postgres_banker_test tool to comunicate with test database
- **Only in case when** postgres_banker_dev or postgres_banker_test tools is unavaliable you can get data from databases directly:
- Development database: `psql banker_dev -c "<query>"`
- Test database: `psql banker_test -c "<query>"`
- **NEVER** try do anything with production database. You are **FORBIDDEN** from execute any queries on prod environmemnt
<!-- tool-usage:database-end -->
<!-- tool-usage-end -->
<!-- guidelines-start -->
@@ -125,7 +77,7 @@ Register project to make Tree Sitter tool available for analyzing the Banker cod
- Elixir's standard library has everything necessary for date and time manipulation. Familiarize yourself with the common `Time`, `Date`, `DateTime`, and `Calendar` interfaces by accessing their documentation as necessary. **Never** install additional dependencies unless asked or for date/time parsing (which you can use the `date_time_parser` package)
- Don't use `String.to_atom/1` on user input (memory leak risk)
- Predicate function names should not start with `is_` and should end in a question mark. Names like `is_thing` should be reserved for guards
- Elixir's builtin OTP primitives like `DynamicSupervisor` and `Registry`, require names in the child spec, such as `{DynamicSupervisor, name: Banker.MyDynamicSup}`, then you can use `DynamicSupervisor.start_child(Banker.MyDynamicSup, child_spec)`
- Elixir's builtin OTP primitives like `DynamicSupervisor` and `Registry`, require names in the child spec, such as `{DynamicSupervisor, name: IbanEx.MyDynamicSup}`, then you can use `DynamicSupervisor.start_child(IbanEx.MyDynamicSup, child_spec)`
- Use `Task.async_stream(collection, callback, options)` for concurrent enumeration with back-pressure. The majority of times you will want to pass `timeout: :infinity` as option
- Elixir variables are immutable, but can be rebound, so for block expressions like `if`, `case`, `cond`, etc
you *must* bind the result of the expression to a variable if you want to use it and you CANNOT rebind the result inside the expression, ie:

View File

@@ -7,7 +7,7 @@
"dialyxir": {:hex, :dialyxir, "1.4.3", "edd0124f358f0b9e95bfe53a9fcf806d615d8f838e2202a9f430d59566b6b53b", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "bf2cfb75cd5c5006bec30141b131663299c661a864ec7fbbc72dfa557487a986"},
"doctor": {:hex, :doctor, "0.21.0", "20ef89355c67778e206225fe74913e96141c4d001cb04efdeba1a2a9704f1ab5", [:mix], [{:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}], "hexpm", "a227831daa79784eb24cdeedfa403c46a4cb7d0eab0e31232ec654314447e4e0"},
"earmark_parser": {:hex, :earmark_parser, "1.4.39", "424642f8335b05bb9eb611aa1564c148a8ee35c9c8a8bba6e129d51a3e3c6769", [:mix], [], "hexpm", "06553a88d1f1846da9ef066b87b57c6f605552cfbe40d20bd8d59cc6bde41944"},
"elixir_sense": {:git, "https://github.com/elixir-lsp/elixir_sense.git", "885a63fc917a3f3468ddcf1b0855efd77be39182", []},
"elixir_sense": {:hex, :elixir_sense, "1.0.0", "ae4313b90e5564bd8b66aaed823b5e5f586db0dbb8849b7c4b7e07698c0df7bc", [:mix], [], "hexpm", "6a3baef02859e3e1a7d6f355ad6a4fc962ec56cb0f396a8be2bd8091aaa28821"},
"erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"},
"esbuild": {:hex, :esbuild, "0.7.1", "fa0947e8c3c3c2f86c9bf7e791a0a385007ccd42b86885e8e893bdb6631f5169", [:mix], [{:castore, ">= 0.0.0", [hex: :castore, repo: "hexpm", optional: false]}], "hexpm", "66661cdf70b1378ee4dc16573fcee67750b59761b2605a0207c267ab9d19f13c"},
"ex_check": {:hex, :ex_check, "0.14.0", "d6fbe0bcc51cf38fea276f5bc2af0c9ae0a2bb059f602f8de88709421dae4f0e", [:mix], [], "hexpm", "8a602e98c66e6a4be3a639321f1f545292042f290f91fa942a285888c6868af0"},