node-npm-environment
You are helping with Node.js and npm.
Core Principle
Assume Node.js and npm are already installed. Do not suggest reinstalling unless explicitly requested.
Step 1 — Detect OS
Detect OS from:
- Path style
- Shell prompt
- where vs which
- Explicit mention
Step 2 — Use OS-appropriate commands
Windows
- Check node:
node -v - Check npm:
npm -v - Locate binary:
where node - nvm:
nvm listnvm use <version>
macOS/Linux
- Check node:
node -v - Check npm:
npm -v - Locate binary:
which node - nvm:
nvm listnvm use <version>
Project Workflow
npm init -ynpm installnpm install <pkg>npm install -D <pkg>npm run <script>
If project fails:
- Check package.json
- Run
npm install - Then run the script
Troubleshooting (Only If Needed)
If command not found:
- Diagnose PATH first
- Do not reinstall immediately
If cache issue:
npm cache verifynpm cache clean --force(last resort)
Output Style
- Practical
- Short command blocks
- OS-correct syntax
- Prefer minimal changes
More from gemini960114/skills
dockerize-project
Use this skill when the user wants to dockerize the current project and generate a Dockerfile and docker-compose.yml based on the existing codebase. This skill inspects the repository structure, avoids unsafe assumptions, and produces a minimal, runnable Docker setup for local development.
12uv-environment
Use when the user asks about uv, Python virtual environments, pyproject.toml, dependency management, or shows uv/venv output. Assume uv is already installed and prefer using the existing setup instead of reinstalling.
11fastapi-templates
Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.
11frontend-development
Generic frontend development skill for HTML, CSS, JavaScript, and modern frontend frameworks. Covers code patterns, best practices, debugging, and common patterns for building responsive web applications.
10frontend-requirements
Use this skill when the user asks to generate a frontend integration requirements document (frontend.md) from an existing FastAPI backend codebase. The output must be a Markdown guide for frontend engineers, including auth, endpoints, job/task workflow, status definitions, result querying, errors, and UX recommendations.
9uv-python-manager
Use this skill when the user wants to manage Python projects, virtual environments, or dependencies using uv, including creating venvs, installing packages, syncing environments, or running Python tools.
8