What you actually installed
By the end of this lesson you will have your own declared and installed package counts in the README, an audit step in CI that fails on anything that ships with the app, and each finding you chose not to fix written down with the reason.
Before anything is public, look at what is in it. Most of your repository is code you did not write and have never read.
Eleven, and four hundred and thirty-four
Measured on the starter repository on 2026-08-26:
| Declared dependencies | 3 |
| Declared dev dependencies | 8 |
| Packages in the lockfile | 434 |
Eleven decisions, four hundred and thirty-four packages. That ratio is normal for this ecosystem and it is worth sitting with, because every one of those 434 runs with the same permissions as your code, and several of them run at install time.
This is not an argument for writing everything yourself. It is an argument for knowing the number, which almost nobody does.
Run the audit, and read it properly
npm audit on every push, and read the output with three questions:
Is it reachable? A vulnerability in a dev-only tool that never touches a request is a different risk from one in your HTTP path. --omit=dev separates them, and the difference is usually most of the list.
Is there a fix? npm audit fix handles most, and the ones it cannot are the ones that need a decision.
What does the decision cost? Sometimes the fix is a major version and half a day. That is a legitimate trade to make deliberately and record — not one to make by ignoring the output for six weeks.
Commit the lockfile, and know why
package-lock.json is committed. Without it, "the same code" installs different versions on your machine and in CI, and a bug that only appears in one of them is very hard to reason about.
With it, npm ci installs exactly what the lockfile says. Use npm ci in CI and npm install locally — the first is reproducible and fails on a mismatch, the second updates the lockfile, and using the wrong one in the wrong place is how a dependency drifts in without a diff.
Before adding a dependency, ask what it replaces
One question, applied honestly: is this more code than I would write?
A date library replacing twenty lines is a good trade. A package that formats a percentage is a supply chain you took on to avoid toFixed. The version of this that actually bites is not one obvious mistake; it is thirty small conveniences, each defensible alone.
Your assistant will suggest dependencies readily, because that is what most code it has read does. It is the right moment to apply Build Your First Tool's habit of reading what you were handed and asking what a line actually buys.
Try it now
Count your own two numbers — declared versus lockfile — and put them in the README's architecture section. Then run the audit with and without --omit=dev and see how much of the list is not actually reachable from a request.
The prompt
Mock mode on, plan mode on, and paste:
Count what this repository depends on: the dependencies and
devDependencies declared in package.json, and the packages in
package-lock.json, and show me the command you counted with. Then run
npm audit and npm audit --omit=dev, and for each finding say whether
it ships with the app or is dev-only, and whether npm audit fix
resolves it without a major version. Change nothing yet. After I
decide, run npm audit fix for any fix I approved, then npm audit again,
and treat a finding the second run still lists as not fixed, whatever
the first run said. Write the two counts under How it works in
README.md, add a step running npm audit --omit=dev right after npm ci
in the checks job of .github/workflows/key-scan.yml, and put every
finding still open in REVIEW.md with my reason and a date to look again.
A good answer counts, triages and waits for you. After your decisions it changes README.md, the workflow and REVIEW.md — and package-lock.json only if you approved a fix, through npm audit fix rather than an edit by hand.
Check it yourself
- The declared count matches what you see in
package.jsonby eye; the installed count comes with the command that produced it, so you can run it again later. - The
--omit=devlist is shorter than the full one, and every finding missing from it belongs to a tool that never handles a request. - In the workflow, the audit step comes after
npm ci, never afternpm install. - Every finding left open has a line in
REVIEW.md: what it is, why it stays, when you will look again. That includes a findingnpm auditsaid had a fix and the second run still lists: it happens when even the newest release of the package that pulls it in still depends on the vulnerable version.
Compare with ours
# .github/workflows/key-scan.yml, checks job
- run: npm ci
- run: npm audit --omit=dev # what ships with the app; any finding fails the run
# counted with
node -p "Object.keys(require('./package-lock.json').packages).filter(Boolean).length"
REVIEW.md
Dependency audit, <date>
<package> dev only, never handles a request left open: the fix is a major
version; look again at the
next framework upgrade
The full state at the end of this unit is on the starter's branch ref/ship-your-tool/u2.
Checkpoint
git status # the files you expect, and no .env file
git add -A
git commit -m "Dependencies counted in the README, audit of what ships in CI, open findings decided"
Then answer this lesson's questions.