← Back to Skills Marketplace
willoscar

Citation Diversifier

by WILLOSCAR · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
146
Downloads
0
Stars
1
Active Installs
1
Versions
Install in OpenClaw
/install citation-diversifier
Description
Raise citation diversity/density (NO NEW FACTS): generate an in-scope “citation budget” plan per H3 so drafts stop failing the global unique-citation gate an...
README (SKILL.md)

Citation Diversifier (budget-as-constraints) [NO NEW FACTS]

Purpose: fix a common survey failure mode:

  • the draft reads under-cited (or reuses the same few citations everywhere)
  • the pipeline fails the global unique-citation gate

This skill does not change prose by itself. It produces a constraint sheet: output/CITATION_BUDGET_REPORT.md.

Inputs

  • output/DRAFT.md
  • outline/outline.yml (H3 ids/titles; used to allocate budgets per subsection)
  • outline/writer_context_packs.jsonl (source of allowed_bibkeys_{selected,mapped,chapter,global} per H3)
  • citations/ref.bib

Output

  • output/CITATION_BUDGET_REPORT.md

Non-negotiables (NO NEW FACTS)

  • Only propose citation keys that exist in citations/ref.bib.
  • Only propose keys that are in-scope for the target H3 (prefer subsection-first scope; use chapter/global only when truly cross-cutting).
  • Do not propose “padding citations” that would require adding new claims or new numbers.

What a good budget report looks like (contract)

The report should feel like a constraint sheet, not a random list:

  • It states the blocking policy target and the gap-to-target (how many unique keys are missing; policy default is recommended).
  • For each H3, it proposes a scope-safe budget sized to actually close the gap:
    • small gaps: 3-6 keys / H3 is often enough
    • A150++ gaps: plan for ~6-12 keys / H3 (and avoid duplicates across H3 budgets)
  • It gives placement guidance (where in the subsection those keys can be embedded without adding new facts).

Canonical (parseable) lines required (downstream validators depend on these):

  • The target is derived from queries.md:citation_target (recommended by default for A150++).
  • - Global target (policy; blocking): >= \x3CN> ...
  • - Gap: \x3CK> (gap-to-target; if 0, injection can be a no-op PASS)

Optional (always reported; may be blocking depending on citation_target):

  • - Global recommended target: >= \x3CN> ...
  • - Gap to recommended: \x3CK>

Recommended prioritization (scope-safe):

  • allowed_bibkeys_selectedallowed_bibkeys_mappedallowed_bibkeys_chapter
  • Use allowed_bibkeys_global only for:
    • benchmarks/protocol papers
    • widely-used datasets/suites
    • cross-cutting surveys/method papers referenced across chapters

How this connects to writing (LLM-first)

After you generate the budget report:

  • Apply it using citation-injector (LLM edits to output/DRAFT.md, NO NEW FACTS).
  • Then run draft-polisher to remove any “budget dump voice” while keeping citation keys unchanged.

Important: citation-injector is LLM-first. Its script is validation-only.

Workflow

  1. Diagnose the global situation
  • Read output/DRAFT.md and estimate the “unique-key gap” (or use pipeline-auditor’s FAIL reason).
  1. Allocate budgets per H3 (scope-first)
  • Use outline/outline.yml to enumerate H3s in paper order.
  • For each H3, read its allowed key sets from outline/writer_context_packs.jsonl.
  • Pick a small set of unused keys that strengthen positioning without requiring new claims.
  1. Write output/CITATION_BUDGET_REPORT.md Required structure:
  • - Status: PASS|FAIL
  • - Global target (policy; blocking): >= \x3CN> ...
  • - Gap: \x3CK>
  • ## Summary (gap + strategy)
  • ## Per-subsection budgets (H3 id/title → suggested keys → placement hint)

Script (optional; deterministic report generator)

If you want a deterministic first-pass budget report, run the helper script. Treat it as a baseline and refine the plan as needed.

Quick Start

  • python scripts/run.py --help
  • python scripts/run.py --workspace workspaces/\x3Cws>

All Options

  • --workspace \x3Cdir>
  • --unit-id \x3CU###> (optional)
  • --inputs \x3Csemicolon-separated> (rare override; prefer defaults)
  • --outputs \x3Csemicolon-separated> (rare override; default writes output/CITATION_BUDGET_REPORT.md)
  • --checkpoint \x3CC#> (optional)

Examples

  • Default IO:
    • python scripts/run.py --workspace workspaces/\x3Cws>

Done criteria

  • output/CITATION_BUDGET_REPORT.md exists and has actionable, in-scope budgets.
  • After applying the plan via citation-injector, pipeline-auditor no longer FAILs on global unique citations.
Usage Guidance
This skill appears to do exactly what it says: analyze output/DRAFT.md, outline/*, writer_context_packs.jsonl and citations/ref.bib to suggest in-scope unused citation keys and write output/CITATION_BUDGET_REPORT.md. Before installing or running, verify you are comfortable with the agent having read access to the project workspace (these inputs may contain unpublished text or private BibTeX entries). Also review any omitted files (the toolset includes large quality-gate/ideation modules not fully printed here); if you require stronger assurance, inspect the remaining source files for network, subprocess, or credential access. Running in a contained workspace is recommended if you are unsure.
Capability Analysis
Type: OpenClaw Skill Name: citation-diversifier Version: 1.0.0 The citation-diversifier skill bundle is designed to analyze academic drafts and suggest additional citations from an existing bibliography to meet specific density targets. The core logic in scripts/run.py performs deterministic regex-based citation extraction and gap analysis. The extensive tooling/ directory provides utility functions for file I/O, pipeline execution, and quality gate checks (e.g., checking for placeholders or citation counts). While the code uses subprocess.run in executor.py and quality_gate.py, it does so safely using argument lists to execute internal scripts or standard utilities like pdfinfo. No evidence of malicious intent, data exfiltration, or harmful prompt injection was found.
Capability Assessment
Purpose & Capability
Name/description (raise citation density without inventing facts) matches the code and SKILL.md: the scripts read draft/outline/writer_context_packs/ref.bib and generate a per-H3 budget. Required binaries (python) are appropriate and proportional.
Instruction Scope
SKILL.md instructions are specific and constrained: operate on workspace files, honor 'NO NEW FACTS', and produce output/CITATION_BUDGET_REPORT.md. The included run.py implements that behavior and does not read unrelated system files or environment variables.
Install Mechanism
No install spec (instruction-only with bundled Python scripts). Requiring Python is reasonable; there are no downloads, external package installs, or archive extraction steps.
Credentials
The skill declares no required env vars, no credentials, and the code does not access secrets or external services. It only reads workspace files and writes a local report.
Persistence & Privilege
always:false and default autonomous invocation settings are present (normal). The skill does not modify other skills or system-wide agent settings and only writes its own output artifact in the workspace.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install citation-diversifier
  3. After installation, invoke the skill by name or use /citation-diversifier
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release of citation-diversifier. - Adds a tool to generate in-scope citation "budget" plans per subsection (H3) to increase citation diversity and density. - Produces a constraint-based report (output/CITATION_BUDGET_REPORT.md) without introducing new facts or inventing citations. - Ensures only existing, in-scope citation keys from citations/ref.bib are proposed, adhering to context pack constraints. - Designed to help drafts pass the global unique-citation gate and avoid under-cited sections. - Includes guidance for budget allocation, report structure, and workflow integration with citation-injector and draft-polisher.
Metadata
Slug citation-diversifier
Version 1.0.0
License MIT-0
All-time Installs 1
Active Installs 1
Total Versions 1
Frequently Asked Questions

What is Citation Diversifier?

Raise citation diversity/density (NO NEW FACTS): generate an in-scope “citation budget” plan per H3 so drafts stop failing the global unique-citation gate an... It is an AI Agent Skill for Claude Code / OpenClaw, with 146 downloads so far.

How do I install Citation Diversifier?

Run "/install citation-diversifier" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Citation Diversifier free?

Yes, Citation Diversifier is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Citation Diversifier support?

Citation Diversifier is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Citation Diversifier?

It is built and maintained by WILLOSCAR (@willoscar); the current version is v1.0.0.

💬 Comments