Skip to content

eyangs/claude-code-my-workflow

Repository files navigation

My Claude Code Setup

Work in progress. This is not meant to be a polished guide for everyone. It's mostly a summary of how I've been using Claude Code for academic work — creating lecture slides, writing R scripts, managing Beamer-to-Quarto workflows, and so on. I keep learning new things, and as I do, I keep updating these files. This is just a way for me to share what I've figured out with friends and colleagues.

Live site: eyangs.github.io/claude-code-my-workflow

A ready-to-fork starter kit for academics using Claude Code with LaTeX/Beamer + R + Quarto. You describe what you want; Claude plans the approach, runs specialized agents, fixes issues, verifies quality, and presents results — like a contractor who handles the entire job. Extracted from a production PhD course (6 lectures, 800+ slides).


Quick Start (5 minutes)

1. Fork & Clone

# Fork this repo on GitHub (click "Fork" on the repo page), then:
git clone https://github.com/YOUR_USERNAME/claude-code-my-workflow.git my-project
cd my-project

Replace YOUR_USERNAME with your GitHub username.

2. Start Claude Code and Paste This Prompt

claude

Using VS Code? Open the Claude Code panel instead. Everything works the same — see the full guide for details.

Then paste the following, filling in your project details:

I am starting to work on [PROJECT NAME] in this repo. [Describe your project in 2–3 sentences — what you're building, who it's for, what tools you use.]

I want our collaboration to be structured, precise, and rigorous. When creating visuals, everything must be polished and publication-ready.

I've set up the Claude Code academic workflow (forked from pedrohcgs/claude-code-my-workflow). The configuration files are already in this repo. Please read them, understand the workflow, and then update all configuration files to fit my project — fill in placeholders in CLAUDE.md, adjust rules if needed, and propose any customizations specific to my use case.

After that, use the plan-first workflow for all non-trivial tasks. Once I approve a plan, switch to contractor mode — coordinate everything autonomously and only come back to me when there's ambiguity or a decision to make.

Enter plan mode and start by adapting the workflow configuration for this project.

What this does: Claude reads all the configuration files, fills in your project name, institution, and preferences, then enters contractor mode — planning, implementing, reviewing, and verifying autonomously. You approve the plan and Claude handles the rest.

Prefer to configure manually? See the full guide for step-by-step manual setup instructions.


How It Works

Contractor Mode

You describe a task. Claude plans the approach, implements it, runs specialized review agents, fixes issues, re-verifies, and scores against quality gates — all autonomously. You see a summary when the work meets quality standards. Say "just do it" and it auto-commits too.

Specialized Agents

Instead of one general-purpose reviewer, 10 focused agents each check one dimension:

  • proofreader — grammar/typos
  • slide-auditor — visual layout
  • pedagogy-reviewer — teaching quality
  • r-reviewer — R code quality
  • domain-reviewer — field-specific correctness (template — customize for your field)

Each is better at its narrow task than a generalist would be. The /slide-excellence skill runs them all in parallel.

Adversarial QA

Two agents work in opposition: the critic reads both Beamer and Quarto and produces harsh findings. The fixer implements exactly what the critic found. They loop until the critic says "APPROVED" (or 5 rounds max). This catches errors that single-pass review misses.

Quality Gates

Every file gets a score (0–100). Scores below threshold block the action:

  • 80 — commit threshold
  • 90 — PR threshold
  • 95 — excellence (aspirational)

The Guide

For a comprehensive walkthrough, read the full guide (or see the source).

It covers:

  1. Why This Workflow Exists — the problem and the vision
  2. Getting Started — fork, paste one prompt, and Claude sets up the rest
  3. The System in Action — specialized agents, adversarial QA, quality scoring
  4. The Building Blocks — CLAUDE.md, rules, skills, agents, hooks, memory
  5. Workflow Patterns — lecture creation, translation, replication, multi-agent review, research exploration
  6. Customizing for Your Domain — creating your own reviewers and knowledge bases

What's Included

10 agents, 19 skills, 17 rules, 4 hooks (click to expand)

Agents (.claude/agents/)

Agent What It Does
proofreader Grammar, typos, overflow, consistency review
slide-auditor Visual layout audit (overflow, font consistency, spacing)
pedagogy-reviewer 13-pattern pedagogical review (narrative arc, notation density, pacing)
r-reviewer R code quality, reproducibility, and domain correctness
tikz-reviewer Merciless TikZ diagram visual critique
beamer-translator Beamer-to-Quarto translation specialist
quarto-critic Adversarial QA comparing Quarto against Beamer benchmark
quarto-fixer Implements fixes from the critic agent
verifier End-to-end task completion verification
domain-reviewer Template for your field-specific substance reviewer

Skills (.claude/skills/)

Skill What It Does
/compile-latex 3-pass XeLaTeX compilation with bibtex
/deploy Render Quarto + sync to GitHub Pages
/extract-tikz TikZ diagrams to PDF to SVG pipeline
/proofread Launch proofreader on a file
/visual-audit Launch slide-auditor on a file
/pedagogy-review Launch pedagogy-reviewer on a file
/review-r Launch R code reviewer
/qa-quarto Adversarial critic-fixer loop (max 5 rounds)
/slide-excellence Combined multi-agent review
/translate-to-quarto Full 11-phase Beamer-to-Quarto translation
/validate-bib Cross-reference citations against bibliography
/devils-advocate Challenge design decisions before committing
/create-lecture Full lecture creation workflow
/commit Stage, commit, create PR, and merge to main
/lit-review Literature search, synthesis, and gap identification
/research-ideation Generate research questions and empirical strategies
/interview-me Interactive interview to formalize a research idea
/review-paper Manuscript review: structure, econometrics, referee objections
/data-analysis End-to-end R analysis with publication-ready output

Research Workflow

Feature What It Does
Exploration folder Structured explorations/ sandbox with graduate/archive lifecycle
Fast-track workflow 60/100 quality threshold for rapid prototyping
Simplified orchestrator implement → verify → score → done (no multi-round reviews)
Enhanced session logging Structured tables for changes, decisions, verification
Merge-only reporting Quality reports at merge time only
Math line-length exception Long lines acceptable for documented formulas
Workflow quick reference One-page cheat sheet at .claude/WORKFLOW_QUICK_REF.md

Rules (.claude/rules/)

Rules use path-scoped loading: always-on rules load every session (~100 lines total); path-scoped rules load only when Claude works on matching files. Claude follows ~150 instructions reliably, so less is more.

Always-on (no paths: frontmatter — load every session):

Rule What It Enforces
plan-first-workflow Plan mode for non-trivial tasks + context preservation
orchestrator-protocol Contractor mode: implement → verify → review → fix → score
session-logging Three logging triggers: post-plan, incremental, end-of-session

Path-scoped (load only when working on matching files):

Rule Triggers On What It Enforces
verification-protocol .tex, .qmd, docs/ Task completion checklist
single-source-of-truth Figures/, .tex, .qmd No content duplication; Beamer is authoritative
quality-gates .tex, .qmd, *.R 80/90/95 scoring + tolerance thresholds
r-code-conventions *.R R coding standards + math line-length exception
tikz-visual-quality .tex TikZ diagram visual standards
beamer-quarto-sync .tex, .qmd Auto-sync Beamer edits to Quarto
pdf-processing master_supporting_docs/ Safe large PDF handling
proofreading-protocol .tex, .qmd, quality_reports/ Propose-first, then apply with approval
no-pause-beamer .tex No overlay commands in Beamer
replication-protocol *.R Replicate original results before extending
knowledge-base-template .tex, .qmd, *.R Notation/application registry template
orchestrator-research *.R, explorations/ Simple orchestrator for research (no multi-round reviews)
exploration-folder-protocol explorations/ Structured sandbox for experimental work
exploration-fast-track explorations/ Lightweight exploration workflow (60/100 threshold)

Templates (templates/) — reference formats for session logs, quality reports, and exploration READMEs. Not auto-loaded.


Prerequisites

Tool Required For Install
Claude Code Everything npm install -g @anthropic-ai/claude-code
XeLaTeX LaTeX compilation TeX Live or MacTeX
Quarto Web slides quarto.org/docs/get-started
R Figures & analysis r-project.org
pdf2svg TikZ to SVG brew install pdf2svg (macOS)
gh CLI PR workflow brew install gh (macOS)

Not all tools are needed — install only what your project uses. Claude Code is the only hard requirement.


Adapting for Your Field

  1. Fill in the knowledge base (.claude/rules/knowledge-base-template.md) with your notation, applications, and design principles
  2. Customize the domain reviewer (.claude/agents/domain-reviewer.md) with review lenses specific to your field
  3. Update the color palette in your Quarto theme SCSS file — change the color variables at the top
  4. Add field-specific R pitfalls to .claude/rules/r-code-conventions.md
  5. Fill in the lecture mapping in .claude/rules/beamer-quarto-sync.md
  6. Customize the workflow quick reference (.claude/WORKFLOW_QUICK_REF.md) with your non-negotiables and preferences
  7. Set up the exploration folder (explorations/) for experimental work

Additional Resources


Origin

This infrastructure was extracted from Econ 730: Causal Panel Data at Emory University, developed by Pedro Sant'Anna using Claude Code over 6+ sessions. The course produced 6 complete PhD lecture decks with 800+ slides, interactive Quarto versions with plotly charts, and full R replication packages — all managed through this multi-agent workflow.


License

MIT License. Use freely for teaching, research, or any academic purpose.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors