Docsbook
← Back to catalog
publishingfree

docs-generate-agents-md

Give every AI agent in your repo the same context about your docs. Reads your Docsbook workspace and writes an AGENTS.md at repo root so Claude Code, Cursor, Codex, Copilot and Gemini CLI all start each session knowing the docs URL, languages, AI-chat conventions and available @docs-skills commands.

Install & use this skill

Pick your AI client — install this single skill and call it.

1. Install
npx skills add Docsbook-io/docs-skills --skill docs-generate-agents-md -a claude-code
2. Use
/docs-generate-agents-md

Invoke as a slash command in chat.

Or: runtime discovery via Docsbook MCP

Already connected to the Docsbook MCP server? Skip install — ask your agent to load this skill on demand.

@docsbook find_skill "docs-generate-agents-md"

docs-generate-agents-md — Generate AGENTS.md from a Docsbook workspace

Workflow#

  1. Gather the workspace settings. If a Docsbook workspace is connected, read them directly; otherwise derive them from local files (docs config, repo) or ask the user.
  2. Collect: docs URL (custom domain or computed), docs path, enabled languages, AI chat status, and plan tier. If a workspace is expected but does not exist, instruct the user to run /docs-setup-workspace first.
  3. Read the doc tree / page list — from a graph tool if a workspace is connected, or by walking the docs folder — to extract top-level folder structure and total page count. If it is unavailable, continue with an empty structure — the template handles missing data.
  4. Render the AGENTS.md template using the collected data: site URL, owner/repo, docs path, languages, AI-chat status, folder structure summary.
  5. Write the file to the repo root. If AGENTS.md already exists, locate the managed section by its markers and replace only that section. If no markers exist, append under them. Never touch content outside the markers.
  6. Report the file path, Docsbook URL, languages, and AI chat status. Remind the user to commit the file.

Guardrails#

Inputs#

Acceleration (optional). If a Docsbook workspace is connected, the settings and doc graph can be read directly. Without it, generate AGENTS.md from local files. Pairs with the sibling /docs-setup-workspace.

Acceptance Criteria#

View source on GitHub →Browse full catalog repo →
Keywords
agents.mdsystem promptonboardingagent contextdocsbookmcpsetup