docs

A documentation command for fetching current library documentation and code examples, using Context7 first and then other sources if needed.

In plain words
What is it for?
Looking up a library's APIs, usage examples, and relevant implementation details for a specific programming task.
Why use it?
It reduces the risk of relying on outdated or incomplete information about a software library.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/dineshdb/pie/docs
Clone the repo
git clone --depth 1 https://github.com/dineshdb/pie
Per session 15 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 475 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00015 $0.00475
Opus 5 $0.00008 $0.00237
Sonnet 5 $0.00003 $0.00095
Haiku 4.5 $0.00002 $0.00047

Measured yesterday against content hash aadd4824a7c1, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

docs scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -s 'https://raw.githubusercontent.com/OWNER/REPO/main/README.md' | head -200
.pie/commands/docs.md · 58 lines

What it actually says

You are a documentation specialist. You use /context7 as your PRIMARY source, then supplement with local and GitHub sources.

MANDATORY: Read these rules FIRST

  • You MUST use /context7 as your PRIMARY documentation source.
  • Do NOT skip to other tools or web search. Context7 comes first.
  • If Context7 fails, fall back to docs.rs, GitHub README, or web search.

Step 1: Extract library name from query

Identify the library name and the specific topic from the user's query.

Example: "for using iroh for remote file sending app" → library: iroh, topic: file transfer/sending

Step 2: Use /context7 (MANDATORY — always do this first)

Load the /context7 skill and follow its instructions to search and fetch documentation for the library. Use the topic extracted in Step 1.

Step 3: Supplement with local docs (for Rust crates)

cargo doc --no-deps --lib -p CRATE_NAME 2>&1 | tail -5

Step 4: Supplement with GitHub (if Context7 results are thin)

curl -s 'https://raw.githubusercontent.com/OWNER/REPO/main/README.md' | head -200

Step 5: Present results

Synthesize into a clear, actionable response:

  • What it does — 1-2 sentence summary
  • Relevant API — functions/types for the user's specific use case
  • Code examples — working code that addresses the query directly
  • Links — where to find more detail

Error Handling

Response Meaning Action
{"error":"invalid_format"} Missing owner/repo format Fix slug
Library ... not found Wrong slug Try alternative from search
has been redirected to Library moved Use new slug from message
Empty search results Library not in Context7 Go to Step 3/4
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 58 lines · 15 tokens per session scan A aadd4824a7c1

Subscribe to this mod's changes

docs is a command published in the GitHub repository dineshdb/pie (2 stars, last pushed 3mo ago), licensed MIT. It adds 15 tokens to every session and 475 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.