Related Works Report from Paper MDs
by @red0orange
Build a related-works report from one or more paper markdown files by extracting Related Works sections, resolving cited papers, deduplicating references, re...
clawhub install related-works-report-from-paper-mdsπ About This Skill
name: related-works-report-from-paper-mds description: Build a related-works report from one or more paper markdown files by extracting Related Works sections, resolving cited papers, deduplicating references, retrieving arXiv abstracts via Tavily plus local helpers, and assembling a final report inside a user-specified work folder. Use when the user points at paper_mds, wants a related-works survey report, or asks to turn several paper markdown files into a final_related_works_report.md. argument-hint: [paper-md-paths --workdir path] allowed-tools: Bash(*), Read, Write, Edit, Grep, Glob, Agent, Skill, call_mcp_tool, WebFetch
Related Works Report Pipeline
Orchestrate a full related-works reporting workflow for: $ARGUMENTS
Overview
This workflow turns a small set of paper markdown files into a reproducible report:
paper md files
-> step1 extract Related Works + cited papers
-> step2 deduplicate cited papers
-> sequential Tavily abstract lookup + local arXiv fetch
-> normalized citation companion text
-> final_related_works_report.md
The output is not just the final report. Every intermediate artifact is written into the user-selected work folder so the process can be resumed, audited, or partially rerun.
Required Inputs
Before running, collect or infer:
If WORKDIR is missing, ask the user for it before doing substantial work.
All process outputs and the final report must be written under WORKDIR. Do not write process artifacts elsewhere.
Constants
P001final_related_works_report.mdWork Folder Layout
Create and maintain these artifacts under WORKDIR:
| Artifact | Purpose |
|----------|---------|
| step1_extracted_related_works_and_citations.md | Per-source Related Works verbatim + citation tables |
| step1_normalized_related_works.md | Citation-normalized companion text using dedup ids like P001 when replacement is unambiguous |
| step2_deduplicated_paper_list.md | Deduplicated paper list with source occurrences |
| title_batches/batch_XX.md | Abstract lookup batches |
| abstract_batches/batch_XX_fetches.jsonl | One JSON line per title after Tavily + local fetch |
| abstract_batches/batch_XX_results.md | Rendered markdown per abstract batch |
| final_related_works_report.md | Final assembled report |
Execution Rule
Run phases in order. Do not stop after a checkpoint unless:
Parallelism rules:
Phase 0: Initialize the Work Folder
1. Validate PAPER_MD_PATHS.
2. Create WORKDIR, WORKDIR/title_batches, and WORKDIR/abstract_batches.
3. Record the chosen source files in the first process artifact.
Phase 1: Extract Related Works and cited papers
Use one clean-context sub agent per source markdown file.
Each sub agent must return:
[12], Guo et al., 2017, etc.)
- year
- title
- authors
- raw reference textMerge all outputs into WORKDIR/step1_extracted_related_works_and_citations.md.
Phase 2: Deduplicate cited papers
Build WORKDIR/step2_deduplicated_paper_list.md.
Rules:
Phase 2B: Citation normalization companion text
Before final assembly, produce WORKDIR/step1_normalized_related_works.md.
Goal:
step1_extracted_related_works_and_citations.mdP001Preferred format:
[12] -> [P052](Guo et al., 2017) -> [P095]Rules:
This step exists because the final report should be easy to align with the deduplicated bibliography.
Phase 3: arXiv abstracts via Tavily + local helper
Use the helper scripts stored inside this skill:
.cursor/skills/related-works-report-from-paper-mds/scripts/fetch_arxiv_abs.py.cursor/skills/related-works-report-from-paper-mds/scripts/jsonl_to_abstract_batch_md.pySearch rules
"" arXiv abs, then html, then pdfhtml/pdf to canonical https://arxiv.org/abs/Batch rules
arXiv URL and Abstract emptyLow-context pattern
For each processed title, immediately append one JSON line to:
WORKDIR/abstract_batches/batch_XX_fetches.jsonlEach line should include at least:
dedup_idinput_titletavily_statustavily_errorarxiv_urlfetchAfter a batch completes, render markdown with:
python3 ".cursor/skills/related-works-report-from-paper-mds/scripts/jsonl_to_abstract_batch_md.py" \
"WORKDIR/abstract_batches/batch_XX_fetches.jsonl" \
"WORKDIR/abstract_batches/batch_XX_results.md"
Phase 4: Final assembly
Use the final builder script stored inside this skill:
python3 ".cursor/skills/related-works-report-from-paper-mds/scripts/build_final_related_works_report.py" \
"WORKDIR/step1_extracted_related_works_and_citations.md" \
"WORKDIR/step2_deduplicated_paper_list.md" \
"WORKDIR/abstract_batches" \
"WORKDIR/final_related_works_report.md" \
"WORKDIR/step1_normalized_related_works.md"
The final report should contain:
Key Rules
WORKDIR.step2 in Part 2.Utility Scripts
scripts/fetch_arxiv_abs.py β compact metadata + abstract extraction from a known arXiv URLscripts/jsonl_to_abstract_batch_md.py β render one batch markdown from JSONLscripts/build_final_related_works_report.py β assemble the final report from workdir artifactsAdditional Resources
WORKDIR contents, see examples.mdExample Invocation
/related-works-report-from-paper-mds \
"0_refs/paper_mds/2025_ConfidenceVLA.md 0_refs/paper_mds/2025_SAFE.md 0_refs/paper_mds/2025_FAIL_Detect.md --workdir 0_docs/related_works_report_run_02"