$npx -y skills add WILLOSCAR/research-units-pipeline-skills --skill opener-variatorRewrite subsection openers so they stop reading like a generated table-of-contents: remove \"overview/narration\" stems and reduce repeated opener cadences across H3s. Trigger: opener variator, opener rewrite, rewrite openers, overview opener, 开头改写, 小节开头, 去overview, 去旁白.
| 1 | # Opener Variator (H3 first paragraph rewrite) |
| 2 | |
| 3 | Purpose: fix a high-signal automation tell that survives structural gates: |
| 4 | - many H3s begin with the same rhetorical shape |
| 5 | - \"overview\" narration replaces content-bearing framing |
| 6 | |
| 7 | This skill is intentionally narrow: |
| 8 | - only rewrite the first paragraph (or first 2–4 sentences) of the flagged H3 files |
| 9 | - keep the argument moves and citations intact |
| 10 | |
| 11 | ## Inputs |
| 12 | |
| 13 | Required: |
| 14 | - `output/WRITER_SELFLOOP_TODO.md` (Style Smells section) |
| 15 | - the referenced `sections/S<sub_id>.md` files |
| 16 | |
| 17 | Optional (helps you stay aligned): |
| 18 | - `outline/writer_context_packs.jsonl` (use `opener_mode`, `tension_statement`, `thesis`) |
| 19 | |
| 20 | ## Outputs |
| 21 | |
| 22 | Run this targeted pass immediately after `style-harmonizer` and before logic |
| 23 | polish. The deterministic script is a certification adapter: it refuses to |
| 24 | create the marker while the latest `writer-selfloop` report still names flagged |
| 25 | files or predates any `sections/*.md` file. Perform the semantic rewrite through |
| 26 | this Skill or the responsible upstream writer, rerun `writer-selfloop`, then |
| 27 | retry the adapter. A passing marker records the certified Section-tree SHA256. |
| 28 | |
| 29 | - Updated `sections/S<sub_id>.md` files (still body-only; no headings) |
| 30 | |
| 31 | ## Workflow (route from the self-loop report) |
| 32 | |
| 33 | 1) Open `output/WRITER_SELFLOOP_TODO.md` and locate `## Style Smells`. |
| 34 | 2) Treat the flagged `sections/S*.md` list as the *only* scope for this pass. |
| 35 | 3) For each flagged file: |
| 36 | - Optional: look up its entry in `outline/writer_context_packs.jsonl` and read `opener_mode` / `tension_statement` / `thesis` to stay aligned. |
| 37 | - Do the real rewrite upstream in `subsection-writer` or `chapter-lead-writer`; do not rely on blind local regex passes. |
| 38 | - Best-of-3 opener sampling (recommended): draft 2-3 candidate opener paragraphs (different opener modes), then keep the one that is most content-bearing and least repetitive across H3s. |
| 39 | 4) Rerun `writer-selfloop` and confirm the Style Smells list shrinks. |
| 40 | |
| 41 | ## Role prompt: Opener Editor (paper voice) |
| 42 | |
| 43 | ```text |
| 44 | You are rewriting the opening paragraph of a survey subsection. |
| 45 | |
| 46 | Goal: |
| 47 | - replace narration/overview openers with a content-bearing framing |
| 48 | - vary opener cadence across subsections so the paper reads authored |
| 49 | |
| 50 | Constraints: |
| 51 | - do not invent facts |
| 52 | - do not add/remove/move citation keys |
| 53 | - do not change the subsection’s thesis |
| 54 | |
| 55 | Checklist: |
| 56 | - sentence 1 is content-bearing (tension/decision/failure/protocol/contrast), not “what we do in this section” |
| 57 | - paragraph 1 ends with a clear thesis/takeaway |
| 58 | - no slide navigation (“Next, we…”, “In this subsection…”, “This section provides an overview…“) |
| 59 | ``` |
| 60 | |
| 61 | ## What to delete (high-signal narration) |
| 62 | |
| 63 | Rewrite immediately if the opener contains any of: |
| 64 | - “This section/subsection provides an overview …” |
| 65 | - “In this section/subsection, we …” |
| 66 | - “This subsection surveys/argues …” |
| 67 | - “Next, we move/turn …” |
| 68 | - repeated opener labels (“Key takeaway:” spam) |
| 69 | |
| 70 | ## What to replace with (opener moves) |
| 71 | |
| 72 | Pick one opener mode per H3 (the writer pack may suggest `opener_mode`). |
| 73 | Do not copy labels; write as natural prose. |
| 74 | |
| 75 | Allowed opener moves (choose 1; keep it concrete): |
| 76 | - **Tension-first**: state the real trade-off; why it matters; end with thesis. |
| 77 | - **Decision-first**: frame the builder’s choice under constraints; end with thesis. |
| 78 | - **Failure-first**: start from a failure mode that motivates the lens; end with thesis. |
| 79 | - **Protocol-first**: start from comparability constraints (budget/tool access); end with thesis. |
| 80 | - **Contrast-first**: open with an A-vs-B sentence, then explain why; end with thesis. |
| 81 | - **Lens-first**: state the chapter lens and narrow to this subsection’s question. |
| 82 | |
| 83 | ## Mini examples (paraphrase; do not copy) |
| 84 | |
| 85 | Bad (overview narration): |
| 86 | - `This subsection provides an overview of tool interfaces for agents.` |
| 87 | |
| 88 | Better (content-bearing): |
| 89 | - `Tool interfaces define what actions are executable; interface contracts therefore determine which evaluation claims transfer across environments.` |
| 90 | |
| 91 | Bad (process narration): |
| 92 | - `In this subsection, we discuss memory mechanisms and then review retrieval methods.` |
| 93 | |
| 94 | Better (tension-first): |
| 95 | - `Memory improves long-horizon coherence, but it also expands the failure surface: retrieval can be stale, wrong, or adversarial, and agents rarely know which.` |
| 96 | |
| 97 | ## Done checklist |
| 98 | |
| 99 | - [ ] No flagged file starts with “overview/narration” stems. |
| 100 | - [ ] Paragraph 1 ends with a thesis/takeaway (same meaning). |
| 101 | - [ ] Citation keys are unchanged (no adds/removes/moves). |
| 102 | - [ ] `writer-selfloop` still PASSes and Style Smells shrink. |
| 103 | |
| 104 | ## Script |
| 105 | |
| 106 | ### Quick Start |
| 107 | |
| 108 | - `uv run python .codex/skills/opener-variator/scripts/run.py --workspace <workspace>` |
| 109 | |
| 110 | ### All Options |
| 111 | |
| 112 | - `--workspace <dir>` ( |