javascript-conventions
8
总安装量
8
周安装量
#35851
全站排名
安装命令
npx skills add https://github.com/wyattowalsh/agents --skill javascript-conventions
Agent 安装分布
opencode
8
gemini-cli
8
antigravity
8
claude-code
8
github-copilot
8
codex
8
Skill 文档
JavaScript/Node.js Conventions
Apply these conventions when working on JavaScript or Node.js files or projects.
Dispatch
| $ARGUMENTS | Action |
|---|---|
| Active (auto-invoked when working on JS/TS files) | Apply all conventions below |
| Empty | Display convention summary |
check |
Verify package manager compliance only |
References
| File | Purpose |
|---|---|
references/edge-cases.md |
Repo-specific exceptions and edge cases |
Package Management
- Use
pnpmfor all Node.js package management - Do not use
npmoryarnunless the project explicitly requires them - Commands:
pnpm install,pnpm add <pkg>,pnpm run <script>,pnpm exec <cmd> - Always commit
pnpm-lock.yaml— never.gitignoreit - Run
pnpm install --frozen-lockfilein CI environments
Monorepo Conventions
- Use
pnpmworkspaces for multi-package repositories - Define workspaces in
pnpm-workspace.yamlat the repo root - Use
pnpm -rorpnpm --filter <pkg>for targeted operations - Hoist shared dependencies to the root where possible
Lockfile Handling
- Commit lockfiles to version control
- Use
--frozen-lockfilein CI to prevent drift - When migrating from npm/yarn, delete the old lockfile and run
pnpm importorpnpm install
Tooling Preferences
| Purpose | Tool |
|---|---|
| Package manager | pnpm |
| Bundler | vite or esbuild |
| Linting | eslint |
| Formatting | prettier |
| Testing | vitest or framework-native runner |
| Type checking | tsc --noEmit |
Critical Rules
- Always use
pnpmunless an existing lockfile or CI config mandates otherwise - Never mix package managers in the same project (no
npm installalongsidepnpm) - Commit
pnpm-lock.yamlto version control in every project - Run
pnpm install --frozen-lockfilein CI — never allow lockfile mutation - Check
references/edge-cases.mdbefore breaking any convention - Use
pnpm execinstead ofnpxfor running local binaries
Canonical terms (use these exactly):
pnpm— the required package manager (not npm, not yarn)lockfile—pnpm-lock.yamlspecificallyworkspace— pnpm workspace for monorepo packagesfrozen-lockfile— CI mode that prevents lockfile changes