$npx -y skills add PangenomeAI/academic-skills-food-nutrition --skill food-figureComprehensive figure system for food & nutrition manuscripts: analyzes the user's data, recommends the best figure(s) to make, then produces submission-grade graphics in Python or R at the target journal's spec. Handles all common scientific figure types (bar/box/violin, line/kin
| 1 | # Food-Figure — Data-Driven Figure System for Food & Nutrition Science |
| 2 | |
| 3 | Turn a dataset (or a described result) into the right submission-grade figure. |
| 4 | **The chart serves the scientific logic; polish is subordinate to making the |
| 5 | core conclusion clear, defensible, and reviewable.** Original work; architecture |
| 6 | informed by open community figure skills (see the repo README Acknowledgements). |
| 7 | |
| 8 | Load reference files **as needed** (progressive disclosure) — don't read them all |
| 9 | up front. The map is in the frontmatter `references` list. |
| 10 | |
| 11 | ## Workflow |
| 12 | |
| 13 | ```mermaid |
| 14 | flowchart TD |
| 15 | A[Data or described result] --> B[1. Analyze the data<br/>scripts/analyze_data.py -> profile] |
| 16 | B --> C[2. Recommend figures<br/>references/data-to-figure.md] |
| 17 | C --> D[3. Figure contract<br/>references/figure-contract.md] |
| 18 | D --> E{Backend?} |
| 19 | E -- unknown --> Eq[Ask 'Python or R?' once<br/>scripts/backend_pref.py] |
| 20 | E -- known --> F |
| 21 | Eq --> F[4. Render<br/>python-guide.md OR r-guide.md + food-recipes.md] |
| 22 | F --> G[5. Export at journal spec<br/>references/journal-specs.md] |
| 23 | G --> H[6. QA<br/>references/qa-checklist.md] |
| 24 | H --> OUT[Journal-ready SVG/PDF/TIFF + editable source] |
| 25 | ``` |
| 26 | |
| 27 | ### 1 — Analyze the data |
| 28 | If the user supplies a data file (CSV/TSV/Excel) or table, profile it first: |
| 29 | run `scripts/analyze_data.py <file>` to get, per column, the type |
| 30 | (numeric/categorical/datetime), cardinality, missingness, distribution summary, |
| 31 | and the detected structure (grouping factors, repeated measures, time/dose axis, |
| 32 | wide sensory/composition matrix). If the user only describes a result, elicit the |
| 33 | same: what varies, what's measured, n, and the error type. See |
| 34 | `references/data-to-figure.md`. |
| 35 | |
| 36 | ### 2 — Recommend the figure(s) |
| 37 | From the profile, propose the **best** figure type(s) with a one-line rationale |
| 38 | each, and say what each would show. Prefer the figure that makes the paper's |
| 39 | claim most directly; note honest alternatives. The decision rules and a full |
| 40 | catalog are in `references/data-to-figure.md` and `references/chart-types.md`. |
| 41 | Never force a chart the data can't support (e.g. bar-of-means where a |
| 42 | distribution matters → box/violin + points). |
| 43 | |
| 44 | ### 3 — Figure contract + provenance (before code) |
| 45 | Fix the conclusion, evidence logic, export needs (target journal), and review |
| 46 | risks (`references/figure-contract.md`). Open a **figure trace card** |
| 47 | (`references/figure-provenance.md`): the real data source, the script that makes |
| 48 | the figure, what it shows, and the claim it supports — so the plotted values match |
| 49 | the reported statistics. Choose the palette by data type |
| 50 | (`references/color-palettes.md`). |
| 51 | |
| 52 | For a dense Figure 1/2-style request, first design the complete evidence story |
| 53 | with `references/figure-story-design.md`: experimental sequence, evidence |
| 54 | hierarchy, non-redundant panel questions, source-data map, opening schematic, and |
| 55 | an integrated synthesis panel. Do not start by filling a grid with chart types. |
| 56 | |
| 57 | ### 4 — Backend gate (blocking) |
| 58 | - **Data figures → Python or R (always).** Resolve the backend by priority: |
| 59 | explicit request → language of the user's input files/data → saved preference |
| 60 | (`python scripts/backend_pref.py get`) → ask once ("Python or R? I'll remember |
| 61 | this") and save it (`backend_pref.py set python|r`). The chosen backend does |
| 62 | **all** data graphics, |