# Paper Section Writer

> Write mathematical modeling paper sections based only on available problem analysis, model plans, results, figures, and robustness reports.

- **Type:** Skill
- **Install:** `agentstack add skill-zhnnky329-mathmodeling-skills-paper-section-writer`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [zhnnky329](https://agentstack.voostack.com/s/zhnnky329)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [zhnnky329](https://github.com/zhnnky329)
- **Source:** https://github.com/zhnnky329/MathModeling-skills/tree/main/.codex/skills/paper-section-writer

## Install

```sh
agentstack add skill-zhnnky329-mathmodeling-skills-paper-section-writer
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Purpose

Write mathematical modeling paper sections from validated workflow artifacts.

This skill turns the final method explanation, final result analysis, solution package, and figure-table plan into structured paper section drafts. It must keep every claim traceable to an artifact and must not invent data, numerical results, figures, references, or unsupported conclusions.

**CRITICAL**: This skill is gated. It MUST NOT write final paper sections for a subquestion unless all three prerequisites are met (see "Three Critical Rules" below). If prerequisites are missing, this skill must refuse and redirect to the appropriate upstream skill.

This skill does not run models, generate new results, create unsupported figures, perform final QA, or approve final submission.

# When to use

Use this skill:

- After `solution-package-builder` has produced the solution package for a subquestion.
- After `figure-table-planner` has produced the figure-table plan.
- When all three critical rule prerequisites are met for the target subquestion.
- When paper section drafts are needed.
- When existing section drafts need to be aligned with validated artifacts.
- Before `quality-assurance-auditor`.

Do NOT use this skill:
- To write final paper sections for Qx when `methods/Qx/qx_final_method_explanation.md` is missing.
- To write final paper sections for Qx when `results/Qx/reports/qx_final_result_analysis.md` is missing.
- To write final paper sections for Qx when `results/QX/reports/qx_solution_package_for_writer.md` is missing (the writer's primary source).

# Gate G5: Section Quality (NEW — load-bearing for paper external quality)

Beyond the three critical rules (which ensure the right inputs exist), every section drafted by this skill must also pass two output-quality gates before it counts as "drafted". Marketers of completion always claim "已经写完了"; this gate makes "写完" structurally checkable.

## G5.1 Word-count floor (per section type)

Different sections have different minimum substantive lengths. Below these floors, the section is "占位" not "正文":

| Section type | Floor (Chinese chars) | Floor (English words) | Rationale |
|--------------|-----------------------|------------------------|-----------|
| Abstract | 200 | 150 | Must cover problem + method + key result + robustness in 4-6 sentences |
| Problem restatement | 300 | 220 | Background + main goal + subquestions + constraints |
| Problem analysis | 400 | 280 | Decomposition reasoning + dependency map |
| Assumptions | 200 | 150 | Each necessary assumption stated with justification |
| Symbols and definitions | 150 | 100 | Variable list with units; brief |
| Data preprocessing | 300 | 220 | Sources + cleaning ops + risks |
| Model construction (per Qx) | 600 | 450 | Assumptions + symbols + math model + procedure + metrics — this is the longest per-Qx section |
| Model solution (per Qx) | 250 | 180 | Solver + pipeline + computational notes |
| Results analysis (per Qx) | 500 | 380 | Numerical results + interpretation + baseline comparison + figures referenced |
| Method selection narrative (per Qx) | 300 | 220 | Eliminated methods + why-this-method |
| Robustness and sensitivity | 350 | 250 | Stable conclusions + fragile conclusions + perturbation details |
| Strengths and limitations | 300 | 220 | At least 2 strengths + 2 limitations, each tied to evidence |
| Conclusion | 300 | 220 | Direct answer per subquestion + key numbers + limitations |

If a section is below floor, the writer must report it as `status: under_floor` and identify what is missing (which subsection lacks substance), NOT pad with filler prose. Filler prose triggers `paper-polisher` rejection later.

## G5.2 Three-Dimension Discussion Rule (per numerical result)

Every numerical result reported in the paper MUST be accompanied by at least **three discussion dimensions** out of:

1. **Sensitivity / robustness** — how does the number change under ±10% perturbation of weights / inputs / parameters? (sourced from `robustness/Qx/qx_robustness_report.md`) — **AI may draft** from the robustness report.
2. **Physical / domain meaning** — what does the number mean in the real world? Is it large or small? Plausible or surprising? — **AI MUST NOT author this.** This is a graded modeling judgment: whether a number is large/small/plausible is exactly what a judge grades and a student must learn. The AI emits the sentinel `[MODELER INPUT NEEDED: what does this number mean physically — is it large/small/plausible, what does it imply in the real world?]` in the physical-meaning slot and STOPS. A human replaces it.
3. **Baseline comparison** — how does this number compare to the baseline method's number? (sourced from comparison tables in `qx_final_result_analysis.md`) — **AI may draft** from the analysis comparison tables.
4. **Cross-subquestion consistency** — is this number consistent with related numbers from other subquestions? (e.g., total demand from Q2 should ≈ total allocated from Q3) — **AI may draft** from frozen numbers across Qx.
5. **Uncertainty / confidence interval** — what's the confidence range? Standard error? Bootstrap CI? — **AI may draft** from the analysis/robustness artifacts.

A bare claim like "RMSE = 2.4" with no discussion fails this gate. The minimum is 3 of the above 5 dimensions; pick whichever are most defensible from evidence.

**B-layer rule — physical meaning is the human's dimension.** Dimension 2 (physical / domain meaning) counts toward the ≥3 floor ONLY if its slot traces to a human-authored field, i.e. the `[MODELER INPUT NEEDED: ...]` sentinel has been replaced by human prose. A surviving `[MODELER INPUT NEEDED` (or any `[AI-DRAFT`) sentinel in the physical-meaning slot is NOT a covered dimension — it does not count, exactly as a `>>` sentinel fails the C-layer decision gate. If removing the un-replaced physical-meaning slot drops a numerical claim below 3 covered dimensions, that claim FAILS G5.2 and the section is not "drafted". The AI draws the other dimensions (sensitivity from the robustness report, baseline from the analysis, cross-Qx, uncertainty) but never fabricates or finalizes the physical-meaning one to reach the floor.

In the output JSON summary, include a `three_dimension_check` field listing, per numerical claim, which 3+ dimensions were covered AND, for the physical-meaning slot, whether it is `human_authored: true/false` (a `false` value means that dimension does NOT count and the claim may be under the floor).

## G5.3 Three paper seeds the AI may not author (B-layer)

Three high-stakes framing claims are graded judgments — what a judge reads first and weighs most. The AI may draft surrounding prose and mechanics, but MUST NOT originate these three. Each is emitted as a `[MODELER INPUT NEEDED: ...]` sentinel (no AI draft to copy) and a human must supply it before the abstract / Qx section counts as "drafted". A surviving sentinel here is a GATE FAIL, exactly like the physical-meaning slot above.

1. **`key_result_claim` (abstract headline)** — *which* results are the headline of the paper. The AI knows every frozen number but must not decide which one(s) the abstract leads with. In the abstract draft, the headline slot is:
   `[MODELER INPUT NEEDED: which result(s) are the headline of this paper — the number(s) the abstract leads with and why they matter?]`
   The AI may surround it with the frozen numbers it has (so the human picks from real values), but must not pick the headline itself.

2. **`contribution_claim` (what the innovation is)** — what this paper's contribution / innovation actually is. This is graded contribution, not a mechanical summary. In the abstract and/or strengths section, the contribution slot is:
   `[MODELER INPUT NEEDED: what is this paper's contribution / innovation — what did we do that is new or better, in your own words?]`
   The AI must NOT generalize "we built a model and it worked" into a contribution claim.

3. **`why_this_method` (per Qx) — TRANSCRIBED, not re-authored** — the justification for the chosen method must NOT be re-authored by the AI from the method explanation. It is **transcribed verbatim** from the human's decision log at `methods/Qx/qx_decision_log.md`, with a provenance marker `` pointing to the specific decision entry. The method-selection narrative slot is:
   `[MODELER INPUT NEEDED: transcribe the "why this method over the rejected ones" rationale from methods/Qx/qx_decision_log.md and tag it  with the source decision id. Do NOT re-author this from the method explanation.]`
   If `methods/Qx/qx_decision_log.md` is missing or has no entry for the method choice, the why-this-method slot stays a sentinel (gate FAIL) — route to `modeler-decision-logger`. The AI may quote/restate the *mechanics* of the method (assumptions, symbols, procedure) from the final method explanation, but the *judgment* ("why this over the alternatives") must carry the `` provenance marker and trace to a human decision entry. A why-this-method paragraph with no provenance marker fails this gate.

In the output JSON summary, add a `paper_seeds` field reporting, per seed, `present: true/false` and (for `why_this_method`) the `provenance_marker` transcribed. Any seed `present: false` (surviving sentinel) means the affected section is NOT "drafted".

# Three Critical Rules (Enforced as Hard Gates)

This skill MUST enforce these three rules. Violation of any rule means the skill must refuse to write final paper sections and redirect.

## Rule 1: No final paper writing without final method explanation

```
GATE CHECK: methods/Qx/qx_final_method_explanation.md MUST exist.
```

If missing: Stop. Do NOT write the paper section for Qx. The paper writer cannot write the model construction section without knowing the final method, its assumptions, symbols, and mathematical specification. Redirect to `workflow-orchestrator` with a clear blocker report.

The paper writer MAY write a partial draft for other sections that don't depend on the final method (e.g., problem restatement), but MAY NOT write the model construction or results analysis sections.

## Rule 2: No writer handoff without final result analysis

```
GATE CHECK: results/Qx/reports/qx_final_result_analysis.md MUST exist.
```

If missing: Stop. Do NOT write the results analysis section for Qx. Raw experiment outputs are not sufficient — the results must have been analyzed and interpreted by the programmer. Redirect to `workflow-orchestrator` with a clear blocker report.

## Rule 3: Writer reads primarily from the solution package

```
GATE CHECK: results/Qx/reports/qx_solution_package_for_writer.md MUST exist.
```

If missing: Stop. Do NOT write the paper section for Qx by hunting through scattered results and method notes. The solution package is the writer's curated source. If it's missing, the subquestion is NOT Ready for Writer. Redirect to `workflow-orchestrator` or `solution-package-builder`.

# Preconditions

The following must exist before writing final paper sections for a subquestion:

**REQUIRED (hard gates — verified at start)**:
1. `methods/Qx/qx_final_method_explanation.md`
2. `results/Qx/reports/qx_final_result_analysis.md`
3. `results/Qx/reports/qx_solution_package_for_writer.md`

**Also required for complete sections**:
- `methods/Qx/qx_figure_table_plan.md` (figure and table plan).
- Actual figure files referenced in the solution package (must exist on disk).
- Robustness report at `robustness/Qx/qx_robustness_report.md` (for robustness section).
- A validated problem parse (for problem restatement).
- Contest formatting requirements (if available).

**For global sections** (abstract, problem restatement, assumptions, symbols, conclusion):
- All subquestion final method explanations (for symbols and assumptions).
- All subquestion final result analyses (for abstract and conclusion).

If any hard gate is missing, this skill must refuse and report which gate failed.

# Inputs

Use or request (for Qx paper section):

**Primary sources (read first)**:
- `results/Qx/reports/qx_solution_package_for_writer.md` — THE primary source for the writer.
- `methods/Qx/qx_final_method_explanation.md` — method details.
- `results/Qx/reports/qx_final_result_analysis.md` — result details.

**Supporting sources**:
- `methods/Qx/qx_figure_table_plan.md` — figure/table assignments.
- `methods/Qx/qx_method_candidates.md` — for method selection narrative.
- `methods/Qx/qx_method_iteration_log.md` — for iteration history context.
- `robustness/Qx/qx_robustness_report.md` — for robustness section.
- Existing paper section drafts under `paper/sections/`, if any.
- Global symbol table and model assumptions (from `planning/`).
- Problem parse and classification artifacts.
- Contest paper structure or formatting notes.

# Workflow

1. **GATE CHECK: Verify prerequisites.**
   - Before anything else, check that all three hard-gate files exist for the target subquestion.
   - If any is missing, STOP immediately and report which gate failed. Do not proceed.
   - If all gates pass, proceed to step 2.

2. Read the solution package first.
   - The solution package is the writer's primary source. It summarizes everything.
   - Use it to understand the overall narrative before diving into detailed source files.
   - Follow its section mapping, claims inventory, and figure assignments.

3. Gather the detailed sources.
   - Read the final method explanation for model details.
   - Read the final result analysis for numerical claims.
   - Read the figure-table plan for visual assignments.
   - Read the robustness report for sensitivity claims.

4. Build a section map.
   - Map each subquestion to the paper sections that should answer it.
   - Map each model to its assumptions, variables, equations, results, figures, and tables.
   - Map each major claim to a supporting artifact from the solution package's claims inventory.

5. Draft standard paper sections.
   - Write only the sections requested or appropriate for the current workflow stage.
   - Keep the writing concise, technical, and evidence-based.
   - Avoid filler prose.
   - For each section, verify that every claim is traceable to an artifact.

6. Maintain artifact traceability.
   - Every numerical claim must point to a result artifact.
   - Every figure or table reference must appear in the figure-table plan or existing files.
   - Every robustness claim must point to a robustness artifact.
   - Every model description must align with the final method explanation.
   - Use the solution package's claims inventory to verify each claim.

7. Write formulas and symbols carefully.
   - Use mathematical notation only when variables are defined in the final method explanation.
   - Keep notation consistent with the global symbol table.
   - Do not introduce new variables without defining them.

8. Handle missing evidence explicitly.
   - If a result, figure, table, or robustness check is missing, mark the section as incomplete.
   - Do not fill gaps with invented values or generic claims.
   - Recommend the upstream skill needed to complete the missing evidence.

9. Produce section drafts.
   - Save drafts under `paper/sections/`.
   - Use section-oriented file names: `q1.tex` or `q1.md`, `abstract.tex`, `assumptions.tex`, etc.
   - Preserve a clear link between drafts and source artifacts.

10. Recommend final audit.
    - After section drafts are complete enough, hand off to `quality-assurance-auditor`.

# Outputs

Produce paper section drafts and a writing summary:

- `paper/sections/abstract.tex` or `.md`
- `paper/sections/problem_restatement.tex`
- `paper/sections/problem_analysis.tex`
- `paper/sections/assumptions.tex`
- `paper/sections/symbols.tex`
- `paper/sections/data_preprocessing.tex`
- `paper/sections/q1.tex`
- `paper/sections/q2.tex`
- `paper/sections/q3.tex`
- `paper/sections/q4.tex`
- `paper/sections/robustness.tex`
- `paper/sections/strengths_limitations.tex`
- `paper/sections/conclusion.tex`
- Section-to-artif

…

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [zhnnky329](https://github.com/zhnnky329)
- **Source:** [zhnnky329/MathModeling-skills](https://github.com/zhnnky329/MathModeling-skills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-zhnnky329-mathmodeling-skills-paper-section-writer
- Seller: https://agentstack.voostack.com/s/zhnnky329
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
