dependency-management
Dependency Management
Workflows
- Audit: Check for known vulnerabilities
- Update: Keep dependencies reasonably current
- Lock: Ensure reproducible builds
- Minimize: Remove unused dependencies
Security Scanning
# Node.js
npm audit
pnpm audit
# Python
pip-audit
safety check
# Go
govulncheck ./...
# Rust
cargo audit
Version Management
Semantic Versioning
- Major (1.0.0): Breaking changes
- Minor (0.1.0): New features, backward compatible
- Patch (0.0.1): Bug fixes, backward compatible
Version Constraints
// package.json
{
"dependencies": {
"exact": "1.2.3", // Exactly 1.2.3
"patch": "~1.2.3", // 1.2.x (patch updates)
"minor": "^1.2.3", // 1.x.x (minor updates)
"range": ">=1.2.3 <2.0.0" // Range
}
}
Lockfiles
Always commit lockfiles for reproducible builds:
package-lock.jsonorpnpm-lock.yaml(Node.js)poetry.lockoruv.lock(Python)go.sum(Go)Cargo.lock(Rust)
Best Practices
- Pin Versions in Production: Use exact versions or lockfiles
- Update Regularly: Don't let dependencies get too stale
- Review Changelogs: Check breaking changes before major updates
- Test After Updates: Run full test suite after dependency changes
- Minimize Dependencies: Each dependency is a liability
Removing Unused Dependencies
# Node.js
npx depcheck
# Python
pip-autoremove
# Go
go mod tidy
More from nguyenhuuca/assessment
compliance
Ensure regulatory compliance. Use when implementing GDPR, HIPAA, PCI-DSS, or SOC2 requirements. Covers compliance frameworks and controls.
17security-review
Conduct security code reviews. Use when reviewing code for vulnerabilities, assessing security posture, or auditing applications. Covers security review checklist.
13execution-roadmaps
Create execution roadmaps for projects. Use when planning multi-phase projects or feature rollouts. Covers phased delivery and milestone planning.
12cloud-native-patterns
Apply cloud-native architecture patterns. Use when designing for scalability, resilience, or cloud deployment. Covers microservices, containers, and distributed systems.
12agile-methodology
Apply agile development practices. Use when planning sprints, running ceremonies, or improving team processes. Covers Scrum, Kanban, and agile principles.
12designing-systems
Design scalable, reliable software systems. Use when planning new systems, major features, or architecture changes. Covers C4 diagrams, trade-off analysis, and system decomposition.
12