Use the docs with AI
Give AI coding agents the Better IAM docs through llms.txt, per-page Markdown, the docs MCP server, an installable agent skill, and ready-made prompts.
AI coding agents write better Better IAM code when they read the real reference instead of guessing method names. This site offers the same content to tools as it does to people, in five forms: a plain-text index of every page, a Markdown copy of every page, an MCP server an agent can query while it works, an installable agent skill with the rules for writing Better IAM code, and prompts you can paste into any assistant.
Use this section to choose the form that fits your tool, then follow its page.
At a glance
| Resource | Address | Use it for | Details |
|---|---|---|---|
| Index | /llms.txt | Letting an agent find the right page: agent instructions, then every page grouped by sidebar section with its Markdown URL and description | llms.txt |
| Full text | /llms-full.txt | Loading every page into one long context window | llms.txt |
| Page Markdown | /docs/<page>.md, or any docs URL with Accept: text/markdown | Reading or quoting one page exactly | llms.txt |
| MCP server | /api/mcp | Searching pages and looking up API methods, exports, and error codes during a coding session | Docs MCP server |
| Agent skill | /skills/better-iam/SKILL.md | Teaching an agent the setup order, call shapes, and pitfalls before it writes code | Agent skills |
| Prompts | Copy from the page | Starting common tasks and adding Better IAM rules to AGENTS.md | Prompts and AGENTS.md |
The public site is https://better-iam.com. When you run the docs locally with pnpm --filter @better-iam/docs dev,
every address above is served from http://localhost:4000 instead.
Connect an assistant with MCP
The Model Context Protocol lets an assistant call tools while it works. This site
serves an MCP endpoint at /api/mcp (Streamable HTTP, read-only, no sign-in) with six tools:
| Tool | What it does |
|---|---|
search | Full-text search over every page, the same index as the search dialog. |
list_pages | Lists every page with its URL and one-line description. |
get_page | Returns one page as Markdown, by URL (for example /docs/authorization/policies). |
lookup_api_method | Returns the signature, HTTP route, permission, errors, and behaviour of one server API method, for example groups.addMember. |
lookup_export | Explains a function, hook, component, class, or constant a package exports, for example useSession or @better-iam/core evaluatePolicy, with its parameters and every entry point that exports it. |
lookup_error_code | Explains an IamError code (for example ACCESS_DENIED): what it means, why it happens, and how to handle it. |
claude mcp add --transport http better-iam-docs https://better-iam.com/api/mcpDocs MCP server covers Claude Desktop, project-wide configuration, testing the connection, and each tool's input and output.
Give a model the whole site
When a tool cannot call MCP, point it at the plain-text files:
| URL | Content | Use it for |
|---|---|---|
/llms.txt | Instructions for agents, then every page's title, Markdown URL, and description, grouped by sidebar section | Letting a model pick which pages to read |
/llms-full.txt | Every page as Markdown in one file | Loading everything into a long context window |
/docs/<page>.md | One page as Markdown | Quoting a single page precisely |
Any docs URL also returns Markdown when the request prefers it (Accept: text/markdown), so agents that fetch pages
get Markdown without special URLs:
curl -H 'Accept: text/markdown' https://better-iam.com/docs/quickstart
curl https://better-iam.com/docs/quickstart.mdSee llms.txt for what each file contains and how an agent should use them.
Install the agent skill
An agent skill is a Markdown file that an agent loads when a task matches its description. The Better IAM skill holds the setup order, the three method shapes, the authorization rules, the common error codes, and the pitfalls that most often produce wrong code, with links to the Markdown pages to read next. In Claude Code, install it for one project with:
mkdir -p .claude/skills/better-iam
curl -fsSL https://better-iam.com/skills/better-iam/SKILL.md -o .claude/skills/better-iam/SKILL.mdSee Agent skills for other agents and for writing a project skill of your own.
Page actions
Every docs page has two controls under its title:
- Copy Markdown copies the page's Markdown to the clipboard, ready to paste into a chat.
- Open offers View as Markdown, Open in GitHub (the page's source file), and Open in Scira AI,
Open in ChatGPT, Open in Claude, and Open in Cursor, which start a chat with the prompt "Read
<page URL>, I want to ask questions about it."
Both use the same Markdown as /docs/<page>.md.
Keep answers accurate
The reference pages and the MCP lookup tools are generated from the code (method names, signatures, routes, and
error codes) with hand-written explanations on top, so they match the version of Better IAM these docs were built
from. When an assistant's answer disagrees with your installed version, trust the TypeScript types in your editor:
every server method is typed end to end from the betterIam() instance.
Three habits keep generated code correct:
- Ask the agent to look up every
iam.apicall it writes (lookup_api_method, or the page under API reference) instead of recalling it. - Ask it to cite the docs page it used, so you can check the claim.
- Run the TypeScript compiler on the result: an invented method or option fails to type-check.
Next steps
What the index and full-text files contain, and how agents should read them.
Docs MCP serverConnect Claude Code, Claude Desktop, Cursor, or VS Code, and use each tool.
Agent skillsInstall the Better IAM skill and write one for your own project.
Prompts and AGENTS.mdCopyable prompts for common tasks and a rules block for your repository.
Better IAM is created by Sean Filimon
Last updated
Security model
Better IAM's trust boundaries, root authority and delegation, authentication guarantees, external identity rules, and what stays with operators.
llms.txt
What /llms.txt, /llms-full.txt, and the per-page Markdown URLs of the Better IAM docs contain, and how AI agents should use them to find, read, and cite pages.