| name | learn-shit |
| description | Generate Jupyter notebooks that teach a user-chosen topic by interleaving compact theory, runnable experiments, visualizations, and a small culminating build. Use when the user asks to learn a topic through a notebook, wants a theory-plus-practice tutorial, mentions the spinning donut tutorial style, or asks for an .ipynb lesson in this format. |
Learn Shit
Quick Start
When the user gives a learning topic, create a real .ipynb tutorial that feels like the reference notebook in references/spinning_donut.ipynb: small conceptual steps, immediate code checks, formulas where useful, and a concrete mini-project that combines the ideas.
Default to Chinese prose if the user writes in Chinese; otherwise use the user's language.
Workflow
- Read the user's topic and infer the target level. If unclear, assume a curious beginner who can run Python.
- Read or inspect
references/spinning_donut.ipynb directly as the style and structure reference. Do not rely on a separate extracted summary when the notebook itself is available.
- Choose one tangible final artifact for the lesson: simulation, visualization, parser, toy model, solver, animation, or terminal/HTML display.
- Build the notebook as a sequence:
- Title cell:
# <topic>; add a subtitle or short intro only if it helps. Do not force 101 into the title.
- Motivation and environment setup.
- "What are the steps?" roadmap with 3-6 bullets.
- Concept blocks: each concept gets a short markdown explanation, optional math, then a small code cell that proves or explores it.
- Composition blocks: combine earlier pieces into larger functions.
- Final build: render, animate, simulate, or evaluate something visible.
- Reflection/exercises: 3-5 small modifications the learner can try.
- Save as a valid notebook with executable Python code and minimal dependencies.
Notebook Style Rules
- Prefer short markdown cells over long lectures.
- Every abstract idea should be followed quickly by runnable code.
- Use
numpy, matplotlib, IPython.display, and standard library tools when enough; add heavier libraries only when the topic truly needs them.
- Introduce names by using them, then explain just enough to keep momentum.
- Show intermediate arrays, tables, plots, or printed output so the learner can inspect the machinery.
- Keep code cells focused. One cell should teach one idea or build one reusable piece.
- Let the final artifact be playful or inspectable, not just a numeric answer.
- Avoid hidden magic: define helper functions in the notebook before using them.
- Include comments only where they orient the learner.
Bundled Reference
Use the complete bundled notebook at references/spinning_donut.ipynb as the example. Match its overall rhythm and notebook-native teaching style while adapting the content to the requested subject.