Flag PyPI and npm package names that imitate popular packages (homoglyphs, separator tricks, affixes, one-edit typos) and say which rule matched. Use when the user reviews new dependencies, requirements.txt or package.json entries.
95%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Low
Low-risk findings worth noting
Check candidate package names against a list of popular packages and report which rule matched which target. It runs locally with Python 3.10+ (standard library only); no package install and no network access are needed. It is defensive: use it to stop a suspicious dependency before install.
requirements.txt, pyproject.toml or package.json.python3 scripts/typosquat_detector.py reqeusts flask --ecosystem pypi
Use --ecosystem npm for npm names (scoped names such as @scope/pkg are accepted).candidate: rule -> target. Exit code 1 means findings, 0 none,
2 usage or invalid name (the reason is printed to stderr).--popular names.txt (one
name per line, at most 10,000 names and 1 MiB).| Rule | Matches when |
|---|---|
homoglyph | equal to a target after mapping 0 1 3 5 rn vv to o l e s m w |
separator | equal to a target after removing -, _, . |
affix | a target plus a known prefix or suffix (for example python- or -js) |
distance | one edit (insert, delete, substitute, adjacent swap) from a target, both names 4+ characters |
Per target the first matching rule is reported. A name equal to a target after normalisation (PEP 503 for PyPI, lowercase for npm) is the package itself and is skipped. Details are in references/rules.md.
--popular.Project source: https://github.com/Trysac/u256-typosquat-detector