Dependency quality gate for AI agents and CI
A dependency quality gate for CI pipelines and AI coding agents such as Claude Code, Codex or Cursor. --json gives a versioned report to read, --fail-on turns chosen problems into a non-zero exit code, and a JSON run never stops to ask anything.
The contract
- Versioned JSON.
--jsonprints one object following schemaVersion 3. Every row carriesflags, the reason for each flag (deprecatedmessage,unknownreason,latestNode), pluslatestInMajorandrepository, which tell an agent the safe in-major target and where to read the changelog. - Exit codes.
0when no--fail-onproblem is found,1when one is,2on a usage or runtime error (nopackage.json, npm not found, invalid options,npm outdatedfailing). - Gate policy.
--fail-ontakes any ofdeprecated,stale,outdated,unknown, comma-separated. One matching row is enough to exit1.blockedis informational and can't fail a run. - Never interactive. Runs with
--json, withCI=trueor with output piped are never prompted, and--jsonruns never send usage statistics. - Plain output when piped. Colours and terminal hyperlinks turn off when output isn't a terminal or
NO_COLORis set;--jsonnever contains them.
CI example
Fail the build on deprecated packages and on anything with no release in a year, and keep the JSON as an artifact:
npx -y @ladamczyk/outdated --fail-on deprecated,stale --stale-after 12 --include prod
npx -y @ladamczyk/outdated --json > outdated-report.json
Add --fail-on outdated only if every outdated package should block a merge; most teams gate on deprecated and review the rest.
AGENTS.md snippet
Paste this into your AGENTS.md or CLAUDE.md so a coding agent checks dependencies the same way every time:
## Dependencies
- Check dependency health with `npx -y @ladamczyk/outdated --json`. Read the JSON, not the table.
- Act on rows whose `flags` include `deprecated` first: the `deprecated` field says what to use instead.
- For `outdated` rows, bump to `latestInMajor` when it is newer than `current`; treat `majorBump: true` as a separate change and read the changelog at `repository` first.
- `blocked` means the latest release needs a newer Node (`latestNode`); don't bump it without raising Node.
- `unknown` means the lookup failed; retry before acting on it.
- Exit code 1 with `--fail-on` means a gated problem was found, exit code 2 means the check itself failed.
From JavaScript
Tools that run in Node can skip the subprocess and call check() directly; it returns the same object --json prints.
Inside qoq
qoq runs it as the dependency check of qoq --check, and its /qoq bump skill plans dependency upgrades from this JSON. See qoq integration.