dmccreary/claude-skills/docker-python-lab
Claude Code and agent skill by dmccreary/claude-skills
- community
Checking that the SKILL.md file is still in the repository.
Generates an interactive Docker Python lab block for MkDocs textbook pages, where students write and run real Python code inside an isolated Docker container. Use this skill whenever someone asks to add a Python lab, code runner, interactive Python exercise, or runnable code block to a textbook page that uses Docker (not Skulpt). Also use it when adding multiple labs to a single page, setting up the shared CSS/JS infrastructure, or creating a timing/benchmark lab that shows students how long each phase takes. Always invoke this skill instead of writing docker lab HTML by hand.
Install
npx vskill@latest install dmccreary/claude-skills/docker-python-labSKILL.md
Docker Python Lab Generator
What This Skill Does
Generates interactive Python lab blocks for MkDocs pages in the learning-python textbook (or any MkDocs project following the same pattern). Each lab shows a code editor, Run and Reset buttons, and an output area. Code runs inside a fresh, isolated Docker container via a local HTTP service on port 5001.
This is the Docker counterpart to the Skulpt lab pattern — same look and feel, but students run real Python (not browser-emulated Python) with access to the full standard library and third-party packages.
Prerequisites: Shared Infrastructure
Before generating any lab block, make sure the shared files exist. Check once per session; skip if already in place.
1. Check / create docs/css/docker-lab.css
If the file is missing, copy from the skill's assets:
2. Check / create docs/js/docker-lab.js
3. Add to mkdocs.yml (if not already present)
Check extra_css and extra_javascript in mkdocs.yml. If the entries are missing, add them:
Do not duplicate entries that are already there.
4. Verify the service script exists
The runtime service lives at scripts/run-python-docker.sh. If it is missing from the project, tell the user — the labs won't work without it.
Lab HTML Template
Each lab needs a unique suffix — a short string that distinguishes it from other labs on the same page. Use "1" for the first lab, "2" for the second, and so on. The suffix appears in every element ID so the JS can find the right elements.
Standard lab (text output only)
Rules:
- Replace every
SUFFIXwith the same string (e.g.,1,2,hello-world). - Put the Python code directly inside the
<textarea>tag — no extra indentation
relative to column 0, because leading spaces become part of the code.
- The
</textarea>closing tag must be on its own line with no trailing spaces
before it; any blank line between the code and </textarea> adds an empty line in the editor.
- Do not add
rows="N"— the JS auto-sizes the textarea to fit the code. - Do not add
id="main"to any element — that conflicts with the p5.js canvas
parent convention used elsewhere in this project.
Timed lab (shows phase-by-phase timing breakdown)
Only add this variant when the lesson is specifically about how Docker execution works. It requires suffix "4" by convention and adds a timing table below the buttons.
Complete Page Pattern
A page with three labs looks like this:
Choosing Good Lab Code
- Keep starter code short (5–15 lines) so students can read it at a glance.
- Every lab should produce visible output — at least one
print()call. - Avoid `input()` — there is no stdin in the Docker runner.
- Avoid file I/O — the container has no persistent filesystem.
- Avoid `import` of non-stdlib packages unless
python:3.11-alpineincludes
them (it ships only the stdlib).
- Match the "See It — Run It — Modify It" rhythm from the Skulpt labs:
starter code runs and shows something, then "Try these experiments" gives specific, achievable modifications.
Service Not Running — User-Facing Error
If a student clicks Run before starting the service, the lab shows:
Cannot connect to the Python Docker service.Please open a terminal and run:bash scripts/run-python-docker.shThen reload this page and try again.
No extra error handling is needed in the page markdown — docker-lab.js handles this automatically.
Multiple Labs per Page — Checklist
When generating labs for a single page:
- [ ] Each lab has a unique suffix —
1,2,3, … - [ ] Every element ID includes that suffix (
docker-lab-1,docker-code-1, etc.) - [ ] Button
onclickpasses the matching suffix string:runDocker('2') - [ ] No two labs share a suffix on the same page
- [ ] The page opens with a "Start the Docker service" instruction block
- [ ]
docs/css/docker-lab.cssanddocs/js/docker-lab.jsare inmkdocs.yml
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/archived/docker-python-lab/SKILL.md
Popularity
- Repository stars
- 91
- Repository forks
- 12
- 7-day trend score
- 23
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/dmccreary/claude-skills/docker-python-lab)