/research-engineering-code:research-engineering-codefrom research-engineering-code
Use for any change to research or experiment code in any language: training and evaluation loops, losses, metrics, data loading and splits, simulations and solvers, experiment runners and configs, seeding and reproducibility, or tests for any of these. Covers everyday requests such as 'fix this bug in training', 'add X to the model', 'make runs reproducible', 'check why these results look wrong', 'write tests for the metrics', 'set up experiments from config files', 'refactor train.py without changing results', '给训练加早停', '修一下这个 bug', '重构一下但结果不能变'. Makes the agent work from a short design of the whole, build a thin end-to-end path and grow it, add only what the purpose needs, and verify both the numbers and the pipeline. Skip it for questions with no code change, one-off plots or scripts the user calls throwaway, and dependency or config chores.
Ships in research-engineering-code. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Research code has one job and two kinds of reader. The job is to produce a result someone will trust, and wrong research code rarely crashes: it returns a plausible number. The readers are the people who will run it and the people who will change it later. So the code has to be right in a way that can be checked, and clear in a way that can be maintained.
Both come from working from a design of the whole. The design is written into the code first, and it decides the structure, the order of building, and what the final report is checked against. Everything below is that one thread.
Scale it to the change: for a one-line fix the design is one sentence, and the rest is a test and a run. The project's own language, layout, test framework and commands always win; do not add tooling unasked. Respond in the user's language.
Before anything else, run grep -ls research-engineering-code CLAUDE.md AGENTS.md at the repository root. You need its answer at the end (section 6).
Read the path the change sits on, from where data enters to where a result comes out. Then put the design down before any implementation.
New module, command or pipeline. Your first edit creates the entry module with nothing in it but its header docstring (or the language's header comment), and the design goes there:
Existing output changed:, naming every existing command or function whose results would differ after your work, or none. The user will see and depend on this part, so it is theirs to decide.No code in that edit. The design comes first because every later step uses it, and it stays in the file as the first thing the next reader sees. Keep it to about a dozen lines. If building shows it was wrong, change it and say so.
Change inside existing code. No new file is needed; go straight to the test (section 4).
Then keep working. Note each choice the request left open as an assumption for the report: a user can correct a stated assumption faster than they can answer a question.
There is one place to stop. If Existing output changed is not none, ask before making that change, and build the rest so that it does not depend on it. Results someone already has are theirs to change, even when they look wrong or unrepeatable and the change would serve the request. Beyond that, ask only when a wrong guess would be expensive to undo.
Worked designs for a local change and for a new cross-language pipeline are in references/decomposition-example.md.
Two kinds of thing can be added, and they are judged differently.
Changing what existing code outputs is the user's decision too. Report a bug you find outside the request; fix it only if asked, because a silent fix changes numbers someone may rely on. When the user calls the work throwaway, its purpose is a single use: write the script and nothing else.
A reader should be able to find each responsibility from the design in one place in the code, with its tests where the project keeps tests.
Patterns and per-language equivalents are in references/test-patterns.md.
End by checking the result against the design:
Last, the grep you ran at the start. If it printed a file name, say nothing about setup. If it printed nothing, close with one line: "This skill is not set up for this project, so it may not load on its own next time; ask me to set it up if you want that." Do not edit either file yourself.
Results come only from real runs. Do not describe an outcome you did not run, and label smoke-run numbers as such.
Do this only when the user asks to set this skill up in a project, and do nothing else in that turn. The project's instruction file is the one your host reads at the repository root: CLAUDE.md in Claude Code, AGENTS.md in Codex.
research-engineering-code, say so and stop.CLAUDE.local.md instead.Before changing research or experiment code in this repository (training, evaluation, losses, metrics, data, simulations, experiment runners, or their tests), load the research-engineering-code skill and follow it. Not needed for questions with no code change, throwaway scripts, or dependency and config chores.
The rule is what makes the skill load reliably: an instruction file is followed, while a skill description is only one entry in a list.
For a Python project with no linter configuration, assets/python/ holds a ruff and pytest snippet to offer when the user wants one.
README.md (opens in a new tab)agents/openai.yaml (opens in a new tab)assets/python/pre-commit-config.yaml (opens in a new tab)assets/python/pyproject-snippet.toml (opens in a new tab)references/decomposition-example.md (opens in a new tab)references/test-patterns.md (opens in a new tab)tests/acceptance/test_c01_label_smoothing.py (opens in a new tab)tests/acceptance/test_c02_running_stats.py (opens in a new tab)tests/acceptance/test_c03_seed_determinism.py (opens in a new tab)tests/acceptance/test_c03i_seed_bug.py (opens in a new tab)tests/acceptance/test_c04_logging.py (opens in a new tab)tests/acceptance/test_c05_restructure.py (opens in a new tab)tests/acceptance/test_c07i_throwaway_plot.py (opens in a new tab)tests/acceptance/test_c09_experiment_runner.py (opens in a new tab)tests/acceptance/test_c09i_config_runner.py (opens in a new tab)tests/acceptance/test_c10_empty_accuracy.py (opens in a new tab)tests/acceptance/test_c10i_empty_accuracy.py (opens in a new tab)tests/acceptance/test_c11i_balanced_accuracy.py (opens in a new tab)tests/acceptance/test_h01_macro_f1.py (opens in a new tab)tests/acceptance/test_h02_split_standardize.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub lkcy23/claudespace --plugin research-engineering-code