---
sidebar:
  hidden: true
title: roboto.domain.skills.skill
---
## Module Contents

### Skill

```python
class roboto.domain.skills.skill.Skill(
    record: roboto.domain.skills.record.SkillRecord,
    roboto_client: roboto.http.RobotoClient,
)
```

`from roboto.domain.skills import Skill`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/skills/skill.py#L31-L570)

A skill: a stored, versioned procedure, written in Markdown, that Roboto's AI can apply during a conversation.

A skill belongs to one organization, and the user who created it is its author. Its [`SkillAccessibility`](/docs/reference/python-sdk/roboto/domain/skills/record#roboto.domain.skills.record.SkillAccessibility) sets who can see, invoke, and edit it. Its procedure is in its versions, each a [`SkillVersionRecord`](/docs/reference/python-sdk/roboto/domain/skills/record#roboto.domain.skills.record.SkillVersionRecord). A user's subscription to the skill adds it to their personal skills and pins the version, if any, that the AI may apply for them without being asked.

Get a `Skill` from `create`, `from_id`, or `from_name`. `list_for_org` and `get_summary` return [`SkillSummary`](/docs/reference/python-sdk/roboto/domain/skills/record#roboto.domain.skills.record.SkillSummary) records instead. Each instance holds a copy of the skill's record: `update_metadata` updates that copy from Roboto's response, and `refresh` fetches changes made elsewhere.

**Parameters**

- **record** (`roboto.domain.skills.record.SkillRecord`)
- **roboto_client** (`roboto.http.RobotoClient`)

**Properties**

- **Skill.accessibility** (`roboto.domain.skills.record.SkillAccessibility`): Who can see, invoke, and edit the skill.

- **Skill.created_by** (`str`): ID of the user who created the skill, its author.

- **Skill.name** (`str`): Human-readable name of the skill.

  See [`name`](/docs/reference/python-sdk/roboto/domain/skills/record#roboto.domain.skills.record.SkillRecord.name) for where it is unique.

- **Skill.org_id** (`str`): ID of the organization that owns the skill.

- **Skill.record** (`roboto.domain.skills.record.SkillRecord`): Record of the skill that this instance holds.

- **Skill.skill_id** (`str`): Unique ID of the skill, beginning with `sk_`.

- **Skill.tags** (`list[str]`): Tags on the skill, such as `"qa-review"`.

  The list is a copy; change the skill's tags with `update_metadata`, as [`tags`](/docs/reference/python-sdk/roboto/domain/skills/record#roboto.domain.skills.record.SkillRecord.tags) describes.

#### Skill.create()

```python
@classmethod
def create(
    name: str,
    description: str,
    body: str,
    accessibility: roboto.domain.skills.record.SkillAccessibility = SkillAccessibility.Private,
    tags: Optional[collections.abc.Sequence[str]] = None,
    relevant_topics: Optional[collections.abc.Sequence[str]] = None,
    caller_org_id: Optional[str] = None,
    roboto_client: Optional[roboto.http.RobotoClient] = None,
) -> Skill
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/skills/skill.py#L45-L110)

Create a skill and its first version, version `1`.

Roboto subscribes the author with version `1` pinned, so Roboto's AI can apply the skill for the author at once. Other members of the organization who can see the skill must `subscribe` and pin a version with `set_ai_version` before the AI applies it for them on its own.

**Parameters**

- **name** (`str`): Name of the skill, at most 120 characters, matching [`SKILL_NAME_PATTERN`](/docs/reference/python-sdk/roboto/domain/skills/operations#roboto.domain.skills.operations.SKILL_NAME_PATTERN). The name of a skill shared with the organization is unique among the organization's shared skills; a private skill's name is unique among its author's private skills in the organization.
- **description** (`str`): Text telling the AI when to apply the skill, at most 500 characters ([`MAX_SKILL_DESCRIPTION_LENGTH`](/docs/reference/python-sdk/roboto/domain/skills/record#roboto.domain.skills.record.MAX_SKILL_DESCRIPTION_LENGTH)).
- **body** (`str`): Procedure the AI follows when it applies the skill.
- **accessibility** (`roboto.domain.skills.record.SkillAccessibility`): Who can see, invoke, and edit the skill. Defaults to [`Private`](/docs/reference/python-sdk/roboto/domain/skills/record#roboto.domain.skills.record.SkillAccessibility.Private), which limits all three to the author.
- **tags** (`Optional[collections.abc.Sequence[str]]`): Tags to set on the skill. `None` sets none.
- **relevant_topics** (`Optional[collections.abc.Sequence[str]]`): Names of the topics the first version's procedure investigates, such as `"/imu/data"`. `None` names none. See [`relevant_topics`](/docs/reference/python-sdk/roboto/domain/skills/record#roboto.domain.skills.record.SkillVersionRecord.relevant_topics) for how the AI uses them.
- **caller_org_id** (`Optional[str]`): Organization to create the skill in. Required when the caller belongs to more than one organization; otherwise the caller's only organization.
- **roboto_client** (`Optional[roboto.http.RobotoClient]`): Client to make requests to Roboto with. Defaults to one configured from the environment, by [`from_env()`](/docs/reference/python-sdk/roboto/http/roboto_client#roboto.http.roboto_client.RobotoClient.from_env).

**Raises**

- [`RobotoConflictException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoConflictException): The name is already taken, under the rules given for `name`.
- `pydantic.ValidationError`: `name` is longer than 120 characters or does not match `SKILL_NAME_PATTERN`, or `description` is longer than 500 characters.

**Returns**

- `Skill`

**Usage**

```python
skill = Skill.create(
    name="qa-review",
    description="Run when the user asks for a QA review of a dataset.",
    body="Step 1: load the dataset summary...",
    accessibility=SkillAccessibility.Org,
    tags=["qa-review", "triage"],
    relevant_topics=["/imu/data", "/gps/fix"],
)
print(skill.skill_id)
```

#### Skill.create_version()

```python
def create_version(
    request: roboto.domain.skills.operations.CreateSkillVersionRequest,
) -> roboto.domain.skills.record.SkillVersionRecord
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/skills/skill.py#L433-L460)

Create a version of the skill, numbered one higher than its highest version.

The author can create versions, and so can any member of the organization subscribed to an [`OrgEditable`](/docs/reference/python-sdk/roboto/domain/skills/record#roboto.domain.skills.record.SkillAccessibility.OrgEditable) skill. Subscribers keep the version they pinned; for Roboto's AI to apply the new version for them, each must pin it with `set_ai_version`.

**Parameters**

- **request** (`roboto.domain.skills.operations.CreateSkillVersionRequest`): Description, procedure, and relevant topics of the new version.

**Returns**

- `roboto.domain.skills.record.SkillVersionRecord`: Record of the new version.

**Usage**

```python
skill = Skill.from_id("sk_12345")
v2 = skill.create_version(
    CreateSkillVersionRequest(
        description="Run when ...",
        body="Updated procedure ...",
        relevant_topics=["/imu/data", "/gps/fix"],
    )
)
print(v2.version)
```

#### Skill.delete()

```python
def delete() -> None
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/skills/skill.py#L388-L401)

Delete the skill, with all its versions and every subscription to it.

Only the author can delete a skill, whatever its accessibility. Conversations in which Roboto's AI already applied the skill keep the procedure it received.

**Raises**

- [`RobotoUnauthorizedException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoUnauthorizedException): The caller is not the skill's author.

**Returns**

- `None`

**Usage**

```python
skill = Skill.from_id("sk_12345")
skill.delete()
```

#### Skill.delete_version()

```python
def delete_version(version: int) -> None
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/skills/skill.py#L488-L507)

Delete a version of the skill, and the skill itself when no other version remains.

The author can delete any version. On an [`OrgEditable`](/docs/reference/python-sdk/roboto/domain/skills/record#roboto.domain.skills.record.SkillAccessibility.OrgEditable) skill, any member of the organization subscribed to it can delete every version but the last: deleting the last version deletes the skill, which only the author can do. Subscriptions that pinned the deleted version remain, with `ai_version` set to `None`.

**Parameters**

- **version** (`int`): Number of the version to delete.

**Raises**

- [`RobotoNotFoundException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoNotFoundException): The skill has no version with this number.
- [`RobotoUnauthorizedException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoUnauthorizedException): The version is the skill's last and the caller is not its author.

**Returns**

- `None`

**Usage**

```python
skill = Skill.from_id("sk_12345")
skill.delete_version(1)
```

#### Skill.from_id()

```python
@classmethod
def from_id(
    skill_id: str,
    roboto_client: Optional[roboto.http.RobotoClient] = None,
) -> Skill
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/skills/skill.py#L113-L134)

Fetch a skill by its ID.

**Parameters**

- **skill_id** (`str`): ID of the skill.
- **roboto_client** (`Optional[roboto.http.RobotoClient]`): Client to make requests to Roboto with. Defaults to one configured from the environment, by [`from_env()`](/docs/reference/python-sdk/roboto/http/roboto_client#roboto.http.roboto_client.RobotoClient.from_env).

**Raises**

- [`RobotoNotFoundException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoNotFoundException): No skill has this ID, or the caller cannot see it.

**Returns**

- `Skill`

**Usage**

```python
skill = Skill.from_id("sk_12345")
print(skill.name)
```

#### Skill.from_name()

```python
@classmethod
def from_name(
    name: str,
    caller_org_id: Optional[str] = None,
    roboto_client: Optional[roboto.http.RobotoClient] = None,
) -> Skill
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/skills/skill.py#L164-L197)

Fetch a skill by name.

A private skill can have the same name as a skill shared with the organization. When the caller authored such a private skill, this method returns it rather than the shared one.

**Parameters**

- **name** (`str`): Name of the skill.
- **caller_org_id** (`Optional[str]`): Organization to look the skill up in. Required when the caller belongs to more than one organization; otherwise the caller's only organization.
- **roboto_client** (`Optional[roboto.http.RobotoClient]`): Client to make requests to Roboto with. Defaults to one configured from the environment, by [`from_env()`](/docs/reference/python-sdk/roboto/http/roboto_client#roboto.http.roboto_client.RobotoClient.from_env).

**Raises**

- [`RobotoNotFoundException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoNotFoundException): The organization has no skill with this name that the caller can see.

**Returns**

- `Skill`

**Usage**

```python
skill = Skill.from_name("qa-review")
print(skill.accessibility)
```

#### Skill.get_summary()

```python
@classmethod
def get_summary(
    skill_id: str,
    roboto_client: Optional[roboto.http.RobotoClient] = None,
) -> roboto.domain.skills.record.SkillSummary
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/skills/skill.py#L137-L161)

Fetch a skill's summary: the skill, its latest version, and the caller's subscription to it.

Returns the same summary `list_for_org` yields for this skill, without listing the organization's skills.

**Parameters**

- **skill_id** (`str`): ID of the skill.
- **roboto_client** (`Optional[roboto.http.RobotoClient]`): Client to make requests to Roboto with. Defaults to one configured from the environment, by [`from_env()`](/docs/reference/python-sdk/roboto/http/roboto_client#roboto.http.roboto_client.RobotoClient.from_env).

**Raises**

- [`RobotoNotFoundException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoNotFoundException): No skill has this ID, or the caller cannot see it.

**Returns**

- `roboto.domain.skills.record.SkillSummary`

**Usage**

```python
summary = Skill.get_summary("sk_12345")
print(summary.latest_version.version)
if summary.subscription is None:
    print("Not subscribed")
```

#### Skill.get_version()

```python
def get_version(version: int) -> roboto.domain.skills.record.SkillVersionRecord
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/skills/skill.py#L415-L431)

Fetch one version of the skill.

**Parameters**

- **version** (`int`): Number of the version.

**Raises**

- [`RobotoNotFoundException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoNotFoundException): The skill has no version with this number.

**Returns**

- `roboto.domain.skills.record.SkillVersionRecord`

**Usage**

```python
skill = Skill.from_id("sk_12345")
v2 = skill.get_version(2)
print(v2.body)
```

#### Skill.list_for_org()

```python
@classmethod
def list_for_org(
    scope: Optional[roboto.domain.skills.operations.SkillListScope] = None,
    caller_org_id: Optional[str] = None,
    roboto_client: Optional[roboto.http.RobotoClient] = None,
) -> collections.abc.Generator[roboto.domain.skills.record.SkillSummary, None, None]
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/skills/skill.py#L226-L283)

List summaries of the skills the caller can see in the organization, most recently modified first.

The caller can see every skill shared with the organization, the private skills they authored, and the skills that Roboto ships. Each summary holds the skill's record, its latest version, and the caller's subscription to it, if any. Summaries are fetched a page at a time as you iterate.

**Parameters**

- **scope** (`Optional[roboto.domain.skills.operations.SkillListScope]`): Which of those skills to list: [`Personal`](/docs/reference/python-sdk/roboto/domain/skills/operations#roboto.domain.skills.operations.SkillListScope.Personal) for the skills the caller authored or subscribed to, [`Org`](/docs/reference/python-sdk/roboto/domain/skills/operations#roboto.domain.skills.operations.SkillListScope.Org) for the shared skills someone else authored, or [`Roboto`](/docs/reference/python-sdk/roboto/domain/skills/operations#roboto.domain.skills.operations.SkillListScope.Roboto) for the skills that Roboto ships. `None` lists every skill the caller can see, with the skills that Roboto ships first.
- **caller_org_id** (`Optional[str]`): Organization to list the skills of. Required when the caller belongs to more than one organization; otherwise the caller's only organization.
- **roboto_client** (`Optional[roboto.http.RobotoClient]`): Client to make requests to Roboto with. Defaults to one configured from the environment, by [`from_env()`](/docs/reference/python-sdk/roboto/http/roboto_client#roboto.http.roboto_client.RobotoClient.from_env).

**Yields**

- [`SkillSummary`](/docs/reference/python-sdk/roboto/domain/skills/record#roboto.domain.skills.record.SkillSummary) of each skill.

**Returns**

- `collections.abc.Generator[roboto.domain.skills.record.SkillSummary, None, None]`

**Usage**

Print the skills the caller authored or subscribed to, with the version each one pins:

```python
for summary in Skill.list_for_org(scope=SkillListScope.Personal):
    print(summary.skill.name, summary.subscription.ai_version if summary.subscription else None)
```

Collect every skill the caller can see:

```python
all_visible = list(Skill.list_for_org())
```

List only the skills that Roboto ships:

```python
for summary in Skill.list_for_org(scope=SkillListScope.Roboto):
    print(summary.skill.name, [resource.slug for resource in summary.latest_version.resources])
```

#### Skill.list_known_tags()

```python
@classmethod
def list_known_tags(
    caller_org_id: Optional[str] = None,
    roboto_client: Optional[roboto.http.RobotoClient] = None,
) -> list[str]
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/skills/skill.py#L200-L223)

List the distinct tags on the skills the caller can see in the organization, in alphabetical order.

Tags on other users' private skills are left out.

**Parameters**

- **caller_org_id** (`Optional[str]`): Organization to list the tags of. Required when the caller belongs to more than one organization; otherwise the caller's only organization.
- **roboto_client** (`Optional[roboto.http.RobotoClient]`): Client to make requests to Roboto with. Defaults to one configured from the environment, by [`from_env()`](/docs/reference/python-sdk/roboto/http/roboto_client#roboto.http.roboto_client.RobotoClient.from_env).

**Returns**

- `list[str]`

**Usage**

```python
for tag in Skill.list_known_tags():
    print(tag)
```

#### Skill.list_versions()

```python
def list_versions() -> list[roboto.domain.skills.record.SkillVersionRecord]
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/skills/skill.py#L403-L413)

List the skill's versions, highest version number first.

**Usage**

```python
skill = Skill.from_id("sk_12345")
for version in skill.list_versions():
    print(version.version, version.description)
```

**Returns**

- `list[roboto.domain.skills.record.SkillVersionRecord]`

#### Skill.refresh()

```python
def refresh() -> Skill
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/skills/skill.py#L339-L353)

Fetch the skill's record from Roboto again, replacing this instance's copy.

**Returns**

- `Skill`: This instance, with its record updated from Roboto's response.

**Raises**

- [`RobotoNotFoundException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoNotFoundException): The skill has been deleted, or the caller can no longer see it.

**Usage**

```python
skill = Skill.from_id("sk_12345")
print(skill.refresh().name)
```

#### Skill.set_ai_version()

```python
def set_ai_version(
    version: Optional[int],
) -> roboto.domain.skills.record.SkillSubscriptionRecord
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/skills/skill.py#L541-L570)

Pin the version of the skill that Roboto's AI may apply for the caller without being asked.

Subscribes the caller if they are not subscribed. Any caller who can see the skill can pin a version.

**Parameters**

- **version** (`Optional[int]`): Number of the version to pin. `None` keeps the subscription but stops the AI from applying the skill on its own; the caller can still invoke it in a chat message.

**Returns**

- `roboto.domain.skills.record.SkillSubscriptionRecord`: Caller's subscription to the skill.

**Raises**

- [`RobotoNotFoundException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoNotFoundException): The skill has no version with this number.

**Usage**

Let the AI apply version 2 on its own:

```python
skill = Skill.from_id("sk_12345")
skill.set_ai_version(2)
```

Stop the AI from applying the skill on its own, but keep the subscription so the caller can still invoke it in a chat message:

```python
skill.set_ai_version(None)
```

#### Skill.subscribe()

```python
def subscribe() -> roboto.domain.skills.record.SkillSubscriptionRecord
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/skills/skill.py#L509-L526)

Subscribe the caller to the skill, adding it to their personal skills.

Any caller who can see the skill can subscribe. A new subscription pins no version, so Roboto's AI applies the skill only when the caller invokes it; pin a version with `set_ai_version`. If the caller is already subscribed, Roboto returns that subscription unchanged.

**Returns**

- `roboto.domain.skills.record.SkillSubscriptionRecord`: Caller's subscription to the skill.

**Usage**

```python
skill = Skill.from_id("sk_12345")
subscription = skill.subscribe()
print(subscription.ai_version)
```

#### Skill.unsubscribe()

```python
def unsubscribe() -> None
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/skills/skill.py#L528-L539)

Delete the caller's subscription to the skill, so Roboto's AI no longer applies it without being asked.

Does nothing if the caller is not subscribed. A caller who is not the author can no longer invoke the skill and no longer sees it among their personal skills. An author who unsubscribes still sees the skill there and can subscribe again.

**Usage**

```python
skill = Skill.from_id("sk_12345")
skill.unsubscribe()
```

**Returns**

- `None`

#### Skill.update_metadata()

```python
def update_metadata(
    request: roboto.domain.skills.operations.UpdateSkillMetadataRequest,
) -> Skill
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/skills/skill.py#L355-L386)

Update the skill's name, accessibility, or tags.

The author can change every field. On an [`OrgEditable`](/docs/reference/python-sdk/roboto/domain/skills/record#roboto.domain.skills.record.SkillAccessibility.OrgEditable) skill, any member of the organization subscribed to it can change the name and tags, but only the author can change its accessibility. Making a shared skill private deletes every subscription to it except the author's.

**Parameters**

- **request** (`roboto.domain.skills.operations.UpdateSkillMetadataRequest`): Fields to change. A field left unset is unchanged.

**Returns**

- `Skill`: This instance, with its record updated from Roboto's response.

**Raises**

- [`RobotoConflictException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoConflictException): The new name is already taken, or the request shares a private skill whose name a shared skill already has.
- [`RobotoUnauthorizedException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoUnauthorizedException): The request sets `accessibility` and the caller is not the author.

**Usage**

```python
skill = Skill.from_id("sk_12345")
skill.update_metadata(
    UpdateSkillMetadataRequest(
        accessibility=SkillAccessibility.Org,
        put_tags=["qa-review"],
    )
)
```

#### Skill.update_version()

```python
def update_version(
    version: int,
    request: roboto.domain.skills.operations.UpdateSkillVersionRequest,
) -> roboto.domain.skills.record.SkillVersionRecord
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/skills/skill.py#L462-L486)

Update a version of the skill in place.

The same users who can create versions can update them. Roboto keeps no copy of the earlier values, so subscribers who pinned this version get the new content the next time Roboto's AI applies the skill for them. To leave them on the current content, create a version with `create_version` instead.

**Parameters**

- **version** (`int`): Number of the version to update.
- **request** (`roboto.domain.skills.operations.UpdateSkillVersionRequest`): Fields to change. A field left unset is unchanged.

**Returns**

- `roboto.domain.skills.record.SkillVersionRecord`: Record of the version, as updated.

**Raises**

- [`RobotoNotFoundException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoNotFoundException): The skill has no version with this number.

**Usage**

```python
skill = Skill.from_id("sk_12345")
skill.update_version(2, UpdateSkillVersionRequest(body="..."))
```
