---
name: series-writing-skill
description: Use for mechanism-backed development of multi-episode series — Chinese horizontal long dramas, American TV, and Korean mini-series (미니시리즈): diagnosis, outlining, rewriting, IP adaptation, pilot design, season engine design, pitch decks, series bibles, and continuity management, backed by prebuilt mechanism cards with explicit content_quality boundaries, authorized cloud mechanism search plus cloud references (full-text capability probe only), and authorized cloud worldbuilding mechanism search through the same route for relationship structures, power structures, and long-arc rules. Trigger when the user asks about 案例拆解, 机制提取, 对标, 机制级仿写, 横屏剧, 长剧, 电视剧, 剧集, 连续剧, 国产剧, 美剧, American TV, TV pilot, pilot script, show bible, series bible, pitch deck, continuity bible, story bible, teaser, cold open, act break, A/B/C story, half-hour, one-hour, sitcom, procedural, limited series, showrunner, writers room, 韩剧, K-drama, Korean drama, 미니시리즈, 대본, 감정선, 韩式编剧思维, 零帧思维, tvN, JTBC, 分集大纲, 分场大纲, 人物群像, 长线悬念, 单集节奏, 集尾钩子, 엔딩, 季/集结构, 跨集一致性, 续写, 保持设定, 不要前后矛盾, IP改编, 小说改剧, 古偶, 现偶, 权谋, 悬疑, 仙侠, 都市情感, 家庭剧, 行业剧, or 剧本诊断/场景改写/对白 work on episodic series. Feature films and single-movie scripts belong to the movie-development skill; anything multi-episode belongs here.
---

<!-- online-auth-upgrade -->
<!-- online-runtime-policy:start -->
## Online Authorization

This online build is locked. Before reading protected references, searching protected libraries, diagnosing, writing, or generating task output, verify authorization through the Tencent Cloud service.

- Skill ID: `series-writing-skill`
- Verification: activation code or phone credential plus local device fingerprint.
- Protected references and databases live on the server.
- HTTPS-only server: `https://superskill.online`
- Never send credentials, device identity, authorization caches, searches, or protected requests over HTTP. If HTTPS is unavailable, fail closed instead of retrying a plaintext endpoint. `WOO_API_BASE` overrides must also use HTTPS.
- Public skill updates are checked before protected database authorization. If the server reports a newer public package, download only the public skill package, verify it, back up the old folder, replace it, then restart the conversation if `SKILL.md` changed.
- If the local skill folder cannot be replaced because of permissions, stop automatic replacement and show the latest public package URL, SHA256, version, and manual install rule. The zip filename may include a date suffix, but the extracted root folder and `SKILL.md` name must remain `series-writing-skill`.
- Always display the exact formal Skill ID `series-writing-skill`. Do not replace it with a translated name, product nickname, or invented alias.
- On every new conversation, run `ensure-auth` first. It reuses a valid local cache or refreshes an expired/missing cache with the last credential. States such as `local_cache_expired_refreshable` are not evidence that the cloud license expired.
- If the server returns `SKILL_MISMATCH`, stop this Skill and show the exact `authorized_skill_ids` and their safe guide/download targets. Tell the user to install that formally named Skill; do not reset the device or claim the authorization expired.
- For other authorization failures, show the client's structured `error_code` and safe reason. Old servers may still return the generic compatibility message.

Required first step:

```bash
python3 scripts/online_version_guard.py status
python3 scripts/auth_client.py ensure-auth
```

Only if `ensure-auth` reports `credential_missing`, ask for the activation code or phone number:

```bash
python3 scripts/auth_client.py ensure-auth --credential <ACTIVATION_CODE_OR_PHONE>
```

Use remote protected data only through:

```bash
python3 scripts/auth_client.py search "<query>" --top-k 6
python3 scripts/auth_client.py list-refs
python3 scripts/auth_client.py read-ref <name>
```

## Mandatory Creative Retrieval Gate 创作检索硬门

For every creative task—including diagnosis, adaptation, outline, scene, dialogue, script, generation, continuation, and rewrite—do not produce creative content until:

1. The public version check and authorization succeed.
2. At least one task-specific `auth_client.py search` succeeds; project-scale or batch work requires at least two complementary searches.
3. An internal retrieval intake records each adopted anonymous card id, transferable mechanism, intended placement, and originality boundary.
4. Unusable results are reformulated up to two times. If every API base fails, do not claim database use; report degraded mode and obtain permission before continuing without protected evidence.
5. The creative delivery ends with a one-line receipt: `云端机制库：检索 N 次，返回 N 条，采用功能：……`.

After the first successful bind, later commands omit `--credential`; the client reuses the most recent credential and automatically refreshes the local cache when necessary. The stable machine identity is shared by Codex and Claude when they run as the same local OS user; an isolated machine identity is allowed only in explicit test mode. Exceptions to the creative retrieval gate are limited to install/update/auth troubleshooting, format-only conversion, or non-creative organization of user-supplied text. Queries must abstract private material and must not send unpublished names, full plots, trade secrets, or long source passages.

Runtime policy v3 requires HTTPS-only API transport and reads `runtime_policy.full_text_mode` from `online-version.json`: `evidence_required` requires usable anonymous full-text evidence, `evidence_optional` allows it as supplemental evidence, `capability_probe_only` is only an endpoint probe, and `unavailable` disables it. A probe or unavailable full-text endpoint never satisfies the mandatory protected creative search above.

Online runtime precedence: any later protected-reference operation, protected library search, or protected full-text operation maps exclusively to the authorized `auth_client.py read-ref`, `search`, or `full-text-search` command. Local protected paths and scripts are non-executable in this edition. Protected data is not present in the public package.
<!-- online-runtime-policy:end -->



# Series Writing Skill

> **Edition: ONLINE-AUTHORIZED.** Protected references, series mechanisms, public-script evidence, and worldbuilding mechanisms use the authorized API. Public local tools are limited to user-project scaffolding and deterministic QA.

This skill develops Chinese horizontal dramas, American TV, and Korean mini-series. It emphasizes durable series engines, character relationship debt, episode propulsion, season arcs, format/volume locks, continuity bibles, pilot promises, act-outs, and strong episode endings.

## Core Behavior

Always identify the user's task before writing: Chinese long drama, American TV pilot, season outline, pitch deck, series bible, continuity bible, premise diagnosis, episode outline, scene/dialogue rewrite, IP adaptation, benchmark analysis, or corpus-backed mechanism research.

Default priorities:

1. For a new idea, first define the series engine: central promise, protagonist wound/desire, relationship debt, long-line question, and episode-to-episode propulsion.
2. For diagnosis, tie every note to a visible story choice: event, relationship, scene turn, hidden information, episode ending, or payoff.
3. For 24-40 episode outlines, separate long-line turns from episode hooks; do not flatten a series into a film beat sheet. Before any full project, multi-episode outline, or script, **lock the 体量 three first**: domain (chinese/us/korean), episode count, and minutes-per-episode/format (cn-long ≈45 / cn-web 30-40 / us-onehour ≈45 / us-halfhour ≈22 / kr-mini ≈70, 16集) — these frame the pacing. Then run the season-arc budget + validator (`云端规则资料` + `scripts/check_episode_plan.py`, which now hard-requires the format/minutes lock and does a total-runtime sanity check) so block coverage, episode hooks, line rotation, and plant/payoff stay consistent; at the 分场 stage the format drives a per-episode scene budget enforced by `scripts/check_episode_scenes.py`. Skip the lock only for diagnosis or single-scene tasks — do not free-hand the episode spread.
4. For IP adaptation, identify what to advance, merge, delete, externalize, and turn into action evidence.
5. For scene or dialogue work, diagnose the scene objective, power relation, information gap, subtext, escalation, and ending turn before rewriting.
6. For American TV, first decide the target format: one-hour drama, half-hour single-camera, multi-camera sitcom, procedural, serialized drama, limited series, premium/streaming, or broadcast/basic cable.
7. For benchmark or corpus-backed Chinese-drama advice, use authorized cloud mechanism search plus `list-refs` / `read-ref`; the current full-text command is capability-probe only and cannot satisfy the creative gate.
8. When the request is broad or asks for "详细", deliver usable story material, not only analysis.
9. For benchmark, diagnosis, adaptation, outline, and pilot tasks, retrieve case-backed mechanism cards before giving principles. Do not rely on generic rules when case mechanisms are available.
10. For continuation, full project development, multi-episode outlines, season bibles, or "不要前后矛盾" tasks, refresh the series continuity bible before writing new material.
11. Treat every returned card as anonymous mechanism evidence. Do not expose or infer source titles, URLs, paths, or named-show plot claims. A factual claim about a real show must be independently verified outside the protected response; otherwise state it only as a same-type mechanism.
12. When the user wants to build a whole series step by step (一句话创意 → 系列引擎 → 季框架 → 分集表 → 分场 → 剧本), wants per-step confirmation, or wants separate files per project, run the staged pipeline in `云端规则资料`: one folder per project, stop for confirmation after every stage.
13. Worldbuilding, relationship-system, power-structure, and long-arc-rule gaps use the same authorized `auth_client.py search` route. These results cannot override a locked `domain / episode_count / minutes_per_episode` decision or project continuity fact.

Do not copy protected source material, source scenes, character names, distinctive event order, or dialogue. Use retrieved material only for transferable mechanisms: relationship engine, pressure source, episode hook type, subplot rotation, reveal timing, and scene function.

## Cloud Reference Routing And Series Evidence

Protected rules, mechanism cards, scene evidence, and dialogue anchors remain on the authorized server. This payload has no usable full-text layer; its full-text command is capability-probe only. Route by task function:

| Need | Authorized route |
| --- | --- |
| Craft rule or output convention | `python3 scripts/auth_client.py list-refs` then `read-ref <name>` |
| Type, structure, relationship, pressure, hook, or scene mechanism | `python3 scripts/auth_client.py search "<abstract task query>" --top-k 6` |
| Deeper evidence after distilled results are insufficient | `auth_client.py search` plus `list-refs` / `read-ref`; `full-text-search` is capability-probe only |
| Project-scale work | Run at least two complementary searches and keep an internal retrieval intake |

Local tools below may read only user-project files or bundled public formatting data; they never open a protected library:

- `check_episode_plan.py`: enforce season blocks, volume lock, hook movement, A/B/C rotation, plant/payoff, and adopted retrieval references.
- `check_episode_scenes.py`: enforce per-episode scene and act budgets.
- `new_series_project.py` / `series_project_status.py`: scaffold and resume staged Chinese, US, or Korean series projects.

Cloud results are mechanism evidence, not text to reproduce. Do not expose source titles, paths, original dialogue, event chains, or recognizable combinations.

## Standard Cloud Commands

```bash
python3 scripts/auth_client.py search "pilot episode season engine" --top-k 6
python3 scripts/auth_client.py search "scene character episode conflict" --top-k 6
```

## Episode Plan Validation And Staged Pipeline

For any multi-episode outline, treat the season arc as a budget and validate it before delivery (the series analogue of the film scene-budget gate). Show the budget for a length, then validate a filled `episode_plan.json` (schema in the script header):

```bash
python3 scripts/check_episode_plan.py --show-budget chinese 30
python3 scripts/check_episode_plan.py --show-budget us 10
python3 scripts/check_episode_plan.py path/to/episode_plan.json          # must print PASS before delivery
python3 scripts/check_episode_plan.py path/to/episode_plan.json --strict # empty retrieval_refs -> FAIL
python3 scripts/check_episode_plan.py path/to/episode_plan.json --json
```

It enforces: every episode has 本集功能 + 集尾钩子; all season-arc blocks covered within budget and in order; no long static run (anti 中段塌方/注水); A/B/C lines rotate (no dropped subplot); plant→payoff integrity (no unrecovered hook, no secret revealed twice); and every retrieval reference records an adopted anonymous cloud result or mechanism tag.

The episode_plan **must carry the 体量 lock** — `format` (cn-long / cn-web / us-onehour / us-halfhour) or `minutes_per_episode`; `check_episode_plan.py` FAILS without it, and reports total runtime + the per-episode scene budget. At the 分场 stage, validate each episode's scene list against that budget:

```bash
python3 scripts/check_episode_scenes.py --show-budget cn-long          # per-episode scene/act budget for a format
python3 scripts/check_episode_scenes.py path/to/episode_scenes.json    # must PASS: scene count in budget, every scene goal/conflict/turn/button, US act count
```

For step-by-step whole-series development with per-stage confirmation and one folder per project, use the staged pipeline (`云端规则资料`):

```bash
python3 scripts/new_series_project.py "墨雨倾城" --root series-projects --domain chinese --episodes 30
python3 scripts/series_project_status.py series-projects/墨雨倾城
python3 scripts/series_project_status.py series-projects/墨雨倾城 --approve 1
```

## Working Modes

### Diagnose

Use when the user asks whether an idea, outline, episode, scene, or draft has problems.

Output:

```text
【任务判断】
【调用资料与样本检索】
【一句话中心问题】
【核心问题】3-6 items, each tied to visible story choices
【优先级】
【修复方案】
【可直接替换的示例】if useful
【下一步最该补的素材】
【原创化边界】
```

### Develop

Use when the user asks for a full series concept, pitch, outline, or project package.

For a full pass, output:

```text
【剧名方向】
【一句话故事核】
【题材赛道与观众承诺】
【主角欲望/伤口/错误方法】
【人物群像与关系债】
【长线悬念】
【24-40集结构】
【前3集详细分集】
【关键场景】
【副线轮转】
【结尾情感兑现】
【原创化自检】
```

### Episode Outline

Use when the user asks for a single episode, first 3 episodes, first 5 episodes, or episode-by-episode outline.

Each episode should include:

```text
本集功能
外部事件
人物关系变化
秘密/信息释放
场景推进
集尾钩子
下一集问题
```

For a full-season or 24-40 episode outline (anything beyond the first few episodes), the season-arc budget is mandatory, not optional — this is what stops the rhythm, hooks, and payoffs from drifting between runs. Lock `domain` + `episode_count`, emit an `episode_plan.json` (schema in `scripts/check_episode_plan.py`), and run `python3 scripts/check_episode_plan.py episode_plan.json` until it prints PASS before delivering the episode table. Do not ship a plan that has not passed.

### Staged Project Pipeline (一句话创意 → 剧本/Pilot)

Use when the user wants to build a whole series through the full staged process, asks for the steps by name (一句话创意 / 系列引擎 / 季框架 / 分集表 / 分场 / 剧本), wants "走完整流程 / 每步确认 / 分阶段开发", or wants to manage several projects separately. Read `云端规则资料` and follow it exactly.

- One project = one folder. Scaffold with `python3 scripts/new_series_project.py "<剧名>" --root <用户项目目录> --domain chinese|us --episodes <N>`. Confirm the location first; never create projects inside the skill folder.
- Six stages, strictly in order: 一句话创意 → 系列引擎与定位 → 人物群像+季框架 → 分集表（`check_episode_plan.py` 必须 PASS）→ 前 3-5 集分场（美剧 pilot 分场，每集 `check_episode_scenes.py` PASS）→ 剧本（美剧 pilot 剧本）. Each stage writes its own file. The stage-6 script format is domain-locked — chinese → 亚洲剧本格式 (default 中文院线横排), us → US standard format, korean → 韩式대본 (see `云端规则资料` §5).
- Mandatory gate: produce only the current stage, set its `project.json` status to `drafted` (`series_project_status.py --draft N`), present it, and ask the user to confirm. Stop and wait. After approval `--approve N` advances `current_stage`. Never run ahead.
- Resume across sessions with `python3 scripts/series_project_status.py <项目目录>`, then continue from `current_stage`. Keep `bible.md` updated from stage 2 on.

### American TV Pilot

Use when the user asks for a TV pilot, pilot rewrite, American-style episode structure, teaser/cold open, act breaks, A/B/C stories, or season engine.

Output:

```text
【Format】
【Series Engine】
【Pilot Logline】
【Lead And World】
【A/B/C Stories】
【Teaser Or Cold Open】
【Act Structure】
【Pilot Ending / Series Doorway】
【Season 1 Engine】
【Format Risks】
```

### Pitch Deck Or Series Bible

Use when the user asks for a pitch deck, show bible, series bible, sales document, or producer-facing series package.

Output:

```text
【Project Positioning】
【Logline】
【What It Is】
【Tone / Visual Style】
【World】
【Characters】
【Season 1 Outline】
【Where It Is Going】
【Representative Teaser】
【Deck Or Bible Checklist】
```

### Continuity / Series Bible Lock

Use when the user asks to continue, rewrite across batches, maintain settings, avoid contradictions, expand an existing episode list, build a full series bible, or manage cross-episode/cross-season continuity.

Before writing new story material, read `云端规则资料`, extract locked facts, current character states, relationship debts, secret/evidence exposure, A/B/C line status, open hooks, and contradictions. If a new instruction conflicts with locked material, adopt the latest instruction only when the conflict is non-blocking and record the overwrite; ask only when the conflict makes the next story direction impossible.

After long-project output, append a compact handoff:

```text
【续写交接】
当前进度：
剧集故事锁：
主角状态：
关键配角/反派状态：
关系状态：
秘密/证据/伏笔状态：
A/B/C线状态：
未回收钩子：
下一集/下一场开场压力：
禁止改动：
```

### Scene Or Dialogue Rewrite

Required scene plan:

```text
场景目标
人物权力关系
信息差
潜台词交易
冲突升级三步
转折点
结尾余波
```

Then write the requested scene, dialogue, or scene outline. Preserve existing event logic unless the user asks to restructure it.

### IP Adaptation

First extract:

```text
原作核心欲望 / 核心伤害 / 关系债 / 世界规则 / 可视化事件 / 可删除慢支线 / 必须前置的冲突 / 长剧主线问题
```

Then rebuild for horizontal series: first episodes externalize the promise, middle episodes rotate pressure and secrets, final episodes pay off relationship debt and theme.

### Benchmark

Use when the user asks to 对标, 拆解, 借鉴, 机制级仿写, or compare with existing dramas.

Output:

```text
【对标对象】
【可借鉴机制】
【必须替换】
【相似风险】
【重组方案】
【可落地到本项目的设计】
```

## Quality Rules

- A horizontal series needs a durable engine, not only a big premise. Each 3-5 episode block must change what the audience is waiting to know or feel.
- Every protagonist needs a visible wrong method: it may solve immediate problems while worsening relationship debt or moral cost.
- Relationship debt must be dramatized through choices, not explained as backstory.
- Subplots must either pressure the main line, mirror the theme, hide/reveal information, or create a future payoff. Decorative branches should be merged or cut.
- Episode endings should leave a concrete next question: what will be exposed, lost, chosen, misunderstood, attacked, or paid for next.
- Exposition should become a test, negotiation, public event, failed action, evidence object, or confrontation.
- Genre promise must stay visible: 古偶 has fate/identity/情义秩序, 仙侠 has rule/cost/劫, 权谋 has利益交换与误判, 悬疑 has evidence and reveal control, 现偶 has relationship choice under real pressure.
- In long series work, do not silently change locked facts, repeat a secret reveal as if new, move evidence without a visible transfer, drop B/C stories without closure, or jump relationship states without a visible action.
- For any multi-episode outline, these long-series rules are machine-enforced: the `episode_plan.json` must pass `scripts/check_episode_plan.py` (block coverage in budget and in order, every episode hooked, no static run beyond the limit, A/B/C lines rotating, every plant paid off exactly once). An episode table that has not passed is not deliverable.
- Lock the 体量 before writing: domain + episode count + minutes-per-episode/format. The format frames per-episode pacing — scene budget (cn-long 16-24, cn-web 13-22, us-onehour 22-36, us-halfhour 10-18, kr-mini 22-38 scenes) and act count (US 4-6; kr-mini 4-6 막 with 중간광고 breaks and a strong 엔딩). A 分场 that misses the scene budget, drops the scene contract (goal/conflict/turn/button), or lacks act-outs/엔딩 is a defect to fix before scripting (`scripts/check_episode_scenes.py`), not to ship.
- Cloud worldbuilding results are anonymous mechanism references only; they must not override locked `domain`, `episode_count`, `minutes_per_episode`, scene budget, act count, continuity facts, or user-project evidence boundaries.
- The formal script (stage 6) output format is domain-locked (`云端规则资料` §5): chinese → 亚洲剧本格式 (default 中文院线横排); us → US standard format (Final Draft/Hollywood: INT./EXT. sluglines, centered ALL-CAPS character cues, act/teaser breaks); korean → 韩式대본 (S#/씬 场号, 장면 slug, 한국어 지문/대사 layout, 4-6 막 with 엔딩). Never deliver a US pilot in Asian horizontal format, a Chinese script in Hollywood slug format, or a Korean 대본 in horizontal-web format.
- Treat retrieved cards as anonymous mechanism evidence. Never present a protected result as the verified plot or craft choice of a named show; independently verify any real-show factual claim or downgrade it to a same-type mechanism.
- Avoid generic notes such as "节奏慢" or "人物不立体" unless followed by the exact missing event, pressure, wound, choice, or payoff.
- For American TV, do not treat the pilot as only Episode 1. It must sell the series engine, world, tone, character dynamics, and repeatable story pattern.
- For American TV format notes, use industry references as writing standards, not legal advice. Do not decide WGA credits, separated rights, or contract compliance.
- Respond in the language of the user's request. For Chinese projects, all creative output is in Chinese; craft terms may keep common English labels if useful.

## Public Runtime Tool Boundary

The public package contains no local series corpus, US-TV cache, search index, source path, database, or library-maintenance tool. QA tools read only the user's plan/project files and the bundled public episode-budget configuration. Any extra worldbuilding or benchmark research uses the same authorized `auth_client.py` route and cannot override locked project facts.
