# Research harness clean

> Research harness clean is an open-source agent skill for analytics and data. Generates and runs reproducible data cleaning and merge scripts that leave raw data. It is available on Claude Code.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code
- **Website:** https://github.com/maxwell2732/claudecode-research-harness-workflow/tree/main/skills/research-harness-clean
- **Repository:** https://github.com/maxwell2732/claudecode-research-harness-workflow
- **GitHub stars:** 42
- **License:** MIT
- **Skill name:** research-harness-clean
- **Collection:** https://github.com/maxwell2732/claudecode-research-harness-workflow
- **Categories:** [analytics and data](https://ai-powered.com/categories/analytics-and-data)
- **Listing updated:** 2026-12-03

## About

This skill guides an AI coding agent through cleaning and combining research datasets. It reads an audit report and a cleaning plan, then writes an R, Stata or Python script covering renaming, type conversion, date parsing, missing-value recoding, duplicate handling, unit harmonization, reshaping and derived variables, in the order the plan specifies.

The workflow is built around checks. Before any script is written it verifies that the prerequisite reports and source files exist and that outputs land outside the raw data folder. Every filter that drops observations is logged with counts before and after, and merges record pre- and post-merge row counts and match rates. If merge keys are ambiguous or variable conflicts appear, the agent is told to stop and ask rather than guess. Scripts run with exit-code checks and limited retries, and the agent writes a cleaning report and a merge report.

The skill expects a completed data audit and a filled-in cleaning plan in the project's reports folder, with source files under a data/raw directory. It produces a log file, processed datasets and report files, and it is meant to run between the audit and planning steps of the Research Harness workflow.

## When your agent uses it

> RES: Generate and run reproducible data cleaning, harmonization, reshaping, and merging scripts. Preserves raw data. Produces cleaned datasets, cleaning report, and merge report. Trigger: clean data, merge data, process data, harmonize data. Do NOT load for: audit, analysis, review, release, setup.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/maxwell2732/claudecode-research-harness-workflow/tree/HEAD/skills/research-harness-clean)
- [Asks for: Read, Write, Edit, Bash, Glob, Grep](https://github.com/maxwell2732/claudecode-research-harness-workflow/blob/HEAD/skills/research-harness-clean/SKILL.md)
- [License: MIT](https://github.com/maxwell2732/claudecode-research-harness-workflow/tree/HEAD/skills/research-harness-clean)

## Features

- **Reproducible cleaning scripts:** Generates a single cleaning script or one script per task in R, Stata or Python, with project-relative paths and a log file.
- **Raw data protection:** Blocks writes to the raw data folder and checks that outputs go to processed or intermediate directories.
- **Logged observation drops:** Records the condition and row count for every filter so no observations are removed silently.
- **Merge validation:** Checks merge keys and duplicate keys before merging and reports matched and unmatched rows afterward.
- **Cleaning and merge reports:** Fills in report templates with row counts, recodes, derived variables and verification results.
- **Plan-driven execution:** Runs all tasks or a single numbered task from a cleaning plan, with a dry-run option that writes scripts without executing them.

## Good for

- Clean and standardize a raw survey CSV according to a written cleaning plan
- Merge two research datasets on a shared ID and report match rates
- Recode non-standard missing-value codes and log how many values changed
- Parse dates into ISO format and flag any that cannot be read
- Generate a reproducible R or Stata script for a data preparation step

## Install

### Claude Code

This skill ships in the `claudecode-research-harness-workflow` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add maxwell2732/claudecode-research-harness-workflow
/plugin install claudecode-research-harness-workflow@claudecode-research-harness-workflow
```

Or copy only this skill to `~/.claude/skills/research-harness-clean`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/maxwell2732/claudecode-research-harness-workflow.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/research-harness-clean &&
cp -R "$tmp/skills/research-harness-clean" ~/.claude/skills/research-harness-clean &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/research-harness-clean` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/research-harness-clean` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/maxwell2732/claudecode-research-harness-workflow.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/research-harness-clean &&
cp -R "$tmp/skills/research-harness-clean" ~/.agents/skills/research-harness-clean &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/research-harness-clean` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/research-harness-clean` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/maxwell2732/claudecode-research-harness-workflow.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/research-harness-clean &&
cp -R "$tmp/skills/research-harness-clean" ~/.cursor/skills/research-harness-clean &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/research-harness-clean` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/maxwell2732/claudecode-research-harness-workflow.git --path skills/research-harness-clean
```

Or copy the folder to `~/.gemini/skills/research-harness-clean` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/research-harness-clean`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/maxwell2732/claudecode-research-harness-workflow.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/research-harness-clean &&
cp -R "$tmp/skills/research-harness-clean" ~/.copilot/skills/research-harness-clean &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/research-harness-clean` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/maxwell2732/claudecode-research-harness-workflow.git
```

Then copy `claudecode-research-harness-workflow/skills/research-harness-clean` into your agent's skills folder as `research-harness-clean`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does the skill need before Research harness clean runs?

It needs an existing data audit report and a cleaning plan saved under the reports folder, plus the source files under data/raw. If either report or any source file is missing, it stops.

### Does Research harness clean modify the raw data?

No. The skill forbids writing to data/raw and checks that outputs are written to processed or intermediate folders.

### Which languages does Research harness clean support?

The procedure covers R, Stata and Python, defaulting to R when no language is specified. R and Stata skeletons are included.

### What happens if merge keys are unclear?

The agent stops before writing the merge script, reports the ambiguity and asks the user for clarification.

### When is the skill triggered?

It triggers on requests such as clean data, merge data, process data or harmonize data, and is not meant for audit, analysis, review, release or setup tasks.

### How do I install Research harness clean in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/research-harness-clean to use it in all your projects, or to .claude/skills/research-harness-clean in one project. Or install the claudecode-research-harness-workflow plugin, which includes it: /plugin marketplace add maxwell2732/claudecode-research-harness-workflow, then /plugin install claudecode-research-harness-workflow@claudecode-research-harness-workflow.

### Does Research harness clean run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Research harness clean?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

### What are the best alternatives to Research harness clean?

The closest alternatives to Research harness clean are Research harness work, Research harness audit, Famou data analysis, Data scientist and Datanalysis credit risk.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Research harness work](https://ai-powered.com/skills/research-harness-work): Research harness work is an open-source agent skill for analytics and data.
- [Research harness audit](https://ai-powered.com/skills/research-harness-audit): Research harness audit is an open-source agent skill for analytics and data.
- [Famou data analysis](https://ai-powered.com/skills/famou-data-analysis): Famou data analysis is an open-source agent skill for analytics and data.
- [Data scientist](https://ai-powered.com/skills/data-scientist): Data scientist is an open-source agent skill for analytics and data.
- [Datanalysis credit risk](https://ai-powered.com/skills/datanalysis-credit-risk): Datanalysis credit risk is an open-source agent skill for analytics and data.
- [Data pipeline work](https://ai-powered.com/skills/data-pipeline-work): Data pipeline work is an open-source agent skill for analytics and data.
- [Data analysis](https://ai-powered.com/skills/data-analysis): Data analysis is an open-source agent skill for analytics and data.
- [Data workflow](https://ai-powered.com/skills/data-workflow): Data workflow is an open-source agent skill for analytics and data.

---
Source: https://ai-powered.com/skills/research-harness-clean
