solidity-argus 0.1.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.
- package/AGENTS.md +37 -0
- package/LICENSE +21 -0
- package/README.md +249 -0
- package/package.json +43 -0
- package/skills/INVENTORY.md +79 -0
- package/skills/README.md +56 -0
- package/skills/checklists/cyfrin-best-practices-runtime/SKILL.md +424 -0
- package/skills/checklists/cyfrin-best-practices-upgrades/SKILL.md +157 -0
- package/skills/checklists/cyfrin-defi-core/SKILL.md +373 -0
- package/skills/checklists/cyfrin-defi-integrations/SKILL.md +412 -0
- package/skills/checklists/cyfrin-gas/SKILL.md +55 -0
- package/skills/checklists/general-audit/SKILL.md +433 -0
- package/skills/methodology/audit-workflow/SKILL.md +129 -0
- package/skills/methodology/report-template/SKILL.md +190 -0
- package/skills/methodology/severity-classification/SKILL.md +179 -0
- package/skills/protocol-patterns/amm-dex/SKILL.md +229 -0
- package/skills/protocol-patterns/bridges-cross-chain/SKILL.md +317 -0
- package/skills/protocol-patterns/dao-governance/SKILL.md +281 -0
- package/skills/protocol-patterns/lending-borrowing/SKILL.md +221 -0
- package/skills/protocol-patterns/staking-vesting/SKILL.md +247 -0
- package/skills/references/exploit-reference/SKILL.md +259 -0
- package/skills/references/smartbugs-examples/SKILL.md +296 -0
- package/skills/vulnerability-patterns/access-control/SKILL.md +298 -0
- package/skills/vulnerability-patterns/arbitrary-storage-location/SKILL.md +59 -0
- package/skills/vulnerability-patterns/assert-violation/SKILL.md +59 -0
- package/skills/vulnerability-patterns/asserting-contract-from-code-size/SKILL.md +61 -0
- package/skills/vulnerability-patterns/authorization-txorigin/SKILL.md +55 -0
- package/skills/vulnerability-patterns/default-visibility/SKILL.md +62 -0
- package/skills/vulnerability-patterns/delegatecall-untrusted-callee/SKILL.md +60 -0
- package/skills/vulnerability-patterns/dos-gas-limit/SKILL.md +59 -0
- package/skills/vulnerability-patterns/dos-revert/SKILL.md +72 -0
- package/skills/vulnerability-patterns/flash-loan-attacks/SKILL.md +249 -0
- package/skills/vulnerability-patterns/floating-pragma/SKILL.md +51 -0
- package/skills/vulnerability-patterns/hash-collision/SKILL.md +52 -0
- package/skills/vulnerability-patterns/inadherence-to-standards/SKILL.md +61 -0
- package/skills/vulnerability-patterns/incorrect-constructor/SKILL.md +60 -0
- package/skills/vulnerability-patterns/incorrect-inheritance-order/SKILL.md +59 -0
- package/skills/vulnerability-patterns/insufficient-gas-griefing/SKILL.md +61 -0
- package/skills/vulnerability-patterns/lack-of-precision/SKILL.md +61 -0
- package/skills/vulnerability-patterns/logic-errors/SKILL.md +333 -0
- package/skills/vulnerability-patterns/missing-protection-signature-replay/SKILL.md +60 -0
- package/skills/vulnerability-patterns/msgvalue-loop/SKILL.md +66 -0
- package/skills/vulnerability-patterns/off-by-one/SKILL.md +67 -0
- package/skills/vulnerability-patterns/oracle-manipulation/SKILL.md +252 -0
- package/skills/vulnerability-patterns/outdated-compiler-version/SKILL.md +65 -0
- package/skills/vulnerability-patterns/overflow-underflow/SKILL.md +61 -0
- package/skills/vulnerability-patterns/reentrancy/SKILL.md +266 -0
- package/skills/vulnerability-patterns/shadowing-state-variables/SKILL.md +72 -0
- package/skills/vulnerability-patterns/signature-malleability/SKILL.md +59 -0
- package/skills/vulnerability-patterns/unbounded-return-data/SKILL.md +63 -0
- package/skills/vulnerability-patterns/unchecked-return-values/SKILL.md +52 -0
- package/skills/vulnerability-patterns/unencrypted-private-data-on-chain/SKILL.md +65 -0
- package/skills/vulnerability-patterns/unexpected-ecrecover-null-address/SKILL.md +61 -0
- package/skills/vulnerability-patterns/uninitialized-storage-pointer/SKILL.md +63 -0
- package/skills/vulnerability-patterns/unsafe-low-level-call/SKILL.md +56 -0
- package/skills/vulnerability-patterns/unsecure-signatures/SKILL.md +80 -0
- package/skills/vulnerability-patterns/unsupported-opcodes/SKILL.md +69 -0
- package/skills/vulnerability-patterns/unused-variables/SKILL.md +70 -0
- package/skills/vulnerability-patterns/use-of-deprecated-functions/SKILL.md +81 -0
- package/skills/vulnerability-patterns/weak-sources-randomness/SKILL.md +77 -0
- package/skills/vulnerability-patterns/weird-tokens/SKILL.md +294 -0
- package/src/agents/argus-prompt.ts +407 -0
- package/src/agents/pythia-prompt.ts +134 -0
- package/src/agents/scribe-prompt.ts +87 -0
- package/src/agents/sentinel-prompt.ts +133 -0
- package/src/cli/cli-program.ts +67 -0
- package/src/cli/commands/doctor.ts +83 -0
- package/src/cli/commands/init.ts +46 -0
- package/src/cli/commands/install.ts +55 -0
- package/src/cli/index.ts +13 -0
- package/src/cli/tui-prompts.ts +75 -0
- package/src/cli/types.ts +9 -0
- package/src/config/index.ts +3 -0
- package/src/config/loader.ts +36 -0
- package/src/config/schema.ts +82 -0
- package/src/config/types.ts +4 -0
- package/src/constants/defaults.ts +6 -0
- package/src/create-hooks.ts +84 -0
- package/src/create-managers.ts +26 -0
- package/src/create-tools.ts +30 -0
- package/src/features/audit-enforcer/audit-enforcer.ts +34 -0
- package/src/features/audit-enforcer/index.ts +1 -0
- package/src/features/background-agent/background-manager.ts +200 -0
- package/src/features/background-agent/index.ts +1 -0
- package/src/features/context-monitor/context-monitor.ts +48 -0
- package/src/features/context-monitor/index.ts +4 -0
- package/src/features/context-monitor/tool-output-truncator.ts +17 -0
- package/src/features/error-recovery/index.ts +2 -0
- package/src/features/error-recovery/session-recovery.ts +27 -0
- package/src/features/error-recovery/tool-error-recovery.ts +35 -0
- package/src/features/index.ts +5 -0
- package/src/features/persistent-state/audit-state-manager.ts +121 -0
- package/src/features/persistent-state/index.ts +1 -0
- package/src/hooks/compaction-hook.ts +50 -0
- package/src/hooks/config-handler.ts +116 -0
- package/src/hooks/event-hook-v2.ts +93 -0
- package/src/hooks/event-hook.ts +74 -0
- package/src/hooks/hook-system.ts +9 -0
- package/src/hooks/index.ts +5 -0
- package/src/hooks/knowledge-sync-hook.ts +57 -0
- package/src/hooks/safe-create-hook.ts +15 -0
- package/src/hooks/system-prompt-hook.ts +126 -0
- package/src/hooks/tool-tracking-hook.ts +234 -0
- package/src/hooks/types.ts +16 -0
- package/src/index.ts +36 -0
- package/src/knowledge/scvd-client.ts +242 -0
- package/src/knowledge/scvd-index.ts +183 -0
- package/src/knowledge/scvd-sync.ts +85 -0
- package/src/managers/index.ts +1 -0
- package/src/managers/types.ts +85 -0
- package/src/plugin-interface.ts +38 -0
- package/src/shared/binary-utils.ts +63 -0
- package/src/shared/deep-merge.ts +71 -0
- package/src/shared/file-utils.ts +56 -0
- package/src/shared/index.ts +5 -0
- package/src/shared/jsonc-parser.ts +39 -0
- package/src/shared/logger.ts +36 -0
- package/src/state/audit-state.ts +27 -0
- package/src/state/finding-store.ts +126 -0
- package/src/state/plugin-state.ts +14 -0
- package/src/state/types.ts +61 -0
- package/src/tools/contract-analyzer-tool.ts +184 -0
- package/src/tools/forge-fuzz-tool.ts +311 -0
- package/src/tools/forge-test-tool.ts +397 -0
- package/src/tools/pattern-checker-tool.ts +337 -0
- package/src/tools/report-generator-tool.ts +308 -0
- package/src/tools/slither-tool.ts +465 -0
- package/src/tools/solodit-search-tool.ts +131 -0
- package/src/tools/sync-knowledge-tool.ts +116 -0
- package/src/utils/project-detector.ts +133 -0
- package/src/utils/solidity-parser.ts +174 -0
package/AGENTS.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Argus Plugin Agents
|
|
2
|
+
|
|
3
|
+
This file enables OpenCode agent discovery for the `solidity-argus` plugin.
|
|
4
|
+
|
|
5
|
+
## Architecture
|
|
6
|
+
|
|
7
|
+
Modular factory-based architecture: `create-tools.ts`, `create-hooks.ts`, `create-managers.ts`, `plugin-interface.ts`.
|
|
8
|
+
Multi-level config (user + project) with deep merge. Hook enable/disable via `disabled_hooks` config.
|
|
9
|
+
CLI: `argus doctor`, `argus init`, `argus install`.
|
|
10
|
+
|
|
11
|
+
## argus
|
|
12
|
+
|
|
13
|
+
**Role**: Primary security audit orchestrator
|
|
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
|
+
**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)
|
|
17
|
+
|
|
18
|
+
## sentinel
|
|
19
|
+
|
|
20
|
+
**Role**: Static analysis and testing specialist
|
|
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
|
+
**Model**: anthropic/claude-sonnet-4-6
|
|
23
|
+
**Tools**: argus_slither_analyze, argus_forge_test, argus_forge_fuzz, argus_analyze_contract, argus_check_patterns
|
|
24
|
+
|
|
25
|
+
## pythia
|
|
26
|
+
|
|
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.
|
|
29
|
+
**Model**: anthropic/claude-sonnet-4-6
|
|
30
|
+
**Tools**: argus_solodit_search, argus_check_patterns
|
|
31
|
+
|
|
32
|
+
## scribe
|
|
33
|
+
|
|
34
|
+
**Role**: Audit report writer
|
|
35
|
+
**Description**: Transforms raw findings into professional markdown audit reports. Produces structured output with severity classifications (Critical/High/Medium/Low/Informational), impact assessments, proof-of-concept steps, and actionable recommendations. Dispatched by Argus only after all analysis is complete.
|
|
36
|
+
**Model**: anthropic/claude-sonnet-4-6
|
|
37
|
+
**Tools**: argus_generate_report
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Apegurus
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
# solidity-argus
|
|
2
|
+
|
|
3
|
+
**The All-Seeing Solidity Security Auditor for OpenCode**
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/solidity-argus) [](./LICENSE)
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
**solidity-argus** is a security auditing plugin for [OpenCode](https://opencode.ai) that brings professional-grade Solidity smart contract auditing directly into your AI coding workflow.
|
|
12
|
+
|
|
13
|
+
Argus Panoptes — the mythological all-seeing giant — orchestrates a team of 4 specialized AI agents to conduct comprehensive security audits: static analysis, vulnerability research, dynamic testing, and professional report generation.
|
|
14
|
+
|
|
15
|
+
**What it does:**
|
|
16
|
+
- Runs Slither static analysis and Foundry tests automatically
|
|
17
|
+
- Searches 7,769+ real-world audit findings via SCVD and Solodit
|
|
18
|
+
- Matches code against 55 curated vulnerability pattern files
|
|
19
|
+
- Generates professional markdown audit reports with severity classifications
|
|
20
|
+
- Follows a rigorous 7-step audit methodology (Reconnaissance → Report)
|
|
21
|
+
|
|
22
|
+
**Why it's useful:**
|
|
23
|
+
- Catches reentrancy, oracle manipulation, access control flaws, flash loan vectors, and 35+ other vulnerability classes
|
|
24
|
+
- Integrates seamlessly into OpenCode's agent system — no separate tooling setup required
|
|
25
|
+
- Knowledge base sourced from Trail of Bits, Cyfrin, DeFiFoFum, and the broader security community
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Installation
|
|
30
|
+
|
|
31
|
+
Add `solidity-argus` to your OpenCode configuration:
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"plugin": ["solidity-argus"]
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Or install via npm/bun:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
bun add solidity-argus
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Quick Start
|
|
48
|
+
|
|
49
|
+
1. Open a Solidity project in OpenCode
|
|
50
|
+
2. Switch to the `@argus` agent
|
|
51
|
+
3. Say: `"Audit the VaultContract.sol for security vulnerabilities"`
|
|
52
|
+
|
|
53
|
+
Argus will automatically:
|
|
54
|
+
- Analyze the contract structure
|
|
55
|
+
- Run Slither (if available)
|
|
56
|
+
- Search for known vulnerability patterns
|
|
57
|
+
- Research historical exploits in similar protocols
|
|
58
|
+
- Generate a full audit report
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Agents
|
|
63
|
+
|
|
64
|
+
| Agent | Role | Model |
|
|
65
|
+
|-------|------|-------|
|
|
66
|
+
| `@argus` | Orchestrator — coordinates the full audit | claude-opus-4-6 |
|
|
67
|
+
| `@sentinel` | Static analysis & testing specialist | claude-sonnet-4-6 |
|
|
68
|
+
| `@pythia` | Vulnerability researcher | claude-sonnet-4-6 |
|
|
69
|
+
| `@scribe` | Audit report writer | claude-sonnet-4-6 |
|
|
70
|
+
|
|
71
|
+
### @argus — The Orchestrator
|
|
72
|
+
Argus Panoptes is the lead auditor. It follows a 7-step methodology (Reconnaissance, Automated Scanning, Manual Review, Attack Surface Mapping, Vulnerability Research, Testing & Verification, Reporting) and delegates to Sentinel, Pythia, and Scribe as needed.
|
|
73
|
+
|
|
74
|
+
### @sentinel — The Executor
|
|
75
|
+
Runs Slither, writes and executes Foundry tests, performs fuzz testing. Your tactical executor for all dynamic and static analysis tasks.
|
|
76
|
+
|
|
77
|
+
### @pythia — The Researcher
|
|
78
|
+
Searches Solodit and SCVD for historical exploits, checks vulnerability pattern databases, and provides research context for similar protocols and known attack vectors.
|
|
79
|
+
|
|
80
|
+
### @scribe — The Reporter
|
|
81
|
+
Transforms raw findings into professional, structured markdown audit reports with severity classifications, impact assessments, and actionable recommendations.
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Tools
|
|
86
|
+
|
|
87
|
+
| Tool | Agent | Description |
|
|
88
|
+
|------|-------|-------------|
|
|
89
|
+
| `argus_slither_analyze` | Sentinel | Runs Slither static analysis on Solidity contracts; detects reentrancy, uninitialized variables, unchecked returns, and more |
|
|
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 |
|
|
92
|
+
| `argus_solodit_search` | Pythia | Searches Solodit's database of real-world audit reports for similar protocols and historical findings |
|
|
93
|
+
| `argus_forge_test` | Sentinel | Runs existing or newly written Foundry/Forge tests; essential for PoC verification |
|
|
94
|
+
| `argus_forge_fuzz` | Sentinel | Fuzzes specific functions with random inputs to find edge cases and invariant violations |
|
|
95
|
+
| `argus_generate_report` | Scribe | Generates the final structured audit report in professional markdown format |
|
|
96
|
+
| `argus_sync_knowledge` | Argus | Syncs the local vulnerability database from SCVD (api.scvd.dev) |
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Knowledge Base
|
|
101
|
+
|
|
102
|
+
The plugin ships with **55 curated SKILL.md files** organized into 5 categories:
|
|
103
|
+
|
|
104
|
+
| Category | Files | Description |
|
|
105
|
+
|----------|-------|-------------|
|
|
106
|
+
| Vulnerability Patterns | 38 | Reentrancy, oracle manipulation, flash loans, access control, overflow/underflow, and 33 more |
|
|
107
|
+
| Methodology | 3 | Audit workflow, report templates, severity classification |
|
|
108
|
+
| Protocol Patterns | 5 | AMM/DEX, bridges, governance, lending, staking security guides |
|
|
109
|
+
| Checklists | 6 | Cyfrin audit checklists (DeFi core, integrations, upgrades, gas, best practices) |
|
|
110
|
+
| References | 2 | DeFi exploit reference index, SmartBugs vulnerable contract examples |
|
|
111
|
+
|
|
112
|
+
**Sources:** Trail of Bits, Cyfrin, DeFiFoFum, kadenzipfel, SunWeb3Sec, smartbugs
|
|
113
|
+
|
|
114
|
+
**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
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## Configuration
|
|
119
|
+
|
|
120
|
+
Create `.opencode/solidity-argus.jsonc` in your project root:
|
|
121
|
+
|
|
122
|
+
```jsonc
|
|
123
|
+
{
|
|
124
|
+
"agents": {
|
|
125
|
+
"argus": { "model": "anthropic/claude-opus-4-6" },
|
|
126
|
+
"sentinel": { "model": "anthropic/claude-sonnet-4-6" },
|
|
127
|
+
"pythia": { "model": "anthropic/claude-sonnet-4-6" },
|
|
128
|
+
"scribe": { "model": "anthropic/claude-sonnet-4-6" }
|
|
129
|
+
},
|
|
130
|
+
|
|
131
|
+
"tools": {
|
|
132
|
+
"slitherPath": "/usr/local/bin/slither",
|
|
133
|
+
"forgePath": "/usr/local/bin/forge"
|
|
134
|
+
},
|
|
135
|
+
|
|
136
|
+
"knowledge": {
|
|
137
|
+
"scvd": { "enabled": true, "apiUrl": "https://api.scvd.dev" },
|
|
138
|
+
"autoSync": true,
|
|
139
|
+
"customSkillsDir": "./my-custom-skills"
|
|
140
|
+
},
|
|
141
|
+
|
|
142
|
+
"reporting": {
|
|
143
|
+
"format": "markdown",
|
|
144
|
+
"severityThreshold": "low",
|
|
145
|
+
"gasAnalysis": false
|
|
146
|
+
},
|
|
147
|
+
|
|
148
|
+
"solodit": {
|
|
149
|
+
"enabled": true,
|
|
150
|
+
"port": 3000
|
|
151
|
+
},
|
|
152
|
+
|
|
153
|
+
"disabled_hooks": [],
|
|
154
|
+
|
|
155
|
+
"background": {
|
|
156
|
+
"max_concurrent": 3
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## New in v2: Modular Architecture
|
|
164
|
+
|
|
165
|
+
This release restructures solidity-argus into a modular factory-based architecture with several new infrastructure features:
|
|
166
|
+
|
|
167
|
+
### CLI Tools
|
|
168
|
+
|
|
169
|
+
Run diagnostics and setup from the command line:
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
# Check that Slither, Foundry, and SCVD are available
|
|
173
|
+
argus doctor
|
|
174
|
+
|
|
175
|
+
# Generate a starter .opencode/solidity-argus.jsonc config
|
|
176
|
+
argus init
|
|
177
|
+
|
|
178
|
+
# Install optional dependencies (Slither, Foundry)
|
|
179
|
+
argus install
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### Hook Enable/Disable
|
|
183
|
+
|
|
184
|
+
Selectively disable any hook via config:
|
|
185
|
+
|
|
186
|
+
```jsonc
|
|
187
|
+
{
|
|
188
|
+
"disabled_hooks": ["context-monitor", "audit-enforcer"]
|
|
189
|
+
}
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### Multi-Level Configuration
|
|
193
|
+
|
|
194
|
+
Config is resolved by merging three layers (last wins):
|
|
195
|
+
|
|
196
|
+
1. **Defaults** — Built-in sensible defaults
|
|
197
|
+
2. **User-level** — `~/.config/solidity-argus/config.jsonc`
|
|
198
|
+
3. **Project-level** — `.opencode/solidity-argus.jsonc`
|
|
199
|
+
|
|
200
|
+
### Background Agent Management
|
|
201
|
+
|
|
202
|
+
Background tasks (knowledge sync, long-running analysis) are tracked with configurable concurrency limits and lifecycle callbacks:
|
|
203
|
+
|
|
204
|
+
```jsonc
|
|
205
|
+
{
|
|
206
|
+
"background": {
|
|
207
|
+
"max_concurrent": 3,
|
|
208
|
+
"cleanup_interval_ms": 60000
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
### Persistent Audit State
|
|
214
|
+
|
|
215
|
+
Audit progress survives session restarts. State is saved to `.opencode/argus-state.json` and automatically restored on next session.
|
|
216
|
+
|
|
217
|
+
### Error Recovery
|
|
218
|
+
|
|
219
|
+
Failed tool executions are captured with full context and automatically retried with exponential backoff when appropriate.
|
|
220
|
+
|
|
221
|
+
### Context Window Monitoring
|
|
222
|
+
|
|
223
|
+
Monitors token usage and adaptively reduces injection sizes when context pressure is high, preventing context window overflow during long audits.
|
|
224
|
+
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
## Companion Plugins
|
|
228
|
+
|
|
229
|
+
- **Trail of Bits Skills** — Additional security research skills from Trail of Bits auditors
|
|
230
|
+
- **Solodit MCP** — Direct MCP integration with Solodit's audit report database for richer vulnerability research
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
## Requirements
|
|
235
|
+
|
|
236
|
+
| Dependency | Required | Notes |
|
|
237
|
+
|------------|----------|-------|
|
|
238
|
+
| OpenCode | ✅ Required | The AI coding environment this plugin runs in |
|
|
239
|
+
| Bun | ✅ Required | `>=1.0.0` — runtime for the plugin |
|
|
240
|
+
| Slither | ⚠️ Optional | Enables `argus_slither_analyze`. Install: `pip install slither-analyzer` |
|
|
241
|
+
| Foundry/Forge | ⚠️ Optional | Enables `argus_forge_test` and `argus_forge_fuzz`. Install: `curl -L https://foundry.paradigm.xyz \| bash` |
|
|
242
|
+
|
|
243
|
+
If Slither or Foundry are unavailable, Argus gracefully falls back to manual review mode and notes the limitation in the audit report.
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
## License
|
|
248
|
+
|
|
249
|
+
MIT — see [LICENSE](./LICENSE) for details.
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "solidity-argus",
|
|
3
|
+
"version": "0.1.0",
|
|
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"],
|
|
6
|
+
"author": "Apegurus",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"main": "./src/index.ts",
|
|
10
|
+
"module": "./src/index.ts",
|
|
11
|
+
"types": "./src/index.ts",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": "./src/index.ts",
|
|
14
|
+
"./package.json": "./package.json"
|
|
15
|
+
},
|
|
16
|
+
"bin": {
|
|
17
|
+
"argus": "./src/cli/index.ts"
|
|
18
|
+
},
|
|
19
|
+
"files": ["src/", "!src/**/*.test.ts", "skills/", "README.md", "AGENTS.md", "LICENSE"],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"test": "bun test",
|
|
22
|
+
"typecheck": "tsc --noEmit",
|
|
23
|
+
"cli": "bun src/cli/index.ts",
|
|
24
|
+
"doctor": "bun src/cli/index.ts doctor",
|
|
25
|
+
"init": "bun src/cli/index.ts init"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"zod": "^4.3.6"
|
|
29
|
+
},
|
|
30
|
+
"peerDependencies": {
|
|
31
|
+
"@opencode-ai/plugin": "^1.2.6"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@opencode-ai/plugin": "^1.2.6",
|
|
35
|
+
"@types/bun": "^1.2.0",
|
|
36
|
+
"typescript": "^5"
|
|
37
|
+
},
|
|
38
|
+
"repository": {
|
|
39
|
+
"type": "git",
|
|
40
|
+
"url": "https://github.com/Apegurus/solidity-argus"
|
|
41
|
+
},
|
|
42
|
+
"engines": { "bun": ">=1.0.0" }
|
|
43
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Argus Knowledge Base Inventory
|
|
2
|
+
|
|
3
|
+
Generated: 2026-02-18
|
|
4
|
+
Total SKILL.md files: 55
|
|
5
|
+
|
|
6
|
+
## Vulnerability Patterns
|
|
7
|
+
| File | Source(s) | Topic | Word Count |
|
|
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 |
|
|
48
|
+
|
|
49
|
+
## Methodology
|
|
50
|
+
| File | Source(s) | Topic | Word Count |
|
|
51
|
+
|------|-----------|-------|------------|
|
|
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 |
|
|
55
|
+
|
|
56
|
+
## Protocol Patterns
|
|
57
|
+
| File | Source(s) | Topic | Word Count |
|
|
58
|
+
|------|-----------|-------|------------|
|
|
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 |
|
|
64
|
+
|
|
65
|
+
## Checklists
|
|
66
|
+
| File | Source(s) | Topic | Word Count |
|
|
67
|
+
|------|-----------|-------|------------|
|
|
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 |
|
|
74
|
+
|
|
75
|
+
## References
|
|
76
|
+
| File | Source(s) | Topic | Word Count |
|
|
77
|
+
|------|-----------|-------|------------|
|
|
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 |
|
package/skills/README.md
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Argus Knowledge Base
|
|
2
|
+
|
|
3
|
+
The Argus knowledge base provides a structured collection of Solidity security patterns, audit methodologies, and protocol-specific security guides. OpenCode's skills system uses these files to provide context-aware security analysis and auditing assistance.
|
|
4
|
+
|
|
5
|
+
## Architecture
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
OpenCode Skills System
|
|
9
|
+
├── skills/ (bundled with plugin)
|
|
10
|
+
│ ├── vulnerability-patterns/ (37 patterns from kadenzipfel + DeFiFoFum)
|
|
11
|
+
│ ├── methodology/ (3 files from DeFiFoFum)
|
|
12
|
+
│ ├── protocol-patterns/ (5 files from DeFiFoFum)
|
|
13
|
+
│ ├── checklists/ (6 files from DeFiFoFum + Cyfrin)
|
|
14
|
+
│ └── references/ (2 files: SmartBugs + DeFiHackLabs)
|
|
15
|
+
├── SCVD Local Index (~/.cache/opencode-argus/scvd-index.json)
|
|
16
|
+
│ └── 7,769+ findings, auto-synced from api.scvd.dev
|
|
17
|
+
└── Companion Plugins (installed separately)
|
|
18
|
+
├── Trail of Bits Skills (trailofbits/skills)
|
|
19
|
+
└── Solodit MCP (auto-registered by Argus)
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Source Attribution
|
|
23
|
+
|
|
24
|
+
| Source | License | URL | What Was Imported |
|
|
25
|
+
|--------|---------|-----|-------------------|
|
|
26
|
+
| DeFiFoFum/fofum-solidity-skills | MIT | https://github.com/DeFiFoFum/fofum-solidity-skills | 15 SKILL.md files: methodology, vulnerability patterns, protocol patterns |
|
|
27
|
+
| kadenzipfel/smart-contract-vulnerabilities | MIT | https://github.com/kadenzipfel/smart-contract-vulnerabilities | 37 vulnerability reference files with Detection Heuristics |
|
|
28
|
+
| Cyfrin/audit-checklist | Unspecified (attributed) | https://github.com/Cyfrin/audit-checklist | 221 structured checklist items organized by category |
|
|
29
|
+
| smartbugs/smartbugs-curated | Apache-2.0 | https://github.com/smartbugs/smartbugs-curated | 143 annotated vulnerable contract references |
|
|
30
|
+
| SunWeb3Sec/DeFiHackLabs | Reference only | https://github.com/SunWeb3Sec/DeFiHackLabs | 15 exploit PoC GitHub URL references |
|
|
31
|
+
| SCVD (api.scvd.dev) | CC0 | https://api.scvd.dev | 7,769+ findings via local index (auto-synced) |
|
|
32
|
+
|
|
33
|
+
## SKILL.md Format Specification
|
|
34
|
+
|
|
35
|
+
Contributors can add custom skills using this format:
|
|
36
|
+
|
|
37
|
+
```yaml
|
|
38
|
+
---
|
|
39
|
+
name: topic-name # Must match parent directory name
|
|
40
|
+
description: One sentence description (1-1024 chars)
|
|
41
|
+
---
|
|
42
|
+
<!-- Source: Author/repo (License) -->
|
|
43
|
+
|
|
44
|
+
# Topic Title
|
|
45
|
+
|
|
46
|
+
## Overview
|
|
47
|
+
...
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Custom Skills
|
|
51
|
+
|
|
52
|
+
To add your own skills, use the `knowledge.customSkillsDir` configuration option in your `opencode-argus.jsonc` file. Point this to a directory containing your custom `SKILL.md` files organized into subdirectories.
|
|
53
|
+
|
|
54
|
+
## Inventory
|
|
55
|
+
|
|
56
|
+
See [INVENTORY.md](./INVENTORY.md) for a complete listing of all 55 SKILL.md files currently bundled with Argus.
|