Dev.to
5/10/2026

I Shipped an npm Package With an AGENTS.md File — Here's Why Every Library Should Do This
Short summary
npm packages should ship AGENTS.md alongside README.md — a reference manual written explicitly for AI agents like Claude Code and Cursor to prevent API hallucination. The format includes exact prop names, type definitions, usage patterns, and common mistakes agents make. This reduces support issues, improves adoption across agent platforms, and takes just two hours to implement.
- •npm packages should include AGENTS.md — a reference manual for AI agents separate from README.md
- •Include exact APIs, common mistakes, and decision trees to prevent agent hallucination
- •Reduces GitHub issues, improves adoption in Cursor/Claude Code, minimal effort to implement
Generated with AI, which can make mistakes.
Is this a good recommendation for you?



