# code-audit

code-audit audits empirical R and Python scripts through a two-stage protocol before running computations on research data.

- 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-audit/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-audit

## What it does

This workflow inspects data processing and econometric pipelines. The initial phase stays strictly read-only, preventing premature execution against restricted databases like CRSP or WRDS. It flags missing panel checks, inflated joins, bad controls, and invalid standard error clustering.

Execution happens only during the second stage when explicitly permitted. The assistant runs calculations against synthetic records or tiny sample extracts first, verifying coefficient stability and log convergence before any complete run.

Findings arrive structured by severity into critical bugs, warnings, and style notes, followed by code-level recommendations tied directly to line numbers.

## Install

### Claude Code (native platform)

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

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

### Codex

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

2. **Manually: put the files in place**
- File: `.agents/skills/code-audit/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-audit -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/code-audit/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-audit
```

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

### Gemini CLI

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

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

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/code-audit/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-audit/SKILL.md

## When to use it
- detect observation inflation during panel data merges
- verify standard error clustering and fixed effects choices
- audit difference-in-differences setups for parallel trends
- ensure script reproducibility with relative paths and fixed seeds

## Example prompts
- Audit empirical analysis script run_models.R before estimation
- Review data cleaning logic in panel_build.py
- Check whether instrumented variables satisfy first-stage requirements

## Similar
- [audit-analysis](https://affpapa.org/en/nevibecode/skills/audit-analysis.md) — skill · ★ 579 repo stars
- [statsmodels](https://affpapa.org/en/nevibecode/skills/k-dense-ai-statsmodels.md) — skill · 2400 installs
- [StatsPAI_skill](https://affpapa.org/en/nevibecode/skills/statspai-skill.md) — skill · ★ 240 repo stars
- [research-log](https://affpapa.org/en/nevibecode/skills/research-log.md) — skill · ★ 89 repo stars
- [ft50-empirical-writing](https://affpapa.org/en/nevibecode/skills/ft50-empirical-writing.md) — skill · ★ 240 repo stars
- [audit-reproducibility](https://affpapa.org/en/nevibecode/skills/audit-reproducibility.md) — skill · ★ 1729 repo stars

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
