> For the complete documentation index, see [llms.txt](https://docs.gitloom.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gitloom.cloud/api-reference/skills.md).

# Skills

Store procedural know-how and find the skill that fits a task.

A skill is how something is done: a procedure, a checklist, a way of working. Skills are ordinary memories under the `skills` tier, so retrieve reaches them like anything else — these routes are the shape that makes them convenient to write and to look up by task.

#### POST /v1/skills

Each skill becomes a memory at `skills/<topic>/<slug>.md`, its body opening with the name and description. Storing one at a path that already exists rewrites it.

{% hint style="warning" %}
**Asynchronous**, like every write. The response is `202`, with the paths the skills will live at.
{% endhint %}

| field       | type   | required | notes                 |
| ----------- | ------ | -------- | --------------------- |
| `skills`    | array  | yes      | up to 100 per request |
| `namespace` | string | no       | defaults to `default` |

| skill field   | required | notes                                                                       |
| ------------- | -------- | --------------------------------------------------------------------------- |
| `name`        | yes      | what the skill is called                                                    |
| `description` | no       | one line; either this or `content` must be present                          |
| `content`     | no       | the procedure itself, as markdown — `##` headings become sections           |
| `topic`       | no       | files it under `skills/<topic>/`                                            |
| `path`        | no       | overrides the location entirely; must stay under `skills/` and end in `.md` |
| `tags`        | no       |                                                                             |
| `triggers`    | no       | how someone would ask for it; defaults to the name and description          |
| `confidence`  | no       | `[0, 1]`                                                                    |
| `date`        | no       | the date the skill is *about*, not now                                      |

```bash
curl -s -X POST "$GITLOOM_API/v1/skills" \
  -H "Authorization: Bearer $GITLOOM_KEY" \
  -H "content-type: application/json" \
  -d '{"namespace":"user-8213","skills":[{
    "name":"Deploy to production","topic":"ops",
    "description":"How a release reaches prod without a human on the box.",
    "content":"## Steps\n\n1. Tag the release.\n2. Run `make deploy ENV=prod`.",
    "triggers":["how do I ship a release","deploy to prod"],
    "tags":["release"]}]}'
```

```json
{
  "id": "3f2b9e01-…", "namespace": "user-8213", "status": "accepted",
  "paths": ["skills/ops/deploy-to-production.md"]
}
```

{% hint style="info" %}
`triggers` become the memory's retrieval cues, which is what `GET /v1/skills?q=…` matches against. Writing them as the question someone would actually ask — "how do I ship a release" rather than "deployment" — is what makes a skill findable.
{% endhint %}

| status | code                                                              |
| ------ | ----------------------------------------------------------------- |
| `400`  | `no_skills`, `invalid_skill`, `invalid_path`, `invalid_namespace` |
| `404`  | `namespace_not_found`                                             |
| `413`  | `too_many_skills`, `payload_too_large`                            |

#### GET /v1/skills

With `q`, the skills that bear on a task, best first — a retrieval confined to the `skills` tier. Without it, every skill.

| param       | required | default   | notes                                                      |
| ----------- | -------- | --------- | ---------------------------------------------------------- |
| `namespace` | no       | `default` |                                                            |
| `q`         | no       | —         | the task, in a few words                                   |
| `paths`     | no       | all       | comma-separated topics under `skills/`, e.g. `ops,release` |
| `tags`      | no       | —         | any of these tags                                          |
| `limit`     | no       | `20`      | capped at 200                                              |

```bash
curl -s -G "$GITLOOM_API/v1/skills" -H "Authorization: Bearer $GITLOOM_KEY" \
  --data-urlencode "namespace=user-8213" --data-urlencode "q=ship a release to production"
```

```json
{
  "namespace": "user-8213",
  "skills": [{
    "path": "skills/ops/deploy-to-production.md",
    "topic": "ops",
    "name": "Deploy to production",
    "description": "How a release reaches prod without a human on the box.",
    "content": "## Steps\n\n1. Tag the release.\n2. Run `make deploy ENV=prod`.",
    "tags": ["release"],
    "triggers": ["how do I ship a release", "deploy to prod"],
    "score": 0.88,
    "matched": ["lexical", "cue"]
  }],
  "millis": 9
}
```

`score` and `matched` mean what they mean on retrieve: a calibrated relevance in `[0, 1]`, and the arms that produced the result. Both are absent when you are listing rather than searching.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.gitloom.cloud/api-reference/skills.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
