---
metadata:
  - name: generator
    content: Diplodoc Platform v5.57.3
alternate:
  - https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/ai-skills.md
  - https://sourcecraft.dev/portal/docs/ru/sourcecraft/concepts/ai-skills.md
  - href: en/sourcecraft/concepts/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

# 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 -->

SourceCraft comes with the following types of AI skills:
* _System skills_, which you can run from the get-go in any repository without preliminary setup. You will find their parameters and instructions in the [sourcecraft/ai](https://sourcecraft.dev/sourcecraft/ai) repository. {#system}

  You cannot change the configuration and instructions of system skills, but you can add instructions for the agent and set the default parameter values.

  In custom repositories, additional agent instructions and default parameter values for system skills are provided in the [.sourcecraft/ai.yaml](#ai-yaml) file.

* _Catalog skills_, which is a selection of public AI skills collected by the SourceCraft team. To run these skills, [import](https://sourcecraft.dev/portal/docs/en/sourcecraft/operations/ai-skills.md#add-from-catalog) them into your repository first. You will find their parameters and instructions in the [examples/skills](https://sourcecraft.dev/examples/skills) repository. {#catalog}

  You cannot modify the configuration and instructions of catalog skills, but you can add new instructions for the agent and set the default parameter values. 
  
  In custom repositories, the import configuration is located in the [.sourcecraft/ai.yaml](#ai-yaml) file.

* _Public skills_, which are hosted in public repositories. To use them, [import](https://sourcecraft.dev/portal/docs/en/sourcecraft/operations/ai-skills.md#add-public-skill) them into the repository you need. {#public}

  You cannot change the configuration and instructions of imported skills, but you can add new instructions for the agent and set the default parameter values. 
  
  In custom repositories, the import configuration is located in the [.sourcecraft/ai.yaml](#ai-yaml) file.

* _Custom skills_, which are created by the user. These skills are available in the repository they were created in. If the repository is public, the skills can also be [imported](https://sourcecraft.dev/portal/docs/en/sourcecraft/operations/ai-skills.md#add-public-skill) into a different repository. {#custom}

  You can change the configuration and instructions in custom skills. 
  
  Their parameters and instructions are stored in the [.sourcecraft/skills/](#skills) directory.

{% note info %}

System and catalog skills are available on the SourceCraft [main page](https://sourcecraft.dev) by clicking ![image](../../_assets/console-icons/circles-3-plus.svg) **Browse AI skills**.

{% endnote %}

## Skill configuration files {#ai-skills-config}

System skills are not visible in custom repository files; for their configuration and instructions, see the [sourcecraft/ai](https://sourcecraft.dev/sourcecraft/ai) repository.

Imported catalog skills or skills from other public repositories as well as additional agent instructions and default parameter values are specified in the [.sourcecraft/ai.yaml](#ai-yaml) file.

Custom skills are hosted in the [.sourcecraft/skills/](#skills) directory.

### Configuration of imported skills {#ai-yaml}

Here is the basic structure of `.sourcecraft/ai.yaml`:

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

Where:
* `source.name`: Command to run a system skill, e.g., `configs-helper`. It is only used if you need to add instructions for the agent or set the default parameters.

<!-- 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 -->

### Configuration of custom skills {#skills}

The AI skill is stored in the repository at `.sourcecraft/skills/<command_to_run>/SKILL.md`. 

Here is the basic structure of `SKILL.md`:

```text
---
name: <command_to_run>
description: "<description>"
metadata:
  inputs:
    <skill_parameter>:
      type: <parameter_type>
      description: "<parameter_description>"
      required: <true_or_false>
      options:
        - "<available_value_1>"
        - "<available_value_2>"
  title: <skill_name>
---

<Markdown_text_instructions_for_agent>

```

Where:
* `name`: Command to run a skill, e.g., `issue-summary`.
* `description`: Skill description, e.g., `Creates a brief summary of the issue. Use it to get a quick overview of large issues or those with extensive comment threads`.
* `metadata.inputs`: Optional skill parameters, e.g., `issue_link`:
  * `type`: Parameter type, possible values:
    * `string`: String.
    * `bool`: Logical value, `true` or `false`.
    * `choice`: Select from the preset values. 

    {% note info %}

    If the configuration contains the `options` parameter, you do not need to set the `type: choice` parameter.

    If the type is not specified and there is no `options` parameter, the default parameter type is `string`.

    {% endnote %}

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

  * `description`: Parameter description to display in the SourceCraft interface.
  * `required`: Required parameter. The possible values are `true` or `false`.
  * `options`: Possible values ​​for the `choice` parameter type.
* `title`: Skill name to display in the SourceCraft interface, e.g., `Issue summary`.

<!-- 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 -->

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

* [Using AI skills in SourceCraft](https://sourcecraft.dev/portal/docs/en/sourcecraft/operations/ai-skills.md)
* [AGENTS.md](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/agentsmd.md)
* [AI in SourceCraft](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/code-assistant.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)
