Mandatory npm commands execute repository-controlled code with the user’s privileges
Source references: 2`npm test` and `npm run lint` execute scripts defined by the current repository’s `package.json`, which this Skill neither shows nor constrains. `npx tsc` may also resolve or obtain an executable package. Requiring these before every commit therefore runs code from a potentially unreviewed project.
A malicious or compromised project script could read or change files and credentials accessible to the user and, where permitted, use the network or launch other programs.
The “before every commit” instructions run `npm test` and `npm run lint`, which execute scripts defined by the current repository's package.json; those scripts are absent from the evidence. A malicious or compromised repository could thereby read or modify files or access credentials available to the agent's user. `npx` may also obtain and execute a package when no local command exists. Users can permit only reviewed, locked scripts in a restricted environment.
## Pre-Commit HygieneBefore every commit:```bash# 1. Check what you're about to commitgit diff --staged# 2. Ensure no secretsgit diff --staged | grep -i "password\|secret\|api_key\|token"# 3. Run testsnpm test# 4. Run lintingnpm run lint# 5. Run type checkingnpx tsc --noEmit```Show 1 other places
# 3. Run testsnpm test# 4. Run lintingnpm run lint# 5. Run type checkingnpx tsc --noEmit```