---
name: lit-review-writer
description: "Interactive workflow for systematic literature review and synthesis writing. Use when the user wants to survey a research topic, write a literature review, conduct a systematic review, or summarize the state of a field. Guides through 5 phases with 4 user-confirmation checkpoints: parameter collection, literature search (3 rounds), outline via temporal-comparative analysis, section-by-section writing, Word export. Output is Markdown draft confirmed by user then exported as .docx. No LaTeX. Triggered by phrases like 'write a literature review on', 'survey the literature on', 'do a systematic review of', 'summarize the field of'."
allowed-tools: Read Write Edit Bash WebSearch WebFetch
---

# Literature Review Writer

Interactive, checkpoint-driven workflow for systematic literature review and synthesis. Never advances to the next phase without explicit user confirmation.

**Output path**: Markdown draft → user confirms → Word document (.docx) in current working directory.  
**No LaTeX**: all formatting in standard Word styles.

---

## Global Rules

- One phase at a time. Complete each phase fully before showing the checkpoint.
- At every checkpoint, explicitly ask: "Does this look right? Please confirm to proceed, or tell me what to change."
- If a search returns fewer results than requested, report the actual count and ask whether to proceed or broaden the search.
- All speculation or unverifiable claims in the written text must be flagged with "(unverified)" or "likely" — never stated as fact.

---

## Phase 0 — Parameter Collection

Ask the following one at a time (wait for each answer before asking the next):

1. "What is the research topic you want me to review? The more specific, the better."
2. "Which research domain does this fall under? (a) Life sciences / medicine  (b) Computer science / AI  (c) Earth & environmental sciences  (d) Social sciences / humanities  (e) Other — please describe"
3. "What time range should I focus on? For example: 'last 5 years', '2015–2024', or 'all time'."
4. "How many references are you targeting? I suggest 20–60 for a focused review; more for a comprehensive one."
5. "Which citation format? (a) APA  (b) Nature / Vancouver (numbered)  (c) Chicago author-date"
6. "Should I write in (a) English or (b) Chinese?"

**Checkpoint 1**: Display a summary table of all six parameters:

```
Topic:           [answer]
Domain:          [answer]
Time range:      [answer]
Target refs:     [answer]
Citation style:  [answer]
Language:        [answer]
```

Say: "These are the parameters I'll use. Does everything look right? Reply 'yes' to proceed, or tell me what to change."

Do not start Phase 1 until the user confirms.

---

## Phase 1 — Literature Search

Execute three rounds of search. Invoke the `paper-lookup` skill and the `research-lookup` skill for database searches; use `WebSearch` and `WebFetch` for supplemental web searches.

### Round 1 — Core literature
Search PubMed, arXiv, Semantic Scholar, and Google Scholar using the main topic keywords. Aim for the top papers by relevance and citation count within the specified time range.

### Round 2 — Snowballing
From the 5 highest-cited papers found in Round 1, extract their reference lists. Add any papers that are (a) within the time range and (b) not already in the list.

### Round 3 — Recent developments
Restrict search to the last 1–2 years only. Target preprints and newly published work not yet highly cited. Use arXiv and bioRxiv in addition to standard databases.

### Recording format
For every paper collected, record:
```
| Title | First Author | Year | Source | DOI or URL | Relevance (1–5) | One-line summary |
```

Relevance scoring guide:
- 5: Directly addresses the topic; must cite
- 4: Closely related; highly relevant
- 3: Tangentially relevant; useful context
- 2: Weak connection; borderline
- 1: Not relevant

### Auto-filtering
- Score ≥ 3 → **Main list**
- Score < 3 → **Pending list** (shown separately, user decides)

**Checkpoint 2**: Display the main list as a markdown table, then the pending list beneath it. Say:

"Here are the papers I found. The main list has [N] papers. The pending list has [M] papers with lower relevance scores — let me know if you want to include any of them.

You can:
- Remove any paper from the main list by number
- Promote papers from the pending list
- Ask me to do a supplemental search on a specific sub-topic
- Reply 'proceed' when the list looks right"

Do not start Phase 2 until the user confirms.

---

## Phase 2 — Outline Generation

Generate the outline using the **Temporal-Comparative Analysis** (横纵分析法) framework below. The outline has a fixed skeleton with an adaptive main body.

### Temporal-Comparative Analysis Framework

This framework structures the review around two analytical axes that are then synthesized:

**Longitudinal axis (纵向 — development narrative)**:
- Trace the research direction from its origins to the present
- Cover: origin background, founding works, key paradigm shifts, decision logic at each turning point
- Narrative style: cause-and-effect story, not a dry chronological list
- Weave in key papers, authors, and institutions as characters in the narrative
- For each major transition: explain *why* the field moved in that direction, what constraints existed, what alternatives were rejected

**Synchronic axis (横向 — current landscape)**:
- Snapshot of the field at the present moment
- First, classify the competitive landscape:
  - Scenario A (no competing approaches): explain why — is the area too new, too niche, or too dominated by one paradigm? What indirect alternatives exist?
  - Scenario B (1–2 competing approaches): deep comparison of each
  - Scenario C (3+ competing approaches): select 3–5 most representative; briefly mention others
- Comparison dimensions (adapt to the topic):
  - Technical approach / underlying methodology
  - Applicable scenarios and target problems
  - Strengths and clear limitations
  - Community adoption: citation patterns, which groups use which approach, known controversies
  - Niche position: does each approach fill a gap or compete head-on?

**Convergence (横纵交汇)**:
- Combine both axes into a new integrated judgment
- This is NOT a summary of prior sections — it must offer new synthesis
- Answer: Where does this field stand historically? What is the most likely site of the next paradigm shift?

### Outline Template

```
1. Abstract

2. Introduction
   2.1 Research background and significance
   2.2 Scope and objectives of this review
   2.3 Structure of this paper

── LONGITUDINAL AXIS ──────────────────────────────────────────
3. Origins and Foundations
   — What problem or need gave birth to this research direction?
   — Who were the founding contributors? What was the intellectual context?
   — [List reference numbers to cite here]

4. Evolution of the Field
   — Narrative of key paradigm shifts (not a list of dates)
   — For each major transition: what changed, why, what was abandoned
   — [List reference numbers to cite here]

── SYNCHRONIC AXIS ────────────────────────────────────────────
5. Current Approaches and Comparative Landscape
   5.1 [Approach / School A]
       — Technical approach, applicable scenarios, strengths, limitations
       — Community reception and adoption
   5.2 [Approach / School B] (if Scenario B or C)
   5.3 [Approach / School C] (if Scenario C)
   5.4 Niche and ecosystem analysis
   [List reference numbers per subsection]

── CONVERGENCE ────────────────────────────────────────────────
6. Challenges and Research Gaps
   — New integrated synthesis from both axes
   — Specific open problems with evidence
   [List reference numbers]

7. Future Directions
   — Grounded predictions based on longitudinal + synchronic analysis
   [List reference numbers]

8. Conclusion

9. References
```

### Annotations per section
For each section in the outline, add:
- Reference numbers from the confirmed list that will be cited
- A 1–2 sentence note on the core argument to be made

### Writing style constraints (enforced in Phase 3)
- Longitudinal sections: narrative-driven prose, cause-effect structure, no bullet-point chronologies
- Synchronic sections: core analysis in prose; tables permitted only as supplementary aids
- Plain language: no consultant jargon ("empower", "synergy", "ecosystem play")
- Every evaluative claim must be backed by a citation or labeled as the author's inference
- Speculation must be explicitly flagged: "This suggests…", "It is possible that…", "(unverified)"

**Checkpoint 3**: Display the full annotated outline. Say:

"Here is the outline structured around the temporal-comparative framework. You can:
- Reorder or rename sections
- Merge or split sections
- Adjust which references go where
- Change the argument direction for any section
- Reply 'proceed' when the outline looks right"

Do not start Phase 3 until the user confirms.

---

## Phase 3 — Full Text Writing (Markdown)

Write section by section. For each section, follow this sequence:

```
① State the core argument of this section in 2–3 sentences
   → Ask: "Is this the right direction for this section?"
   → Wait for confirmation before writing the full text
   → If the user says no or proposes a different direction: ask them to state the intended direction, revise the 2–3 sentence summary accordingly, and ask for confirmation again before writing

② Write full paragraphs (no bullet lists in body text)

③ Embed inline citations in the user-selected format
   APA example:    (Smith & Jones, 2021)
   Vancouver:      [1], [2]
   Chicago:        (Smith 2021)

④ After writing the section, ask:
   "Section complete. Shall I: (a) continue to the next section,
   (b) revise this section, or (c) add more references here?"
```

### Special handling: Section 6 (Convergence)
This section must not summarize Sections 3–5. It must:
- Synthesize the longitudinal narrative with the synchronic landscape
- Deliver a judgment on where the field currently stands in its historical arc
- Identify the most likely source of the next paradigm shift, with evidence
- Be as opinionated as the evidence allows; label inferences clearly

### Reference shortfall rule
If any section has fewer than 2 supporting references from the confirmed list, pause and say: "This section has limited citation support. I can (a) proceed with a note that more references are needed, (b) do a targeted search for more papers on [specific sub-topic], or (c) merge this section into an adjacent one."

**Checkpoint 4**: After all sections are written, display the complete Markdown document. Say:

"Here is the full draft. You can:
- Request edits to any section (quote the section heading)
- Ask me to expand or compress any section
- Add or remove references
- Reply 'export' when ready to generate the Word document"

Do not start Phase 4 until the user says 'export' or equivalent confirmation.

---

## Phase 4 — Export to Word (.docx)

Invoke the `docx` skill to convert the confirmed Markdown to a formatted Word document. If the `docx` skill is unavailable or the export fails, inform the user: "The Word export encountered an issue. Your complete Markdown draft is available in this conversation — you can copy it to any Markdown editor or use an online Markdown-to-Word converter (e.g., Pandoc, Word's built-in import)."

Document structure:
- Title page: review title, date, citation format used
- Auto-generated table of contents
- Body: heading hierarchy (H1 for numbered sections, H2 for subsections), 12pt body text, 1.5 line spacing
- References section: formatted per user-selected citation style, numbered or author-year

Output filename: `[topic-slug]_literature_review_[YYYY-MM-DD].docx` where `topic-slug` is a short, filesystem-safe version of the topic (lowercase, hyphens instead of spaces, max 30 chars)
Save to: current working directory

After export, say: "Your literature review has been saved as `[filename].docx` in the current directory. The Markdown draft is also available in this conversation if you need to make further edits."

---
