# code-sweep

code-sweep audits research code folders against paper figures, tables, and raw data before paper submission. It flags inconsistencies and proposes confirmed fixes one by one.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf (Devin Desktop), Claude.ai · ★ 165 repo stars
- Author: aspi6246
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/aspi6246/Claude-Code-Skills-for-Academics/tree/HEAD/code-sweep/SKILL.md
- Updated: 2026-08-21
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/code-sweep

## What it does

The skill verifies alignment across `.Rmd` analysis scripts, generated assets, and TeX manuscripts. It inspects YAML metadata headers, verifies that referenced input and output paths exist, and traces `\includegraphics` and `\input` calls inside `Paper/main.tex` to confirm that active scripts account for every figure. Discrepancies are tagged as either `MUST-FIX` or `SUGGESTED`.

Execution safety is tested by purling active scripts with `knitr` and running a 120-second dry run on downsampled data. It also monitors deterministic execution, requiring an explicit `set.seed()` whenever random sampling functions appear in code.

Without a `Code/` directory present the skill halts immediately, and full registry reconciliation relies on `build_registry.R` provided by `script-registry`.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add aspi6246/Claude-Code-Skills-for-Academics --skill code-sweep -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/code-sweep/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/code-sweep/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add aspi6246/Claude-Code-Skills-for-Academics --skill code-sweep -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/code-sweep/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add aspi6246/Claude-Code-Skills-for-Academics --skill code-sweep -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/code-sweep/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install aspi6246/Claude-Code-Skills-for-Academics code-sweep
```

2. **Manually: put the files in place**
- File: `.github/skills/code-sweep/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add aspi6246/Claude-Code-Skills-for-Academics --skill code-sweep -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/aspi6246/Claude-Code-Skills-for-Academics --path code-sweep
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/code-sweep/SKILL.md` — The legacy .windsurf/skills/ path still works

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/aspi6246/Claude-Code-Skills-for-Academics/tree/HEAD/code-sweep/SKILL.md

## When to use it
- detect missing source scripts for figures cited in TeX files
- dry-run R markdown analysis scripts to catch runtime errors
- locate unseeded random variables across analytical pipelines
- reconcile missing input datasets and outdated generated outputs

## Example prompts
- /code-sweep
- /code-sweep --no-dryrun
- run a code sweep before paper submission

## Similar
- [review-paper-code](https://affpapa.org/en/nevibecode/skills/review-paper-code.md) — skill · ★ 579 repo stars
- [backward-traceability](https://affpapa.org/en/nevibecode/skills/backward-traceability.md) — skill · 2300 installs
- [minimal-run-and-audit](https://affpapa.org/en/nevibecode/skills/minimal-run-and-audit.md) — skill · 502400 installs
- [quarto-authoring](https://affpapa.org/en/nevibecode/skills/quarto-authoring.md) — skill · 1500 installs
- [review-r](https://affpapa.org/en/nevibecode/skills/review-r.md) — skill · ★ 1729 repo stars
- [paper-context-resolver](https://affpapa.org/en/nevibecode/skills/paper-context-resolver.md) — skill · 503300 installs

From the same set: [aspi6246/claude-code-skills-for-academics](https://affpapa.org/en/nevibecode/by/aspi6246/claude-code-skills-for-academics.md) — 17 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
