AI skills in SourceCraft
You can automate recurring tasks and extend the functionality of the chat with Code Assistant 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.
- Summarize issue-related information.
- Gather the context of your actions in the repository for the last few hours.
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 repository.
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 file.
-
Catalog skills, which is a selection of public AI skills collected by the SourceCraft team. To run these skills, import them into your repository first. You will find their parameters and instructions in the examples/skills repository.
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 file.
-
Public skills, which are hosted in public repositories. To use them, import them into the repository you need.
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 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 into a different repository.
You can change the configuration and instructions in custom skills.
Their parameters and instructions are stored in the .sourcecraft/skills/ directory.
Note
System and catalog skills are available on the SourceCraft main page by clicking
Skill configuration files
System skills are not visible in custom repository files; for their configuration and instructions, see the 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 file.
Custom skills are hosted in the .sourcecraft/skills/ directory.
Configuration of imported skills
Here is the basic structure of .sourcecraft/ai.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.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.
Configuration of custom 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:
---
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 for a quick look into large issues or issues with extensive threads of comments.metadata.inputs: Optional skill parameters, e.g.,issue_link:-
type: Parameter type, possible values:string: String.bool: Logical value,trueorfalse.choice: Select from the preset values.
Note
If the configuration contains the
optionsparameter, you do not need to set thetype: choiceparameter.If the type is not specified and there is no
optionsparameter, the default parameter type isstring.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 aretrueorfalse. -
options: Possible values for thechoiceparameter type.
-
title: Skill name to display in the SourceCraft interface, e.g.,Issue summary.
Tip
For examples of skills, see these repositories: sourcecraft/ai and examples/skills.