psyclaw 0.28.1 → 0.28.3

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.
Files changed (135) hide show
  1. package/README.md +5 -5
  2. package/agents/recommended/catalog.json +1 -1
  3. package/dist/src/adapters/pi/extension.js +79 -25
  4. package/dist/src/adapters/pi/extension.js.map +1 -1
  5. package/dist/src/ars/keybindings.d.ts +13 -0
  6. package/dist/src/ars/keybindings.js +50 -0
  7. package/dist/src/ars/keybindings.js.map +1 -0
  8. package/dist/src/ars/mode-editor.d.ts +25 -0
  9. package/dist/src/ars/mode-editor.js +78 -0
  10. package/dist/src/ars/mode-editor.js.map +1 -0
  11. package/dist/src/ars/profile.d.ts +4 -1
  12. package/dist/src/ars/profile.js +23 -6
  13. package/dist/src/ars/profile.js.map +1 -1
  14. package/dist/src/chat.js +3 -0
  15. package/dist/src/chat.js.map +1 -1
  16. package/dist/src/panel/server.js +1 -1
  17. package/dist/src/panel/server.js.map +1 -1
  18. package/package.json +10 -3
  19. package/vendor/academic-paper-skills/LICENSE +21 -0
  20. package/vendor/academic-paper-skills/NOTICE.md +7 -0
  21. package/vendor/academic-paper-skills/PSYCLAW_SOURCE.json +14 -0
  22. package/vendor/academic-paper-skills/academic-paper-composer/SKILL.md +840 -0
  23. package/vendor/academic-paper-skills/academic-paper-composer/references/section_guides.md +675 -0
  24. package/vendor/academic-paper-skills/academic-paper-composer/references/writing_standards.md +629 -0
  25. package/vendor/academic-paper-skills/academic-paper-composer/scripts/chapter_quality_check.py +470 -0
  26. package/vendor/academic-paper-skills/academic-paper-composer/scripts/final_evaluation.py +550 -0
  27. package/vendor/academic-paper-skills/academic-paper-strategist/SKILL.md +670 -0
  28. package/vendor/academic-paper-skills/academic-paper-strategist/references/quality_standards.md +336 -0
  29. package/vendor/academic-paper-skills/academic-paper-strategist/references/search_strategy.md +459 -0
  30. package/vendor/academic-paper-skills/academic-paper-strategist/scripts/evaluate_samples.py +300 -0
  31. package/vendor/academic-paper-skills/academic-paper-strategist/scripts/gap_analysis.py +399 -0
  32. package/vendor/ars/pi/wrapper.js +9 -0
  33. package/vendor/nature-skills/LICENSE +201 -0
  34. package/vendor/nature-skills/NOTICE.md +7 -0
  35. package/vendor/nature-skills/PSYCLAW_SOURCE.json +19 -0
  36. package/vendor/nature-skills/skills/nature-figure/README.md +107 -0
  37. package/vendor/nature-skills/skills/nature-figure/README_EN.md +107 -0
  38. package/vendor/nature-skills/skills/nature-figure/SKILL.md +154 -0
  39. package/vendor/nature-skills/skills/nature-figure/agents/openai.yaml +4 -0
  40. package/vendor/nature-skills/skills/nature-figure/evals/evals.json +325 -0
  41. package/vendor/nature-skills/skills/nature-figure/manifest.yaml +103 -0
  42. package/vendor/nature-skills/skills/nature-figure/references/ai-graphical-abstract-workflow.md +129 -0
  43. package/vendor/nature-skills/skills/nature-figure/references/api.md +576 -0
  44. package/vendor/nature-skills/skills/nature-figure/references/asset-adaptation.md +72 -0
  45. package/vendor/nature-skills/skills/nature-figure/references/backend-selection.md +118 -0
  46. package/vendor/nature-skills/skills/nature-figure/references/chart-types.md +348 -0
  47. package/vendor/nature-skills/skills/nature-figure/references/common-patterns.md +371 -0
  48. package/vendor/nature-skills/skills/nature-figure/references/demos.md +58 -0
  49. package/vendor/nature-skills/skills/nature-figure/references/design-theory.md +467 -0
  50. package/vendor/nature-skills/skills/nature-figure/references/figure-contract.md +122 -0
  51. package/vendor/nature-skills/skills/nature-figure/references/figure-legend-conventions.md +90 -0
  52. package/vendor/nature-skills/skills/nature-figure/references/multipanel-evidence-architecture.md +268 -0
  53. package/vendor/nature-skills/skills/nature-figure/references/nature-2026-observations.md +124 -0
  54. package/vendor/nature-skills/skills/nature-figure/references/nature-article-requirements.md +149 -0
  55. package/vendor/nature-skills/skills/nature-figure/references/openrouter-image-generation.md +141 -0
  56. package/vendor/nature-skills/skills/nature-figure/references/qa-contract.md +344 -0
  57. package/vendor/nature-skills/skills/nature-figure/references/r-template-index.md +66 -0
  58. package/vendor/nature-skills/skills/nature-figure/references/r-workflow.md +234 -0
  59. package/vendor/nature-skills/skills/nature-figure/references/template-catalog.md +33 -0
  60. package/vendor/nature-skills/skills/nature-figure/references/tutorials.md +260 -0
  61. package/vendor/nature-skills/skills/nature-figure/requirements.txt +1 -0
  62. package/vendor/nature-skills/skills/nature-figure/scripts/audit_figure_collisions.py +742 -0
  63. package/vendor/nature-skills/skills/nature-figure/scripts/audit_panel_alignment.py +933 -0
  64. package/vendor/nature-skills/skills/nature-figure/scripts/audit_pdf_text.py +152 -0
  65. package/vendor/nature-skills/skills/nature-figure/scripts/figure_safety.py +50 -0
  66. package/vendor/nature-skills/skills/nature-figure/scripts/generate_openrouter_schematic.py +260 -0
  67. package/vendor/nature-skills/skills/nature-figure/scripts/nature_figure_backend.py +93 -0
  68. package/vendor/nature-skills/skills/nature-figure/scripts/panel_alignment.R +188 -0
  69. package/vendor/nature-skills/skills/nature-figure/scripts/plot_templates.py +604 -0
  70. package/vendor/nature-skills/skills/nature-figure/scripts/validate_figure.py +835 -0
  71. package/vendor/nature-skills/skills/nature-figure/static/core/contract.md +55 -0
  72. package/vendor/nature-skills/skills/nature-figure/static/core/stance.md +41 -0
  73. package/vendor/nature-skills/skills/nature-figure/static/fragments/backend/python.md +56 -0
  74. package/vendor/nature-skills/skills/nature-figure/static/fragments/backend/r.md +63 -0
  75. package/vendor/nature-skills/skills/nature-figure/tests/test_figure_safety.py +209 -0
  76. package/vendor/nature-skills/skills/nature-polishing/README.md +58 -0
  77. package/vendor/nature-skills/skills/nature-polishing/README_EN.md +58 -0
  78. package/vendor/nature-skills/skills/nature-polishing/SKILL.md +111 -0
  79. package/vendor/nature-skills/skills/nature-polishing/agents/openai.yaml +4 -0
  80. package/vendor/nature-skills/skills/nature-polishing/manifest.yaml +101 -0
  81. package/vendor/nature-skills/skills/nature-polishing/references/latex-layout.md +211 -0
  82. package/vendor/nature-skills/skills/nature-polishing/references/nat-comms-2025-diction.md +73 -0
  83. package/vendor/nature-skills/skills/nature-polishing/references/phrasebank-playbook.md +175 -0
  84. package/vendor/nature-skills/skills/nature-polishing/references/published-article-patterns.md +126 -0
  85. package/vendor/nature-skills/skills/nature-polishing/references/section-moves.md +252 -0
  86. package/vendor/nature-skills/skills/nature-polishing/references/style-guardrails.md +94 -0
  87. package/vendor/nature-skills/skills/nature-polishing/references/writing-strategy.md +160 -0
  88. package/vendor/nature-skills/skills/nature-polishing/static/core/failure-modes.md +29 -0
  89. package/vendor/nature-skills/skills/nature-polishing/static/core/output-format.md +21 -0
  90. package/vendor/nature-skills/skills/nature-polishing/static/core/stance.md +26 -0
  91. package/vendor/nature-skills/skills/nature-polishing/static/fragments/journal/generic.md +17 -0
  92. package/vendor/nature-skills/skills/nature-polishing/static/fragments/journal/nat-comms.md +38 -0
  93. package/vendor/nature-skills/skills/nature-polishing/static/fragments/journal/nat-mach-intell.md +102 -0
  94. package/vendor/nature-skills/skills/nature-polishing/static/fragments/journal/nature.md +19 -0
  95. package/vendor/nature-skills/skills/nature-polishing/static/fragments/language/en.md +19 -0
  96. package/vendor/nature-skills/skills/nature-polishing/static/fragments/language/zh-to-en.md +19 -0
  97. package/vendor/nature-skills/skills/nature-polishing/static/fragments/paper_type/algorithmic.md +18 -0
  98. package/vendor/nature-skills/skills/nature-polishing/static/fragments/paper_type/hypothesis.md +17 -0
  99. package/vendor/nature-skills/skills/nature-polishing/static/fragments/paper_type/methods.md +35 -0
  100. package/vendor/nature-skills/skills/nature-polishing/static/fragments/paper_type/research.md +29 -0
  101. package/vendor/nature-skills/skills/nature-polishing/static/fragments/paper_type/review.md +17 -0
  102. package/vendor/nature-skills/skills/nature-polishing/static/fragments/section/abstract.md +26 -0
  103. package/vendor/nature-skills/skills/nature-polishing/static/fragments/section/conclusion.md +15 -0
  104. package/vendor/nature-skills/skills/nature-polishing/static/fragments/section/discussion.md +48 -0
  105. package/vendor/nature-skills/skills/nature-polishing/static/fragments/section/intro.md +33 -0
  106. package/vendor/nature-skills/skills/nature-polishing/static/fragments/section/methods.md +26 -0
  107. package/vendor/nature-skills/skills/nature-polishing/static/fragments/section/results.md +61 -0
  108. package/vendor/nature-skills/skills/nature-polishing/static/fragments/section/title.md +17 -0
  109. package/vendor/nature-skills/skills/nature-ref-verifier/README.md +44 -0
  110. package/vendor/nature-skills/skills/nature-ref-verifier/README_EN.md +44 -0
  111. package/vendor/nature-skills/skills/nature-ref-verifier/SKILL.md +196 -0
  112. package/vendor/nature-skills/skills/nature-ref-verifier/agents/openai.yaml +4 -0
  113. package/vendor/nature-skills/skills/nature-ref-verifier/manifest.yaml +19 -0
  114. package/vendor/nature-skills/skills/nature-ref-verifier/references/common-patterns.md +96 -0
  115. package/vendor/nature-skills/skills/nature-shared/README.md +43 -0
  116. package/vendor/nature-skills/skills/nature-shared/README_EN.md +43 -0
  117. package/vendor/nature-skills/skills/nature-shared/SKILL.md +33 -0
  118. package/vendor/nature-skills/skills/nature-shared/agents/openai.yaml +6 -0
  119. package/vendor/nature-skills/skills/nature-shared/core/consistency-sweep.md +122 -0
  120. package/vendor/nature-skills/skills/nature-shared/core/discussion-argument-language.md +192 -0
  121. package/vendor/nature-skills/skills/nature-shared/core/ethics.md +88 -0
  122. package/vendor/nature-skills/skills/nature-shared/core/main-text-discipline.md +179 -0
  123. package/vendor/nature-skills/skills/nature-shared/core/nature-abstract.md +171 -0
  124. package/vendor/nature-skills/skills/nature-shared/core/nature-introduction.md +164 -0
  125. package/vendor/nature-skills/skills/nature-shared/core/nature-results-discussion.md +215 -0
  126. package/vendor/nature-skills/skills/nature-shared/core/paper-type-taxonomy.md +41 -0
  127. package/vendor/nature-skills/skills/nature-shared/core/reader-workflow.md +21 -0
  128. package/vendor/nature-skills/skills/nature-shared/core/research-compliance.md +192 -0
  129. package/vendor/nature-skills/skills/nature-shared/core/terminology-ledger.md +58 -0
  130. package/vendor/nature-skills/skills/nature-shared/journal-formats/nat-comms.md +139 -0
  131. package/vendor/nature-skills/skills/nature-shared/journal-formats/nature-machine-intelligence.md +431 -0
  132. package/vendor/nature-skills/skills/nature-shared/journal-formats/nature.md +313 -0
  133. package/vendor/nature-skills/skills/nature-shared/manifest.yaml +52 -0
  134. package/vendor/nature-skills/skills/nature-shared/scripts/check_consistency.py +273 -0
  135. package/vendor/nature-skills/skills/nature-shared/tests/test_check_consistency.py +63 -0
@@ -0,0 +1,111 @@
1
+ ---
2
+ name: nature-polishing
3
+ description: Polish, restructure, or translate academic prose into concise Nature-leaning English while preserving facts, evidence boundaries, terminology, and citation intent. Use for manuscript paragraphs, abstracts, introductions, Results, discussions, conclusions, titles, Methods, Chinese drafts, proofreading, language editing, and general academic or scientific writing. Also use to shorten bloated Results, allocate evidence across main text, captions, and Supplementary Information, prevent reviewer-driven revision accretion, reduce repeated statistics or claims, and apply paragraph-necessity checks. Covers LaTeX layout or typesetting fixes such as sparse pages, stranded headings, oversized or split figures, float errors, multi-panel arrangement, and sparse Supplementary Information via references/latex-layout.md. Trigger on 学术写作、科研写作、论文润色、SCI写作、英文论文润色、语言润色、润色、改写、学术英语、排版.
4
+ ---
5
+
6
+ # Nature-Style Academic Polishing — Router
7
+
8
+ This skill is split into two layers:
9
+
10
+ - A **static layer** under `static/` that holds versioned, reusable content fragments (core principles, paper-type playbooks, per-section guidance, language-specific rules, per-journal style).
11
+ - A **dynamic layer** (this file plus `manifest.yaml`) that detects the request's axes and loads only the fragments needed for the current job.
12
+
13
+ Do not try to apply the polishing logic from memory or from this router. Always load fragments from disk as described below.
14
+
15
+ ## Routing protocol
16
+
17
+ Follow these five steps every time the skill is invoked.
18
+
19
+ ### 1. Load the manifest and the core layer
20
+
21
+ Read [manifest.yaml](manifest.yaml). It declares the axes (`paper_type`, `section`, `language`, `journal`), the allowed values, and the file paths each value maps to.
22
+
23
+ Also read every file listed under `always_load`. These hold the default stance, failure-mode diagnosis, ethics, and output format that apply to every polish job.
24
+
25
+ ### 2. Detect the axis values for this request
26
+
27
+ For each axis in the manifest, decide the value using the manifest's `detect:` hint and the user's input:
28
+
29
+ - `paper_type` — research / methods / hypothesis / algorithmic / review. Default: research.
30
+ - `section` — abstract / intro / results / discussion / conclusion / title / methods. May be multiple. Ask the user if it is ambiguous and matters for the polish.
31
+ - `language` — en or zh-to-en. Detect from the draft itself.
32
+ - `journal` — nature / nat-comms / nat-mach-intell / generic. Default:
33
+ generic. Use `nature` only for flagship Nature, `nat-comms` for Nature
34
+ Communications and `nat-mach-intell` for Nature Machine Intelligence (NMI).
35
+ Do not route another Nature Portfolio title through flagship Nature rules.
36
+
37
+ State the detected axis values in one short line to the user before proceeding, so they can correct you cheaply. This is a progress update, not an approval gate; continue unless a necessary decision remains unresolved.
38
+
39
+ ### 3. Load the matching fragments
40
+
41
+ For each axis value, Read the file mapped in the manifest. Skip the `section` axis only if the user has supplied free-floating prose with no section context.
42
+
43
+ Do **not** read every fragment in `static/`. Load only what step 2 selected.
44
+
45
+ ### 4. Polish using the loaded material
46
+
47
+ Apply the loaded fragments in this priority order, matching the `paper type -> section job -> paragraph logic -> claim/evidence/boundary -> sentence polish` rule from `core/failure-modes.md`:
48
+
49
+ 1. Paper-type playbook (architecture, writing order).
50
+ 2. Section-specific job and failure modes.
51
+ 3. Journal-specific framing and constraints.
52
+ 4. Language-specific sentence and paragraph rules (apply last).
53
+ 5. Core stance and ethics throughout.
54
+
55
+ If a paragraph's structural problem cannot be fixed without inventing content, flag it instead of papering over it.
56
+
57
+ For Results, full-main-text compression, main-versus-SI allocation, or prose
58
+ added during revision, load `../nature-shared/core/main-text-discipline.md`
59
+ before sentence polishing. Classify each result, retain the shortest sufficient
60
+ evidence chain, and require every addition to trigger a deletion or replacement
61
+ check across the affected paragraph.
62
+
63
+ For flagship Nature, Nature Communications, Nature Machine Intelligence, or
64
+ another Nature Portfolio title, load the matching shared Nature-style corpus
65
+ guidance:
66
+
67
+ - Results or Discussion →
68
+ `../nature-shared/core/nature-results-discussion.md`
69
+ - Introduction or whole-manuscript narrative →
70
+ `../nature-shared/core/nature-introduction.md`
71
+ - Abstract → `../nature-shared/core/nature-abstract.md`
72
+
73
+ Preserve claim escalation, the fast question funnel, Introduction–Results
74
+ alignment, discovery-centred abstract compression, evidence-bound local
75
+ interpretation, and cross-Results synthesis. These defaults were initially
76
+ distilled from published NMI papers; treat them as corpus-derived guidance, not
77
+ official policy, and obey the target journal's current rules when they differ.
78
+
79
+ For any Discussion polish or restructuring job, also load
80
+ `../nature-shared/core/discussion-argument-language.md`. Use its function labels
81
+ to remove Results replay, repair the movement from specific findings to bounded
82
+ implications, calibrate modal and reporting verbs to evidence strength, and make
83
+ limitations and future work resolve named claim boundaries. Treat it as general
84
+ writing guidance, not journal policy.
85
+
86
+ ### 5. Reach for references only when needed
87
+
88
+ The files under `references/` are deep references, not defaults. Open them on demand per the `references.on_demand` table in the manifest, for example when the user explicitly asks for phrasebank-style alternatives or a stricter style audit.
89
+
90
+ When the target is Nature Machine Intelligence and exact limits, availability
91
+ sections, conference-extension disclosure or production checks affect the
92
+ revision, load
93
+ `../nature-shared/journal-formats/nature-machine-intelligence.md`.
94
+
95
+ When the job is a whole manuscript rather than a passage, or the text has already been through more than one round of editing, also load `../nature-shared/core/consistency-sweep.md`. Polishing passage by passage cannot see accumulated drift: one experimental factor under several names, the same quantity in two units, a metric at two precisions, or a superlative the paper's own table contradicts. Sweep for those before working on sentences, and repeat the sweep until a pass finds nothing new.
96
+
97
+ **Layout/typesetting (排版) requests are different.** If the user asks to fix
98
+ *placement* rather than wording — loose/sparse pages, stranded headings, figures
99
+ that don't fill the page or split across pages, "Float too large", multi-panel
100
+ arrangement, sparse Supplementary Information — skip the prose axes (paper_type,
101
+ section, language, journal) and load `references/latex-layout.md` directly. That
102
+ file is self-contained: it carries the diagnosis workflow (render → contact-sheet →
103
+ read the log), the float-glue and `[H]`/`\clearpage`/`placeins` patterns, and the
104
+ "regenerate wide figures taller at the source" rule. Always compile and visually
105
+ inspect rendered pages before and after — never judge layout from the `.tex` alone.
106
+
107
+ ## Why this split
108
+
109
+ - The static layer is versioned and reviewable. Adding a new journal style or paper type is one new file plus one manifest line.
110
+ - The dynamic layer keeps each invocation cheap: only the fragments relevant to this draft enter context, instead of the full 1000-line monolith.
111
+ - The router itself is short on purpose. Update fragments, not this file, when adding scope.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Nature Polishing"
3
+ short_description: "Polish academic prose while preserving factual meaning"
4
+ default_prompt: "Use $nature-polishing to revise this passage into concise Nature-leaning English without changing its factual meaning."
@@ -0,0 +1,101 @@
1
+ name: nature-polishing
2
+ version: 6.6.0
3
+ description: >
4
+ Declarative manifest for the static/dynamic split. SKILL.md uses this to
5
+ decide which fragments to load for a given polishing request.
6
+
7
+ always_load:
8
+ # Shared layer — common to nature-polishing and nature-writing
9
+ - ../nature-shared/core/reader-workflow.md
10
+ - ../nature-shared/core/paper-type-taxonomy.md
11
+ - ../nature-shared/core/ethics.md
12
+ - ../nature-shared/core/terminology-ledger.md
13
+ # Skill-local core
14
+ - static/core/stance.md
15
+ - static/core/failure-modes.md
16
+ - static/core/output-format.md
17
+
18
+ axes:
19
+ paper_type:
20
+ detect: |
21
+ Decide what kind of paper or section is being polished. Default to research.
22
+ Use the user's stated framing first; fall back to inference from the text.
23
+ values:
24
+ research: static/fragments/paper_type/research.md
25
+ methods: static/fragments/paper_type/methods.md
26
+ hypothesis: static/fragments/paper_type/hypothesis.md
27
+ algorithmic: static/fragments/paper_type/algorithmic.md
28
+ review: static/fragments/paper_type/review.md
29
+ default: research
30
+ multi: false
31
+
32
+ section:
33
+ detect: |
34
+ Identify which section(s) the user wants polished. The user may name
35
+ one or several. If unclear, ask before loading. Skip this axis only
36
+ when the user provides standalone prose with no section context.
37
+ values:
38
+ abstract: static/fragments/section/abstract.md
39
+ intro: static/fragments/section/intro.md
40
+ results: static/fragments/section/results.md
41
+ discussion: static/fragments/section/discussion.md
42
+ conclusion: static/fragments/section/conclusion.md
43
+ title: static/fragments/section/title.md
44
+ methods: static/fragments/section/methods.md
45
+ multi: true
46
+
47
+ language:
48
+ detect: |
49
+ Detect the source language of the draft. Use zh-to-en when the draft
50
+ is Chinese or shows strong Chinese-influenced English structure.
51
+ Otherwise use en.
52
+ values:
53
+ en: static/fragments/language/en.md
54
+ zh-to-en: static/fragments/language/zh-to-en.md
55
+ default: en
56
+ multi: false
57
+
58
+ journal:
59
+ detect: |
60
+ Use nature only for the flagship journal Nature. Use nat-comms for Nature
61
+ Communications and nat-mach-intell for Nature Machine Intelligence or
62
+ NMI. If the user says "Nature-family" generically or names another Nature
63
+ Portfolio subjournal, use generic and check that title's current guide.
64
+ values:
65
+ nature: static/fragments/journal/nature.md
66
+ nat-comms: static/fragments/journal/nat-comms.md
67
+ nat-mach-intell: static/fragments/journal/nat-mach-intell.md
68
+ generic: static/fragments/journal/generic.md
69
+ default: generic
70
+ multi: false
71
+
72
+ references:
73
+ on_demand:
74
+ - condition: polishing, restructuring, or shortening Results or full main text; deciding what belongs in main text versus captions or SI; preventing revision accretion; reducing statistical or claim repetition; or applying a paragraph necessity test
75
+ path: ../nature-shared/core/main-text-discipline.md
76
+ - condition: target is flagship Nature, Nature Communications, Nature Machine Intelligence, or another Nature Portfolio title and the user is polishing or restructuring Results, Discussion, or their boundary; testing claim escalation; deciding whether local interpretation or robustness advances the claim; or separating necessary recap from redundant re-demonstration
77
+ path: ../nature-shared/core/nature-results-discussion.md
78
+ - condition: polishing, restructuring, or auditing any scientific Discussion; repairing its reverse-funnel movement or function sequence; distinguishing interpretation from Results replay; calibrating modal verbs or hedging; making limitations claim-specific; or converting generic future work into uncertainty-resolving next tests
79
+ path: ../nature-shared/core/discussion-argument-language.md
80
+ - condition: target is flagship Nature, Nature Communications, Nature Machine Intelligence, or another Nature Portfolio title and the user is polishing or restructuring the Introduction or whole-manuscript narrative; building a fast problem funnel, exact knowledge gap, literature tension, question-first novelty, compact study roadmap, or Introduction–Results alignment
81
+ path: ../nature-shared/core/nature-introduction.md
82
+ - condition: target is flagship Nature, Nature Communications, Nature Machine Intelligence, or another Nature Portfolio title and the user is polishing or restructuring the abstract; compressing the manuscript into a discovery-centred evidence chain; selecting one main claim, one or two decisive supports, optional core numbers, or a bounded field-level payoff
83
+ path: ../nature-shared/core/nature-abstract.md
84
+ - condition: needs Nature/Nature Communications article-level patterns for abstracts, intros, Results openings, Discussion, conclusions, titles
85
+ path: references/published-article-patterns.md
86
+ - condition: empirical 2025 Nat Commun diction calibration — connector frequencies, the significantly red line, hedge/booster/tense word choices
87
+ path: references/nat-comms-2025-diction.md
88
+ - condition: needs section-specific move orders or phrase patterns
89
+ path: references/section-moves.md
90
+ - condition: needs hedging, transition, evidence, limitation, future-work phrases
91
+ path: references/phrasebank-playbook.md
92
+ - condition: needs academic style, register, article use, or mechanics checks
93
+ path: references/style-guardrails.md
94
+ - condition: polishing or proofreading a full manuscript rather than a passage, or the text has been through more than one round of editing — sweep for accumulated terminology/unit/number drift, headline counts that do not reconcile, claims contradicted by the paper's own tables, tense parallelism, and prose that restates displays
95
+ path: ../nature-shared/core/consistency-sweep.md
96
+ - condition: needs deeper writing-strategy principles
97
+ path: references/writing-strategy.md
98
+ - condition: needs LaTeX layout/typesetting help (排版) — loose or sparse pages, stranded section headings, figures that don't fill the page or split across pages, "Float too large", multi-panel figure arrangement, or Supplementary Information that looks empty
99
+ path: references/latex-layout.md
100
+ - condition: target is Nature Machine Intelligence and exact content-type, word/display, data/code, initial-submission, or production requirements affect the polish
101
+ path: ../nature-shared/journal-formats/nature-machine-intelligence.md
@@ -0,0 +1,211 @@
1
+ # LaTeX layout & float typesetting for Nature-style manuscripts
2
+
3
+ ## Contents
4
+
5
+ - [0. Diagnosis workflow (do this first)](#0-diagnosis-workflow-do-this-first)
6
+ - [1. The "loose / 松散" float page — top-align the glue](#1-the-loose-松散-float-page-top-align-the-glue)
7
+ - [2. Wide-and-short figures can never fill a portrait page — fix at the source](#2-wide-and-short-figures-can-never-fill-a-portrait-page-fix-at-the-source)
8
+ - [3. Do NOT rotate to landscape (Nature house style)](#3-do-not-rotate-to-landscape-nature-house-style)
9
+ - [4. Float backlog → stranded section headings](#4-float-backlog-stranded-section-headings)
10
+ - [5. [H] and placeins — sharp edges](#5-h-and-placeins-sharp-edges)
11
+ - [6. Multi-panel main-text figures — stack, don't cram](#6-multi-panel-main-text-figures-stack-dont-cram)
12
+ - [7. Page-count is not the metric — fullness is](#7-page-count-is-not-the-metric-fullness-is)
13
+ - [8. Quick checklist](#8-quick-checklist)
14
+
15
+
16
+ Deep reference for **typesetting/layout** requests (排版): loose pages, stranded
17
+ headings, figures that don't fill the page, "Float too large", page-splitting
18
+ figures, Supplementary Information that looks sparse. This is about *placement*,
19
+ not prose. Load it when the user asks to fix layout, spacing, figure placement,
20
+ page breaks, or "make it less empty / more compact / more beautiful".
21
+
22
+ Golden rule: **change → compile → render to image → look → iterate.** Never judge
23
+ layout from the `.tex` alone. Measure, don't guess.
24
+
25
+ ---
26
+
27
+ ## 0. Diagnosis workflow (do this first)
28
+
29
+ 1. Compile and read the log for the three signals that matter:
30
+ - `Float too large for page by Xpt` — a float (often figure+caption) exceeds the text height.
31
+ - `Overfull \vbox` — content ran past the bottom margin (often `[H]` placement).
32
+ - `Reference ... undefined` / `Citation ... undefined` — re-run needed (and for `xr-hyper`, compile the SI first, then the main file twice).
33
+ 2. Render pages to PNG and *look*. With pymupdf:
34
+ `fitz.open(pdf)[i].get_pixmap(dpi=90).save(...)`. Build a **contact sheet**
35
+ (all pages as a grid) to spot whitespace, stranded headings, and split floats at a glance.
36
+ 3. Measure figure aspect ratios from the source PDFs (`pypdf` mediabox, or pymupdf):
37
+ `aspect = width/height`. Then `displayed_height_pt ≈ textwidth_pt / aspect`.
38
+ For a 1-in-margin `article` on US Letter, `\textwidth ≈ 468 pt`, usable
39
+ `\textheight ≈ 620–650 pt`. Budget every page against that height.
40
+
41
+ ---
42
+
43
+ ## 1. The "loose / 松散" float page — top-align the glue
44
+
45
+ **Symptom:** a page holding only floats (two tables, or a figure) has a big band of
46
+ whitespace in the middle / above, content seemingly centered with gaps.
47
+
48
+ **Cause:** LaTeX's float-page glue is rubber and spreads floats to fill the page:
49
+ `\@fptop = 0pt plus 1fil`, `\@fpsep = 8pt plus 2fil`, `\@fpbot = 0pt plus 1fil`.
50
+
51
+ **Fix:** top-align floats so they pack from the top and slack collects at the bottom
52
+ (reads as an intentional page tail, not "loose"):
53
+
54
+ ```latex
55
+ \makeatletter
56
+ \setlength{\@fptop}{0pt} % no stretch at top → floats start at top
57
+ \setlength{\@fpsep}{14pt} % fixed gap between stacked floats
58
+ \setlength{\@fpbot}{0pt plus 1fil} % all slack to the bottom
59
+ \makeatother
60
+ % Let a page hold more float and less forced text:
61
+ \renewcommand{\topfraction}{0.95}
62
+ \renewcommand{\bottomfraction}{0.95}
63
+ \renewcommand{\textfraction}{0.06}
64
+ \renewcommand{\floatpagefraction}{0.80}
65
+ \setlength{\textfloatsep}{16pt plus 3pt minus 3pt}
66
+ \setlength{\floatsep}{14pt plus 3pt minus 3pt}
67
+ ```
68
+
69
+ This single change fixed the spread-apart table pages in practice (a two-table page
70
+ went from a centered gap to a tight top-aligned block). Apply it in the SI preamble.
71
+
72
+ ---
73
+
74
+ ## 2. Wide-and-short figures can never fill a portrait page — fix at the source
75
+
76
+ **Symptom:** a figure (e.g. a 1×N strip of per-dataset bars) sits at full width but is
77
+ short (aspect 3:1–4:1), leaving ~40–50% of the page empty; it also tends to strand the
78
+ next heading (see §4).
79
+
80
+ **Why LaTeX can't fix it:** the figure is width-bound at `\textwidth`. A 3.3:1 figure
81
+ at 468 pt wide is only ~140 pt tall. You cannot make it taller without making it wider
82
+ than the text, and stretching (`height=...` without keeping aspect) distorts it.
83
+
84
+ **Correct fix — regenerate the figure with a taller aspect** (target ~**1.9:1–2.2:1**)
85
+ so two stacked panels + caption fill the portrait page. In matplotlib this is just the
86
+ `figsize` height, e.g. `figsize=(17, 4.1)` → `figsize=(17, 6.8)`. Then:
87
+
88
+ - **Verify faithfulness before trusting regeneration:** re-run at the *original* size
89
+ first and pixel-diff against the shipped PDF. Only if identical do you trust that
90
+ changing the height won't drift fonts/colors/style.
91
+ - **Only touch the SI branch.** Main-text and SI versions are often produced by
92
+ different functions (`plot_avg_bar` vs `plot_grouped_bar`); change only the one the
93
+ SI uses, or you'll silently alter approved main-text figures.
94
+ - **Font-size caveat:** the on-page text size is set by the *display width* (figure
95
+ scaled to `\textwidth`). Making a figure *taller* does **not** enlarge tick/label
96
+ fonts — it only adds vertical extent (taller bars, more breathing room). To enlarge
97
+ labels you must *narrow* the figure (more scale-up to `\textwidth`) or bump the
98
+ in-plot font, not add height.
99
+ - **Mind the caption budget.** A 5–6 line caption is ~80 pt. Size the figure so
100
+ `heading + intro + 2 panels + subcaptions + caption ≤ usable height`. A long-caption
101
+ figure (e.g. a timeline) often needs to be ~0.5 in shorter than a short-caption one.
102
+
103
+ ---
104
+
105
+ ## 3. Do NOT rotate to landscape (Nature house style)
106
+
107
+ Nature / Nature Communications discourage rotated/landscape figures that force the
108
+ reader to turn the page. **Prefer a taller redraw (§2) over `\rotatebox` /
109
+ `sidewaysfigure`.** Landscape is *tolerated* in SI for genuinely un-squarable figures,
110
+ but try the redraw first. If the user defers ("do what Nature does"), choose upright.
111
+
112
+ ---
113
+
114
+ ## 4. Float backlog → stranded section headings
115
+
116
+ **Symptom (very common in figure-heavy SI):** two or more section headings pile at the
117
+ top of a page above a huge empty gap; their figures appear pages later.
118
+
119
+ **Cause:** big floats can't be placed, so they defer; meanwhile body text and the next
120
+ `\section` keep flowing and stack up. The headings out-run their figures.
121
+
122
+ **Fix — bind each figure section into a "heading + figure" unit:**
123
+
124
+ 1. Make the figure short enough to *share a page* with its heading + intro
125
+ (`heading + intro + figure ≤ usable height`; see §2 caption budget).
126
+ 2. Start the section on a fresh page: `\clearpage` immediately before the `\section`.
127
+ This guarantees full height is available.
128
+ 3. Pin the figure with `[H]` (needs `\usepackage{float}`) right after the heading/intro
129
+ so it cannot float away:
130
+
131
+ ```latex
132
+ \clearpage
133
+ \section{Per-dataset context scaling}
134
+ Figure~\ref{fig:scaling} shows ... % short intro
135
+ \begin{figure}[H] % H = exactly here, no floating
136
+ ...two stacked panels...
137
+ \caption{...}\label{fig:scaling}
138
+ \end{figure}
139
+ ```
140
+
141
+ Result: a fresh page with heading + intro + figure + caption that fills the page, with
142
+ no stranded heading.
143
+
144
+ **Also pin the *preceding* section's trailing figure.** A `\clearpage` before a heading
145
+ flushes the page early — if the previous section ended with a big floating figure whose
146
+ intro text is still on the page, you strand that text instead. Give that trailing figure
147
+ `[H]` too (and size it to fit with its intro), so the page before the `\clearpage` is
148
+ also full. (In practice: a timeline figure had to be shrunk ~10% so its intro paragraph
149
+ + figure + long caption fit one page.)
150
+
151
+ ---
152
+
153
+ ## 5. `[H]` and `placeins` — sharp edges
154
+
155
+ - **`[H]`** (float package) does not float. If the figure doesn't fit in the remaining
156
+ space it either page-breaks *before* itself (stranding preceding text) or overflows
157
+ (`Overfull \vbox`). Safe only when you guarantee room — hence pair it with `\clearpage`
158
+ and size-to-fit. Great for the heading+figure unit; risky mid-page.
159
+ - **`\usepackage[section]{placeins}`** puts a `\FloatBarrier` at every `\section`, keeping
160
+ a section's floats inside it. Useful against backlog — **but** it flushes the previous
161
+ float and can strand the *current* heading alone on a page if that section's figure is
162
+ too tall to share. It fixed a two-heading pile-up yet produced one-heading-per-empty-page
163
+ until figures were also shortened. Use it *with* §2/§4 sizing, not as a standalone cure.
164
+ - **Don't blanket-`\clearpage` every section.** Section-boundary clearpages create
165
+ near-empty pages when a section is short. Use `\clearpage` surgically (figure sections,
166
+ §4), not everywhere. (Removing 8 blanket clearpages once took an SI 23→21 pages with
167
+ even density.)
168
+
169
+ ---
170
+
171
+ ## 6. Multi-panel main-text figures — stack, don't cram
172
+
173
+ - A 2×2 grid shrinks panels; for **wide** panels prefer a **single-column vertical stack**
174
+ (`a` over `b` over `c` over `d`), each near full width, on a dedicated float page `[p]`.
175
+ Reads larger and matches a 2-panel `a/b` stacked figure elsewhere.
176
+ - Tune inter-panel space with `\vspace` between `subfigure`s (e.g. `0.3em–0.8em`).
177
+ - If you see `Float too large for page by X pt` and X is small (<5 pt), shave the
178
+ smallest thing first: reduce inter-panel `\vspace`, or panel width by ~2%, before
179
+ touching the figure itself.
180
+
181
+ ```latex
182
+ \begin{figure}[p]\centering
183
+ \begin{subfigure}{0.66\textwidth}\includegraphics[width=\textwidth]{a}\caption{}\end{subfigure}
184
+ \vspace{0.3em}
185
+ \begin{subfigure}{0.66\textwidth}\includegraphics[width=\textwidth]{b}\caption{}\end{subfigure}
186
+ ...
187
+ \caption{...}\label{...}
188
+ \end{figure}
189
+ ```
190
+
191
+ ---
192
+
193
+ ## 7. Page-count is not the metric — *fullness* is
194
+
195
+ Tightening loose pages can *reduce* count; enlarging short figures to fill pages can
196
+ *increase* it. Both are correct. A 20-page SI where every page is full beats a 19-page SI
197
+ with half-empty figure pages. Optimize for even density and no stranded headings, not for
198
+ the smallest page count.
199
+
200
+ ---
201
+
202
+ ## 8. Quick checklist
203
+
204
+ - [ ] Top-aligned float glue in the preamble (§1).
205
+ - [ ] Wide-short figures regenerated to ~2:1, SI branch only, faithfulness pixel-checked (§2).
206
+ - [ ] Upright, not landscape (§3).
207
+ - [ ] Each figure section: `\clearpage` + `[H]` heading-figure unit; trailing figure of the
208
+ previous section also `[H]` and sized to fit (§4).
209
+ - [ ] No blanket section clearpages; no stranded headings (§5).
210
+ - [ ] Compile clean: no "Float too large", no "Overfull \vbox", no undefined refs.
211
+ - [ ] Contact-sheet the final PDF and eyeball every page (§0).
@@ -0,0 +1,73 @@
1
+ # Nature Communications 2025 — Diction & Connector Calibration
2
+
3
+ Use this file during the sentence-level polish pass when you want **empirical,
4
+ quantified word-choice calibration** to back up `style-guardrails.md` and
5
+ `published-article-patterns.md`. The preferences below are measured from a 2025
6
+ reading set of 20 open-access *Nature Communications* computer-science / AI
7
+ articles. They are calibration data, not rules to apply blindly — a discipline
8
+ or a specific journal house style overrides them. **Do not copy source wording.**
9
+
10
+ ## 1. Connectors — observed preference order
11
+
12
+ 句首大写连接词词频(5 篇子集合计):
13
+ `However` **51** ≫ `Furthermore` 22 · `Therefore` 19 · `Overall`/`Notably` 16 · `In addition` 13 · `In contrast` 6 · `Moreover` 4 · `Importantly` 2.
14
+
15
+ - **However** carries turns, gap-opening, and surprises — do not scatter weaker
16
+ alternatives where `However` is idiomatic.
17
+ - For addition, prefer **Furthermore** over **Moreover** (22 vs 4 here).
18
+ - Cause/close with **Therefore**; summarise a block with **Overall / In summary / In conclusion**.
19
+ - Reserve **Notably / Importantly / Interestingly / Surprisingly** for the
20
+ paragraph's key finding, not as routine sentence openers.
21
+
22
+ ## 2. Boosters — the `significantly` red line
23
+
24
+ - **`significantly` appears 0 times in the corpus.** When a draft leans on
25
+ "significantly (better/higher/improved)", first check it is a *statistical*
26
+ claim with a test behind it; otherwise replace with **notably /
27
+ substantially / considerably / markedly**.
28
+ - This extends the `style-guardrails.md` overclaim list: treat blanket
29
+ intensifiers as a smell, and attach every booster to a number or a test.
30
+
31
+ ## 3. Hedges — concentrated, not sprinkled
32
+
33
+ - Primary hedges are **may** and **potential**; `might / could / likely` are
34
+ secondary. They cluster in meaning/Discussion sentences, not in Results
35
+ reporting. Pattern marker: *"Encoding these mechanisms **may** help further
36
+ improve the performance."*
37
+ - Keep Results sentences assertive + numeric; move the hedge to the
38
+ interpretation sentence.
39
+
40
+ ## 4. Achievement verbs — the house vocabulary
41
+
42
+ Frequent, defensible when backed by data: **achieve · demonstrate · outperform
43
+ · superior · robust · generalizable · comparable**. When the result is *weaker*
44
+ than a baseline, state it honestly and reframe with **comparable** +
45
+ concession: *"**Despite the smaller scale** of our pre-training data …, the
46
+ **comparable** performance highlights the effectiveness."* Do not upgrade
47
+ `comparable` to `superior`.
48
+
49
+ ## 5. Tense & voice (polish-pass checks)
50
+
51
+ - Background / property = present; specific operation = past; figure
52
+ description = present. Flag accidental past-tense for a standing property
53
+ (*"CataPro demonstrates…"* not *"demonstrated"* when stating a capability).
54
+ - Active **we** for narrative and claims; passive for apparatus/method only.
55
+ Flag passive over-use that hides the agent in claim sentences.
56
+
57
+ ## 6. Sentence-skeleton phrases (calibrated to 2025 corpus)
58
+
59
+ - Abstract hinge: `Here we show/present X (FULL NAME, abbr.), a … that …`
60
+ - Gap: `However, … remains a challenge` / `the scarcity of … hinders …` /
61
+ `Without X, Y cannot be quantified`.
62
+ - Result close: `These findings collectively affirm/confirm that …`
63
+ - Significance (soft promise, not a guarantee): `promises to / offers
64
+ potential / paves the way`.
65
+ - Title: no number, no result — keep digits for the abstract.
66
+
67
+ ## 7. 中文润色要点
68
+
69
+ - 连接词:转折/制造空白优先"然而";递进偏"此外/进一步"(对应 Furthermore);
70
+ 因果用"因此";收束用"总体而言/综上"。
71
+ - 慎用"显著"——英文 `significantly` 在本语料 0 次。无统计检验支撑时改"明显/大幅/相当/尤为"。
72
+ - 对冲(可能/提示/有望)集中在意义句,结果句保持带数字的肯定陈述。
73
+ - 战绩措辞(实现/证明/优于/稳健/可泛化/相当)需有数据支撑;弱于对手时用"相当"+"尽管规模更小"客观化,不拔高为"优于"。