| name | security-review |
| description | Comprehensive security audit of SaThuCoin contract, dependencies, deployment scripts, and scraper code. Only invoke manually — never auto-trigger. |
| disable-model-invocation | true |
| user-invocable | true |
| allowed-tools | Read, Grep, Glob, Bash(npm audit), Bash(npm list *), Bash(npm run compile), Bash(npm run test:gas) |
| argument-hint | [scope: all | contract | deps | deploy | scraper] |
/security-review — SaThuCoin Security Audit
Perform a methodical, comprehensive security review of the SaThuCoin project.
This is a read-only audit. Do not modify any files. Report findings only.
Scope Selection
Parse $ARGUMENTS to determine review scope:
| Argument | Scope | Domains Audited |
|---|
(empty) or all | Full project | A + B + C + D + E + F |
contract | Smart contract | A only |
deps | Dependencies | C only |
deploy | Deployment scripts | B + E |
scraper | Scraper/minter | D + E |
Domain A: Smart Contract Audit
Files to read: contracts/SaThuCoin.sol, test/SaThuCoin.test.js
Reference: docs/SaThuCoin comprehensive security deep dive.md (sections 1-2)
A1. Access Control (CRITICAL)
Search for anti-patterns:
Grep for: tx.origin
Grep for: function.*public|external (verify each has access control or is view/pure)
A2. Token Economics (CRITICAL)
Search for:
Grep in contracts/: _mint
Grep in contracts/: _burn
Grep in contracts/: totalSupply
A3. Emergency Controls (HIGH)
A4. Code Quality (MEDIUM)
A5. Inheritance & Overrides (HIGH when multi-inheritance)
A6. Test Coverage Assessment (HIGH)
Read test/SaThuCoin.test.js and verify:
Domain B: Deployment Script Audit
Files to read: scripts/deploy.js, scripts/verify.js, hardhat.config.js
Reference: Gap Analysis (section 2.4)
B1. Secret Handling (CRITICAL)
Search for:
Grep in scripts/: 0x[a-fA-F0-9]{64} (private key pattern)
Grep in scripts/: hardcoded|password|secret|mnemonic
Grep in scripts/: console.log
B2. Deployment Safety (HIGH)
B3. Network Configuration (MEDIUM)
Read hardhat.config.js:
Domain C: Dependency / Supply Chain Audit
Files to read: package.json, package-lock.json, .npmrc (if exists)
Reference: Security Deep Dive section 3, Security Rules "npm Supply Chain"
C1. Version Pinning (CRITICAL)
Read package.json and check:
C2. Dependency Hygiene (HIGH)
C3. Package Verification (HIGH)
For each dependency, verify:
Known high-risk npm incidents to be aware of:
- September 2025 "Qix" attack (chalk, debug, supports-color)
- September-November 2025 "Shai-Hulud" worm (500+ packages)
- February 2026 dYdX package compromise
Domain D: Scraper / Minter Audit (Phase 4+)
Files to read: scraper/**/*.js, cli/**/*.js (if they exist)
Reference: Security Deep Dive sections 3-5, Project Plan Phases 5-7
D1. Address Validation (CRITICAL)
D2. Minting Controls (CRITICAL)
D3. Key Handling (CRITICAL)
Grep in scraper/: PRIVATE_KEY
Grep in scraper/: console.log
D4. Nonce Management (HIGH)
D5. RPC Security (HIGH)
D6. Error Handling (MEDIUM)
Domain E: Configuration & Secrets Audit
Files to search: entire repo
Reference: Security Rules "Secrets & Key Management"
E1. Gitignore Coverage (CRITICAL)
Read .gitignore and verify:
E2. Git History (CRITICAL)
Bash: git log --all --diff-filter=A -- "*.env" ".env*"
E3. Config File Safety (HIGH)
Read all files in config/:
Domain F: AI Agent Security Audit
Files to read: .claude/CLAUDE.md, .claude/settings.json, .claude/rules/*.md, .claude/hooks/*
Reference: Security Deep Dive section 6, Security Rules "AI Agent Security"
F1. Agent Permissions (HIGH)
Read .claude/settings.json:
F2. Post-Edit Hooks (MEDIUM)
Read .claude/hooks/post-edit.sh:
F3. Security Rules (MEDIUM)
Read .claude/rules/security.md:
Report Format
After completing all applicable domain checks, produce a report in this structure:
# SaThuCoin Security Review Report
**Date:** [current date]
**Scope:** [what was reviewed]
**Reviewer:** Claude Code /security-review skill
## Summary
- CRITICAL findings: [count]
- HIGH findings: [count]
- MEDIUM findings: [count]
- LOW/INFO findings: [count]
## Findings
### [SEVERITY] Finding Title
- **Domain:** [A/B/C/D/E/F]
- **File:** [file path:line number]
- **Description:** [what's wrong]
- **Risk:** [what could happen]
- **Recommendation:** [how to fix]
- **Reference:** [link to relevant security doc section]
[Repeat for each finding...]
## Checklist Results
[Domain A checklist with pass/fail marks]
[Domain B checklist with pass/fail marks]
[...]
## Recommendations (Prioritized)
1. [Most critical action]
2. [Next most critical]
3. [...]
Important Notes
- This skill is read-only. Do NOT modify any files.
- Report ALL findings, even if they were previously identified in the gap analysis.
- For each finding, provide the specific file and line number.
- Cross-reference findings against
docs/SaThuCoin comprehensive security deep dive.md to check if the project follows its own security recommendations.
- The gap between documentation and implementation is itself a finding.