# Reference-Grounded Narrative Sequence Skill

Generate continuity-safe narrative image sequences and clean standalone keyframes from one or more reference images plus a supplied style directive.

Do not use this skill for plain image-editing requests. If the user wants a direct edit, retouch, replacement, inpainting, outpainting, or the same explicit change applied across multiple images, route that request to `image-generation` instead.

## What it does

This skill is designed for narrative visual storytelling. It can:

- build a default 6-panel sequence from one or many references
- interpret reference roles such as anchor shot, character, location, prop, style/mood, and detail cue
- preserve identity, wardrobe, props, environment, and style across panels
- use a cinematic narrative profile by default
- adapt to next-scene continuation, character emotional continuation, environment/detail progression, and illustrated sequences
- recreate any selected panel as a clean standalone image without labels, borders, or text overlays

## Inputs

Expected inputs may include:

- one or more reference images
- a description for each image
- a style directive from the user, orchestrator, or production bible
- optional adaptation profile
- optional panel count
- optional continuity priorities
- optional output mode (`collage`, `clean_extract`, or both)

## Orchestrator contract

The orchestrator should pass normalized inputs whenever possible:

- `referenceImages[]`
- `referenceImages[].description`
- `referenceImages[].role` when known
- `styleDirective`
- `adaptationProfile`
- `panelCount`
- `continuityPriorities`
- `outputMode`
- `targetPanel` for extraction requests

Conflict resolution precedence:
1. explicit orchestrator instruction
2. production bible / visual bible
3. explicit user request
4. anchor shot reference
5. other references
6. inferred defaults

## Tool usage

If an image-generation tool is available in the runtime, the skill should use it to generate the sequence or clean extracted frame.

Example: use an available MCP image-generation tool such as a Kalasetu generate-image tool.

If no image-generation tool is available, the skill should still produce structured prompts and panel plans for downstream generation.

## Default behavior

- Default panel count: **6**
- Default profile: **cinematic_narrative**

Example default cinematic grammar:
1. establishing wide
2. medium wide subject placement
3. medium
4. medium close-up or close-up
5. insert detail / reaction / over-shoulder
6. final hero frame / payoff

This is a starting point, not a restriction.

## Clean frame extraction

The skill is also designed to support follow-up requests like:

- extract panel 4
- recreate the 4th frame clean
- remove labels and borders from panel 3

Every panel should be recoverable as a clean standalone image.

## Example invocations

### 1) Single anchor image
"Use this image as the anchor shot. Create a 6-panel cinematic narrative sequence that preserves the same character and location. Style: moody grounded realism."

### 2) Multi-reference narrative sequence
"Create a 6-panel narrative sequence using these references: image 1 is the main character, image 2 is the lakeside location, image 3 is the lantern prop. Keep continuity across all panels. Style: cold dawn cinematic tone."

### 3) Next-scene continuation
"This first image is the anchor frame. Continue the next scene in 6 panels. Keep the same environment, wardrobe, and atmosphere."

### 4) Character emotional continuation
"Use this character reference and build a 6-panel emotional continuation sequence. Focus on subtle expression changes and continuity of lighting and costume."

### 5) Environment/detail progression
"Using this anchor shot and this water-surface detail reference, create a 6-panel environment/detail progression where the reflection in the water becomes an important narrative beat."

### 6) Clean extraction request
"Extract panel 4 as a clean standalone image with no text, no borders, and no collage artifacts."

## Installation

```bash
npx skills i ./reference-grounded-narrative-sequence-skill
```
