SKY-Q409 · Quality, structure and performance
Unlisted npm script binary
A simple package script invokes an npm binary whose provider is not declared by that package or an ancestor. System tools and dynamically expanded scripts do not establish a missing provider.
- Languages
- package.json
- Turned on by
skylos . --quality- Quality gate
- counted toward the gate limits (full and diff scans). Reported as quality; counts toward max_quality.
- Finding type
- review
Why it matters
A build can succeed only because the developer has a globally installed tool. A clean environment lacks that undeclared provider and the script stops working.
What Skylos flags
{"name":"shop","scripts":{"build":"tsc --noEmit"}}export const version = "1.0.0";What Skylos leaves alone
{"name":"shop","scripts":{"build":"tsc --noEmit"},"devDependencies":{"typescript":"^5.0.0"}}Why Skylos leaves it alone
The typescript declaration supplies the known tsc binary; an ancestor tooling declaration can also supply workspace scripts.
How Skylos decides
- Reads command heads in package.json scripts without executing them. Each
&&,;,||and|segment is read on its own;$VARarguments, assignments, redirections and command substitutions do not hide the command, andyarn --cwd <dir>,npm --prefix <dir>,pnpm -C,pnpm --filterandyarn workspacerun the target package's script there or resolve the binary in the target's lineage. - Resolves a command through literal bin metadata from installed or workspace package manifests, the
binentries a lockfile records (package-lock.json, Yarn Berry yarn.lock, bun.lock), a map of well-known CLIs whose package name differs (tsc to typescript, ng to @angular/cli, ngc to @angular/compiler-cli, svelte-package to @sveltejs/package, changeset to @changesets/cli and others), and otherwise assumes the command names its package. A provider declared in the package or an ancestor counts as available. Shareable configs, plugins, presets and @types/ packages never provide a tool binary. - Reads through cross-env, env, concurrently and npm-run-all style runners. npx, pnpm dlx and unknown package-manager shorthands can fetch or resolve providers indirectly, so they never report a missing provider.
- An unknown command first holds back declared dependencies that could plausibly provide it, meaning not installed and name-related to the command. Only those dependencies abstain from SKY-U005; every other dependency is still checked.
- Reports MEDIUM on the script line when no declared dependency could provide the command, the command is not a system tool or shell builtin (psql, docker, make, readarray and similar) and the script is not dynamic. An expanded command name, subshells,
node -ecode and opaque wrappers remain unresolved and are recorded in analysis_summary.npm_dependency_analysis. CI and container commands count as dependency use but are never reported here.
How to fix it
Add the intended binary provider to this package or shared ancestor tooling, or replace the script with a declared tool.
Removed: {"name":"shop","scripts":{"build":"tsc --noEmit"}}Added: {"name":"shop","scripts":{"build":"tsc --noEmit"},"devDependencies":{"typescript":"^5.0.0"}}When it can be wrong
- An operator may intentionally install the binary globally, but that contract is outside this manifest.
- A tool installed outside npm under a name Skylos does not list as a system command is reported; suppress it or invoke it through an explicit path.
Seeing a case that isn't listed here? Report the wrong result so the rule can be fixed. Don't paste company code: describe the shape of it.
How to silence it
Set
[tool.skylos] ignore = ["SKY-Q409"]to disable this rule project-wide.