solidity-argus 0.1.8 → 0.3.0

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 (178) hide show
  1. package/AGENTS.md +3 -3
  2. package/README.md +229 -13
  3. package/package.json +37 -8
  4. package/skills/INVENTORY.md +88 -57
  5. package/skills/README.md +72 -6
  6. package/skills/case-studies/beanstalk-governance/SKILL.md +52 -0
  7. package/skills/case-studies/bzx-flash-loan/SKILL.md +53 -0
  8. package/skills/case-studies/cream-finance/SKILL.md +52 -0
  9. package/skills/case-studies/curve-reentrancy/SKILL.md +52 -0
  10. package/skills/case-studies/dao-hack/SKILL.md +51 -0
  11. package/skills/case-studies/euler-finance/SKILL.md +52 -0
  12. package/skills/case-studies/harvest-finance/SKILL.md +52 -0
  13. package/skills/case-studies/level-finance/SKILL.md +51 -0
  14. package/skills/case-studies/mango-markets/SKILL.md +53 -0
  15. package/skills/case-studies/nomad-bridge/SKILL.md +51 -0
  16. package/skills/case-studies/parity-multisig/SKILL.md +55 -0
  17. package/skills/case-studies/poly-network/SKILL.md +51 -0
  18. package/skills/case-studies/rari-fuse/SKILL.md +51 -0
  19. package/skills/case-studies/ronin-bridge/SKILL.md +52 -0
  20. package/skills/case-studies/wormhole-bridge/SKILL.md +51 -0
  21. package/skills/checklists/cyfrin-defi-core/SKILL.md +3 -0
  22. package/skills/manifests/cyfrin.json +16 -0
  23. package/skills/manifests/defifofum.json +25 -0
  24. package/skills/manifests/kadenzipfel.json +48 -0
  25. package/skills/manifests/scvd.json +9 -0
  26. package/skills/manifests/smartbugs.json +9 -0
  27. package/skills/manifests/solodit.json +9 -0
  28. package/skills/manifests/sunweb3sec.json +9 -0
  29. package/skills/manifests/trailofbits.json +9 -0
  30. package/skills/methodology/audit-workflow/SKILL.md +3 -0
  31. package/skills/protocol-patterns/amm-dex/SKILL.md +3 -0
  32. package/skills/references/exploit-reference/SKILL.md +3 -0
  33. package/skills/vulnerability-patterns/access-control/SKILL.md +27 -0
  34. package/skills/vulnerability-patterns/arbitrary-storage-location/SKILL.md +13 -1
  35. package/skills/vulnerability-patterns/assert-violation/SKILL.md +8 -1
  36. package/skills/vulnerability-patterns/asserting-contract-from-code-size/SKILL.md +12 -1
  37. package/skills/vulnerability-patterns/authorization-txorigin/SKILL.md +8 -1
  38. package/skills/vulnerability-patterns/cross-chain-bridge-vulnerabilities/SKILL.md +217 -0
  39. package/skills/vulnerability-patterns/default-visibility/SKILL.md +13 -1
  40. package/skills/vulnerability-patterns/delegatecall-untrusted-callee/SKILL.md +8 -1
  41. package/skills/vulnerability-patterns/dos-gas-limit/SKILL.md +8 -1
  42. package/skills/vulnerability-patterns/dos-revert/SKILL.md +14 -1
  43. package/skills/vulnerability-patterns/erc4626-exchange-rate-manipulation/SKILL.md +64 -0
  44. package/skills/vulnerability-patterns/fee-on-transfer-tokens/SKILL.md +93 -0
  45. package/skills/vulnerability-patterns/flash-loan-attacks/SKILL.md +13 -0
  46. package/skills/vulnerability-patterns/floating-pragma/SKILL.md +8 -1
  47. package/skills/vulnerability-patterns/front-running-attacks/SKILL.md +209 -0
  48. package/skills/vulnerability-patterns/gas-optimization-patterns/SKILL.md +203 -0
  49. package/skills/vulnerability-patterns/governance-attacks/SKILL.md +208 -0
  50. package/skills/vulnerability-patterns/hash-collision/SKILL.md +8 -1
  51. package/skills/vulnerability-patterns/inadherence-to-standards/SKILL.md +12 -1
  52. package/skills/vulnerability-patterns/incorrect-constructor/SKILL.md +8 -1
  53. package/skills/vulnerability-patterns/incorrect-inheritance-order/SKILL.md +8 -1
  54. package/skills/vulnerability-patterns/insufficient-gas-griefing/SKILL.md +12 -1
  55. package/skills/vulnerability-patterns/lack-of-precision/SKILL.md +7 -1
  56. package/skills/vulnerability-patterns/logic-errors/SKILL.md +10 -0
  57. package/skills/vulnerability-patterns/missing-parameter-bounds/SKILL.md +44 -0
  58. package/skills/vulnerability-patterns/missing-protection-signature-replay/SKILL.md +17 -1
  59. package/skills/vulnerability-patterns/msgvalue-loop/SKILL.md +12 -1
  60. package/skills/vulnerability-patterns/off-by-one/SKILL.md +7 -1
  61. package/skills/vulnerability-patterns/oracle-manipulation/SKILL.md +22 -0
  62. package/skills/vulnerability-patterns/outdated-compiler-version/SKILL.md +8 -1
  63. package/skills/vulnerability-patterns/overflow-underflow/SKILL.md +11 -1
  64. package/skills/vulnerability-patterns/proxy-vulnerabilities/SKILL.md +209 -0
  65. package/skills/vulnerability-patterns/reentrancy/SKILL.md +22 -0
  66. package/skills/vulnerability-patterns/shadowing-state-variables/SKILL.md +8 -1
  67. package/skills/vulnerability-patterns/share-accounting-desynchronization/SKILL.md +44 -0
  68. package/skills/vulnerability-patterns/signature-malleability/SKILL.md +11 -1
  69. package/skills/vulnerability-patterns/stateful-parameter-update-drift/SKILL.md +44 -0
  70. package/skills/vulnerability-patterns/unbounded-return-data/SKILL.md +12 -1
  71. package/skills/vulnerability-patterns/unchecked-return-values/SKILL.md +13 -1
  72. package/skills/vulnerability-patterns/unencrypted-private-data-on-chain/SKILL.md +8 -1
  73. package/skills/vulnerability-patterns/unexpected-ecrecover-null-address/SKILL.md +8 -1
  74. package/skills/vulnerability-patterns/uninitialized-storage-pointer/SKILL.md +8 -1
  75. package/skills/vulnerability-patterns/unsafe-erc20-transfers/SKILL.md +132 -0
  76. package/skills/vulnerability-patterns/unsafe-low-level-call/SKILL.md +12 -1
  77. package/skills/vulnerability-patterns/unsecure-signatures/SKILL.md +12 -1
  78. package/skills/vulnerability-patterns/unsupported-opcodes/SKILL.md +11 -1
  79. package/skills/vulnerability-patterns/unused-variables/SKILL.md +8 -1
  80. package/skills/vulnerability-patterns/use-of-deprecated-functions/SKILL.md +8 -1
  81. package/skills/vulnerability-patterns/weak-sources-randomness/SKILL.md +8 -1
  82. package/skills/vulnerability-patterns/weird-tokens/SKILL.md +10 -0
  83. package/skills/vulnerability-patterns/zero-address-misconfiguration/SKILL.md +48 -0
  84. package/src/agents/argus-prompt.ts +27 -10
  85. package/src/agents/pythia-prompt.ts +7 -8
  86. package/src/agents/scribe-prompt.ts +10 -5
  87. package/src/agents/sentinel-prompt.ts +36 -7
  88. package/src/cli/cli-output.ts +16 -0
  89. package/src/cli/cli-program.ts +29 -22
  90. package/src/cli/commands/check-skills.ts +135 -0
  91. package/src/cli/commands/doctor.ts +303 -23
  92. package/src/cli/commands/init.ts +8 -6
  93. package/src/cli/commands/install.ts +10 -8
  94. package/src/cli/commands/lint-skills.ts +118 -0
  95. package/src/cli/index.ts +5 -5
  96. package/src/cli/tui-prompts.ts +4 -2
  97. package/src/cli/types.ts +3 -3
  98. package/src/config/index.ts +1 -1
  99. package/src/config/loader.ts +4 -6
  100. package/src/config/schema.ts +6 -5
  101. package/src/config/types.ts +2 -2
  102. package/src/constants/defaults.ts +2 -0
  103. package/src/create-hooks.ts +225 -29
  104. package/src/create-managers.ts +10 -8
  105. package/src/create-tools.ts +14 -8
  106. package/src/features/background-agent/background-manager.ts +93 -87
  107. package/src/features/background-agent/index.ts +1 -1
  108. package/src/features/context-monitor/context-monitor.ts +3 -3
  109. package/src/features/context-monitor/index.ts +2 -2
  110. package/src/features/error-recovery/session-recovery.ts +2 -4
  111. package/src/features/error-recovery/tool-error-recovery.ts +79 -19
  112. package/src/features/index.ts +5 -5
  113. package/src/features/persistent-state/audit-state-manager.ts +158 -52
  114. package/src/features/persistent-state/global-run-index.ts +38 -0
  115. package/src/features/persistent-state/index.ts +1 -1
  116. package/src/features/persistent-state/run-journal.ts +86 -0
  117. package/src/hooks/agent-tracker.ts +53 -0
  118. package/src/hooks/compaction-hook.ts +46 -37
  119. package/src/hooks/config-handler.ts +31 -11
  120. package/src/hooks/context-budget.ts +42 -0
  121. package/src/hooks/event-hook.ts +48 -23
  122. package/src/hooks/hook-system.ts +4 -4
  123. package/src/hooks/index.ts +5 -5
  124. package/src/hooks/knowledge-sync-hook.ts +19 -21
  125. package/src/hooks/recon-context-builder.ts +66 -0
  126. package/src/hooks/safe-create-hook.ts +9 -11
  127. package/src/hooks/system-prompt-hook.ts +128 -0
  128. package/src/hooks/tool-tracking-hook.ts +162 -29
  129. package/src/hooks/types.ts +2 -1
  130. package/src/index.ts +23 -13
  131. package/src/knowledge/retry.ts +53 -0
  132. package/src/knowledge/scvd-client.ts +103 -83
  133. package/src/knowledge/scvd-errors.ts +89 -0
  134. package/src/knowledge/scvd-index.ts +110 -62
  135. package/src/knowledge/scvd-sync.ts +223 -47
  136. package/src/knowledge/source-manifest.ts +102 -0
  137. package/src/managers/index.ts +1 -1
  138. package/src/managers/types.ts +19 -14
  139. package/src/plugin-interface.ts +19 -8
  140. package/src/shared/binary-utils.ts +44 -34
  141. package/src/shared/deep-merge.ts +55 -36
  142. package/src/shared/file-utils.ts +21 -19
  143. package/src/shared/index.ts +11 -5
  144. package/src/shared/jsonc-parser.ts +123 -28
  145. package/src/shared/logger.ts +91 -17
  146. package/src/shared/project-utils.ts +30 -0
  147. package/src/skills/analysis/cluster.ts +414 -0
  148. package/src/skills/analysis/gates.ts +227 -0
  149. package/src/skills/analysis/index.ts +33 -0
  150. package/src/skills/analysis/normalize.ts +217 -0
  151. package/src/skills/analysis/similarity.ts +224 -0
  152. package/src/skills/argus-skill-resolver.ts +237 -0
  153. package/src/skills/skill-schema.ts +99 -0
  154. package/src/solodit-lifecycle.ts +202 -0
  155. package/src/state/audit-state.ts +10 -8
  156. package/src/state/finding-store.ts +68 -55
  157. package/src/state/types.ts +96 -44
  158. package/src/tools/argus-skill-load-tool.ts +78 -0
  159. package/src/tools/contract-analyzer-tool.ts +60 -77
  160. package/src/tools/forge-coverage-tool.ts +226 -0
  161. package/src/tools/forge-fuzz-tool.ts +127 -127
  162. package/src/tools/forge-test-tool.ts +153 -157
  163. package/src/tools/gas-analysis-tool.ts +264 -0
  164. package/src/tools/pattern-checker-tool.ts +206 -167
  165. package/src/tools/pattern-loader.ts +77 -0
  166. package/src/tools/pattern-schema.ts +51 -0
  167. package/src/tools/proxy-detection-tool.ts +224 -0
  168. package/src/tools/report-generator-tool.ts +333 -142
  169. package/src/tools/slither-tool.ts +300 -210
  170. package/src/tools/solodit-search-tool.ts +255 -80
  171. package/src/tools/sync-knowledge-tool.ts +7 -11
  172. package/src/utils/audit-artifact-detector.ts +118 -0
  173. package/src/utils/dependency-scanner.ts +93 -0
  174. package/src/utils/project-detector.ts +175 -86
  175. package/src/utils/solidity-parser.ts +112 -67
  176. package/src/utils/solodit-health.ts +29 -0
  177. package/src/hooks/event-hook-v2.ts +0 -99
  178. package/src/state/plugin-state.ts +0 -14
package/AGENTS.md CHANGED
@@ -13,19 +13,19 @@ CLI: `argus doctor`, `argus init`, `argus install`.
13
13
  **Role**: Primary security audit orchestrator
14
14
  **Description**: Argus Panoptes, the All-Seeing Guardian. Coordinates full Solidity security audits by dispatching Sentinel (analysis), Pythia (research), and Scribe (reporting). Follows a rigorous 7-step methodology: Reconnaissance, Automated Scanning, Manual Review, Attack Surface Mapping, Vulnerability Research, Testing & Verification, and Reporting.
15
15
  **Model**: anthropic/claude-opus-4-6
16
- **Tools**: All 8 argus_* tools (argus_slither_analyze, argus_analyze_contract, argus_check_patterns, argus_solodit_search, argus_forge_test, argus_forge_fuzz, argus_generate_report, argus_sync_knowledge)
16
+ **Tools**: All 12 argus_* tools (argus_slither_analyze, argus_analyze_contract, argus_check_patterns, argus_proxy_detection, argus_solodit_search, argus_forge_test, argus_gas_analysis, argus_forge_fuzz, argus_forge_coverage, argus_skill_load, argus_generate_report, argus_sync_knowledge)
17
17
 
18
18
  ## sentinel
19
19
 
20
20
  **Role**: Static analysis and testing specialist
21
21
  **Description**: Finds vulnerabilities through Slither static analysis, Foundry testing, fuzzing, and pattern matching. The tactical executor — runs tools, writes PoC tests, and verifies findings. Dispatched by Argus during Automated Scanning and Testing & Verification phases.
22
22
  **Model**: anthropic/claude-sonnet-4-6
23
- **Tools**: argus_slither_analyze, argus_forge_test, argus_forge_fuzz, argus_analyze_contract, argus_check_patterns, skill
23
+ **Tools**: argus_slither_analyze, argus_forge_test, argus_gas_analysis, argus_forge_fuzz, argus_forge_coverage, argus_analyze_contract, argus_check_patterns, argus_proxy_detection, skill
24
24
 
25
25
  ## pythia
26
26
 
27
27
  **Role**: Vulnerability researcher
28
- **Description**: Consults Solodit, SCVD, and the knowledge base to find historical precedents and known attack vectors. Searches 7,769+ real-world audit findings and 55 curated vulnerability pattern files. Dispatched by Argus during Vulnerability Research phase.
28
+ **Description**: Consults Solodit, SCVD, and the knowledge base to find historical precedents and known attack vectors. Searches 7,769+ real-world audit findings and 44 curated vulnerability pattern files. Dispatched by Argus during Vulnerability Research phase.
29
29
  **Model**: anthropic/claude-sonnet-4-6
30
30
  **Tools**: argus_solodit_search, argus_check_patterns, skill
31
31
 
package/README.md CHANGED
@@ -15,12 +15,12 @@ Argus Panoptes — the mythological all-seeing giant — orchestrates a team of
15
15
  **What it does:**
16
16
  - Runs Slither static analysis and Foundry tests automatically
17
17
  - Searches 7,769+ real-world audit findings via SCVD and Solodit
18
- - Matches code against 55 curated vulnerability pattern files
18
+ - Matches code against 82 curated SKILL.md knowledge files
19
19
  - Generates professional markdown audit reports with severity classifications
20
20
  - Follows a rigorous 7-step audit methodology (Reconnaissance → Report)
21
21
 
22
22
  **Why it's useful:**
23
- - Catches reentrancy, oracle manipulation, access control flaws, flash loan vectors, and 35+ other vulnerability classes
23
+ - Catches reentrancy, oracle manipulation, access control flaws, flash loan vectors, and 50+ vulnerability classes across 14 pattern categories
24
24
  - Integrates seamlessly into OpenCode's agent system — no separate tooling setup required
25
25
  - Knowledge base sourced from Trail of Bits, Cyfrin, DeFiFoFum, and the broader security community
26
26
 
@@ -88,10 +88,13 @@ Transforms raw findings into professional, structured markdown audit reports wit
88
88
  |------|-------|-------------|
89
89
  | `argus_slither_analyze` | Sentinel | Runs Slither static analysis on Solidity contracts; detects reentrancy, uninitialized variables, unchecked returns, and more |
90
90
  | `argus_analyze_contract` | Sentinel | Generates a deep structural profile of a contract: functions, state variables, modifiers, inheritance tree |
91
- | `argus_check_patterns` | Sentinel, Pythia | Scans code against a library of complex vulnerability patterns (regex/AST-based) covering 35+ vulnerability classes |
91
+ | `argus_check_patterns` | Sentinel, Pythia | Scans code against a library of complex vulnerability patterns (regex/AST-based) covering 50+ vulnerability classes across 14 pattern categories |
92
+ | `argus_proxy_detection` | Sentinel | Detects proxy patterns in Solidity contracts (ERC1967, UUPS, transparent, beacon, diamond) with confidence scoring |
92
93
  | `argus_solodit_search` | Pythia | Searches Solodit's database of real-world audit reports for similar protocols and historical findings |
93
94
  | `argus_forge_test` | Sentinel | Runs existing or newly written Foundry/Forge tests; essential for PoC verification |
95
+ | `argus_gas_analysis` | Sentinel | Runs forge gas report analysis, parses per-function gas metrics, and identifies high-gas hotspots above configurable threshold |
94
96
  | `argus_forge_fuzz` | Sentinel | Fuzzes specific functions with random inputs to find edge cases and invariant violations |
97
+ | `argus_forge_coverage` | Sentinel | Runs forge coverage analysis and returns structured per-file coverage metrics (lines, statements, branches, functions) |
95
98
  | `argus_generate_report` | Scribe | Generates the final structured audit report in professional markdown format |
96
99
  | `argus_sync_knowledge` | Argus | Syncs the local vulnerability database from SCVD (api.scvd.dev) |
97
100
 
@@ -99,20 +102,169 @@ Transforms raw findings into professional, structured markdown audit reports wit
99
102
 
100
103
  ## Knowledge Base
101
104
 
102
- The plugin ships with **55 curated SKILL.md files** organized into 5 categories:
105
+ The plugin ships with **82 curated SKILL.md files** organized into 6 categories:
103
106
 
104
107
  | Category | Files | Description |
105
108
  |----------|-------|-------------|
106
- | Vulnerability Patterns | 38 | Reentrancy, oracle manipulation, flash loans, access control, overflow/underflow, and 33 more |
109
+ | Vulnerability Patterns | 51 | Reentrancy, oracle manipulation, flash loans, access control, ERC4626, governance, front-running, and 44 more |
107
110
  | Methodology | 3 | Audit workflow, report templates, severity classification |
108
111
  | Protocol Patterns | 5 | AMM/DEX, bridges, governance, lending, staking security guides |
109
112
  | Checklists | 6 | Cyfrin audit checklists (DeFi core, integrations, upgrades, gas, best practices) |
110
113
  | References | 2 | DeFi exploit reference index, SmartBugs vulnerable contract examples |
114
+ | Case Studies | 15 | Major DeFi exploit analyses (Euler, Nomad Bridge, Ronin, Cream Finance, etc.) |
111
115
 
112
- **Sources:** Trail of Bits, Cyfrin, DeFiFoFum, kadenzipfel, SunWeb3Sec, smartbugs
116
+ **Sources:** Trail of Bits, Cyfrin, DeFiFoFum, kadenzipfel, SunWeb3Sec, smartbugs, BailSec, Argus
117
+
118
+ ### Detection Rules
119
+
120
+ Vulnerability detection patterns are defined as `detection_rules` in SKILL.md frontmatter. Each skill with a `pattern_category` field is automatically discovered by the pattern checker — no separate configuration needed.
121
+
122
+ - **51 vulnerability pattern skills** with detection rules across **14 categories**
123
+ - Categories: `reentrancy`, `oracle-manipulation`, `flash-loan`, `access-control`, `erc4626`, `proxy`, `signature`, `dos`, `front-running`, `governance`, `token-standard`, `gas-optimization`, `logic-error`, `delegatecall`
124
+
125
+ #### Adding Custom Detection Rules
126
+
127
+ Add custom detection rules by creating SKILL.md files in your `customSkillsDir`:
128
+
129
+ ```yaml
130
+ ---
131
+ name: my-custom-pattern
132
+ description: Detects insecure transfer patterns
133
+ pattern_category: access-control
134
+ detection_rules:
135
+ - regex: 'transfer\(msg\.sender, .+\)'
136
+ severity: High
137
+ description: Potentially insecure transfer to caller
138
+ ---
139
+ ```
113
140
 
114
141
  **SCVD Integration:** The plugin connects to [api.scvd.dev](https://api.scvd.dev) for 7,769+ real-world audit findings. Sync with `argus_sync_knowledge` or configure `knowledge.autoSync: true`.
115
142
 
143
+ ### Audit PDF Extraction Pipeline
144
+
145
+ A generic pipeline for extracting security findings from public audit report PDFs and converting them into structured data for pattern creation.
146
+
147
+ **How it works:**
148
+ 1. Downloads PDFs from configured GitHub repositories
149
+ 2. Parses each PDF page-by-page using `pdf-parse`
150
+ 3. Extracts findings using regex-based heading/severity/description detection
151
+ 4. Deduplicates and categorizes findings into 11 categories
152
+ 5. Outputs structured JSON to `scripts/audit-pdf-output/`
153
+
154
+ **Running the pipeline:**
155
+
156
+ ```bash
157
+ bun scripts/audit-pdf-extract.ts
158
+ ```
159
+
160
+ > **Note:** The extraction pipeline scripts are available in the [source repository](https://github.com/Apegurus/solidity-argus) only. They are not included in the npm package. If you installed `solidity-argus` via npm/bun, you'll need to clone the repository to run the extraction pipeline.
161
+
162
+ **Output files:**
163
+ - `scripts/audit-pdf-output/findings.json` — All extracted findings
164
+ - `scripts/audit-pdf-output/metadata.json` — Extraction stats, errors, source info
165
+ - `scripts/audit-pdf-output/by-category/*.json` — Findings grouped by category (reentrancy, access-control, oracle, etc.)
166
+
167
+ **Adding new audit sources:**
168
+
169
+ The pipeline uses a generic `AuditSource[]` interface. To add a new audit firm's reports, edit `scripts/audit-pdf-extract.ts` and add an entry to `DEFAULT_SOURCES`:
170
+
171
+ ```typescript
172
+ {
173
+ name: "AuditFirmName",
174
+ repoRawBase: "https://raw.githubusercontent.com/org/repo/main",
175
+ repoUrl: "https://github.com/org/repo",
176
+ pdfFiles: [
177
+ "Audit Report - Protocol Name.pdf",
178
+ // ... more PDFs
179
+ ],
180
+ }
181
+ ```
182
+
183
+ **How agents leverage extracted findings:**
184
+
185
+ The extracted findings are used to create new SKILL.md vulnerability pattern files (e.g., `erc4626-exchange-rate-manipulation`, `missing-parameter-bounds`). These patterns are loaded on-demand by agents via `argus_skill_load` during audits. The extraction pipeline is a developer tool — agents don't run it directly.
186
+
187
+ ### Case Studies
188
+
189
+ 15 detailed case studies of major DeFi exploits are included in `skills/case-studies/`. Each provides deep narrative context: root cause analysis, attack flow, impact assessment, key transactions, and lessons learned.
190
+
191
+ **Sources:** Public exploit research from [rekt.news](https://rekt.news) and [SunWeb3Sec/DeFiHackLabs](https://github.com/SunWeb3Sec/DeFiHackLabs).
192
+
193
+ **How they complement SCVD:** SCVD provides breadth (7,769+ searchable findings by keyword). Case studies provide depth (detailed narratives of 15 major exploits). The `@pythia` agent uses both — SCVD for "has this pattern been seen before?" and case studies for "how did this type of exploit actually unfold?"
194
+
195
+ **Adding new case studies:**
196
+
197
+ 1. Create a new directory under `skills/case-studies/<exploit-name>/`
198
+ 2. Add a `SKILL.md` file with frontmatter (`name`, `description`, `category: reference`, `source_url`, `source_license`, `detection_rules`)
199
+ 3. Include sections: Overview, Root Cause, Attack Flow, Impact, Key Transactions, Lessons
200
+ 4. Add the entry to `skills/INVENTORY.md`
201
+
202
+ ---
203
+
204
+ ## Knowledge Ingestion Contract
205
+
206
+ All ingested knowledge sources must conform to a standardized metadata contract to ensure traceability, freshness, and compliance:
207
+
208
+ ### Required Metadata Fields
209
+
210
+ Every knowledge source ingested into Argus must include:
211
+
212
+ - **`source`** — Human-readable source name (e.g., "Cyfrin", "Trail of Bits", "SCVD")
213
+ - **`url`** — Canonical URL to the source repository or API endpoint
214
+ - **`license`** — SPDX license identifier (e.g., "MIT", "Apache-2.0", "CC0")
215
+ - **`retrievedAt`** — ISO 8601 timestamp of when the knowledge was last fetched
216
+ - **`hash`** — SHA-256 hash of the ingested content for integrity verification
217
+ - **`version`** — Semantic version of the knowledge source (e.g., "1.2.3")
218
+ - **`provenance`** — Trust tier and source verification metadata
219
+
220
+ ### Trust Tiers
221
+
222
+ Argus classifies knowledge sources into three trust tiers:
223
+
224
+ - **`bundled`** — Built-in skills and patterns. Highest trust, always available.
225
+ - **`companion`** — Installed separately (e.g., Trail of Bits). Medium trust.
226
+ - **`custom`** — User-provided skills in `customSkillsDir`. Lower trust, validated on load.
227
+
228
+ ### Freshness Policy
229
+
230
+ Knowledge freshness is monitored automatically:
231
+
232
+ - **SCVD local index** — Stale if not synced within 7 days. `argus doctor` will warn if stale and suggest running `argus_sync_knowledge`.
233
+ - **Detection rules** — Versioned via `DETECTION_RULE_VERSION` and updated on package release.
234
+ - **Baked-in curated skills** — Updated only on package release; no automatic refresh.
235
+ - **On-demand live sources** — Retrieved per-request; never cached locally.
236
+
237
+ `argus doctor` reports the staleness of all indexed sources.
238
+
239
+ ### Three Operating Modes
240
+
241
+ Argus supports three distinct knowledge ingestion patterns:
242
+
243
+ #### 1. Baked-in Curated
244
+ **Sources:** Cyfrin audit checklists, kadenzipfel vulnerability patterns, DeFiFoFum protocol guides
245
+
246
+ - Bundled directly with the plugin package
247
+ - Updated only on package release (via npm/bun)
248
+ - No network calls required; instant availability
249
+ - Example: `skills/checklists/cyfrin-defi-core.md`
250
+
251
+ #### 2. On-Demand Live
252
+ **Sources:** Solodit audit reports, SCVD real-time queries
253
+
254
+ - Retrieved per-request from external APIs
255
+ - Never cached locally; always fresh
256
+ - Network-dependent; graceful fallback if unavailable
257
+ - Example: `argus_solodit_search` queries Solodit's database on each call
258
+
259
+ #### 3. Hybrid Indexed
260
+ **Sources:** SCVD local index, Trail of Bits companion skills
261
+
262
+ - Local index synced periodically via `argus_sync_knowledge`
263
+ - Cached locally in `~/.cache/solidity-argus/scvd-index.json`
264
+ - Refreshed on-demand when `knowledge.autoSync: true`
265
+ - Trail of Bits skills git-cloned on install and updated via companion plugin
266
+ - Example: SCVD findings indexed locally, queried without network latency
267
+
116
268
  ---
117
269
 
118
270
  ## Configuration
@@ -136,7 +288,8 @@ Create `.opencode/solidity-argus.jsonc` in your project root:
136
288
  "knowledge": {
137
289
  "scvd": { "enabled": true, "apiUrl": "https://api.scvd.dev" },
138
290
  "autoSync": true,
139
- "customSkillsDir": "./my-custom-skills"
291
+ "customSkillsDir": "./my-custom-skills",
292
+ "skillPrecedence": "bundled-first"
140
293
  },
141
294
 
142
295
  "reporting": {
@@ -160,7 +313,68 @@ Create `.opencode/solidity-argus.jsonc` in your project root:
160
313
 
161
314
  ---
162
315
 
163
- ## New in v2: Modular Architecture
316
+ ## Context Delivery Architecture
317
+
318
+ Argus uses a **three-channel context delivery system** to inject dynamic audit state, methodology, and knowledge into agents at runtime. Each channel serves a distinct purpose:
319
+
320
+ ### Decision Matrix: When to Use Each Channel
321
+
322
+ | Channel | Mechanism | Use Case | Scope | Mutability |
323
+ |---------|-----------|----------|-------|-----------|
324
+ | **Prompt** | Static agent identity files (`src/agents/*-prompt.ts`) | Methodology, personality, tool instructions, audit framework | Agent-specific | Never changes at runtime |
325
+ | **Hook** | `experimental.chat.system.transform` (agent-gated injection) | Audit progress, findings count, current phase, session state | Per-session | Changes every turn |
326
+ | **Skill-load** | `argus_skill_load` tool (on-demand) | Vulnerability patterns, protocol-specific knowledge, historical exploits | On-demand | Loaded when agent requests |
327
+
328
+ ### Prompt Channel (Static Identity)
329
+
330
+ Each of the 4 Argus agents has a static prompt file defining its role, methodology, and tool instructions:
331
+
332
+ - `src/agents/argus-prompt.ts` — Orchestrator methodology (7-step audit framework)
333
+ - `src/agents/sentinel-prompt.ts` — Static analysis & testing instructions
334
+ - `src/agents/pythia-prompt.ts` — Vulnerability research methodology
335
+ - `src/agents/scribe-prompt.ts` — Report generation format and structure
336
+
337
+ These prompts **never change at runtime** and establish the agent's core identity and decision-making framework.
338
+
339
+ ### Hook Channel (Dynamic State Injection)
340
+
341
+ The `experimental.chat.system.transform` hook injects dynamic audit state into the system context on every turn. This includes:
342
+
343
+ - Current audit phase (Reconnaissance, Automated Scanning, etc.)
344
+ - Findings discovered so far (count, severity distribution)
345
+ - Tools executed and their results
346
+ - Session-specific audit state (contract under review, scope, etc.)
347
+
348
+ **Critical Rule:** This hook is **Argus-family gated**. Only agents in `{argus, sentinel, pythia, scribe}` receive injected context. All other agents receive `undefined` (no injection).
349
+
350
+ **Session→Agent Mapping Pattern:**
351
+ 1. `chat.params` hook captures `(sessionID, agentName)` pairs during each turn
352
+ 2. `system.transform` hook looks up the agent by sessionID
353
+ 3. If agent is in the Argus family, inject audit state; otherwise, return `undefined`
354
+
355
+ This prevents context pollution and ensures non-audit agents operate independently.
356
+
357
+ ### Skill-Load Channel (On-Demand Knowledge)
358
+
359
+ Agents load specialized knowledge on-demand via the `argus_skill_load` tool:
360
+
361
+ - **Vulnerability Patterns** — 51 SKILL.md files covering reentrancy, oracle manipulation, flash loans, etc.
362
+ - **Protocol Patterns** — 5 files for AMM/DEX, bridges, governance, lending, staking
363
+ - **Methodology** — 3 files for audit workflow, report templates, severity classification
364
+ - **Checklists** — 6 Cyfrin audit checklists
365
+ - **References** — 2 files for exploit index and vulnerable contract examples
366
+
367
+ This channel is **lazy-loaded** — agents request skills only when needed, reducing context overhead.
368
+
369
+ ### Implementation Notes
370
+
371
+ - **Dynamic injection:** `system.transform` uses agent-gated dynamic audit state injection via `createSystemPromptHook` (see `src/create-hooks.ts`).
372
+ - **Global transforms forbidden:** No global system context injection unless agent-gated and minimal. Prevents context window overflow.
373
+ - **Audit state persistence:** State is saved to `.opencode/argus-state.json` and restored on session restart (see `Persistent Audit State` section).
374
+
375
+ ---
376
+
377
+ ## Modular Architecture
164
378
 
165
379
  This release restructures solidity-argus into a modular factory-based architecture with several new infrastructure features:
166
380
 
@@ -175,7 +389,10 @@ argus doctor
175
389
  # Generate a starter .opencode/solidity-argus.jsonc config
176
390
  argus init
177
391
 
178
- # Install optional dependencies (Slither, Foundry)
392
+ # Validate SKILL.md files against schema
393
+ argus lint-skills
394
+
395
+ # Register solidity-argus in opencode.json (tools installed separately; see Requirements)
179
396
  argus install
180
397
  ```
181
398
 
@@ -194,18 +411,17 @@ Selectively disable any hook via config:
194
411
  Config is resolved by merging three layers (last wins):
195
412
 
196
413
  1. **Defaults** — Built-in sensible defaults
197
- 2. **User-level** — `~/.config/solidity-argus/config.jsonc`
414
+ 2. **User-level** — `~/.config/opencode/solidity-argus.jsonc`
198
415
  3. **Project-level** — `.opencode/solidity-argus.jsonc`
199
416
 
200
417
  ### Background Agent Management
201
418
 
202
- Background tasks (knowledge sync, long-running analysis) are tracked with configurable concurrency limits and lifecycle callbacks:
419
+ Background tasks (knowledge sync, long-running analysis) are tracked with configurable concurrency limits:
203
420
 
204
421
  ```jsonc
205
422
  {
206
423
  "background": {
207
- "max_concurrent": 3,
208
- "cleanup_interval_ms": 60000
424
+ "max_concurrent": 3
209
425
  }
210
426
  }
211
427
  ```
package/package.json CHANGED
@@ -1,8 +1,19 @@
1
1
  {
2
2
  "name": "solidity-argus",
3
- "version": "0.1.8",
4
- "description": "Solidity smart contract security auditing plugin for OpenCode — 4 specialized agents, 8 tools, and a curated vulnerability knowledge base",
5
- "keywords": ["solidity", "security", "audit", "opencode", "plugin", "smart-contract", "ethereum", "defi", "slither", "foundry"],
3
+ "version": "0.3.0",
4
+ "description": "Solidity smart contract security auditing plugin for OpenCode — 4 specialized agents, 12 tools (11 core + optional Solodit), and a curated vulnerability knowledge base",
5
+ "keywords": [
6
+ "solidity",
7
+ "security",
8
+ "audit",
9
+ "opencode",
10
+ "plugin",
11
+ "smart-contract",
12
+ "ethereum",
13
+ "defi",
14
+ "slither",
15
+ "foundry"
16
+ ],
6
17
  "author": "Apegurus",
7
18
  "license": "MIT",
8
19
  "type": "module",
@@ -17,28 +28,46 @@
17
28
  "solidity-argus": "./src/cli/index.ts",
18
29
  "argus": "./src/cli/index.ts"
19
30
  },
20
- "files": ["src/", "!src/**/*.test.ts", "skills/", "README.md", "AGENTS.md", "LICENSE"],
31
+ "files": [
32
+ "src/",
33
+ "!src/**/*.test.ts",
34
+ "skills/",
35
+ "README.md",
36
+ "AGENTS.md",
37
+ "LICENSE"
38
+ ],
21
39
  "scripts": {
22
40
  "test": "bun test",
23
41
  "typecheck": "tsc --noEmit",
42
+ "lint": "biome lint .",
43
+ "format": "biome format --write .",
44
+ "format:check": "biome format .",
45
+ "check": "biome check .",
46
+ "check:fix": "biome check --write .",
47
+ "ci": "biome ci .",
24
48
  "cli": "bun src/cli/index.ts",
25
49
  "doctor": "bun src/cli/index.ts doctor",
26
50
  "init": "bun src/cli/index.ts init"
27
51
  },
28
52
  "dependencies": {
29
- "zod": "^4.3.6"
53
+ "@opencode-ai/plugin": "^1.2.10",
54
+ "yaml": "^2.8.2",
55
+ "zod": "^4.1.8"
30
56
  },
31
57
  "peerDependencies": {
32
- "@opencode-ai/plugin": "^1.2.6"
58
+ "@opencode-ai/sdk": "^1.0.0"
33
59
  },
34
60
  "devDependencies": {
35
- "@opencode-ai/plugin": "^1.2.6",
61
+ "@biomejs/biome": "^2.4.4",
36
62
  "@types/bun": "^1.2.0",
63
+ "pdf-parse": "^2.4.5",
37
64
  "typescript": "^5"
38
65
  },
39
66
  "repository": {
40
67
  "type": "git",
41
68
  "url": "https://github.com/Apegurus/solidity-argus"
42
69
  },
43
- "engines": { "bun": ">=1.0.0" }
70
+ "engines": {
71
+ "bun": ">=1.0.0"
72
+ }
44
73
  }
@@ -1,79 +1,110 @@
1
1
  # Argus Knowledge Base Inventory
2
2
 
3
- Generated: 2026-02-18
4
- Total SKILL.md files: 55
3
+ Generated: 2026-02-20
4
+ Total SKILL.md files: 82
5
5
 
6
6
  ## Vulnerability Patterns
7
7
  | File | Source(s) | Topic | Word Count |
8
8
  |------|-----------|-------|------------|
9
- | vulnerability-patterns/access-control/SKILL.md | DeFiFoFum, kadenzipfel | Access Control Exploits | 1018 |
10
- | vulnerability-patterns/arbitrary-storage-location/SKILL.md | kadenzipfel | Write to Arbitrary Storage Location | 309 |
11
- | vulnerability-patterns/assert-violation/SKILL.md | kadenzipfel | Assert Violation | 356 |
12
- | vulnerability-patterns/asserting-contract-from-code-size/SKILL.md | kadenzipfel | Asserting Contract from Code Size | 336 |
13
- | vulnerability-patterns/authorization-txorigin/SKILL.md | kadenzipfel | Authorization Through tx.origin | 266 |
14
- | vulnerability-patterns/default-visibility/SKILL.md | kadenzipfel | Default Visibility | 298 |
15
- | vulnerability-patterns/delegatecall-untrusted-callee/SKILL.md | kadenzipfel | Delegatecall to Untrusted Callee | 309 |
16
- | vulnerability-patterns/dos-gas-limit/SKILL.md | kadenzipfel | DoS with Block Gas Limit | 333 |
17
- | vulnerability-patterns/dos-revert/SKILL.md | kadenzipfel | DoS with (Unexpected) Revert | 408 |
18
- | vulnerability-patterns/flash-loan-attacks/SKILL.md | DeFiFoFum, kadenzipfel | Flash Loan Attack Exploits | 1000 |
19
- | vulnerability-patterns/floating-pragma/SKILL.md | kadenzipfel | Floating Pragma | 279 |
20
- | vulnerability-patterns/hash-collision/SKILL.md | kadenzipfel | Hash Collision with abi.encodePacked() | 318 |
21
- | vulnerability-patterns/inadherence-to-standards/SKILL.md | kadenzipfel | Inadherence to Standards | 361 |
22
- | vulnerability-patterns/incorrect-constructor/SKILL.md | kadenzipfel | Incorrect Constructor Name | 285 |
23
- | vulnerability-patterns/incorrect-inheritance-order/SKILL.md | kadenzipfel | Incorrect Inheritance Order | 289 |
24
- | vulnerability-patterns/insufficient-gas-griefing/SKILL.md | kadenzipfel | Insufficient Gas Griefing | 368 |
25
- | vulnerability-patterns/lack-of-precision/SKILL.md | kadenzipfel | Lack of Precision | 334 |
26
- | vulnerability-patterns/logic-errors/SKILL.md | DeFiFoFum, kadenzipfel | Logic Bug Exploits | 1192 |
27
- | vulnerability-patterns/missing-protection-signature-replay/SKILL.md | kadenzipfel | Missing Protection Against Signature Replay | 350 |
28
- | vulnerability-patterns/msgvalue-loop/SKILL.md | kadenzipfel | msg.value Reuse in Loops | 378 |
29
- | vulnerability-patterns/off-by-one/SKILL.md | kadenzipfel | Off-By-One Errors | 336 |
30
- | vulnerability-patterns/oracle-manipulation/SKILL.md | DeFiFoFum, kadenzipfel | Oracle Manipulation Exploits | 985 |
31
- | vulnerability-patterns/outdated-compiler-version/SKILL.md | kadenzipfel | Outdated Compiler Version | 327 |
32
- | vulnerability-patterns/overflow-underflow/SKILL.md | kadenzipfel | Integer Overflow and Underflow | 332 |
33
- | vulnerability-patterns/reentrancy/SKILL.md | DeFiFoFum, kadenzipfel | Reentrancy Exploits | 1034 |
34
- | vulnerability-patterns/shadowing-state-variables/SKILL.md | kadenzipfel | Shadowing State Variables | 363 |
35
- | vulnerability-patterns/signature-malleability/SKILL.md | kadenzipfel | Signature Malleability | 320 |
36
- | vulnerability-patterns/unbounded-return-data/SKILL.md | kadenzipfel | Unbounded Return Data | 359 |
37
- | vulnerability-patterns/unchecked-return-values/SKILL.md | kadenzipfel | Unchecked Return Values | 281 |
38
- | vulnerability-patterns/unencrypted-private-data-on-chain/SKILL.md | kadenzipfel | Unencrypted Private Data On-Chain | 330 |
39
- | vulnerability-patterns/unexpected-ecrecover-null-address/SKILL.md | kadenzipfel | Unexpected ecrecover Null Address | 324 |
40
- | vulnerability-patterns/uninitialized-storage-pointer/SKILL.md | kadenzipfel | Uninitialized Storage Pointer | 315 |
41
- | vulnerability-patterns/unsafe-low-level-call/SKILL.md | kadenzipfel | Unsafe Low-Level Call | 328 |
42
- | vulnerability-patterns/unsecure-signatures/SKILL.md | kadenzipfel | Unsecure Signatures | 441 |
43
- | vulnerability-patterns/unsupported-opcodes/SKILL.md | kadenzipfel | Unsupported Opcodes on EVM-Compatible Chains | 391 |
44
- | vulnerability-patterns/unused-variables/SKILL.md | kadenzipfel | Presence of Unused Variables | 333 |
45
- | vulnerability-patterns/use-of-deprecated-functions/SKILL.md | kadenzipfel | Use of Deprecated Functions | 323 |
46
- | vulnerability-patterns/weak-sources-randomness/SKILL.md | kadenzipfel | Weak Sources of Randomness from Chain Attributes | 377 |
47
- | vulnerability-patterns/weird-tokens/SKILL.md | DeFiFoFum | Weird ERC20 Tokens Reference | 852 |
9
+ | vulnerability-patterns/access-control/SKILL.md | DeFiFoFum, kadenzipfel | Access Control Exploits | 1164 |
10
+ | vulnerability-patterns/arbitrary-storage-location/SKILL.md | kadenzipfel | Write to Arbitrary Storage Location | 334 |
11
+ | vulnerability-patterns/assert-violation/SKILL.md | kadenzipfel | Assert Violation | 369 |
12
+ | vulnerability-patterns/asserting-contract-from-code-size/SKILL.md | kadenzipfel | Asserting Contract from Code Size | 367 |
13
+ | vulnerability-patterns/authorization-txorigin/SKILL.md | kadenzipfel | Authorization Through tx.origin | 295 |
14
+ | vulnerability-patterns/cross-chain-bridge-vulnerabilities/SKILL.md | Argus | Cross-Chain Bridge Vulnerabilities | 1195 |
15
+ | vulnerability-patterns/default-visibility/SKILL.md | kadenzipfel | Default Visibility | 331 |
16
+ | vulnerability-patterns/delegatecall-untrusted-callee/SKILL.md | kadenzipfel | Delegatecall to Untrusted Callee | 356 |
17
+ | vulnerability-patterns/dos-gas-limit/SKILL.md | kadenzipfel | DoS with Block Gas Limit | 355 |
18
+ | vulnerability-patterns/dos-revert/SKILL.md | kadenzipfel | DoS with (Unexpected) Revert | 481 |
19
+ | vulnerability-patterns/erc4626-exchange-rate-manipulation/SKILL.md | BailSec | ERC4626 Exchange Rate Manipulation | 381 |
20
+ | vulnerability-patterns/fee-on-transfer-tokens/SKILL.md | BailSec | Fee-on-Transfer Token Incompatibility | 540 |
21
+ | vulnerability-patterns/flash-loan-attacks/SKILL.md | DeFiFoFum, kadenzipfel | Flash Loan Attack Exploits | 1116 |
22
+ | vulnerability-patterns/floating-pragma/SKILL.md | kadenzipfel | Floating Pragma | 301 |
23
+ | vulnerability-patterns/front-running-attacks/SKILL.md | Argus | Front-Running and MEV Vulnerabilities | 1147 |
24
+ | vulnerability-patterns/gas-optimization-patterns/SKILL.md | Argus | Gas Optimization Vulnerability Patterns | 1219 |
25
+ | vulnerability-patterns/governance-attacks/SKILL.md | Argus | Governance Attack Vulnerabilities | 1321 |
26
+ | vulnerability-patterns/hash-collision/SKILL.md | kadenzipfel | Hash Collision with abi.encodePacked() | 326 |
27
+ | vulnerability-patterns/inadherence-to-standards/SKILL.md | kadenzipfel | Inadherence to Standards | 369 |
28
+ | vulnerability-patterns/incorrect-constructor/SKILL.md | kadenzipfel | Incorrect Constructor Name | 320 |
29
+ | vulnerability-patterns/incorrect-inheritance-order/SKILL.md | kadenzipfel | Incorrect Inheritance Order | 325 |
30
+ | vulnerability-patterns/insufficient-gas-griefing/SKILL.md | kadenzipfel | Insufficient Gas Griefing | 392 |
31
+ | vulnerability-patterns/lack-of-precision/SKILL.md | kadenzipfel | Lack of Precision | 395 |
32
+ | vulnerability-patterns/logic-errors/SKILL.md | DeFiFoFum, kadenzipfel | Logic Bug Exploits | 1336 |
33
+ | vulnerability-patterns/missing-parameter-bounds/SKILL.md | BailSec | Missing Parameter Bounds | 407 |
34
+ | vulnerability-patterns/missing-protection-signature-replay/SKILL.md | kadenzipfel | Missing Protection Against Signature Replay | 362 |
35
+ | vulnerability-patterns/msgvalue-loop/SKILL.md | kadenzipfel | msg.value Reuse in Loops | 413 |
36
+ | vulnerability-patterns/off-by-one/SKILL.md | kadenzipfel | Off-By-One Errors | 398 |
37
+ | vulnerability-patterns/oracle-manipulation/SKILL.md | DeFiFoFum, kadenzipfel | Oracle Manipulation Exploits | 1126 |
38
+ | vulnerability-patterns/outdated-compiler-version/SKILL.md | kadenzipfel | Outdated Compiler Version | 342 |
39
+ | vulnerability-patterns/overflow-underflow/SKILL.md | kadenzipfel | Integer Overflow and Underflow | 385 |
40
+ | vulnerability-patterns/proxy-vulnerabilities/SKILL.md | Argus | Proxy Pattern Vulnerabilities | 1063 |
41
+ | vulnerability-patterns/reentrancy/SKILL.md | DeFiFoFum, kadenzipfel | Reentrancy Exploits | 1160 |
42
+ | vulnerability-patterns/shadowing-state-variables/SKILL.md | kadenzipfel | Shadowing State Variables | 404 |
43
+ | vulnerability-patterns/share-accounting-desynchronization/SKILL.md | BailSec | Share Accounting Desynchronization | 390 |
44
+ | vulnerability-patterns/signature-malleability/SKILL.md | kadenzipfel | Signature Malleability | 370 |
45
+ | vulnerability-patterns/stateful-parameter-update-drift/SKILL.md | BailSec | Stateful Parameter Update Drift | 388 |
46
+ | vulnerability-patterns/unbounded-return-data/SKILL.md | kadenzipfel | Unbounded Return Data | 389 |
47
+ | vulnerability-patterns/unchecked-return-values/SKILL.md | kadenzipfel | Unchecked Return Values | 331 |
48
+ | vulnerability-patterns/unencrypted-private-data-on-chain/SKILL.md | kadenzipfel | Unencrypted Private Data On-Chain | 360 |
49
+ | vulnerability-patterns/unexpected-ecrecover-null-address/SKILL.md | kadenzipfel | Unexpected ecrecover Null Address | 339 |
50
+ | vulnerability-patterns/uninitialized-storage-pointer/SKILL.md | kadenzipfel | Uninitialized Storage Pointer | 337 |
51
+ | vulnerability-patterns/unsafe-erc20-transfers/SKILL.md | BailSec | Unsafe ERC20 Transfer and Approve Calls | 620 |
52
+ | vulnerability-patterns/unsafe-low-level-call/SKILL.md | kadenzipfel | Unsafe Low-Level Call | 347 |
53
+ | vulnerability-patterns/unsecure-signatures/SKILL.md | kadenzipfel | Unsecure Signatures | 459 |
54
+ | vulnerability-patterns/unsupported-opcodes/SKILL.md | kadenzipfel | Unsupported Opcodes on EVM-Compatible Chains | 432 |
55
+ | vulnerability-patterns/unused-variables/SKILL.md | kadenzipfel | Presence of Unused Variables | 388 |
56
+ | vulnerability-patterns/use-of-deprecated-functions/SKILL.md | kadenzipfel | Use of Deprecated Functions | 385 |
57
+ | vulnerability-patterns/weak-sources-randomness/SKILL.md | kadenzipfel | Weak Sources of Randomness from Chain Attributes | 398 |
58
+ | vulnerability-patterns/weird-tokens/SKILL.md | DeFiFoFum | Weird ERC20 Tokens Reference | 1013 |
59
+ | vulnerability-patterns/zero-address-misconfiguration/SKILL.md | BailSec | Zero Address Misconfiguration | 426 |
48
60
 
49
61
  ## Methodology
50
62
  | File | Source(s) | Topic | Word Count |
51
63
  |------|-----------|-------|------------|
52
- | methodology/audit-workflow/SKILL.md | DeFiFoFum | audit-workflow | 382 |
53
- | methodology/report-template/SKILL.md | DeFiFoFum | Audit Report Template | 481 |
54
- | methodology/severity-classification/SKILL.md | DeFiFoFum | Severity Classification Guide | 465 |
64
+ | methodology/audit-workflow/SKILL.md | DeFiFoFum | Audit Workflow | 523 |
65
+ | methodology/report-template/SKILL.md | DeFiFoFum | Audit Report Template | 585 |
66
+ | methodology/severity-classification/SKILL.md | DeFiFoFum | Severity Classification Guide | 603 |
55
67
 
56
68
  ## Protocol Patterns
57
69
  | File | Source(s) | Topic | Word Count |
58
70
  |------|-----------|-------|------------|
59
- | protocol-patterns/amm-dex/SKILL.md | DeFiFoFum | AMM (Automated Market Maker) Security Guide | 597 |
60
- | protocol-patterns/bridges-cross-chain/SKILL.md | DeFiFoFum | Cross-Chain Bridge Security Guide | 851 |
61
- | protocol-patterns/dao-governance/SKILL.md | DeFiFoFum | Governance Protocol Security Guide | 827 |
62
- | protocol-patterns/lending-borrowing/SKILL.md | DeFiFoFum | Lending Protocol Security Guide | 663 |
63
- | protocol-patterns/staking-vesting/SKILL.md | DeFiFoFum | Staking Protocol Security Guide | 698 |
71
+ | protocol-patterns/amm-dex/SKILL.md | DeFiFoFum | AMM (Automated Market Maker) Security Guide | 852 |
72
+ | protocol-patterns/bridges-cross-chain/SKILL.md | DeFiFoFum | Cross-Chain Bridge Security Guide | 1083 |
73
+ | protocol-patterns/dao-governance/SKILL.md | DeFiFoFum | Governance Protocol Security Guide | 1024 |
74
+ | protocol-patterns/lending-borrowing/SKILL.md | DeFiFoFum | Lending Protocol Security Guide | 871 |
75
+ | protocol-patterns/staking-vesting/SKILL.md | DeFiFoFum | Staking Protocol Security Guide | 895 |
64
76
 
65
77
  ## Checklists
66
78
  | File | Source(s) | Topic | Word Count |
67
79
  |------|-----------|-------|------------|
68
- | checklists/cyfrin-best-practices-runtime/SKILL.md | Cyfrin | Cyfrin Audit Checklist — Best Practices (Runtime & Cross-chain) | 4766 |
69
- | checklists/cyfrin-best-practices-upgrades/SKILL.md | Cyfrin | Cyfrin Audit Checklist — Best Practices (Upgrades & Versioning) | 2269 |
70
- | checklists/cyfrin-defi-core/SKILL.md | Cyfrin | Cyfrin Audit Checklist — DeFi Security (Core) | 4555 |
71
- | checklists/cyfrin-defi-integrations/SKILL.md | Cyfrin | Cyfrin Audit Checklist — DeFi Security (Integrations & Tokens) | 4632 |
72
- | checklists/cyfrin-gas/SKILL.md | Cyfrin | Cyfrin Audit Checklist — Gas Optimization | 443 |
73
- | checklists/general-audit/SKILL.md | DeFiFoFum, Cyfrin | Solidity Audit Checklist | 2341 |
80
+ | checklists/cyfrin-best-practices-runtime/SKILL.md | Cyfrin | Cyfrin Audit Checklist — Best Practices (Runtime & Cross-chain) | 4303 |
81
+ | checklists/cyfrin-best-practices-upgrades/SKILL.md | Cyfrin | Cyfrin Audit Checklist — Best Practices (Upgrades & Versioning) | 2053 |
82
+ | checklists/cyfrin-defi-core/SKILL.md | Cyfrin | Cyfrin Audit Checklist — DeFi Security (Core) | 4222 |
83
+ | checklists/cyfrin-defi-integrations/SKILL.md | Cyfrin | Cyfrin Audit Checklist — DeFi Security (Integrations & Tokens) | 4290 |
84
+ | checklists/cyfrin-gas/SKILL.md | Cyfrin | Cyfrin Audit Checklist — Gas Optimization | 342 |
85
+ | checklists/general-audit/SKILL.md | DeFiFoFum, Cyfrin | Solidity Audit Checklist | 2878 |
74
86
 
75
87
  ## References
76
88
  | File | Source(s) | Topic | Word Count |
77
89
  |------|-----------|-------|------------|
78
- | references/exploit-reference/SKILL.md | SunWeb3Sec | DeFi Exploit Reference Index | 1133 |
79
- | references/smartbugs-examples/SKILL.md | smartbugs | SmartBugs Curated Dataset — Vulnerable Contract Examples | 3386 |
90
+ | references/exploit-reference/SKILL.md | SunWeb3Sec | DeFi Exploit Reference Index | 1125 |
91
+ | references/smartbugs-examples/SKILL.md | smartbugs | SmartBugs Curated Dataset — Vulnerable Contract Examples | 1677 |
92
+
93
+ ## Case Studies
94
+ | File | Source(s) | Topic | Word Count |
95
+ |------|-----------|-------|------------|
96
+ | case-studies/beanstalk-governance/SKILL.md | DeFiFoFum | Beanstalk Governance Attack Case Study | 420 |
97
+ | case-studies/bzx-flash-loan/SKILL.md | DeFiFoFum | bZx Flash Loan Attack Case Study | 370 |
98
+ | case-studies/cream-finance/SKILL.md | DeFiFoFum | Cream Finance Attack Case Study | 420 |
99
+ | case-studies/curve-reentrancy/SKILL.md | DeFiFoFum | Curve Reentrancy Attack Case Study | 395 |
100
+ | case-studies/dao-hack/SKILL.md | DeFiFoFum | The DAO Hack Case Study | 350 |
101
+ | case-studies/euler-finance/SKILL.md | DeFiFoFum | Euler Finance Attack Case Study | 419 |
102
+ | case-studies/harvest-finance/SKILL.md | DeFiFoFum | Harvest Finance Attack Case Study | 405 |
103
+ | case-studies/level-finance/SKILL.md | DeFiFoFum | Level Finance Attack Case Study | 371 |
104
+ | case-studies/mango-markets/SKILL.md | DeFiFoFum | Mango Markets Attack Case Study | 422 |
105
+ | case-studies/nomad-bridge/SKILL.md | DeFiFoFum | Nomad Bridge Attack Case Study | 429 |
106
+ | case-studies/parity-multisig/SKILL.md | DeFiFoFum | Parity Multisig Wallet Attack Case Study | 395 |
107
+ | case-studies/poly-network/SKILL.md | DeFiFoFum | Poly Network Attack Case Study | 395 |
108
+ | case-studies/rari-fuse/SKILL.md | DeFiFoFum | Rari Fuse Attack Case Study | 391 |
109
+ | case-studies/ronin-bridge/SKILL.md | DeFiFoFum | Ronin Bridge Attack Case Study | 384 |
110
+ | case-studies/wormhole-bridge/SKILL.md | DeFiFoFum | Wormhole Bridge Attack Case Study | 337 |