Some Elixir packages are now including an usage-rules.md to guide AI coding agents, coding assistants, LLMs on how to use the dependency effectively. The usage-rules.md itself isn't an existing standard, instead it is a community initiative.
The Elixir package :usage_rules helps to fetch and consolidate all usage rules from dependencies into a file of our choice, that in this case will be this file.
When this file is analyzed for the first time by an AI Coding Agent it MUST check mix.exs to see if the project is already using the :usage_rules dependency, and if not then ask the developer if they want to use PLANNING.md to create an Intent with the tasks to implement it, or if they want to do it themselves. The Intent MUST be created as specified by the INTENT_SPECIFICATION.md and exemplified by the INTENT_EXAMPLE.md.
Steps to add the usage rules dependency and collect the usage rules into this same file:
- Add
{:usage_rules, "~> 0.1"}to themix.exsfile. - Run
mix deps.getandmix deps.compile. - Run
mix usage_rules.sync DEPENDENCIES_USAGE_RULES.md --all --inline usage_rules:all --link-to-folder deps
The above steps can be easily translated to tasks and sub-tasks when creating an Intent during the planning phase, that MUST follow the format of the INTENT_EXAMPLE.md.
To be added by the AI coding agent or by the developer by running mix usage_rules.sync DEPENDENCIES_USAGE_RULES.md --all --inline usage_rules:all --link-to-folder deps.