# Scenario

A **bible** describes once the characters, the sets, the visual style and the narrative structure of
a story world. Stories of every format point to it by `id`, the way they point to data instead of
copying numbers. Récit **never calls a model**: it describes, checks and traces; you, your agent and
the image tool of your choice do the rest.

## Three levels, each one works alone

| Level           | Who works                                      | What Récit gives                                                      |
| --------------- | ---------------------------------------------- | --------------------------------------------------------------------- |
| 0 — without AI  | the author, by hand                            | the bible and the stories in Markdown, the CLI, placeholder images    |
| 1 — with agent  | any MCP host, or an agent that reads the guide | the guides `recit://guide/scenario` and `recit://guide/character`     |
| 2 — with images | the image tool the author chose, outside Récit | prompts written as data in the bible, and a provenance file per image |

To be guided from the first idea, the guide `recit://guide/atelier` (skill `recit-atelier`) leads an
agent through the writing workshop: nine steps, questions before any generation, and a gate where
the author chooses at the end of each creative step.

No level depends on a service hosted by Récit or on a given AI provider.

## The method

1. **Brief**: who, where, the tone, the formats, the languages. List what is missing instead of
   filling it.
2. **[Bible](/documentation/scenario/bible)**: one file, `cast.md`, one entry per character, set,
   style, prompt and beat template.
3. **Beats**: pick a template of the bible, `hook-tension-payoff` for 3 to 5 scenes, `three-act` for
   longer ones. A checklist, not a mould.
4. **Story**: one micro-story per idea, in an existing format, one scene per beat.
5. **[Prompts and provenance](/documentation/scenario/provenance)**: each image is a prompt entry of
   the bible; once generated outside Récit, it gets a provenance file.
6. **Render** with the CLI, with placeholders until the images exist.

## The golden rule: no invented trait

A trait the author did not give — a voice, a value, an ambience — ends with `{inferred}` until a
human validates it. An agent that reads the guide proposes; it never presents a guess as a fact.

## The example

`examples/scenario-lorem` holds a Lorem bible in English and French (one character, two sets, a
style, three prompts, two beat templates) and three micro-films in `motion`, with ` ```pixel `
sprites as placeholder images and no generated image at all.

## A story that uses the bible

A story of any narrative format names its bible in its front matter, `cast: ./cast.md` (or a list),
and its scenes point to the entries by `id`:

```md
--- id=hook beat=hook set=rooftop-night cast=lorem pose=waving prompt=p-rooftop-wave
```

`beat`, `cast`, `set`, `shot`, `pose`, `expression` and `prompt` are metadata: they change no render
by themselves, and every one of them is checked against the bible. With a
[described character](/documentation/scenario/bible#a-described-character-preview), `animation=`
names a cycle of its model or an animation of the scene (a `:::animation` block in the scene, with
`cast=` when it has several characters), and `render=` one of its renders.

| Command                                         | What it does                                                                                                                                                  |
| ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `recit validate cast.md`                        | the bible against its schema and its rules, with the line of each problem                                                                                     |
| `recit validate night.story.md`                 | the story, then its scenario: unknown references at their line, beats missing or out of order, scenes unlike their prompt, images missing or stale (warnings) |
| `recit validate --strict …`                     | publication: inferred traits, placeholder images and images with no provenance are errors                                                                     |
| `recit convert cast.md`                         | the typed JSON of the bible (`kind: "bible"`), and back with `recit convert cast.json`                                                                        |
| `recit prompts build night.story.md`            | one `<id>.txt` per prompt and a `prompts.json` in `prompts/`; `--placeholders` adds an SVG placeholder per missing image                                      |
| `recit assets register cover.png --prompt <id>` | the provenance of an image, see [Provenance](/documentation/scenario/provenance)                                                                              |
| `recit i18n check`                              | `cast.fr.md` keeps the entries and every never-localised field of `cast.md`                                                                                   |

These commands come from `@recit/scenario`, installed next to `@recit/cli`; without it they say so.
`@recit/scenario` is **not on npm yet**: it is private in the repository, a preview outside the 1.0,
and the commands above work from a clone of Récit until the package is published.

## Settings

The `scenario:` section of `recit.config.ts` holds two keys. Récit never calls a model: a provider
adapter is a text template, filled from the bible by `recit prompts build`.

| Key                        | What it is                                                                                                                                                                                   |
| -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `scenario.promptTemplates` | templates by name (lowercase kebab-case), their `{style}`, `{subject}`, `{palette}`, `{set}`, `{shot}`, `{pose}`, `{expression}`, `{action}`, `{aspect}` and `{avoid}` filled from the bible |
| `scenario.template`        | the template `recit prompts build` uses without `--template` (default `generic`)                                                                                                             |

```ts title="recit.config.ts"
import { defineConfig } from "recit/config";

export default defineConfig({
  scenario: {
    template: "lorem-tool",
    promptTemplates: { "lorem-tool": "{style}. {subject}, {set}, {shot}. {action}. Avoid: {avoid}" },
  },
});
```

A template named `generic` replaces the shipped one. The `--template` option of
`recit prompts build`, followed by a template's name (`lorem-tool` here), overrides the key for one
run, and `--placeholders` writes an SVG for each prompt whose image does not exist yet.

## Reading a diagnostic

Every problem is reported with its file and its line, one per line, in the form of the whole CLI:

```text
✖ cast.md:42 — p-rooftop-wave: set "rooftop" is not a set of the bible
⚠ night.story.md:7 — wave: the image cast/wave.png is stale, prompt p-rooftop-wave changed since it was registered
```

A bible written in JSON gives the path instead of the line (`cast.json /entries/3/set`). With
`--strict`, the warnings of publication become errors; see
[the bible](/documentation/scenario/bible#validating-a-bible).
