home / skills / michalvavra / agents / search-hexdocs
/skills/search-hexdocs
This skill helps you search Hexdocs documentation for Elixir and Erlang packages, returning results with optional package filters and JSON output.
npx playbooks add skill michalvavra/agents --skill search-hexdocsReview the files below or copy the command above to add this skill to your agents.
---
name: search-hexdocs
description: Search Hex package documentation for Elixir/Erlang.
compatibility: Requires Node.js 18+. Run `npm install` in {baseDir}/scripts first.
---
# Search hexdocs
Search [hexdocs.pm](https://hexdocs.pm) documentation.
## Usage
```bash
{baseDir}/scripts/hexdocs.js <QUERY> [OPTIONS]
```
## Examples
```bash
# Search all packages
{baseDir}/scripts/hexdocs.js "GenServer callbacks"
# Filter by package
{baseDir}/scripts/hexdocs.js "Ecto.Query" --packages ecto
# Multiple packages
{baseDir}/scripts/hexdocs.js "LiveView hooks" --packages phoenix_live_view,phoenix
# Limit results
{baseDir}/scripts/hexdocs.js "plug conn" --limit 5
# JSON output
{baseDir}/scripts/hexdocs.js "json encode" --packages jason --json
```
## Output Format
```
Results: 42 (showing 10)
<result index="0" package="phoenix" ref="Phoenix.Controller.html#json/2" title="json/2">
Sends JSON response...
</result>
```
This skill lets an AI search HexDocs package documentation for Elixir and Erlang projects. It runs a command-line query against hexdocs.pm and returns matching documentation references and snippets. Results can be filtered by package, limited in number, and emitted as JSON for programmatic consumption.
You provide a text query and optional flags; the script crawls indexed HexDocs pages and scores matches by relevance. It supports package filters, result limits, and a JSON output mode. The output lists results with package, reference, title, and a short excerpt so you can quickly locate the exact API or guide.
Can I restrict search to multiple packages?
Yes. Pass a comma-separated list with --packages to limit results to specific packages.
How do I get machine-readable results?
Use the --json flag to output results as JSON, making it easy to parse and consume.