Skip to content

Commit 36eb616

Browse files
committed
Added CLAUDE skills to fix dependency versions and related principles
1 parent 51391a9 commit 36eb616

3 files changed

Lines changed: 615 additions & 485 deletions

File tree

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
---
2+
name: dependency-management
3+
description: |
4+
Enforces fixed version dependency installation across all package managers. Ensures reproducible builds, supply chain security, and stability.
5+
Use when: installing packages, updating dependencies, working with package.json/requirements.txt/go.mod/Cargo.toml/pom.xml/build.gradle/composer.json/Gemfile/.csproj, reviewing dependency configurations, configuring CI/CD pipelines
6+
---
7+
8+
# Dependency Management
9+
10+
## Basic Principles
11+
12+
### Always Use Exact Versions
13+
14+
- Use exact versions only: `package@1.2.3`
15+
- Forbid: `^1.2.3`, `~1.2.3`, `latest`, `*`, version ranges
16+
- Exception: Library peerDependencies only
17+
18+
### Lock Files Are Mandatory
19+
20+
- Always commit to version control
21+
- Forbid manual editing
22+
- CI/CD must use frozen/locked mode
23+
24+
### Security Audit First
25+
26+
- Check vulnerabilities before installation
27+
- Automate regular audits
28+
29+
## Installation Commands
30+
31+
```bash
32+
# Node.js
33+
npm install --save-exact package@1.2.3
34+
pnpm add --save-exact package@1.2.3
35+
yarn add --exact package@1.2.3
36+
37+
# Python
38+
pip install package==1.2.3
39+
poetry add package@1.2.3
40+
41+
# Go
42+
go get package@v1.2.3
43+
44+
# Rust
45+
cargo add package@=1.2.3
46+
47+
# PHP
48+
composer require vendor/package:1.2.3
49+
50+
# Ruby (Gemfile)
51+
gem 'package', '1.2.3'
52+
53+
# Java/Kotlin
54+
implementation("group:artifact:1.2.3") # Gradle
55+
<version>1.2.3</version> # Maven
56+
57+
# .NET
58+
dotnet add package PackageName --version 1.2.3
59+
```
60+
61+
## CI/CD Commands
62+
63+
```bash
64+
npm ci # npm
65+
pnpm install --frozen-lockfile # pnpm
66+
yarn install --frozen-lockfile # yarn
67+
poetry install --no-update # poetry
68+
go mod verify # go
69+
cargo build --locked # rust
70+
composer install --no-update # php
71+
bundle install --frozen # ruby
72+
dotnet restore --locked-mode # .NET
73+
```
74+
75+
## Common Mistakes
76+
77+
| ❌ Wrong | ✅ Correct |
78+
| ------------------------ | ------------------------------ |
79+
| `npm install` (CI) | `npm ci` |
80+
| `package@latest` | `package@1.2.3` |
81+
| `package@^1.2.3` | `package@1.2.3` |
82+
| Lock file in .gitignore | Commit lock file |
83+
| Manual lock file editing | Regenerate via package manager |

package.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -48,29 +48,29 @@
4848
"prepublishOnly": "yarn build"
4949
},
5050
"dependencies": {
51-
"@octokit/rest": "^22.0.1",
52-
"commander": "^14.0.1",
53-
"globby": "^14.0.0",
54-
"js-yaml": "^4.1.0",
55-
"ky": "^1.8.3",
56-
"micromatch": "^4.0.8",
57-
"picocolors": "^1.0.0",
58-
"tar": "^7.5.1",
59-
"zod": "^4.1.12"
51+
"@octokit/rest": "22.0.1",
52+
"commander": "14.0.1",
53+
"globby": "14.0.0",
54+
"js-yaml": "4.1.0",
55+
"ky": "1.14.0",
56+
"micromatch": "4.0.8",
57+
"picocolors": "1.0.0",
58+
"tar": "7.5.1",
59+
"zod": "4.1.12"
6060
},
6161
"devDependencies": {
62-
"@types/js-yaml": "^4.0.9",
63-
"@types/micromatch": "^4.0.9",
64-
"@types/node": "^24.7.1",
65-
"@types/tar": "^6.1.13",
62+
"@types/js-yaml": "4.0.9",
63+
"@types/micromatch": "4.0.9",
64+
"@types/node": "24.7.1",
65+
"@types/tar": "6.1.13",
6666
"eslint": "9.39.1",
6767
"eslint-plugin-import": "2.32.0",
6868
"eslint-plugin-perfectionist": "4.15.1",
6969
"husky": "9.1.7",
7070
"lint-staged": "15.2.11",
7171
"prettier": "3.6.2",
72-
"tsup": "^8.0.0",
73-
"typescript": "^5.3.0",
72+
"tsup": "8.0.0",
73+
"typescript": "5.9.3",
7474
"typescript-eslint": "8.46.3"
7575
}
7676
}

0 commit comments

Comments
 (0)