psyclaw 0.28.0 → 0.28.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/agents/recommended/catalog.json +99 -0
- package/dist/apps/panel/index.html +5 -5
- package/dist/src/adapters/pi/extension.js +164 -18
- package/dist/src/adapters/pi/extension.js.map +1 -1
- package/dist/src/adapters/pi/rpc.d.ts +2 -0
- package/dist/src/adapters/pi/rpc.js +9 -2
- package/dist/src/adapters/pi/rpc.js.map +1 -1
- package/dist/src/agents/recommended-personas.d.ts +42 -0
- package/dist/src/agents/recommended-personas.js +135 -0
- package/dist/src/agents/recommended-personas.js.map +1 -0
- package/dist/src/ars/mode-editor.d.ts +20 -0
- package/dist/src/ars/mode-editor.js +57 -0
- package/dist/src/ars/mode-editor.js.map +1 -0
- package/dist/src/ars/profile.d.ts +4 -1
- package/dist/src/ars/profile.js +23 -6
- package/dist/src/ars/profile.js.map +1 -1
- package/dist/src/cli.js +6 -3
- package/dist/src/cli.js.map +1 -1
- package/dist/src/creation/contracts.d.ts +3 -0
- package/dist/src/creation/service.js +17 -5
- package/dist/src/creation/service.js.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/orchestration/bundled-personas.d.ts +16 -0
- package/dist/src/orchestration/bundled-personas.js +101 -0
- package/dist/src/orchestration/bundled-personas.js.map +1 -0
- package/dist/src/orchestration/effects.d.ts +8 -0
- package/dist/src/orchestration/effects.js +39 -0
- package/dist/src/orchestration/effects.js.map +1 -0
- package/dist/src/orchestration/personas.d.ts +2 -1
- package/dist/src/orchestration/personas.js +20 -7
- package/dist/src/orchestration/personas.js.map +1 -1
- package/dist/src/orchestration/pi-executor.d.ts +9 -5
- package/dist/src/orchestration/pi-executor.js +55 -22
- package/dist/src/orchestration/pi-executor.js.map +1 -1
- package/dist/src/orchestration/research-agents.d.ts +3 -7
- package/dist/src/orchestration/research-agents.js +5 -69
- package/dist/src/orchestration/research-agents.js.map +1 -1
- package/dist/src/panel/server.js +6 -0
- package/dist/src/panel/server.js.map +1 -1
- package/dist/src/style/cli-ui.d.ts +14 -0
- package/dist/src/style/cli-ui.js +45 -0
- package/dist/src/style/cli-ui.js.map +1 -1
- package/dist/src/tui/skill-manager.js +1 -1
- package/dist/src/tui/skill-manager.js.map +1 -1
- package/dist/src/updates/update.js +9 -3
- package/dist/src/updates/update.js.map +1 -1
- package/package.json +11 -3
- package/vendor/academic-paper-skills/LICENSE +21 -0
- package/vendor/academic-paper-skills/NOTICE.md +7 -0
- package/vendor/academic-paper-skills/PSYCLAW_SOURCE.json +14 -0
- package/vendor/academic-paper-skills/academic-paper-composer/SKILL.md +840 -0
- package/vendor/academic-paper-skills/academic-paper-composer/references/section_guides.md +675 -0
- package/vendor/academic-paper-skills/academic-paper-composer/references/writing_standards.md +629 -0
- package/vendor/academic-paper-skills/academic-paper-composer/scripts/chapter_quality_check.py +470 -0
- package/vendor/academic-paper-skills/academic-paper-composer/scripts/final_evaluation.py +550 -0
- package/vendor/academic-paper-skills/academic-paper-strategist/SKILL.md +670 -0
- package/vendor/academic-paper-skills/academic-paper-strategist/references/quality_standards.md +336 -0
- package/vendor/academic-paper-skills/academic-paper-strategist/references/search_strategy.md +459 -0
- package/vendor/academic-paper-skills/academic-paper-strategist/scripts/evaluate_samples.py +300 -0
- package/vendor/academic-paper-skills/academic-paper-strategist/scripts/gap_analysis.py +399 -0
- package/vendor/ars/pi/wrapper.js +9 -0
- package/vendor/nature-skills/LICENSE +201 -0
- package/vendor/nature-skills/NOTICE.md +7 -0
- package/vendor/nature-skills/PSYCLAW_SOURCE.json +19 -0
- package/vendor/nature-skills/skills/nature-figure/README.md +107 -0
- package/vendor/nature-skills/skills/nature-figure/README_EN.md +107 -0
- package/vendor/nature-skills/skills/nature-figure/SKILL.md +154 -0
- package/vendor/nature-skills/skills/nature-figure/agents/openai.yaml +4 -0
- package/vendor/nature-skills/skills/nature-figure/evals/evals.json +325 -0
- package/vendor/nature-skills/skills/nature-figure/manifest.yaml +103 -0
- package/vendor/nature-skills/skills/nature-figure/references/ai-graphical-abstract-workflow.md +129 -0
- package/vendor/nature-skills/skills/nature-figure/references/api.md +576 -0
- package/vendor/nature-skills/skills/nature-figure/references/asset-adaptation.md +72 -0
- package/vendor/nature-skills/skills/nature-figure/references/backend-selection.md +118 -0
- package/vendor/nature-skills/skills/nature-figure/references/chart-types.md +348 -0
- package/vendor/nature-skills/skills/nature-figure/references/common-patterns.md +371 -0
- package/vendor/nature-skills/skills/nature-figure/references/demos.md +58 -0
- package/vendor/nature-skills/skills/nature-figure/references/design-theory.md +467 -0
- package/vendor/nature-skills/skills/nature-figure/references/figure-contract.md +122 -0
- package/vendor/nature-skills/skills/nature-figure/references/figure-legend-conventions.md +90 -0
- package/vendor/nature-skills/skills/nature-figure/references/multipanel-evidence-architecture.md +268 -0
- package/vendor/nature-skills/skills/nature-figure/references/nature-2026-observations.md +124 -0
- package/vendor/nature-skills/skills/nature-figure/references/nature-article-requirements.md +149 -0
- package/vendor/nature-skills/skills/nature-figure/references/openrouter-image-generation.md +141 -0
- package/vendor/nature-skills/skills/nature-figure/references/qa-contract.md +344 -0
- package/vendor/nature-skills/skills/nature-figure/references/r-template-index.md +66 -0
- package/vendor/nature-skills/skills/nature-figure/references/r-workflow.md +234 -0
- package/vendor/nature-skills/skills/nature-figure/references/template-catalog.md +33 -0
- package/vendor/nature-skills/skills/nature-figure/references/tutorials.md +260 -0
- package/vendor/nature-skills/skills/nature-figure/requirements.txt +1 -0
- package/vendor/nature-skills/skills/nature-figure/scripts/audit_figure_collisions.py +742 -0
- package/vendor/nature-skills/skills/nature-figure/scripts/audit_panel_alignment.py +933 -0
- package/vendor/nature-skills/skills/nature-figure/scripts/audit_pdf_text.py +152 -0
- package/vendor/nature-skills/skills/nature-figure/scripts/figure_safety.py +50 -0
- package/vendor/nature-skills/skills/nature-figure/scripts/generate_openrouter_schematic.py +260 -0
- package/vendor/nature-skills/skills/nature-figure/scripts/nature_figure_backend.py +93 -0
- package/vendor/nature-skills/skills/nature-figure/scripts/panel_alignment.R +188 -0
- package/vendor/nature-skills/skills/nature-figure/scripts/plot_templates.py +604 -0
- package/vendor/nature-skills/skills/nature-figure/scripts/validate_figure.py +835 -0
- package/vendor/nature-skills/skills/nature-figure/static/core/contract.md +55 -0
- package/vendor/nature-skills/skills/nature-figure/static/core/stance.md +41 -0
- package/vendor/nature-skills/skills/nature-figure/static/fragments/backend/python.md +56 -0
- package/vendor/nature-skills/skills/nature-figure/static/fragments/backend/r.md +63 -0
- package/vendor/nature-skills/skills/nature-figure/tests/test_figure_safety.py +209 -0
- package/vendor/nature-skills/skills/nature-polishing/README.md +58 -0
- package/vendor/nature-skills/skills/nature-polishing/README_EN.md +58 -0
- package/vendor/nature-skills/skills/nature-polishing/SKILL.md +111 -0
- package/vendor/nature-skills/skills/nature-polishing/agents/openai.yaml +4 -0
- package/vendor/nature-skills/skills/nature-polishing/manifest.yaml +101 -0
- package/vendor/nature-skills/skills/nature-polishing/references/latex-layout.md +211 -0
- package/vendor/nature-skills/skills/nature-polishing/references/nat-comms-2025-diction.md +73 -0
- package/vendor/nature-skills/skills/nature-polishing/references/phrasebank-playbook.md +175 -0
- package/vendor/nature-skills/skills/nature-polishing/references/published-article-patterns.md +126 -0
- package/vendor/nature-skills/skills/nature-polishing/references/section-moves.md +252 -0
- package/vendor/nature-skills/skills/nature-polishing/references/style-guardrails.md +94 -0
- package/vendor/nature-skills/skills/nature-polishing/references/writing-strategy.md +160 -0
- package/vendor/nature-skills/skills/nature-polishing/static/core/failure-modes.md +29 -0
- package/vendor/nature-skills/skills/nature-polishing/static/core/output-format.md +21 -0
- package/vendor/nature-skills/skills/nature-polishing/static/core/stance.md +26 -0
- package/vendor/nature-skills/skills/nature-polishing/static/fragments/journal/generic.md +17 -0
- package/vendor/nature-skills/skills/nature-polishing/static/fragments/journal/nat-comms.md +38 -0
- package/vendor/nature-skills/skills/nature-polishing/static/fragments/journal/nat-mach-intell.md +102 -0
- package/vendor/nature-skills/skills/nature-polishing/static/fragments/journal/nature.md +19 -0
- package/vendor/nature-skills/skills/nature-polishing/static/fragments/language/en.md +19 -0
- package/vendor/nature-skills/skills/nature-polishing/static/fragments/language/zh-to-en.md +19 -0
- package/vendor/nature-skills/skills/nature-polishing/static/fragments/paper_type/algorithmic.md +18 -0
- package/vendor/nature-skills/skills/nature-polishing/static/fragments/paper_type/hypothesis.md +17 -0
- package/vendor/nature-skills/skills/nature-polishing/static/fragments/paper_type/methods.md +35 -0
- package/vendor/nature-skills/skills/nature-polishing/static/fragments/paper_type/research.md +29 -0
- package/vendor/nature-skills/skills/nature-polishing/static/fragments/paper_type/review.md +17 -0
- package/vendor/nature-skills/skills/nature-polishing/static/fragments/section/abstract.md +26 -0
- package/vendor/nature-skills/skills/nature-polishing/static/fragments/section/conclusion.md +15 -0
- package/vendor/nature-skills/skills/nature-polishing/static/fragments/section/discussion.md +48 -0
- package/vendor/nature-skills/skills/nature-polishing/static/fragments/section/intro.md +33 -0
- package/vendor/nature-skills/skills/nature-polishing/static/fragments/section/methods.md +26 -0
- package/vendor/nature-skills/skills/nature-polishing/static/fragments/section/results.md +61 -0
- package/vendor/nature-skills/skills/nature-polishing/static/fragments/section/title.md +17 -0
- package/vendor/nature-skills/skills/nature-ref-verifier/README.md +44 -0
- package/vendor/nature-skills/skills/nature-ref-verifier/README_EN.md +44 -0
- package/vendor/nature-skills/skills/nature-ref-verifier/SKILL.md +196 -0
- package/vendor/nature-skills/skills/nature-ref-verifier/agents/openai.yaml +4 -0
- package/vendor/nature-skills/skills/nature-ref-verifier/manifest.yaml +19 -0
- package/vendor/nature-skills/skills/nature-ref-verifier/references/common-patterns.md +96 -0
- package/vendor/nature-skills/skills/nature-shared/README.md +43 -0
- package/vendor/nature-skills/skills/nature-shared/README_EN.md +43 -0
- package/vendor/nature-skills/skills/nature-shared/SKILL.md +33 -0
- package/vendor/nature-skills/skills/nature-shared/agents/openai.yaml +6 -0
- package/vendor/nature-skills/skills/nature-shared/core/consistency-sweep.md +122 -0
- package/vendor/nature-skills/skills/nature-shared/core/discussion-argument-language.md +192 -0
- package/vendor/nature-skills/skills/nature-shared/core/ethics.md +88 -0
- package/vendor/nature-skills/skills/nature-shared/core/main-text-discipline.md +179 -0
- package/vendor/nature-skills/skills/nature-shared/core/nature-abstract.md +171 -0
- package/vendor/nature-skills/skills/nature-shared/core/nature-introduction.md +164 -0
- package/vendor/nature-skills/skills/nature-shared/core/nature-results-discussion.md +215 -0
- package/vendor/nature-skills/skills/nature-shared/core/paper-type-taxonomy.md +41 -0
- package/vendor/nature-skills/skills/nature-shared/core/reader-workflow.md +21 -0
- package/vendor/nature-skills/skills/nature-shared/core/research-compliance.md +192 -0
- package/vendor/nature-skills/skills/nature-shared/core/terminology-ledger.md +58 -0
- package/vendor/nature-skills/skills/nature-shared/journal-formats/nat-comms.md +139 -0
- package/vendor/nature-skills/skills/nature-shared/journal-formats/nature-machine-intelligence.md +431 -0
- package/vendor/nature-skills/skills/nature-shared/journal-formats/nature.md +313 -0
- package/vendor/nature-skills/skills/nature-shared/manifest.yaml +52 -0
- package/vendor/nature-skills/skills/nature-shared/scripts/check_consistency.py +273 -0
- package/vendor/nature-skills/skills/nature-shared/tests/test_check_consistency.py +63 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Figure contract before plotting
|
|
2
|
+
|
|
3
|
+
A publication-quality scientific figure is a visual argument, not an isolated pretty plot. Every figure starts from a claim, an evidence hierarchy, and a review-risk check before code or aesthetics. Before generating or editing code, establish the contract below.
|
|
4
|
+
|
|
5
|
+
## Backend selection uses the task context and saved preference
|
|
6
|
+
|
|
7
|
+
Backend selection applies only to rendering or editing plotting code. Reuse a choice already established in the same task and its follow-ups; do not ask again merely because a new message omits the language. Read-only figure review and backend-independent data inspection may proceed without this choice. If the backend remains unresolved, retain the one-time Python/R question and pause only dependent plotting steps. Explicit approval requirements and backend exclusivity remain in force.
|
|
8
|
+
|
|
9
|
+
For plotting tasks, first honor an explicit Python/R choice in the current request or a clearly language-specific input file/workflow. Save that backend as the user's default with `scripts/nature_figure_backend.py set python` or `scripts/nature_figure_backend.py set r`.
|
|
10
|
+
|
|
11
|
+
If the current request does not specify a backend, first reuse the choice established in this task; otherwise check the saved preference with `scripts/nature_figure_backend.py get`. If it returns `python` or `r`, use that backend without asking again.
|
|
12
|
+
|
|
13
|
+
If no saved preference exists, ask one concise question: **Python or R? I will remember this as your default.** Pause dependent plotting steps and wait for the user's answer; continue independent inspection. Do not generate mock data, write scripts, create figures, or choose Python/R by default before this first preference is established. After the user answers, save it and proceed.
|
|
14
|
+
|
|
15
|
+
Only recommend a backend when the user explicitly asks you to choose or recommend one. In that case, use `references/backend-selection.md`, state the reason, save the selected backend, and then proceed with the recommended backend.
|
|
16
|
+
|
|
17
|
+
## The selected backend is exclusive
|
|
18
|
+
|
|
19
|
+
Once Python or R is selected, every plotting script, preview image, SVG/PDF/TIFF/PNG export, QA render, and visual workaround must be produced by that same backend. Do not use Python to draw a preview for an R figure, and do not use R to draw a preview for a Python figure, even if the selected runtime or packages are missing locally. The non-selected language may only be used for non-visual file inspection or data conversion when it does not open a graphics device, import plotting libraries, create image/vector files, or change the final visual appearance.
|
|
20
|
+
|
|
21
|
+
The backend-neutral `audit_panel_alignment.py`, `audit_pdf_text.py` and
|
|
22
|
+
`audit_figure_collisions.py` tools may inspect a layout manifest or final PDF
|
|
23
|
+
from either backend. They do not redraw the scientific content. The selected
|
|
24
|
+
backend must measure its own final axes/grob geometry before the alignment JSON
|
|
25
|
+
is audited. Alignment and collision overlays are QA-only, not previews,
|
|
26
|
+
substitute exports or submission assets; keep the original selected-backend
|
|
27
|
+
figure authoritative.
|
|
28
|
+
|
|
29
|
+
## Missing runtime/package rule
|
|
30
|
+
|
|
31
|
+
After the backend is selected, check the selected runtime early (`Rscript`/R for R; Python and required plotting packages for Python). If the selected runtime or required packages are unavailable, pause rendering, continue independent script or data checks, and report the exact blocker. You may provide a selected-backend script and installation commands, or ask permission to install dependencies, but you must not fall back to the other language to make a substitute figure.
|
|
32
|
+
|
|
33
|
+
## Data-integrity gate
|
|
34
|
+
|
|
35
|
+
Use all user-provided observations and requested variables unless an exclusion has a scientific or statistical justification or the user explicitly requests a subset. Never reduce data merely to make a plot easier or faster to render. For large point clouds, prefer rasterized marks, hexbin/density representations, aggregation with a stated rule, or another backend-native rendering strategy.
|
|
36
|
+
|
|
37
|
+
If any row, column, replicate, image, or category is excluded, record the before/after counts, the exact rule, and the reason in the QA notes. Preserve the unmodified source data and never silently select convenient columns to satisfy a template.
|
|
38
|
+
|
|
39
|
+
Plan figures by scientific claims, not by source tables. Do not turn each table into a separate figure when several tables answer the same question. If an effect is defined within matched datasets, subjects, seeds, or tasks, inspect and visualize paired differences rather than relying only on overlapping marginal distributions; large between-unit heterogeneity can hide a strong paired effect.
|
|
40
|
+
|
|
41
|
+
## The five-point contract
|
|
42
|
+
|
|
43
|
+
1. **Core conclusion**: write the one-sentence claim the figure must defend and the Results-level scientific question it answers.
|
|
44
|
+
2. **Evidence chain**: map each planned panel to one distinct inferential role in that claim, and drop, merge, or demote panels that only redraw another panel's evidence or repeat it under a secondary metric.
|
|
45
|
+
3. **Archetype**: classify the figure as `quantitative grid`, `schematic-led composite`, `image plate + quant`, or `asymmetric mixed-modality figure`.
|
|
46
|
+
4. **Backend**: use the explicit or saved Python/R track exclusively for all figure drawing, previewing, exporting, and visual QA. Do not cross-render with the other language.
|
|
47
|
+
5. **Journal/export contract**: set final dimensions, a 5 pt floor for every rendered glyph, editable text, source data, statistics, image-integrity notes, export formats, a blocking multi-panel alignment gate, and automatic rendered collision QA before styling.
|
|
48
|
+
|
|
49
|
+
The highest-priority rule is: **the chart serves the scientific logic**. Aesthetic polish, template matching, and complex layout are subordinate to making the core conclusion clear, defensible, and reviewable.
|
|
50
|
+
|
|
51
|
+
For the full method to convert a request into core conclusion, evidence hierarchy, panel map, and review-risk checks, open `references/figure-contract.md`.
|
|
52
|
+
For a labelled multi-panel figure or a manuscript-level figure sequence, also
|
|
53
|
+
open `references/multipanel-evidence-architecture.md`: use one figure-level
|
|
54
|
+
claim as the planning default, give panels complementary evidence roles, and
|
|
55
|
+
align successive figures with the Results claim escalation.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Default operating stance
|
|
2
|
+
|
|
3
|
+
The older Python/matplotlib rules in this skill remain valid. The skill also supports R, especially `ggplot2 + patchwork + ComplexHeatmap + ggrepel + svglite/cairo_pdf + ragg`.
|
|
4
|
+
|
|
5
|
+
## Color policy
|
|
6
|
+
|
|
7
|
+
Prefer **unified method families across all panels** over maximal hue separation. For dense Nature Machine Intelligence-style figure pages, use the low-saturation `NMI pastel` family described in `references/api.md` and reserve green/red mainly for gains, drops, and other directional cues.
|
|
8
|
+
|
|
9
|
+
## Stance
|
|
10
|
+
|
|
11
|
+
- Start by classifying the requested figure into one of four archetypes: `quantitative grid`, `schematic-led composite`, `image plate + quant`, or `asymmetric mixed-modality figure`.
|
|
12
|
+
- Prefer one **hero panel** plus subordinate evidence panels over filling the canvas with equal-sized subplots.
|
|
13
|
+
- If the user asks for a single chart, still identify its role in the manuscript claim: discovery, mechanism, validation, comparison, robustness, or clinical/biological relevance.
|
|
14
|
+
- Keep the background white for plots and diagrams; switch to black only for microscopy / volume-rendering image plates.
|
|
15
|
+
- Prefer direct labels over legends when categories are spatially fixed or the legend would force unnecessary eye travel.
|
|
16
|
+
- Keep one restrained palette per figure: usually one neutral family, one signal family, and one accent family.
|
|
17
|
+
- Treat perceptual separation as necessary but not sufficient: verify that the intended hero series is more salient than baselines after rendering, and do not reuse a sequential light-to-dark scale as unrelated categorical colors.
|
|
18
|
+
- Treat statistics, `n`, error-bar definitions, source-data traceability, and image-integrity notes as part of the figure, not as optional caption cleanup.
|
|
19
|
+
- When panels show comparable seed/fold/split aggregates, use the same uncertainty definition in every comparable panel or state why a panel is exempt.
|
|
20
|
+
- Preserve canonical model capitalization in display labels. Legend entries use display-style initial capitalization; prose follows normal sentence grammar. Never apply blind `.title()` transformations to names such as `XGBoost`, `DeepSeek`, `GPT-5.2`, or `RF`.
|
|
21
|
+
- Require the render-time alignment gate for every multi-panel layout, followed by a final-size, panel-by-panel visual inspection. Source validation cannot prove color hierarchy, label clearance, legend spacing, or complete uncertainty coverage.
|
|
22
|
+
- When the user asks for broad `Nature` style rather than ML/NMI-specific style, read `references/nature-2026-observations.md` before choosing layout.
|
|
23
|
+
- When the user references `figures4papers` or the older `scientific-figure-making` skill, treat this skill as the successor and open `references/demos.md` for the third-party demo map, copyright boundary, and original reimplementation guidance.
|
|
24
|
+
|
|
25
|
+
## User-facing privacy rule
|
|
26
|
+
|
|
27
|
+
Do not disclose private local paths, private filenames, chat-attachment names, internal reference filenames, template identifiers, or the provenance of private working materials in user-facing replies, generated code comments, figure legends, reports, or manuscript text. Use generic descriptions such as "the provided R template collection", "a private working draft", or "the internal figure contract". If the user provides a private plotting template collection, use it only as an internal adaptation source and do not reveal its path, filenames, or provenance. Only reveal an exact path or source file when the user explicitly asks for that audit trail.
|
|
28
|
+
|
|
29
|
+
## When to load this skill
|
|
30
|
+
|
|
31
|
+
- Python or R figures for **papers, slides, or reports** targeting Nature, Science, Cell, NeurIPS, ICLR, or similar venues.
|
|
32
|
+
- Requests involving **grouped bars, trend lines, heatmaps, radar plots, multi-panel grids**, or **PDF/SVG/high-DPI** output.
|
|
33
|
+
- Any mention of "Nature style", "publication figure", "paper figure", "SCI figure", "figures4papers", "scientific-figure-making", "R plotting template", or "high-quality scientific plot".
|
|
34
|
+
- Requests to improve a figure's logic, aesthetics, panel layout, figure legend, export quality, or journal-readiness.
|
|
35
|
+
|
|
36
|
+
## When NOT to load
|
|
37
|
+
|
|
38
|
+
- Plotly, Altair, Bokeh, or other interactive/web-first plotting.
|
|
39
|
+
- EDA-only plots without a publication target.
|
|
40
|
+
- Primary workflow is 3D, GIS, or non-scientific illustration tooling.
|
|
41
|
+
- Illustrator / Figma–first layout.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Backend: Python (matplotlib / seaborn)
|
|
2
|
+
|
|
3
|
+
**Python-only execution rule.** When the user has selected Python, do all figure drawing, previewing, exporting, and visual QA in Python. Do not call R/ggplot2, ComplexHeatmap, patchwork, or any R graphics device to create a temporary preview, fallback export, or layout approximation. If Python or required Python plotting packages are missing, pause rendering, continue independent script or data checks, and report the missing dependency. You may still write the Python script, provide `pip`/environment install commands, or ask permission to install dependencies, but do not cross-render the figure in R.
|
|
4
|
+
|
|
5
|
+
## Python quick-start
|
|
6
|
+
|
|
7
|
+
```python
|
|
8
|
+
import matplotlib as mpl
|
|
9
|
+
import matplotlib.pyplot as plt
|
|
10
|
+
# Copy audit_panel_alignment.py beside the plotting source or add the skill's
|
|
11
|
+
# scripts directory to PYTHONPATH before importing it.
|
|
12
|
+
from audit_panel_alignment import require_matplotlib_panel_alignment
|
|
13
|
+
|
|
14
|
+
mpl.rcParams.update({
|
|
15
|
+
"font.family": "sans-serif",
|
|
16
|
+
"font.sans-serif": ["Arial", "Helvetica", "DejaVu Sans", "sans-serif"],
|
|
17
|
+
"svg.fonttype": "none", # editable text in SVG
|
|
18
|
+
"pdf.fonttype": 42, # editable TrueType text in PDF
|
|
19
|
+
"font.size": 7, # use 15-24 only for large slide-sized panels
|
|
20
|
+
"axes.spines.right": False,
|
|
21
|
+
"axes.spines.top": False,
|
|
22
|
+
"axes.linewidth": 0.8,
|
|
23
|
+
"legend.frameon": False,
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
def save_pub_py(fig, filename, dpi=600):
|
|
27
|
+
# Run after every layout-affecting change, before export. Single-panel
|
|
28
|
+
# figures record NOT APPLICABLE; unresolved multi-panel geometry blocks.
|
|
29
|
+
require_matplotlib_panel_alignment(
|
|
30
|
+
fig,
|
|
31
|
+
json_out=f"{filename}.alignment.json",
|
|
32
|
+
overlay_svg=f"{filename}.alignment.svg",
|
|
33
|
+
tolerance_pt=1.5,
|
|
34
|
+
gutter_tolerance_pt=1.5,
|
|
35
|
+
strict=True,
|
|
36
|
+
)
|
|
37
|
+
fig.savefig(f"{filename}.svg", bbox_inches="tight")
|
|
38
|
+
fig.savefig(f"{filename}.pdf", bbox_inches="tight")
|
|
39
|
+
fig.savefig(f"{filename}.tiff", dpi=dpi, bbox_inches="tight")
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Use `text.usetex = True` only when LaTeX is installed and math-rich labels are required.
|
|
43
|
+
|
|
44
|
+
## Going deeper
|
|
45
|
+
|
|
46
|
+
- `references/api.md` — Python PALETTE, helper function signatures, validation rules.
|
|
47
|
+
- `references/template-catalog.md` — validated CSV-driven volcano, ROC, dot-plot, marginal, and paired templates backed by `scripts/plot_templates.py`.
|
|
48
|
+
- `references/common-patterns.md` — hero panels, legend-only axes, dark image plates, asymmetric layouts.
|
|
49
|
+
- `references/chart-types.md` — radar, 3D sphere, fill_between, scatter patterns.
|
|
50
|
+
- `references/tutorials.md` — end-to-end walkthroughs for bars, trends, heatmaps.
|
|
51
|
+
- `references/demos.md` — third-party figures4papers demo map, copyright boundary, and original Python reimplementation guidance.
|
|
52
|
+
- `scripts/validate_figure.py` — dependency-free source preflight before rendering and visual QA.
|
|
53
|
+
- `scripts/audit_pdf_text.py` — dependency-free `Tf` scan of exported PDF text runs; use it to enforce the 5 pt glyph floor after rendering.
|
|
54
|
+
- `scripts/audit_panel_alignment.py` — mandatory render-time Matplotlib axes alignment gate for every multi-panel figure; call `require_matplotlib_panel_alignment()` after the final layout draw and before export.
|
|
55
|
+
- `scripts/audit_figure_collisions.py` — mandatory PyMuPDF geometry audit after every generated or layout-affecting revision; fix text-text, text-stroke and clipping FAIL findings before delivery.
|
|
56
|
+
- `scripts/figure_safety.py` — strict monotone interpolation and annotation placement above uncertainty extents.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Backend: R (ggplot2 / patchwork / ComplexHeatmap)
|
|
2
|
+
|
|
3
|
+
**R-only execution rule.** When the user has selected R, do all figure drawing, previewing, exporting, and visual QA in R. Do not call matplotlib/seaborn or any Python graphics device to create a temporary preview, fallback export, or layout approximation. If `Rscript`/R or required R packages are missing, pause rendering, continue independent script or data checks, and report the exact blocker. You may still write the R script, provide install commands (for example `install.packages(...)`), or ask permission to install dependencies, but do not cross-render the figure in Python.
|
|
4
|
+
|
|
5
|
+
## R quick-start
|
|
6
|
+
|
|
7
|
+
```r
|
|
8
|
+
library(ggplot2)
|
|
9
|
+
library(patchwork)
|
|
10
|
+
source("skills/nature-figure/scripts/panel_alignment.R")
|
|
11
|
+
|
|
12
|
+
theme_set(
|
|
13
|
+
theme_classic(base_size = 6.5, base_family = "Arial") +
|
|
14
|
+
theme(
|
|
15
|
+
axis.line = element_line(linewidth = 0.35, colour = "black"),
|
|
16
|
+
axis.ticks = element_line(linewidth = 0.35, colour = "black"),
|
|
17
|
+
legend.title = element_text(size = 6.2),
|
|
18
|
+
legend.text = element_text(size = 5.8),
|
|
19
|
+
strip.text = element_text(size = 6.2, face = "bold"),
|
|
20
|
+
plot.title = element_text(size = 7, face = "bold"),
|
|
21
|
+
panel.grid = element_blank()
|
|
22
|
+
)
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
save_pub_r <- function(plot, filename, width_mm = 183, height_mm = 120, dpi = 600) {
|
|
26
|
+
w <- width_mm / 25.4
|
|
27
|
+
h <- height_mm / 25.4
|
|
28
|
+
if (inherits(plot, "patchwork")) {
|
|
29
|
+
# Run after every layout-affecting change, before export.
|
|
30
|
+
require_patchwork_panel_alignment(
|
|
31
|
+
plot,
|
|
32
|
+
manifest_path = paste0(filename, ".alignment-layout.json"),
|
|
33
|
+
report_path = paste0(filename, ".alignment.json"),
|
|
34
|
+
overlay_svg = paste0(filename, ".alignment.svg"),
|
|
35
|
+
width_in = w,
|
|
36
|
+
height_in = h,
|
|
37
|
+
tolerance_pt = 1.5,
|
|
38
|
+
gutter_tolerance_pt = 1.5,
|
|
39
|
+
strict = TRUE
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
svglite::svglite(paste0(filename, ".svg"), width = w, height = h)
|
|
43
|
+
print(plot)
|
|
44
|
+
dev.off()
|
|
45
|
+
grDevices::cairo_pdf(paste0(filename, ".pdf"), width = w, height = h, family = "Arial")
|
|
46
|
+
print(plot)
|
|
47
|
+
dev.off()
|
|
48
|
+
ragg::agg_tiff(paste0(filename, ".tiff"), width = w, height = h, units = "in", res = dpi)
|
|
49
|
+
print(plot)
|
|
50
|
+
dev.off()
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Going deeper
|
|
55
|
+
|
|
56
|
+
- `references/r-workflow.md` — the R plotting workflow when the user provides R scripts, templates, or data.
|
|
57
|
+
- `references/r-template-index.md` — adapt a user-provided or private R template collection without exposing source paths.
|
|
58
|
+
- `references/design-theory.md` — typography, color theory, layout rationale, export policy (backend-agnostic).
|
|
59
|
+
- `references/nature-2026-observations.md` — real Nature page archetypes to match before choosing layout.
|
|
60
|
+
- `scripts/validate_figure.py` — dependency-free static R source preflight before running R and inspecting the rendered outputs.
|
|
61
|
+
- `scripts/audit_pdf_text.py` — inspect the final R-generated PDF's rendered glyph floor without redrawing it.
|
|
62
|
+
- `scripts/panel_alignment.R` plus `scripts/audit_panel_alignment.py` — mandatory render-time patchwork/gtable alignment gate for every multi-panel figure; declare comparable groups explicitly for asymmetric layouts.
|
|
63
|
+
- `scripts/audit_figure_collisions.py` — mandatory backend-neutral geometry audit after every generated or layout-affecting revision; its optional marked PDF is QA-only and does not replace the R export.
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import importlib.util
|
|
4
|
+
import sys
|
|
5
|
+
import unittest
|
|
6
|
+
import zlib
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
SKILL = Path(__file__).parents[1]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def load_module(name: str, path: Path):
|
|
14
|
+
spec = importlib.util.spec_from_file_location(name, path)
|
|
15
|
+
assert spec and spec.loader
|
|
16
|
+
module = importlib.util.module_from_spec(spec)
|
|
17
|
+
sys.modules[name] = module
|
|
18
|
+
spec.loader.exec_module(module)
|
|
19
|
+
return module
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
VALIDATOR = load_module("nature_figure_validator_test", SKILL / "scripts" / "validate_figure.py")
|
|
23
|
+
PDF_AUDIT = load_module("nature_figure_pdf_audit_test", SKILL / "scripts" / "audit_pdf_text.py")
|
|
24
|
+
FIGURE_SAFETY = load_module("nature_figure_safety_test", SKILL / "scripts" / "figure_safety.py")
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def fake_pdf(stream: bytes, compressed: bool = False) -> bytes:
|
|
28
|
+
payload = zlib.compress(stream) if compressed else stream
|
|
29
|
+
filter_entry = b" /Filter /FlateDecode" if compressed else b""
|
|
30
|
+
return (
|
|
31
|
+
b"%PDF-1.4\n1 0 obj\n<< /Length "
|
|
32
|
+
+ str(len(payload)).encode("ascii")
|
|
33
|
+
+ filter_entry
|
|
34
|
+
+ b" >>\nstream\n"
|
|
35
|
+
+ payload
|
|
36
|
+
+ b"\nendstream\nendobj\n%%EOF\n"
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class PdfTextAuditTests(unittest.TestCase):
|
|
41
|
+
def test_plain_pdf_passes_when_all_tf_sizes_meet_floor(self):
|
|
42
|
+
result = PDF_AUDIT.audit_pdf(fake_pdf(b"BT /F1 7 Tf (Label) Tj ET"))
|
|
43
|
+
self.assertTrue(result["auditable"])
|
|
44
|
+
self.assertEqual(result["minimum_found_pt"], 7.0)
|
|
45
|
+
self.assertEqual(result["below_minimum_count"], 0)
|
|
46
|
+
|
|
47
|
+
def test_flate_pdf_catches_mathtext_sized_run(self):
|
|
48
|
+
result = PDF_AUDIT.audit_pdf(
|
|
49
|
+
fake_pdf(b"BT /F1 7 Tf (R) Tj /F2 4.9 Tf (2) Tj ET", compressed=True)
|
|
50
|
+
)
|
|
51
|
+
self.assertTrue(result["auditable"])
|
|
52
|
+
self.assertEqual(result["minimum_found_pt"], 4.9)
|
|
53
|
+
self.assertEqual(result["below_minimum_count"], 1)
|
|
54
|
+
self.assertEqual(result["below_minimum"][0]["font"], "F2")
|
|
55
|
+
|
|
56
|
+
def test_pdf_without_supported_tf_is_not_auditable(self):
|
|
57
|
+
result = PDF_AUDIT.audit_pdf(fake_pdf(b"0 0 m 10 10 l S"))
|
|
58
|
+
self.assertFalse(result["auditable"])
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
class SourceSafetyTests(unittest.TestCase):
|
|
62
|
+
def findings(self, source: str):
|
|
63
|
+
return {row.check_id: row for row in VALIDATOR.validate_source(source, "python")}
|
|
64
|
+
|
|
65
|
+
def test_risky_patterns_are_reported(self):
|
|
66
|
+
source = '''
|
|
67
|
+
import numpy as np
|
|
68
|
+
seed_scores = np.median(scores, axis=0)
|
|
69
|
+
n_equiv = np.interp(target, decreasing_error, n_samples)
|
|
70
|
+
ax.plot(x, seed_scores, label="+ semantic guidance")
|
|
71
|
+
ax.text(0.5, 0.5, "$R^2$", fontsize=7, rotation=45,
|
|
72
|
+
bbox=dict(facecolor="white", edgecolor="none"))
|
|
73
|
+
LABEL_Y = 96.4
|
|
74
|
+
'''
|
|
75
|
+
rows = self.findings(source)
|
|
76
|
+
for check_id in (
|
|
77
|
+
"FONT-GLYPH-FLOOR",
|
|
78
|
+
"LEGEND-LABEL-CASE",
|
|
79
|
+
"INTERP-MONOTONIC",
|
|
80
|
+
"UNCERTAINTY-ENCODING",
|
|
81
|
+
"ROTATION-ANCHOR",
|
|
82
|
+
"ANNOTATION-WORKAROUND",
|
|
83
|
+
):
|
|
84
|
+
self.assertEqual(rows[check_id].level, "WARN", check_id)
|
|
85
|
+
|
|
86
|
+
def test_guarded_patterns_pass_targeted_checks(self):
|
|
87
|
+
source = '''
|
|
88
|
+
import numpy as np
|
|
89
|
+
def interp_monotone(target, xp, fp):
|
|
90
|
+
order = np.argsort(xp)
|
|
91
|
+
xp = xp[order]
|
|
92
|
+
fp = fp[order]
|
|
93
|
+
assert np.all(np.diff(xp) > 0)
|
|
94
|
+
return np.interp(target, xp, fp)
|
|
95
|
+
|
|
96
|
+
seed_scores = np.median(scores, axis=0)
|
|
97
|
+
ax.plot(x, seed_scores, label="+ Semantic guidance")
|
|
98
|
+
ax.fill_between(x, seed_scores - seed_std, seed_scores + seed_std)
|
|
99
|
+
ax.text(0.5, 0.5, "R²", fontsize=7, rotation=45, rotation_mode="anchor")
|
|
100
|
+
'''
|
|
101
|
+
rows = self.findings(source)
|
|
102
|
+
for check_id in (
|
|
103
|
+
"FONT-GLYPH-FLOOR",
|
|
104
|
+
"LEGEND-LABEL-CASE",
|
|
105
|
+
"INTERP-MONOTONIC",
|
|
106
|
+
"UNCERTAINTY-ENCODING",
|
|
107
|
+
"ROTATION-ANCHOR",
|
|
108
|
+
"ANNOTATION-WORKAROUND",
|
|
109
|
+
):
|
|
110
|
+
self.assertEqual(rows[check_id].level, "PASS", check_id)
|
|
111
|
+
|
|
112
|
+
def test_string_split_is_not_mistaken_for_random_split(self):
|
|
113
|
+
source = '''
|
|
114
|
+
columns = [value.strip() for value in args.columns.split(",")]
|
|
115
|
+
ax.set_ylabel("Mean fold change")
|
|
116
|
+
'''
|
|
117
|
+
rows = self.findings(source)
|
|
118
|
+
self.assertEqual(rows["UNCERTAINTY-ENCODING"].level, "PASS")
|
|
119
|
+
|
|
120
|
+
def test_every_rotated_call_must_be_anchored(self):
|
|
121
|
+
source = '''
|
|
122
|
+
ax.text(0.2, 0.3, "A", rotation=45, rotation_mode="anchor")
|
|
123
|
+
ax.text(0.5, 0.6, "B", rotation=90)
|
|
124
|
+
'''
|
|
125
|
+
rows = self.findings(source)
|
|
126
|
+
self.assertEqual(rows["ROTATION-ANCHOR"].level, "WARN")
|
|
127
|
+
self.assertEqual(rows["ROTATION-ANCHOR"].evidence, ["line 3: rotation=..."])
|
|
128
|
+
|
|
129
|
+
def test_python_multipanel_source_requires_alignment_gate(self):
|
|
130
|
+
missing = self.findings("fig, axes = plt.subplots(2, 2)")
|
|
131
|
+
self.assertEqual(missing["PANEL-ALIGNMENT-GATE"].level, "FAIL")
|
|
132
|
+
|
|
133
|
+
import_only = self.findings(
|
|
134
|
+
"from audit_panel_alignment import require_matplotlib_panel_alignment\n"
|
|
135
|
+
"fig, axes = plt.subplots(2, 2)"
|
|
136
|
+
)
|
|
137
|
+
self.assertEqual(import_only["PANEL-ALIGNMENT-GATE"].level, "FAIL")
|
|
138
|
+
|
|
139
|
+
manual_axes = self.findings(
|
|
140
|
+
"fig = plt.figure()\n"
|
|
141
|
+
"ax_a = fig.add_axes([0.1, 0.1, 0.3, 0.8])\n"
|
|
142
|
+
"ax_b = fig.add_axes([0.6, 0.1, 0.3, 0.8])"
|
|
143
|
+
)
|
|
144
|
+
self.assertEqual(manual_axes["PANEL-ALIGNMENT-GATE"].level, "FAIL")
|
|
145
|
+
|
|
146
|
+
mosaic = self.findings("fig, axes = plt.subplot_mosaic([['a', 'b']])")
|
|
147
|
+
self.assertEqual(mosaic["PANEL-ALIGNMENT-GATE"].level, "FAIL")
|
|
148
|
+
|
|
149
|
+
wired = self.findings(
|
|
150
|
+
'''
|
|
151
|
+
fig, axes = plt.subplots(2, 2)
|
|
152
|
+
require_matplotlib_panel_alignment(fig, strict=True)
|
|
153
|
+
'''
|
|
154
|
+
)
|
|
155
|
+
self.assertEqual(wired["PANEL-ALIGNMENT-GATE"].level, "PASS")
|
|
156
|
+
|
|
157
|
+
def test_r_patchwork_source_requires_alignment_gate(self):
|
|
158
|
+
missing = {
|
|
159
|
+
row.check_id: row
|
|
160
|
+
for row in VALIDATOR.validate_source(
|
|
161
|
+
"fig <- (p_a | p_b) + plot_layout(guides = 'collect')",
|
|
162
|
+
"r",
|
|
163
|
+
)
|
|
164
|
+
}
|
|
165
|
+
self.assertEqual(missing["PANEL-ALIGNMENT-GATE"].level, "FAIL")
|
|
166
|
+
|
|
167
|
+
manifest_only = {
|
|
168
|
+
row.check_id: row
|
|
169
|
+
for row in VALIDATOR.validate_source(
|
|
170
|
+
"fig <- p_a | p_b\nwrite_patchwork_panel_layout(fig, manifest_path='a.json')",
|
|
171
|
+
"r",
|
|
172
|
+
)
|
|
173
|
+
}
|
|
174
|
+
self.assertEqual(manifest_only["PANEL-ALIGNMENT-GATE"].level, "FAIL")
|
|
175
|
+
|
|
176
|
+
wired = {
|
|
177
|
+
row.check_id: row
|
|
178
|
+
for row in VALIDATOR.validate_source(
|
|
179
|
+
"fig <- p_a | p_b\nrequire_patchwork_panel_alignment(fig, manifest_path='a.json')",
|
|
180
|
+
"r",
|
|
181
|
+
)
|
|
182
|
+
}
|
|
183
|
+
self.assertEqual(wired["PANEL-ALIGNMENT-GATE"].level, "PASS")
|
|
184
|
+
|
|
185
|
+
def test_r_delimiter_check_ignores_comments(self):
|
|
186
|
+
finding = VALIDATOR.check_syntax(
|
|
187
|
+
"# patchwork's final panel cells { are measured\nfig <- (p_a | p_b)",
|
|
188
|
+
"r",
|
|
189
|
+
)
|
|
190
|
+
self.assertEqual(finding.level, "WARN")
|
|
191
|
+
self.assertIn("delimiter check passed", finding.message)
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
class NumericalSafetyTests(unittest.TestCase):
|
|
195
|
+
def test_interp_monotone_handles_decreasing_grid(self):
|
|
196
|
+
result = FIGURE_SAFETY.interp_monotone(7, [10, 8, 6], [5, 10, 15])
|
|
197
|
+
self.assertAlmostEqual(float(result), 12.5)
|
|
198
|
+
|
|
199
|
+
def test_interp_monotone_rejects_direction_changes(self):
|
|
200
|
+
with self.assertRaisesRegex(ValueError, "strictly monotone"):
|
|
201
|
+
FIGURE_SAFETY.interp_monotone(7, [10, 6, 8], [5, 10, 15])
|
|
202
|
+
|
|
203
|
+
def test_label_position_clears_uncertainty(self):
|
|
204
|
+
label_y = FIGURE_SAFETY.label_y_above([80, 90], spread=[2, 6])
|
|
205
|
+
self.assertGreater(label_y, 96)
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
if __name__ == "__main__":
|
|
209
|
+
unittest.main()
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# `nature-polishing` 技能
|
|
2
|
+
|
|
3
|
+
[English](README_EN.md)
|
|
4
|
+
|
|
5
|
+
`nature-polishing` 用于把学术手稿文本润色、重构或翻译成更接近 Nature 风格的简洁英文,同时保持作者原意、证据边界和引用意图。
|
|
6
|
+
|
|
7
|
+
## 适合用它做什么
|
|
8
|
+
|
|
9
|
+
- 将中文学术段落翻译为投稿可用英文。
|
|
10
|
+
- 精简冗长句子,增强论证顺序和段落推进。
|
|
11
|
+
- 按 Nature / Nature Communications / Nature Machine Intelligence 论文范式调整摘要、引言、结果、讨论或标题。
|
|
12
|
+
- 对 NMI 识别独立路由,检查 3,500 词正文、150 词摘要、6 个 display、代码审查与会议论文实质扩展,不再误用旗舰 Nature 数字。
|
|
13
|
+
- 对旗舰 Nature、Nature Communications、NMI 及其他 Nature Portfolio 期刊的 Results–Discussion,保留 claim 递进、证据绑定的局部解释和跨结果综合,区分必要回顾与重复论证。
|
|
14
|
+
- 对任何期刊的 Discussion,检查从具体发现到有边界意义的反向漏斗、四类功能是否完整、情态动词是否匹配证据强度,以及局限和未来工作是否指向明确的 claim 与未决问题。
|
|
15
|
+
- 对所有 Nature / Nature Portfolio 目标的 Introduction,执行快速问题漏斗、精确 gap、文献张力、问题先行的 novelty 与 Introduction–Results 对齐检查。
|
|
16
|
+
- 对所有 Nature / Nature Portfolio 目标的 Abstract,保留一个主发现、1–2 个决定性支撑或边界,只在数字定义或实质支撑核心 claim 时保留,并用有边界的意义句收尾。这三组默认最初来自 NMI 语料归纳,其中 Results–Discussion 又经旗舰 Nature 论文对照加强;它们均非官方规则。
|
|
17
|
+
- 区分 research paper 与 methods paper 的写作重点。
|
|
18
|
+
- 检查 AI 味、夸张声称、过度因果表达和不自然搭配。
|
|
19
|
+
- 对全文或多轮修改稿执行一致性扫描,定位术语、单位、数值精度和内部声称漂移。
|
|
20
|
+
- 对 Results 执行主文必要性审计:区分核心发现、必要支撑与稳健性/异质性/替代推断,分配到主文、图注或 SI;每次新增文字都触发删除或替换检查。
|
|
21
|
+
|
|
22
|
+
## 方法来源
|
|
23
|
+
|
|
24
|
+
- 写作策略:学术写作课程笔记中的沙漏结构、读者工作流和章节职责。
|
|
25
|
+
- 发表论文模式:精选 Nature 与 Nature Communications 文章的 section moves。
|
|
26
|
+
- 短语支持:Academic Phrasebank 中适合学术论文的表达族。
|
|
27
|
+
|
|
28
|
+
## 典型请求
|
|
29
|
+
|
|
30
|
+
- “把这段中文结果翻译成 Nature 风格英文,保持克制。”
|
|
31
|
+
- “润色 abstract,不要改变事实和引用意图。”
|
|
32
|
+
- “这段 introduction 太像 AI 写的,帮我重构逻辑和语言。”
|
|
33
|
+
|
|
34
|
+
## 你需要提供
|
|
35
|
+
|
|
36
|
+
- 原文、目标章节、论文类型和希望保留的术语。
|
|
37
|
+
- 不能改变的事实、数据、引用和专有表达。
|
|
38
|
+
- 期望输出:只给改写版,还是给修改说明和风险标记。
|
|
39
|
+
|
|
40
|
+
## 产出
|
|
41
|
+
|
|
42
|
+
- 可粘贴的英文改写或中英对照版本。
|
|
43
|
+
- 关键修改说明:逻辑重排、语气收敛、术语统一和声称边界。
|
|
44
|
+
- 全文一致性风险清单;机械扫描结果逐条回到上下文确认后再修改。
|
|
45
|
+
- 主文压缩任务可附结果分配表、删除记录、统计位置记录和 claim repetition map。
|
|
46
|
+
- 需要作者确认的事实或引用意图。
|
|
47
|
+
|
|
48
|
+
## 边界
|
|
49
|
+
|
|
50
|
+
- 不会替作者新增结果、机制、统计意义或未给出的引用。
|
|
51
|
+
- 不会为了更像 Nature 而夸大 novelty、causality 或 generality。
|
|
52
|
+
- 如果需要从零搭建论文章节,优先使用 `nature-writing`。
|
|
53
|
+
|
|
54
|
+
## 相关技能
|
|
55
|
+
|
|
56
|
+
- `nature-writing`:章节级起草和论证重建。
|
|
57
|
+
- `nature-response`:返修回复信和 cover letter 语言。
|
|
58
|
+
- `nature-statistics`:统计文本、图注和审稿统计回复。
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# `nature-polishing` Skill
|
|
2
|
+
|
|
3
|
+
[中文说明](README.md)
|
|
4
|
+
|
|
5
|
+
`nature-polishing` polishes, restructures, or translates academic manuscript text into concise Nature-leaning English while preserving author meaning, evidence boundaries, and citation intent.
|
|
6
|
+
|
|
7
|
+
## What To Use It For
|
|
8
|
+
|
|
9
|
+
- Translate Chinese academic paragraphs into submission-ready English.
|
|
10
|
+
- Shorten long sentences and improve argument order and paragraph movement.
|
|
11
|
+
- Adjust abstracts, introductions, results, discussions, or titles using Nature / Nature Communications / Nature Machine Intelligence article patterns.
|
|
12
|
+
- Route NMI separately to check its 3,500-word main text, 150-word abstract, six-display budget, code-review duties, and substantial conference-paper extension without importing flagship Nature numbers.
|
|
13
|
+
- For flagship Nature, Nature Communications, NMI, and other Nature Portfolio titles, preserve claim escalation, evidence-bound local interpretation, and cross-Results synthesis, distinguishing a necessary recap from redundant re-demonstration.
|
|
14
|
+
- For any journal's Discussion, audit the movement from specific findings to bounded implications, coverage of the core rhetorical functions, modality against evidence strength, and whether limitations and future work resolve explicit claim boundaries and open questions.
|
|
15
|
+
- For every Nature / Nature Portfolio target, apply a fast problem funnel, exact gap, literature tension, question-first novelty, and Introduction–Results alignment.
|
|
16
|
+
- For every Nature / Nature Portfolio target, keep one main discovery, one or two decisive supports or boundaries, only necessary core numbers, and a bounded payoff in the abstract. These three defaults were initially distilled from published NMI papers, with the Results–Discussion guidance further reinforced by flagship Nature comparisons, and generalized as Nature-style guidance; they are not official policy.
|
|
17
|
+
- Distinguish research-paper and methods-paper writing priorities.
|
|
18
|
+
- Check AI-like phrasing, exaggerated claims, excessive causal language, and unnatural collocations.
|
|
19
|
+
- Sweep full or repeatedly revised manuscripts for terminology, unit, numeric-precision, and internal-claim drift.
|
|
20
|
+
- Audit Results for main-text necessity: separate core discovery and necessary support from robustness, heterogeneity, and alternative inference; allocate material across main text, captions, and SI; and make every addition trigger a deletion or replacement check.
|
|
21
|
+
|
|
22
|
+
## Method Sources
|
|
23
|
+
|
|
24
|
+
- Writing strategy: hourglass structure, reader workflow, and section roles from academic-writing course notes.
|
|
25
|
+
- Published article patterns: section moves from selected Nature and Nature Communications papers.
|
|
26
|
+
- Phrase support: expression families from Academic Phrasebank.
|
|
27
|
+
|
|
28
|
+
## Typical Requests
|
|
29
|
+
|
|
30
|
+
- "Translate this Chinese Results paragraph into Nature-style English, keeping it conservative."
|
|
31
|
+
- "Polish this abstract without changing facts or citation intent."
|
|
32
|
+
- "This introduction sounds too AI-written; rebuild its logic and language."
|
|
33
|
+
|
|
34
|
+
## What You Need To Provide
|
|
35
|
+
|
|
36
|
+
- Source text, target section, paper type, and terms that must be preserved.
|
|
37
|
+
- Facts, data, citations, and specialized expressions that must not change.
|
|
38
|
+
- Desired output: rewritten text only, or rewritten text with change notes and risk flags.
|
|
39
|
+
|
|
40
|
+
## Outputs
|
|
41
|
+
|
|
42
|
+
- Ready-to-paste English rewrite or Chinese-English paired version.
|
|
43
|
+
- Key change notes: logic reordering, tone tightening, terminology alignment, and claim boundaries.
|
|
44
|
+
- A manuscript-wide consistency risk list, with mechanical warnings inspected in context before revision.
|
|
45
|
+
- For main-text compression, an optional result-allocation table, deletion record, statistics-location record, and claim-repetition map.
|
|
46
|
+
- Facts or citation intent that require author confirmation.
|
|
47
|
+
|
|
48
|
+
## Boundaries
|
|
49
|
+
|
|
50
|
+
- The skill does not add results, mechanisms, statistical significance, or citations not provided by the author.
|
|
51
|
+
- It does not exaggerate novelty, causality, or generality to sound more like Nature.
|
|
52
|
+
- For building a manuscript section from scratch, use `nature-writing` first.
|
|
53
|
+
|
|
54
|
+
## Related Skills
|
|
55
|
+
|
|
56
|
+
- `nature-writing`: section-level drafting and argument rebuilding.
|
|
57
|
+
- `nature-response`: reviewer response and cover-letter language.
|
|
58
|
+
- `nature-statistics`: statistical text, figure legends, and statistical reviewer responses.
|