← Blog

OpenCode Scientific Writer: 24 AI Agents for Academic Writing

The Endless Writing Loop of a PhD Student

If there is one constant in the life of a PhD student, it is writing. Manuscripts, grant proposals, literature reviews, conference abstracts, poster layouts, figure captions, rebuttal letters — the list never ends. And while each of these has its own conventions and templates, a huge fraction of the effort is spent on the structural, repetitive parts: organizing sections, formatting citations, ensuring compliance with reporting standards, generating boilerplate text for methods sections.

After defending my PhD at CUHK School of Life Sciences, I wanted to build something that would have saved me hundreds of hours. That became OpenCode Scientific Writer — an OpenCode plugin that deploys 24 specialized AI agents, each trained for a specific aspect of scientific and academic writing.

From Claude Scientific Writer to OpenCode

The plugin was originally inspired by and ported from “Claude Scientific Writer” by K-Dense Inc. I adapted the concept to the OpenCode platform, restructuring the agent architecture and expanding capabilities to take advantage of OpenCode’s plugin system. The result is a standalone tool that brings domain-specific AI writing assistance directly into your development environment.

The 24 Agents

The agents are organized to cover the full lifecycle of scientific communication:

Manuscript Writing follows the IMRAD structure (Introduction, Methods, Results, Discussion), with additional agents for abstracts, conclusions, and title generation. Each agent understands the conventions of its section — the Methods agent writes in past tense passive voice, the Results agent presents findings without interpretation, and so on.

Clinical Reports includes agents trained on CONSORT (for randomized trials), STROBE (for observational studies), and PRISMA (for systematic reviews) reporting guidelines.

Research and Literature features agents for hypothesis generation, research question lookup (powered by Perplexity’s academic search), and systematic literature review synthesis. The research lookup agent connects to Perplexity’s sonar-pro-search model to find relevant academic papers in real time.

Grant Writing provides templates and agents for major funding agencies: NSF, NIH, DOE, and DARPA. Each agent understands the specific review criteria and formatting requirements of its target agency.

Visual Communication is where things get particularly interesting. Agents for scientific schematics use Gemini models with an iterative quality review loop — they generate a diagram, evaluate it against quality thresholds, and refine it until it meets the standard. This covers scientific figures, infographics, LaTeX/PPTX posters, and presentation slides.

Support Agents handle citation management, venue-specific templates (journal formatting, conference requirements), and general editing for clarity and conciseness.

Smart Backend Routing

Not all writing tasks need the same AI backend. OpenCode Scientific Writer implements intelligent routing:

  • General writing and editing queries go to the Parallel Chat API for fast, broad-competence responses
  • Academic paper searches and research lookups are routed to Perplexity’s sonar-pro-search, which is specifically tuned for scholarly literature
  • Diagram and figure generation uses Gemini models, which have strong visual generation capabilities

This routing happens transparently — you just invoke the agent you need, and the plugin selects the optimal backend automatically.

Quality-Controlled Diagram Generation

One of the features I am most proud of is the iterative quality control for diagram generation. Scientific figures have a higher bar than casual illustrations — axes need labels, schematics need consistent styling, flowcharts need logical clarity. The diagram agent generates a draft, evaluates it against document-type-specific quality thresholds (a poster figure has different requirements than a journal figure), and iterates until the quality score passes. This multi-pass approach dramatically reduces the “almost right but not quite” problem that plagues single-shot AI image generation.

What I Learned

Building this plugin was a crash course in several areas:

  • Plugin architecture — designing a system that is modular enough to host 24 agents while remaining coherent and maintainable
  • Multi-agent system design — orchestrating agents that sometimes need to work in sequence (research, then outline, then draft) and sometimes independently
  • Prompt engineering for domain-specific AI — crafting prompts that encode scientific writing conventions, not just generic writing ability
  • API integration — connecting multiple AI backends (chat models, search APIs, image generation) behind a unified interface
  • Scientific publishing conventions — deepening my understanding of IMRAD, CONSORT, STROBE, PRISMA, and agency-specific grant structures

The goal of OpenCode Scientific Writer is not to replace the researcher’s voice or judgment. It is to handle the scaffolding — the structure, the formatting, the boilerplate — so you can focus on the science itself.

The plugin is available at github.com/loganylchen/opencode-scientific-writer.