Refactor Structure
Fix the architecture of the argument, not its words. A paper can be
grammatical, on-template, and within the page limit and still fail because the
story is assembled in the wrong order, a section doesn't do its job, the
introduction promises things the body never delivers, or the conclusion
outruns the evidence. This skill diagnoses those problems and produces a
restructuring plan — move / merge / split / cut, with the reasoning for
each — that the author approves before a single section is rewritten.
It plans and (on approval) executes the moves. It does not reword sentences
(that is polish-prose) and it does not fit the paper to a venue's rules
(that is tailor-to-venue).
When to use
- "The structure feels off" / "it doesn't flow" / "reorganize my paper".
- Reviewers said: hard to follow, disorganized, the story is unclear, the
contribution is buried, related work is in the wrong place, a section
doesn't belong.
- The intro over-promises (claims a proof / user study / ablation the body
doesn't contain), or the conclusion claims something never evidenced.
- Redundant sections (two Background sections), or one section doing two jobs
(Results carrying Threats-to-Validity).
Not for: sentence wording / de-AI-ifying (polish-prose), page limits /
templates / track fit (tailor-to-venue), the Related Work section's content
(draft-related-work), or whether the citations are real (verify-citations).
Inputs
- The draft: main
.tex file (the script follows \input/\include).
- Optional: the paper's intended contribution list and target paper type, from
.paper-memory/profile.yml if present (a theory paper and an empirical paper
have different expected arcs). If absent, ask the author for the one-sentence
claim and the contribution bullets.
Process
1. Read the structure, don't re-read the paper
Run the bundled extractor to get the skeleton on one screen:
python3 skills/refactor-structure/scripts/outline_extract.py <main.tex>
It prints the section/subsection tree, each unit's first sentence (the
topic sentence — where a well-built section announces its job), and per-unit
signals (word count, citations, whether it carries floats/equations/lists,
units that open with no topic sentence). Use --md to drop the skeleton
into the plan, --json to drive your own analysis, --no-inputs to run on a
single section file. Exit 2 on bad input. This is a structure map, not a
verdict — it tells you what is where; the diagnosis below is the judgment.
2. Establish the intended arc
Before judging order, know what the paper is trying to argue. Read the
contribution bullets and the abstract's claim. Write down, in one line each:
the problem, the claimed contribution(s), the evidence that should back each
contribution, and the conclusion each contribution licenses. This is the spine
every later check measures against.
3. Diagnose against the architecture checklist
Work through references/architecture-checklist.md,
which covers the seven failure modes (wrong order, a section not doing its job,
gaps, redundancy, misplaced content, intro/body mismatch, a broken
contribution -> evidence -> conclusion arc) and the standard section arcs by
paper type. The two highest-value, most objective checks:
- Promise-vs-delivery. For every contribution bullet and every "we
show / we prove / we evaluate" in the intro, find the section that delivers
it. A promised proof, user study, or ablation with no home section is a
gap the reader (and reviewer) will hold against the paper. Conversely, list
any major result section the intro never advertised.
- Conclusion-vs-evidence. Every claim in the conclusion must trace back to
a result in the body. A conclusion that introduces a new claim (e.g.
"scales to any number of nodes" with no scaling experiment) is an
arc break — flag it as either "remove the claim" or "the body is missing the
experiment that would support it."
See references/diagnosis-patterns.md for
how each symptom maps to a concrete remedy (move / merge / split / cut) and the
ripple effects to check (forward references, "as we show in Section~X" pointers,
a cut section's surviving citations).
4. Write the restructuring plan (the author approves it before any edit)
Produce, do not apply. Write paper-workspace/writing/restructuring-plan.md
with:
- Current skeleton — the
--md outline from step 1.
- Intended arc — the spine from step 2.
- Diagnosis — findings grouped by failure mode, each with: what's wrong,
why it hurts the argument, severity (blocks comprehension / weakens it /
minor), and the proposed remedy.
- Proposed skeleton — the section tree after the plan, so the author
sees the new order at a glance.
- Ordered move list — each move/merge/split/cut as a discrete, reversible
step with its ripple effects, sequenced so the document stays coherent
between steps.
Present the diagnosis with the cheaper path called out:
often a reorder plus two merges fixes more than a rewrite. Where a symptom has
more than one reading — is the user study missing, or just unlabeled? — show
both and ask; never silently assume a section is
absent when it might live in an \input file.
5. Execute on approval, one step at a time
Only after the author signs off, apply the moves in order. After each
structural change, re-run outline_extract.py to confirm the skeleton matches
the proposed one, and fix the ripple effects the plan listed (cross-references,
"see Section~X" pointers, a moved section's label). Moving prose is mechanical;
do not silently reword it — flag any sentence that needs new connective tissue
for the author (or hand it to polish-prose). A reference orphaned by a cut
(a now-dangling \cite) routes through verify-citations; a claim left
without evidence — e.g. the conclusion-vs-evidence break in step 3 — routes
through verify-claims for a proper claim→evidence audit. Never invent a
citation or a result to patch either.
Output
- A reviewable
paper-workspace/writing/restructuring-plan.md: current
skeleton -> intended arc -> diagnosis -> proposed skeleton -> ordered moves.
- On approval, the applied moves with a re-extracted skeleton confirming the
result and a ripple-effect checklist (cross-refs, pointers, labels).
- The author decides every move; nothing is rewritten at sentence level here.
Adapt to your discipline
The failure modes are field-agnostic; the expected arc is not.
references/architecture-checklist.md
gives CS-paper arcs (systems / ML-empirical / theory). Fork it for your field:
IMRaD for experimental science, a different placement of Related Work, a
Methods-before-Results vs. interleaved convention, or essay-style argument
structure in the humanities.
Guardrails
- Plan before you touch the paper. Diagnosis and the move list come first;
the author approves before any section is moved, merged, split, or cut.
- It restructures; it does not reword. Sentence-level edits are
polish-prose;
venue/track/page fit is tailor-to-venue. Do not silently rewrite moved
prose — flag seams for the author.
- Never fabricate a result, section, or citation to "fill a gap." A missing
user study is reported as missing; the fix is to add the work or drop the
promise, never to invent it.
- Never delete content the author may want; a cut is a proposal, and cut text
is preserved (note where it went) so it is recoverable.
- Diagnosis is from reading the structure, not from a venue rule or memory; the
extractor's output and the draft are ground truth. It never claims the
restructure will get the paper accepted.
- Never submit anything anywhere on the author's behalf.
Relationship to other skills
tailor-to-venue — venue/track fit, page budget, template, blind level.
Run after the argument is sound; structure-then-fit, not the reverse.
polish-prose — sentence-level wording, hedging, AI-tells. Run after the
structure is settled, so you polish prose you're keeping.
draft-related-work — the content of the Related Work section; this skill
only decides where that section sits and whether it does its job.
verify-claims — when a conclusion claim outruns the evidence (an arc
break), this skill flags the structural break; verify-claims audits whether
the claim is actually supported. verify-citations is the separate check that
a .bib entry resolves (e.g. a reference orphaned by a cut).
simulate-reviewers / assess-paper — if a mock review flagged "hard to
follow", this skill is the fix.
Memory
Uses the shared .paper-memory/ convention in the user's paper directory
(full spec: paper-memory-convention.md).
- At start: read
profile.yml (paper type sets the expected arc) and
lessons.md — lead with any recurring structural habit already recorded
(e.g. "you habitually bury Threats to Validity in Results") so you check for
it first.
- At end: append durable findings via
reflect-and-improve's
reflect_log.py append in the shared format - [YYYY-MM-DD] (refactor-structure | <scope>) pattern -> recommendation. A habit seen
across drafts is recurring; a one-off is this-paper. Don't log routine
single moves.
- Create
.paper-memory/ on demand and offer to add it to the project
.gitignore; it is local-only and never uploaded or copied into this repo.
1---2name: refactor-structure3description: Diagnoses and fixes a paper's argument architecture and narrative flow, independent of any venue. Checks whether the story is built in the right order, whether each section does its job, whether the intro promises what the body delivers, and whether the contribution -> evidence -> conclusion arc holds — then produces a restructuring plan (move / merge / split / cut sections) the author approves BEFORE anything is rewritten. Use when a researcher says "the structure is off", "it doesn't flow", "reviewers said it's hard to follow / disorganized / the story is unclear", "my intro over-promises", "related work is in the wrong place", "this section doesn't belong here", "reorganize my paper", "fix the narrative", or "the contributions don't match the results". Distinct from tailor-to-venue (venue/track fit, page limits, templates) and polish-prose (sentence-level wording). Bundles outline_extract.py to print the section tree + each section's opening sentence so the architecture is reviewable at a glance.4---56# Refactor Structure78Fix the *architecture* of the argument, not its words. A paper can be9grammatical, on-template, and within the page limit and still fail because the10story is assembled in the wrong order, a section doesn't do its job, the11introduction promises things the body never delivers, or the conclusion12outruns the evidence. This skill diagnoses those problems and produces a13**restructuring plan** — move / merge / split / cut, with the reasoning for14each — that the author approves before a single section is rewritten.1516It plans and (on approval) executes the moves. It does not reword sentences17(that is `polish-prose`) and it does not fit the paper to a venue's rules18(that is `tailor-to-venue`).1920## When to use2122- "The structure feels off" / "it doesn't flow" / "reorganize my paper".23- Reviewers said: hard to follow, disorganized, the story is unclear, the24 contribution is buried, related work is in the wrong place, a section25 doesn't belong.26- The intro over-promises (claims a proof / user study / ablation the body27 doesn't contain), or the conclusion claims something never evidenced.28- Redundant sections (two Background sections), or one section doing two jobs29 (Results carrying Threats-to-Validity).3031Not for: sentence wording / de-AI-ifying (`polish-prose`), page limits /32templates / track fit (`tailor-to-venue`), the Related Work section's *content*33(`draft-related-work`), or whether the citations are real (`verify-citations`).3435## Inputs3637- The draft: main `.tex` file (the script follows `\input`/`\include`).38- Optional: the paper's intended contribution list and target paper type, from39 `.paper-memory/profile.yml` if present (a theory paper and an empirical paper40 have different expected arcs). If absent, ask the author for the one-sentence41 claim and the contribution bullets.4243## Process4445### 1. Read the structure, don't re-read the paper4647Run the bundled extractor to get the skeleton on one screen:4849```50python3 skills/refactor-structure/scripts/outline_extract.py <main.tex>51```5253It prints the section/subsection tree, each unit's **first sentence** (the54topic sentence — where a well-built section announces its job), and per-unit55signals (word count, citations, whether it carries floats/equations/lists,56units that open with *no* topic sentence). Use `--md` to drop the skeleton57into the plan, `--json` to drive your own analysis, `--no-inputs` to run on a58single section file. Exit 2 on bad input. This is a **structure map, not a59verdict** — it tells you what is where; the diagnosis below is the judgment.6061### 2. Establish the intended arc6263Before judging order, know what the paper is *trying* to argue. Read the64contribution bullets and the abstract's claim. Write down, in one line each:65the problem, the claimed contribution(s), the evidence that should back each66contribution, and the conclusion each contribution licenses. This is the spine67every later check measures against.6869### 3. Diagnose against the architecture checklist7071Work through [references/architecture-checklist.md](references/architecture-checklist.md),72which covers the seven failure modes (wrong order, a section not doing its job,73gaps, redundancy, misplaced content, intro/body mismatch, a broken74contribution -> evidence -> conclusion arc) and the standard section arcs by75paper type. The two highest-value, most objective checks:7677- **Promise-vs-delivery.** For every contribution bullet and every "we78 show / we prove / we evaluate" in the intro, find the section that delivers79 it. A promised proof, user study, or ablation with no home section is a80 gap the reader (and reviewer) will hold against the paper. Conversely, list81 any major result section the intro never advertised.82- **Conclusion-vs-evidence.** Every claim in the conclusion must trace back to83 a result in the body. A conclusion that introduces a *new* claim (e.g.84 "scales to any number of nodes" with no scaling experiment) is an85 arc break — flag it as either "remove the claim" or "the body is missing the86 experiment that would support it."8788See [references/diagnosis-patterns.md](references/diagnosis-patterns.md) for89how each symptom maps to a concrete remedy (move / merge / split / cut) and the90ripple effects to check (forward references, "as we show in Section~X" pointers,91a cut section's surviving citations).9293### 4. Write the restructuring plan (the author approves it before any edit)9495Produce, do not apply. Write `paper-workspace/writing/restructuring-plan.md`96with:97981. **Current skeleton** — the `--md` outline from step 1.992. **Intended arc** — the spine from step 2.1003. **Diagnosis** — findings grouped by failure mode, each with: what's wrong,101 why it hurts the argument, severity (blocks comprehension / weakens it /102 minor), and the proposed remedy.1034. **Proposed skeleton** — the section tree *after* the plan, so the author104 sees the new order at a glance.1055. **Ordered move list** — each move/merge/split/cut as a discrete, reversible106 step with its ripple effects, sequenced so the document stays coherent107 between steps.108109Present the diagnosis with the cheaper path called out:110often a reorder plus two merges fixes more than a rewrite. Where a symptom has111more than one reading — *is* the user study missing, or just unlabeled? — show112both and ask; never silently assume a section is113absent when it might live in an `\input` file.114115### 5. Execute on approval, one step at a time116117Only after the author signs off, apply the moves in order. After each118structural change, re-run `outline_extract.py` to confirm the skeleton matches119the proposed one, and fix the ripple effects the plan listed (cross-references,120"see Section~X" pointers, a moved section's label). Moving prose is mechanical;121do not silently reword it — flag any sentence that needs new connective tissue122for the author (or hand it to `polish-prose`). A reference orphaned by a cut123(a now-dangling `\cite`) routes through `verify-citations`; a claim left124without evidence — e.g. the conclusion-vs-evidence break in step 3 — routes125through `verify-claims` for a proper claim→evidence audit. Never invent a126citation or a result to patch either.127128## Output129130- A reviewable `paper-workspace/writing/restructuring-plan.md`: current131 skeleton -> intended arc -> diagnosis -> proposed skeleton -> ordered moves.132- On approval, the applied moves with a re-extracted skeleton confirming the133 result and a ripple-effect checklist (cross-refs, pointers, labels).134- The author decides every move; nothing is rewritten at sentence level here.135136## Adapt to your discipline137138The failure modes are field-agnostic; the *expected arc* is not.139[references/architecture-checklist.md](references/architecture-checklist.md)140gives CS-paper arcs (systems / ML-empirical / theory). Fork it for your field:141IMRaD for experimental science, a different placement of Related Work, a142Methods-before-Results vs. interleaved convention, or essay-style argument143structure in the humanities.144145## Guardrails146147- **Plan before you touch the paper.** Diagnosis and the move list come first;148 the author approves before any section is moved, merged, split, or cut.149- It restructures; it does not reword. Sentence-level edits are `polish-prose`;150 venue/track/page fit is `tailor-to-venue`. Do not silently rewrite moved151 prose — flag seams for the author.152- Never fabricate a result, section, or citation to "fill a gap." A missing153 user study is reported as missing; the fix is to add the work or drop the154 promise, never to invent it.155- Never delete content the author may want; a cut is a *proposal*, and cut text156 is preserved (note where it went) so it is recoverable.157- Diagnosis is from reading the structure, not from a venue rule or memory; the158 extractor's output and the draft are ground truth. It never claims the159 restructure will get the paper accepted.160- Never submit anything anywhere on the author's behalf.161162## Relationship to other skills163164- `tailor-to-venue` — venue/track fit, page budget, template, blind level.165 Run *after* the argument is sound; structure-then-fit, not the reverse.166- `polish-prose` — sentence-level wording, hedging, AI-tells. Run *after* the167 structure is settled, so you polish prose you're keeping.168- `draft-related-work` — the *content* of the Related Work section; this skill169 only decides where that section sits and whether it does its job.170- `verify-claims` — when a conclusion claim outruns the evidence (an arc171 break), this skill flags the structural break; `verify-claims` audits whether172 the claim is actually supported. `verify-citations` is the separate check that173 a `.bib` entry resolves (e.g. a reference orphaned by a cut).174- `simulate-reviewers` / `assess-paper` — if a mock review flagged "hard to175 follow", this skill is the fix.176177## Memory178179Uses the shared `.paper-memory/` convention in the user's paper directory180(full spec: [`paper-memory-convention.md`](../paper-profile/references/paper-memory-convention.md)).181182- **At start:** read `profile.yml` (paper type sets the expected arc) and183 `lessons.md` — lead with any recurring structural habit already recorded184 (e.g. "you habitually bury Threats to Validity in Results") so you check for185 it first.186- **At end:** append durable findings via `reflect-and-improve`'s187 `reflect_log.py append` in the shared format `- [YYYY-MM-DD]188 (refactor-structure | <scope>) pattern -> recommendation`. A habit seen189 across drafts is `recurring`; a one-off is `this-paper`. Don't log routine190 single moves.191- Create `.paper-memory/` on demand and offer to add it to the project192 `.gitignore`; it is local-only and never uploaded or copied into this repo.