fqih/.mycc-setup/notebook-hygiene
Claude Code and agent skill by fqih/.mycc-setup
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Use when working with Jupyter notebooks (.ipynb) — strip output before commit, pin kernels, ensure reproducibility, prevent JSON bloat in git, and integrate with mlflow experiments. Trigger on "notebook", ".ipynb", "jupyter", "strip output", "kernel".
Install
npx vskill@latest install fqih/.mycc-setup/notebook-hygieneSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as fqih/.mycc-setup/notebook-hygiene.
notebook-hygiene
Jupyter workflow yang bersih: notebook kecil di git, reproducible, siap production.
Output stripping (WAJIB sebelum commit)
Notebook dengan output = JSON bloat (ratusan KB per cell untuk plot). Solusi: nbstripout.
Setup satu kali per repo
Hook pre-commit otomatis strip semua cell output dari .ipynb yang di-stage. Wajib setup sebelum commit notebook pertama.
Manual strip (untuk file yang sudah terlanjur di-commit)
Verifikasi
Kernel pinning
Setiap notebook wajib declare kernel di metadata agar reproducibility terjaga.
Cek kernel di notebook:
Reproducibility rules (di setiap notebook)
- Random seed — wajib di awal eksperimen:
``python import numpy as np import random RANDOM_SEED = 42 np.random.seed(RANDOM_SEED) random.seed(RANDOM_SEED) # untuk torch: torch.manual_seed(RANDOM_SEED); torch.cuda.manual_seed_all(RANDOM_SEED) ``
- Environment lock —
requirements.txtatauuv.lock/poetry.lock. Commit lock file, bukan hanya constraints.
- Data versioning — kalau pakai dataset besar, hash + catat di cell pertama:
``python DATASET_HASH = "sha256:abc123..." # dari sha256sum data.csv ``
- No hardcoded paths — pakai
pathlib.Pathrelatif terhadap repo root, atau env var.
Struktur notebook yang baik
MCP integration (jupyter-mcp-server)
Kalau MCP jupyter aktif, pakai untuk eksekusi cell-by-cell:
- Start jupyter lab lokal:
``bash jupyter lab --port 8888 --IdentityProvider.token=claude-code-mcp --ip 127.0.0.1 ``
- CC punya akses ke tool MCP untuk:
execute_cell,read_cell,insert_cell,restart_notebook,list_kernels, multimodal output (plot/gambar inline).
- Selalu restart kernel sebelum eksekusi panjang untuk pastikan state bersih:
restart_notebook→execute_cellcell by cell → cek output di setiap step.
- JANGAN commit notebook dengan cell output besar (gambar base64, DataFrame preview panjang). Strip dulu.
Pre-commit checklist untuk notebook
Sebelum git commit:
- [ ]
nbstripoutoutput sudah jalan (cekgit diff --stat) - [ ] Kernel declared dan reproducible
- [ ] Random seed di cell pertama
- [ ] Tidak ada path absolut (
/home/fqih/...) - [ ] Tidak ada API key/secret hardcoded
- [ ] requirements.txt updated
Common pitfalls
| Pitfall | Solusi | |
|---|---|---|
| Notebook 5MB+ di git | nbstripout retroactive + .gitattributes filter | |
| Kernel "dead" setelah pindah env | python3 -m ipykernel install --user --name=... ulang | |
| Output beda tiap run (no seed) | Tambah np.random.seed, random.seed, torch seed | |
| Plot hilang di GitHub preview | Pakai %matplotlib inline (default), simpan figure ke file jika perlu | |
| Cell error lalu stuck state | Restart kernel + run all dari awal |
Invokation
Auto-trigger saat:
- Edit/tulis file
.ipynb - User bilang "notebook", "jupyter", "strip output"
- Pre-commit hook jalan dan ada
.ipynbdi staged
Manual trigger: /notebook-strip atau panggil skill ini langsung.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/notebook-hygiene/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
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/fqih/.mycc-setup/notebook-hygiene)