# Agent Skills

An [Agent Skill](https://agentskills.io/specification) is a folder with a `SKILL.md` that an agent
loads when its description matches the task: the same folder works in several hosts. Récit writes
its skills from one source, the guides served by the [MCP server](/documentation/ai/mcp), and never
by hand.

```bash
npx recit skills export                       # one skill per guide, in ./skills
npx recit skills export --only scenario       # recit-scenario only (repeatable)
npx recit skills export --bible ./cast.md     # the skill of each character of a bible
npx recit skills export --bible ./cast.md --character lorem --output .claude/skills
```

The guides need `@recit/mcp`, and a bible needs `@recit/scenario`: both are optional packages of the
CLI, and the command says so when one is missing. `@recit/scenario` is not on npm yet: `--bible`
works from a clone of Récit until it is published.

## Skills of the guides

Each guide `recit://guide/<name>` becomes the skill `recit-<name>`: `recit-scenario`,
`recit-character`, `recit-atelier` (the guided writing workshop, `recit://guide/atelier`),
`recit-premise`, `recit-interview`, `recit-art-direction`, `recit-world`, `recit-breakdown`,
`recit-continuity`, `recit-revision`, `recit-motion`, `recit-deck`, `recit-pixel`, and one per
format with a guide (`recit-report`, `recit-webtoon`, `recit-book`…). Its body is the guide, word
for word, after one line saying it is generated; its `metadata` names the guide and the version of
the CLI.

## The skill of a character

With `--bible`, each character of the [bible](/documentation/scenario/bible) gets a folder named
after its id:

| File                    | What it holds                                                                                                                  |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| `SKILL.md`              | who the character is, its voice, its values, what it never says, the rules, its identity block, what no image shows, its poses |
| `references/bible.md`   | the whole bible, the source of everything else                                                                                 |
| `references/sets.md`    | the sets, their light, props and shots                                                                                         |
| `references/style.md`   | the drawing styles                                                                                                             |
| `references/prompts.md` | the image prompts of the character, derived from the bible, with their fingerprints                                            |
| `assets/`               | its reference images, and their [provenance](/documentation/scenario/provenance) when registered                               |

With it, an agent writes in the voice of the character without Récit. A trait the author has not
validated yet (`{inferred}` in the bible) stays marked as such in the skill, and the skill tells the
agent never to present it as a fact.

## For opencode

With `--target opencode`, each skill is written as an opencode role in `.opencode/agent/<name>.md`,
where opencode reads the roles of the project (`--output` still changes the folder):

```bash
npx recit skills export --target opencode
npx recit skills export --target opencode --bible ./cast.md
```

Each file carries the skill's `description`, `mode: subagent` (no `model`, so the project keeps its
own), and a `permission` block that lets the role edit the project (`edit: allow`), asks before
running shell commands (`bash` `"*": ask`), and denies publishing, network fetches and paths outside
the project (`"*git push*": deny`, `"*git *push*": deny`, `"*git tag*": deny`, `"*git *tag*": deny`,
`"*publish*": deny`, `"*vercel*": deny`, `webfetch: deny`, `external_directory: deny`), followed by
the skill's body. When a skill has attached files — such as a character from `--bible` — they go in
`.opencode/agent/<name>/` next to `<name>.md`, with a line at the top of the body pointing to
`.opencode/agent/<name>/` relative to the project root.

## Rules

- Every skill is checked against the specification before a file is written: a name of 1 to 64
  lowercase letters, digits and single hyphens, equal to its folder; a description of 1 to 1024
  characters that says what the skill does and when to use it; a body under 500 lines; files one
  level deep in `scripts/`, `references/` or `assets/`.
- A generated folder or role file is written again in full on the next export. A folder or file that
  `recit skills export` did not write is never overwritten: the command stops and names it.
- Never edit a generated `SKILL.md` or `.opencode/agent/<name>.md`: edit the guide or the bible,
  then export again.
