BetterIAM

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

ResourceAddressUse it forDetails
Index/llms.txtLetting an agent find the right page: agent instructions, then every page grouped by sidebar section with its Markdown URL and descriptionllms.txt
Full text/llms-full.txtLoading every page into one long context windowllms.txt
Page Markdown/docs/<page>.md, or any docs URL with Accept: text/markdownReading or quoting one page exactlyllms.txt
MCP server/api/mcpSearching pages and looking up API methods, exports, and error codes during a coding sessionDocs MCP server
Agent skill/skills/better-iam/SKILL.mdTeaching an agent the setup order, call shapes, and pitfalls before it writes codeAgent skills
PromptsCopy from the pageStarting common tasks and adding Better IAM rules to AGENTS.mdPrompts 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:

ToolWhat it does
searchFull-text search over every page, the same index as the search dialog.
list_pagesLists every page with its URL and one-line description.
get_pageReturns one page as Markdown, by URL (for example /docs/authorization/policies).
lookup_api_methodReturns the signature, HTTP route, permission, errors, and behaviour of one server API method, for example groups.addMember.
lookup_exportExplains 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_codeExplains 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/mcp

Docs 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:

URLContentUse it for
/llms.txtInstructions for agents, then every page's title, Markdown URL, and description, grouped by sidebar sectionLetting a model pick which pages to read
/llms-full.txtEvery page as Markdown in one fileLoading everything into a long context window
/docs/<page>.mdOne page as MarkdownQuoting 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.md

See 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.md

See 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.api call 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

Was this page helpful?

Better IAM is created by Sean Filimon

Last updated

On this page