Go from never having used a coding agent to working productively and safely with one. The learner should understand what an agent is and how it differs from a chat assistant. They should choose a tool, set up a protected first project, describe tasks the agent can do well, and follow and verify its work. They should recover from bad changes, manage context, and plan bigger changes. They should also use tests as the definition of done and run everyday workflows (bug fixes, features, writing tests, codebase exploration, scripts, small tools, refactors). Throughout, they should keep secrets and systems safe and keep their own understanding growing instead of outsourcing it.
Dependencies, package managers and lockfiles
card 3 of 6
Where to look, what to touch
builds on: How a code project is laid out
- **JavaScript:** `npm` · manifest `package.json` · lockfile `package-lock.json` · files in `node_modules/`
- **Python:** `pip` · manifest `requirements.txt` or `pyproject.toml` · install the listed packages with `pip install -r requirements.txt` · `pip install` writes no lockfile, but tools like Poetry and uv do (`poetry.lock`, `uv.lock`) · files often in `.venv/`
Rules:
1. Add packages with the manager's command (`npm install <name>`). Never write the lockfile by hand.
2. To get exactly the same versions, install from the lockfile (`npm ci`).
3. Don't copy install folders around, because they contain files set up for one specific machine. Reinstall instead.
Terms on this card
- package
- A bundle of reusable code that someone published so other projects can use it, e.g. `express` or `requests`.
- npm
- The standard package manager for JavaScript projects. It reads `package.json` and installs packages into `node_modules/`.
- npm install
- The npm command that installs packages. With a name (`npm install <name>`), it adds that package and updates `package.json` and `package-lock.json`. Without a name, it installs everything the project lists.
- npm ci
- An npm command that installs exactly the versions in `package-lock.json`. It fails if the lockfile and the manifest disagree.
- pip
- The standard package manager for Python. It installs packages from PyPI, often listed in `requirements.txt`.
Lesson goal: Explain that projects pull in external packages through a package manager (pip, npm, ...), listed in a manifest and pinned in a lockfile. Explain why installing a package runs someone else's code on your machine. ·
the whole lesson