﻿---
title: Create and manage custom skills
description: Learn how to create, edit, and manage custom skills in Agent Builder.
url: https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9659/explore-analyze/ai-features/agent-builder/custom-skills
products:
  - Elastic Cloud Serverless
  - Elastic Documentation
  - Elastic Observability
  - Elastic Security
  - Elasticsearch
  - Kibana
applies_to:
  - Elastic Cloud Serverless: Generally available
  - Elastic Stack: Generally available since 9.4
---

# Create and manage custom skills
Custom skills let you package domain-specific knowledge and tools into reusable instruction sets that can be assigned to any [agent](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9659/explore-analyze/ai-features/agent-builder/agent-builder-agents). For an overview of how skills work, refer to [Skills in Elastic Agent Builder](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9659/explore-analyze/ai-features/agent-builder/skills).

## When to create a custom skill

Create a custom skill when you have domain-specific knowledge or procedures that are not covered by the [built-in skills](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9659/explore-analyze/ai-features/agent-builder/builtin-skills-reference). Custom skills are particularly useful when you need to:
- **Standardize a workflow**: Encode a repeatable process (such as a triage runbook or an onboarding checklist) so that every agent follows the same steps.
- **Share expertise across agents**: Write instructions once and assign them to multiple agents instead of duplicating the same guidance in each agent's system prompt.
- **Scope tools to a task**: Bundle specific tools with the instructions that explain how and when to use them, so the agent only has access to relevant tools for the task at hand.
- **Keep agent prompts clean**: Move detailed, task-specific instructions out of the system prompt and into a skill that loads only when needed.


## Create a custom skill

You can create a custom skill in three ways:
- Use the Elastic Agent Builder UI.
- Use the Kibana REST API.
- Ask an agent to create it from Agent Chat.


### Create a skill in the UI

Follow these steps to create a custom skill and add it to your skill library. Once saved, you need to add the skill to an agent before the agent can use it.
You can create a skill from **Manage components** → **Skills**, or inline when adding skills to an agent from **Customize** → **Skills**.
<tip>
  For guidance on writing effective descriptions and instructions, refer to [Skill creation guidelines](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9659/explore-analyze/ai-features/agent-builder/skill-creation-guidelines).
</tip>

To create skills, you need the **Manage skills** privilege. To add skills to an agent, you also need permission to edit that agent.
<stepper>
  <step title="Open the create skill form">
    Go to **Manage components** → **Skills**, then select **New skill**. This opens the **Create a new skill** page.From an agent's **Customize** → **Skills** page, select **Add skill**, then **Create a skill**. This opens the **Create skill** flyout. If the agent has no skills yet, the page shows **Add skills** instead, which only imports from the library. Refer to [Add the skill to an agent](#add-skill-to-agent).
    <applies-switch>
      <applies-item title="stack: ga 9.4-9.5" applies-to="Elastic Stack: Generally available from 9.4 to 9.5">
        The **Create skill** flyout in 9.4 and 9.5 has separate **ID** and **Name** fields:
        ![Create skill flyout with ID, Name, Description, Instructions, an Add file button, and Associated tools under Advanced options](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9659/explore-analyze/ai-features/agent-builder/images/create-new-skill.png)
      </applies-item>

      <applies-item title="{ stack: ga 9.6+, serverless: ga }" applies-to="Elastic Cloud Serverless: Generally available, Elastic Stack: Planned">
        The **Create skill** flyout in 9.6 and later has a single **Name** field:
        ![Create skill flyout with a single Name field, Description, Instructions, a No reference files yet panel with an Add file button, and a collapsed Advanced options section](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9659/explore-analyze/ai-features/agent-builder/images/create-skill-flyout-name.png)
      </applies-item>
      The **Create a new skill** page has the same fields in separate sections:
      ![Create a new skill page with Name and Description under Skill identity, followed by Instructions, Files, and Associated tools sections](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9659/explore-analyze/ai-features/agent-builder/images/create-skill-page.png)
    </applies-switch>
  </step>

  <step title="Fill in the skill fields">
    Complete the fields in the form. The identifier fields depend on your version:
    <applies-switch>
      <applies-item title="stack: ga 9.4-9.5" applies-to="Elastic Stack: Generally available from 9.4 to 9.5">
        - **ID**: Unique identifier for the skill.
          - Use lowercase letters, numbers, hyphens, and underscores.
          - Start and end with a lowercase letter or a number.
          - The limit is 64 characters.
          - You can set the ID when you create the skill. In an agent's edit flyout it's read-only, and the edit page doesn't show it as a field.
        - **Name**: Display name.
          - Use letters, numbers, spaces, hyphens, and underscores.
          - Start and end with a letter or a number.
          - The limit is 64 characters.
      </applies-item>

      <applies-item title="{ stack: ga 9.6+, serverless: ga }" applies-to="Elastic Cloud Serverless: Generally available, Elastic Stack: Planned">
        - **Name**: Identifier for the skill.
          - Use lowercase letters, numbers, hyphens, and underscores.
          - Start and end with a lowercase letter or a number.
          - The limit is 64 characters.
          - As you type, the field lowercases text and replaces each space with a hyphen.
          - The form saves this value as both the skill ID and the skill name.
          - You can't change the name in the UI after you save the skill.
          - The skills library and skill details show the name.
          - Create and update messages show the name.
          - Delete confirmation dialog boxes show the name, and delete notifications use the ID.
      </applies-item>
    </applies-switch>
    The remaining fields are the same in all versions:
    - **Description**: Short description of when the agent should use the skill (1,024-character limit). The agent uses the description to choose when to load the skill, so make it specific and distinct from other skill descriptions. Corresponds to `description` in the API.
    - **Instructions**: Skill content in Markdown. Include trigger conditions, step-by-step instructions, examples, and edge cases. Corresponds to `content` in the API.
    - **Files**: Optional Markdown the agent can read when it uses the skill, such as a runbook, playbook, or other reference material. The limit is 100 files. Corresponds to [`referenced_content`](https://www.elastic.co/docs/api/doc/kibana/operation/operation-post-agent-builder-skills#operation-post-agent-builder-skills-body-application-json-referenced_content) in the API.
      - On the **Create a new skill** page, **Files** is its own section.
      - In the **Create skill** flyout, it appears above **Advanced options**. Select **Add file** to add one.
    - **Associated tools**: Tools the skill can use. The limit is 5. Corresponds to `tool_ids` in the API.
      - On the **Create a new skill** page, this is its own section.
      - In the **Create skill** flyout, open **Advanced options** to select the tools.
  </step>

  <step title="Save the skill">
    Select **Save**. The skill is added to your library and becomes available to assign to any agent.
  </step>

  <step title="Add the skill to an agent">
    Custom skills in your library are not available to your agents until you add them. On the agent, go to **Customize** → **Skills**.
    - If the agent already has skills, select **Add skill**. From there you can:
      - **Import from skill library**: Open the **Add skill from library** panel. Turn on the switch next to a skill to add it to this agent.
      - **Create a skill**: Open the **Create skill** flyout, save the skill, and add it to this agent. The skill is also saved to your library. This option appears only if you have permission to manage skills.
    - <applies-to>Elastic Stack: Generally available since 9.5</applies-to> <applies-to>Elastic Cloud Serverless: Generally available</applies-to> If the agent has no skills at all, including no built-in skills, select **Add skills**. That opens the **Add skill from library** panel, where you turn on the switch next to a skill. To create a new skill instead, use **Manage components** → **Skills**.
    Built-in skill availability depends on your deployment type. Refer to [Built-in skills reference](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9659/explore-analyze/ai-features/agent-builder/builtin-skills-reference) for details.
  </step>

  <step title="Test the skill">
    Send the agent realistic queries that should trigger the skill. Check that the agent selects the skill when expected, follows your instructions correctly, and handles the edge cases you documented. Revise the description or instructions based on what you observe.For guidance on writing effective instructions, refer to [Skill creation guidelines](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9659/explore-analyze/ai-features/agent-builder/skill-creation-guidelines).
  </step>
</stepper>


### Create a skill with the API

Create and manage skills programmatically using the Kibana REST API. You can set the description, instructions (`content`), associated tools (`tool_ids`), and [`referenced_content`](https://www.elastic.co/docs/api/doc/kibana/operation/operation-post-agent-builder-skills#operation-post-agent-builder-skills-body-application-json-referenced_content) the same way you do in the UI. For request examples, refer to [Skills APIs](/elastic/docs-content/pull/9659/explore-analyze/ai-features/agent-builder/kibana-api#skills-apis).
The API provides these endpoints:
- [List skills](https://www.elastic.co/docs/api/doc/kibana/operation/operation-get-agent-builder-skills) `GET /api/agent_builder/skills`
- [Create a skill](https://www.elastic.co/docs/api/doc/kibana/operation/operation-post-agent-builder-skills) `POST /api/agent_builder/skills`
- [Get a skill by ID](https://www.elastic.co/docs/api/doc/kibana/operation/operation-get-agent-builder-skills-skillid) `GET /api/agent_builder/skills/{skillId}`
- [Update a skill](https://www.elastic.co/docs/api/doc/kibana/operation/operation-put-agent-builder-skills-skillid) `PUT /api/agent_builder/skills/{skillId}`
- [Delete a skill](https://www.elastic.co/docs/api/doc/kibana/operation/operation-delete-agent-builder-skills-skillid) `DELETE /api/agent_builder/skills/{skillId}`

A create request requires separate `id` and `name` fields:
- `id`: Use lowercase letters, numbers, hyphens, and underscores. Start and end with a lowercase letter or a number. The limit is 64 characters.
- `name`: Use letters, numbers, spaces, hyphens, and underscores. Start and end with a letter or a number. The limit is 64 characters. It can differ from `id`.

Keep these rules in mind:
- Get, update, and delete requests use `id` in the path.
- An update can change `name` but not `id`.
- The API rejects more than 5 `tool_ids`, even if the API reference shows a higher maximum.

<applies-to>Elastic Stack: Planned</applies-to> <applies-to>Elastic Cloud Serverless: Generally available</applies-to> The UI and Agent Chat handle `id` and `name` differently:
- The **Create a new skill** page and the **Create skill** flyout send the **Name** value as both `id` and `name`. Agent Chat **Create skill** posts the `id` and `name` stored on the draft. They're normally the same, but nothing requires it.
- Skills created earlier keep their stored `id` and `name`. When those values differ, the skills library and skill details show `name`.


### Create a skill from Agent Chat

<applies-to>
  - Elastic Cloud Serverless: Generally available
  - Elastic Stack: Generally available since 9.5
</applies-to>

Open a conversation with an agent that has [Elastic capabilities](/elastic/docs-content/pull/9659/explore-analyze/ai-features/agent-builder/agent-builder-agents#elastic-capabilities) turned on, or that has the `skill-management` skill assigned, and ask it to create a skill. For example, "Create a skill that handles production alerts using our incident runbook." The agent may ask clarifying questions before it presents the generated skill as a draft.
Review the description, instructions, associated tools, and references, and ask the agent to edit anything that needs changing. When the draft is ready, select **Create skill**. The skill is not added to your library until you select **Create skill**. When you do, it's also added to the agent you're chatting with.
The following screenshot shows a skill draft in Agent Chat:
![Skill draft in Agent Chat showing its description, instructions preview, associated tool references, and a Create skill button](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9659/explore-analyze/ai-features/agent-builder/images/create-skill-from-chat.png)

To edit a skill that is already in your library, refer to [Edit a custom skill from Agent Chat](#edit-a-skill-from-chat).

## Edit a custom skill from Agent Chat

<applies-to>
  - Elastic Cloud Serverless: Generally available
  - Elastic Stack: Generally available since 9.5
</applies-to>

Ask an agent to view or edit a custom skill that is already in your library. The agent shows the skill as a card in the conversation, so you can review and save changes without leaving the chat. You can't edit built-in skills or skills provided by plugins from chat.
Before you start:
- Use an agent that has [Elastic capabilities](/elastic/docs-content/pull/9659/explore-analyze/ai-features/agent-builder/agent-builder-agents#elastic-capabilities) turned on (the default Elastic AI Agent does) or that has the `skill-management` skill assigned.
- To save changes, you need the **Create and edit skills** privilege in the current space, the same privilege required to update a skill from **Manage components** → **Skills**. Refer to [Elastic Agent Builder privileges](/elastic/docs-content/pull/9659/explore-analyze/ai-features/agent-builder/permissions#kib-privileges).

To view or edit a custom skill:
1. In an Agent Chat conversation, ask the agent to view or edit the skill by name or ID. For example, "Add a rate-limiting section to the incident-triage skill."
2. Review the skill card. Select **Preview** ([where to find it](#skill-card-preview)) to read the full instructions, or **Edit in Management** to open the saved skill in a new tab.
3. To change the skill, describe the change in the conversation. The agent shows an updated card with a **Draft** badge, a **Latest** badge, and **Save changes**.
4. (Optional) To compare the draft with the instructions that were loaded into the conversation, turn on **Show diff**.
5. Select **Save changes**. The card then shows a **Saved** badge and **Edit in Management**.

Where **Preview** appears depends on your version. The screenshots in [Where to find Preview](#skill-card-preview) show an edited skill draft with **Show diff** turned on.

### Where to find Preview

<applies-switch>
  <applies-item title="{ stack: ga 9.7+, serverless: ga }" applies-to="Elastic Cloud Serverless: Generally available, Elastic Stack: Planned">
    **Preview** is in the **More actions** menu next to the primary button (**Save changes** or **Edit in Management**). On an older card in the same conversation, **Preview** is the main button.
    ![Skill card in Agent Chat showing Draft and Latest badges, a Save changes button with a More actions menu, and a diff of the added instructions](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9659/explore-analyze/ai-features/agent-builder/images/edit-skill-from-chat-serverless.png)
  </applies-item>

  <applies-item title="{ stack: ga 9.5-9.6 }" applies-to="Elastic Stack: Generally available since 9.5">
    **Preview** is a standalone button on the card.
    ![Skill card in Agent Chat showing Draft and Latest badges, Preview and Save changes buttons, and a diff of the added instructions](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9659/explore-analyze/ai-features/agent-builder/images/edit-skill-from-chat.png)
  </applies-item>
</applies-switch>


### What to know before you save

Your library isn't updated until you save. **Save changes** replaces the saved skill's name, description, instructions, tools, and references with the draft on the card. This overwrites any changes made in **Manage components** → **Skills** or through the API since the agent loaded the skill. There is no conflict warning.
Which buttons you see depends on the card:
- **Show diff** appears only for an unsaved draft whose instructions differ from the loaded instructions. It compares instructions only, so a change to just the description, tools, or references shows no **Show diff**. After you save and then ask for another change, **Show diff** still compares against the instructions first loaded, so your earlier saved changes also appear as additions.
- **Save changes** and **Edit in Management** appear only on the newest version of a draft, which the **Latest** badge marks. If you ask the agent to load the skill again, it creates a separate card, and an earlier unsaved draft card keeps its own **Save changes**. Saving an older draft overwrites the library with that draft.

Without the **Create and edit skills** privilege, **Save changes** is disabled. You can still view the skill and ask the agent to draft changes, but you can't save them.

## Related pages

- [Skills in Elastic Agent Builder](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9659/explore-analyze/ai-features/agent-builder/skills)
- [Built-in skills reference](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9659/explore-analyze/ai-features/agent-builder/builtin-skills-reference)
- [Skill creation guidelines](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9659/explore-analyze/ai-features/agent-builder/skill-creation-guidelines)
- [Tools in Elastic Agent Builder](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9659/explore-analyze/ai-features/agent-builder/tools)
- [Elastic Agent Builder Kibana APIs](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9659/explore-analyze/ai-features/agent-builder/kibana-api)