Creates and validates publication-quality clinical figures using ggplot2 or matplotlib with standardized styling and manifest tracking.
- GitHub stars
- 6
- Files
- 9
- Last commit
- Oct 31, 2026
- License
- MIT
- Allowed tools
- —
What does the method-figure skill do?
method-figure creates and validates publication-quality clinical figures using ggplot2 or matplotlib with standardized styling and manifest tracking.
Summary generated from the skill's SKILL.md.
About the method-figure skill
Creating publication-ready clinical plots from R or Python is what this skill enables for researchers and medical writers. It automates the generation of standardized figures like Kaplan-Meier curves, forest plots, ROC curves, and calibration plots using ggplot2 or matplotlib. By applying a journal-neutral clinical style, it ensures that typography, axis scaling, and legend placement meet strict manuscript requirements.
An agent should load this skill when a user requests a specific manuscript figure or needs to validate existing plots against journal standards. The workflow produces vector PDF exports, detailed captions, and alt text, while maintaining a figure manifest for data traceability. It relies on specific language assets like theme_clinical.R for R or clinical_style.py for Python to maintain consistency. The skill distinguishes itself by using a validator to check the manifest for missing source code, data, or style profiles, ensuring every figure is reproducible and ready for submission.
What an agent can do with it
- 1Ensure data traceabilityLink every figure to its source data, statistical analysis plan section, and original script.
Written from the skill's SKILL.md. Every use case is checked against a quote from it.
How to install the method-figure skill
Each command copies the skill folder into the client's skills directory. Restart the client or start a new session to load it.Install the method-figure skill in Plugin
/plugin marketplace add sajor2000/methodsmith /plugin install methodsmith@methodsmith
Install the method-figure skill in Claude Code
~/.claude/skills/method-figure/SKILL.md
$ npx degit sajor2000/methodsmith/plugins/methodsmith/skills/method-figure ~/.claude/skills/method-figureInstall the method-figure skill in Claude Code (project)
.claude/skills/method-figure/SKILL.md
$ npx degit sajor2000/methodsmith/plugins/methodsmith/skills/method-figure .claude/skills/method-figureInstall the method-figure skill in Codex
~/.agents/skills/method-figure/SKILL.md
$ npx degit sajor2000/methodsmith/plugins/methodsmith/skills/method-figure ~/.agents/skills/method-figureInstall the method-figure skill in Gemini CLI
~/.gemini/skills/method-figure/SKILL.md
$ npx degit sajor2000/methodsmith/plugins/methodsmith/skills/method-figure ~/.gemini/skills/method-figureInstall the method-figure skill in Claude.ai
npx degit sajor2000/methodsmith/plugins/methodsmith/skills/method-figure method-figure && zip -r method-figure.zip method-figure # claude.ai → Customize → Skills → + → Create skill → Upload a skill → method-figure.zip
Automated checks
Ran Nov 15, 2026Full report →Passed our automated checks. That is not a security audit: read the scripts before you let an agent run them. How checks work
- Source repository linked and reachablesajor2000/methodsmith/plugins/methodsmith/skills/method-figure is public and reachablegithub.com/sajor2000/methodsmith/tree/HEAD/plugins/methodsmi ↗Pass
- Open source license (OSI)MITspdx.org/licenses/MIT.html ↗Pass
- Commit or release in the last yearLast commit 2026-10-31github.com/sajor2000/methodsmith/commits ↗Pass
- No download-and-run or credential theft in scripts2 scripts read; no download-and-run, remote eval, base64 execution or credential uploadPass
- No hidden instructions in SKILL.mdNo override phrases, safeguard switches, credential requests or hidden charactersgithub.com/sajor2000/methodsmith/blob/HEAD/plugins/methodsmi ↗Pass
- Pre-approved tools are scopedNo pre-approved tools; the agent asks before using onegithub.com/sajor2000/methodsmith/blob/HEAD/plugins/methodsmi ↗Pass
- SKILL.md follows the Agent Skills formatValid name and description; says when to use it; 94 linesgithub.com/sajor2000/methodsmith/blob/HEAD/plugins/methodsmi ↗Pass
SKILL.md
View on GitHubPublication Figure Workflow
Run the commands below from the user's project root. The
SKILL_DIRanchor locates the bundled script and assets;--manifestand--project-rootstay project-relative.
Skill Value
- Problem it solves: Figures can look polished in a notebook and still fail journal typography, sizing, axis, legend, caption, or data-traceability standards, and R and Python figures in one manuscript drift apart in style.
- Use when: The user asks for a manuscript figure or plot (Kaplan-Meier, forest, dot and CI, box, scatter, line, heat map, ROC, calibration, flow diagram, multi-panel), figure styling in ggplot2 or matplotlib/seaborn, a figure manifest, or figure QA.
- Output: Figure exported at final column width from a saved script or notebook, in the
clinical-standardstyle (or a journal override), with a manifest entry, validator report, and visual inspection notes. - Ask only if: Figure purpose, source data, figure type, panel structure, target journal, or language (R vs Python) is unclear.
- Do not do: Do not invent data, type counts by hand, scale a large figure down to fit, or skip visual inspection when the harness can view images; otherwise report visual inspection as not performed.
- Interaction: Check repo/config/chat evidence first. Ask one decision-changing question at a time; use the current harness's blocking question UI when available, otherwise present numbered choices and wait.
A figure is ready only when its source data, source code, output file, caption, alt text, SAP link, and style profile are visible in the manifest and the validator reports no blockers.
When the requested figure workflow creates or materially extends a Marimo, Jupyter, R Markdown, or Quarto notebook, load the method-notebook-standards skill before creating cells or chunks.
Style System
clinical-standardis the defaultstyle_profile: a journal-neutral clinical publication style (Arial/Helvetica, 12 pt bold caption title, 10 pt axis titles, 8-9 pt ticks and legends, nothing under 8 pt, open left/bottom axes, no gridlines, Okabe-Ito palette, legend outside the data, 3.5/5/7 in widths, vector PDF with embedded fonts). Rules by topic and figure type:references/figure-style-guide.md.- Journal overrides (
jama,generic-biomedical) change only what that journal specifies (formats, sizes); everything else inheritsclinical-standard. Settings:references/figure-style-profiles.yaml. When the user names a journal, read its live instructions and setstyle_profileto its override name (or toclinical-standardwith a note when no override exists). - Language assets:
assets/theme_clinical.R(theme_clinical(),scale_color_clinical(),scale_fill_clinical(),save_figure()) andassets/clinical_style.pywithassets/clinical.mplstyle(apply_clinical_style(),save_figure(),add_panel_labels(),km_with_risk_table(),forest_plot(),dot_ci_plot(),roc_plot(),calibration_plot()). Call recipes per figure type and per environment (RStudio, Jupyter, Marimo):references/r-and-python-recipes.md.
Workflow
- Identify the figure type, the source data file, the SAP section, the target journal, and the language. Match the user's existing stack (ggplot2 in R scripts or Quarto; matplotlib/seaborn/lifelines in Jupyter or Marimo).
- Read the matching figure-type checklist in
references/figure-style-guide.mdand the recipe inreferences/r-and-python-recipes.md. Copy the language asset into the project (recommended, keeps the figure reproducible without the plugin):
SKILL_DIR="<absolute path of the directory containing this SKILL.md>";
cp "$SKILL_DIR/assets/theme_clinical.R" analysis/scripts/theme_clinical.R
or cp "$SKILL_DIR/assets/clinical_style.py" analysis/scripts/clinical_style.py for Python. Loading in place (source() / sys.path.insert() with the absolute path) is acceptable when the user prefers it; record the path in the script header.
- Render from the source data with a saved script or notebook cell group (
analysis/scripts/figN.R,figN.py, or a notebook), applyingtheme_clinical()orapply_clinical_style(), the palette scale, axis titles in "Quantity, unit" form, and the figure-type rules (risk table under KM curves, log axis and reference line for ratios, diagonal for ROC/calibration, panel labels A, B, C). - Export at final size with
save_figure(): width 3.5, 5, or 7 in, height <= 9 in, vector PDF (plus a PNG review copy); never render large and shrink. Marimo: returnfigfrom the cell or usemo.mpl.interactive(fig); Jupyter: set%config InlineBackend.figure_format = 'retina'; neither preview is the export. - Write the caption ("Figure n. Title Case Title." then abbreviations, error bar or shading definition, n per group, method, axis notes) and alt text (chart type, variables, main pattern, one key number), citing every reported number in captions and alt text as
{{num:<id>}}from the number registry (load themethod-numbersskill; register figure-level numbers such as n per group in the figure script withregister_number), keeping the caption sources inanalysis/publication/figures/captions.md, rendering them with itsrender, and running itscheckon both; then add or update the manifest entry inanalysis/publication/figures/figure-manifest.jsonwithstyle_profile: clinical-standard(or the journal override). - Run the validator:
SKILL_DIR="<absolute path of the directory containing this SKILL.md>";
python3 "$SKILL_DIR/scripts/validate_figure_manifest.py" --manifest analysis/publication/figures/figure-manifest.json --project-root .
If python3 is missing, try python, then py; with none available, check the readiness rules below by hand and say so.
- Resolve blockers before marking any figure manuscript-ready; address warnings or state why they stand.
- If the harness can view images, open the exported PDF/PNG and inspect for text overlap, clipped labels, legend over data, text under 8 pt, missing units, missing risk table, and panel-label order; run the "Before-export checklist" from the style guide. Otherwise report visual inspection as not performed.
For QA-only requests (existing figures or manifest), start at step 6 and apply steps 7-8 to the existing exports, reporting style deviations against the checklist without re-rendering unless asked.
Manifest Shape
{
"figures": [
{
"figure_id": "fig1",
"sap_section": "SAP-5.1",
"source_data": "analysis/publication/figures/fig1-source.csv",
"source_code": "analysis/scripts/fig1.R",
"output_path": "analysis/publication/figures/fig1.pdf",
"caption": "Figure 1. Kaplan-Meier Estimates of 90-Day Mortality by Treatment Group. Shaded areas indicate 95% CIs. HR indicates hazard ratio.",
"alt_text": "Two Kaplan-Meier curves of survival probability over 90 days by treatment group; the intervention curve stays above control, 90-day survival 78% vs 71%.",
"style_profile": "clinical-standard",
"checklist_items": ["CONSORT-26"]
}
]
}
Readiness Rules
- Block duplicate figure IDs.
- Block absolute or parent-traversal paths.
- Block missing required fields (
figure_id,sap_section,source_data,source_code,output_path,caption,alt_text,style_profile) and source data, source code, or output files that do not exist. - Warn when no checklist item is linked.
- Warn when the output format is not a common publication format (PDF, EPS, SVG, TIFF, PNG, or JPEG).
- Warn when
style_profileis notclinical-standard,jama, orgeneric-biomedical. - Warn when
captiondoes not start withFigure <n>.oralt_textis shorter than 20 characters.
References
@./references/figure-spec.md
Loaded on demand: references/figure-style-guide.md (style rules and figure-type checklists), references/r-and-python-recipes.md (calls per figure type and environment), references/figure-style-profiles.yaml (profile settings), assets/theme_clinical.R, assets/clinical_style.py, assets/clinical.mplstyle.
Files in this skill
9method-figure skill questions
How do I install the method-figure skill in Claude Code?
Run npx degit sajor2000/methodsmith/plugins/methodsmith/skills/method-figure ~/.claude/skills/method-figure. Claude Code loads skills from ~/.claude/skills (all projects) or .claude/skills (one project) and uses a skill when its description matches the task.
Which clients can use the method-figure skill?
Any client that reads the Agent Skills format: Claude Code, Codex, Gemini CLI and claude.ai (upload as a ZIP). Scripts in the skill run only where the client allows code execution.
What kind of figures can this skill create?
The skill can create Kaplan-Meier, forest, calibration, ROC, multi-panel, dot and CI, box, scatter, line, heat map, and flow diagrams.
What information is required in the figure manifest?
A figure is ready when its source data, source code, output file, caption, alt text, SAP link, and style profile are all visible in the manifest.