Keeps research code lean by identifying real owners, callers, and existing capabilities before adding surface. Use when writing, extending, or reviewing research code.
Ships in research-code-parsimony. 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.
Before adding code, be able to state:
Search before creating an owner. If none fits a genuinely new capability, create one clear owner rather than forcing unrelated behavior into an existing module.
When copying or adapting third-party code, put a searchable SOURCE_COPY:
comment next to each retained block. Record the source URL, commit/version,
file or function, license, and substantive local changes. A shared nearby
comment may cover a clearly identified contiguous block. Copy only the pieces
needed; preserving an obsolete upstream launcher is not required for fidelity.
An ordinary import is dependency reuse, not copied source.
During experimentation, these comments suffice for project acknowledgements;
do not add speculative README entries. Before publishing or releasing the
system, search for SOURCE_COPY: and acknowledge surviving components in the
README. Preserve license-required copyright, attribution and notices from the
moment code is copied; those obligations cannot wait for publication.
Prefer a meaningful package hierarchy over a flat directory of long,
repeated-prefix filenames. When several modules belong to one scientific or
contract family, let the directory carry that context and give the modules
short role names: for example,
training/concentration_field/diffusion/runtime.py rather than
training/concentration_field_diffusion_runtime.py. A separate
training/physics_field/direct_inverse/ can own its own data, objective, and QC
modules; genuinely shared training infrastructure stays at the shared level.
Group by cohesive ownership, not chronology, and add depth only when it makes
navigation and responsibilities clearer. Do not create speculative package
trees or duplicate a family merely to achieve symmetry.
Apply this preference when choosing a new owner's home. Existing flat families can move in a bounded, authorized pass coordinated with their current owners; this preference does not authorize reorganizing active work during another task. Leave queued/running execution checkouts and immutable run artifacts untouched. Move live imports, entrypoints, config references, and hashed execution declarations together, updating valid source pins according to local policy. Validate the affected execution paths and remove old module routes without compatibility aliases. Completed runs retain their producing layout through their pinned commits, not duplicate source at HEAD.
When a change genuinely supersedes an existing implementation, retire it in the same scoped change:
Retire only what your change supersedes. Note other sprawl you noticed rather than turning the task into a repository-wide cleanup.
When implementing or reviewing, flag:
Different scientific conditions can warrant separate configs; judge duplicated behavior, not visual similarity. Keep justified model/config flexibility and diagnostics that make results interpretable. A review-only request authorizes findings, not applying changes.
Explicit user requirements and project-local safety, provenance, retention, validation, execution, and scope rules outrank any impulse to simplify. Read local instructions rather than inventing universal experiment, retention, or testing policies.
Match the check to the claim: imports and compilation check mechanics, not numerical equivalence or scientific validity. Exercise the affected contract when results could change, using the cheapest appropriate check local policy allows. Add tests or documentation only when justified and permitted, not as a ritual.
Report what you added, what you reused, what you retired and on what evidence, and which check you ran, proportional to the change.
Inspired by Ponytail's reuse-first approach to avoiding unnecessary code.
job-babysitting has what the agent does next.Deleting what your change supersedes is part of that change, not maintenance. When a step replaces a mechanism, estimator, renderer, config, or owner, remove the superseded implementation, its configs, and the helpers it alone used in the same commit, reroute every live caller, and confirm no live reference survives.
History and the completed run's recorded commit preserve the exact producing source, so a superseded path need not stay executable — and a still-runnable invalid path is worse than an absent one, because a later reader cannot tell which is current. This does not require a maintenance session and the maintenance-lane rules do not restrict it.
Run disposable edits and migrations through standard input when practical. If a one-off helper must be written to disk, delete it and its temporary launch files as part of finishing the task, without waiting for a separate cleanup request. First verify that no queued/running job or current caller still needs the files; defer deletion only with that concrete dependency and its cleanup condition recorded in the owning notebook. Do not retain unused helpers as backups.
Keep the resulting maintained code/config and the useful change record, rather than the script that mechanically edited them. A producer needed to regenerate a scientific artifact is not disposable: integrate it into the owning module and record its invocation/provenance. Apply the same cleanup to delegated workers before their changes are integrated.
find in a shell wrapper encoding the same rule. Expect the stale copy to be
the one whose output nobody validates, because nothing fails when a README lies.At a CSV or JSON serialization boundary, normalize and validate typed fields
explicitly. Serialization is lossy about type in ways that stay invisible until a
consumer reads the file: an integer comes back as text, a missing identifier
deserializes as a float NaN and then enters numeric aggregation, a boolean becomes
the string "False" which is truthy.
An in-memory type match is not a serialization contract. Before any fan-out, exercise the real path end to end on one real case — producer write, serialized read, and whatever the reducer or finalizer validates — and require clean logs. Checking the object you are about to write tests the wrong half; the defect lives in the round trip.
_v1, _v2, or
_v3 in live code filenames; history tracks source versions, and a successor
must either keep the one canonical filename or take a human-meaningful name for a
genuinely different mechanism. Update all callers and delete the superseded
implementation rather than keeping both names. Explicit versions remain
appropriate inside immutable serialized schema identifiers, artifact/run slugs,
and provenance records where they distinguish incompatible stored contracts — but
not in executable owner filenames.snake_case semantic slugs naming the
artifact, the dataset or mechanism, and the main differing knob. Apply this to
run and output directories and to run-name fields; keep details in config, queue
items, or provenance. Avoid opaque-only IDs, double underscores, repeated parent
context, and external-tool style unless required.RUN=... for nested artifacts.git grep omits untracked
files unless told otherwise, so a module whose only callers are uncommitted work
in progress scans as unreferenced. Three separate retirements in one session
deleted live modules for exactly this reason, and the affected work had no run
evidence either, because its run had not happened yet.EXECUTION_FILES has zero importers and is still load-bearing: deleting it raises
at run start, which no import check can see. Validate a retirement by running the
execution-path check, not only by importing what survived.A shell reads its script incrementally and a long-running interpreter may reread or
lazily import, so shifting byte offsets under a live process can make it resume
mid-statement on text that was never a command. Check for a running instance first.
When one exists, either wait, or write the replacement to a new path and mv it
over the target so the running process keeps its original inode. An in-place edit
mutates that inode and is the operation to avoid.
Scope a log or stream guardrail to a bounded window with an explicit boundary rather than forbidding a marker anywhere in the artifact. Orderly teardown routinely emits error text that healthy execution produced, so a rule that greps the whole artifact rejects working runs.
Validate a rejection rule against a real passing artifact as well as against every failure shape it must still catch. A guardrail proven only against the failure it was written for is half tested; the question that matters is what makes it fire wrongly.
Never place a guardrail that can reject an already completed run immediately before an irreversible reduction, and keep it outside any hash-bound owner set. Repairing a false positive inside that set re-binds provenance, and the affected run can then no longer be reduced under its own producing commit — so the fix for a spurious rejection destroys the result it was trying to protect.
Before applying a formatter to a legacy shared owner, check whether it would rewrite unrelated lines. Format new files or edited regions without reformatting the rest of the owner.
Before pushing a config-backed entrypoint, or extending a helper from a narrow case set to a broader cohort, run the real structured config/prepare path at the broadest intended scope and enumerate the helper's semantic preconditions. Compile, import, or narrow-case checks are not sufficient.
What SKILL.md sets; muted values are Claude Code's defaults
/research-code-parsimony:research-code-parsimonyfrom research-code-parsimony
npx claudepluginhub uchicago-dsi/ai-sci-skills --plugin research-code-parsimonyOther plugins' skills for the same job