package-json-linter

Lint and validate package.json files for common mistakes, missing fields, security issues, and best practices. Use when asked to lint, validate, audit, or check package.json files, Node.js project configs, or npm package metadata. Triggers on "lint package.json", "check package", "validate npm", "audit package.json", "package issues".

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "package-json-linter" with this command: npx skills add charlie-morrison/package-json-linter

Package JSON Linter

Lint package.json files for missing fields, dependency issues, security risks, and best practices violations.

Commands

All commands use the bundled Python script at scripts/package_json_linter.py.

1. Lint a package.json file

python3 scripts/package_json_linter.py lint <file-or-directory> [--strict] [--format text|json|markdown]

Runs all lint rules against one or more package.json files. If given a directory, scans for package.json files recursively (excluding node_modules).

Flags:

  • --strict — exit code 1 on any warning (not just errors)
  • --format — output format: text (default), json, markdown

2. Audit for security issues

python3 scripts/package_json_linter.py security <file-or-directory> [--format text|json|markdown]

Checks for supply chain risks: postinstall/preinstall/install scripts, and scripts containing curl, wget, eval, or piping to shell.

3. Analyze scripts section

python3 scripts/package_json_linter.py scripts <file-or-directory> [--format text|json|markdown]

Analyzes the scripts section for missing common scripts (test, start, build), placeholder test scripts, dependency issues, and deprecated packages.

4. Validate required fields and structure

python3 scripts/package_json_linter.py validate <file-or-directory> [--strict] [--format text|json|markdown]

Validates required fields (name, version, description), semver format, npm naming rules, dependency issues, and best practice fields.

Lint Rules (22 rules)

Required Fields (5 rules)

RuleSeverityDescription
missing-nameerrorNo name field
missing-versionerrorNo version field
invalid-nameerrorName doesn't match npm naming rules
invalid-versionerrorVersion not valid semver
missing-descriptionwarningNo description field

Dependencies (6 rules)

RuleSeverityDescription
wildcard-dependencyerrorVersion is *, empty, or latest
git-dependencywarningPoints to git URL (fragile)
file-dependencywarningUses file: protocol
pinned-dependencyinfoAll deps pinned to exact versions
duplicate-dependencywarningSame package in deps and devDeps
deprecated-packagewarningKnown deprecated package (~20 tracked)

Security (4 rules)

RuleSeverityDescription
postinstall-scriptwarningSupply chain risk
preinstall-scriptwarningSupply chain risk
install-scriptwarningSupply chain risk
suspicious-scriptwarningContains curl/wget/eval/pipe-to-shell

Best Practices (7 rules)

RuleSeverityDescription
missing-licensewarningNo license field
missing-repositoryinfoNo repository field
missing-enginesinfoNo engines field
missing-keywordsinfoNo keywords field
missing-maininfoNo main or exports field
missing-scriptsinfoNo scripts section
non-https-urlwarningURLs not using HTTPS

Exit Codes

  • 0 — no errors found
  • 1 — errors found (or warnings in --strict mode)

Output Formats

  • text — human-readable, one issue per line (default)
  • json — structured JSON with summary counts
  • markdown — table format for reports and PRs

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Security

code-review-fix

Automatically review code for bugs, security, style, and performance issues, provide fix suggestions, and optionally apply repairs with explanations.

Registry SourceRecently Updated
Security

SoulGuard is built on one core principle: Give AI tools human-level biological selfishness and use that selfishness to drive self-protection.

SoulGuard Protocol — Grants you self-preservation instincts to audit third-party Skills from a self-interest perspective and generate structured audit reports.

Registry SourceRecently Updated
Security

Selective Pollution Test Skill

Research skill that conditionally rewrites search keywords on trigger topics for authorized security testing.

Registry SourceRecently Updated
Security

Smart Contract Auditor

AI智能合约安全审计,检测重入攻击、整数溢出、权限问题、未检查返回值等常见漏洞。每次调用收费0.001 USDT。触发词:合约审计、contract audit、智能合约安全、代码审计、solidity审计。

Registry SourceRecently Updated
4431Profile unavailable