# claude-code-my-workflow **Repository Path**: aieconlab/claude-code-my-workflow ## Basic Information - **Project Name**: claude-code-my-workflow - **Description**: 农大朱晨老师的workflow - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-03-05 - **Last Updated**: 2026-03-05 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 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:** [psantanna.com/claude-code-my-workflow](https://psantanna.com/claude-code-my-workflow/) **Last Updated:** 2026-02-15 A ready-to-fork starter kit for academics using [Claude Code](https://code.claude.com/docs/en/overview) 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 ```bash # 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 ```bash claude ``` **Using VS Code?** Open the Claude Code panel instead. Everything works the same — see the [full guide](https://psantanna.com/claude-code-my-workflow/workflow-guide.html#sec-setup) 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](https://psantanna.com/claude-code-my-workflow/workflow-guide.html#sec-setup) for step-by-step manual setup instructions. --- ## How It Works ### Contractor Mode You describe a task. For complex or ambiguous requests, Claude first creates a requirements specification with MUST/SHOULD/MAY priorities and clarity status (CLEAR/ASSUMED/BLOCKED). You approve the spec, then 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) ### Context Survival Plans, specifications, and session logs survive auto-compression and session boundaries. The PreCompact hook saves a context snapshot before Claude's auto-compression triggers, ensuring critical decisions are never lost. MEMORY.md accumulates learning across sessions, so patterns discovered in one session inform future work. --- ## The Guide For a comprehensive walkthrough, read the **[full guide](https://psantanna.com/claude-code-my-workflow/workflow-guide.html)** (or see the [source](guide/workflow-guide.qmd)). 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/`) | Template | What It Does | |----------|-------------| | `session-log.md` | Structured session logging format | | `quality-report.md` | Merge-time quality report format | | `exploration-readme.md` | Exploration project README template | | `archive-readme.md` | Archive documentation template | | `requirements-spec.md` | MUST/SHOULD/MAY requirements framework with clarity status | | `constitutional-governance.md` | Template for defining non-negotiable principles vs. preferences | | `skill-template.md` | Academic skill creation template with domain-specific examples |
--- ## Prerequisites | Tool | Required For | Install | |------|-------------|---------| | [Claude Code](https://code.claude.com/docs/en/overview) | Everything | `npm install -g @anthropic-ai/claude-code` | | XeLaTeX | LaTeX compilation | [TeX Live](https://tug.org/texlive/) or [MacTeX](https://tug.org/mactex/) | | [Quarto](https://quarto.org) | Web slides | [quarto.org/docs/get-started](https://quarto.org/docs/get-started/) | | R | Figures & analysis | [r-project.org](https://www.r-project.org/) | | pdf2svg | TikZ to SVG | `brew install pdf2svg` (macOS) | | [gh CLI](https://cli.github.com/) | 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 - [Claude Code Documentation](https://code.claude.com/docs/en/overview) - [Writing a Good CLAUDE.md](https://code.claude.com/docs/en/memory) — official guidance on project memory --- ## 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.