npm-patterns

Detect package managers from lockfiles and enforce semver ranges and script conventions.

9|1|Updated Jun 16, 2026
One-click install
npx skills add https://github.com/AratKruglik/antigravity-sdlc --skill npm-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: npm-patterns
Source: https://github.com/AratKruglik/antigravity-sdlc/tree/main/plugins/js-foundation/skills/npm-patterns
Command: npx skills add https://github.com/AratKruglik/antigravity-sdlc --skill npm-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Package management discipline for any JavaScript/TypeScript project: dependency declaration, semver, scripts conventions, lockfile hygiene, package-manager detection. Stack-agnostic — referenced by every JS/TS framework plugin in the marketplace.

Core Features & Use Cases

  • Detect the package manager from the lockfile (packageManager field where present) and apply the corresponding workflow.
  • Enforce proper dependency ranges and semver discipline when editing package.json.
  • Define and validate standard script names and conventions (start, build, test, lint, format) to ensure consistency.
  • Maintain lockfile hygiene and guard against manual edits or conflicting entries.

Quick Start

Install dependencies using the detected package manager and adhere to standard script conventions.

Frequently Asked Questions about npm-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce consistent npm script conventions across JavaScript projects?

Enforce standard npm script names like start, build, test, lint, and format to maintain consistency. This package management discipline ensures predictable script behavior across frontend, backend, and library codebases.

How do I detect which package manager a JavaScript project is using?

Detect the package manager by reading the lockfile and the packageManager field where present. This identifies whether npm, yarn, or pnpm is used and applies the corresponding workflow and dependency rules automatically.

What's the best way to manage semver ranges in package.json?

Enforce proper dependency declaration rules to manage semver ranges in package.json. This maintains lockfile hygiene by preventing conflicting entries and guarding against manual edits to dependency ranges.

Does this package management approach work with pnpm and yarn environments?

Yes, this approach supports pnpm and yarn environments alongside npm. It detects the active manager from the lockfile and applies the corresponding workflow, dependency declarations, and script conventions.

How do I maintain lockfile hygiene and prevent manual editing conflicts?

Maintain lockfile hygiene by guarding against manual edits and conflicting entries. The system detects the package manager from the lockfile and enforces proper semver ranges to prevent dependency declaration conflicts.