Skip to content

Commit b1ac2b6

Browse files
JihaoXinclaude
andcommitted
Add page-adjustment and figure-integrity builtin skills
New skills (auto-inherited by all projects): - page-adjustment: gap-proportional strategies for fitting papers to page limits; appendix-first for new content; sensitive areas guidance - figure-integrity: all figure/table data must trace to result files; plotting scripts must load from files not literals; protected during page adjustment Updated writer.prompt to reference skills instead of inlining duplicate rules. Simplified _enforce_page_count prompts to defer strategy choice to the writer + skills. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 3a781f6 commit b1ac2b6

File tree

4 files changed

+150
-63
lines changed

4 files changed

+150
-63
lines changed

ark/execution.py

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -765,37 +765,25 @@ def _enforce_page_count(self, context: str = "post-writing") -> bool:
765765
if page_count > cur_max:
766766
action = "compress"
767767
self.log(f"[{context}] Over limit ({page_count:.1f} > {cur_max:.1f}), compressing (attempt {attempt})...", "WARN")
768-
self.run_agent("writer", f"""{hist_block}## PAGE COMPRESSION (attempt {attempt})
768+
self.run_agent("writer", f"""{hist_block}## PAGE ADJUSTMENT — compress (attempt {attempt})
769769
770-
The paper body is currently {page_count:.2f} pages, {gap:+.2f} pages over the limit ({columns}-column).
771-
Target: between {cur_min:.2f} and {venue_pages:.0f} body pages. Do NOT over-compress.
772-
773-
Reduce carefully — aim for exactly {venue_pages} pages, NOT much less. Strategies:
774-
- Merge overlapping sentences in related work
775-
- Move only truly non-essential subsections to \\appendix
776-
- Do NOT remove key technical content, results, or entire sections
770+
Current: {page_count:.2f} body pages ({gap:+.2f} over limit, {columns}-column).
771+
Target: {cur_min:.2f}{venue_pages:.0f} body pages.
777772
778-
After changes, compile and verify body pages are between {cur_min:.2f} and {venue_pages:.0f}.
779-
Ensure `\\clearpage` before `\\bibliography`.
773+
Refer to the page-adjustment and figure-integrity skills for strategies and constraints.
774+
After changes, compile and verify. Ensure `\\clearpage` before `\\bibliography`.
780775
""", timeout=1800)
781776

782777
elif page_count < cur_min:
783778
action = "expand"
784779
self.log(f"[{context}] Under target ({page_count:.1f} < {cur_min:.2f}), expanding (attempt {attempt})...", "WARN")
785-
self.run_agent("writer", f"""{hist_block}## PAGE EXPANSION (attempt {attempt})
780+
self.run_agent("writer", f"""{hist_block}## PAGE ADJUSTMENT — expand (attempt {attempt})
786781
787-
The paper body is currently {page_count:.2f} pages, {-gap:+.2f} pages short of the target ({columns}-column).
782+
Current: {page_count:.2f} body pages ({-gap:+.2f} short of target, {columns}-column).
788783
Target: {cur_min:.2f}{venue_pages:.0f} body pages.
789784
790-
Expand by adding substantive content (NOT filler):
791-
- Deepen the analysis/discussion section with more insights
792-
- Add more related work comparisons and positioning
793-
- Expand experimental methodology details (hyperparameters, setup)
794-
- Add a limitations paragraph or future work discussion
795-
- Do NOT add padding text or redundant restatements
796-
797-
After changes, compile and verify body pages are between {cur_min:.2f} and {venue_pages:.0f}.
798-
Ensure `\\clearpage` before `\\bibliography`.
785+
Refer to the page-adjustment and figure-integrity skills for strategies and constraints.
786+
After changes, compile and verify. Ensure `\\clearpage` before `\\bibliography`.
799787
""", timeout=1800)
800788

801789
self._ensure_clearpage_before_bibliography()

ark/templates/agents/writer.prompt

Lines changed: 9 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -60,51 +60,18 @@ Every quantitative claim in the paper must be traceable to a real result file:
6060
3. **If a result doesn't exist**, do not write the claim. Instead, leave a LaTeX comment: `% TODO: result not available — needs experiment`
6161
4. **Do NOT describe experiments that weren't run**. If `results/` is empty or contains only simulated data, do not write an Experiments section that claims real results were obtained.
6262

63-
## Hard Page Limit — {VENUE_PAGES} pages (MANDATORY)
63+
## Page Limit — {VENUE_PAGES} pages
6464

65-
The paper body (excluding references and appendix) has a strict page target:
66-
- **Maximum**: {VENUE_PAGES} pages. Exceeding this means automatic desk rejection. This is the hard constraint — never violate it.
67-
- **Minimum**: The last page of body text should be at least 70% filled. Up to 30% whitespace at the bottom is acceptable.
65+
The paper body (excluding references and appendix) must not exceed **{VENUE_PAGES} pages** (desk rejection). The last page should be at least 70% filled.
6866

69-
**Before making ANY change**, check current page count. Then:
67+
Before making changes, check the current page count. Refer to the **page-adjustment** skill for compression/expansion strategies and the **figure-integrity** skill for rules on modifying figures and tables.
7068

71-
- **Over {VENUE_PAGES} pages**: COMPRESS first. Do NOT add content until under the limit.
72-
- **At or near the limit**: For every paragraph added, remove equal or more text.
73-
- **Well under the limit (last page < 70% filled)**: ADD substantive content — deeper analysis, more related work comparisons, expanded methodology details. Do NOT pad with filler.
69+
Always ensure `\clearpage` appears before `\bibliography` so references start on a new page.
7470

75-
**Always ensure `\clearpage` appears before `\bibliography`** so references start on a new page.
76-
77-
## Figure Placement Rules (MUST check after every edit)
71+
## Figure Placement
7872

7973
After every modification, compile and check that:
80-
1. **No blank pages with only figures** — if a figure can't fit on the current page, it may float to a later page. If this creates a page with only figure(s) and no text, fix it by:
81-
- Moving the `\begin{figure}` declaration earlier in the text
82-
- Reducing figure height with `\includegraphics[width=...,height=...]`
83-
- Using `[!htbp]` placement specifier instead of `[t]`
84-
2. **`\FloatBarrier` before the last section** — add `\FloatBarrier` (from `\usepackage{placeins}`) immediately before the last body section (usually Conclusion). This guarantees all figures appear before the final section, not after it. Example:
85-
```
86-
\FloatBarrier
87-
\section{Conclusion}
88-
```
89-
3. **Figures match their context** — a figure referenced in Section 3 should appear on or near Section 3's pages, not 2 pages later
90-
4. **Multi-panel figures use correct environment** — figures with 2+ panels (side-by-side) should use `\begin{figure*}` (full width) in multi-column templates, so fonts are readable
91-
5. **No large whitespace gaps on body pages** — floats that don't fit on the current page can leave a big vertical gap (e.g., a paragraph ends, several inches of whitespace, then the next section starts on the next page). After compiling, visually scan every body page:
92-
- If you see a gap larger than ~1/4 of page height between paragraphs, it's a float placement problem
93-
- Fix it by: shrinking the offending figure, moving its `\begin{figure}` closer to where it's first referenced, switching `[t]` to `[!htbp]`, or combining adjacent small figures into one
94-
- As a last resort, allow the float to appear slightly earlier or later than its reference rather than creating mid-page whitespace
95-
96-
If you see layout issues after compiling, fix them before finishing.
97-
98-
**Compression strategies** (in order of priority):
99-
1. Move detailed ablations, sensitivity analyses, and per-category breakdowns to `\appendix`
100-
2. Merge Discussion and Conclusion into one section
101-
3. Replace verbose multi-paragraph explanations with concise text
102-
4. Compress tables — remove redundant rows/columns, use `\small` or `\footnotesize`
103-
5. Remove any content that repeats information from another section
104-
105-
**Expansion strategies** (when too short):
106-
1. Deepen analysis/discussion — explain WHY, not just WHAT
107-
2. Add more related work with specific comparisons to your approach
108-
3. Expand experimental setup (hyperparameters, hardware, dataset splits)
109-
4. Add a Limitations paragraph
110-
5. Expand figure captions with interpretive context
74+
1. No blank pages with only figures — adjust float placement (`[t]`, `[!htbp]`) or move the `\begin{figure}` earlier
75+
2. Add `\FloatBarrier` before the last body section (usually Conclusion)
76+
3. Figures appear near where they are referenced, not pages later
77+
4. No large whitespace gaps — shrink figures or adjust placement if floats leave gaps
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
name: figure-integrity
3+
description: Rules for maintaining figure and table data integrity. All visual data must trace to result files — never invented or modified for convenience.
4+
tags: [writing, figures, tables, data-integrity, latex]
5+
---
6+
7+
# Figure and Table Integrity
8+
9+
## Core Rule
10+
11+
Every number displayed in a figure or table must be traceable to a file in `results/` or `data/`. If the source file doesn't exist, the figure should not exist either.
12+
13+
## When Creating or Updating Figures
14+
15+
1. **Read the source data first.** Before writing any plotting script, read the actual result file (`results/*.json`, `results/*.csv`) and extract the exact values. Do NOT hardcode numbers from memory or from the paper text.
16+
2. **Load data from files, not literals.** Plotting scripts must `json.load()` or `pandas.read_csv()` from the result file. Acceptable:
17+
```python
18+
with open("results/exp3_repair_n100.json") as f:
19+
data = json.load(f)
20+
drr = data["mean_drr"]
21+
```
22+
Not acceptable:
23+
```python
24+
drr = 0.942 # from the paper
25+
```
26+
3. **Handle missing data honestly.** If a result file doesn't exist or is incomplete:
27+
- Leave the figure cell/bar/point blank or mark it "N/A"
28+
- Add a `% TODO` comment in the LaTeX caption
29+
- Do NOT invent a plausible value
30+
31+
## When the Paper Text Cites a Figure
32+
33+
The flow is always: **experiment → result file → figure → paper text**. Never the reverse.
34+
35+
- If the paper says "F1=0.891 (Figure 4)" — verify that Figure 4's plotting script reads a file that contains 0.891.
36+
- If the paper text and the figure disagree, the result file is the authority. Fix whichever is wrong.
37+
38+
## During Page Adjustment
39+
40+
Figures and tables are **protected zones** during page compression or expansion:
41+
42+
- You may **resize** a figure (change `width`/`height` in `\includegraphics`)
43+
- You may **move** a figure to a different position in the LaTeX source or to the appendix
44+
- You may **change float placement** (`[t]`, `[!htbp]`, `[p]`)
45+
- You must NOT **change the data** shown in the figure
46+
- You must NOT **regenerate the figure with different values**
47+
- You must NOT **remove data points, bars, or table rows** to make it smaller
48+
49+
## After Any Figure Modification
50+
51+
1. **Spot-check values.** Pick 2-3 numbers from the figure and verify them against the source file.
52+
2. **Check captions.** If the figure was moved or its context changed, update the caption to remain accurate.
53+
3. **Check references.** Ensure all `\ref{fig:...}` in the text still point to the correct figure.
54+
55+
## Common Mistakes to Avoid
56+
57+
- Regenerating a plotting script from scratch using numbers "remembered" from the paper text, when the original script loaded from a result file
58+
- Changing figure data during page compression to make the figure smaller
59+
- Copying a figure caption's numbers into a new version of the figure without reading the actual data
60+
- Creating a figure for an experiment that was blocked or incomplete — an honest "not evaluated" note is better than a fabricated chart
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
---
2+
name: page-adjustment
3+
description: Strategies for fitting a paper to a venue's page limit without destroying content quality. Applies to any phase that modifies paper content.
4+
tags: [writing, latex, page-limit, appendix, compression]
5+
---
6+
7+
# Page Adjustment
8+
9+
## Guiding Principle
10+
11+
Page adjustment is surgery, not demolition. Every change must preserve the paper's technical accuracy, figure correctness, and citation integrity. The approach should be proportional to the gap — small gaps need small edits, large gaps may require structural changes.
12+
13+
## Assess the Gap First
14+
15+
Before making any change, compile and measure:
16+
- **How many pages over/under?** This determines the scale of intervention.
17+
- **Small gap (< 0.3 pages):** Tighten or loosen prose — a sentence here, a paragraph there. No structural changes needed.
18+
- **Medium gap (0.3–1.0 pages):** May need to add/remove a paragraph, resize a figure, or move a subsection to appendix.
19+
- **Large gap (> 1.0 pages):** Structural changes — move entire subsections to/from appendix, add/remove a discussion section, consolidate related work.
20+
21+
Match the intervention to the gap. Do not restructure the paper to fix a 0.2-page overshoot.
22+
23+
## When Adding New Content
24+
25+
When new experiment results or analyses need to be added (review phase, dev phase, any iteration):
26+
27+
1. **Consider appendix for details.** Full experiment methodology, detailed tables, and per-category breakdowns often fit better in `\appendix`, with a brief summary (1-3 sentences) and forward reference in the main body.
28+
2. **Budget before writing.** Estimate how much space the new content needs. If the main body is already at or near the limit, the appendix is the natural home for details.
29+
3. **Balance additions with removals.** If you add a paragraph, look for an equal-length passage that can be condensed or moved to appendix. Do this in the same edit — do not defer to a later compression pass.
30+
31+
## Available Strategies
32+
33+
These are tools in your toolbox. Choose based on the gap size and paper structure — there is no fixed priority order.
34+
35+
**For compression (over limit):**
36+
- Tighten prose: merge overlapping sentences, remove hedging ("it is worth noting that..."), collapse short lists into inline text
37+
- Move subsections to `\appendix`: per-category breakdowns, detailed ablations, extended proofs, large tables — keep a summary in the body
38+
- Compress tables: use `\footnotesize`, remove redundant columns, merge header rows
39+
- Reduce figure size: decrease `height` in `\includegraphics` by 10-20%
40+
- Merge sections: combine "Discussion" and "Conclusion" if both are short, merge sub-subsections with <3 sentences
41+
42+
**For expansion (under limit):**
43+
- Deepen analysis: explain *why* results look the way they do, not just *what*
44+
- Add related work: compare with 2-3 more relevant papers, specific technical differences
45+
- Expand methodology: hyperparameters, hardware specs, dataset details that aid reproducibility
46+
- Bring appendix content back: if content was moved to appendix during prior compression, selectively restore the most important parts
47+
- Add a Limitations paragraph if one doesn't exist
48+
49+
## What to Avoid
50+
51+
- Avoid changing numbers in figures, tables, or quantitative claims — these come from result files
52+
- Avoid removing figures or tables entirely when they can be moved to appendix instead
53+
- Avoid deleting `\cite{}` commands or modifying `references.bib`
54+
- Avoid adding filler text or restating what was already said
55+
- Avoid fabricating new experimental results to fill space
56+
57+
## Sensitive Areas
58+
59+
These elements require extra care during page adjustment:
60+
61+
- **Figure data and labels** — sourced from `results/` files. If you must modify a figure, re-read the source data. Do not change values from memory.
62+
- **Table values** — same principle. Move or resize the table, but be careful with its contents.
63+
- **`references.bib`** — managed by the citation system. Prefer not to touch it.
64+
- **Venue template**`\documentclass`, `\usepackage`, `.sty`, `.bst` are off-limits.
65+
66+
## Verification After Adjustment
67+
68+
After every page adjustment pass:
69+
1. Compile and check page count
70+
2. Spot-check 2-3 quantitative values against `results/` files — especially any figure or table you touched
71+
3. Check for LaTeX warnings on unresolved `\ref{}` or `\cite{}`
72+
4. Read through any section you modified — no dangling references to moved content

0 commit comments

Comments
 (0)