Writing Lean Proofs
trailofbits/skills
Structures Lean 4 proofs and library design along Mathlib conventions, from stating theorems to refactoring long tactic proofs and fixing slow or timing-out ones.
A skill your agent uses when refactoring research code for publication, adding documentation to existing analysis scripts, creating reproducible computational workflows, or preparing code for…
$ npx skills add aipoch/medical-research-skills --skill code-refactor-for-reproducibility -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install aipoch/medical-research-skills code-refactor-for-reproducibility --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/aipoch/medical-research-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/'scientific-skills/Data Analysis/code-refactor-for-reproducibility' .claude/skills/code-refactor-for-reproducibility && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "code-refactor-for-reproducibility" agent skill from https://github.com/aipoch/medical-research-skills/tree/main/scientific-skills/Data%20Analysis/code-refactor-for-reproducibility into .claude/skills/code-refactor-for-reproducibility/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "code-refactor-for-reproducibility", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/aipoch/medical-research-skills/tree/main/scientific-skills/Data%20Analysis/code-refactor-for-reproducibilityType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add aipoch/medical-research-skills --skill code-refactor-for-reproducibility -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install aipoch/medical-research-skills code-refactor-for-reproducibility --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/aipoch/medical-research-skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/'scientific-skills/Data Analysis/code-refactor-for-reproducibility' .agents/skills/code-refactor-for-reproducibility && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "code-refactor-for-reproducibility" agent skill from https://github.com/aipoch/medical-research-skills/tree/main/scientific-skills/Data%20Analysis/code-refactor-for-reproducibility into .agents/skills/code-refactor-for-reproducibility/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "code-refactor-for-reproducibility", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add aipoch/medical-research-skills --skill code-refactor-for-reproducibility -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install aipoch/medical-research-skills code-refactor-for-reproducibility --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/aipoch/medical-research-skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/'scientific-skills/Data Analysis/code-refactor-for-reproducibility' .cursor/skills/code-refactor-for-reproducibility && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "code-refactor-for-reproducibility" agent skill from https://github.com/aipoch/medical-research-skills/tree/main/scientific-skills/Data%20Analysis/code-refactor-for-reproducibility into .cursor/skills/code-refactor-for-reproducibility/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "code-refactor-for-reproducibility", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/aipoch/medical-research-skills.git --path 'scientific-skills/Data Analysis/code-refactor-for-reproducibility'--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add aipoch/medical-research-skills --skill code-refactor-for-reproducibility -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install aipoch/medical-research-skills code-refactor-for-reproducibility --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/aipoch/medical-research-skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/'scientific-skills/Data Analysis/code-refactor-for-reproducibility' .gemini/skills/code-refactor-for-reproducibility && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "code-refactor-for-reproducibility" agent skill from https://github.com/aipoch/medical-research-skills/tree/main/scientific-skills/Data%20Analysis/code-refactor-for-reproducibility into .gemini/skills/code-refactor-for-reproducibility/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "code-refactor-for-reproducibility", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install aipoch/medical-research-skills code-refactor-for-reproducibilityInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add aipoch/medical-research-skills --skill code-refactor-for-reproducibility -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/aipoch/medical-research-skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/'scientific-skills/Data Analysis/code-refactor-for-reproducibility' .github/skills/code-refactor-for-reproducibility && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "code-refactor-for-reproducibility" agent skill from https://github.com/aipoch/medical-research-skills/tree/main/scientific-skills/Data%20Analysis/code-refactor-for-reproducibility into .github/skills/code-refactor-for-reproducibility/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "code-refactor-for-reproducibility", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add aipoch/medical-research-skills --skill code-refactor-for-reproducibility -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install aipoch/medical-research-skills code-refactor-for-reproducibility --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/aipoch/medical-research-skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/'scientific-skills/Data Analysis/code-refactor-for-reproducibility' .opencode/skills/code-refactor-for-reproducibility && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "code-refactor-for-reproducibility" agent skill from https://github.com/aipoch/medical-research-skills/tree/main/scientific-skills/Data%20Analysis/code-refactor-for-reproducibility into .opencode/skills/code-refactor-for-reproducibility/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "code-refactor-for-reproducibility", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
code-refactor-for-reproducibilityA skill your agent uses when refactoring research code for publication, adding documentation to existing analysis scripts, creating reproducible computational workflows, or preparing code for…
Code Refactor For Reproducibility is an agent skill from aipoch/medical-research-skills. Use when refactoring research code for publication, adding documentation to existing analysis scripts, creating reproducible computational workflows, or preparing code for sharing with collaborators. Transforms research code into publication-ready, reproducible workflows. Adds documentation, implements error handling, creates environment specifications, and ensures computational reproducibility for scientific publications.
Its SKILL.md is about 3.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 5 other files, including scripts (for example `code-refactor-for-reproducibility_audit_result_v2.json`, `scripts/main.py` and `tile.json`).
It sits in Development, covering Reproducible research and Refactoring. The repository describes itself as: Hundreds of agent skills for medical research, including protocol design, data analysis, evidence insights, and academic writing. The licence is MIT.
4 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 686e09d. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Ships 1 file in scripts/ (Python), which the agent can run.
Shell commands in SKILL.md call:
pythonpytestFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Code Refactor For Reproducibility loads about 3.1k tokens when it runs. Until then it costs about 115 tokens; SKILL.md has 946 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.
The full file from aipoch/medical-research-skills at commit 686e09d, republished under its MIT licence (© aipoch). 946 words, ~3,075 tokens.
.claude/skills/code-refactor-for-reproducibility/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.scripts/main.py.Python: 3.10+. Repository baseline for current packaged skills.numpy: unspecified. Declared in requirements.txt.pandas: unspecified. Declared in requirements.txt.pytest: unspecified. Declared in requirements.txt.scipy: unspecified. Declared in requirements.txt.src: unspecified. Declared in requirements.txt.cd "20260318/scientific-skills/Data Analytics/code-refactor-for-reproducibility"
python -m py_compile scripts/main.py
python scripts/main.py --helpExample run plan:
CONFIG block or documented parameters if the script uses fixed settings.python scripts/main.py with the validated inputs.See ## Workflow above for related details.
scripts/main.py.Use this command to verify that the packaged script entry point can be parsed before deeper execution.
python -m py_compile scripts/main.pyUse these concrete commands for validation. They are intentionally self-contained and avoid placeholder paths.
python -m py_compile scripts/main.py
python scripts/main.py --helpFollow this sequence when refactoring a research codebase:
Read each source file and check for the following problems. Document findings before making any changes.
Checklist: missing docstrings · hardcoded absolute paths · missing random seeds · bare except: clauses · unpinned imports · unexplained magic numbers
Example — detecting issues manually:
import ast, pathlib
def find_hardcoded_paths(source: str) -> list[str]:
"""Return string literals that look like absolute paths."""
tree = ast.parse(source)
return [
node.s for node in ast.walk(tree)
if isinstance(node, ast.Constant)
and isinstance(node.s, str)
and node.s.startswith("/")
]
source = pathlib.Path("analysis.py").read_text()
print(find_hardcoded_paths(source))Apply improvements in place. Always back up originals first.
# Before
def load_data(path):
import pandas as pd
return pd.read_csv(path)
# After
def load_data(path: str) -> "pd.DataFrame":
"""Load a CSV dataset from disk.
Parameters
----------
path : str
Path to the CSV file (relative to project root).
Returns
-------
pd.DataFrame
Raw dataset with original column names preserved.
"""
import pandas as pd
return pd.read_csv(path)from pathlib import Path
import argparse
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("--data", type=Path, default=Path("data/raw.csv"))
parser.add_argument("--output", type=Path, default=Path("results/"))
return parser.parse_args()
args = parse_args()
df = pd.read_csv(args.data)
args.output.mkdir(parents=True, exist_ok=True)import random
import numpy as np
SEED = 42 # document this constant at module level
random.seed(SEED)
np.random.seed(SEED)
# scikit-learn
from sklearn.ensemble import RandomForestClassifier
clf = RandomForestClassifier(random_state=SEED)
# PyTorch
import torch
torch.manual_seed(SEED)
torch.backends.cudnn.deterministic = Trueimport logging
from pathlib import Path
logging.basicConfig(level=logging.INFO, format="%(asctime)s [%(levelname)s] %(message)s")
logger = logging.getLogger(__name__)
def load_data(path: Path) -> "pd.DataFrame":
"""Load dataset with validation."""
import pandas as pd
if not path.exists():
raise FileNotFoundError(f"Data file not found: {path}")
logger.info("Loading data from %s", path)
df = pd.read_csv(path)
if df.empty:
raise ValueError(f"Loaded dataframe is empty: {path}")
logger.info("Loaded %d rows, %d columns", *df.shape)
return dfSee references/environment-setup.md for full Dockerfile and Conda environment templates.
pip install pipreqs
pipreqs src/ --output requirements.txt --forceVerify resolution:
python -m venv .venv_test && source .venv_test/bin/activate
pip install -r requirements.txt
python -c "import pandas, numpy, sklearn"
deactivate && rm -rf .venv_testname: my-research-env
channels:
- conda-forge
- defaults
dependencies:
- python=3.9
- numpy=1.24.3
- pandas=2.0.1
- scikit-learn=1.2.2
- matplotlib=3.7.1
- pip:
- some-pip-only-package==0.5.0conda env create -f environment.yml
conda activate my-research-envGenerate a README.md containing at minimum:
## Requirements
<!-- List Python version and key packages with versions -->
## Installation
```text
conda env create -f environment.yml
conda activate my-research-env<!-- Describe input data format, source, and where to place files -->
python main.py --data data/raw.csv --output results/<!-- Describe files created and how to interpret them -->
config.py)
---
## Step 5: Validate Reproducibility
After all changes, verify that behaviour is unchanged:
```text
# 1. Run the full pipeline and capture output checksums
python main.py --data data/raw.csv --output results/
md5sum results/*.csv > checksums_refactored.md5
diff checksums_original.md5 checksums_refactored.md5
# 2. Run unit tests
pytest tests/ -v --tb=short
# 3. Confirm determinism across two clean runs
python main.py --output results_run1/
python main.py --output results_run2/
diff -r results_run1/ results_run2/Reproducibility verification checklist:
requirements.txt / environment.yml installs cleanly in a fresh environment| Practice |
|---|
| Relative paths only |
| Pin dependency versions |
| Set random seeds |
| Docstrings on all public functions |
| Validate outputs against a baseline |
| Automate environment setup |
references/guide.md — Comprehensive user guidereferences/environment-setup.md — Dockerfile and full environment templatesreferences/examples/ — Working code examplesreferences/api-docs/ — Complete API documentationSkill ID: 455 | Version: 1.0 | License: MIT
Every final response should make these items explicit when they are relevant:
scripts/main.py fails, report the failure point, summarize what still can be completed safely, and provide a manual fallback.This skill accepts requests that match the documented purpose of code-refactor-for-reproducibility and include enough context to complete the workflow safely.
Do not continue the workflow when the request is out of scope, missing a critical input, or would require unsupported assumptions. Instead respond:
code-refactor-for-reproducibilityonly handles its documented workflow. Please provide the missing required inputs or switch to a more suitable skill.
Use the following fixed structure for non-trivial requests:
If the request is simple, you may compress the structure, but still keep assumptions and limits explicit when they affect correctness.
© aipoch, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 4 other files (scripts) in scientific-skills/Data Analysis/code-refactor-for-reproducibility of aipoch/medical-research-skills.
Open the folder on GitHubat commit 686e09d
Code Refactor For Reproducibility next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Code Refactor For Reproducibility this skillaipoch/medical-research-skills | 2k | — | ~3.1k | Automated safety check: Pass | MIT | |
| Writing Lean Proofstrailofbits/skills | 7.4k | — | ~4k | Automated safety check: Pass | CC-BY-SA-4.0 | |
| Setting Up Reproducible AnalysisK-Dense-AI/science-superpowers | 348 | — | ~1.5k | Automated safety check: Pass | Custom licence | |
| Review Rpedrohcgs/claude-code-my-workflow | 1.6k | — | ~430 | Automated safety check: Pass | MIT | |
| Bio Workflow Management Wdl WorkflowsGPTomics/bioSkills | 1.2k | 1 repos | ~3.5k | Automated safety check: Pass | MIT | |
| Review Rbrycewang-stanford/Auto-Empirical-Research-Skills | 4.5k | — | ~1.3k | Automated safety check: Pass | Custom licence |
trailofbits/skills
Structures Lean 4 proofs and library design along Mathlib conventions, from stating theorems to refactoring long tactic proofs and fixing slow or timing-out ones.
K-Dense-AI/science-superpowers
A skill your agent uses when starting analysis work that needs isolation, or before executing a pre-registered plan - ensures an isolated, reproducible workspace with pinned environment, fixed…
pedrohcgs/claude-code-my-workflow
Read-only R code review protocol for .R scripts. An agent skill from pedrohcgs/claude-code-my-workflow.
GPTomics/bioSkills
Authors bioinformatics pipelines in WDL (Workflow Description Language) run by Cromwell or miniwdl, targeting the GATK/Broad and Terra/AnVIL/BioData Catalyst cloud ecosystem, with tasks, workflows…
brycewang-stanford/Auto-Empirical-Research-Skills
R code review for the sewage project. An agent skill from brycewang-stanford/Auto-Empirical-Research-Skills.
akash-network/node
Behavioral guidelines to reduce common LLM coding mistakes. An agent skill from akash-network/node.
aipoch/medical-research-skills
Complete workflow for generating academic research posters from PDF literature; use when you need to extract paper content from PDFs and produce a LaTeX-based poster…
aipoch/medical-research-skills
Analyzes clinical diagnostic accuracy studies for bias using the QUADAS-2 tool.
aipoch/medical-research-skills
Perform comprehensive exploratory data analysis on scientific data files across 200+ file formats.
aipoch/medical-research-skills
A toolkit for preparing ISO 13485:2016 certification documentation for medical device QMS.
aipoch/medical-research-skills
Recommends target journals for manuscript submission by analyzing the paper topic/abstract and the journal distribution of similar PubMed literature; use when users ask for journal…
aipoch/medical-research-skills
Creates academic-poster writing packages for LaTeX using beamerposter, tikzposter, or baposter.
Categories
A skill your agent uses when refactoring research code for publication, adding documentation to existing analysis scripts, creating reproducible computational workflows, or preparing code for…. Code Refactor For Reproducibility is an agent skill from aipoch/medical-research-skills. Use when refactoring research code for publication, adding documentation to existing analysis scripts, creating reproducible computational workflows, or preparing code for sharing with collaborators.
Code Refactor For Reproducibility fits situations like: refactoring research code for publication; adding documentation to existing analysis scripts; creating reproducible computational workflows; preparing code for sharing with collaborators.
Run `npx skills add aipoch/medical-research-skills --skill code-refactor-for-reproducibility -a claude-code`. Or copy the skill folder (scientific-skills/Data Analysis/code-refactor-for-reproducibility in aipoch/medical-research-skills) into .claude/skills/code-refactor-for-reproducibility in your project. Claude Code loads it when a task matches its description.
Run `npx skills add aipoch/medical-research-skills --skill code-refactor-for-reproducibility -a codex`. Or copy the skill folder (scientific-skills/Data Analysis/code-refactor-for-reproducibility in aipoch/medical-research-skills) into .agents/skills/code-refactor-for-reproducibility in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add aipoch/medical-research-skills --skill code-refactor-for-reproducibility -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/code-refactor-for-reproducibility, .gemini/skills/code-refactor-for-reproducibility, .github/skills/code-refactor-for-reproducibility and .opencode/skills/code-refactor-for-reproducibility in your project.
Going by SKILL.md and its folder, Code Refactor For Reproducibility needs Python for the scripts in its folder and the command-line tools its instructions call (python and pytest). Our summary lists: Python 3.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.
Code Refactor For Reproducibility is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 3.1k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Code Refactor For Reproducibility: Writing Lean Proofs (trailofbits/skills, 7.4k stars), Setting Up Reproducible Analysis (K-Dense-AI/science-superpowers, 348 stars), Review R (pedrohcgs/claude-code-my-workflow, 1.6k stars) and Bio Workflow Management Wdl Workflows (GPTomics/bioSkills, 1.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
aipoch (a GitHub organization) maintains it in aipoch/medical-research-skills, which has 1,974 GitHub stars. The repository holds 567 skills in this directory. The repository was last updated on September 17, 2026.
Source: aipoch/medical-research-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.