usage-rules
Using Usage Rules
When & Why to Use This Skill
The Usage Rules skill is a specialized developer tool designed for Elixir environments that enables AI agents to access and search comprehensive package documentation and author-defined guidelines. By leveraging custom Mix tasks, it allows for precise lookups of modules, functions, and arity, ensuring that development actions are strictly aligned with official documentation and best practices.
Use Cases
- Case 1: Retrieving specific function signatures and documentation for Elixir modules (e.g., Enum.zip/1) to ensure correct implementation.
- Case 2: Searching across all project dependencies for multi-word queries to find relevant library features or configuration examples.
- Case 3: Consulting author-provided usage rules before performing destructive actions or complex integrations to maintain system stability.
| name | usage-rules |
|---|---|
| description | Using Usage Rules |
Using Usage Rules
Many packages have usage rules, which you should thoroughly consult before taking any action. These usage rules contain guidelines and rules directly from the package authors. They are your best source of knowledge for making decisions.
Modules & functions in the current app and dependencies
When looking for docs for modules & functions that are dependencies of the current project,
or for Elixir itself, use mix usage_rules.docs
# Search a whole module
mix usage_rules.docs Enum
# Search a specific function
mix usage_rules.docs Enum.zip
# Search a specific function & arity
mix usage_rules.docs Enum.zip/1
Searching Documentation
You should also consult the documentation of any tools you are using, early and often. The best
way to accomplish this is to use the usage_rules.search_docs mix task. Once you have
found what you are looking for, use the links in the search results to get more detail. For example:
# Search docs for all packages in the current application, including Elixir
mix usage_rules.search_docs Enum.zip
# Search docs for specific packages
mix usage_rules.search_docs Req.get -p req
# Search docs for multi-word queries
mix usage_rules.search_docs "making requests" -p req
# Search only in titles (useful for finding specific functions/modules)
mix usage_rules.search_docs "Enum.zip" --query-by title