usage-rules

Using Usage Rules

⭐2stars🔀0forks📁View on GitHub🕐Updated Oct 21, 2025

When & Why to Use This Skill

The Usage Rules skill is a specialized developer utility designed to streamline documentation lookup and compliance for Elixir projects. It enables AI agents and developers to search through module documentation, function signatures, and specific package usage rules directly via Mix tasks, ensuring that code implementation aligns with authoritative library standards and author-defined best practices.

Use Cases

  • Case 1: Quickly retrieving detailed function documentation and arity (e.g., Enum.zip/1) to ensure accurate code generation and prevent syntax errors.
  • Case 2: Searching across all project dependencies for specific keywords or implementation patterns, such as 'making requests' within the Req library.
  • Case 3: Consulting package-specific usage rules before performing complex integrations to ensure the AI agent follows the exact guidelines provided by the library authors.
  • Case 4: Using title-based searches to rapidly locate specific modules or functions within a large codebase or extensive dependency list.
nameusage-rules
descriptionUsing 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