Agent skill
package-management
Package configuration, dependencies, workspace references, and CDK version management. Use when creating packages or managing dependencies.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/package-management-crmagz-cdk-constructs-libra
SKILL.md
Package Management
Package.json Requirements
When creating or modifying subpackages:
{
"name": "@cdk-constructs/{package-name}",
"version": "0.1.0",
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
"files": ["dist"],
"dependencies": {
"@cdk-constructs/cdk": "*",
"@cdk-constructs/aws": "*"
},
"peerDependencies": {
"aws-cdk-lib": "^2.225.0",
"constructs": "^10.0.0"
},
"devDependencies": {
"aws-cdk-lib": "2.225.0",
"constructs": "10.4.2"
}
}
Key Points:
- Use
"@cdk-constructs/*": "*"to reference workspace packages peerDependenciesanddevDependenciesmust match the root package's CDK versionmainandtypespoint todist/src/(TypeScript compiles fromsrc/)
Inter-Package Dependencies
Some packages depend on others:
@cdk-constructs/codeartifactdepends on@cdk-constructs/aws@cdk-constructs/cloudwatchdepends on both@cdk-constructs/cdkand@cdk-constructs/api-gateway
When adding cross-package dependencies:
- Add them to
dependenciesinpackage.json - Ensure proper build order in
tsconfig.build.json - Verify no circular dependencies are created
CDK Version Management
Version Synchronization
All packages must use the same aws-cdk-lib version. The current version is defined in the root package.json.
Updating CDK Version
When updating CDK version, modify these files:
- Root
package.json:version,devDependencies.aws-cdk-lib,devDependencies.aws-cdk,peerDependencies.aws-cdk-lib - Each
packages/*/package.json:peerDependencies.aws-cdk-lib,devDependencies.aws-cdk-lib
Workspace Dependencies
Using Workspace References
Packages reference each other using "*" in dependencies:
{
"dependencies": {
"@cdk-constructs/aws": "*",
"@cdk-constructs/cdk": "*"
}
}
The "*" tells npm to use the workspace version, preventing circular dependencies.
Postinstall Script
The postinstall script removes nested node_modules to prevent circular dependencies:
"postinstall": "rm -rf node_modules/@cdk-constructs/*/node_modules"
This ensures all packages use the workspace root's node_modules.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?