$npx -y skills add WILLOSCAR/research-units-pipeline-skills --skill chapter-lead-writerWrite H2 chapter lead blocks (sections/S<sec_id>_lead.md) that preview the chapter's comparison lens and connect its H3 subsections, without adding new facts. Trigger: chapter lead writer, section lead writer, H2 lead, lead paragraph, 章节导读, 章节导语. Use when: you have H2 c
| 1 | # Chapter Lead Writer |
| 2 | |
| 3 | ## Purpose |
| 4 | |
| 5 | This skill writes the body-only lead block that sits under an H2 heading and makes a chapter with multiple H3 subsections read like one argument. |
| 6 | |
| 7 | This `SKILL.md` is now the **package router**, not the full method manual. |
| 8 | |
| 9 | ## Migration status |
| 10 | |
| 11 | This package is in **P0 compatibility-preserving migration**: |
| 12 | - `references/` and `assets/` now hold the intended knowledge and contract layers. |
| 13 | - `scripts/run.py` remains in **compatibility mode** for active generation. |
| 14 | - a later script-thinning pass should move more judgment and exemplars out of Python and leave the script with deterministic execution and validation only. |
| 15 | |
| 16 | For now, preserve the existing output contract and treat `scripts/run.py` as the execution source of truth. |
| 17 | |
| 18 | ## Inputs |
| 19 | |
| 20 | Required: |
| 21 | - `outline/outline.yml` |
| 22 | - `outline/chapter_briefs.jsonl` |
| 23 | - `citations/ref.bib` |
| 24 | |
| 25 | Optional: |
| 26 | - `outline/writer_context_packs.jsonl` |
| 27 | |
| 28 | ## Outputs |
| 29 | |
| 30 | For each H2 section with H3 subsections: |
| 31 | - `sections/S<sec_id>_lead.md` |
| 32 | |
| 33 | ## Output contract |
| 34 | |
| 35 | Keep these file-shape rules stable: |
| 36 | - each lead file is body-only and contains no headings |
| 37 | - each lead file previews the chapter lens and connects multiple H3s as one argument |
| 38 | - each lead file stays within the chapter's existing citation scope |
| 39 | - each lead file adds no new facts that are not supported later in the chapter |
| 40 | |
| 41 | ## Load Order |
| 42 | |
| 43 | Always read: |
| 44 | - `references/overview.md` |
| 45 | - `references/lead_block_archetypes.md` |
| 46 | |
| 47 | Read by task: |
| 48 | - `references/throughline_patterns.md` — when chapter briefs are thin or hard to convert into a throughline |
| 49 | - `references/bridge_examples.md` — when the lead needs stronger H3 transitions without slide narration |
| 50 | - `references/bad_narration_examples.md` — when removing table-of-contents narration, planner talk, count-based openers |
| 51 | |
| 52 | Machine-readable assets: |
| 53 | - `assets/lead_block_contract.json` — stable package contract for lead-block shape |
| 54 | - `assets/lead_block_compatibility_defaults.json` — fallback phrasing, item limits, joiners, sentence cadence |
| 55 | |
| 56 | ## Routing rules |
| 57 | |
| 58 | Use this skill in the following order: |
| 59 | |
| 60 | 1. Confirm the chapter is eligible |
| 61 | - identify H2 sections with H3 subsections from `outline/outline.yml` |
| 62 | - locate the corresponding chapter brief in `outline/chapter_briefs.jsonl` |
| 63 | |
| 64 | 2. Load the method |
| 65 | - read `references/overview.md` |
| 66 | - read `references/lead_block_archetypes.md` |
| 67 | - load the other reference files only if the chapter brief or current prose needs them |
| 68 | |
| 69 | 3. Check citation scope |
| 70 | - if `outline/writer_context_packs.jsonl` exists, use it for cross-cutting chapter citations |
| 71 | - keep any citations inside the existing chapter scope and validate keys against `citations/ref.bib` |
| 72 | |
| 73 | 4. Execute |
| 74 | - **current phase**: use `scripts/run.py` in compatibility mode to preserve active behavior and output shape |
| 75 | - **future phase**: keep `scripts/run.py` for deterministic execution only, with the writing method and anti-pattern inventory living in `references/` |
| 76 | |
| 77 | ## Compatibility mode note |
| 78 | |
| 79 | `scripts/run.py` still contains active lead-generation logic. |
| 80 | |
| 81 | That is temporary. For now: |
| 82 | - do not treat the current script wording as the target architecture |
| 83 | - do treat `assets/lead_block_compatibility_defaults.json` as the primary compatibility-mode wording source |
| 84 | - do not copy large prose instructions back into `SKILL.md` |
| 85 | - do preserve the current output contract while reducing obvious narration stems in the active path |
| 86 | |
| 87 | ## What this skill should guarantee |
| 88 | |
| 89 | Regardless of where the detailed method lives, this skill should produce chapter leads that: |
| 90 | - state the chapter's comparison lens rather than narrating the outline |
| 91 | - connect the H3 subsections as one argument, not as isolated stops on a tour |
| 92 | - introduce recurring contrasts without slash-list jargon |
| 93 | - keep the evaluation or calibration lens visible at a high level |
| 94 | - avoid slide narration, planner talk, and repeated stock openers |
| 95 | - choose from multiple candidate lead frames when possible (lens-first / sequence-first / comparison-first) and keep the least narrated option instead of reusing one stock cadence everywhere |
| 96 | |
| 97 | ## Block conditions |
| 98 | |
| 99 | Stop and route upstream if any of these are true: |
| 100 | - `outline/chapter_briefs.jsonl` is missing |
| 101 | - the target H2 section has no H3 subsections |
| 102 | - the chapter brief is too incomplete to infer a throughline safely |
| 103 | - the requested lead would require new facts or out-of-scope citations |
| 104 | |
| 105 | ## Script role |
| 106 | |
| 107 | `scripts/run.py` should currently be treated as a **compatibility executor**. |
| 108 | |
| 109 | Its long-term role after script thinning is narrower: |
| 110 | - chapter discovery |
| 111 | - brief loading and normalization |
| 112 | - contract validati |