$npx -y skills add WILLOSCAR/research-units-pipeline-skills --skill citation-injectorApply a citation-diversifier budget report by injecting *in-scope* citations into an existing draft (NO NEW FACTS), so the run passes the global unique-citation gate without citation dumps. Trigger: citation injector, apply citation budget, inject citations, add citations s
| 1 | # Citation Injector (deterministic baseline edits; budget-as-constraints) |
| 2 | |
| 3 | Purpose: make the pipeline converge when the draft is: |
| 4 | - locally citation-dense but **globally under-cited** (too few unique keys), or |
| 5 | - overly reusing the same citations across many subsections. |
| 6 | |
| 7 | This skill is intentionally **conservative and scriptable**: |
| 8 | - the script edits `output/DRAFT.md` directly using the budget report as constraints |
| 9 | - injections stay evidence-neutral (NO NEW FACTS) and use only in-scope keys already listed for each H3 |
| 10 | |
| 11 | ## Inputs |
| 12 | |
| 13 | - `output/DRAFT.md` |
| 14 | - `output/CITATION_BUDGET_REPORT.md` (from `citation-diversifier`) |
| 15 | - `outline/outline.yml` (H3 id/title mapping) |
| 16 | - `citations/ref.bib` (must contain every injected key) |
| 17 | |
| 18 | ## Outputs |
| 19 | |
| 20 | - `output/DRAFT.md` (updated in place) |
| 21 | - `output/CITATION_INJECTION_REPORT.md` (PASS/FAIL + what you changed) |
| 22 | |
| 23 | ## Non-negotiables (NO NEW FACTS) |
| 24 | |
| 25 | - Only inject keys listed for that H3 in the budget report. |
| 26 | - Do not introduce new numbers, new benchmarks, or superiority claims. |
| 27 | - Do not add narration templates such as `This subsection discusses` or `Next, we examine`. |
| 28 | - Do not produce cite dumps like `[@a; @b; @c]` as the only citations in a paragraph. |
| 29 | |
| 30 | ## Paper-voice injection patterns (safe sentence shapes) |
| 31 | |
| 32 | Use these as *sentence intentions* (paraphrase; do not copy verbatim). |
| 33 | |
| 34 | 1) Axis-anchored exemplars (preferred) |
| 35 | - `Systems such as X [@a] and Y [@b] instantiate <axis/design point>, whereas Z [@c] explores a contrasting point under a different protocol.` |
| 36 | |
| 37 | 2) Parenthetical grounding (short, low-risk) |
| 38 | - `The same design pressure appears in nearby systems (e.g., X [@a], Y [@b], Z [@c]).` |
| 39 | |
| 40 | 3) Cluster pointer + contrast hint |
| 41 | - `Representative implementations span both <cluster A> (X [@a], Y [@b]) and <cluster B> (Z [@c]), suggesting that the trade-off hinges on <lens>.` |
| 42 | |
| 43 | 4) Decision-lens pointer |
| 44 | - `For builders choosing between <A> and <B>, prior systems provide concrete instantiations on both sides (X [@a]; Y [@b]; Z [@c]).` |
| 45 | |
| 46 | 5) Evaluation-lens pointer (still evidence-neutral) |
| 47 | - `Across commonly used agent evaluations, systems such as X [@a] and Y [@b] illustrate how <lens> is operationalized, while Z [@c] highlights a different constraint.` |
| 48 | |
| 49 | 6) Contrast without list voice |
| 50 | - `While many works operationalize <topic> via <mechanism> (X [@a]; Y [@b]), others treat it as <alternative> (Z [@c]), which changes the failure modes discussed later.` |
| 51 | |
| 52 | ## Anti-patterns (high-signal “budget dump” voice) |
| 53 | |
| 54 | Avoid these stems (they read like automated injection): |
| 55 | - `A few representative references include` |
| 56 | - `Notable lines of work include` |
| 57 | - `Concrete examples include` |
| 58 | |
| 59 | If your draft contains these, rewrite them immediately using the patterns above (keep citation keys unchanged). |
| 60 | |
| 61 | ## Placement guidance |
| 62 | |
| 63 | - Prefer inserting citations where the subsection already states a concrete contrast or decision lens. |
| 64 | - If you must add a new sentence/mini-paragraph, place it early (often after paragraph 1) so it reads as positioning, not as an afterthought. |
| 65 | - Keep injections subsection-specific: mention the subsection lens (H3 title / `contrast_hook`) so the same sentence cannot be copy-pasted into every H3. |
| 66 | |
| 67 | ## Workflow |
| 68 | |
| 69 | 1) Read the budget report (`output/CITATION_BUDGET_REPORT.md`) |
| 70 | - Treat `Global target (policy; blocking)` as the PASS line for the pipeline gate (derived from `queries.md:citation_target`; A150++ default: `recommended`). |
| 71 | - If `Gap: 0`, do nothing: write a short PASS report and move on. |
| 72 | - Otherwise, for each H3 with suggested keys, pick enough keys to close the gap to target: |
| 73 | - small gaps: 3-6 keys / H3 |
| 74 | - A150++ gaps: often 6-12 keys / H3 |
| 75 | Prefer keys that are unused globally and avoid repeating the same new keys across many H3s. |
| 76 | |
| 77 | 2) Inject in the right subsection |
| 78 | - Use `outline/outline.yml` to confirm H3 ordering and ensure the injected sentence lands inside the correct `###` subsection. |
| 79 | |
| 80 | 3) Inject with paper voice |
| 81 | - Prefer one short, axis-anchored sentence over a long enumerator sentence. |
| 82 | - Keep injections evidence-neutral (NO NEW FACTS) and avoid new numbers. |
| 83 | - Before you commit an injected key, confirm it exists in `citations/ref.bib`. |
| 84 | |
| 85 | 4) Write `output/CITATION_INJECTION_REPORT.md` |
| 86 | - Record which H3s you touched and which keys were added. |
| 87 | - Mark `- Status: PASS` only when the global target is met. |
| 88 | |
| 89 | 5) Verify |
| 90 | - Rerun the validator script (below) to recheck the global target. |
| 91 | - Then run `draft-polisher` to smooth any residual injection voice (citation keys must remain unchanged). |
| 92 | |
| 93 | ## Done criteria |
| 94 | |
| 95 | - `output/CITATION_INJECTION_REPORT.md` exists and is `- Status: PASS`. |
| 96 | - `pipeline-auditor` no longer FAILs on “unique citations too low”. |
| 97 | |
| 98 | ## |