SWF — Scientific Workflow
中文文档
A Claude Code plugin for managing multi-project research workflows. Covers the full lifecycle from initial idea to published paper, with Linear as the task coordination hub.
Installation
Install as a global (user-scope) plugin. SWF commands operate across projects (/swf:dashboard, /swf:daily, /swf:idea, etc.), so they need to be available in every directory. Installing as a project plugin would limit access to a single repo.
# Prerequisite: connect Linear MCP
claude mcp add --transport http linear-server https://mcp.linear.app/mcp -s user
# Prerequisite: ensure GitHub CLI is authenticated
gh auth status
# 1. Add the marketplace
claude plugin marketplace add cliffren/swf
# 2. Install the plugin (the marketplace name comes from marketplace.json: swf-marketplace)
claude plugin install swf@swf-marketplace
Then restart Claude Code, or run /reload-plugins inside it. Steps 1-2 also work as slash commands inside Claude Code (/plugin marketplace add cliffren/swf, /plugin install swf@swf-marketplace). After installation, run /swf:init-linear to set up your Linear workspace.
Quick Start
Start a new project from scratch:
/swf:init-linear # One-time: set up Linear workspace (labels, Ideas, Archive)
/swf:idea "my research idea" # Log the idea, discuss and clarify with Claude
# Complete evaluation sub-issues (literature, feasibility, tech, design)
/swf:promote # Graduate to independent project (Linear + repo)
cd <project-path>
/swf:load # Load project context (especially if new session)
/swf:plan-next my-project # Plan the first batch of issues
Import an existing project:
cd ~/Projects/existing-project
/swf:import # Analyze repo, infer phase, create Linear project, scaffold docs
/swf:plan-next existing-project # Plan issues for current phase
Then the daily loop:
/swf:load # Start of session: load context
/swf:next # Pick up a task
# ... work ...
/swf:done # Finish task, record summary
Other coding agents:
- Codex: See .codex/INSTALL.md — clone and symlink to
~/.agents/skills/
- Cursor: Copy
.cursor-plugin/ and skills/ into your Cursor plugin directory
- OpenCode: See .opencode/INSTALL.md — add to
opencode.json plugin array
Core Philosophy
A research project's lifecycle:
Idea → Evaluate → Establish → Develop → Validate → Deep Analysis → Figures → Write Paper → Submit → Publish
What SWF does: Manages what to do — which project, which phase, which task, when to do it.
What SWF doesn't do: Doesn't manage how to write code — that's handled by development plugins like Superpowers.
Zero-handoff between sessions:
Session A: work on task → /swf:done → summary in Linear, code in git → close
Session B: /swf:load → full context restored from Linear + git → continue
No manual notes, no handoff documents. State lives in Linear and git, not in session memory.
How SWF and Superpowers work together:
/swf:next → Pick up a task from Linear
↓
Superpowers handles development (brainstorm → plan → TDD → review)
↓
/swf:done → Record completion, mark Done
Project Lifecycle
Phase 0: Ideas Funnel
All ideas go through the Ideas Project for evaluation before becoming independent projects.
/swf:idea "Scalable Single-Cell Analysis"
│ → Creates main issue in Ideas Project
│ → Auto-creates 5 evaluation sub-issues:
│ Literature review, feasibility, tech selection, design.md draft, architecture diagram
│
├─ Evaluation passes → /swf:promote
│ → Interactive: select idea, choose project name
│ → Creates Linear Project + Phase 1~8 Milestones
│ → Creates GitHub repo + standard directory structure + CLAUDE.md
│ → Archives the Ideas issue
│
└─ Evaluation fails → Archive with notes
For existing projects, use /swf:import: analyzes the repo to infer current phase, creates Linear Project, scaffolds missing docs without touching existing files.
Phase 1~8: Project Progression
Each project has 8 phases, mapped to Linear Project Milestones:
| Phase | Stage | Primary Work |
|---|
| 1 | Data Preparation & Development | Write code, build systems |
| 2 | Validation & Benchmark | Standardized comparisons against baselines |
| 3 | Deep Validation | Case studies / Feature demonstrations |
| 4 | Figure Assembly | Publication-quality figures |
| 5 | Paper Writing | Draft by section |
| 6 | Submission Preparation | Declarations, materials, checklists |
| 7 | Post-Submission | Peer review, revision |
| 8 | Publication | Proofing, promotion |