Skip to content

Commit 3a84f9f

Browse files
Merge branch 'deploy-with-db' into copilot/sub-pr-107
2 parents 3719939 + f7d2750 commit 3a84f9f

147 files changed

Lines changed: 46022 additions & 2206 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agent/skills/dependency-auditor/README.md

Lines changed: 524 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 333 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,333 @@
1+
# Dependency Auditor
2+
3+
> **Skill Type:** POWERFUL
4+
> **Category:** Engineering
5+
> **Domain:** Dependency Management & Security
6+
7+
## Overview
8+
9+
The **Dependency Auditor** is a comprehensive toolkit for analyzing, auditing, and managing dependencies across multi-language software projects. This skill provides deep visibility into your project's dependency ecosystem, enabling teams to identify vulnerabilities, ensure license compliance, optimize dependency trees, and plan safe upgrades.
10+
11+
In modern software development, dependencies form complex webs that can introduce significant security, legal, and maintenance risks. A single project might have hundreds of direct and transitive dependencies, each potentially introducing vulnerabilities, license conflicts, or maintenance burden. This skill addresses these challenges through automated analysis and actionable recommendations.
12+
13+
## Core Capabilities
14+
15+
### 1. Vulnerability Scanning & CVE Matching
16+
17+
**Comprehensive Security Analysis**
18+
- Scans dependencies against built-in vulnerability databases
19+
- Matches Common Vulnerabilities and Exposures (CVE) patterns
20+
- Identifies known security issues across multiple ecosystems
21+
- Analyzes transitive dependency vulnerabilities
22+
- Provides CVSS scores and exploit assessments
23+
- Tracks vulnerability disclosure timelines
24+
- Maps vulnerabilities to dependency paths
25+
26+
**Multi-Language Support**
27+
- **JavaScript/Node.js**: package.json, package-lock.json, yarn.lock
28+
- **Python**: requirements.txt, pyproject.toml, Pipfile.lock, poetry.lock
29+
- **Go**: go.mod, go.sum
30+
- **Rust**: Cargo.toml, Cargo.lock
31+
- **Ruby**: Gemfile, Gemfile.lock
32+
- **Java/Maven**: pom.xml, gradle.lockfile
33+
- **PHP**: composer.json, composer.lock
34+
- **C#/.NET**: packages.config, project.assets.json
35+
36+
### 2. License Compliance & Legal Risk Assessment
37+
38+
**License Classification System**
39+
- **Permissive Licenses**: MIT, Apache 2.0, BSD (2-clause, 3-clause), ISC
40+
- **Copyleft (Strong)**: GPL (v2, v3), AGPL (v3)
41+
- **Copyleft (Weak)**: LGPL (v2.1, v3), MPL (v2.0)
42+
- **Proprietary**: Commercial, custom, or restrictive licenses
43+
- **Dual Licensed**: Multi-license scenarios and compatibility
44+
- **Unknown/Ambiguous**: Missing or unclear licensing
45+
46+
**Conflict Detection**
47+
- Identifies incompatible license combinations
48+
- Warns about GPL contamination in permissive projects
49+
- Analyzes license inheritance through dependency chains
50+
- Provides compliance recommendations for distribution
51+
- Generates legal risk matrices for decision-making
52+
53+
### 3. Outdated Dependency Detection
54+
55+
**Version Analysis**
56+
- Identifies dependencies with available updates
57+
- Categorizes updates by severity (patch, minor, major)
58+
- Detects pinned versions that may be outdated
59+
- Analyzes semantic versioning patterns
60+
- Identifies floating version specifiers
61+
- Tracks release frequencies and maintenance status
62+
63+
**Maintenance Status Assessment**
64+
- Identifies abandoned or unmaintained packages
65+
- Analyzes commit frequency and contributor activity
66+
- Tracks last release dates and security patch availability
67+
- Identifies packages with known end-of-life dates
68+
- Assesses upstream maintenance quality
69+
70+
### 4. Dependency Bloat Analysis
71+
72+
**Unused Dependency Detection**
73+
- Identifies dependencies that aren't actually imported/used
74+
- Analyzes import statements and usage patterns
75+
- Detects redundant dependencies with overlapping functionality
76+
- Identifies oversized packages for simple use cases
77+
- Maps actual vs. declared dependency usage
78+
79+
**Redundancy Analysis**
80+
- Identifies multiple packages providing similar functionality
81+
- Detects version conflicts in transitive dependencies
82+
- Analyzes bundle size impact of dependencies
83+
- Identifies opportunities for dependency consolidation
84+
- Maps dependency overlap and duplication
85+
86+
### 5. Upgrade Path Planning & Breaking Change Risk
87+
88+
**Semantic Versioning Analysis**
89+
- Analyzes semver patterns to predict breaking changes
90+
- Identifies safe upgrade paths (patch/minor versions)
91+
- Flags major version updates requiring attention
92+
- Tracks breaking changes across dependency updates
93+
- Provides rollback strategies for failed upgrades
94+
95+
**Risk Assessment Matrix**
96+
- Low Risk: Patch updates, security fixes
97+
- Medium Risk: Minor updates with new features
98+
- High Risk: Major version updates, API changes
99+
- Critical Risk: Dependencies with known breaking changes
100+
101+
**Upgrade Prioritization**
102+
- Security patches: Highest priority
103+
- Bug fixes: High priority
104+
- Feature updates: Medium priority
105+
- Major rewrites: Planned priority
106+
- Deprecated features: Immediate attention
107+
108+
### 6. Supply Chain Security
109+
110+
**Dependency Provenance**
111+
- Verifies package signatures and checksums
112+
- Analyzes package download sources and mirrors
113+
- Identifies suspicious or compromised packages
114+
- Tracks package ownership changes and maintainer shifts
115+
- Detects typosquatting and malicious packages
116+
117+
**Transitive Risk Analysis**
118+
- Maps complete dependency trees
119+
- Identifies high-risk transitive dependencies
120+
- Analyzes dependency depth and complexity
121+
- Tracks influence of indirect dependencies
122+
- Provides supply chain risk scoring
123+
124+
### 7. Lockfile Analysis & Deterministic Builds
125+
126+
**Lockfile Validation**
127+
- Ensures lockfiles are up-to-date with manifests
128+
- Validates integrity hashes and version consistency
129+
- Identifies drift between environments
130+
- Analyzes lockfile conflicts and resolution strategies
131+
- Ensures deterministic, reproducible builds
132+
133+
**Environment Consistency**
134+
- Compares dependencies across environments (dev/staging/prod)
135+
- Identifies version mismatches between team members
136+
- Validates CI/CD environment consistency
137+
- Tracks dependency resolution differences
138+
139+
## Technical Architecture
140+
141+
### Scanner Engine (`dep_scanner.py`)
142+
- Multi-format parser supporting 8+ package ecosystems
143+
- Built-in vulnerability database with 500+ CVE patterns
144+
- Transitive dependency resolution from lockfiles
145+
- JSON and human-readable output formats
146+
- Configurable scanning depth and exclusion patterns
147+
148+
### License Analyzer (`license_checker.py`)
149+
- License detection from package metadata and files
150+
- Compatibility matrix with 20+ license types
151+
- Conflict detection engine with remediation suggestions
152+
- Risk scoring based on distribution and usage context
153+
- Export capabilities for legal review
154+
155+
### Upgrade Planner (`upgrade_planner.py`)
156+
- Semantic version analysis with breaking change prediction
157+
- Dependency ordering based on risk and interdependence
158+
- Migration checklists with testing recommendations
159+
- Rollback procedures for failed upgrades
160+
- Timeline estimation for upgrade cycles
161+
162+
## Use Cases & Applications
163+
164+
### Security Teams
165+
- **Vulnerability Management**: Continuous scanning for security issues
166+
- **Incident Response**: Rapid assessment of vulnerable dependencies
167+
- **Supply Chain Monitoring**: Tracking third-party security posture
168+
- **Compliance Reporting**: Automated security compliance documentation
169+
170+
### Legal & Compliance Teams
171+
- **License Auditing**: Comprehensive license compliance verification
172+
- **Risk Assessment**: Legal risk analysis for software distribution
173+
- **Due Diligence**: Dependency licensing for M&A activities
174+
- **Policy Enforcement**: Automated license policy compliance
175+
176+
### Development Teams
177+
- **Dependency Hygiene**: Regular cleanup of unused dependencies
178+
- **Upgrade Planning**: Strategic dependency update scheduling
179+
- **Performance Optimization**: Bundle size optimization through dep analysis
180+
- **Technical Debt**: Identifying and prioritizing dependency technical debt
181+
182+
### DevOps & Platform Teams
183+
- **Build Optimization**: Faster builds through dependency optimization
184+
- **Security Automation**: Automated vulnerability scanning in CI/CD
185+
- **Environment Consistency**: Ensuring consistent dependencies across environments
186+
- **Release Management**: Dependency-aware release planning
187+
188+
## Integration Patterns
189+
190+
### CI/CD Pipeline Integration
191+
```bash
192+
# Security gate in CI
193+
python dep_scanner.py /project --format json --fail-on-high
194+
python license_checker.py /project --policy strict --format json
195+
```
196+
197+
### Scheduled Audits
198+
```bash
199+
# Weekly dependency audit
200+
./audit_dependencies.sh > weekly_report.html
201+
python upgrade_planner.py deps.json --timeline 30days
202+
```
203+
204+
### Development Workflow
205+
```bash
206+
# Pre-commit dependency check
207+
python dep_scanner.py . --quick-scan
208+
python license_checker.py . --warn-conflicts
209+
```
210+
211+
## Advanced Features
212+
213+
### Custom Vulnerability Databases
214+
- Support for internal/proprietary vulnerability feeds
215+
- Custom CVE pattern definitions
216+
- Organization-specific risk scoring
217+
- Integration with enterprise security tools
218+
219+
### Policy-Based Scanning
220+
- Configurable license policies by project type
221+
- Custom risk thresholds and escalation rules
222+
- Automated policy enforcement and notifications
223+
- Exception management for approved violations
224+
225+
### Reporting & Dashboards
226+
- Executive summaries for management
227+
- Technical reports for development teams
228+
- Trend analysis and dependency health metrics
229+
- Integration with project management tools
230+
231+
### Multi-Project Analysis
232+
- Portfolio-level dependency analysis
233+
- Shared dependency impact analysis
234+
- Organization-wide license compliance
235+
- Cross-project vulnerability propagation
236+
237+
## Best Practices
238+
239+
### Scanning Frequency
240+
- **Security Scans**: Daily or on every commit
241+
- **License Audits**: Weekly or monthly
242+
- **Upgrade Planning**: Monthly or quarterly
243+
- **Full Dependency Audit**: Quarterly
244+
245+
### Risk Management
246+
1. **Prioritize Security**: Address high/critical CVEs immediately
247+
2. **License First**: Ensure compliance before functionality
248+
3. **Gradual Updates**: Incremental dependency updates
249+
4. **Test Thoroughly**: Comprehensive testing after updates
250+
5. **Monitor Continuously**: Automated monitoring and alerting
251+
252+
### Team Workflows
253+
1. **Security Champions**: Designate dependency security owners
254+
2. **Review Process**: Mandatory review for new dependencies
255+
3. **Update Cycles**: Regular, scheduled dependency updates
256+
4. **Documentation**: Maintain dependency rationale and decisions
257+
5. **Training**: Regular team education on dependency security
258+
259+
## Metrics & KPIs
260+
261+
### Security Metrics
262+
- Mean Time to Patch (MTTP) for vulnerabilities
263+
- Number of high/critical vulnerabilities
264+
- Percentage of dependencies with known vulnerabilities
265+
- Security debt accumulation rate
266+
267+
### Compliance Metrics
268+
- License compliance percentage
269+
- Number of license conflicts
270+
- Time to resolve compliance issues
271+
- Policy violation frequency
272+
273+
### Maintenance Metrics
274+
- Percentage of up-to-date dependencies
275+
- Average dependency age
276+
- Number of abandoned dependencies
277+
- Upgrade success rate
278+
279+
### Efficiency Metrics
280+
- Bundle size reduction percentage
281+
- Unused dependency elimination rate
282+
- Build time improvement
283+
- Developer productivity impact
284+
285+
## Troubleshooting Guide
286+
287+
### Common Issues
288+
1. **False Positives**: Tuning vulnerability detection sensitivity
289+
2. **License Ambiguity**: Resolving unclear or multiple licenses
290+
3. **Breaking Changes**: Managing major version upgrades
291+
4. **Performance Impact**: Optimizing scanning for large codebases
292+
293+
### Resolution Strategies
294+
- Whitelist false positives with documentation
295+
- Contact maintainers for license clarification
296+
- Implement feature flags for risky upgrades
297+
- Use incremental scanning for large projects
298+
299+
## Future Enhancements
300+
301+
### Planned Features
302+
- Machine learning for vulnerability prediction
303+
- Automated dependency update pull requests
304+
- Integration with container image scanning
305+
- Real-time dependency monitoring dashboards
306+
- Natural language policy definition
307+
308+
### Ecosystem Expansion
309+
- Additional language support (Swift, Kotlin, Dart)
310+
- Container and infrastructure dependencies
311+
- Development tool and build system dependencies
312+
- Cloud service and SaaS dependency tracking
313+
314+
---
315+
316+
## Quick Start
317+
318+
```bash
319+
# Scan project for vulnerabilities and licenses
320+
python scripts/dep_scanner.py /path/to/project
321+
322+
# Check license compliance
323+
python scripts/license_checker.py /path/to/project --policy strict
324+
325+
# Plan dependency upgrades
326+
python scripts/upgrade_planner.py deps.json --risk-threshold medium
327+
```
328+
329+
For detailed usage instructions, see [README.md](README.md).
330+
331+
---
332+
333+
*This skill provides comprehensive dependency management capabilities essential for maintaining secure, compliant, and efficient software projects. Regular use helps teams stay ahead of security threats, maintain legal compliance, and optimize their dependency ecosystems.*
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
module github.com/example/sample-go-service
2+
3+
go 1.20
4+
5+
require (
6+
github.com/gin-gonic/gin v1.9.1
7+
github.com/go-redis/redis/v8 v8.11.5
8+
github.com/golang-jwt/jwt/v4 v4.5.0
9+
github.com/gorilla/mux v1.8.0
10+
github.com/gorilla/websocket v1.5.0
11+
github.com/lib/pq v1.10.9
12+
github.com/stretchr/testify v1.8.2
13+
go.uber.org/zap v1.24.0
14+
golang.org/x/crypto v0.9.0
15+
gopkg.in/yaml.v3 v3.0.1
16+
gorm.io/driver/postgres v1.5.0
17+
gorm.io/gorm v1.25.1
18+
)
19+
20+
require (
21+
github.com/bytedance/sonic v1.8.8 // indirect
22+
github.com/cespare/xxhash/v2 v2.2.0 // indirect
23+
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
24+
github.com/davecgh/go-spew v1.1.1 // indirect
25+
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
26+
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
27+
github.com/gin-contrib/sse v0.1.0 // indirect
28+
github.com/go-playground/locales v0.14.1 // indirect
29+
github.com/go-playground/universal-translator v0.18.1 // indirect
30+
github.com/go-playground/validator/v10 v10.13.0 // indirect
31+
github.com/goccy/go-json v0.10.2 // indirect
32+
github.com/jackc/pgpassfile v1.0.0 // indirect
33+
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
34+
github.com/jackc/pgx/v5 v5.3.1 // indirect
35+
github.com/jinzhu/inflection v1.0.0 // indirect
36+
github.com/jinzhu/now v1.1.5 // indirect
37+
github.com/json-iterator/go v1.1.12 // indirect
38+
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
39+
github.com/leodido/go-urn v1.2.4 // indirect
40+
github.com/mattn/go-isatty v0.0.18 // indirect
41+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
42+
github.com/modern-go/reflect2 v1.0.2 // indirect
43+
github.com/pelletier/go-toml/v2 v2.0.7 // indirect
44+
github.com/pmezard/go-difflib v1.0.0 // indirect
45+
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
46+
github.com/ugorji/go/codec v1.2.11 // indirect
47+
go.uber.org/atomic v1.11.0 // indirect
48+
go.uber.org/multierr v1.11.0 // indirect
49+
golang.org/x/arch v0.3.0 // indirect
50+
golang.org/x/net v0.10.0 // indirect
51+
golang.org/x/sys v0.8.0 // indirect
52+
golang.org/x/text v0.9.0 // indirect
53+
)

0 commit comments

Comments
 (0)