> For the complete documentation index, see [llms.txt](https://gitbook.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.com/docs/developers/gitbook-api/guides/work-on-your-site-with-an-ai-agent.md).

# Work on your site with an AI agent

Use a coding agent and GitBook skills to update your documentation.

Use a coding agent with GitBook skills to plan and make a reviewable site update.

### Before you begin

You need:

* A coding agent that supports Agent Skills.
* The GitBook CLI installed and signed in.
* Access to the GitBook organization and site you want to update.

### Install the GitBook skills

From the repository where you work with your agent, run:

```bash
npx skills add GitbookIO/gitbook-skills
```

The installed skills give your agent GitBook-specific instructions.

See the [GitBook skills repository](https://github.com/GitbookIO/gitbook-skills) for available skills.

### Give the agent a focused task

In your agent, enter a request like this:

{% prompt description="Review content" defaultExpanded="partial" %}

```markdown
Use the GitBook skills to review our site’s getting-started content.

Propose updates for outdated setup steps.

Create a change request for review. Do not merge it.
```

{% endprompt %}

Name the site, space, pages, and desired outcome in your prompt.

Ask the agent to create a change request when you need review before publishing.

### Review the proposed changes

Open the generated change request in GitBook.

Check its diff, links, and examples. Merge it when the update is ready to publish.

### Continue building

Use the same workflow for larger changes:

* Create a new space or site.
* Update related pages in one change request.
* Identify broken links or incomplete setup steps.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://gitbook.com/docs/developers/gitbook-api/guides/work-on-your-site-with-an-ai-agent.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
