Elixir programming
The Elixir skill is designed to provide comprehensive guidance on the Elixir programming language and its associated frameworks, including Phoenix, Ecto, Ash, and OTP. It aims to streamline the development process by emphasizing best practices for code structure, testing, and using modern patterns. This skill ensures that developers follow critical code style guidelines, enhancing code readability and maintainability while fostering a deeper understanding of these frameworks and behaviors.
Key features of this skill include detailed instructions on the usage of the Elixir testing framework, specific recommendations for the correct usage of the pipe operator, and best practices for LiveView components. It also emphasizes the importance of proper code testing through scratch test files, ensuring that developers can quickly test code snippets without introducing clutter or unnecessary complexity. By adhering to these guidelines, developers are able to write cleaner, more efficient Elixir code, reducing errors and enhancing overall project quality.
This skill is aimed at Elixir developers who wish to improve their coding practices and gain a better understanding of key frameworks such as Phoenix and Ecto. It is especially useful for those new to Elixir or seeking to standardize their development approach, as well as teams looking to maintain a high standard of code quality and test-driven development in their Elixir projects.
You should use a scratch test file located at `test/scratch_test.exs`. Avoid creating new files or using `mix run` or `iex` for testing. Always run tests with the command `mix test test/scratch_test.exs`.
No, it is not necessary to use the pipe operator for a single function call. Direct function calls are preferred for single operations, such as `Enum.map(list, & &1 * 2)`.
For LiveView components, always create a public wrapper function to enable compile-time validation. This function should accept component attributes, ensuring clear and validated component rendering.
No, scratch test files should be added to `.gitignore` to avoid accidental commits. They are temporary and should only be used for local testing and experimentation.
The scratch test file approach provides easy iteration on tests, automatic database rollback, clear test output, and no need for manual cleanup. It allows for quick and efficient testing without creating unnecessary clutter.
Quick Setup:
.claude/skills/Repository
barnabasJ/dotfiles