Supply Chain Audit
Standalone skill for analyzing the supply chain threat landscape of a project's direct dependencies.
Load skills: zsh-compat
Usage
/rune:supply-chain-audit # Auto-detect package manager, analyze all
/rune:supply-chain-audit --max 20 # Limit to 20 dependencies
/rune:supply-chain-audit --manager npm # Force specific package manager
Flags
| Flag |
Effect |
--max N |
Maximum dependencies to analyze (default: 50, from talisman) |
--manager TYPE |
Force package manager: npm, pip, cargo, go, composer |
Workflow
const args = "$ARGUMENTS".trim()
const maxFlag = args.match(/--max\s+(\d+)/)
const managerFlag = args.match(/--manager\s+(\w+)/)
// Read talisman config
// readTalismanSection: "misc"
const talismanMisc = readTalismanSection("misc") ?? {}
const supplyChainConfig = talismanMisc.supply_chain ?? {}
if (supplyChainConfig.enabled === false) {
log("Supply chain audit is disabled in talisman. Set supply_chain.enabled: true to enable.")
return
}
const maxDeps = maxFlag ? parseInt(maxFlag[1]) : (supplyChainConfig.max_dependencies ?? 50)
const riskThreshold = supplyChainConfig.risk_threshold ?? "medium"
// Step 1: Auto-detect package manager
const manifests = {
npm: "package.json",
pip: ["requirements.txt", "pyproject.toml"],
cargo: "Cargo.toml",
go: "go.mod",
composer: "composer.json"
}
let detectedManagers = []
if (managerFlag) {
detectedManagers = [managerFlag[1]]
} else {
// Scan for manifest files
for (const [manager, files] of Object.entries(manifests)) {
const fileList = Array.isArray(files) ? files : [files]
for (const f of fileList) {
if (Glob(f).length > 0) {
detectedManagers.push(manager)
break
}
}
}
}
if (detectedManagers.length === 0) {
log("No package manifest files found. Supply chain audit requires package.json, requirements.txt, Cargo.toml, go.mod, or composer.json.")
return
}
log(`Detected package managers: ${detectedManagers.join(", ")}`)
// Step 2: Extract dependencies per manager
let allDeps = []
for (const manager of detectedManagers) {
let deps = []
switch (manager) {
case "npm":
// Read package.json, extract .dependencies keys
const pkg = JSON.parse(Read("package.json"))
deps = Object.keys(pkg.dependencies || {}).map(name => ({
name, version: pkg.dependencies[name], manager: "npm"
}))
break
case "pip":
// Read requirements.txt, strip version specifiers
const reqFile = Glob("requirements.txt").length > 0 ? "requirements.txt" : null
if (reqFile) {
const lines = Read(reqFile).split("\n")
.filter(l => l.trim() && !l.startsWith("#") && !l.startsWith("-"))
.map(l => ({ name: l.replace(/[>=<!\[].*$/, "").trim(), version: "*", manager: "pip" }))
deps = lines
}
break
case "cargo":
// Parse Cargo.toml [dependencies]
const cargoContent = Read("Cargo.toml")
const depSection = cargoContent.match(/\[dependencies\]([\s\S]*?)(?:\[|$)/)?.[1] || ""
deps = depSection.split("\n")
.filter(l => l.includes("="))
.map(l => ({ name: l.split("=")[0].trim().replace(/"/g, ""), version: l.split("=")[1]?.trim(), manager: "cargo" }))
break
case "go":
// Parse go.mod require block
const goContent = Read("go.mod")
const requireBlock = goContent.match(/require \(([\s\S]*?)\)/)?.[1] || ""
deps = requireBlock.split("\n")
.filter(l => l.trim())
.map(l => {
const parts = l.trim().split(/\s+/)
return { name: parts[0], version: parts[1], manager: "go" }
})
break
case "composer":
const composer = JSON.parse(Read("composer.json"))
deps = Object.keys(composer.require || {})
.filter(n => n !== "php" && !n.startsWith("ext-"))
.map(name => ({ name, version: composer.require[name], manager: "composer" }))
break
}
allDeps = allDeps.concat(deps)
}
// Cap at maxDeps
if (allDeps.length > maxDeps) {
log(`Found ${allDeps.length} dependencies, capping at ${maxDeps}`)
allDeps = allDeps.slice(0, maxDeps)
}
log(`Analyzing ${allDeps.length} dependencies...`)
// Step 3: For each dependency, query registry + GitHub for risk signals
// Uses gh api for GitHub data, npm view / curl for registry data
// Scores across 6 risk dimensions per the supply-chain-sentinel agent protocol
// Step 4: Generate structured risk report
// Output format matches supply-chain-sentinel output with risk summary table
// Step 5: For P1/P2 findings, suggest alternatives via WebSearch (if available)
// Present final report to user
Risk Dimensions
| Dimension |
Weight |
P1 Threshold |
P2 Threshold |
P3 Threshold |
| Maintainer count |
25% |
0-1 maintainers |
2-3 maintainers |
— |
| Last commit date |
25% |
>24 months |
12-24 months |
6-12 months |
| CVE history |
20% |
Unpatched CVEs |
3+ CVEs/2yr |
1-2 CVEs/2yr |
| Download trajectory |
10% |
— |
>50% decline |
>25% decline |
| Bus factor |
10% |
>90% single |
>70% single |
>50% single |
| Security policy |
10% |
— |
— |
Missing SECURITY.md |
Severity Mapping
- P1 (Critical): Abandoned package with known CVEs, or composite score >= 0.7
- P2 (High): Single maintainer, or abandoned (>12mo), or composite score >= 0.4
- P3 (Medium): Weak signals only, composite score >= 0.2
Output
The skill produces a formatted risk report directly in the conversation with:
- Risk summary table (all dependencies)
- Detailed findings for P1/P2/P3 dependencies
- Alternative package suggestions for high-risk dependencies
- Packages that could not be analyzed (API failures)
Talisman Configuration
# .rune/talisman.yml
supply_chain:
enabled: true # Enable supply chain analysis
max_dependencies: 50 # Cap on dependencies to analyze
risk_threshold: "medium" # Minimum risk level to report: low|medium|high
registries: # Override registry API endpoints (optional)
npm: "https://registry.npmjs.org"
pypi: "https://pypi.org/pypi"
Error Handling
| Error |
Recovery |
gh CLI not available |
Fall back to unauthenticated API calls (60 req/hr limit) |
| Registry API failure |
Mark dependency as UNCERTAIN, continue with others |
| GitHub API rate limit |
Stop GitHub queries, report partial results |
| No manifest files found |
Report and exit gracefully |
| Private/scoped packages |
Skip with note (cannot query public registries) |
1---
2name: supply-chain-audit
3description: |
4 Analyze project dependencies for supply chain risks. Checks maintainer count,
5 commit frequency, CVE history, abandonment signals, bus factor, and security
6 policy presence for each direct dependency. Supports npm, pip, cargo, go mod,
7 and composer.
8 Use when: "supply chain audit", "dependency risk", "check dependencies",
9 "maintainer risk", "abandoned packages", "dependency health",
10 "package security", "supply chain risk".
11user-invocable: true
12metadata:
13 source: https://skillmd.com/skills/aibot88/supply-chain-audit
14---
15
16# Supply Chain Audit
17
18Standalone skill for analyzing the supply chain threat landscape of a project's direct dependencies.
19
20**Load skills**: `zsh-compat`
21
22## Usage
23
24```bash
25/rune:supply-chain-audit # Auto-detect package manager, analyze all
26/rune:supply-chain-audit --max 20 # Limit to 20 dependencies
27/rune:supply-chain-audit --manager npm # Force specific package manager
28```
29
30## Flags
31
32| Flag | Effect |
33|------|--------|
34| `--max N` | Maximum dependencies to analyze (default: 50, from talisman) |
35| `--manager TYPE` | Force package manager: npm, pip, cargo, go, composer |
36
37## Workflow
38
39```javascript
40const args = "$ARGUMENTS".trim()
41const maxFlag = args.match(/--max\s+(\d+)/)
42const managerFlag = args.match(/--manager\s+(\w+)/)
43
44// Read talisman config
45// readTalismanSection: "misc"
46const talismanMisc = readTalismanSection("misc") ?? {}
47const supplyChainConfig = talismanMisc.supply_chain ?? {}
48
49if (supplyChainConfig.enabled === false) {
50 log("Supply chain audit is disabled in talisman. Set supply_chain.enabled: true to enable.")
51 return
52}
53
54const maxDeps = maxFlag ? parseInt(maxFlag[1]) : (supplyChainConfig.max_dependencies ?? 50)
55const riskThreshold = supplyChainConfig.risk_threshold ?? "medium"
56
57// Step 1: Auto-detect package manager
58const manifests = {
59 npm: "package.json",
60 pip: ["requirements.txt", "pyproject.toml"],
61 cargo: "Cargo.toml",
62 go: "go.mod",
63 composer: "composer.json"
64}
65
66let detectedManagers = []
67if (managerFlag) {
68 detectedManagers = [managerFlag[1]]
69} else {
70 // Scan for manifest files
71 for (const [manager, files] of Object.entries(manifests)) {
72 const fileList = Array.isArray(files) ? files : [files]
73 for (const f of fileList) {
74 if (Glob(f).length > 0) {
75 detectedManagers.push(manager)
76 break
77 }
78 }
79 }
80}
81
82if (detectedManagers.length === 0) {
83 log("No package manifest files found. Supply chain audit requires package.json, requirements.txt, Cargo.toml, go.mod, or composer.json.")
84 return
85}
86
87log(`Detected package managers: ${detectedManagers.join(", ")}`)
88
89// Step 2: Extract dependencies per manager
90let allDeps = []
91
92for (const manager of detectedManagers) {
93 let deps = []
94 switch (manager) {
95 case "npm":
96 // Read package.json, extract .dependencies keys
97 const pkg = JSON.parse(Read("package.json"))
98 deps = Object.keys(pkg.dependencies || {}).map(name => ({
99 name, version: pkg.dependencies[name], manager: "npm"
100 }))
101 break
102 case "pip":
103 // Read requirements.txt, strip version specifiers
104 const reqFile = Glob("requirements.txt").length > 0 ? "requirements.txt" : null
105 if (reqFile) {
106 const lines = Read(reqFile).split("\n")
107 .filter(l => l.trim() && !l.startsWith("#") && !l.startsWith("-"))
108 .map(l => ({ name: l.replace(/[>=<!\[].*$/, "").trim(), version: "*", manager: "pip" }))
109 deps = lines
110 }
111 break
112 case "cargo":
113 // Parse Cargo.toml [dependencies]
114 const cargoContent = Read("Cargo.toml")
115 const depSection = cargoContent.match(/\[dependencies\]([\s\S]*?)(?:\[|$)/)?.[1] || ""
116 deps = depSection.split("\n")
117 .filter(l => l.includes("="))
118 .map(l => ({ name: l.split("=")[0].trim().replace(/"/g, ""), version: l.split("=")[1]?.trim(), manager: "cargo" }))
119 break
120 case "go":
121 // Parse go.mod require block
122 const goContent = Read("go.mod")
123 const requireBlock = goContent.match(/require \(([\s\S]*?)\)/)?.[1] || ""
124 deps = requireBlock.split("\n")
125 .filter(l => l.trim())
126 .map(l => {
127 const parts = l.trim().split(/\s+/)
128 return { name: parts[0], version: parts[1], manager: "go" }
129 })
130 break
131 case "composer":
132 const composer = JSON.parse(Read("composer.json"))
133 deps = Object.keys(composer.require || {})
134 .filter(n => n !== "php" && !n.startsWith("ext-"))
135 .map(name => ({ name, version: composer.require[name], manager: "composer" }))
136 break
137 }
138 allDeps = allDeps.concat(deps)
139}
140
141// Cap at maxDeps
142if (allDeps.length > maxDeps) {
143 log(`Found ${allDeps.length} dependencies, capping at ${maxDeps}`)
144 allDeps = allDeps.slice(0, maxDeps)
145}
146
147log(`Analyzing ${allDeps.length} dependencies...`)
148
149// Step 3: For each dependency, query registry + GitHub for risk signals
150// Uses gh api for GitHub data, npm view / curl for registry data
151// Scores across 6 risk dimensions per the supply-chain-sentinel agent protocol
152
153// Step 4: Generate structured risk report
154// Output format matches supply-chain-sentinel output with risk summary table
155
156// Step 5: For P1/P2 findings, suggest alternatives via WebSearch (if available)
157
158// Present final report to user
159```
160
161## Risk Dimensions
162
163| Dimension | Weight | P1 Threshold | P2 Threshold | P3 Threshold |
164|-----------|--------|-------------|-------------|-------------|
165| Maintainer count | 25% | 0-1 maintainers | 2-3 maintainers | — |
166| Last commit date | 25% | >24 months | 12-24 months | 6-12 months |
167| CVE history | 20% | Unpatched CVEs | 3+ CVEs/2yr | 1-2 CVEs/2yr |
168| Download trajectory | 10% | — | >50% decline | >25% decline |
169| Bus factor | 10% | >90% single | >70% single | >50% single |
170| Security policy | 10% | — | — | Missing SECURITY.md |
171
172## Severity Mapping
173
174- **P1 (Critical)**: Abandoned package with known CVEs, or composite score >= 0.7
175- **P2 (High)**: Single maintainer, or abandoned (>12mo), or composite score >= 0.4
176- **P3 (Medium)**: Weak signals only, composite score >= 0.2
177
178## Output
179
180The skill produces a formatted risk report directly in the conversation with:
181- Risk summary table (all dependencies)
182- Detailed findings for P1/P2/P3 dependencies
183- Alternative package suggestions for high-risk dependencies
184- Packages that could not be analyzed (API failures)
185
186## Talisman Configuration
187
188```yaml
189# .rune/talisman.yml
190supply_chain:
191 enabled: true # Enable supply chain analysis
192 max_dependencies: 50 # Cap on dependencies to analyze
193 risk_threshold: "medium" # Minimum risk level to report: low|medium|high
194 registries: # Override registry API endpoints (optional)
195 npm: "https://registry.npmjs.org"
196 pypi: "https://pypi.org/pypi"
197```
198
199## Error Handling
200
201| Error | Recovery |
202|-------|----------|
203| `gh` CLI not available | Fall back to unauthenticated API calls (60 req/hr limit) |
204| Registry API failure | Mark dependency as UNCERTAIN, continue with others |
205| GitHub API rate limit | Stop GitHub queries, report partial results |
206| No manifest files found | Report and exit gracefully |
207| Private/scoped packages | Skip with note (cannot query public registries) |