pin-versions
依存関係のバージョン固定。package.json や Terraform Provider を編集したら必ず実行。
Installation
Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.
View source ↗GuidesSkill instructions
Pin Versions
依存関係のバージョンを固定するスキル。
重要
package.json や Terraform Provider ファイルを編集した場合は、必ずこのルールに従ってバージョンを固定すること。
対象ファイル
-
**/package.json- npm/pnpm パッケージ -
**/*.tf(providers.tf, versions.tf) - Terraform Provider
ルール
package.json
バージョン指定には ^ や ~ を使用せず、固定バージョンを指定する。
// NG
"dependencies": {
"react": "^19.0.0",
"next": "~15.0.0"
}
// OK
"dependencies": {
"react": "19.0.0",
"next": "15.0.0"
}
例外:
-
workspace:*- モノレポ内のパッケージ参照は許可
Terraform Provider
~> や >= を使用せず、固定バージョンを指定する。
// NG
terraform {
required_version = ">= 1.0"
required_providers {
aws = {
version = "~> 5.0"
}
}
}
// OK
terraform {
required_version = "1.14.3"
required_providers {
aws = {
version = "5.82.2"
}
}
}
確認コマンド
# package.json の ^ や ~ を検索
grep -r '"\^' apps/*/package.json packages/*/package.json
grep -r '"~' apps/*/package.json packages/*/package.json
# Terraform の ~> や >= を検索
grep -rE '"~>|">=' infra/terraform --include="*.tf"
手順
- ファイルを編集
- 上記の確認コマンドでバージョン指定を確認
-
^や~があれば固定バージョンに修正 -
pnpm installで lockfile を更新(package.json の場合) -
pnpm checkで問題がないことを確認
理由
- 再現性の確保: 同じバージョンで常にビルドできる
- 予期しない破壊的変更の防止
- CI/CD での一貫性
Examples
Read the usage examples in the source repository.
View source ↗Source history
- Indexed on
- 2026-01-20
- Index updated
- 2026-01-26
- Branch
- main
Index and sync dates describe this directory. View the source repository for code history.
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!