# Citable Python Packages from Research Code

> Turn research scripts into a pip-installable, citable Python package: src/ layout with uv, ruff and pytest, CITATION.cff and a How to cite section, a lock file for reproducibility, and your code moved without rewrites.

Citable Python Packages from Research Code is a free 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: Free
- Creator: [Aurora Lab](https://www.agensi.io/creators/aurora-lab)
- Category: [Research & Analysis](https://www.agensi.io/skills/research-analysis)
- Uses: 3
- 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/citable-python-packages-from-research-code
- Tags: research, python, reproducibility, packaging, research-software, citation, uv, pytest

## About this skill

### What it does
Your agent turns loose research code, or just an idea, into a Python package other people can install, run and cite. It:

- **Builds a clean package** with a fixed, modern toolchain: `uv` for the environment and lock file, `hatchling` to build, `ruff` to lint, `pytest` to test, and a `src/` layout so tests run against the installed package.
- **Makes it citable**: a `CITATION.cff` (authors, ORCID iDs, licence, version), a README with a "How to cite" section and BibTeX, and a test that fails if the citation is invalid, still has placeholders, or drifts from the package version.
- **Records what your results ran on**: lower bounds in `pyproject.toml`, exact versions in a committed `uv.lock`, the Python version in `.python-version`.
- **Keeps your code yours**: existing scripts are copied into the package verbatim and the originals are left in place. The only edit is turning imports between your own scripts into package imports. Code that runs on import, hard-coded paths, undeclared imports and lint findings are flagged for you to decide, never silently rewritten.
- **Runs the checks** (`uv sync`, `ruff`, `pytest`) and hands over the exact commands plus a list of what is still a placeholder.

### Optional extras
On request: an `examples/` folder with a test that runs every example, a `notebooks/` folder, a GitHub Actions CI workflow testing the oldest and newest Python, and a Dockerfile that installs the locked versions. When you want a DOI, it prepares the release and gives you a checklist for Zenodo's GitHub integration, with a Code availability statement for your paper.

### What's included
- `SKILL.md`: the workflow for both starting points (an idea, or existing scripts)
- `references/`: annotated templates for `pyproject.toml`, `CITATION.cff` and its test, the README, CI, Docker and examples, plus guides to reproducibility and releases with a DOI

### Part of the Aurora Lab research pipeline
Works entirely on its own. If you keep a `research/` folder, it can read `research/refs.bib` and `research/paper/` to fill in the paper citation. No skill calls another.

## Requires

- Python 3.10+
- Internet access
- cffconvert
- Git
- Optional: uv (Python tool runner)

Without uv, the agent writes the files and lists the commands. Internet access is for the first uv sync from PyPI.

## Known limitations

Python only, with a fixed toolchain (uv, hatchling, ruff, pytest); it does not set up Poetry, conda or setuptools projects. It packages your code but does not judge whether the science is right: the tests it writes are smoke tests on small known inputs, not a validation of your method. It does not create the GitHub repository, publish releases, mint a DOI or upload to PyPI; it prepares the files and gives you the steps. Zenodo and GitHub Actions details reflect their documentation as of October 2026; check the current guides when you release.

## 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 Citable Python Packages from Research Code skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### Will it change my code?

No. Existing scripts are copied into the package verbatim, and the originals stay where they are. The one edit it makes is turning imports between your own scripts into package imports (from load import x becomes from .load import x), and it tells you about it. Everything else it would change (code that runs on import, hard-coded paths, undeclared imports, lint findings) is listed for you to decide. It runs ruff --fix or ruff format on your code only if you agree.

### What do I need installed?

Python 3.10+ and uv. The package's own dev tools (pytest, pytest-cov, ruff, pyyaml) are installed by uv into the project's .venv. Without uv, the agent still writes every file and gives you the commands to run later.

### Does it need internet access?

Only for uv. The first uv sync downloads your package's dependencies from PyPI (and a Python interpreter if you don't have the one requested). The agent asks before that first sync. The skill itself contacts nothing.

### Can it get me a DOI?

It prepares everything for one: version bump, CITATION.cff, release notes, README badge placeholder, and a step-by-step checklist for Zenodo's GitHub integration, plus a Code availability statement for your paper. You publish the GitHub release and switch on the repository in Zenodo yourself; the repository must be public.

### Does it publish to PyPI?

No. Once the repository is on GitHub, people can install a tagged release straight from git (pip install "name @ git+<repository URL>@v0.1.0"). PyPI publishing is an optional later step, which the handoff points out.

### Does it test my science?

No. It writes smoke tests that call each function on a small input with a known answer, to show the package works after the move, plus the citation test. Whether your method is correct is outside its scope.

### Can I start from scratch?

Yes. Describe the package in a sentence and its first call; it scaffolds the same structure with stub functions and tests, so the project installs and its tests run before any real logic exists.

### Which agents does it work with?

Any agent that loads SKILL.md skills, including Claude Code, Codex CLI, Cursor and Gemini CLI. It needs a terminal to run uv, ruff and pytest.

---

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.
