---
metadata:
  - name: generator
    content: Diplodoc Platform v5.57.3
alternate:
  - https://sourcecraft.dev/portal/docs/en/sourcecraft/operations/ai-skills.md
  - https://sourcecraft.dev/portal/docs/ru/sourcecraft/operations/ai-skills.md
  - href: en/sourcecraft/operations/ai-skills.md
    type: text/markdown
    title: Markdown version
  - href: ../../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://sourcecraft.dev/portal/docs/en/llms.txt

# Using AI skills in SourceCraft

<!-- source: en/_includes/sourcecraft/ai-skills-intro.md -->
{% note tip %}

This page is about skills in the SourceCraft interface. To learn about skills in the Code Assistant plugin, see [Skills in SourceCraft Code Assistant](https://sourcecraft.dev/portal/docs/en/code-assistant/operations/agent/skills.md).

{% endnote %}

You can automate recurring tasks and extend the functionality of the [chat with Code Assistant](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/code-assistant.md#chat-mode) in the SourceCraft interface using _AI skills_.

An AI skill starts in the chat with Code Assistant and supplies the AI agent with instructions and context specific to the particular task and repository the chat has been opened in.

Instead of providing the AI agent with multi-step instructions each time, describe them once and call them as an AI skill as needed. AI skills also allow you to standardize your workflow within your team and replicate it across different repositories.

For example, you can do the following using AI skills:
* Complete interactive training for SourceCraft users.
* Request help with repository configuration.
* Decompose an [issue](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/index.md#issues).
* Summarize issue-related information.
* Gather the context of your actions in the repository for the last few hours.

<iframe width="640" height="360" src="https://runtime.strm.yandex.ru/player/video/vplvnm5w3edfcrns6is3?autoplay=0&mute=0" allow="autoplay; fullscreen; picture-in-picture; encrypted-media" frameborder="0" scrolling="no"></iframe>
<!-- endsource: en/_includes/sourcecraft/ai-skills-intro.md -->

For more information, see [AI skills in SourceCraft](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/ai-skills.md).

{% note info %}

Follow these guides to set up skills in the SourceCraft interface. Learn more about the Configuration as Code setup format in [Skill configuration files](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/ai-skills.md#ai-skills-config).

{% endnote %}

## Running a skill {#run-skill}

Only [system skills](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/ai-skills.md#system) are immediately available for running in any [repository](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/index.md#repos) by default. To run a [skill from the catalog](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/ai-skills.md#catalog) or a [public skill](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/ai-skills.md#public), first [import](#import-skill) it. To run a [custom skill](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/ai-skills.md#custom), first create it in the repository.

To run a skill:
1. Open the SourceCraft [home page](https://sourcecraft.dev).
1. On the ![image](../../_assets/console-icons/house.svg) **Home** tab, under ![image](../../_assets/console-icons/layout-tabs.svg) **Your craftspace**, navigate to ![image](../../_assets/console-icons/archive.svg) **Repositories**.
1. Select the repository you want to run a skill in.
1. In the panel on the left, click ![image](../../_assets/code-assistant/chat-logo-src.svg) **Code Assistant Chat**.

    You can also run a skill from ![image](../../_assets/console-icons/terminal-line.svg) **CI/CD** in the ![image](../../_assets/console-icons/sparkles.svg) **AI skills** section.

1. Click ![image](../../_assets/sourcecraft/slash-command.svg)</svg> in the bottom-right corner of the chat and select the skill you want to run.

    {% note tip %}

    If you know the command corresponding to the skill, you can also start typing it in the chat beginning with `/`, e.g., `/configs`, and then select the command from the drop-down menu, e.g., `/configs-helper`.

    {% endnote %}

1. Click ![image](../../_assets/sourcecraft/send.svg)</svg> or press **Enter**.
1. Optionally, if the skill implies any parameters, enter them or select them from the drop-down menu and click **Accept**.
1. Code Assistant may ask you clarifying questions as you go along. Answer them in the chat in natural language.

    {% note tip %}

    If you change your mind and want to stop Code Assistant, click ![image](../../_assets/console-icons/circle-stop.svg) **Stop**.

    {% endnote %}

    Wait for the ![image](../../_assets/console-icons/sparkles.svg) **Finished skill scenario** message to appear in the chat.

1. If changes were applied to the repository when executing a skill:

    <!-- source: en/_includes/sourcecraft/commit-message.md -->
    1. In the top-right corner, click **Commit changes**.
    1. In the window that opens, configure the procedure for changes:

        <!-- source: en/_includes/sourcecraft/commit-message-settings.md -->
        * In the **Commit message** field, give a comment that will describe the changes you make.
        * Under **Commit branch**, select the branch you want to change. Create a new branch as needed.
        * Under **After commit action**, select an action to take after saving changes: `Save and create a new change proposal` or `Just save`.
        <!-- endsource: en/_includes/sourcecraft/commit-message-settings.md -->

    1. Confirm your changes.
    <!-- endsource: en/_includes/sourcecraft/commit-message.md -->

## Importing a skill {#import-skill}

You can import a [skill from the catalog](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/ai-skills.md#catalog) or any [public skill](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/ai-skills.md#public) into your repository.

{% note warning %}

Imported skills contain instructions for Code Assistant that will be executed within your repository. Make sure to review the contents of these instructions before using a skill.

Note that an imported skill can be modified by its author, which may, in turn, lead to unexpected behavior.

{% endnote %}

### Importing a skill from the catalog {#add-from-catalog}

1. Open the SourceCraft [home page](https://sourcecraft.dev).
1. Click ![image](../../_assets/console-icons/circles-3-plus.svg) **Browse AI skills** in the top center section.
1. Select the skill you want to import.

    You can search by name or keyword and sort skills by command or name.
1. Click ![image](../../_assets/console-icons/copy-plus.svg) **Import** in the skill card.

    The catalog also displays [system skills](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/ai-skills.md#system) which you cannot import as they are available in any repository by default.

    {% note tip %}

    To test a skill, click ![image](../../_assets/console-icons/circle-play.svg) **Launch**.

    {% endnote %}

1. Select the repository you want to import the skill into.
1. Review the skill's instructions and parameters.
1. Optionally, set **Additional instructions for model** and **Launch parameters**.
1. Click **Save**.
1. In the window that opens:

    <!-- source: en/_includes/sourcecraft/commit-message-settings.md -->
    * In the **Commit message** field, give a comment that will describe the changes you make.
    * Under **Commit branch**, select the branch you want to change. Create a new branch as needed.
    * Under **After commit action**, select an action to take after saving changes: `Save and create a new change proposal` or `Just save`.
    <!-- endsource: en/_includes/sourcecraft/commit-message-settings.md -->

1. Confirm your changes.
1. [Test](#run-skill) the skill.

### Importing a public skill {#add-public-skill}

1. In the repository you want to import the skill into, [create](https://sourcecraft.dev/portal/docs/en/sourcecraft/operations/add-file-repo.md) a file named [.sourcecraft/ai.yaml](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/ai-skills.md#ai-yaml) with the following contents:

    ```yaml
    skills:
      - source:
          repo: <organization_slug>/<repository_slug>
          path: .sourcecraft/skills/<command_to_run>
        settings:
          instructions: |-
            <additional_instructions>
          inputs:
            <parameter>: <default_value>
    ```

    Where:

    <!-- source: en/_includes/sourcecraft/ai-skills-import-settings.md -->
    * `source.repo`: Path to the public repository you are importing a skill from, e.g., `examples/skills`.
    * `source.path`: Path to the directory housing the skill, e.g., `.sourcecraft/skills/issue-summary`.
    * `settings.instructions`: Additional instructions for the agent, e.g., `Return results in English only`.
    * `settings.inputs`: Default skill settings, e.g., `config_type: Brach rules`.
    <!-- endsource: en/_includes/sourcecraft/ai-skills-import-settings.md -->

1. [Test](#run-skill) the skill.

## Configuring a system skill or imported skill {#configure-skill}

You can configure additional instructions and default parameters for [system](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/ai-skills.md#system) and [public](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/ai-skills.md#public) skills, or [skills from the catalog](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/ai-skills.md#catalog):
1. Open the SourceCraft [home page](https://sourcecraft.dev).
1. On the ![image](../../_assets/console-icons/house.svg) **Home** tab, under ![image](../../_assets/console-icons/layout-tabs.svg) **Your craftspace**, navigate to ![image](../../_assets/console-icons/archive.svg) **Repositories**.
1. Select the repository you want to configure a skill in.
1. Under ![image](../../_assets/console-icons/terminal-line.svg) **CI/CD**, navigate to ![image](../../_assets/console-icons/sparkles.svg) **AI skills**.
1. Click ![image](../../_assets/console-icons/sliders.svg) next to the skill you want to configure.
1. Set **Additional instructions for model** and **Launch parameters**.
1. Click **Save**.
1. In the window that opens:

    <!-- source: en/_includes/sourcecraft/commit-message-settings.md -->
    * In the **Commit message** field, give a comment that will describe the changes you make.
    * Under **Commit branch**, select the branch you want to change. Create a new branch as needed.
    * Under **After commit action**, select an action to take after saving changes: `Save and create a new change proposal` or `Just save`.
    <!-- endsource: en/_includes/sourcecraft/commit-message-settings.md -->

1. Confirm your changes.

## Creating a custom skill {#add-custom-skill}

1. Open the SourceCraft [home page](https://sourcecraft.dev).
1. On the ![image](../../_assets/console-icons/house.svg) **Home** tab, under ![image](../../_assets/console-icons/layout-tabs.svg) **Your craftspace**, navigate to ![image](../../_assets/console-icons/archive.svg) **Repositories**.
1. Select the repository you want to create a skill in.
1. Under ![image](../../_assets/console-icons/terminal-line.svg) **CI/CD**, navigate to ![image](../../_assets/console-icons/sparkles.svg) **AI skills**.
1. In the top-right corner, click **New AI skill**.
1. In the window that opens, set the following:
    * **Name** you are going to see in the SourceCraft interface, e.g., `Issue summary`.
    * **Description**, e.g., `Creates a brief summary of the issue. Use for a quick look into large issues or issues with extensive threads of comments`.
    * **Launch command**, e.g., `issue-summary`.
    * **Description for model**: Text instructions for the agent in [Markdown](https://en.wikipedia.org/wiki/Markdown) markup.

      <!-- source: en/_includes/sourcecraft/ai-skills-examples-tip.md -->
      {% note tip %}

      For examples of skills, see these repositories: [sourcecraft/ai](https://sourcecraft.dev/sourcecraft/ai) and [examples/skills](https://sourcecraft.dev/examples/skills).

      {% endnote %}
      <!-- endsource: en/_includes/sourcecraft/ai-skills-examples-tip.md -->

1. Optionally, under **Launch parameters**, click ![image](../../_assets/console-icons/plus.svg) **Add parameter** and configure it:
    1. Select the parameter type:
        * ![image](../../_assets/console-icons/font-cursor.svg) **String**.
        * ![image](../../_assets/console-icons/list-ul.svg) **Choice**. Add possible options for this parameter type.
        * ![image](../../_assets/console-icons/toggle-on.svg) **Boolean**.
    1. Enter a name for the parameter.
    1. Optionally, select or set the default parameter value.
    1. Optionally, enter the parameter description.
    1. Specify if this is a required parameter.

    To add another parameter, click ![image](../../_assets/console-icons/plus.svg) **Add parameter**.  

    {% note info %}

    In text instructions for the agent, parameters are specified in `{{ <parameter_name>}}` format.

    {% endnote %}

1. Click **Save**.
1. In the window that opens:

    <!-- source: en/_includes/sourcecraft/commit-message-settings.md -->
    * In the **Commit message** field, give a comment that will describe the changes you make.
    * Under **Commit branch**, select the branch you want to change. Create a new branch as needed.
    * Under **After commit action**, select an action to take after saving changes: `Save and create a new change proposal` or `Just save`.
    <!-- endsource: en/_includes/sourcecraft/commit-message-settings.md -->

1. Confirm your changes.
1. [Test](#run-skill) the skill.

## Editing a custom skill {#edit-custom-skill}

1. Open the SourceCraft [home page](https://sourcecraft.dev).
1. On the ![image](../../_assets/console-icons/house.svg) **Home** tab, under ![image](../../_assets/console-icons/layout-tabs.svg) **Your craftspace**, navigate to ![image](../../_assets/console-icons/archive.svg) **Repositories**.
1. Select the repository you want to edit a custom skill in.
1. Under ![image](../../_assets/console-icons/terminal-line.svg) **CI/CD**, navigate to ![image](../../_assets/console-icons/sparkles.svg) **AI skills**.
1. Next to the custom skill to edit, click ![image](../../_assets/console-icons/ellipsis.svg) and select ![image](../../_assets/console-icons/pencil.svg) **Edit**.
1. Edit the custom parameter settings. For more information, see [Creating a custom skill](#add-custom-skill).
1. Click **Save**.
1. In the window that opens:

    <!-- source: en/_includes/sourcecraft/commit-message-settings.md -->
    * In the **Commit message** field, give a comment that will describe the changes you make.
    * Under **Commit branch**, select the branch you want to change. Create a new branch as needed.
    * Under **After commit action**, select an action to take after saving changes: `Save and create a new change proposal` or `Just save`.
    <!-- endsource: en/_includes/sourcecraft/commit-message-settings.md -->

1. Confirm your changes.

## Deleting a custom or imported skill {#remove-skill}

1. Open the SourceCraft [home page](https://sourcecraft.dev).
1. On the ![image](../../_assets/console-icons/house.svg) **Home** tab, under ![image](../../_assets/console-icons/layout-tabs.svg) **Your craftspace**, navigate to ![image](../../_assets/console-icons/archive.svg) **Repositories**.
1. Select the repository you want to delete a skill in.
1. Under ![image](../../_assets/console-icons/terminal-line.svg) **CI/CD**, navigate to ![image](../../_assets/console-icons/sparkles.svg) **AI skills**.
1. Next to the skill to delete, click ![image](../../_assets/console-icons/ellipsis.svg) and select ![image](../../_assets/console-icons/trash-bin.svg) **Delete**.
1. In the window that opens:

    <!-- source: en/_includes/sourcecraft/commit-message-settings.md -->
    * In the **Commit message** field, give a comment that will describe the changes you make.
    * Under **Commit branch**, select the branch you want to change. Create a new branch as needed.
    * Under **After commit action**, select an action to take after saving changes: `Save and create a new change proposal` or `Just save`.
    <!-- endsource: en/_includes/sourcecraft/commit-message-settings.md -->

1. Confirm your changes.

#### Useful links {#see-also}

* [AI skills in SourceCraft](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/ai-skills.md)
* [Chat with Code Assistant in SourceCraft](https://sourcecraft.dev/portal/docs/en/sourcecraft/operations/ca-chat.md)
* [AGENTS.md](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/agentsmd.md)
* [Slash (/) commands in SourceCraft Code Assistant](https://sourcecraft.dev/portal/docs/en/code-assistant/operations/agent/slash-commands.md)
* [Skills in SourceCraft Code Assistant](https://sourcecraft.dev/portal/docs/en/code-assistant/operations/agent/skills.md)