# snl-ucsb/paper-writing-skill architecture

> Architecture diagram of the GitHub repository snl-ucsb/paper-writing-skill, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/snl-ucsb/paper-writing-skill
- Repository: https://github.com/snl-ucsb/paper-writing-skill

## Overview

This repository is a Claude Code skill and reusable set of Markdown methods for research-paper writing, not a conventional application. A researcher invokes the skill, creates or reuses a project context, then develops and refines a paper through the documented pipeline. The graph preserves the alternate story-mode entry, editorial gates and iterative red-team loop, plus the separate figure-synthesis workflow and customizable rules. Relationships are based on the README; source excerpts were not provided, so implementation-level calls cannot be verified.

Main entry points: [`SKILL.md`](https://github.com/snl-ucsb/paper-writing-skill/blob/main/SKILL.md) (Section drafting), [`red_team_protocol.md`](https://github.com/snl-ucsb/paper-writing-skill/blob/main/red_team_protocol.md) (Red team), [`figure_synthesis_guide.md`](https://github.com/snl-ucsb/paper-writing-skill/blob/main/figure_synthesis_guide.md) (Figure workflow), [`loop_mode.md`](https://github.com/snl-ucsb/paper-writing-skill/blob/main/loop_mode.md) (Audit loop)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Paper workflow"]
  node_skill["Skill entry<br/>[SKILL.md]"]
  node_story["Story mode<br/>[story_mode.md]"]
  node_brainstorm["Brainstorming"]
  node_context["Project context<br/>[project_context.md]"]
  node_architecture["Paper architecture<br/>[SKILL.md]"]
  node_drafting["Section drafting<br/>[SKILL.md]"]
  node_integration["Integration<br/>[SKILL.md]"]
  node_compression["Compression"]
end

subgraph group_quality["Editorial quality"]
  node_mechanical["Mechanical gate<br/>[gate_mechanical.md]"]
  node_semantic["Semantic gate<br/>[gate_semantic.md]"]
  node_craft["Craft reference<br/>[craft_reference.md]"]
  node_redteam["Red team"]
  node_loop["Audit loop<br/>[loop_mode.md]"]
end

subgraph group_figures["Figure synthesis"]
  node_figure_workflow["Figure workflow"]
  node_figure_templates["Figure templates"]
end

subgraph group_customization["Rules and guidance"]
  node_editorial["Editorial principles"]
  node_moves["Rhetorical moves"]
  node_section_moves["Section move guides<br/>[introduction.md]"]
  node_checklists["Writing checklists<br/>[intro_questions.md]"]
  node_interventions["Intervention types"]
end

node_researcher(("Researcher"))
node_claude["Claude Code"]
node_viz["Viz skill"]

node_researcher -->|"invokes skill"| node_claude
node_claude -->|"loads"| node_skill
node_researcher -->|"supplies existing record"| node_story
node_researcher -->|"answers questions"| node_brainstorm
node_brainstorm -->|"produces context"| node_context
node_story -->|"develops story and outline"| node_architecture
node_context -->|"guides planning"| node_architecture
node_architecture -->|"plans sections"| node_drafting
node_drafting -->|"feeds drafts"| node_integration
node_integration -->|"precedes reduction"| node_compression
node_drafting -->|"audits every edit"| node_mechanical
node_redteam -->|"applies gate"| node_semantic
node_redteam -->|"reruns greps"| node_mechanical
node_researcher -->|"requests independent review"| node_redteam
node_loop -->|"iterates audit"| node_redteam
node_loop -->|"iterates fixes"| node_drafting
node_drafting -->|"uses writing guidance"| node_craft
node_figure_workflow -->|"uses templates"| node_figure_templates
node_researcher -->|"requests figure synthesis"| node_figure_workflow
node_viz -.->|"handles data plots separately"| node_figure_workflow
node_drafting -->|"uses move sequences"| node_moves
node_drafting -->|"uses section guidance"| node_section_moves
node_drafting -->|"checks drafts"| node_checklists
node_researcher -->|"requests feedback"| node_interventions
node_researcher -->|"customizes rules"| node_editorial

click node_skill "https://github.com/snl-ucsb/paper-writing-skill/blob/main/SKILL.md"
click node_story "https://github.com/snl-ucsb/paper-writing-skill/blob/main/story_mode.md"
click node_brainstorm "https://github.com/snl-ucsb/paper-writing-skill/blob/main/brainstorming_guide.md"
click node_context "https://github.com/snl-ucsb/paper-writing-skill/blob/main/examples/project_context.md"
click node_architecture "https://github.com/snl-ucsb/paper-writing-skill/blob/main/SKILL.md"
click node_drafting "https://github.com/snl-ucsb/paper-writing-skill/blob/main/SKILL.md"
click node_integration "https://github.com/snl-ucsb/paper-writing-skill/blob/main/SKILL.md"
click node_compression "https://github.com/snl-ucsb/paper-writing-skill/blob/main/author_profile/compression_patterns.md"
click node_mechanical "https://github.com/snl-ucsb/paper-writing-skill/blob/main/author_profile/gate_mechanical.md"
click node_semantic "https://github.com/snl-ucsb/paper-writing-skill/blob/main/author_profile/gate_semantic.md"
click node_craft "https://github.com/snl-ucsb/paper-writing-skill/blob/main/author_profile/craft_reference.md"
click node_redteam "https://github.com/snl-ucsb/paper-writing-skill/blob/main/red_team_protocol.md"
click node_loop "https://github.com/snl-ucsb/paper-writing-skill/blob/main/loop_mode.md"
click node_figure_workflow "https://github.com/snl-ucsb/paper-writing-skill/blob/main/figure_synthesis_guide.md"
click node_figure_templates "https://github.com/snl-ucsb/paper-writing-skill/blob/main/figure_templates/figure_spec_template.md"
click node_editorial "https://github.com/snl-ucsb/paper-writing-skill/blob/main/author_profile/editorial_principles.md"
click node_moves "https://github.com/snl-ucsb/paper-writing-skill/blob/main/author_profile/rhetorical_moves.md"
click node_section_moves "https://github.com/snl-ucsb/paper-writing-skill/blob/main/section_rhetorical_moves/introduction.md"
click node_checklists "https://github.com/snl-ucsb/paper-writing-skill/blob/main/writing_checklists/intro_questions.md"
click node_interventions "https://github.com/snl-ucsb/paper-writing-skill/blob/main/author_profile/intervention_types.md"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_skill,node_story,node_brainstorm,node_context,node_architecture,node_drafting,node_integration,node_compression toneBlue
class node_mechanical,node_semantic,node_craft,node_redteam,node_loop toneAmber
class node_figure_workflow,node_figure_templates toneMint
class node_editorial,node_moves,node_section_moves,node_checklists,node_interventions toneRose
class node_researcher,node_claude,node_viz toneIndigo
```

## Components

### Paper workflow

- [Skill entry](https://github.com/snl-ucsb/paper-writing-skill/blob/main/SKILL.md): `SKILL.md`
- [Story mode](https://github.com/snl-ucsb/paper-writing-skill/blob/main/story_mode.md): `story_mode.md`
- [Brainstorming](https://github.com/snl-ucsb/paper-writing-skill/blob/main/brainstorming_guide.md): `brainstorming_guide.md`
- [Project context](https://github.com/snl-ucsb/paper-writing-skill/blob/main/examples/project_context.md): `examples/project_context.md`
- [Paper architecture](https://github.com/snl-ucsb/paper-writing-skill/blob/main/SKILL.md): `SKILL.md`
- [Section drafting](https://github.com/snl-ucsb/paper-writing-skill/blob/main/SKILL.md): `SKILL.md`
- [Integration](https://github.com/snl-ucsb/paper-writing-skill/blob/main/SKILL.md): `SKILL.md`
- [Compression](https://github.com/snl-ucsb/paper-writing-skill/blob/main/author_profile/compression_patterns.md): `author_profile/compression_patterns.md`

### Editorial quality

- [Mechanical gate](https://github.com/snl-ucsb/paper-writing-skill/blob/main/author_profile/gate_mechanical.md): `author_profile/gate_mechanical.md`
- [Semantic gate](https://github.com/snl-ucsb/paper-writing-skill/blob/main/author_profile/gate_semantic.md): `author_profile/gate_semantic.md`
- [Craft reference](https://github.com/snl-ucsb/paper-writing-skill/blob/main/author_profile/craft_reference.md): `author_profile/craft_reference.md`
- [Red team](https://github.com/snl-ucsb/paper-writing-skill/blob/main/red_team_protocol.md): `red_team_protocol.md`
- [Audit loop](https://github.com/snl-ucsb/paper-writing-skill/blob/main/loop_mode.md): `loop_mode.md`

### Figure synthesis

- [Figure workflow](https://github.com/snl-ucsb/paper-writing-skill/blob/main/figure_synthesis_guide.md): `figure_synthesis_guide.md`
- [Figure templates](https://github.com/snl-ucsb/paper-writing-skill/blob/main/figure_templates/figure_spec_template.md): `figure_templates/figure_spec_template.md`

### Rules and guidance

- [Editorial principles](https://github.com/snl-ucsb/paper-writing-skill/blob/main/author_profile/editorial_principles.md): `author_profile/editorial_principles.md`
- [Rhetorical moves](https://github.com/snl-ucsb/paper-writing-skill/blob/main/author_profile/rhetorical_moves.md): `author_profile/rhetorical_moves.md`
- [Section move guides](https://github.com/snl-ucsb/paper-writing-skill/blob/main/section_rhetorical_moves/introduction.md): `section_rhetorical_moves/introduction.md`
- [Writing checklists](https://github.com/snl-ucsb/paper-writing-skill/blob/main/writing_checklists/intro_questions.md): `writing_checklists/intro_questions.md`
- [Intervention types](https://github.com/snl-ucsb/paper-writing-skill/blob/main/author_profile/intervention_types.md): `author_profile/intervention_types.md`

### Other components

- **Researcher**
- **Claude Code**
- **Viz skill**

## Connections

- Researcher → Claude Code: invokes skill (evidence: `README.md`)
- Claude Code → Skill entry: loads (evidence: `README.md`)
- Researcher → Story mode: supplies existing record (evidence: `README.md`)
- Researcher → Brainstorming: answers questions (evidence: `README.md`)
- Brainstorming → Project context: produces context (evidence: `README.md`)
- Story mode → Paper architecture: develops story and outline (evidence: `README.md`)
- Project context → Paper architecture: guides planning (evidence: `README.md`)
- Paper architecture → Section drafting: plans sections (evidence: `README.md`)
- Section drafting → Integration: feeds drafts (evidence: `README.md`)
- Integration → Compression: precedes reduction (evidence: `README.md`)
- Section drafting → Mechanical gate: audits every edit (evidence: `README.md`)
- Red team → Semantic gate: applies gate (evidence: `README.md`)
- Red team → Mechanical gate: reruns greps (evidence: `README.md`)
- Researcher → Red team: requests independent review (evidence: `README.md`)
- Audit loop → Red team: iterates audit (evidence: `README.md`)
- Audit loop → Section drafting: iterates fixes (evidence: `README.md`)
- Section drafting → Craft reference: uses writing guidance (evidence: `README.md`)
- Figure workflow → Figure templates: uses templates (evidence: `README.md`)
- Researcher → Figure workflow: requests figure synthesis (evidence: `README.md`)
- Viz skill → Figure workflow: handles data plots separately (evidence: `README.md`)
- Section drafting → Rhetorical moves: uses move sequences (evidence: `README.md`)
- Section drafting → Section move guides: uses section guidance (evidence: `README.md`)
- Section drafting → Writing checklists: checks drafts (evidence: `README.md`)
- Researcher → Intervention types: requests feedback (evidence: `README.md`)
- Researcher → Editorial principles: customizes rules (evidence: `README.md`)
