Command Palette

Search for a command to run...

UnylyUnyly
Back to skills

DOCX Report Figures

FreeRuns bundled scriptsNot checked

Add data-grounded tables and figures to an existing Chinese/English research report or paper in DOCX, keeping every number traceable to the source text. Use…

wang-shuanglinby wang-shuanglin204 installs in other catalogs

About this skill

DOCX Report Figures

Insert tables and data figures into an existing report without altering its text, so that every number in every exhibit can be traced back to a sentence in the report. The deliverable is the original document plus exhibits, not a rewritten document.

Non-negotiables

  1. Never invent data. Every value, unit, year, rating, and country name in a table or chart must come from the report, or be an explicit arithmetic result of values that do (difference, ratio, sum) — and derived values get a note saying so.
  2. Never change body text except adding in-text references such as (见表1), inserted before the final 。 of the paragraph that the exhibit supports.
  3. Data figures are drawn programmatically (matplotlib), never generated by an image model. Image models cannot guarantee ticks, labels, or values. Only photos/illustrations may come from image generation, and then the caption says 示意图.
  4. Number exhibits in document order and use one series per kind (表1…表N, 图1…图N). Renumber pre-existing captions if they were unnumbered, and keep their images.

Workflow

1. Inventory the document

python scripts/extract_report.py report.docx --out dump.txt

Read the dump (paragraph index, style, text; page setup; existing tables and images). Read the whole report before planning anything — the exhibits must follow the argument, not decorate it.

2. Measure the existing typography

python scripts/inspect_format.py report.docx --out format.txt

Record: page size and margins, usable text width, body font/size/line spacing/first-line indent, how section headings are formatted, how existing figure captions look, whether a table style exists. All inserted content must match these numbers.

3. Plan the exhibits

Walk the report section by section and list candidate passages that contain: multi-country or multi-year comparisons, quantitative targets vs. actuals, price/tariff structures, capacity or grid statistics, financing terms, or a mechanism described as a chain/cycle. For each candidate decide:

  • Table when 3+ attributes must align across 2+ subjects (countries, years, technologies).
  • Figure when magnitude comparison (bars), shares (horizontal bars), or a supply/demand balance (bars + reference line) reads faster.
  • Schematic when the passage describes causal transmission between factors.
  • Nothing when the passage is qualitative with no numbers — do not force an exhibit.

Write the plan as JSON (schema in references/plan-schema.md), and for each exhibit keep a one-line provenance note: 表1 ← P4“23%…15.75%…15.63 GW…4.37 万 MW…”. If you cannot cite the source paragraph, drop the exhibit.

Copy every anchor character-for-character out of dump.txt. Do not retype it and do not add spaces: Chinese reports usually write 截至2025年6月底, and the gap you see on screen is Word's automatic CJK–Latin spacing, not a space. A wrong anchor aborts the build.

4. Draw the figures

Charts go to figs/, width exactly the usable text width (typically 14.5 cm ≈ 5.71 in at 1× scale), matplotlib rcParams with a Times New Roman + SimSun fallback so digits and Chinese both look right. Follow references/sci-report-style.md for sizes, colors, axis and label conventions. Compute derived values in the script and print them, so the numbers in the note can be checked.

5. Build the document

python scripts/build_figures.py plan.json

The builder copies the source file, inserts in-text references, then each table (caption above, three-line borders, 9 pt body, header repeat, rows that do not split) and each figure (image + caption below + 9 pt note), and finally normalizes oversized legacy images to the text width when asked. It never edits existing text.

6. Verify

Export a PDF (Word COM on Windows, else soffice --convert-to pdf) and render pages:

# Windows + Word
powershell -File scripts/export_pdf.ps1 -Source preview.docx -Pdf preview.pdf
python scripts/verify_layout.py preview.pdf --pages-dir pages --out pages.txt

Then look at the page images for every exhibit: caption on the same page as its table/figure, table not split across pages, no overlong cell wraps (country names must not break mid-word), no text overlapping in charts, numbering in order, references present. Fix and rebuild until clean. Do not deliver unseen output.

7. Report

Deliver the DOCX and a PDF preview. List each exhibit with its number, placement, and the paragraph values it came from; call out every derived number and its arithmetic. State what you did not add (e.g. no generative photos for data) and why.

Scripts

Script Purpose
scripts/extract_report.py Dump indexed paragraphs, sections, tables, images, page setup to a UTF-8 text file
scripts/inspect_format.py Report fonts, spacing, indents, caption style, table borders, image widths
scripts/build_figures.py Apply a JSON pl
Full SKILL.md on ClawHub

Install DOCX Report Figures in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

FAQ

What does the DOCX Report Figures skill do?

Add data-grounded tables and figures to an existing Chinese/English research report or paper in DOCX, keeping every number traceable to the source text. Use when the user uploads a .docx report and asks to 补充图表 / 插入表格 / 配图 / 数据可视化 / "看看哪里可以加图表", or asks to turn passages with statistics into 三线表 or matplotlib charts. Covers planning which passages deserve exhibits, designing three-line tables, drawing publication-style charts with exact values from the text, inserting captions/notes/in-text references, and verifying pagination. Do NOT use for rewriting text or for generating illustrative photos (that is an image-generation task).

How do I install the DOCX Report Figures skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the DOCX Report Figures skill run scripts?

Yes, this skill bundles executable scripts. Review the source before installing.

Related skills

Compare DOCX Report Figures with