external/trailofbits-skills-curated/plugins/scv-scan/skills/scv-scan/SKILL.md
Audits Solidity codebases for smart contract vulnerabilities using a four-phase workflow (cheatsheet loading, codebase sweep, deep validation, reporting) covering 36 vulnerability classes. Use when auditing Solidity contracts for security issues, performing smart contract vulnerability scans, or reviewing Solidity code for common exploit patterns.
npx skillsauth add seikaikyo/dash-skills scv-scanInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Systematically audit a Solidity codebase for vulnerabilities using a four-phase approach that balances thoroughness with efficiency.
unchecked blocks, assembly, and type downcasts still wrap_safeMint, ERC1155 safe transfers, and ERC777 hooks all trigger callbacksinitialize() without initializer modifier is itself a critical vulnerabilityreferences/
CHEATSHEET.md # Condensed pattern reference — always read first
reentrancy.md # Full reference files — read selectively in Phase 3
overflow-underflow.md
...
Each full reference file in references/ has these sections:
Before touching any Solidity files, read {baseDir}/skills/scv-scan/references/CHEATSHEET.md in full.
This file contains a condensed entry for every known vulnerability class: name, what to look for (syntactic and semantic), and default severity. Internalize these patterns — they are your detection surface for the sweep phase. Do NOT read any full reference files yet.
Perform two complementary passes over the codebase.
Search for the trigger patterns listed in the cheatsheet under "Grep-able keywords". Use grep or ripgrep to find matches.
For each match, record: file, line number(s), matched pattern, and suspected vulnerability type(s).
This pass catches vulnerabilities that have no reliable grep signature. Read through the codebase searching for any relevant logic similar to that explained in the cheatsheet.
For each finding in this pass, record: file, line number(s), description of the concern, and suspected vulnerability type(s).
Merge results from Pass A and Pass B into a deduplicated candidate list. Each entry should look like:
- File: `path/to/file.sol` L{start}-L{end}
- Suspected: [vulnerability-name] (from CHEATSHEET.md)
- Evidence: [brief description of what was found]
For each candidate in the list:
{baseDir}/skills/scv-scan/references/reentrancy.md). Read it now — not before.For each confirmed finding, output:
### [Vulnerability Name]
**File:** `path/to/file.sol` L{start}-L{end}
**Severity:** Critical | High | Medium | Low | Informational
**Description:** What is vulnerable and why, in 1-3 sentences.
**Code:**
```solidity
// The vulnerable code snippet
Recommendation: Specific fix, referencing the Remediation section of the reference file.
After all findings, include a summary section:
| Severity | Count | |----------|-------| | Critical | N | | High | N | | Medium | N | | Low | N | | Info | N |
Write the final report to `scv-scan.md`.
## Severity Guidelines
- **Critical**: Direct loss of funds, unauthorized fund extraction, permanent freezing of funds
- **High**: Conditional fund loss, access control bypass, state corruption exploitable under realistic conditions
- **Medium**: Unlikely fund loss, griefing attacks, DoS on non-critical paths, value leak under edge conditions
- **Low**: Best practice violations, gas inefficiency, code quality issues with no direct exploit path
- **Informational**: Unused variables, style issues, documentation gaps
## Key Principles
- **Cheatsheet first, references on-demand.** Never read all full reference files upfront. The cheatsheet gives you ambient awareness; full references are for validation only.
- **Semantic > syntactic.** The hardest bugs don't grep. Cross-function reentrancy, missing access control, incorrect inheritance — these require reading and reasoning, not pattern matching.
- **Trace across boundaries.** Follow state across function calls, contract calls, and inheritance chains. Hidden external calls (safe mint/transfer hooks, ERC-777 callbacks) are as dangerous as explicit `.call()`.
- **One location, multiple bugs.** A single line can be vulnerable to reentrancy AND unchecked return value. Check all applicable references.
- **Version matters.** Always check `pragma solidity` — many vulnerabilities are version-dependent (e.g., overflow is checked by default in >=0.8.0).
- **False positives are noise.** Be rigorous about checking false positive conditions. A shorter report with high-confidence findings is more valuable than a long one padded with maybes.
development
拋棄式 HTML mockup 比稿:產出 2 到 3 個設計立場不同的變體(密度 / 版式 / 強調軸,不是換色),各附取捨說明,最後給有立場的對比結論。適用:「畫個草圖」「比較 A 版 B 版」「先看方向再做」「給我看幾種做法」。要 production 元件或設計已定案時不適用。
tools
需求不明時的意圖萃取訪談:一次一題、每題附上自己的猜測、聽出「真正想要 vs 覺得應該要」,直到能預測使用者反應(約 95% 信心)才動工。適用:需求缺少對象 / 動機 / 成功標準 / 約束,或使用者點名「訪談我」「先確認一下」「我們確定嗎」。明確自足的指示、純資訊查詢、機械性操作不適用。
development
對非平凡決策啟動新鮮 context 對抗審查(找碴不背書),在修正還便宜的時候抓出錯誤方向。適用:高風險改動(production、資安敏感邏輯、不可逆操作)、不熟的程式碼、要宣稱「這樣是安全的 / 可行的」之前。機械性操作與一行修改不適用。
testing
Reference for writing and editing agent skills well — the vocabulary and principles that make a skill predictable. Consult when authoring, reviewing, or pruning a SKILL.md.