# Skills

Skills give CKEditor AI knowledge of the markup behind an editor feature, such as footnotes or merge fields, so the HTML it writes is what your editor accepts. Built-in skills are part of the service, and the agent loads a skill only when the request needs that feature. For your own plugins, you can add custom skills. This page covers which features the built-in skills cover, where the agent uses them, and how to write and manage custom skills.

<a id="when-to-use-it"></a>

## When to use it

HTML lets you build the same structure in more than one way. Ask a general-purpose model for footnotes, and it picks one shape. If that shape is not the one your editor supports, the editor drops or downgrades the markup when it loads the content. With CKEditor AI, you do not have to describe your markup in every prompt. A skill names the feature, describes its rules, and shows the markup the editor produces.

The agent loads skills where it writes document content: in [chat](../conversations.md) and in [Document Processing](../document-processing.md). Actions and reviews do not load skills. They rely on the model’s own knowledge of HTML.

<a id="built-in-skills"></a>

## Built-in skills

The built-in skills cover CKEditor 5 features such as text formatting and structure, tables and lists, links and bookmarks, media, merge fields, math equations, and footnotes. The agent does not know the markup of your own plugins: for those, write a [custom skill](#custom-skills). The agent also reads your editor configuration. It writes markup only for the features your editor enables, and it uses only the option values your configuration allows.

New and improved skills come with service releases. Your integration does not change.

<a id="custom-skills"></a>

## Custom skills

A custom skill teaches the agent the markup of your own editor plugin, such as a product card or a callout widget. You upload it once for the environment and it’s available for all users in that environment. Use a [context](context-library.md) instead for anything about your content, such as tone of voice or terminology.

<a id="how-it-works"></a>

### How it works

1. You upload a `SKILL.md` file for the environment through the admin API.
2. On every request, the agent sees the `name` and `description` of every skill, built-in and custom.
3. The document’s `editorConfig` decides which skills the document enables. A skill is enabled when `editorConfig` has a top-level key equal to the skill’s `configKey`. The value of that key can hold the feature’s options, such as allowed variants, and the skill can tell the agent how to use them.

<a id="write-the-skill-file"></a>

### Write the skill file

A skill is one Markdown file named `SKILL.md`: a frontmatter block followed by the instructions.

```markdown
---
name: product-card
description: Product card widget with an image, a title, a price and a call to action. Use when asked to add, insert or format a product, product tile, offer or product teaser.
configKey: productCard
---

## Rules

- The card is a block element. Never place it inside a paragraph, a list item or a table cell.
- `data-sku` is required. Ask the user for the SKU when the request does not include one.
- Use only the variants listed in the `variants` option of the editor configuration.

## Examples

A basic card:

<section class="product-card" data-sku="KB-1042" data-variant="default">
	<img
		class="product-card__image"
		src="https://cdn.example.com/kb-1042.png"
		alt="Mechanical keyboard"
	/>
	<h3 class="product-card__title">Mechanical keyboard</h3>
	<p class="product-card__price">$129</p>
	<a class="product-card__cta" href="https://shop.example.com/kb-1042"
		>Buy now</a
	>
</section>
```

<a id="frontmatter-fields"></a>

#### Frontmatter fields

| Field         | Required | Rules                                                                                                                                                       | Purpose                                                                                                                   |
| ------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| name          | Yes      | Lowercase letters, digits, - and \_. Starts with a letter or a digit. Up to 64 characters. Unique in the environment, and not the name of a built-in skill. | The id you use in the API, and the name the agent loads the skill by. Always taken from the file, never from the request. |
| description   | Yes      | Up to 1000 characters.                                                                                                                                      | Tells the agent what the skill covers and when to load it.                                                                |
| configKey     | Yes      | Letters, digits, \_ and $. Cannot start with a digit. Up to 64 characters.                                                                                  | The top-level editorConfig key that enables the skill.                                                                    |
| editorVersion | No       | A semantic version, such as `47.0.0`                                                                                                                        | The lowest editor version the skill applies to.                                                                           |

<a id="limits"></a>

#### Limits

* One file per skill, up to 32 KiB, UTF-8, sent as `text/markdown` or `text/plain`.
* Up to 50 custom skills per environment.

<a id="manage-skills-through-the-admin-api"></a>

### Manage skills through the admin API

Every endpoint requires a token with the `ai:admin` permission. Call them from your backend only. See [Permissions](../permissions.md).

| Method   | Path                           | Does                                                                        |
| -------- | ------------------------------ | --------------------------------------------------------------------------- |
| `POST`   | `/v1/admin/skills`             | Creates a skill from the uploaded file.                                     |
| `GET`    | `/v1/admin/skills`             | Lists the skills in the environment: names and file names, without content. |
| `GET`    | `/v1/admin/skills/{skillName}` | Returns the skill with its file content.                                    |
| `PUT`    | `/v1/admin/skills/{skillName}` | Replaces the skill with the uploaded file.                                  |
| `DELETE` | `/v1/admin/skills/{skillName}` | Deletes the skill.                                                          |

See the [Skill Admin API reference](https://ai.cke-cs.com/v1/docs#tag/Skill-Admin) for request and response schemas and error codes.

<a id="enable-a-skill"></a>

### Enable a skill

A skill is scoped to a feature through `editorConfig`, a snapshot of the editor configuration sent with the `document` content part. The document enables the skill when `editorConfig` carries a top-level key equal to the skill’s `configKey`.

<a id="register-the-plugin-in-ckeditor-5"></a>

#### Register the plugin in CKEditor 5

The editor sends `editorConfig` for you, but your plugin is not part of it until you register it under the skill’s `configKey`. See [Registering custom features](../../../../../ckeditor5/latest/features/ai/ckeditor-ai-feature-understanding.md#registering-custom-features) in the CKEditor 5 documentation.

<a id="send-editorconfig-through-the-api"></a>

#### Send `editorConfig` through the API

When you call the API directly instead of through the editor, add the key to `editorConfig` yourself:

```json
{
	"type": "document",
	"id": "doc-1",
	"editorConfig": {
		"editorVersion": "47.0.0",
		"heading": { "options": ["…"] },
		"productCard": {
			"variants": ["default", "compact"]
		}
	}
}
```

The key enables the skill whatever its value is, including `false`. To disable a skill for a document, leave the key out of `editorConfig`. A document without `editorConfig`, or with an empty one, counts as a full-featured editor and enables every skill.

<a id="target-an-editor-version"></a>

#### Target an editor version

Add `editorVersion` to the frontmatter when your plugin’s markup works only from a given editor version. The agent then sees the skill only in requests from that version or newer. A skill without `editorVersion` applies to every editor version.

The service takes the editor version of a request from the `editorVersion` key of `editorConfig`. CKEditor 5 sends it for you. Without that key, the service uses the `x-editor-version` request header.

If the request has neither the `editorVersion` key in `editorConfig` nor the `x-editor-version` header, the skill’s `editorVersion` has no effect and the skill is available in every request.

<a id="write-a-good-skill"></a>

### Write a good skill

<a id="lead-with-examples"></a>

#### Lead with examples

Examples are great way to describe your plugin’s markup, so put the effort there. Each example must be exactly the HTML your editor plugin produces including wrappers, classes and attribute order.

Cover the common cases: the minimal form, the full form, and the feature next to surrounding content.

<a id="write-a-precise-description"></a>

#### Write a precise `description`

The agent sees only the `name` and `description` until it decides to load the skill. Say what the feature is and list the requests that should trigger it.

* Good: `Product card widget with an image, a title, a price and a call to action. Use when asked to add, insert or format a product, product tile, offer or product teaser.`
* Avoid: `Product plugin`. It is too vague to trigger reliably, or it triggers for unrelated requests.

<a id="add-rules-only-where-examples-are-not-enough"></a>

#### Add rules only where examples are not enough

Add a `## Rules` section for constraints the examples do not show: required attributes, allowed parents, values that depend on the configuration. Keep the rules short.

<a id="point-to-the-configuration"></a>

#### Point to the configuration

When your plugin has options, pass them in its registration and tell the skill which option controls what (for example “use only the variants listed in `variants`”). One skill then works for every editor that configures the plugin differently.

<a id="keep-it-focused"></a>

#### Keep it focused

* One skill per feature. Do not put tone of voice or business rules into a skill: use a [context](context-library.md) instead.
* Keep the body short. A concise skill is easier for the agent to follow and uses fewer tokens.

<a id="test-it"></a>

#### Test it

1. Upload the skill.
2. Open an editor that registers your plugin under the skill’s `configKey`.
3. Ask for the feature in chat.
4. Check that the inserted markup matches your examples and survives an editor reload.

If the agent does not use the skill, make the `description` more specific to the prompts your users write.

<a id="next-steps"></a>

## Next steps

* **[How CKEditor AI works](../how-it-works.md)** describes what the agent holds in context and how skills fit into a request.
* **[Context library](context-library.md)** gives the agent knowledge of your content: style rules and reference files.
* **[Permissions](../permissions.md)** covers the `ai:admin` scope you need to manage custom skills.

---

Full index of the Cloud Services documentation: [llms.txt](../../../../llms.txt)
