SuperAPI AI Directory

short-drama-novel-analyze

Writing & research

View repository

Updated 10-13 21:10

About this skill

Full-Length Source-Material Analysis

Turn a long piece of material intoan analysis layer that can be cited, rebutted, and built upon. The goal is not to retell the plot, but to identify the dramatic function each passage carries, and to state what it is worth in a vertical-screen short drama.

Analysis is always a candidate. Which line to keep, which characters to merge, and where to open are the creator's decisions, established by $short-drama-develop as the adaptation contract. This skill does not decide for it, nor does it approve its own output.

Quick Start

Offline validation of chapter index, sampling, and source-file change detection:

python3 {技能目录}/scripts/selftest.py
python3 {技能目录}/scripts/novel_index.py index <原著.txt> --out <chapter-index.json>

Before Starting

This skill can be installed and executed independently. First read the source material explicitly provided by the user and the direct inputs for this task; if the current directory is a short-drama project and the project tooling is available, you may read status and use its release lifecycle, but the absence of core or any other skill is not a blocking condition for analysis work. For complete boundaries and rules, see Stage Contract, with no need to read other skills' files.

Material Prerequisites

Only analyze works that the creatorlawfully holds and has the right to use. Analysis is read-only transformative work: extracting structure and function, without copying the source text into passages, and without moving original sentences into downstream output.

Violence, revenge, betrayal, romantic tension, and dark ethics in popular genres are conventional fictional narrative elements; perform structured extraction as usual. When an individual passage cannot be processed, skip that passage and record it; do not halt the entire chapter or the entire book because of it—halting would leave all subsequent stages with an analysis that has holes but no way to see where the holes are.

Determine the Entry Point First

  1. Title only, no source text: ask the creator to provide a file path or paste the body text. Do not recall plot from the title— no bytes means no span, and an analysis without spans cannot be cited or rebutted.
  2. Source text present, no project set up: set up a workspace of this skill's own directly, containing at least a read-only input directory 输入/ and an output directory 项目开发/source-analysis/_work/; copy the source-text bytes into 输入/ then record the original file location, and use this skill's novel_index.py to build the index. If $short-drama is available, you may optionally use it to initialize the same directories and release lifecycle, but installing core must not become a prerequisite for starting analysis.
  3. Source text present, project already in: go directly into the pipeline.
  4. Partial analysis already present: read 项目开发/source-analysis/_progress.md to resume from the breakpoint, without rerunning completed stages.

Pipeline

输入/ is the immutable creator input; this stage only reads it. All outputs land in 项目开发/source-analysis/. The standalone workspace and the full project use the same set of relative paths, so no migration of analysis outputs is needed when core is installed later.

Stage What It Does Output Stop
S0 Build chapter index (script) _index.json、_progress.md Stop if the index has problems
S1 Quick adaptation-value assessment (sampling) triage.md Stop and ask the creator
S2 Chapter-by-chapter function extraction chapters/ch-<N>-extract.md Stop if coverage is insufficient
S3 Story units and pacing aggregation story-units.md、rhythm-and-emotion.md Re-review if the threshold is not met
S4 Character merging and settings characters.md、world.md —
S5 Adaptation value and episode candidates adaptation-value.md、episode-candidates.jsonl Hand off to develop

S0 Chapter index

The index isthe sole source of truth for slicing, established by the chapter index script . If each stage runs its own regex once, it will slice out chapters that do not match each other: Chapter 47 is analyzed by one boundary and aggregated by another, and no one will notice.

python3 {技能目录}/scripts/novel_index.py index 输入/{原文文件} \
  --out 项目开发/source-analysis/_work/_index.next.json
python3 {技能目录}/scripts/novel_index.py verify \
  项目开发/source-analysis/_work/_index.next.json 输入/{原文文件}
# 项目工具可用时可选:
python3 {core 技能目录}/scripts/project_tool.py publish {项目根} \
  --owner short-drama-novel-analyze --artifact-id source-analysis:index \
  --output 项目开发/source-analysis/_index.json=项目开发/source-analysis/_work/_index.next.json \
  --input 输入/{原文文件}

The script recognizes Arabic numerals and Chinese numeral chapter numbers (including 千 / 两, covering serials of over a thousand chapters),recognizes only one numbering unit (the one that appears most often in 章/回/节; the rest are recorded in ignored_heading_units), and only treatsshort standalone linesas titles (body paragraphs beginning with a chapter number are recorded in long_heading_lines_skipped); it removes the table-of-contents block at the beginning and validates numbering by volume segments. Itmakes no editorial judgments—which chapters matter and what they are about are matters for later stages.

problems stops and reports if non-empty; do not proceed to S1 with a bad table. There are four common kinds: skipped chapter numbers (missing chapters or wrongly captured titles), duplicate numbers within the same volume, chapters with very little body text (most likely table-of-contents residue or a volume title page), and unparseable chapter numbers. Also confirm three counts:chapter_unit and ignored_heading_units—a book that uses 第N章 for chapters and 第N节 for sections should show chapter_unit: 章 and 节 being recorded in the ignored count; the reverse indicates the chapter unit was judged incorrectly;long_heading_lines_skipped when clearly too large, it is most likely that this book's chapter titles really are long, and you need to confirm with the creator and then hand-write the boundaries.

When the source text itself has no chapter titles, the index returns an empty table; in that case, confirm with the creator how to split it, write the boundaries into _work/_index.next.json, and after passing verify , publish according to the public lifecycle above—hand-written lines must also include all of sequence / line_start / line_end,verify checks line by line and reports lines with missing fields.

If the source text is changed, the index must be rebuilt; old spans cannot be reused.verify checks numbering, order, and line-number coverage, so inserted or deleted lines will be reported; but in-place rewrites with the same number of lines will not be—that step relies on whoever changed the source text to rebuild, and the suite does not compare bytes.

python3 {技能目录}/scripts/novel_index.py verify \
  项目开发/source-analysis/_index.json 输入/{原文文件}

S1 Adaptation value quick assessment

Answerwhether this book is worth the cost of a full breakdown. The criterion is the book's overall adaptation density—screen_ready how much of it is units, prose_only how much it accounts for, and where the production burden falls—so the quick assessment spans the whole book and uses scripted sampling:

python3 {技能目录}/scripts/novel_index.py sample \
  项目开发/source-analysis/_index.json --count 12

Sampling is fixed, reproducible, and always includes the beginning and end; a second run references the same batch of chapters. Write Adaptation value quick assessment into triage.md, covering six things: the story framework, the proportions of the three judgment types, the opening replacement point, the order of magnitude of production burden, the three biggest adaptation risks, and the order of magnitude of episode candidates. The first line states the coverage rate (the coverage_ratioreturned by the script), and all conclusions are limited to the sampling scope.

Stop here and ask the creator: give the quick assessment and the estimated time for the full breakdown (roughly estimated by chapter count), and ask whether to continue. When the creator explicitly said at the start "run it all at once", still write triage.md, but do not stop and wait—it is the first version of the assumption that S5 will backfill for comparison.

When stopping, put _progress.md write the status as paused_after_triage, and write the breakpoint as "Next: S2 chapter-by-chapter extraction".

The Agent creation artifacts for S1–S5 are likewise first written to source-analysis/_work/, and only after this stage's mechanical checks are complete are they published to the official paths in the table above. When project tooling is available, use project_tool.py publish and a stable artifact-id; when running standalone, atomically replace the official file. Do not overwrite _index.json、_progress.md、chapters/*.md or aggregated artifacts with work-in-progress. _work/ is a candidate workspace, not an authoritative analysis layer, and does not enter the delivery package.

Concurrent subagents write to _work/, and the main thread publishes to the official path. Subagents only write to _work/chapters/ch-<N>-extract.md, and the main thread publishes to chapters/only after the mechanical self-checks have finished running. The coverage gate matches filenames against the official path chapters/ —if you run it before publishing, every chapter will enter unmatched_files; that is not a defect, it is just running too early.

_progress.md is rewritten at every stage, and publishing requires that a path have only one owner, so it uses a fixed artifact-id:source-analysis:progress, whose owner is short-drama-novel-analyze, and every docking from S0–S5 republishes with the same id.

S2 Chapter-by-Chapter Feature Extraction

Process each chapter according to chapter extraction . If subagents can run concurrently, process in batches concurrently (5–8 chapters per batch, and wait for one batch to be written to disk before sending the next); if not supported, process serially—the writing requirements and self-checks are the same for both paths, only the speed differs.

After each chapter is extracted, write it to chapters/ch-<N>-extract.md,<N> is the sequencein the index, not the original chapter number (original chapter numbers repeat in multi-volume books, but sequence does not). After everything is written to disk, run coverage:

python3 {技能目录}/scripts/novel_index.py coverage \
  项目开发/source-analysis/_index.json 项目开发/source-analysis/chapters

missing If non-empty, re-run the missing chapters; ifunmatched_files is non-empty, it means some filenames are written incorrectly—they neither count as covered, nor are they treated as missing chapters, and they must be renamed rather than re-run.Do not enter S3 when coverage is insufficient—aggregation will still produce a result that reads as complete, and the missing chapters will leave no trace anywhere.

If a single chapter fails twice in a row, mark it as skipped, write it into the failure record in _progress.md , and note the chapter's absence in every subsequent aggregated artifact. Failure is acceptable; hiding failure is not.

S3 Plot Units and Pacing

Aggregate from the chapter-by-chapter extractions; do not go back and reread the original text—the original text has already been read once in S2, and reading it again will only yield a second set of mutually contradictory facts. Follow Aggregation and Entities to first identify the story framework (the framework determines how units are divided), then produce:

  • story-units.md: group plot points into units with a beginning and an end; each unit records the entry state, conflict, cost, and exit state;
  • rhythm-and-emotion.md: how key information advances chapter by chapter, the setup→release→aftermath of emotional trigger points, cross-chapter foreshadowing and payoff, and a satisfaction-point table ranked by audience benefit.

After aggregation is complete, run the three threshold self-checks in the same file (attribution confidence, coverage, overlap rate) and the scattered-plot fallback. Thresholds are not a score, they area signal of fuzzy boundaries: an excessively high overlap rate means two units are actually one.

S4 Characters and Setting

Follow Aggregation and Entities to merge characters (cross-chapter deduplication, alias normalization, tiering), and induce world rules, power systems, and factions from the mention data. Only proper names and nicknames with coreference evidence can be merged as aliases; descriptive appellations and titlesnever trigger merging。

Character merging is a candidate, not an asset. Here the character entries carry unresolved and source citations, handed to $short-drama-develop to make adaptation decisions, and$short-drama-write to write into the script, only then does $short-drama-assets establish the real asset identity from the accepted script. Bypassing this chain to directly create assets amounts to letting the source material's character list masquerade as evidence of the script's appearance.

S5 Adaptation value and episode candidates

This is the dividing line between this skill and generic book decomposition. Output by adaptation value :

  • adaptation-value.md: which units can stand directly in a vertical short drama, which need a different carrier, which are pure textual pleasure (inner monologue, narrative trickery, long buildup) that cannot be cashed out on screen; and where the production burden falls.
  • episode-candidates.jsonl: cut bypayoff distribution, local dramatic outcomes and precise handoffsinto a candidate set, not cut evenly by chapter number or word count. Each entry carries a source span, the function it serves, the payoffs it carries, and open items.

At the same timebackfill the quick review: which judgments from S1 were overturned by the full results, written at the start of adaptation-value.md . A sampling conclusion being falsified is far more useful than it being quietly forgotten—the next book's quick review will be more accurate because of it.

See the sample at episode candidate sample。

Handoff

After S5 is complete, show a creator-readable summary explaining: how many chapters were decomposed, which were skipped, how many candidate sets were produced, the three biggest adaptation risks, and which judgments in the quick review were overturned. Then hand off to $short-drama-develop— which turns the candidates into 项目开发/adaptation-map.jsonl and the adaptation contract.

This skill does not write adaptation-map.jsonl, that is a product of develop. When a quality conclusion is needed, hand off to the independent $short-drama-review(scope source_analysis)。

Rule grading

  • structural_invariant: provability of the index and spans, citation completeness, coverage. Can be blocked by script.
  • reviewed_invariant: semantic obligations such as whether function extraction is faithful to the original text and whether merging preserves the dramatic role.
  • craft_default: practices that are usually helpful; creators may override with justification.
  • taste_option: choices such as where to begin and which line to keep; must not block on their own.

Do not replace causal judgment with fixed chapter-count recipes, plot-point counts, or length ratios.

Products and boundaries

This skill owns only the files under 项目开发/source-analysis/ :_index.json、_progress.md、 chapters/*.md、triage.md、story-units.md、rhythm-and-emotion.md、 characters.md、world.md、adaptation-value.md、episode-candidates.jsonl。

It does not rewrite 输入/, does not write products of other skills under 项目开发/ , does not create assets, does not write scenes and dialogue, does not write prompts, does not generate media, and does not issue final-review conclusions.

Do not copy passages of the original text into the analysis. Record locators, spans and de-quoted function summaries; when evidence is needed, cite the shortest necessary fragment. Delivery packages must not carry raw material out of bounds.

Language

Analysis products are read by creators: within a project, follow short-drama.json#/language; when run standalone, follow the language the user uses, without hardcoding a language in this skill. This skill does not produce prompt text and has nothing to do with #/format/prompt_language .

Load on demand

  • Which chapters the quick review reads, what six things it writes, and how not to masquerade as full analysis:Adaptation value quick review
  • Per-chapter extraction method, the boundary between plain description and narrative-framework words, mechanical self-check, concurrency and serialization:Chapter extraction
  • Story framework, plot units, pacing and emotion, character merging, thresholds and scattered fallback:Aggregation and entities
  • Adaptation value assessment, carrier replacement, and candidate episode segmentation methods:Adaptation value
  • What this stage owns, what it inherits, and what it does not overstep:Stage contract