---
title: "Use with an AI agent"
description: "Install the starlight-codeblocks agent skill, so an AI coding agent knows each feature, its syntax and when to use it."
url: "https://ewels.github.io/starlight-codeblocks/agent-skill/"
markdown: "https://ewels.github.io/starlight-codeblocks/agent-skill.md"
section: "Start here"
site: "starlight-codeblocks documentation"
context: "This page is from the documentation of starlight-codeblocks. A Starlight plugin that adds focus, line states, annotations, API auto-linking and 22 more features to the code blocks of a site."
index: "https://ewels.github.io/starlight-codeblocks/llms.txt"
---

# Use with an AI agent

> Install the starlight-codeblocks agent skill, so an AI coding agent knows each feature, its syntax and when to use it.

The plugin comes with an [agent skill](https://github.com/ewels/starlight-codeblocks/tree/main/skills/starlight-codeblocks) for Claude Code, Codex, Cursor, GitHub Copilot and other agents. With the skill, your agent uses the features as it writes new pages. For example, it focuses the lines of a new option, or adds a placeholder for an API token. It also knows when a feature does not help.

## Install the skill

Run this command in the folder of your Starlight site. Add `-g` to install it for every project:

```sh
npx skills add ewels/starlight-codeblocks
```

The [skills CLI](https://github.com/vercel-labs/skills) installs the skill for each coding agent that you use. Run `npx skills update` to get a new version.

An agent without a skills folder can read [`SKILL.md`](https://github.com/ewels/starlight-codeblocks/blob/main/skills/starlight-codeblocks/SKILL.md) on GitHub:

- [Agent skill source](https://github.com/ewels/starlight-codeblocks/tree/main/skills/starlight-codeblocks): SKILL.md and the reference files on GitHub.

## Add features to an existing site

The skill works well for agents building new sites, but can also retrofit existing content.

Ask the agent to add the features to one page, a sidebar group or the whole site. It works through the pages one at a time, and reads each code block in the context of its page. It adds a feature only when the page gives a reason for it. After each page, it tells you what it changed and why.
