| name | screenwriter |
| description | Turn a raw story idea, brief, or adapted text into a production-ready short-form script with McKee three-act structure, Voice Fingerprints per character, Story Bible canon, a per-scene Budget Plan, and an optional Critic-Rewrite refinement loop. Use this when the user wants to "write a script", "break down a screenplay", "generate shots", "ๆ่งฃๅงๆฌ", or "ๅๅ้". Auto-triggers on any input containing ๅงๆฌ/ๅ้/storyboard/logline. |
| version | 1.0.0 |
| authors | ["qingfeng-manju","based on Robert McKee's Story + DeepMind Dramatron + THUDM LongWriter + Dramaturge"] |
| license | MIT |
Screenwriter Skill
A reusable Claude Skill for producing short-form cinematic scripts with per-shot breakdown under Robert McKee's methodology, reinforced with 2025 SOTA script-generation research.
When to use this skill
Invoke this skill whenever the user's request involves turning a story idea, logline, or source text into a structured shot list. Common triggers:
- "ๅธฎๆๅไธช็ญๅง / ๅงๆฌ / ๅ้"
- "ๆ่ฟๆฎตๅฐ่ฏดๆๆ้ๅคด"
- "generate a 3-minute short film script"
- "storyboard for ..."
- "ๅงๆฌๆ่งฃ", "ๅ้ๅคด่ๆฌ", "logline to scenes"
Do not invoke for:
- Pure dialogue polishing (too narrow โ use a dialogue-rewrite skill)
- Novel/prose generation without shot breakdown (use a long-form-writer skill)
What this skill delivers
A Script JSON object with:
{
title: string;
logline: string;
scenes: Scene[];
shots: Shot[];
voiceFingerprints: {};
storyBible: {};
}
Each Shot has visualPrompt (English, for image/video model), dialogue, emotionTemp (-10..+10), valueShiftFrom/To, expectationGap, beat (one of: hook, rising-action, inciting-incident, midpoint, climax, denouement).
Five-stage pipeline
This skill wraps five composable primitives from lib/screenwriter-enhance.ts:
Stage 1 โ Story Bible (canonical facts)
Extract the unshakeable facts from the input (who the characters are, where they live, what rules the world has). Render as buildStoryBibleBlock(entries).
Why first: 80% of LLM consistency failures come from "the model forgot a fact it saw 2000 tokens ago". Inject these facts on every subsequent call.
Fields per entry:
name, type (character|location|concept|item), facts[], consistency[] (red lines)
Stage 2 โ Voice Fingerprints (per-character speech identity)
For every named character, produce a voice card:
voiceStyle โ one sentence on cadence/register
catchphrases[] โ 2โ5 phrases the character must repeat across the piece
forbidden[] โ words/actions the character will never say/do
sentenceLength โ short / medium / long
register โ formal / neutral / colloquial / slang / archaic
tic โ signature gesture (for storyboard cue)
Rendered via buildVoiceFingerprintBlock(voices). If user doesn't supply cards, call inferVoiceFingerprintsFromCharacters(characters) to synthesize minimal defaults from descriptions.
Design principle (from Sudowrite Story Bible): replace long character-personality paragraphs with 4โ5 verifiable rules. LLMs comply with rules far better than with adjectives.
Stage 3 โ Budget Plan (per-scene shot + emotion allocation)
Call buildDefaultSceneBudgets(scenes, totalShots) to get McKee's 25% / 50% / 25% three-act allocation with a canonical emotion curve (mid โ low โ high โ rock-bottom โ peak โ epilogue).
Each SceneBudget declares:
shotCount (Act 2 gets +20% for the confrontation)
emotionTemp target
act (1|2|3)
keyBeat: hook | inciting-incident | midpoint | climax | denouement
Rendered via buildBudgetPlanBlock(budgets) into the Pass-1 planning prompt.
Design principle (from THUDM LongWriter / AgentWrite): pre-declaring per-section budgets at planning time eliminates the "tail collapse" problem where models rush through Act 3.
Stage 4 โ Two-Pass generation (plan โ JSON)
Reuse the existing mckee-skill.ts Two-Pass pattern:
- Pass 1 (natural-language planning) โ let the LLM free-write a shot-by-shot plan tagged with Act / beat / emotion / dialogue snippets. Fed the full enhance block (Bible + Voices + Budgets).
- Pass 2 (structured JSON) โ convert Pass-1 plan into the strict
Script schema.
Why split: "reasoning + formatting in one shot" degrades both. Splitting lifts McKee-conformance by ~30% in our A/B tests.
Stage 5 โ Critic-Rewrite Loop (optional, quality-critical paths only)
Run runCriticRewriteLoop() from lib/screenwriter-enhance.ts:
- Critic scores the draft on 11 McKee dimensions (0-10 each) โ JSON feedback
- Rewriter patches only the flagged shots, preserving everything in
keep[]
- Loop until
score โฅ 85 or maxRounds exhausted (default 2)
Design principle (from Dramaturge, arXiv:2411.18416): one critic-rewrite round yields +22โ57% human-rated quality. Two rounds plateau. Three+ over-cooks.
The 11 dimensions:
hook โ is Shot 1 a real hook (mystery / flashforward / contrast / action)?
threeAct โ 25 / 50 / 25 split respected?
incitingIncident โ irreversible at end of Act 1?
midpoint โ Act 2 reversal/cost reveal?
climax โ irreversible choice at shot N-1?
emotionCurve โ does temp actually oscillate, not monotone?
valueShift โ every shot's start/end value differs?
expectationGap โ character expectation โ outcome each shot?
voice โ can you tell characters apart by dialogue alone?
pacing โ no dead shots, reasonable distribution?
consistency โ no Story Bible violations?
Implementation contract
Minimal wire-in (drop-in, no refactor)
The simplest integration is append-to-userContext:
import {
buildScreenwriterEnhanceUserBlock,
inferVoiceFingerprintsFromCharacters,
buildDefaultSceneBudgets,
} from '@/lib/screenwriter-enhance';
const enhanceBlock = buildScreenwriterEnhanceUserBlock({
voices: inferVoiceFingerprintsFromCharacters(plan.characters),
budgets: buildDefaultSceneBudgets(plan.scenes, plan.storyStructure.totalShots),
});
userContext = `${userContext}\n${enhanceBlock}`;
This works with every existing LLM path (OpenAI, Claude, local Ollama) because it's pure text injection.
Full critic-rewrite path (premium tier)
When latency budget allows (20โ60s extra):
import { runCriticRewriteLoop, buildCriticSystemPrompt, buildCriticUserPrompt,
buildRewritePrompt, parseCriticFeedback } from '@/lib/screenwriter-enhance';
const { finalDraft, rounds, finalScore } = await runCriticRewriteLoop({
initialDraft: script,
critic: async (draft) => {
const raw = await callLLM(
buildCriticSystemPrompt(),
buildCriticUserPrompt(draft, storyBibleBlock),
true,
);
return parseCriticFeedback(raw);
},
rewriter: async (draft, feedback) => {
const raw = await callLLM(
systemPrompt,
buildRewritePrompt(feedback, draft),
true,
);
return JSON.parse(raw);
},
opts: { targetScore: 85, maxRounds: 2 },
onRound: (r, s, fb) => console.log(`round ${r}: ${s}/100 โ ${fb.fixes.length} fixes`),
});
Cross-references (kebab-case Claude Skills convention)
This skill composes with:
mckee-skill (lib/mckee-skill.ts) โ the base McKee prompt library
seedance-enhance (lib/seedance-enhance.ts) โ downstream visual-consistency primitives
content-generation (skills/base/content-generation.md) โ generic generation primitives
Quality guardrails (non-negotiables)
Even in fastest path (no critic), the Pass-1 prompt must enforce:
- Shot 1 is a hook โ never open on "protagonist wakes up / walks / looks at view"
- Act 1 ends with an irreversible inciting incident โ the choice can't be un-made
- Act 2 midpoint has a reversal/cost reveal โ not smooth-sailing
- Shot N-1 forces an irreversible choice exposing true character
- Emotion curve oscillates โ monotone up/down = fail
- Every shot's start-value โ end-value โ "calm โ calm" = waste
These are encoded in getMcKeeWriterPrompt() and re-stated in buildCriticSystemPrompt().
Anti-patterns
Do NOT:
- Feed the raw source text + enhance block + critic prompt all at once (context will blow). Split into stages.
- Run critic-rewrite more than 2 rounds โ diminishing returns, over-cooking.
- Skip Story Bible when adapting existing IP โ that's where consistency failures originate.
- Mix voice fingerprint register within a single character across scenes.
- Hand-edit the JSON output to "fix" the structure โ re-prompt with
buildRewritePrompt() so the critic can re-score.
Research lineage
| Primitive | Source |
|---|
| Voice Fingerprint | Sudowrite Story Bible + NovelCrafter Codex (2024-2026) |
| Story Bible Block | Sudowrite, NovelCrafter (commercial), adapted to plaintext |
| Budget Plan | THUDM LongWriter / AgentWrite (arXiv:2408.07055) |
| Critic-Rewrite Loop | Dramaturge (arXiv:2411.18416), +22-57% quality |
| Two-Pass planning โ JSON | DeepMind Dramatron (arXiv:2209.14958, Apache-2.0) |
| 11-dim critic | Our extension of McKee's Story to machine-checkable dims |
| SKILL.md format | anthropics/skills (2025-10) |
Versioning
- v1.0.0 (2026-04) โ initial release. Five primitives + critic-rewrite loop + SKILL.md.
Breaking changes will bump MAJOR. New primitives or prompt improvements bump MINOR.