agentleFS
gjbexgjbex/scientific-computing-skills/skills/scientific-notebook-workflows/SKILL.md

scientific-notebook-workflows

Skill1 starsChanged 6 months agoApache-2.0View on GitHub

Maintain reproducible scientific notebook workflows, including

The file

Show its rules and text

We split this skill into the rules it gives an agent

41 rules. About 0 are common, 34 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈34

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when scientific work uses Jupyter, Quarto, R Markdown, Pluto, or similar notebooks for exploration, reporting, demos, …

    line 10
  2. Distinctive:

    Use this skill when:

    line 28
  3. Very specific:

    Do not use this skill to replace project packaging or workflow orchestration.

    line 37
  4. Very specific:

    Use scientific-package-management for package layout and scientific-workflow-automation for multi-step pipelines.

    line 38
  5. Distinctive:

    When this skill applies:

    line 43
  6. Distinctive:

    Read the repository AGENTS.md first, if present.

    line 45
  7. Distinctive:

    Keep data paths, parameters, environment assumptions, and generated outputs explicit.

    line 50
  8. Distinctive:

    Avoid treating all notebooks the same.

    line 55
  9. Distinctive:

    Commit outputs intentionally when they are part of the repository contract, for example:

    line 75
  10. Distinctive:

    document that outputs are intentionally committed.

    line 85
  11. Distinctive:

    keep outputs small enough for review and repository size.

    line 86
  12. Distinctive:

    avoid embedding secrets, private paths, large binary blobs, or unstable random output.

    line 87
  13. Distinctive:

    Do not commit outputs merely because they happened to be present after an interactive session.

    line 93
  14. Distinctive:

    Keep reusable functions in importable modules or scripts.

    line 98
  15. Distinctive:

    Keep notebooks as consumers of project code, not the only implementation.

    line 99
  16. Distinctive:

    Use clear sections for setup, parameters, data loading, analysis, and results.

    line 100
  17. Distinctive:

    Avoid hidden state across non-linear execution order.

    line 101
  18. Distinctive:

    Prefer explicit parameters over editing cells before each run.

    line 102
  19. Distinctive:

    Keep long-running or expensive steps behind documented switches or cached inputs.

    line 103
  20. Distinctive:

    Use small example data or documented subsets for notebooks intended to run in CI or by new users.

    line 110
  21. Distinctive:

    Keep generated figures, tables, and exports in documented output locations.

    line 112
  22. Distinctive:

    Do not rely on user-local absolute paths.

    line 113
  23. Distinctive:

    Keep large datasets, caches, and generated outputs out of Git unless they are intentional release artifacts.

    line 116
  24. Very specific:

    Use scientific-data-management for large data and fixture policy.

    line 119
  25. Distinctive:

    Document the kernel, language version, and key packages.

    line 123
  26. Distinctive:

    Prefer using the repository's normal environment setup instead of notebook-only installation cells.

    line 124
  27. Distinctive:

    Avoid installing packages inside notebooks unless the notebook is explicitly a self-contained tutorial and the tradeoff is documented.

    line 126
  28. Very specific:

    Keep environment setup consistent with pyproject.toml, environment files, lockfiles, or project documentation.

    line 128
  29. Very specific:

    Use scientific-package-management when dependency structure needs cleanup.

    line 131
  30. Distinctive:

    Prefer smoke checks for tutorials and demos rather than full production runs.

    line 136
  31. Very specific:

    Consider checking execution with tools such as nbclient, pytest, nbval, Quarto render, or framework-native commands when they are already …

    line 138
  32. Distinctive:

    Keep notebook CI separate from heavyweight analysis unless the repository deliberately validates full reports.

    line 141
  33. Distinctive:

    If notebook execution is too expensive for CI, document the manual validation command and expected runtime.

    line 144
  34. Distinctive:

    Avoid committing execution-order chaos when the notebook is meant to be readable.

    line 150
  35. Distinctive:

    Treat large base64-encoded images or widgets as generated artifacts unless there is a clear reporting/demo reason.

    line 155
  36. Distinctive:

    Prefer small helper modules or scripts over a large migration unless the project is ready for that change.

    line 171
  37. Distinctive:

    Run the smallest representative notebook execution when practical.

    line 177
  38. Distinctive:

    If outputs are committed, rerun from a clean kernel or state why that was not done.

    line 178
  39. Distinctive:

    If outputs are stripped, verify no required report/demo output was removed.

    line 180
  40. Very specific:

    Check .gitignore and repository policy for generated figures, data, and notebook checkpoints.

    line 181
  41. Distinctive:

    When using this skill, briefly note:

    line 196

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Scientific Notebook Workflows

Use this skill when scientific work uses Jupyter, Quarto, R Markdown, Pluto, or similar notebooks for exploration, reporting, demos, documentation, or reproducible analysis.

Repository AGENTS.md instructions take precedence over this skill.

Purpose

Apply a pragmatic default for:

  • keeping notebooks reproducible, reviewable, and useful;
  • deciding when notebook outputs should be stripped or committed;
  • separating reusable logic from exploratory cells;
  • adding small execution or smoke-test paths for important notebooks;
  • documenting data, environment, and artifact expectations.

When To Use

Use this skill when:

  • notebooks are part of a scientific workflow, report, demo, tutorial, or analysis artifact;
  • notebook outputs cause review noise or reproducibility concerns;
  • reusable logic is trapped inside notebook cells;
  • notebooks need CI execution, smoke checks, or conversion to scripts;
  • GitHub preview of notebook outputs is intentionally useful.

Do not use this skill to replace project packaging or workflow orchestration. Use scientific-package-management for package layout and scientific-workflow-automation for multi-step pipelines.

Working Approach

When this skill applies:

  1. Read the repository AGENTS.md first, if present.
  2. Identify the notebook role: exploration, report, demo, tutorial, documentation, or workflow step.
  3. Decide the output policy based on that role.
  4. Factor reusable logic into scripts, modules, or package code when practical.
  5. Keep data paths, parameters, environment assumptions, and generated outputs explicit.
  6. State what was made reproducible, what remains exploratory, and how the notebook should be reviewed.

Avoid treating all notebooks the same. Exploration notebooks, report notebooks, and CI-executed notebooks have different contracts.

Notebook Roles

  • exploration: scratch or early-stage investigation, often not release-critical;
  • analysis: reproducible computation over known inputs;
  • report: narrative result presentation intended for readers;
  • demo: runnable or previewable example of project behavior;
  • tutorial: teaching material with explanatory output;
  • workflow step: notebook is part of an automated or documented pipeline.

The role determines whether outputs, execution order, and CI expectations need to be strict.

Output Policy

Strip outputs by default when notebooks are primarily source artifacts and the outputs are reproducible, noisy, large, or irrelevant to review.

Commit outputs intentionally when they are part of the repository contract, for example:

  • report notebooks where GitHub preview is useful to readers;
  • demo notebooks where rendered output shows expected behavior;
  • tutorial notebooks where outputs are instructional;
  • publication or release artifacts where the rendered result is reviewed.

When committing outputs:

  • document that outputs are intentionally committed;
  • keep outputs small enough for review and repository size;
  • avoid embedding secrets, private paths, large binary blobs, or unstable random output;
  • record the environment and command used to regenerate the notebook;
  • rerun from a clean kernel before committing if the notebook is meant to be reproducible.

Do not commit outputs merely because they happened to be present after an interactive session.

Structure and Reusable Logic

  • Keep reusable functions in importable modules or scripts.
  • Keep notebooks as consumers of project code, not the only implementation.
  • Use clear sections for setup, parameters, data loading, analysis, and results.
  • Avoid hidden state across non-linear execution order.
  • Prefer explicit parameters over editing cells before each run.
  • Keep long-running or expensive steps behind documented switches or cached inputs.

Notebook cells should tell a readable story without becoming the project's API.

Data and Artifacts

  • Use small example data or documented subsets for notebooks intended to run in CI or by new users.
  • Keep generated figures, tables, and exports in documented output locations.
  • Do not rely on user-local absolute paths.
  • Record data provenance, checksums, filters, and preprocessing where they affect interpretation.
  • Keep large datasets, caches, and generated outputs out of Git unless they are intentional release artifacts.

Use scientific-data-management for large data and fixture policy.

Environment and Dependencies

  • Document the kernel, language version, and key packages.
  • Prefer using the repository's normal environment setup instead of notebook-only installation cells.
  • Avoid installing packages inside notebooks unless the notebook is explicitly a self-contained tutorial and the tradeoff is documented.
  • Keep environment setup consistent with pyproject.toml, environment files, lockfiles, or project documentation.

Use scientific-package-management when dependency structure needs cleanup.

CI and Smoke Checks

  • Execute important notebooks in CI only with small inputs and stable outputs.
  • Prefer smoke checks for tutorials and demos rather than full production runs.
  • Fail clearly when a notebook cannot run from a clean checkout.
  • Consider checking execution with tools such as nbclient, pytest, nbval, Quarto render, or framework-native commands when they are already part of the project.
  • Keep notebook CI separate from heavyweight analysis unless the repository deliberately validates full reports.

If notebook execution is too expensive for CI, document the manual validation command and expected runtime.

Review Hygiene

  • Minimize irrelevant metadata churn.
  • Avoid committing execution-order chaos when the notebook is meant to be readable.
  • For output-stripped notebooks, verify the notebook still runs after stripping.
  • For output-committed notebooks, ensure the output diff is meaningful and not just stale execution noise.
  • Treat large base64-encoded images or widgets as generated artifacts unless there is a clear reporting/demo reason.

Reviewers should be able to distinguish source changes from generated output changes.

Converting Notebooks

Factor notebook logic out when:

  • multiple notebooks copy the same code;
  • tests need to cover notebook logic;
  • a workflow depends on notebook internals;
  • performance profiling or packaging requires a script/module boundary;
  • notebooks are too large or fragile to review.

Prefer small helper modules or scripts over a large migration unless the project is ready for that change.

Validation Defaults

  • Open or inspect the notebook metadata when output policy changes.
  • Run the smallest representative notebook execution when practical.
  • If outputs are committed, rerun from a clean kernel or state why that was not done.
  • If outputs are stripped, verify no required report/demo output was removed.
  • Check .gitignore and repository policy for generated figures, data, and notebook checkpoints.

Anti-Patterns

  • keeping the only implementation of a workflow inside notebook cells;
  • committing huge outputs or private paths by accident;
  • stripping outputs from report/demo notebooks where preview is the point;
  • relying on hidden kernel state;
  • adding notebook-only dependency installation that diverges from the project environment;
  • treating a rendered notebook as validated when it was not rerun cleanly.

Output Expectations

When using this skill, briefly note:

  • the notebook role and chosen output policy;
  • whether outputs were stripped, retained, regenerated, or intentionally committed;
  • which reusable logic, data paths, environment assumptions, or generated artifacts changed;
  • which notebook execution or render checks were run;
  • what remains exploratory, manual, or too expensive to validate.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.