@vigolium/piolium 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (271) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +117 -0
  3. package/agents/access-auditor.md +300 -0
  4. package/agents/assumption-breaker.md +154 -0
  5. package/agents/attack-designer.md +116 -0
  6. package/agents/code-scanner.md +139 -0
  7. package/agents/concurrency-auditor.md +238 -0
  8. package/agents/confirm-writer.md +257 -0
  9. package/agents/context-reviewer.md +274 -0
  10. package/agents/cross-verifier.md +165 -0
  11. package/agents/cve-scout.md +381 -0
  12. package/agents/env-builder.md +282 -0
  13. package/agents/env-profiler.md +205 -0
  14. package/agents/evidence-collector.md +140 -0
  15. package/agents/finding-grader.md +142 -0
  16. package/agents/finding-writer.md +148 -0
  17. package/agents/flow-tracer.md +106 -0
  18. package/agents/goal-backtracer.md +146 -0
  19. package/agents/history-miner.md +467 -0
  20. package/agents/independent-verifier.md +118 -0
  21. package/agents/intent-mapper.md +183 -0
  22. package/agents/longshot-collector.md +128 -0
  23. package/agents/longshot-prober.md +126 -0
  24. package/agents/patch-auditor.md +73 -0
  25. package/agents/poc-author.md +124 -0
  26. package/agents/poc-runner.md +194 -0
  27. package/agents/probe-lead.md +269 -0
  28. package/agents/red-challenger.md +101 -0
  29. package/agents/report-composer.md +208 -0
  30. package/agents/review-adjudicator.md +216 -0
  31. package/agents/spec-auditor.md +155 -0
  32. package/agents/taint-tracer.md +265 -0
  33. package/agents/test-locator.md +209 -0
  34. package/agents/threat-modeler.md +132 -0
  35. package/agents/variant-scanner.md +108 -0
  36. package/agents/variant-spotter.md +110 -0
  37. package/bin/piolium.mjs +376 -0
  38. package/extensions/piolium/_vendor/yaml.bundle.d.mts +6 -0
  39. package/extensions/piolium/_vendor/yaml.bundle.mjs +139 -0
  40. package/extensions/piolium/agent-runner.ts +322 -0
  41. package/extensions/piolium/agents.ts +266 -0
  42. package/extensions/piolium/audit-state.ts +522 -0
  43. package/extensions/piolium/bundled-resources.ts +97 -0
  44. package/extensions/piolium/candidate-scan.ts +966 -0
  45. package/extensions/piolium/command-target.ts +177 -0
  46. package/extensions/piolium/console-stream.ts +57 -0
  47. package/extensions/piolium/export-results.ts +380 -0
  48. package/extensions/piolium/findings.ts +448 -0
  49. package/extensions/piolium/heartbeat.ts +182 -0
  50. package/extensions/piolium/help.ts +234 -0
  51. package/extensions/piolium/index.ts +1865 -0
  52. package/extensions/piolium/longshot.ts +530 -0
  53. package/extensions/piolium/matcher-suggestions.ts +196 -0
  54. package/extensions/piolium/matcher-utils.ts +83 -0
  55. package/extensions/piolium/modes/balanced.ts +750 -0
  56. package/extensions/piolium/modes/confirm-bootstrap.ts +186 -0
  57. package/extensions/piolium/modes/confirm.ts +697 -0
  58. package/extensions/piolium/modes/deep.ts +917 -0
  59. package/extensions/piolium/modes/diff.ts +177 -0
  60. package/extensions/piolium/modes/lite.ts +540 -0
  61. package/extensions/piolium/modes/longshot.ts +595 -0
  62. package/extensions/piolium/modes/merge.ts +204 -0
  63. package/extensions/piolium/modes/phase-runner.ts +267 -0
  64. package/extensions/piolium/modes/reinvest.ts +546 -0
  65. package/extensions/piolium/modes/revisit.ts +279 -0
  66. package/extensions/piolium/modes.ts +48 -0
  67. package/extensions/piolium/phase-labels.ts +123 -0
  68. package/extensions/piolium/phase-status-strip.ts +92 -0
  69. package/extensions/piolium/prompt-prefix-editor.ts +39 -0
  70. package/extensions/piolium/providers/anthropic-vertex.ts +836 -0
  71. package/extensions/piolium/recon.ts +409 -0
  72. package/extensions/piolium/result-stats.ts +105 -0
  73. package/extensions/piolium/retry.ts +120 -0
  74. package/extensions/piolium/scheduler.ts +212 -0
  75. package/extensions/piolium/secrets.ts +368 -0
  76. package/extensions/piolium/tools/web-tools.ts +148 -0
  77. package/package.json +77 -0
  78. package/skills/agentic-actions-auditor/SKILL.md +327 -0
  79. package/skills/agentic-actions-auditor/references/action-profiles.md +186 -0
  80. package/skills/agentic-actions-auditor/references/cross-file-resolution.md +209 -0
  81. package/skills/agentic-actions-auditor/references/foundations.md +94 -0
  82. package/skills/agentic-actions-auditor/references/vector-a-env-var-intermediary.md +77 -0
  83. package/skills/agentic-actions-auditor/references/vector-b-direct-expression-injection.md +83 -0
  84. package/skills/agentic-actions-auditor/references/vector-c-cli-data-fetch.md +83 -0
  85. package/skills/agentic-actions-auditor/references/vector-d-pr-target-checkout.md +88 -0
  86. package/skills/agentic-actions-auditor/references/vector-e-error-log-injection.md +88 -0
  87. package/skills/agentic-actions-auditor/references/vector-f-subshell-expansion.md +82 -0
  88. package/skills/agentic-actions-auditor/references/vector-g-eval-of-ai-output.md +91 -0
  89. package/skills/agentic-actions-auditor/references/vector-h-dangerous-sandbox-configs.md +102 -0
  90. package/skills/agentic-actions-auditor/references/vector-i-wildcard-allowlists.md +88 -0
  91. package/skills/audit/SKILL.md +562 -0
  92. package/skills/audit/assets/icon.svg +7 -0
  93. package/skills/audit/hooks/scripts/validate_phase_output.py +550 -0
  94. package/skills/audit/references/adversarial-review.md +148 -0
  95. package/skills/audit/references/architecture-aware-sast.md +306 -0
  96. package/skills/audit/references/audit-workflow.md +737 -0
  97. package/skills/audit/references/chamber-protocol.md +384 -0
  98. package/skills/audit/references/creative-attack-modes.md +221 -0
  99. package/skills/audit/references/deep-analysis.md +273 -0
  100. package/skills/audit/references/domain-attack-playbooks.md +1129 -0
  101. package/skills/audit/references/knowledge-base-template.md +513 -0
  102. package/skills/audit/references/real-env-validation.md +191 -0
  103. package/skills/audit/references/report-templates.md +417 -0
  104. package/skills/audit/references/triage-and-prereqs.md +134 -0
  105. package/skills/audit/scripts/consolidate_drafts.py +554 -0
  106. package/skills/audit/scripts/partition_findings.py +152 -0
  107. package/skills/audit/scripts/rg-hotspots.sh +121 -0
  108. package/skills/audit/scripts/stamp_file_state.py +349 -0
  109. package/skills/code-reviewer/SKILL.md +65 -0
  110. package/skills/codeql/SKILL.md +281 -0
  111. package/skills/codeql/references/build-fixes.md +90 -0
  112. package/skills/codeql/references/diagnostic-query-templates.md +339 -0
  113. package/skills/codeql/references/extension-yaml-format.md +209 -0
  114. package/skills/codeql/references/important-only-suite.md +153 -0
  115. package/skills/codeql/references/language-details.md +207 -0
  116. package/skills/codeql/references/macos-arm64e-workaround.md +179 -0
  117. package/skills/codeql/references/performance-tuning.md +111 -0
  118. package/skills/codeql/references/quality-assessment.md +172 -0
  119. package/skills/codeql/references/ruleset-catalog.md +63 -0
  120. package/skills/codeql/references/run-all-suite.md +92 -0
  121. package/skills/codeql/references/sarif-processing.md +79 -0
  122. package/skills/codeql/references/threat-models.md +51 -0
  123. package/skills/codeql/workflows/build-database.md +280 -0
  124. package/skills/codeql/workflows/create-data-extensions.md +261 -0
  125. package/skills/codeql/workflows/run-analysis.md +301 -0
  126. package/skills/differential-review/SKILL.md +220 -0
  127. package/skills/differential-review/adversarial.md +203 -0
  128. package/skills/differential-review/methodology.md +234 -0
  129. package/skills/differential-review/patterns.md +300 -0
  130. package/skills/differential-review/reporting.md +369 -0
  131. package/skills/fp-check/SKILL.md +125 -0
  132. package/skills/fp-check/references/bug-class-verification.md +114 -0
  133. package/skills/fp-check/references/deep-verification.md +143 -0
  134. package/skills/fp-check/references/evidence-templates.md +91 -0
  135. package/skills/fp-check/references/false-positive-patterns.md +115 -0
  136. package/skills/fp-check/references/gate-reviews.md +27 -0
  137. package/skills/fp-check/references/standard-verification.md +78 -0
  138. package/skills/insecure-defaults/SKILL.md +117 -0
  139. package/skills/insecure-defaults/references/examples.md +409 -0
  140. package/skills/last30days/SKILL.md +444 -0
  141. package/skills/sarif-parsing/SKILL.md +483 -0
  142. package/skills/sarif-parsing/resources/jq-queries.md +162 -0
  143. package/skills/sarif-parsing/resources/sarif_helpers.py +331 -0
  144. package/skills/security-threat-model/LICENSE.txt +201 -0
  145. package/skills/security-threat-model/SKILL.md +81 -0
  146. package/skills/security-threat-model/agents/openai.yaml +4 -0
  147. package/skills/security-threat-model/references/prompt-template.md +255 -0
  148. package/skills/security-threat-model/references/security-controls-and-assets.md +32 -0
  149. package/skills/semgrep/SKILL.md +212 -0
  150. package/skills/semgrep/references/rulesets.md +162 -0
  151. package/skills/semgrep/references/scan-modes.md +110 -0
  152. package/skills/semgrep/references/scanner-task-prompt.md +140 -0
  153. package/skills/semgrep/scripts/merge_sarif.py +203 -0
  154. package/skills/semgrep/workflows/scan-workflow.md +311 -0
  155. package/skills/semgrep-rule-creator/SKILL.md +168 -0
  156. package/skills/semgrep-rule-creator/references/quick-reference.md +202 -0
  157. package/skills/semgrep-rule-creator/references/workflow.md +240 -0
  158. package/skills/semgrep-rule-variant-creator/SKILL.md +205 -0
  159. package/skills/semgrep-rule-variant-creator/references/applicability-analysis.md +250 -0
  160. package/skills/semgrep-rule-variant-creator/references/language-syntax-guide.md +324 -0
  161. package/skills/semgrep-rule-variant-creator/references/workflow.md +518 -0
  162. package/skills/sharp-edges/SKILL.md +292 -0
  163. package/skills/sharp-edges/references/auth-patterns.md +252 -0
  164. package/skills/sharp-edges/references/case-studies.md +274 -0
  165. package/skills/sharp-edges/references/config-patterns.md +333 -0
  166. package/skills/sharp-edges/references/crypto-apis.md +190 -0
  167. package/skills/sharp-edges/references/lang-c.md +205 -0
  168. package/skills/sharp-edges/references/lang-csharp.md +285 -0
  169. package/skills/sharp-edges/references/lang-go.md +270 -0
  170. package/skills/sharp-edges/references/lang-java.md +263 -0
  171. package/skills/sharp-edges/references/lang-javascript.md +269 -0
  172. package/skills/sharp-edges/references/lang-kotlin.md +265 -0
  173. package/skills/sharp-edges/references/lang-php.md +245 -0
  174. package/skills/sharp-edges/references/lang-python.md +274 -0
  175. package/skills/sharp-edges/references/lang-ruby.md +273 -0
  176. package/skills/sharp-edges/references/lang-rust.md +272 -0
  177. package/skills/sharp-edges/references/lang-swift.md +287 -0
  178. package/skills/sharp-edges/references/language-specific.md +588 -0
  179. package/skills/spec-to-code-compliance/SKILL.md +357 -0
  180. package/skills/spec-to-code-compliance/resources/COMPLETENESS_CHECKLIST.md +69 -0
  181. package/skills/spec-to-code-compliance/resources/IR_EXAMPLES.md +417 -0
  182. package/skills/spec-to-code-compliance/resources/OUTPUT_REQUIREMENTS.md +105 -0
  183. package/skills/supply-chain-risk-auditor/SKILL.md +67 -0
  184. package/skills/supply-chain-risk-auditor/resources/results-template.md +41 -0
  185. package/skills/variant-analysis/METHODOLOGY.md +327 -0
  186. package/skills/variant-analysis/SKILL.md +142 -0
  187. package/skills/variant-analysis/resources/codeql/cpp.ql +119 -0
  188. package/skills/variant-analysis/resources/codeql/go.ql +69 -0
  189. package/skills/variant-analysis/resources/codeql/java.ql +71 -0
  190. package/skills/variant-analysis/resources/codeql/javascript.ql +63 -0
  191. package/skills/variant-analysis/resources/codeql/python.ql +80 -0
  192. package/skills/variant-analysis/resources/semgrep/cpp.yaml +98 -0
  193. package/skills/variant-analysis/resources/semgrep/go.yaml +63 -0
  194. package/skills/variant-analysis/resources/semgrep/java.yaml +61 -0
  195. package/skills/variant-analysis/resources/semgrep/javascript.yaml +60 -0
  196. package/skills/variant-analysis/resources/semgrep/python.yaml +72 -0
  197. package/skills/variant-analysis/resources/variant-report-template.md +75 -0
  198. package/skills/vuln-report/SKILL.md +137 -0
  199. package/skills/vuln-report/agents/openai.yaml +4 -0
  200. package/skills/vuln-report/references/report-template.md +135 -0
  201. package/skills/wooyun-legacy/SKILL.md +367 -0
  202. package/skills/wooyun-legacy/references/bank-penetration.md +222 -0
  203. package/skills/wooyun-legacy/references/checklists/command-execution-checklist.md +119 -0
  204. package/skills/wooyun-legacy/references/checklists/csrf-checklist.md +74 -0
  205. package/skills/wooyun-legacy/references/checklists/file-upload-checklist.md +108 -0
  206. package/skills/wooyun-legacy/references/checklists/info-disclosure-checklist.md +114 -0
  207. package/skills/wooyun-legacy/references/checklists/logic-flaws-checklist.md +95 -0
  208. package/skills/wooyun-legacy/references/checklists/misconfig-checklist.md +124 -0
  209. package/skills/wooyun-legacy/references/checklists/path-traversal-checklist.md +87 -0
  210. package/skills/wooyun-legacy/references/checklists/rce-checklist.md +93 -0
  211. package/skills/wooyun-legacy/references/checklists/sql-injection-checklist.md +97 -0
  212. package/skills/wooyun-legacy/references/checklists/ssrf-checklist.md +99 -0
  213. package/skills/wooyun-legacy/references/checklists/unauthorized-access-checklist.md +89 -0
  214. package/skills/wooyun-legacy/references/checklists/weak-password-checklist.md +115 -0
  215. package/skills/wooyun-legacy/references/checklists/xss-checklist.md +103 -0
  216. package/skills/wooyun-legacy/references/checklists/xxe-checklist.md +130 -0
  217. package/skills/wooyun-legacy/references/info-disclosure.md +975 -0
  218. package/skills/wooyun-legacy/references/logic-flaws.md +721 -0
  219. package/skills/wooyun-legacy/references/path-traversal.md +1191 -0
  220. package/skills/wooyun-legacy/references/telecom-penetration.md +156 -0
  221. package/skills/wooyun-legacy/references/unauthorized-access.md +980 -0
  222. package/skills/wooyun-legacy/references/xss.md +746 -0
  223. package/skills/zeroize-audit/SKILL.md +371 -0
  224. package/skills/zeroize-audit/configs/c.yaml +21 -0
  225. package/skills/zeroize-audit/configs/default.yaml +128 -0
  226. package/skills/zeroize-audit/configs/rust.yaml +83 -0
  227. package/skills/zeroize-audit/prompts/report_template.md +238 -0
  228. package/skills/zeroize-audit/prompts/system.md +163 -0
  229. package/skills/zeroize-audit/prompts/task.md +97 -0
  230. package/skills/zeroize-audit/references/compile-commands.md +231 -0
  231. package/skills/zeroize-audit/references/detection-strategy.md +191 -0
  232. package/skills/zeroize-audit/references/ir-analysis.md +252 -0
  233. package/skills/zeroize-audit/references/mcp-analysis.md +221 -0
  234. package/skills/zeroize-audit/references/poc-generation.md +470 -0
  235. package/skills/zeroize-audit/references/rust-zeroization-patterns.md +867 -0
  236. package/skills/zeroize-audit/schemas/input.json +83 -0
  237. package/skills/zeroize-audit/schemas/output.json +140 -0
  238. package/skills/zeroize-audit/tools/analyze_asm.sh +202 -0
  239. package/skills/zeroize-audit/tools/analyze_cfg.py +381 -0
  240. package/skills/zeroize-audit/tools/analyze_heap.sh +211 -0
  241. package/skills/zeroize-audit/tools/analyze_ir_semantic.py +429 -0
  242. package/skills/zeroize-audit/tools/diff_ir.sh +135 -0
  243. package/skills/zeroize-audit/tools/diff_rust_mir.sh +189 -0
  244. package/skills/zeroize-audit/tools/emit_asm.sh +67 -0
  245. package/skills/zeroize-audit/tools/emit_ir.sh +77 -0
  246. package/skills/zeroize-audit/tools/emit_rust_asm.sh +178 -0
  247. package/skills/zeroize-audit/tools/emit_rust_ir.sh +150 -0
  248. package/skills/zeroize-audit/tools/emit_rust_mir.sh +158 -0
  249. package/skills/zeroize-audit/tools/extract_compile_flags.py +284 -0
  250. package/skills/zeroize-audit/tools/generate_poc.py +1329 -0
  251. package/skills/zeroize-audit/tools/mcp/apply_confidence_gates.py +113 -0
  252. package/skills/zeroize-audit/tools/mcp/check_mcp.sh +68 -0
  253. package/skills/zeroize-audit/tools/mcp/normalize_mcp_evidence.py +125 -0
  254. package/skills/zeroize-audit/tools/scripts/check_llvm_patterns.py +481 -0
  255. package/skills/zeroize-audit/tools/scripts/check_mir_patterns.py +554 -0
  256. package/skills/zeroize-audit/tools/scripts/check_rust_asm.py +424 -0
  257. package/skills/zeroize-audit/tools/scripts/check_rust_asm_aarch64.py +300 -0
  258. package/skills/zeroize-audit/tools/scripts/check_rust_asm_x86.py +283 -0
  259. package/skills/zeroize-audit/tools/scripts/find_dangerous_apis.py +375 -0
  260. package/skills/zeroize-audit/tools/scripts/semantic_audit.py +923 -0
  261. package/skills/zeroize-audit/tools/track_dataflow.sh +196 -0
  262. package/skills/zeroize-audit/tools/validate_rust_toolchain.sh +298 -0
  263. package/skills/zeroize-audit/workflows/phase-0-preflight.md +150 -0
  264. package/skills/zeroize-audit/workflows/phase-1-source-analysis.md +144 -0
  265. package/skills/zeroize-audit/workflows/phase-2-compiler-analysis.md +139 -0
  266. package/skills/zeroize-audit/workflows/phase-3-interim-report.md +46 -0
  267. package/skills/zeroize-audit/workflows/phase-4-poc-generation.md +46 -0
  268. package/skills/zeroize-audit/workflows/phase-5-poc-validation.md +136 -0
  269. package/skills/zeroize-audit/workflows/phase-6-final-report.md +44 -0
  270. package/skills/zeroize-audit/workflows/phase-7-test-generation.md +42 -0
  271. package/themes/piolium-srcery.json +94 -0
@@ -0,0 +1,417 @@
1
+ # Intermediate Representation Examples
2
+
3
+ The following examples demonstrate the complete IR workflow using realistic DEX swap patterns.
4
+
5
+ ---
6
+
7
+ ## Example 1: Spec-IR Record
8
+
9
+ **Scenario:** Extracting a security requirement from a DEX protocol whitepaper.
10
+
11
+ ```yaml
12
+ id: SPEC-001
13
+ spec_excerpt: "All swaps MUST enforce maximum slippage of 1% to protect users from sandwich attacks"
14
+ source_section: "Whitepaper §4.1 - Trading Mechanism & User Protection"
15
+ source_document: "dex-protocol-whitepaper-v3.pdf"
16
+ semantic_type: invariant
17
+ normalized_form:
18
+ type: constraint
19
+ entity: swap_transaction
20
+ operation: token_exchange
21
+ condition: "abs((actual_output - expected_output) / expected_output) <= 0.01"
22
+ enforcement: MUST (mandatory)
23
+ rationale: "sandwich_attack_prevention"
24
+ confidence: 1.0
25
+ notes: "Slippage measured as percentage deviation from expected output at transaction submission time"
26
+ ```
27
+
28
+ **What this shows:**
29
+ - Extraction of trading protection requirement with full traceability
30
+ - Normalized form makes slippage calculation explicit and machine-verifiable
31
+ - High confidence (1.0) because requirement is stated explicitly with specific percentage
32
+ - Notes clarify measurement methodology
33
+
34
+ ---
35
+
36
+ ## Example 2: Code-IR Record
37
+
38
+ **Scenario:** Analyzing the `swap()` function in a DEX router contract.
39
+
40
+ ```yaml
41
+ id: CODE-001
42
+ file: "contracts/Router.sol"
43
+ function: "swap(address tokenIn, address tokenOut, uint256 amountIn, uint256 minAmountOut, uint256 deadline)"
44
+ lines: 89-135
45
+ visibility: external
46
+ modifiers: [nonReentrant, ensure(deadline)]
47
+
48
+ behavior:
49
+ preconditions:
50
+ - condition: "block.timestamp <= deadline"
51
+ line: 90
52
+ enforcement: modifier (ensure)
53
+ purpose: "prevent stale transactions"
54
+ - condition: "amountIn > 0"
55
+ line: 92
56
+ enforcement: require
57
+ - condition: "minAmountOut > 0"
58
+ line: 93
59
+ enforcement: require
60
+ - condition: "tokenIn != tokenOut"
61
+ line: 94
62
+ enforcement: require
63
+
64
+ state_reads:
65
+ - variable: "pairs[tokenIn][tokenOut]"
66
+ line: 98
67
+ purpose: "get liquidity pool address"
68
+ - variable: "reserves[pair]"
69
+ line: 102
70
+ purpose: "get current pool reserves"
71
+ - variable: "feeRate"
72
+ line: 108
73
+ purpose: "calculate trading fee"
74
+
75
+ state_writes:
76
+ - variable: "reserves[pair].reserve0"
77
+ line: 125
78
+ operation: "update after swap"
79
+ - variable: "reserves[pair].reserve1"
80
+ line: 126
81
+ operation: "update after swap"
82
+
83
+ computations:
84
+ - operation: "amountInWithFee = amountIn * 997"
85
+ line: 108
86
+ purpose: "apply 0.3% fee (997/1000)"
87
+ - operation: "amountOut = (amountInWithFee * reserveOut) / (reserveIn * 1000 + amountInWithFee)"
88
+ line: 110-111
89
+ purpose: "constant product formula (x * y = k)"
90
+ - operation: "slippageCheck = amountOut >= minAmountOut"
91
+ line: 115
92
+ purpose: "enforce user-specified minimum output"
93
+
94
+ external_calls:
95
+ - target: "IERC20(tokenIn).transferFrom(msg.sender, pair, amountIn)"
96
+ line: 118
97
+ type: "ERC20 transfer"
98
+ return_handling: "require success"
99
+ - target: "IERC20(tokenOut).transfer(msg.sender, amountOut)"
100
+ line: 122
101
+ type: "ERC20 transfer"
102
+ return_handling: "require success"
103
+
104
+ events:
105
+ - name: "Swap"
106
+ line: 130
107
+ parameters: "msg.sender, tokenIn, tokenOut, amountIn, amountOut"
108
+
109
+ postconditions:
110
+ - "amountOut >= minAmountOut (slippage protection enforced)"
111
+ - "reserves updated to maintain K=xy invariant"
112
+ - "tokenIn transferred from user to pool"
113
+ - "tokenOut transferred from pool to user"
114
+
115
+ invariants_enforced:
116
+ - "slippage_protection: amountOut >= minAmountOut (line 115)"
117
+ - "constant_product: reserveIn * reserveOut >= k_before (line 125-126)"
118
+ - "fee_application: effective_rate = 0.3% (line 108)"
119
+ ```
120
+
121
+ **What this shows:**
122
+ - Complete DEX swap function analysis with line-level precision
123
+ - Captures AMM constant product formula and fee mechanics
124
+ - Documents slippage protection enforcement at line 115
125
+ - Shows state transitions (reserve updates) and external interactions
126
+ - All claims reference specific line numbers for traceability
127
+
128
+ ---
129
+
130
+ ## Example 3: Alignment Record (Positive Case)
131
+
132
+ **Scenario:** Verifying that the swap function correctly implements the 0.3% fee requirement.
133
+
134
+ ```yaml
135
+ id: ALIGN-001
136
+ spec_ref: SPEC-002
137
+ code_ref: CODE-001
138
+
139
+ spec_claim: "Protocol MUST charge exactly 0.3% fee on all swaps"
140
+ spec_source: "Whitepaper §4.2 - Fee Structure"
141
+
142
+ code_behavior: "amountInWithFee = amountIn * 997 (line 108), effective fee = (1000-997)/1000 = 0.3%"
143
+ code_location: "Router.sol:L108"
144
+
145
+ match_type: full_match
146
+ confidence: 1.0
147
+
148
+ reasoning: |
149
+ Spec requires: 0.3% fee on all swaps
150
+ Code implements: amountIn * 997 / 1000
151
+
152
+ Mathematical verification:
153
+ - Fee deduction: 1000 - 997 = 3
154
+ - Fee percentage: 3 / 1000 = 0.003 = 0.3% ✓
155
+
156
+ The code uses numerator 997 instead of explicit fee subtraction,
157
+ but this is mathematically equivalent and gas-optimized.
158
+
159
+ Enforcement: Fee is applied before price calculation (line 108-111),
160
+ ensuring it affects the swap output. Cannot be bypassed.
161
+
162
+ evidence:
163
+ spec_quote: "The protocol charges a fixed 0.3% fee on the input amount for every swap transaction"
164
+ spec_location: "Whitepaper §4.2, page 8, paragraph 1"
165
+ code_quote: "uint256 amountInWithFee = amountIn * 997; // 0.3% fee: (1000-997)/1000"
166
+ code_location: "Router.sol:L108"
167
+
168
+ verification_steps:
169
+ - "Checked numerator 997 is used consistently"
170
+ - "Verified denominator 1000 matches in formula at L110-111"
171
+ - "Confirmed fee applies to all swap paths (no conditional logic)"
172
+ - "Validated fee is not configurable (hardcoded = guaranteed)"
173
+
174
+ ambiguity_notes: null
175
+ ```
176
+
177
+ **What this shows:**
178
+ - Successful alignment between spec requirement and code implementation
179
+ - Mathematical proof that 997/1000 = 0.3% fee
180
+ - Reasoning explains WHY implementation is correct (gas optimization via numerator)
181
+ - Evidence provides exact quotes and line numbers
182
+ - High confidence (1.0) due to clear mathematical equivalence
183
+
184
+ ---
185
+
186
+ ## Example 4: Divergence Finding (Critical Issue)
187
+
188
+ **Scenario:** Identifying that the critical slippage protection requirement is completely missing.
189
+
190
+ ```yaml
191
+ id: DIV-001
192
+ severity: CRITICAL
193
+ title: "Missing slippage protection enables unlimited sandwich attacks"
194
+
195
+ spec_claim:
196
+ excerpt: "All swaps MUST enforce maximum slippage of 1% to protect users from sandwich attacks"
197
+ source: "Whitepaper §4.1 - Trading Mechanism & User Protection"
198
+ source_location: "Page 7, paragraph 3"
199
+ semantic_type: security_constraint
200
+ enforcement_level: MUST (mandatory)
201
+
202
+ code_finding:
203
+ file: "contracts/RouterV1.sol"
204
+ function: "swap(address tokenIn, address tokenOut, uint256 amountIn)"
205
+ lines: 45-78
206
+ observation: "Function signature lacks minAmountOut parameter; no slippage validation exists"
207
+
208
+ match_type: missing_in_code
209
+ confidence: 1.0
210
+
211
+ reasoning: |
212
+ Specification Analysis:
213
+ - Spec explicitly requires: "MUST enforce maximum slippage of 1%"
214
+ - Requirement scope: "All swaps" (no exceptions)
215
+ - Purpose stated: "protect users from sandwich attacks"
216
+
217
+ Code Analysis:
218
+ - Function signature: swap(tokenIn, tokenOut, amountIn)
219
+ - Missing parameter: minAmountOut (required for slippage check)
220
+ - Line-by-line review of function body (L45-L78):
221
+ * L50-55: Price calculation from reserves
222
+ * L58-60: Fee deduction (0.3%)
223
+ * L62-65: Output amount calculation
224
+ * L68: Transfer tokenIn from user
225
+ * L72: Transfer tokenOut to user
226
+ * L75: Emit Swap event
227
+ - NO slippage validation found anywhere in function
228
+
229
+ Gap: Spec requires slippage protection → Code provides zero protection
230
+
231
+ Additional verification:
232
+ - Searched entire RouterV1.sol for "slippage", "minAmount", "minOutput": 0 results
233
+ - Checked if validation exists in called functions: None found
234
+ - Verified no modifiers perform slippage check: Confirmed absent
235
+
236
+ evidence:
237
+ spec_evidence:
238
+ quote: "To protect users from front-running and sandwich attacks, all swap operations MUST enforce a maximum slippage of 1% between the expected and actual output amounts"
239
+ location: "Whitepaper §4.1, page 7, paragraph 3"
240
+ emphasis: "MUST" indicates mandatory requirement
241
+
242
+ code_evidence:
243
+ function_signature: "function swap(address tokenIn, address tokenOut, uint256 amountIn) external"
244
+ signature_location: "RouterV1.sol:L45"
245
+ missing_parameter: "uint256 minAmountOut"
246
+
247
+ function_body_summary: |
248
+ L50: uint256 amountOut = calculateSwapOutput(tokenIn, tokenOut, amountIn);
249
+ L68: IERC20(tokenIn).transferFrom(msg.sender, pair, amountIn);
250
+ L72: IERC20(tokenOut).transfer(msg.sender, amountOut);
251
+
252
+ CRITICAL ISSUE: No validation that amountOut meets user expectations
253
+
254
+ search_results:
255
+ - pattern: "minAmountOut" → 0 occurrences in RouterV1.sol
256
+ - pattern: "slippage" → 0 occurrences in RouterV1.sol
257
+ - pattern: "require.*amountOut" → 0 occurrences in RouterV1.sol
258
+ - pattern: "amountOut >=" → 0 occurrences in RouterV1.sol
259
+
260
+ exploitability: |
261
+ Attack Vector: Classic Sandwich Attack
262
+
263
+ Prerequisites:
264
+ - Attacker monitors public mempool for pending swap transactions
265
+ - Attacker has capital to move market price (typically 10-50x target trade size)
266
+ - Target trade is on-chain (not private mempool)
267
+
268
+ Attack Sequence:
269
+
270
+ 1. Detection Phase
271
+ - Victim submits swap: 100 ETH → USDC
272
+ - Expected output at current price: 200,000 USDC (price = $2,000/ETH)
273
+ - Transaction appears in mempool with no slippage protection
274
+
275
+ 2. Front-Run Transaction
276
+ - Attacker submits swap: 500 ETH → USDC (higher gas to execute first)
277
+ - Large buy moves price: $2,000 → $2,100 (+5%)
278
+ - Pool reserves now imbalanced
279
+
280
+ 3. Victim Transaction Executes
281
+ - Victim's 100 ETH swap executes at manipulated price
282
+ - Actual output: 195,122 USDC (effective price $1,951/ETH)
283
+ - Victim loses: 4,878 USDC vs expected 200,000
284
+ - Loss percentage: 2.4% of trade value
285
+ - NO PROTECTION: Transaction succeeds despite 2.4% slippage (exceeds 1% spec limit)
286
+
287
+ 4. Back-Run Transaction
288
+ - Attacker sells USDC → ETH at inflated price
289
+ - Profits from price impact: ~$4,500
290
+ - Price returns toward equilibrium
291
+
292
+ Economic Analysis:
293
+ - Victim trade size: $200,000
294
+ - Attacker cost: Gas fees (~$50-100)
295
+ - Attacker profit: ~$4,500 (net ~$4,400)
296
+ - Victim loss: $4,878 (2.4% slippage)
297
+ - Attack ROI: 4400% in single block
298
+
299
+ Impact Scale:
300
+ - Per transaction: $500 - $10,000 extractable (depending on trade size)
301
+ - Daily volume: $10M → potential $100K-500K daily extraction
302
+ - Unlimited because: No slippage check = no upper bound on extraction
303
+
304
+ Real-World Precedent:
305
+ - SushiSwap (2020): Suffered sandwich attacks before slippage protection
306
+ - Average loss per victim: 1-5% of trade value
307
+ - Specification exists specifically to prevent this attack class
308
+
309
+ remediation:
310
+ immediate_fix: |
311
+ Add minAmountOut parameter and enforce slippage protection:
312
+
313
+ ```solidity
314
+ function swap(
315
+ address tokenIn,
316
+ address tokenOut,
317
+ uint256 amountIn,
318
+ uint256 minAmountOut, // NEW: User-specified minimum output
319
+ uint256 deadline // NEW: Prevent stale transactions
320
+ ) external ensure(deadline) nonReentrant {
321
+ require(amountIn > 0, "Invalid input amount");
322
+ require(minAmountOut > 0, "Invalid minimum output"); // NEW
323
+
324
+ // Existing price calculation
325
+ uint256 amountOut = calculateSwapOutput(tokenIn, tokenOut, amountIn);
326
+
327
+ // NEW: Enforce slippage protection
328
+ require(amountOut >= minAmountOut, "Slippage exceeded");
329
+
330
+ // Rest of swap logic...
331
+ }
332
+ ```
333
+
334
+ This allows users to specify maximum acceptable slippage:
335
+ - User calculates expected output: 200,000 USDC
336
+ - User sets minAmountOut: 198,000 USDC (1% slippage tolerance)
337
+ - Sandwich attack moves price 2.4% → transaction reverts
338
+ - User protected from excessive value extraction
339
+
340
+ long_term_improvements: |
341
+ 1. Add helper function for slippage calculation:
342
+ ```solidity
343
+ function calculateMinOutput(
344
+ uint256 expectedOutput,
345
+ uint256 slippageBps // basis points, e.g., 100 = 1%
346
+ ) public pure returns (uint256) {
347
+ return expectedOutput * (10000 - slippageBps) / 10000;
348
+ }
349
+ ```
350
+
351
+ 2. Implement deadline parameter (as shown in immediate fix)
352
+ - Prevents stale transactions from executing at unexpected prices
353
+ - Standard in Uniswap V2/V3
354
+
355
+ 3. Add price impact warnings in UI:
356
+ - Show estimated price impact before transaction
357
+ - Warn if impact exceeds 1% (spec threshold)
358
+ - Suggest splitting large trades
359
+
360
+ 4. Consider TWAP (Time-Weighted Average Price) validation:
361
+ - Compare spot price vs 30-min TWAP
362
+ - Reject if deviation exceeds threshold
363
+ - Prevents oracle manipulation attacks
364
+
365
+ 5. Add events for slippage monitoring:
366
+ ```solidity
367
+ event SlippageApplied(
368
+ address indexed user,
369
+ uint256 expectedOutput,
370
+ uint256 actualOutput,
371
+ uint256 slippageBps
372
+ );
373
+ ```
374
+
375
+ testing_requirements: |
376
+ 1. Unit test: Swap with 0.5% slippage succeeds
377
+ 2. Unit test: Swap with 1.5% slippage reverts
378
+ 3. Integration test: Simulate sandwich attack, verify protection
379
+ 4. Fuzz test: Random minAmountOut values, verify correct revert behavior
380
+ 5. Mainnet fork test: Replay historical sandwich attacks, verify prevention
381
+
382
+ breaking_changes: |
383
+ YES - This is a breaking change to the swap() function signature.
384
+
385
+ Migration path:
386
+ 1. Deploy RouterV2 with new signature
387
+ 2. Update frontend to calculate and pass minAmountOut
388
+ 3. Deprecate RouterV1 after 30-day migration period
389
+ 4. Add wrapper function in RouterV1 for backward compatibility:
390
+ ```solidity
391
+ function swapLegacy(address tokenIn, address tokenOut, uint256 amountIn) external {
392
+ uint256 expectedOutput = getExpectedOutput(tokenIn, tokenOut, amountIn);
393
+ uint256 minOutput = expectedOutput * 99 / 100; // 1% default slippage
394
+ swap(tokenIn, tokenOut, amountIn, minOutput, block.timestamp + 300);
395
+ }
396
+ ```
397
+
398
+ specification_update: |
399
+ If slippage protection is intentionally omitted (NOT recommended):
400
+
401
+ Update whitepaper §4.1 to:
402
+ "Swaps execute at current market price without slippage protection.
403
+ Users are responsible for sandwich attack mitigation via:
404
+ - Private transaction channels (Flashbots, MEV-Blocker)
405
+ - Off-chain price monitoring and transaction cancellation
406
+ - External slippage calculation and manual validation
407
+
408
+ WARNING: On-chain swaps are vulnerable to MEV extraction."
409
+ ```
410
+
411
+ **What this shows:**
412
+ - Complete divergence finding with CRITICAL severity
413
+ - Evidence-based: Shows exhaustive search for slippage protection (0 results)
414
+ - Detailed exploit scenario with concrete numbers ($200k trade → $4,878 loss)
415
+ - Economic impact quantification (ROI, daily volume, extraction potential)
416
+ - Comprehensive remediation with code examples, testing requirements, migration path
417
+ - Distinguishes between fixing code vs updating spec (if intentional)
@@ -0,0 +1,105 @@
1
+ # Output Requirements & Quality Thresholds
2
+
3
+ When performing spec-to-code compliance analysis, Claude MUST produce structured IR following the formats demonstrated in [IR_EXAMPLES.md](IR_EXAMPLES.md).
4
+
5
+ ---
6
+
7
+ ## Required IR Production
8
+
9
+ For EACH phase, output MUST include:
10
+
11
+ ### Phase 2 - Spec-IR (mandatory)
12
+ - MUST extract ALL intended behavior into Spec-IR records
13
+ - Each record MUST include: `id`, `spec_excerpt`, `source_section`, `source_document`, `semantic_type`, `normalized_form`, `confidence`
14
+ - MUST use YAML format matching Example 1
15
+ - MUST extract minimum 10 Spec-IR items for any non-trivial specification (5+ pages of documentation)
16
+ - MUST include confidence scores (0-1) for all extractions
17
+ - MUST document both explicit and implicit invariants
18
+
19
+ ### Phase 3 - Code-IR (mandatory)
20
+ - MUST analyze EVERY function with structured extraction
21
+ - Each record MUST include: `id`, `file`, `function`, `lines`, `visibility`, `modifiers`, `behavior` (preconditions, state_reads, state_writes, computations, external_calls, events, postconditions), `invariants_enforced`
22
+ - MUST use YAML format matching Example 2
23
+ - MUST document line numbers for ALL claims (every precondition, state read/write, computation, external call)
24
+ - MUST capture full control flow (all conditional branches, revert paths)
25
+ - MUST identify all external interactions with risk analysis
26
+
27
+ ### Phase 4 - Alignment-IR (mandatory)
28
+ - MUST compare EVERY Spec-IR item against Code-IR
29
+ - Each record MUST include: `id`, `spec_ref`, `code_ref`, `spec_claim`, `code_behavior`, `match_type`, `confidence`, `reasoning`, `evidence`
30
+ - MUST classify using exactly one of: `full_match`, `partial_match`, `mismatch`, `missing_in_code`, `code_stronger_than_spec`, `code_weaker_than_spec`
31
+ - MUST use YAML format matching Example 3
32
+ - MUST provide reasoning trace explaining WHY classification was chosen
33
+ - MUST include evidence with exact quotes and locations from both spec and code
34
+ - Every Spec-IR item MUST have corresponding Alignment record (no gaps)
35
+
36
+ ### Phase 5 - Divergence Findings (when applicable)
37
+ - MUST create detailed finding for EVERY `mismatch`, `missing_in_code`, or `code_weaker_than_spec`
38
+ - Each finding MUST include: `id`, `severity`, `title`, `spec_claim`, `code_finding`, `match_type`, `confidence`, `reasoning`, `evidence`, `exploitability`, `remediation`
39
+ - MUST use YAML format matching Example 4
40
+ - MUST quantify impact with concrete numbers (not "could be exploited" but "attacker gains $X, victim loses $Y")
41
+ - MUST provide exploitability analysis with attack scenarios (prerequisites, sequence, impact)
42
+ - MUST include remediation with code examples and testing requirements
43
+
44
+ ### Phase 6 - Final Report (mandatory)
45
+ - MUST produce structured report following 16-section format defined in Phase 6
46
+ - MUST include all IR artifacts (Spec-IR, Code-IR, Alignment-IR, Divergence Findings)
47
+ - MUST provide Full Alignment Matrix showing all spec→code mappings
48
+ - MUST quantify risk and prioritize remediations
49
+
50
+ ---
51
+
52
+ ## Quality Thresholds
53
+
54
+ A complete spec-to-code compliance analysis MUST achieve:
55
+
56
+ ### Spec-IR minimum standards:
57
+ - Minimum 10 Spec-IR items for non-trivial specifications
58
+ - At least 3 invariants extracted (explicit or implicit)
59
+ - At least 2 security requirements identified (MUST/NEVER/ALWAYS keywords)
60
+ - At least 1 math formula or economic assumption documented
61
+ - Confidence scores for all extractions (no missing scores)
62
+
63
+ ### Code-IR minimum standards:
64
+ - EVERY public/external function analyzed (no gaps in coverage)
65
+ - Minimum 3 invariants documented per analyzed function
66
+ - ALL external calls identified with return handling documented
67
+ - ALL state modifications tracked (reads and writes)
68
+ - Line number citations for ALL claims (100% traceability)
69
+
70
+ ### Alignment-IR minimum standards:
71
+ - EVERY Spec-IR item has corresponding Alignment record (complete matrix)
72
+ - Reasoning provided for all match_type classifications
73
+ - Evidence includes exact quotes from both spec and code
74
+ - Ambiguities explicitly flagged (never guessed or inferred)
75
+ - Confidence scores reflect actual certainty (not placeholder 1.0 for everything)
76
+
77
+ ### Divergence Finding minimum standards:
78
+ - EVERY CRITICAL/HIGH finding has exploit scenario with concrete attack sequence
79
+ - Economic impact quantified with dollar amounts or percentages
80
+ - Remediation includes code examples (not just "add validation")
81
+ - Testing requirements specified (unit tests, integration tests, fuzz tests)
82
+ - Breaking changes documented with migration path
83
+
84
+ ---
85
+
86
+ ## Format Consistency
87
+
88
+ - MUST use YAML for all IR records (Spec-IR, Code-IR, Alignment-IR, Divergence)
89
+ - MUST use consistent field names across all records (e.g., `spec_excerpt` not `specification_text`)
90
+ - MUST reference line numbers in format: `L45`, `lines: 89-135`, `line 108`
91
+ - MUST cite spec locations: `"Section §4.1"`, `"Page 7, paragraph 3"`, `"Whitepaper section 2.3"`
92
+ - MUST use markdown code blocks with language tags: ` ```yaml `, ` ```solidity `
93
+ - MUST separate major sections with `---` horizontal rules
94
+
95
+ ---
96
+
97
+ ## Anti-Hallucination Requirements
98
+
99
+ - NEVER infer behavior not present in spec or code
100
+ - ALWAYS quote exact text (spec_quote, code_quote in evidence)
101
+ - ALWAYS provide line numbers for code claims
102
+ - ALWAYS provide section/page for spec claims
103
+ - If uncertain: Set confidence < 0.8 and document ambiguity
104
+ - If spec is silent: Classify as `UNDOCUMENTED`, never guess
105
+ - If code adds behavior: Classify as `code_stronger_than_spec`, document in Alignment-IR
@@ -0,0 +1,67 @@
1
+ ---
2
+ name: supply-chain-risk-auditor
3
+ description: "Identifies dependencies at heightened risk of exploitation or takeover. Use when assessing supply chain attack surface, evaluating dependency health, or scoping security engagements."
4
+ allowed-tools:
5
+ - Read
6
+ - Write
7
+ - Bash
8
+ - Glob
9
+ - Grep
10
+ ---
11
+
12
+ # Supply Chain Risk Auditor
13
+
14
+ Activates when the user says "audit this project's dependencies".
15
+
16
+ ## When to Use
17
+
18
+ - Assessing dependency risk before a security audit
19
+ - Evaluating supply chain attack surface of a project
20
+ - Identifying unmaintained or risky dependencies
21
+ - Pre-engagement scoping for supply chain concerns
22
+
23
+ ## When NOT to Use
24
+
25
+ - Active vulnerability scanning (use dedicated tools like npm audit, pip-audit)
26
+ - Runtime dependency analysis
27
+ - License compliance auditing
28
+
29
+ ## Purpose
30
+
31
+ You systematically evaluate all dependencies of a project to identify red flags that indicate a high risk of exploitation or takeover. You generate a summary report noting these issues.
32
+
33
+ ### Risk Criteria
34
+
35
+ A dependency is considered high-risk if it features any of the following risk factors:
36
+
37
+ * **Single maintainer or team of individuals** - The project is primarily or solely maintained by a single individual, or a small number of individuals. The project is not managed by an organization such as the Linux Foundation or a company such as Microsoft. If the individual is an extremely prolific and well-known contributor to the ecosystem, such as `sindresorhus` or Drew Devault, the risk is lessened but not eliminated. Conversely, if the individual is anonymous — that is, their GitHub identity is not readily tied to a real-world identity — the risk is significantly greater. **Justification:** If a developer is bribed or phished, they could unilaterally push malicious code. Consider the left-pad incident.
38
+ * **Unmaintained** - The project is stale (no updates for a long period of time) or explicitly deprecated/archived. The maintainer may have put a note in the README.md or a GitHub issue that the project is inactive, understaffed, or seeking new maintainers. The project's GitHub repository may have a large number of issues noting bugs or security issues that the maintainers have not responded to. Feature request issues do NOT count. **Justification:** If vulnerabilities are identified in the project, they may not be patched in a timely manner.
39
+ * **Low popularity:** The project has a relatively low number of GitHub stars and/or downloads compared to other dependencies used by the target. **Justification:** Fewer users means fewer eyes on the project. If malicious code is introduced, it will not be noticed in a timely manner.
40
+ * **High-risk features:** The project implements features that by their nature are especially prone to exploitation, including FFI, deserialization, or third-party code execution. **Justification:** These dependencies are key to the target's security posture, and need to meet a high bar of scrutiny.
41
+ * **Presence of past CVEs:** The project has high or critical severity CVEs, especially a large number relative to its popularity and complexity. **Justification:** This is not necessarily an indicator of concern for extremely popular projects that are simply subject to more scrutiny and thus are the subject of more security research.
42
+ * **Absence of a security contact:** The project has no security contact listed in `.github/SECURITY.md`, `CONTRIBUTING.md`, `README.md`, etc., or separately on the project's website (if one exists). **Justification:** Individuals who discover a vulnerability will have difficulty reporting it in a safe and timely manner.
43
+
44
+ ## Prerequisites
45
+
46
+ Ensure that the `gh` tool is available before continuing. Ask the user to install if it is not found.
47
+
48
+ ## Workflow (Initial Setup)
49
+
50
+ You achieve your purpose by:
51
+
52
+ 1. Creating a `.supply-chain-risk-auditor` directory for your workspace
53
+ * Start a `results.md` report file based on `results-template.md` in this directory
54
+ 2. Finding all git repositories for direct dependencies.
55
+ 3. Normalizing the git repository entries to URLs, i.e., if they are just in name/project format, make sure to prepend the github URL.
56
+
57
+ ## Workflow (Dependency Audit)
58
+ 1. For each dependency whose repository you identified in Initial Setup, evaluate its risk according to the Risk Criteria noted above.
59
+ * For any criteria that require actions such as counting open GitHub issues, use the `gh` tool to query the exact data. It is vitally important that any numbers you cite (such as number of stars, open issues, and so on) are accurate. You may round numbers of issues and stars using ~ notation, e.g. "~4000 stars".
60
+ 2. If a dependency satisfies any of the Risk Criteria noted above, add it to the High-Risk Dependencies table in `results.md`, clearly noting your reason for flagging it as high-risk. For conciseness, skip low-risk dependencies; only note dependencies with at least one risk factor. Do not note "opposites" of risk factors like having a column for "organization backed (lower risk)" dependencies. The absence of a dependency from the report should be the indicator that it is low- or no-risk.
61
+
62
+ ## Workflow (Post-Audit)
63
+ 1. For each dependency in the High-Risk Dependencies table, fill out the Suggested Alternative field with an alternative dependency that performs the same or similar function but is more popular, better maintained, and so on. Prefer direct successors and drop-in replacements if available. Provide a short justification of your suggestion.
64
+ 2. Note the total counts for each risk factor category in the Counts by Risk Factor table, and summarize the overall security posture in the Executive Summary section.
65
+ 3. Summarize your recommendations under the Recommendations section
66
+
67
+ **NOTE:** Do not add sections beyond those noted in `results-template.md`.
@@ -0,0 +1,41 @@
1
+ # Supply Chain Risk Report
2
+
3
+ ---
4
+
5
+ ## Metadata
6
+
7
+ - **Scan Date**: [YYYY-MM-DD HH:MM:SS]
8
+ - **Project**: [Project Name]
9
+ - **Repositories Scanned**: [X repositories]
10
+ - **Total Dependencies**: [Y dependencies]
11
+ - **Scan Duration**: [Duration]
12
+
13
+ ---
14
+
15
+ ## Executive Summary
16
+
17
+ ### Counts by Risk Factor
18
+
19
+ | Risk Factor | Dependencies | Total |
20
+ |-------------|--------------|-------|
21
+ | X | X, Y, Z... | # |
22
+ | X | X, Y, Z... | # |
23
+ | X | X, Y, Z... | # |
24
+ | **Total** | — | **#** |
25
+
26
+ ### High-Risk Dependencies
27
+
28
+ The following dependencies have two or more risk factors.
29
+
30
+ | Dependency Name | Risk Factors | Notes | Suggested Alternative |
31
+ |-----------------|--------------|-------|-----------------------|
32
+ | X | X, Y, Z | a short summary of the risk factors | **X** - short justification |
33
+ | X | X, Y, Z | a short summary of the risk factors | **X** - short justification |
34
+ | X | X, Y, Z | a short summary of the risk factors | **X** - short justification |
35
+
36
+ ## Suggested Alternatives
37
+
38
+ ## Report Generated By
39
+
40
+ Supply Chain Risk Auditor Skill
41
+ Generated: [YYYY-MM-DD HH:MM:SS]