LikePrompts

AI Prompts for Dependencies: The Name Is a Claim, Not a Package

LikePrompts Editorial November 17, 2026
AI Prompts for Dependencies: The Name Is a Claim, Not a Package

Image generated with AI.

The install line arrives with total confidence, and the package may never have existed. If the name is free, someone can register it - and install scripts run before your first test. Three catalog prompts, one six-field card, four checks.

You ask for a feature and the model returns the file, install line included: two packages, one version, one command. AI prompts for dependencies begin right there, with a name written as confidently as a variable.

A variable cannot be published by a stranger. A package name is a claim about a public registry: if it exists, someone publishes under it; if not, the name is free - and the installer does not tell the two apart. The three moments the catalog covers - the plan that names the stack, the build that pins versions, the review that reads the diff - leave out what none of them can do: open the registry page and read who publishes.

Why an Invented Name Is Not a Typo

A typo stops your eye. An invented name does not: right length, right prefix, right lowercase noun. The problem is reading, not spelling.

The Model Writes the Shape of a Name

Package names have a shape: an author prefix, a lowercase noun, sometimes a scope. A code model learns that shape and reproduces it fluently, which is why the output looks convincing. A name with the correct shape and nothing behind it is indistinguishable, on the line, from a package with ten thousand weekly downloads. Nothing inside the name can be inspected; the only move that separates them is opening the page.

Consistency Is Not Existence

The invented name tends to come back on a second run, spelled identically; that repetition reads like agreement and is one source, not two. Spracklen and coauthors measured it in We Have a Package for You! A Comprehensive Analysis of Package Hallucinations by Code Generating LLMs (arXiv:2406.10279): 16 code generation models, two prompt datasets, 576,000 code samples, and an average of at least 5.2% hallucinated packages for commercial models and 21.7% for open-source ones, with 205,474 unique invented names. Read the direction, not the decimals: a correct name and an invented one are written the same way.

The Install Runs Before Your Tests

Installing can execute code that is not your code: npm's life-cycle reference lists preinstall, install and postinstall as scripts that run during npm install, taken from the package's own manifest (npm scripts documentation). The mechanism exists so packages can compile native modules; the consequence is still structural. Whatever runs at install time runs before your tests, your review and the lockfile you commit. The limit is not the quality of the code you read; it is the moment.

The Dependency Card: Six Fields Before the First Install

Six columns, filled by hand before the package manager is touched: name exactly as published, version pinned, last release date, who can publish, why we need it, the fallback if it disappears. Two are boring, two require a decision, two are the ones people skip.

The fourth decides more risk than the other five together: how many people can push a new version, and how long since the last one. A package with one maintainer and no release in two years is not abandoned and not malicious; it is a dependency with a single person in the chain, worth writing down before the line enters the lockfile.

AI Prompts for Dependencies, Step 1: Ask the Plan for the Registry Page

The first of the three prompts is not a security tool. It is where the name gets approved, the only place where changing it is free.

What the Planner Prompt Actually Says

The Claude App Builder (Spec to Code) prompt runs a gated protocol: STEP 1 REQUIREMENTS with up to five questions about users, feature, data, platform and must-haves; STEP 2 PLAN, proposing the stack through a slot for yours, the data model and the page structure, then waiting for approval; STEP 3 BUILD in verifiable chunks with manual test steps; STEP 4 HARDEN; STEP 5 TEST, reporting failures honestly. The package names appear in STEP 2, inside a plan you are being asked to approve.

The Line to Add to Step 2

Before approving, ask three things per dependency: the exact name as published, the registry page you will open, and one alternative that does the same job. This is not a question about whether the package exists - the model does not know, and asking produces a confident answer either way. It is the list of what you are going to check, written while the plan is still cheap to change.

The Approval Is the Last Cheap Gate

After the approval the same protocol builds, and the build writes the require line without asking again. The plan is where a dependency is approved; the build is where it is installed.

Step 2: The Build Pins a Version, Not a Publisher

What the Build Prompt Actually Says

The Docker & Deploy Builder prompt asks for a multi-stage Dockerfile with a non-root user, pinned versions, layer caching and a healthcheck; compose with networks, restart policies and limits; a reverse proxy with HTTPS; backups to object storage; a one-command deploy script with rollback; CI; and a SECURITY CHECKLIST covering secrets, exposed ports and image scanning. Every item is about the artefact you ship.

A Pin Is a Lock, Not a Verification

Pinning 1.4.2 protects you from a new release of the correct package. It says nothing about whether the package is the correct one. The image scan looks at the image that was built, while installation happens during the build: if the name was wrong, the scan can come back clean with the install code already executed. A pin freezes what goes in; it does not check who publishes it.

The Lockfile Is the Record

The committed lockfile is the evidence of what was installed, at which version, with which resolution. Without one, every machine builds a different tree and next month there is nothing to compare against. The layering and rollback half of this conversation is in the deployment pipeline post; here the requirement is that the dependency line have a date and a file behind it.

Step 3: The Review That Cannot Open a Registry

What the Review Prompt Actually Says

The Senior code review assistant prompt runs five passes - bugs and edge cases, security, performance, readability, missing tests - requires the exact line plus a proposed fix, limits its length, and closes with "if the code is correct, say so instead of inventing issues". That last rule is what makes it usable: a reviewer told to find something always finds something.

The One Line a Diff Cannot Check

A diff shows a new import. It cannot say whether the name exists, who publishes it, or when the last release happened, because the registry is not in the diff. The review of a change with new dependencies therefore has one stop outside the tool, and that stop is a browser.

Reviewer Rules Apply to You

The rule works in reverse too. If the reviewer may only report what it can justify from the code, a new dependency without written justification is a finding - even when everything compiles.

The Four Checks Before the Lockfile Line

1. The Registry Check

Search the exact name, in quotes, in the official registry and open the project page, not the first result: spelling, author and last release date are read there. If the name returns nothing, the decision is already made.

2. The Pin and Lock Check

Exact version in the manifest, lockfile committed. A clean install has to reproduce the same resolution; if it does not, the card is incomplete.

3. The Clean-Room Check

Install in an empty container with scripts enabled and run the tests there. It is the only place where install code runs without your credentials and your cloud tokens within reach.

4. The Owner Check

How many people can publish a new version, when the last release happened, whether the repository is archived. A single maintainer without a release in two years is not a verdict; it is a dependency with one person in the chain.

All four belong to the card, not the prompt: the model cannot open a page.

What the Model Cannot Decide For You

It does not know your registry, private or mirrored, or the version in your lockfile. It cannot verify a release, a maintainer or an archive date, and it cannot be asked whether a package exists, because the correct answer and the invented one are written identically. What it can do is hand you the list - names, versions, alternatives - over which you apply the card.

Start with the planner: run Claude App Builder and add the three-line dependency request to STEP 2, pin with Docker & Deploy Builder, and let the review assistant flag every import it cannot justify. This is a prompting guide, not a security audit and not legal advice: it does not say a package is safe or unsafe, it says where to look.

LikePrompts Editorial

Practical guides for getting the most out of AI prompts — written by the LikePrompts team.