# createSkill

```graphql
mutation CreateSkill($projectReference: String!, $input: CreateSkillInput!) {
  createSkill(projectReference: $projectReference, input: $input) {
    id
    name
    description
    sourcePath
    editMode
    allowedTools
    instructions
    sections
    source
    sourceOnlyReasons
  }
}
```

Create a skill, a SKILL.md file an agent loads on demand, in the project source or a preview branch; returns the skill source document. Requires project.agents.write.

## Arguments

| Name                     | Type              | Required | Description                                                                                                                                                                                                                  |
| ------------------------ | ----------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `projectReference`       | String!           | Yes      |                                                                                                                                                                                                                              |
| `input`                  | CreateSkillInput! | Yes      |                                                                                                                                                                                                                              |
| `input.name`             | String!           | Yes      | Becomes the skill directory name and the skill id. For example "daily-changelog-flow", not "daily--changelog". A skill cannot be renamed. There is no display\_name field; put the human-readable label in description.      |
| `input.description`      | String!           | Yes      |                                                                                                                                                                                                                              |
| `input.allowedTools`     | \[String!]        |          | Tool IDs the skill may call; default none.                                                                                                                                                                                   |
| `input.instructions`     | String            |          | Full markdown body of SKILL.md, meaning everything below the frontmatter, written verbatim with any markdown headings. Sending it replaces the whole body. The former sections object is rejected; put the whole skill here. |
| `input.sourceTargetKind` | WriteTargetKind   |          | The source to write; default project. One of `project`, `preview_branch`.                                                                                                                                                    |
| `input.targetBranchId`   | ID                |          | Required with the kind preview\_branch.                                                                                                                                                                                      |

## Variables

```json
{
  "projectReference": "string",
  "input": {
    "name": "string",
    "description": "string"
  }
}
```

## Responses

| Status | Description                           |
| ------ | ------------------------------------- |
| 200    | The SkillSource! in data.createSkill. |

## Call it

```bash
curl -X POST "https://api.veryfront.com/graphql" \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "mutation CreateSkill($projectReference: String!, $input: CreateSkillInput!) {\n  createSkill(projectReference: $projectReference, input: $input) {\n    id\n    name\n    description\n    sourcePath\n    editMode\n    allowedTools\n    instructions\n    sections\n    source\n    sourceOnlyReasons\n  }\n}",
  "variables": {
    "projectReference": "string",
    "input": {
      "name": "string",
      "description": "string"
    }
  }
}'
```

## Example response

```json
{
  "data": {
    "createSkill": {
      "id": "string",
      "name": "string",
      "description": "string",
      "sourcePath": "string",
      "editMode": "structured",
      "allowedTools": [
        "string"
      ],
      "instructions": "string",
      "sections": {},
      "source": "string",
      "sourceOnlyReasons": [
        "string"
      ]
    }
  }
}
```
