# Research Software: Correct, Tested, Reproducible Code

> Your agent reviews the code behind your paper for leakage, unseeded randomness, floats compared without a tolerance and swallowed errors, fixes what it finds, pins your results with tests, and reruns everything until the same seed gives the same number.

Research Software: Correct, Tested, Reproducible Code is a paid AI agent skill on Agensi by Aurora Lab, in Research & Analysis. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $12 (one-time purchase)
- Creator: [Aurora Lab](https://www.agensi.io/creators/aurora-lab)
- Category: [Research & Analysis](https://www.agensi.io/skills/research-analysis)
- Version: 1.0
- Last updated: 2026-10-19
- Security: scan passed (2026-10-19); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/research-software-correct-tested-reproducible-code
- Tags: research, python, reproducibility, testing, data-leakage, code-review, scientific-computing

## About this skill

### What it does
A generic code review checks style and obvious bugs. Research code fails in other ways: preprocessing fitted before the train/test split, random draws nobody seeded, tests that compare floats with `==`, an `except:` that turns a failure into a silent NaN, a number in the paper that no script can regenerate. This skill makes your agent review and fix research code against a scientific-programming checklist, then prove the fixes with tests and an end-to-end run.

- **A deterministic smell check first.** The bundled `sci_check.py` parses your Python (never runs it) and reports `file:line` findings: unseeded RNGs, exact float comparisons in tests, transformers fitted before the split or on test data, hard-coded machine paths, `except` blocks that swallow errors, packages with no tests, and results with no source script. Each finding is a lead the agent verifies by reading the code.
- **A review that goes past the script.** The agent works through a checklist that puts science-specific failures first: group, temporal and target leakage, broadcasting, dtype and units, non-determinism, silent fallbacks, numerical stability. In the demo it found that a random row split put seeds from the same tray in train and test, a leak no static check can see.
- **Fixes, then tests that pin the result.** Seeds threaded through every random step, preprocessing moved inside the training fold, tolerances chosen from the metric's scale with the reason written next to them, regression tests on the headline number, seed-stability tests, and exact-by-design comparisons kept and marked rather than "fixed".
- **Run it, don't trust it.** The agent runs the tests and the script end to end, checks that two runs with the same seed agree, and reports the spread across seeds. In the demo it also put the old bug back to confirm the new tests catch it.
- **A review you can act on.** `research/code-review.md` (when you ask for it): must-fix and should-fix items with `file:line`, the fix and its status, what was verified with which command, and what was not checked.

### The smell checker
`sci_check.py` needs Python 3.10+ and the standard library only. It makes no network calls and writes nothing. `--fail-on high` exits 1 on any HIGH finding, so it drops into CI or pre-commit. Swallowed errors (an `except` whose body only passes, continues or returns a default) are HIGH; a bare `except:` that still handles the error is a WARN. A reviewed false positive is silenced with `# sci-check: ignore[CODE]` on that line.

### What's included
- `SKILL.md`: the doctrine and the six-step workflow (scope, pre-check, review, fix and test, run end to end, report)
- `references/`: the review checklist, test discipline (tolerances, regression pins, seed stability, property tests), a leakage taxonomy with fixes, numerics and performance, reproducibility, CI and release gates, and the exact rules of the smell checker
- `scripts/sci_check.py` and a README

### Part of the Aurora Lab research pipeline
Works on any Python codebase, with or without a `research/` folder. Pairs well with Aurora Lab's Citable Python Packages (free), which turns scripts into an installable, citable package, and with Instructions Writer for a README a newcomer can follow; neither is needed.

## Requires

- Python 3.10+
- Your project's environment

Python runs the bundled smell checker (standard library only). Your project's own environment runs its tests and scripts.

## Known limitations

The smell checker is a static heuristic for Python: it parses code and never runs it, so it cannot see a seed set in another module, semantic leakage (duplicates across splits, group or temporal leakage, target leakage, tuning on the test set), wrong units, broadcasting or dtype errors, or wrong maths, and it does not read notebooks (export them to .py first). It also flags float comparisons that are exact by design, such as a stored setting read back or a dyadic fraction; check each one and silence it with an inline `# sci-check: ignore[FLOAT-EQ]`. A clean run proves nothing about logic: the agent's review covers what the script cannot, but it is a careful reading, not a proof of correctness. Regression pins hold for the library versions they were recorded with; a fresh-environment install is a separate step the agent recommends but cannot guarantee in every setup. It does not scaffold packages, write up results or edit your manuscript, and it never changes your data.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Research Software: Correct, Tested, Reproducible Code skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### What does it actually check automatically?

The bundled sci_check.py flags, with file and line: random draws or RNGs with no seed, exact float comparisons in tests, scalers, imputers, selectors or resamplers fitted before the train/test split or on test data, hard-coded machine paths, except blocks that swallow errors, packages with no tests, and (with --results) result files whose source script is missing; plus hygiene warnings. Everything else, including group and temporal leakage, units and numerical stability, is a review the agent performs by reading the code against the bundled checklist.

### Will it change my results?

It changes code, not result files, and only when you ask for fixes. If a fix moves a number, it tells you the old and new value and why. In the demo the reported accuracy fell from about 0.66 to 0.48, the majority-class baseline, because seeds from the same tray were on both sides of the split, and the agent put that at the top of its report.

### How strict is it about bare except?

An except block that swallows the error (its body only passes, continues, breaks, returns nothing or returns or assigns a default such as None or NaN) is HIGH, because failures, and Ctrl-C, silently disappear. A bare except: that still logs, re-raises or computes a real fallback is a WARN: it should name the exception, but it does not hide the failure. except Exception: is flagged only when it swallows.

### What about float comparisons that are exact on purpose?

The checker sees the shape of a comparison, not where the value came from, so a stored setting read back (set 0.25, check == 0.25) is flagged too. Check that nothing on either side is computed, then end the line with # sci-check: ignore[FLOAT-EQ] and a short reason. In the demo the agent did exactly this for two such lines and fixed the one comparison that really needed a tolerance.

### Does it work with notebooks, R or Julia?

The doctrine and the checklist apply to any language, and the agent reviews whatever code you give it. The smell checker reads Python .py files only; export notebooks to .py first (for example with jupyter nbconvert --to script).

### Can I use the checker in CI?

Yes. python sci_check.py . --fail-on high exits 1 on any HIGH finding (--fail-on warn on any finding). It needs only Python 3.10+, makes no network calls and writes nothing. The reference file includes a pre-commit hook snippet.

### Does it need my data?

It reads what your scripts read when it runs them end to end, inside your project. Nothing is uploaded: the skill uses no network. The workflow runs your main script on a small input, so a large dataset is not required for the check.

### How does it relate to Citable Python Packages?

This skill makes the code correct and reproducible; Citable Python Packages (free) turns it into an installable, citable package. They pair well, and neither needs the other.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
