solidity-argus 0.5.10 → 0.6.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 (42) hide show
  1. package/AGENTS.md +8 -1
  2. package/README.md +27 -21
  3. package/package.json +2 -2
  4. package/skills/INVENTORY.md +14 -1
  5. package/skills/README.md +4 -2
  6. package/skills/references/attack-vector-deck/SKILL.md +62 -0
  7. package/skills/specialist-profiles/access-control-specialist/SKILL.md +31 -0
  8. package/skills/specialist-profiles/economic-security/SKILL.md +31 -0
  9. package/skills/specialist-profiles/execution-trace/SKILL.md +31 -0
  10. package/skills/specialist-profiles/first-principles/SKILL.md +31 -0
  11. package/skills/specialist-profiles/invariant/SKILL.md +31 -0
  12. package/skills/specialist-profiles/math-precision/SKILL.md +31 -0
  13. package/skills/specialist-profiles/periphery/SKILL.md +31 -0
  14. package/skills/specialist-profiles/vector-scan/SKILL.md +28 -0
  15. package/src/agents/argus-prompt.ts +59 -6
  16. package/src/agents/audit-specialist-prompt.ts +94 -0
  17. package/src/agents/pythia-prompt.ts +7 -4
  18. package/src/agents/scribe-prompt.ts +9 -0
  19. package/src/agents/sentinel-prompt.ts +12 -0
  20. package/src/agents/themis-prompt.ts +4 -0
  21. package/src/config/schema.ts +2 -0
  22. package/src/constants/defaults.ts +1 -0
  23. package/src/create-hooks.ts +9 -1
  24. package/src/features/background-agent/background-manager.ts +85 -2
  25. package/src/features/persistent-state/run-finalizer.ts +37 -3
  26. package/src/hooks/config-handler.ts +23 -0
  27. package/src/hooks/system-prompt-hook.ts +72 -2
  28. package/src/hooks/tool-tracking-hook.ts +50 -6
  29. package/src/managers/types.ts +21 -0
  30. package/src/shared/agent-names.ts +1 -0
  31. package/src/shared/lineage-validator.ts +96 -0
  32. package/src/shared/report-path-resolver.ts +8 -2
  33. package/src/state/adapters.ts +1 -1
  34. package/src/state/projectors.ts +50 -0
  35. package/src/state/schemas.ts +86 -1
  36. package/src/state/types.ts +25 -1
  37. package/src/tools/forge-coverage-tool.ts +41 -5
  38. package/src/tools/persist-deduped-tool.ts +45 -1
  39. package/src/tools/read-findings-tool.ts +46 -5
  40. package/src/tools/record-finding-tool.ts +10 -30
  41. package/src/tools/report-generator-tool.ts +135 -37
  42. package/src/tools/slither-tool.ts +62 -2
package/AGENTS.md CHANGED
@@ -11,7 +11,7 @@ CLI: `argus doctor`, `argus init`, `argus install`.
11
11
  ## argus
12
12
 
13
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), Scribe (reporting), and Themis (validation). Follows a rigorous 7-step methodology: Reconnaissance, Automated Scanning, Manual Review, Attack Surface Mapping, Vulnerability Research, Testing & Verification, and Reporting.
14
+ **Description**: Argus Panoptes, the All-Seeing Guardian. Coordinates full Solidity security audits by dispatching Sentinel (analysis), Pythia (research), Audit Specialist (deep/adversarial profiles), Scribe (reporting), and Themis (validation). 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-7
16
16
  **Tools**: 15 orchestrator-accessible 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_record_finding, argus_read_findings, argus_sync_knowledge, argus_themis_disposition). `argus_persist_deduped` is reserved for Scribe.
17
17
 
@@ -29,6 +29,13 @@ CLI: `argus doctor`, `argus init`, `argus install`.
29
29
  **Model**: anthropic/claude-sonnet-4-6
30
30
  **Tools**: argus_solodit_search, argus_check_patterns, argus_record_finding, skill
31
31
 
32
+ ## audit-specialist
33
+
34
+ **Role**: Profile-driven adversarial specialist auditor
35
+ **Description**: Runs focused deep/adversarial passes under profiles such as vector-scan, access-control, math-precision, invariant, economic-security, execution-trace, periphery, and first-principles. Combines Sentinel-style analysis and verification tools with Pythia-style historical research. Records only confirmed findings; returns unproven trails as LEAD blocks.
36
+ **Model**: anthropic/claude-sonnet-4-6
37
+ **Tools**: argus_skill_load, argus_check_patterns, argus_solodit_search, argus_analyze_contract, argus_slither_analyze, argus_proxy_detection, argus_forge_test, argus_forge_fuzz, argus_forge_coverage, argus_gas_analysis, argus_record_finding, skill
38
+
32
39
  ## scribe
33
40
 
34
41
  **Role**: Audit report writer
package/README.md CHANGED
@@ -10,12 +10,12 @@
10
10
 
11
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
12
 
13
- Argus Panoptes — the mythological all-seeing giant — orchestrates a team of 5 specialized AI agents to conduct comprehensive security audits: static analysis, vulnerability research, dynamic testing, professional report generation, and independent validation.
13
+ Argus Panoptes — the mythological all-seeing giant — orchestrates a team of 6 specialized AI agents to conduct comprehensive security audits: static analysis, vulnerability research, deep adversarial specialist review, dynamic testing, professional report generation, and independent validation.
14
14
 
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 82 curated SKILL.md knowledge files
18
+ - Matches code against 91 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
 
@@ -68,11 +68,12 @@ Argus will automatically:
68
68
  | `@argus` | Orchestrator — coordinates the full audit | claude-opus-4-7 |
69
69
  | `@sentinel` | Static analysis & testing specialist | claude-sonnet-4-6 |
70
70
  | `@pythia` | Vulnerability researcher | claude-sonnet-4-6 |
71
+ | `@audit-specialist` | Profile-driven adversarial specialist | claude-sonnet-4-6 |
71
72
  | `@scribe` | Audit report writer | claude-sonnet-4-6 |
72
73
  | `@themis` | Independent audit quality gate | gpt-5.5 |
73
74
 
74
75
  ### @argus — The Orchestrator
75
- 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, Scribe, and Themis as needed.
76
+ 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, Audit Specialist, Scribe, and Themis as needed.
76
77
 
77
78
  ### @sentinel — The Executor
78
79
  Runs Slither, writes and executes Foundry tests, performs fuzz testing. Your tactical executor for all dynamic and static analysis tasks.
@@ -80,6 +81,9 @@ Runs Slither, writes and executes Foundry tests, performs fuzz testing. Your tac
80
81
  ### @pythia — The Researcher
81
82
  Searches Solodit and SCVD for historical exploits, checks vulnerability pattern databases, and provides research context for similar protocols and known attack vectors.
82
83
 
84
+ ### @audit-specialist — The Adversarial Specialist
85
+ Runs focused deep/adversarial passes under profiles such as `vector-scan`, `access-control`, `math-precision`, `invariant`, `economic-security`, `execution-trace`, `periphery`, and `first-principles`. It records only confirmed findings and returns unproven trails as leads.
86
+
83
87
  ### @scribe — The Reporter
84
88
  Transforms raw findings into professional, structured markdown audit reports with severity classifications, impact assessments, and actionable recommendations.
85
89
 
@@ -92,17 +96,17 @@ Validates the completed audit by comparing raw findings, deduped findings, and t
92
96
 
93
97
  | Tool | Agent | Description |
94
98
  |------|-------|-------------|
95
- | `argus_slither_analyze` | Sentinel | Runs Slither static analysis on Solidity contracts; detects reentrancy, uninitialized variables, unchecked returns, and more |
96
- | `argus_analyze_contract` | Sentinel | Generates a deep structural profile of a contract: functions, state variables, modifiers, inheritance tree |
97
- | `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 |
98
- | `argus_proxy_detection` | Sentinel | Detects proxy patterns in Solidity contracts (ERC1967, UUPS, transparent, beacon, diamond) with confidence scoring |
99
- | `argus_solodit_search` | Pythia | Searches Solodit's database of real-world audit reports for similar protocols and historical findings |
100
- | `argus_forge_test` | Sentinel | Runs existing or newly written Foundry/Forge tests; essential for PoC verification |
101
- | `argus_gas_analysis` | Sentinel | Runs forge gas report analysis, parses per-function gas metrics, and identifies high-gas hotspots above configurable threshold |
102
- | `argus_forge_fuzz` | Sentinel | Fuzzes specific functions with random inputs to find edge cases and invariant violations |
103
- | `argus_forge_coverage` | Sentinel | Runs forge coverage analysis and returns structured per-file coverage metrics (lines, statements, branches, functions) |
104
- | `argus_skill_load` | Pythia, Themis | Loads curated SKILL.md knowledge files on demand for vulnerability patterns, protocol guidance, methodology, and case studies |
105
- | `argus_record_finding` | Sentinel, Pythia | Records verified manual, static-analysis, research, or testing findings into durable audit state |
99
+ | `argus_slither_analyze` | Sentinel, Audit Specialist | Runs Slither static analysis on Solidity contracts; detects reentrancy, uninitialized variables, unchecked returns, and more |
100
+ | `argus_analyze_contract` | Sentinel, Audit Specialist | Generates a deep structural profile of a contract: functions, state variables, modifiers, inheritance tree |
101
+ | `argus_check_patterns` | Sentinel, Pythia, Audit Specialist | Scans code against a library of complex vulnerability patterns (regex/AST-based) covering 50+ vulnerability classes across 14 pattern categories |
102
+ | `argus_proxy_detection` | Sentinel, Audit Specialist | Detects proxy patterns in Solidity contracts (ERC1967, UUPS, transparent, beacon, diamond) with confidence scoring |
103
+ | `argus_solodit_search` | Pythia, Audit Specialist | Searches Solodit's database of real-world audit reports for similar protocols and historical findings |
104
+ | `argus_forge_test` | Sentinel, Audit Specialist | Runs existing or newly written Foundry/Forge tests; essential for PoC verification |
105
+ | `argus_gas_analysis` | Sentinel, Audit Specialist | Runs forge gas report analysis, parses per-function gas metrics, and identifies high-gas hotspots above configurable threshold |
106
+ | `argus_forge_fuzz` | Sentinel, Audit Specialist | Fuzzes specific functions with random inputs to find edge cases and invariant violations |
107
+ | `argus_forge_coverage` | Sentinel, Audit Specialist | Runs forge coverage analysis and returns structured per-file coverage metrics (lines, statements, branches, functions) |
108
+ | `argus_skill_load` | Pythia, Audit Specialist, Themis | Loads curated SKILL.md knowledge files on demand for vulnerability patterns, protocol guidance, methodology, and case studies |
109
+ | `argus_record_finding` | Sentinel, Pythia, Audit Specialist | Records verified manual, static-analysis, research, or testing findings into durable audit state |
106
110
  | `argus_read_findings` | Scribe, Themis | Reads persisted findings and audit artifacts for report generation and validation |
107
111
  | `argus_persist_deduped` | Scribe | Persists deduplicated findings before final report generation and validation |
108
112
  | `argus_generate_report` | Scribe | Generates the final structured audit report in professional markdown format |
@@ -113,15 +117,15 @@ Validates the completed audit by comparing raw findings, deduped findings, and t
113
117
 
114
118
  ## Knowledge Base
115
119
 
116
- The plugin ships with **82 curated SKILL.md files** organized into 6 categories:
120
+ The plugin ships with **91 curated SKILL.md files** organized into 7 categories:
117
121
 
118
122
  | Category | Files | Description |
119
123
  |----------|-------|-------------|
120
124
  | Vulnerability Patterns | 51 | Reentrancy, oracle manipulation, flash loans, access control, ERC4626, governance, front-running, and 44 more |
121
- | Methodology | 3 | Audit workflow, report templates, severity classification |
125
+ | Methodology | 11 | Audit workflow, report templates, severity classification, and 8 audit-specialist profiles |
122
126
  | Protocol Patterns | 5 | AMM/DEX, bridges, governance, lending, staking security guides |
123
127
  | Checklists | 6 | Cyfrin audit checklists (DeFi core, integrations, upgrades, gas, best practices) |
124
- | References | 2 | DeFi exploit reference index, SmartBugs vulnerable contract examples |
128
+ | References | 3 | DeFi exploit reference index, SmartBugs vulnerable contract examples, and the attack-vector deck |
125
129
  | Case Studies | 15 | Major DeFi exploit analyses (Euler, Nomad Bridge, Ronin, Cream Finance, etc.) |
126
130
 
127
131
  **Sources:** Trail of Bits, Cyfrin, DeFiFoFum, kadenzipfel, SunWeb3Sec, smartbugs, BailSec, Argus
@@ -288,6 +292,7 @@ Create `.argus/solidity-argus.jsonc` in your project root. `.opencode/solidity-a
288
292
  "argus": { "model": "anthropic/claude-opus-4-7" },
289
293
  "sentinel": { "model": "anthropic/claude-sonnet-4-6" },
290
294
  "pythia": { "model": "anthropic/claude-sonnet-4-6" },
295
+ "auditSpecialist": { "model": "anthropic/claude-sonnet-4-6" },
291
296
  "scribe": { "model": "anthropic/claude-sonnet-4-6" },
292
297
  "themis": { "model": "openai/gpt-5.5" }
293
298
  },
@@ -339,11 +344,12 @@ Argus uses a **three-channel context delivery system** to inject dynamic audit s
339
344
 
340
345
  ### Prompt Channel (Static Identity)
341
346
 
342
- Each of the 5 Argus agents has a static prompt file defining its role, methodology, and tool instructions:
347
+ Each of the 6 Argus agents has a static prompt file defining its role, methodology, and tool instructions:
343
348
 
344
349
  - `src/agents/argus-prompt.ts` — Orchestrator methodology (7-step audit framework)
345
350
  - `src/agents/sentinel-prompt.ts` — Static analysis & testing instructions
346
351
  - `src/agents/pythia-prompt.ts` — Vulnerability research methodology
352
+ - `src/agents/audit-specialist-prompt.ts` — Profile-driven adversarial review methodology
347
353
  - `src/agents/scribe-prompt.ts` — Report generation format and structure
348
354
  - `src/agents/themis-prompt.ts` — Independent validation and quality gate logic
349
355
 
@@ -358,7 +364,7 @@ The `experimental.chat.system.transform` hook injects dynamic audit state into t
358
364
  - Tools executed and their results
359
365
  - Session-specific audit state (contract under review, scope, etc.)
360
366
 
361
- **Critical Rule:** This hook is **Argus-family gated**. Only agents in `{argus, sentinel, pythia, scribe, themis}` receive injected context. All other agents receive `undefined` (no injection).
367
+ **Critical Rule:** This hook is **Argus-family gated**. Only agents in `{argus, sentinel, pythia, audit-specialist, scribe, themis}` receive injected context. All other agents receive `undefined` (no injection).
362
368
 
363
369
  **Session→Agent Mapping Pattern:**
364
370
  1. `chat.params` hook captures `(sessionID, agentName)` pairs during each turn
@@ -373,9 +379,9 @@ Agents load specialized knowledge on-demand via the `argus_skill_load` tool:
373
379
 
374
380
  - **Vulnerability Patterns** — 51 SKILL.md files covering reentrancy, oracle manipulation, flash loans, etc.
375
381
  - **Protocol Patterns** — 5 files for AMM/DEX, bridges, governance, lending, staking
376
- - **Methodology** — 3 files for audit workflow, report templates, severity classification
382
+ - **Methodology** — 11 files for audit workflow, report templates, severity classification, and specialist profiles
377
383
  - **Checklists** — 6 Cyfrin audit checklists
378
- - **References** — 2 files for exploit index and vulnerable contract examples
384
+ - **References** — 3 files for exploit index, vulnerable contract examples, and attack-vector deck
379
385
 
380
386
  This channel is **lazy-loaded** — agents request skills only when needed, reducing context overhead.
381
387
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "solidity-argus",
3
- "version": "0.5.10",
4
- "description": "Solidity smart contract security auditing plugin for OpenCode — 5 specialized agents, 16 tools (15 core + optional Solodit), and a curated vulnerability knowledge base",
3
+ "version": "0.6.1",
4
+ "description": "Solidity smart contract security auditing plugin for OpenCode — 6 specialized agents, 16 tools (15 core + optional Solodit), and a curated vulnerability knowledge base",
5
5
  "keywords": [
6
6
  "solidity",
7
7
  "security",
@@ -1,7 +1,7 @@
1
1
  # Argus Knowledge Base Inventory
2
2
 
3
3
  Generated: 2026-02-20
4
- Total SKILL.md files: 82
4
+ Total SKILL.md files: 91
5
5
 
6
6
  ## Vulnerability Patterns
7
7
  | File | Source(s) | Topic | Word Count |
@@ -65,6 +65,18 @@ Total SKILL.md files: 82
65
65
  | methodology/report-template/SKILL.md | DeFiFoFum | Audit Report Template | 585 |
66
66
  | methodology/severity-classification/SKILL.md | DeFiFoFum | Severity Classification Guide | 603 |
67
67
 
68
+ ## Specialist Profiles
69
+ | File | Source(s) | Topic | Word Count |
70
+ |------|-----------|-------|------------|
71
+ | specialist-profiles/access-control-specialist/SKILL.md | Argus | Access Control Specialist Profile | 190 |
72
+ | specialist-profiles/economic-security/SKILL.md | Argus | Economic Security Profile | 190 |
73
+ | specialist-profiles/execution-trace/SKILL.md | Argus | Execution Trace Profile | 180 |
74
+ | specialist-profiles/first-principles/SKILL.md | Argus | First Principles Profile | 170 |
75
+ | specialist-profiles/invariant/SKILL.md | Argus | Invariant Profile | 170 |
76
+ | specialist-profiles/math-precision/SKILL.md | Argus | Math Precision Profile | 190 |
77
+ | specialist-profiles/periphery/SKILL.md | Argus | Periphery Profile | 175 |
78
+ | specialist-profiles/vector-scan/SKILL.md | Argus | Vector Scan Profile | 150 |
79
+
68
80
  ## Protocol Patterns
69
81
  | File | Source(s) | Topic | Word Count |
70
82
  |------|-----------|-------|------------|
@@ -89,6 +101,7 @@ Total SKILL.md files: 82
89
101
  |------|-----------|-------|------------|
90
102
  | references/exploit-reference/SKILL.md | SunWeb3Sec | DeFi Exploit Reference Index | 1125 |
91
103
  | references/smartbugs-examples/SKILL.md | smartbugs | SmartBugs Curated Dataset — Vulnerable Contract Examples | 1677 |
104
+ | references/attack-vector-deck/SKILL.md | Argus | Attack-Vector Deck | 520 |
92
105
 
93
106
  ## Case Studies
94
107
  | File | Source(s) | Topic | Word Count |
package/skills/README.md CHANGED
@@ -9,9 +9,10 @@ OpenCode Skills System
9
9
  ├── skills/ (bundled with plugin)
10
10
  │ ├── vulnerability-patterns/ (51 patterns from kadenzipfel + DeFiFoFum + BailSec + Argus)
11
11
  │ ├── methodology/ (3 files from DeFiFoFum)
12
+ │ ├── specialist-profiles/ (8 profile skills for audit-specialist)
12
13
  │ ├── protocol-patterns/ (5 files from DeFiFoFum)
13
14
  │ ├── checklists/ (6 files from DeFiFoFum + Cyfrin)
14
- │ ├── references/ (2 files: SmartBugs + DeFiHackLabs)
15
+ │ ├── references/ (3 files: SmartBugs + DeFiHackLabs + attack-vector deck)
15
16
  │ └── case-studies/ (15 case studies from DeFiFoFum)
16
17
  ├── SCVD Local Index (~/.cache/solidity-argus/scvd-index.json)
17
18
  │ └── 7,769+ findings, auto-synced from api.scvd.dev
@@ -37,6 +38,7 @@ All sources in the table below must include the following metadata in their SKIL
37
38
  | SunWeb3Sec/DeFiHackLabs | Reference only | https://github.com/SunWeb3Sec/DeFiHackLabs | 15 exploit PoC GitHub URL references |
38
39
  | BailSec | CC0 | https://github.com/bailsec/BailSec | Vulnerability patterns extracted from professional audit PDFs |
39
40
  | SCVD (api.scvd.dev) | CC0 | https://api.scvd.dev | 7,769+ findings via local index (auto-synced) |
41
+ | Argus specialist profiles | MIT | https://github.com/Apegurus/solidity-argus | 8 profile skills and one attack-vector deck for deep/adversarial audit passes |
40
42
 
41
43
  ## SKILL.md Format Specification
42
44
 
@@ -119,4 +121,4 @@ detection_rules:
119
121
 
120
122
  ## Inventory
121
123
 
122
- See [INVENTORY.md](./INVENTORY.md) for a complete listing of all 82 SKILL.md files currently bundled with Argus.
124
+ See [INVENTORY.md](./INVENTORY.md) for a complete listing of all 91 SKILL.md files currently bundled with Argus.
@@ -0,0 +1,62 @@
1
+ ---
2
+ name: attack-vector-deck
3
+ description: Compact catalogue of concrete Solidity vulnerability vectors with detection cues and false-positive guards.
4
+ category: reference
5
+ source_url: https://github.com/Apegurus/solidity-argus
6
+ source_license: MIT
7
+ imported_at: "2026-05-18T00:00:00Z"
8
+ ---
9
+
10
+ # Attack-Vector Deck
11
+
12
+ Use this as a review catalogue, not as an automatic finding source. A vector becomes a finding only after proving reachability, missing guard or broken accounting, and impact in the reviewed code.
13
+
14
+ ## Vectors
15
+
16
+ **1. Unprotected Privileged State Change**
17
+ - **D:** External/public function mutates admin-controlled state without a role, owner, governance, or contract-only guard.
18
+ - **FP:** The function is reachable only during construction/initialization or guarded by an equivalent custom authorization check.
19
+
20
+ **2. Initializer or Upgrade Authority Takeover**
21
+ - **D:** Proxy implementation, initializer, upgrade function, or ownership transfer can be called by an unintended account or more than once.
22
+ - **FP:** Initializer is disabled on the implementation and proxy initialization is atomic with deployment.
23
+
24
+ **3. Share or Reward Accumulator Drift**
25
+ - **D:** Deposits, withdrawals, reward-rate changes, or supply changes occur without settling global/user accumulators first.
26
+ - **FP:** Every state-changing path checkpoints both global and user state before mutating rates, balances, or supply.
27
+
28
+ **4. Decimal or Scale Mismatch**
29
+ - **D:** Assets, oracle prices, shares, or rewards with different decimals are multiplied/divided without explicit normalization.
30
+ - **FP:** Code normalizes all operands to a documented common scale before arithmetic.
31
+
32
+ **5. Rounding Direction Value Leak**
33
+ - **D:** Mint/redeem/borrow/liquidate paths round in the user's favor across repeatable operations.
34
+ - **FP:** Rounding direction is explicit, bounded, and unfavorable to the caller where value can be extracted.
35
+
36
+ **6. Callback or Reentrancy State Desynchronization**
37
+ - **D:** External calls, token hooks, receiver callbacks, or low-level calls occur before all dependent state is finalized.
38
+ - **FP:** Reentrancy guard plus checks-effects-interactions cover every callable path sharing the same state.
39
+
40
+ **7. Oracle or Spot Price Manipulation**
41
+ - **D:** Critical mint/borrow/liquidation/swap logic uses spot AMM reserves or a manipulable single-source price.
42
+ - **FP:** Price source is TWAP/medianized/bounded and stale/manipulated values are rejected.
43
+
44
+ **8. Fee-On-Transfer or Rebasing Token Desync**
45
+ - **D:** Protocol credits requested transfer amounts instead of observed balance deltas for arbitrary ERC20s.
46
+ - **FP:** Accounting uses pre/post balance deltas or the token set is strictly allowlisted to standard behavior.
47
+
48
+ **9. Cross-Chain Message Spoofing or Replay**
49
+ - **D:** Receiver accepts messages without validating endpoint, chain/domain, registered peer, nonce, or replay status.
50
+ - **FP:** Endpoint, origin, chain/domain, and replay protection are all enforced before effects.
51
+
52
+ **10. Queue or Async Flow Parameter Divergence**
53
+ - **D:** Request parameters are stored, transformed, or fulfilled later with mutable global parameters that can drift unfairly.
54
+ - **FP:** The request snapshots all price/rate/limit parameters needed for fair fulfillment.
55
+
56
+ **11. Periphery Encoder or Adapter Semantic Mismatch**
57
+ - **D:** Helper, router, adapter, or library changes calldata/order/units/trust assumptions relative to the core contract.
58
+ - **FP:** Adapter invariants are documented and tested against the core contract's expected semantics.
59
+
60
+ **12. Invariant Broken by Donation or Direct Transfer**
61
+ - **D:** Accounting assumes token balance equals internal tracked balance, but anyone can transfer assets directly.
62
+ - **FP:** Conversions use internal accounting or explicitly handle unsolicited balance changes.
@@ -0,0 +1,31 @@
1
+ ---
2
+ name: access-control-specialist
3
+ description: Specialist profile for roles, modifiers, initialization, upgrade authority, and guard consistency review.
4
+ category: methodology
5
+ source_url: https://github.com/Apegurus/solidity-argus
6
+ source_license: MIT
7
+ imported_at: "2026-05-18T00:00:00Z"
8
+ ---
9
+
10
+ # Access Control Specialist Profile
11
+
12
+ ## Objective
13
+ Find authorization gaps, inconsistent guards, initialization takeovers, upgrade authority mistakes, and privileged flows that can be abused.
14
+
15
+ ## Attack Surfaces
16
+ Owners, roles, multisigs, governance executors, keepers, pausers, upgraders, initializers, factories, delegates, and adapter-only entry points.
17
+
18
+ ## Reading Pattern
19
+ 1. List every external/public state-changing function.
20
+ 2. Map each function to its intended actor and actual guard.
21
+ 3. Trace initialization and upgrade paths separately.
22
+ 4. Compare similar functions for missing or weaker modifiers.
23
+
24
+ ## Recommended Skills
25
+ Load `access-control`, `proxy-vulnerabilities`, `cyfrin-best-practices-upgrades`, and `governance-attacks` when relevant.
26
+
27
+ ## Proof Fields
28
+ Include caller identity, target function, missing/incorrect guard, state change reached, and security impact.
29
+
30
+ ## False-Positive Cautions
31
+ Public functions are not bugs if intentionally permissionless and bounded by economic or state constraints.
@@ -0,0 +1,31 @@
1
+ ---
2
+ name: economic-security
3
+ description: Specialist profile for external dependencies, token behavior, incentives, oracle assumptions, and value-flow attacks.
4
+ category: methodology
5
+ source_url: https://github.com/Apegurus/solidity-argus
6
+ source_license: MIT
7
+ imported_at: "2026-05-18T00:00:00Z"
8
+ ---
9
+
10
+ # Economic Security Profile
11
+
12
+ ## Objective
13
+ Find attacks where the code is locally correct but economically exploitable through prices, incentives, liquidity, token behavior, governance, or integration assumptions.
14
+
15
+ ## Attack Surfaces
16
+ AMM reserves, oracle feeds, collateral values, liquidation incentives, reward emissions, fee paths, arbitrary ERC20 integrations, governance power, and flash-loan-amplified flows.
17
+
18
+ ## Reading Pattern
19
+ 1. Trace all value flows into and out of the protocol.
20
+ 2. Identify assumptions about price, liquidity, token behavior, and participant incentives.
21
+ 3. Ask whether capital, same-block execution, or governance power can bend those assumptions.
22
+ 4. Search historical precedents when the shape matches known DeFi exploits.
23
+
24
+ ## Recommended Skills
25
+ Load `oracle-manipulation`, `flash-loan-attacks`, `weird-tokens`, `unsafe-erc20-transfers`, `amm-dex`, and `lending-borrowing` as needed.
26
+
27
+ ## Proof Fields
28
+ Include dependency manipulated, attack capital/sequence, resulting mispricing or incentive break, and value impact.
29
+
30
+ ## False-Positive Cautions
31
+ Do not report generic centralization or market risk unless a code path makes the risk exploitable or materially worse.
@@ -0,0 +1,31 @@
1
+ ---
2
+ name: execution-trace
3
+ description: Specialist profile for stale reads, parameter divergence, branch ordering, callbacks, and cross-transaction interleavings.
4
+ category: methodology
5
+ source_url: https://github.com/Apegurus/solidity-argus
6
+ source_license: MIT
7
+ imported_at: "2026-05-18T00:00:00Z"
8
+ ---
9
+
10
+ # Execution Trace Profile
11
+
12
+ ## Objective
13
+ Find bugs that appear only when execution order, callbacks, stale reads, queued requests, or multi-transaction interleavings are traced precisely.
14
+
15
+ ## Attack Surfaces
16
+ External calls, token hooks, receiver callbacks, routers, queues, delayed settlement, permit/signature flows, and multi-step lifecycle functions.
17
+
18
+ ## Reading Pattern
19
+ 1. Trace each critical function as ordered reads, checks, effects, and interactions.
20
+ 2. Mark every value read before an external call and used after it.
21
+ 3. Identify stored request parameters and mutable globals used during later fulfillment.
22
+ 4. Consider same-block and cross-transaction ordering attacks.
23
+
24
+ ## Recommended Skills
25
+ Load `reentrancy`, `front-running-attacks`, `dos-revert`, `missing-protection-signature-replay`, and `unbounded-return-data` when relevant.
26
+
27
+ ## Proof Fields
28
+ Include ordered trace, stale/divergent value, attacker-controlled step, and state/asset impact.
29
+
30
+ ## False-Positive Cautions
31
+ Callbacks are not vulnerabilities by themselves; show the callback can observe or mutate shared state in a harmful way.
@@ -0,0 +1,31 @@
1
+ ---
2
+ name: first-principles
3
+ description: Specialist profile for line-by-line assumption extraction without relying on named bug classes.
4
+ category: methodology
5
+ source_url: https://github.com/Apegurus/solidity-argus
6
+ source_license: MIT
7
+ imported_at: "2026-05-18T00:00:00Z"
8
+ ---
9
+
10
+ # First Principles Profile
11
+
12
+ ## Objective
13
+ Ignore vulnerability taxonomies at first. Extract what the code assumes must be true, then search for any caller, state, or dependency that makes an assumption false.
14
+
15
+ ## Attack Surfaces
16
+ Any high-value, unfamiliar, or highly coupled code path; especially systems where named bug patterns do not fully describe the risk.
17
+
18
+ ## Reading Pattern
19
+ 1. For each critical function, list assumptions about caller, state, timing, external contracts, balances, prices, and previous calls.
20
+ 2. For each assumption, ask who can falsify it and at what cost.
21
+ 3. Build minimal violating sequences.
22
+ 4. Only map the result back to a named bug class after proof exists.
23
+
24
+ ## Recommended Skills
25
+ Load `audit-context-building`, `logic-errors`, `general-audit`, and `attack-vector-deck` when broad context is needed.
26
+
27
+ ## Proof Fields
28
+ Include assumption, falsification path, code location, state transition, and impact.
29
+
30
+ ## False-Positive Cautions
31
+ Do not record philosophical concerns. Convert assumptions into concrete reachable failures.
@@ -0,0 +1,31 @@
1
+ ---
2
+ name: invariant
3
+ description: Specialist profile for extracting conservation laws and state couplings, then searching for violating paths.
4
+ category: methodology
5
+ source_url: https://github.com/Apegurus/solidity-argus
6
+ source_license: MIT
7
+ imported_at: "2026-05-18T00:00:00Z"
8
+ ---
9
+
10
+ # Invariant Profile
11
+
12
+ ## Objective
13
+ Derive the protocol's core invariants and find reachable sequences that violate them.
14
+
15
+ ## Attack Surfaces
16
+ Mint/burn symmetry, total assets versus shares, collateral versus debt, reward accumulators, escrow balances, queued requests, and role lifecycle state.
17
+
18
+ ## Reading Pattern
19
+ 1. State each invariant in plain language and as an equation when possible.
20
+ 2. Map every function that mutates each variable in the invariant.
21
+ 3. Search for paths that update only one side of the coupling.
22
+ 4. Use tests or fuzzing when a violation can be encoded cheaply.
23
+
24
+ ## Recommended Skills
25
+ Load `property-based-testing`, `share-accounting-desynchronization`, and protocol-specific skills such as `lending-borrowing` or `staking-vesting`.
26
+
27
+ ## Proof Fields
28
+ Include invariant statement, violating path, concrete state before and after, and impact.
29
+
30
+ ## False-Positive Cautions
31
+ An invariant must reflect intended protocol behavior, not an assumption imposed by the reviewer.
@@ -0,0 +1,31 @@
1
+ ---
2
+ name: math-precision
3
+ description: Specialist profile for rounding, scale, decimal, downcast, and arithmetic accounting edge cases.
4
+ category: methodology
5
+ source_url: https://github.com/Apegurus/solidity-argus
6
+ source_license: MIT
7
+ imported_at: "2026-05-18T00:00:00Z"
8
+ ---
9
+
10
+ # Math Precision Profile
11
+
12
+ ## Objective
13
+ Find arithmetic bugs that leak value, distort accounting, or break protocol invariants through rounding, scale mismatch, decimal mismatch, downcasts, and stale accumulators.
14
+
15
+ ## Attack Surfaces
16
+ Share conversions, reward math, fee math, collateral factors, liquidation discounts, oracle scaling, vesting schedules, and accumulator updates.
17
+
18
+ ## Reading Pattern
19
+ 1. Write the unit/scale next to every value in each formula.
20
+ 2. Identify every division and rounding direction.
21
+ 3. Check whether the caller can repeat a favorable rounding path.
22
+ 4. Compare internal accounting against actual token balances.
23
+
24
+ ## Recommended Skills
25
+ Load `lack-of-precision`, `share-accounting-desynchronization`, `erc4626-exchange-rate-manipulation`, and `stateful-parameter-update-drift` when applicable.
26
+
27
+ ## Proof Fields
28
+ Include concrete numbers, before/after balances, rounding direction, repeatability, and value impact.
29
+
30
+ ## False-Positive Cautions
31
+ Dust-level loss is not a security finding unless repeatable, griefable, or able to accumulate into material loss.
@@ -0,0 +1,31 @@
1
+ ---
2
+ name: periphery
3
+ description: Specialist profile for libraries, helpers, base contracts, adapters, encoders, wrappers, and integration glue.
4
+ category: methodology
5
+ source_url: https://github.com/Apegurus/solidity-argus
6
+ source_license: MIT
7
+ imported_at: "2026-05-18T00:00:00Z"
8
+ ---
9
+
10
+ # Periphery Profile
11
+
12
+ ## Objective
13
+ Find bugs hidden in supporting code that changes semantics before calls reach core contracts.
14
+
15
+ ## Attack Surfaces
16
+ Libraries, inherited base contracts, routers, adapters, wrappers, encoders, factories, deployment scripts, allowlists, and helper math.
17
+
18
+ ## Reading Pattern
19
+ 1. Identify all code that prepares, wraps, routes, or translates calls to core contracts.
20
+ 2. Compare units, address assumptions, calldata layout, and access checks between periphery and core.
21
+ 3. Search for differences between direct core calls and periphery-mediated calls.
22
+ 4. Check inherited hooks and overridden functions for unexpected side effects.
23
+
24
+ ## Recommended Skills
25
+ Load `logic-errors`, `unsafe-erc20-transfers`, `incorrect-inheritance-order`, and protocol integration skills as needed.
26
+
27
+ ## Proof Fields
28
+ Include periphery path, semantic mismatch, affected core call, and exploit impact.
29
+
30
+ ## False-Positive Cautions
31
+ Periphery bugs matter when users, integrations, or privileged flows actually rely on the periphery path.
@@ -0,0 +1,28 @@
1
+ ---
2
+ name: vector-scan
3
+ description: Specialist profile for mechanically applying the attack-vector deck and classifying vectors as skip, drop, or investigate.
4
+ category: methodology
5
+ source_url: https://github.com/Apegurus/solidity-argus
6
+ source_license: MIT
7
+ imported_at: "2026-05-18T00:00:00Z"
8
+ ---
9
+
10
+ # Vector Scan Profile
11
+
12
+ ## Objective
13
+ Apply `attack-vector-deck` across the scoped code and force every relevant vector into `skip`, `drop`, or `investigate`.
14
+
15
+ ## Reading Pattern
16
+ 1. Load `attack-vector-deck`.
17
+ 2. Map contracts by asset custody, privileged controls, external calls, oracle use, and async flows.
18
+ 3. For each vector, cite the concrete functions reviewed.
19
+ 4. Promote only proven `investigate` items to `FINDING`; return incomplete trails as `LEAD`.
20
+
21
+ ## Recommended Skills
22
+ Load `general-audit`, `access-control`, `reentrancy`, `oracle-manipulation`, or protocol-specific skills only when the vector points at that domain.
23
+
24
+ ## Proof Fields
25
+ Include vector number, path, missing guard or broken invariant, concrete exploit sequence, and impact.
26
+
27
+ ## False-Positive Cautions
28
+ Do not record a finding from vector similarity alone. Prove the vector applies to reachable production code.