Goal
SkillCloud & infraKeep the Docker container aligned with the template and install Python packages directly in the notebook
Available today. Use it from your connected AI after setup.
No other account needed.
Connect ahel once, and every AI you use reads what you have installed.
Then ask your AI: use the Goal skill
What this skill tells your AI
The instructions your AI receives, as published by causify-ai/helpers in .claude/skills/notebook.fix_packages/SKILL.md and read by ahel’s review.
- When creating Docker images for projects and tutorials, we want to
- Try to use always the same Docker template image from the
class_projectto avoid replication of Docker containers - Install the needed packages in the notebooks to customize the container
- Try to use always the same Docker template image from the
Inputs
- The user passes:
- A pointer to a target directory
<TARGET_DIR>(e.g.,msml610/tutorials/L03_knowledge_representation) that was cloned fromclass_project/project_template - (Optional) pointers to Jupyter notebooks
- A pointer to a target directory
Workflow
Use the Docker Container From the Project Teamplate
- In the directory with the project (e.g.,
msml610/tutorials/L03_knowledge_representation) we want to use the sameDockerfileandrequirements.txtas the corresponding files inclass_project/project_template(so that the Docker container for the project is the same as the template used for class project) - If something needs to be added to the Docker image (e.g., a package that can't be
installed with
pip) then it's ok to add it toDockerfilebut it should be clearly commented why that package is needed
Discover All Packages Needed by the Notebook
-
A notebook's own
importlines are not the full picture: each notebook is paired with a*_utils.pyfile (e.g.,L03_06_logic_solvers.ipynb->L03_06_logic_solvers_utils.py), and that file is imported with a line like:import L03_06_logic_solvers_utils as utils -
Read the
*_utils.pyfile (and any other local module it imports, transitively) and collect every third-partyimport/from ... importstatement in it, not just the ones in the notebook itself -
Map import names to their pip package name where they differ (e.g.,
cv2->opencv-python,sklearn->scikit-learn,PIL->Pillow,yaml->PyYAML) -
Diff this full package list against
requirements.txtandDockerfile: any package used by the notebook or its utils file that is missing from both is a bug, even if it happens to already be installed in whatever container was used to author the notebook -
Add every missing package to
requirements.txt(and toDockerfileonly if it can't be installed withpip, per## Use the Docker Container from the Project Teamplateabove)
Add Packages to Notebooks
-
Then we want to add
pip installthe packages needed in each notebook, including every package found in## Discover All Packages Needed by the Notebookabove, by installing and pinning down the packages -
For each notebook we want to add after the first call with
%load_ext autoreload %autoreload 2 import logginga cell with content like:
!pip install -q python-sat==1.9.dev15 sympy==1.14.0 z3-solver==5.1.0.0 import pysat print("pysat version: ", pysat.__version__) import sympy print("sympy version: ", sympy.__version__) import z3 print("z3 version: ", z3.get_version_string())
Sync Notebook
- At the end, sync the paired
.pyfile with Jupytext following the conventions in# Code Architecture and Responsibility->## Utilities vs. Notebook Responsibilitiesin.claude/skills/notebook.rules.md
Verification
- Every third-party import in the notebook and its paired
*_utils.pyfile has a matching entry inrequirements.txtand in the notebook'spip installcell - Build the docker container with
docker_build.shinside the target dir<TARGET_DIR> - Make sure the container builds correctly and it's the same as the Docker container for the project, if possible
- Run each notebook inside the docker container with
docker_cmd.shandnbconvertto make sure they run correctly end-to-end
Conventions
- Always follow the conventions and guidelines in
.claude/skills/notebook.rules.md
Signals
- GitHub stars
- 146
- Forks
- 161
- Last commit
- Sep 2026
ahel review
K1binfo
installs-packages
Automated review, not a security audit. Ruleset v1+k2.
Advanced
- Catalog kind
- skill
- Gateway key
notebook-fix-packages- Source
- github.com/causify-ai/helpers