Latex paper empirical writer

From FOURTEEN1416/academic-agent-toolkit · View interactive version

Latex paper empirical writer is an AI agent skill from the GitHub repository FOURTEEN1416/academic-agent-toolkit. Draft IEEE-style empirical ML/AI papers from a structured research contract. Builds experiment plans, section drafts, and the LaTeX project skeleton.

How to use this skill

Skill file

<!--ACAT-ADAPTED: 资产补齐自 yunshenwuchuxun/latex-paper-skills@d0f106108cb0(empirical-paper-writer + _shared),正文未改。溯源见 references/UPSTREAM.md。2026-09-09 专项治理。2026-11-16 重收编收尾批(pin d0f10610→7965fbc):随上游 route_and_invoke.py 修正同步 Gate 0 口径——既有项目目录(自 latex-paper-from-zero 交接)plan-first,不重跑脚手架。-->

Empirical Paper Writer

Use this skill for novel experimental research papers after the topic and

contribution have already been framed.

This skill is the empirical counterpart to ../latex-paper-survey-writer.

It reuses the same high-value paper-engine pieces—citation discipline, LaTeX

compilation, source policy, and QA—but changes the paper logic from review to

experiment-driven writing.

When to Use

When NOT to Use

Inputs

Outputs

Non-Negotiable Rules

  1. No prose in main.tex until plan approved and issues CSV exists.
  2. Do not fabricate results, numbers, or significance claims.
  3. Every experimental claim must map to an evidence item or explicit placeholder.
  4. Mark result status explicitly as one of planned, placeholder, or verified.
  5. Reuse the existing paper-engine scripts for citation verification, compile, source ranking, and QA whenever possible.

Workflow

Gate 0: Scaffold + Research Contract

  1. Confirm venue, page target, datasets/baselines if already known, and any user-provided innovation.
  2. Search literature and gather only enough papers to frame the problem, baselines, and closest related methods.
  3. Create or refine:
  1. Scaffold the project:

```bash

python3 scripts/bootstrap_ieee_empirical_paper.py --stage kickoff --topic "<topic>" --layout project

```

--layout project creates <project>/paper/ (LaTeX + issues) and <project>/experiments/ (code scaffold).

For a lighter entrypoint with an outline-only plan:

```bash

python3 scripts/bootstrap_ieee_empirical_paper.py --stage outline --topic "<topic>" --layout project

```

> Existing project directory (handoff from ../latex-paper-from-zero):

> when the project directory already exists, do NOT rerun scaffolding.

> Create the empirical plan in place first (plan-first; aligned with the

> upstream router fix in 7965fbc), then continue from the approved plan.

> Upstream implements this step with its own empirical plan script, which is

> not integrated in this repository — see the router's governance note in

> ../latex-paper-from-zero/SKILL.md ("Routing Execution").

  1. Create a skeleton-only main.tex with headings, bullet placeholders, experiment slots, and seed citations.
  2. STOP until the user approves the plan.

Phase 0.5: Method & Experiment Design

After the user approves the initial plan, design the method and experiments

before creating the issues CSV. This phase produces structured CSV artifacts.

Step 1: Systematic Baseline Identification

  1. From the contribution-map primary claim, search for baselines in 3 categories:
  1. Record 10-20 candidates in notes/design/baselines.csv (see assets/baselines-template.csv).
  2. Select 4-8 baselines for final comparison. Mark selected=yes with reason.
  3. See references/experiment-design.md Section 1 for selection criteria.

Step 2: Innovation Module Design

  1. From the gap analysis (nearest prior work weaknesses × improvable directions):
  1. Record all pipeline components in notes/design/method-components.csv (see assets/method-components-template.csv).
  2. Mark is_novel=yes for novel components; define replaceable_by for ablation.

Step 3: Pipeline Architecture Design

  1. Design the overall flow: input → preprocessing → core module(s) → postprocessing → output.
  2. For each component: function, input/output format, replaceability.
  3. Training flow: loss function rationale, optimizer, tuning strategy.
  4. Inference flow: runtime cost estimate.
  5. Sketch a pipeline architecture diagram placeholder for the Method section.

Step 4: Comparison Experiment Matrix

  1. Design the baselines × datasets × metrics matrix.
  2. Fair comparison rules:
  1. Record all experiment rows in notes/design/experiment-matrix.csv with type=main_comparison (see assets/experiment-matrix-template.csv).

Step 5: Ablation Experiment Design

  1. From method-components.csv, identify factors by ablation_priority:
  1. For each factor: define removal/degradation/random-replacement strategy.
  2. Record in experiment-matrix.csv with type=ablation.
  3. Minimum 4 ablation factors.

Step 6: Robustness & Efficiency Analysis Plan

  1. Robustness: noise levels, distribution shift, domain transfer scenarios.
  2. Error analysis: failure case categories, sampling protocol.
  3. Efficiency: parameter count, FLOPs, inference latency vs baselines.
  4. Record in experiment-matrix.csv with type=robustness and type=efficiency.

Phase 0.5 outputs (saved in notes/design/):

STOP until the user confirms the design artifacts before proceeding to Gate 1.

Gate 1: Create Issues CSV

  1. Check the kickoff gate in the plan.
  2. Create issues CSV:

```bash

python3 scripts/bootstrap_ieee_empirical_paper.py --stage issues --topic "<topic>" --with-literature-notes --layout project

```

  1. Validate:

```bash

python3 scripts/validate_empirical_paper_issues.py <paper_dir>/issues/<timestamp>-<slug>.csv

```

For --layout project, <paper_dir> is <project>/paper.

Phase 1.5: Literature Enrichment Gate

Before starting the writing loop, ensure citation coverage is adequate.

  1. Count check: total unique entries in ref.bib. If < 25, trigger enrichment.
  2. Cluster search: for each Related Work sub-area (from the RW taxonomy), search

for 3-5 additional relevant papers beyond the initial spine set.

  1. Baseline citations: every selected baseline in baselines.csv must have at

least one corresponding entry in ref.bib.

  1. Method motivation: for each novel component in method-components.csv,

find 1-2 papers that motivate the design choice (prior art or the gap it fills).

  1. Verify all new citations via the standard verification pipeline.
  2. Gate: do not start W1 until ref.bib has ≥ 25 verified entries. Target 30-40

for the finished paper (empirical papers need fewer than reviews, but 14 is

universally too low).

Phase 2: Execution Loop

For each issue:

  1. Research the exact claim, baseline, or related-work gap.
  2. Draft the assigned section or experiment block.
  3. Keep results explicit:
  1. Prefer hypothesis-safe writing for any unverified outcome (e.g., (hypothesis) / [Pending: ...] tags).
  2. Never write deterministic superiority claims without verified evidence.
  3. Run citation audit / compile / QA before marking DONE.
  4. Dependency enforcement: Before marking any issue DONE, verify that ALL issues listed in its Depends_On column are already DONE or SKIP. If any dependency is still TODO or DOING, the current issue MUST NOT be marked DONE. This rule is non-negotiable.

Phase 2.2: Issue Execution Helpers

Phase 2.3: Experiment Execution Checkpoint

After all experiment design issues (E0-E4) and experiment code issues (E5-E7) are DONE:

  1. Check runability: Verify that the experiment runner script exists and is syntactically valid.
  2. STOP and instruct the user:

```

conda activate <runtime.conda_env>

cd <project_dir>/experiments

python run_all.py --config configs/<config>.yaml

```

  1. Do NOT attempt to run long experiments within the AI session.
  2. Mark experiment execution issues (E8-E10) as TODO with note "awaiting user execution".

Phase 2.4: Structural Figure Generation

After all writing issues (W1-W7) reach DONE, resolve structural diagrams.

These are non-result figures—architecture, pipeline, formulation diagrams

that depend on method design, not on experiment outcomes.

Step 1: Identify required figures

Scan main.tex for \fbox{...placeholder...}. Classify each:

generate now.

Phase 2.5.

Step 2: Generate structural TikZ figures

For each structural placeholder:

  1. Read notes/design/method-components.csv to extract component names,

is_novel flags, and data-flow edges.

  1. Select a pattern from references/figure-generation-guide.md.
  2. Generate a .tikz file under paper/figures/ and replace the \fbox

with \input{figures/<name>.tikz}.

  1. Standard figures for empirical papers (generate at least 2 of 3):

where the method fits. Place in Introduction.

novel parts highlighted. Place in Method.

machine / optimization flow. Place in Problem Formulation or Method.

Step 3: Visual issues tracking

Use V-prefixed issues (V1, V2, ...) in the issues CSV for each figure.

Mark DONE only when the TikZ compiles and is referenced in text.

See references/figure-generation-guide.md for TikZ patterns and style rules.

Gate: All structural \fbox placeholders must be resolved before

Phase 2.5. Result-dependent \fbox pass through to Phase 2.5.

Phase 2.5: Claim Upgrade & Placeholder Resolution

After experiment issues (E*) reach verified status, perform a systematic

upgrade pass. This phase has four mandatory steps.

Step 1: Claim Analysis (mandatory)

For each contribution claim (C0, C1, C2, ...):

  1. Map the claim to its supporting experiments in experiment-matrix.csv.
  2. Check result_status for ALL supporting experiment rows.
  3. Apply the upgrade decision:

| Evidence state | Action |

|----------------|--------|

| ALL experiments verified | Upgrade (hypothesis) → bounded factual claim with specific numbers |

| SOME verified, SOME planned | Upgrade the verified part; note remaining gaps explicitly |

| NONE verified | Keep as (hypothesis) |

  1. When upgrading, write with the verified numbers:

vs. the nearest constrained baseline (0.65%), while maintaining

comparable cost (0.8% higher than MPC)."

  1. Update contribution list in Introduction to reflect upgrades.

See references/abstract-conclusion-guide.md for the claim-upgrade

decision tree and safe-language patterns.

Step 2: Result-dependent Figure Resolution (mandatory)

For each remaining \fbox{...placeholder...} in main.tex:

  1. Check whether the required data exists in paper/results/.
  2. If data exists: generate figure (TikZ plot, table, or pgfplots).
  3. If data does not exist: replace \fbox with an explicit text marker

[Figure pending: <experiment_id> not yet verified].

Step 3: Section Back-fill (mandatory)

For each experiment-matrix.csv row with result_status=verified:

  1. Check whether the corresponding section in main.tex contains actual

results or is still a skeleton.

  1. If skeleton: fill with verified results, tables, and analysis text.
  2. For sections where only SOME experiments are verified: write verified

portions and mark remaining as [Results pending: <experiment_id>].

Step 4: Abstract & Conclusion Completion (mandatory)

  1. Abstract (see references/abstract-conclusion-guide.md):

numbers. Do not write a vague abstract when data exists.

  1. Conclusion (see references/abstract-conclusion-guide.md):

results tables/figures. One sentence per major finding.

(tied to planned/placeholder experiments)

not as a finding.

Gate: Do not proceed to Rhythm Refinement (Phase 2.7) until:

Phase 2.7: Rhythm Refinement

After all writing issues are DONE, refine prose section-by-section using the latex-paper-prose-rhythm skill. This step varies sentence/paragraph lengths and removes filler phrases while preserving all citations.

Phase 3: QA Gate

  1. Run internal QA checklist (see ../latex-paper-survey-writer/references/quality-report.md).
  2. Audit source quality and venue policy:
  1. Compile; ensure no Overfull \hbox warnings in main.log.
  2. Deliver main.tex, ref.bib, figures, and main.pdf.

Runtime Environment

Before running any experiment or utility script:

  1. Read paper.config.yaml → runtime.conda_env or runtime.python.
  2. If conda_env is set, activate it: conda activate <env_name>.
  3. If python is set, use that interpreter directly.
  4. If neither is set, ask the user which conda environment to use.
  5. All subprocess calls should use the configured interpreter, not the system default.

Success Criteria

Compilation: python3 ../latex-paper-survey-writer/scripts/compile_paper.py --project-dir <paper_dir> --check-warnings --fail-on-warnings (exit 0).

Quality Metrics:


Safety & Guardrails

Layout Hygiene

Fix Overfull \hbox warnings before marking issues DONE:


Issues CSV Schema

The empirical issues CSV uses an 18-column schema with experiment-specific fields.

| Column | Purpose |

|--------|---------|

| ID | Issue identifier with phase prefix (R/E/W/RF/Q + number) |

| Phase | One of: Research, Experiment, Writing, Refinement, QA |

| Title | Short description of the deliverable |

| Section_Path | Target section in main.tex (e.g., Introduction > Contributions) |

| Claim_ID | Links to evidence-matrix claim (e.g., C1, C2) |

| Evidence_Type | n/a, citation, experiment, figure, table, mixed |

| Experiment_ID | Links to experiment matrix (e.g., EXP-1) |

| Result_Status | n/a, planned, placeholder, verified |

| Description | Detailed scope of the issue |

| Source_Policy | core, standard, frontier (for citation sourcing) |

| Target_Citations | Minimum citations expected for this issue |

| Visualization | Required figure/table description |

| Acceptance | Criteria for marking DONE |

| Status | TODO, DOING, DONE, SKIP |

| Verified_Citations | Actual verified citation count |

| Depends_On | Semicolon-separated issue IDs that must complete first |

| Must_Verify | yes/no: whether this issue requires evidence verification |

| Notes | Free-form notes |

Phase prefixes: R (Research), E (Experiment), W (Writing), RF (Refinement), Q (QA).

Schema validated by scripts/validate_empirical_paper_issues.py.

References to Read

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.