add-package
パッケージを追加する際に使用します。開発用と、プロダクト用途問わずこれを使います。
When & Why to Use This Skill
The add-package skill automates and standardizes the process of adding dependencies to your project using the pnpm package manager. It ensures that both production and development packages are correctly registered in package.json while automatically updating the pnpm-lock.yaml file to maintain dependency integrity and prevent version conflicts.
Use Cases
- Installing production dependencies: Seamlessly add core libraries and frameworks to your project using standard pnpm add commands.
- Configuring development tools: Quickly set up linters, compilers, or testing suites as dev-dependencies using the -D flag to keep your production bundle lean.
- Ensuring lockfile consistency: Prevent build failures and environment mismatches by using automated commands instead of manual package.json edits, ensuring the lockfile is always in sync.
| name | add-package |
|---|---|
| description | パッケージを追加する際に使用します。開発用と、プロダクト用途問わずこれを使います。 |
パッケージ追加スキル
このスキルは、pnpmを使ってプロジェクトにパッケージを追加する正しい方法を提供します。
Instructions
pnpm add <package-name>コマンドでパッケージを追加する- 通常の依存パッケージ:
pnpm add <package-name> - 開発用依存パッケージ:
pnpm add -D <package-name>
- 通常の依存パッケージ:
- パッケージ追加後、
package.jsonにパッケージが追加されていることを確認する pnpm-lock.yamlが更新されていることを確認する
注意事項
⚠️ package.jsonを直接編集しないでください
パッケージを追加する際は、必ず pnpm add コマンドを使用してください。package.jsonを直接編集すると、pnpm-lock.yamlが更新されず、依存関係の整合性が失われます。