@dilukangelo/web3-ai-skills 1.0.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/README.md +112 -0
- package/bin/cli.js +74 -0
- package/package.json +50 -0
- package/template/.agent/ARCHITECTURE.md +129 -0
- package/template/.agent/GEMINI.md +135 -0
- package/template/.agent/agents/contract-auditor.md +161 -0
- package/template/.agent/agents/rust-web3.md +153 -0
- package/template/.agent/agents/solidity-expert.md +164 -0
- package/template/.agent/agents/web3-frontend.md +192 -0
- package/template/.agent/agents/web3-infra.md +155 -0
- package/template/.agent/agents/web3-orchestrator.md +145 -0
- package/template/.agent/skills/clean-code/SKILL.md +142 -0
- package/template/.agent/skills/dapp-patterns/SKILL.md +184 -0
- package/template/.agent/skills/rainbowkit-wagmi/SKILL.md +262 -0
- package/template/.agent/skills/rpc-optimization/SKILL.md +194 -0
- package/template/.agent/skills/rust-smart-contracts/SKILL.md +202 -0
- package/template/.agent/skills/smart-contract-auditing/SKILL.md +198 -0
- package/template/.agent/skills/solidity-patterns/SKILL.md +192 -0
- package/template/.agent/skills/subgraph-indexing/SKILL.md +225 -0
- package/template/.agent/workflows/audit.md +126 -0
- package/template/.agent/workflows/create-contract.md +134 -0
- package/template/.agent/workflows/create-dapp.md +109 -0
- package/template/.agent/workflows/deploy-contract.md +120 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Run security audit on smart contracts. Automated tools + manual review checklist.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# /audit - Smart Contract Security Audit
|
|
6
|
+
|
|
7
|
+
$ARGUMENTS
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Purpose
|
|
12
|
+
|
|
13
|
+
Run a comprehensive security audit on smart contracts using automated tools and manual review.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Sub-commands
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
/audit - Full audit (automated + manual)
|
|
21
|
+
/audit quick - Slither + Aderyn only
|
|
22
|
+
/audit full - All tools + manual review
|
|
23
|
+
/audit report - Generate audit report from findings
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Audit Workflow
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
┌─────────────────┐
|
|
32
|
+
│ /audit │
|
|
33
|
+
└────────┬────────┘
|
|
34
|
+
│
|
|
35
|
+
▼
|
|
36
|
+
┌─────────────────┐
|
|
37
|
+
│ 1. Scope │ Identify contracts, LOC, dependencies
|
|
38
|
+
└────────┬────────┘
|
|
39
|
+
│
|
|
40
|
+
▼
|
|
41
|
+
┌─────────────────┐
|
|
42
|
+
│ 2. Automated │ Slither → Mythril → Aderyn
|
|
43
|
+
└────────┬────────┘
|
|
44
|
+
│
|
|
45
|
+
▼
|
|
46
|
+
┌─────────────────┐
|
|
47
|
+
│ 3. Manual │ Line-by-line, attack vectors
|
|
48
|
+
└────────┬────────┘
|
|
49
|
+
│
|
|
50
|
+
▼
|
|
51
|
+
┌─────────────────┐
|
|
52
|
+
│ 4. Fuzzing │ Foundry fuzz + Echidna
|
|
53
|
+
└────────┬────────┘
|
|
54
|
+
│
|
|
55
|
+
▼
|
|
56
|
+
┌─────────────────┐
|
|
57
|
+
│ 5. Report │ Findings + recommendations
|
|
58
|
+
└────────┬────────┘
|
|
59
|
+
│
|
|
60
|
+
▼
|
|
61
|
+
┌─────────────────┐
|
|
62
|
+
│ ✅ Complete │
|
|
63
|
+
└─────────────────┘
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Tool Commands
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
# Static Analysis
|
|
72
|
+
slither . --detect all --exclude-low
|
|
73
|
+
aderyn .
|
|
74
|
+
|
|
75
|
+
# Symbolic Execution
|
|
76
|
+
myth analyze contracts/Target.sol --solv 0.8.24
|
|
77
|
+
|
|
78
|
+
# Fuzz Testing
|
|
79
|
+
forge test --fuzz-runs 10000
|
|
80
|
+
|
|
81
|
+
# Gas Report
|
|
82
|
+
forge test --gas-report
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Manual Review Checklist
|
|
88
|
+
|
|
89
|
+
### Critical Checks
|
|
90
|
+
- [ ] Reentrancy (CEI pattern enforced?)
|
|
91
|
+
- [ ] Access control (all admin functions protected?)
|
|
92
|
+
- [ ] Flash loan attack vectors
|
|
93
|
+
- [ ] Oracle manipulation risks
|
|
94
|
+
- [ ] Integer overflow in `unchecked` blocks
|
|
95
|
+
|
|
96
|
+
### High Priority
|
|
97
|
+
- [ ] Front-running vulnerabilities
|
|
98
|
+
- [ ] Signature replay attacks
|
|
99
|
+
- [ ] Delegate call safety
|
|
100
|
+
- [ ] Proxy storage layout
|
|
101
|
+
|
|
102
|
+
### Medium Priority
|
|
103
|
+
- [ ] Centralization risks (single admin key?)
|
|
104
|
+
- [ ] Precision loss in calculations
|
|
105
|
+
- [ ] DoS vectors (unbounded loops?)
|
|
106
|
+
- [ ] Event emission completeness
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## Output: Audit Report
|
|
111
|
+
|
|
112
|
+
```markdown
|
|
113
|
+
# Security Audit Report
|
|
114
|
+
|
|
115
|
+
## Summary
|
|
116
|
+
| Severity | Count |
|
|
117
|
+
|----------|-------|
|
|
118
|
+
| Critical | 0 |
|
|
119
|
+
| High | 1 |
|
|
120
|
+
| Medium | 2 |
|
|
121
|
+
| Low | 3 |
|
|
122
|
+
| Info | 5 |
|
|
123
|
+
|
|
124
|
+
## Findings
|
|
125
|
+
[Detailed findings with severity, description, impact, PoC, and recommendations]
|
|
126
|
+
```
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Scaffold a new smart contract project with Foundry or Hardhat.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# /create-contract - Scaffold Smart Contract Project
|
|
6
|
+
|
|
7
|
+
$ARGUMENTS
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Purpose
|
|
12
|
+
|
|
13
|
+
Scaffold a new smart contract project with testing framework, deployment scripts, and CI configuration.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Sub-commands
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
/create-contract - Interactive wizard
|
|
21
|
+
/create-contract foundry - Foundry project
|
|
22
|
+
/create-contract hardhat - Hardhat project
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Scaffold Wizard
|
|
28
|
+
|
|
29
|
+
### Step 1: Framework
|
|
30
|
+
```
|
|
31
|
+
Which framework?
|
|
32
|
+
1. Foundry — recommended (fast, Solidity tests)
|
|
33
|
+
2. Hardhat — mature (TypeScript tests, plugins)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Step 2: Contract Type
|
|
37
|
+
```
|
|
38
|
+
What type of contract?
|
|
39
|
+
1. ERC-20 Token
|
|
40
|
+
2. ERC-721 NFT
|
|
41
|
+
3. ERC-1155 Multi-Token
|
|
42
|
+
4. ERC-4626 Vault
|
|
43
|
+
5. Governor (Governance)
|
|
44
|
+
6. Custom
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Step 3: Features
|
|
48
|
+
```
|
|
49
|
+
Include? (multi-select)
|
|
50
|
+
1. Upgradeable (UUPS)
|
|
51
|
+
2. Access Control (Ownable / Roles)
|
|
52
|
+
3. Pausable
|
|
53
|
+
4. Permit (Gasless approvals)
|
|
54
|
+
5. Royalties (ERC-2981)
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Generated Structure (Foundry)
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
my-contracts/
|
|
63
|
+
├── src/
|
|
64
|
+
│ ├── MyToken.sol
|
|
65
|
+
│ ├── interfaces/
|
|
66
|
+
│ │ └── IMyToken.sol
|
|
67
|
+
│ └── libraries/
|
|
68
|
+
│ └── MathLib.sol
|
|
69
|
+
├── test/
|
|
70
|
+
│ ├── MyToken.t.sol
|
|
71
|
+
│ └── invariants/
|
|
72
|
+
│ └── MyToken.invariant.sol
|
|
73
|
+
├── script/
|
|
74
|
+
│ └── Deploy.s.sol
|
|
75
|
+
├── foundry.toml
|
|
76
|
+
├── remappings.txt
|
|
77
|
+
├── .env.example
|
|
78
|
+
└── .github/
|
|
79
|
+
└── workflows/
|
|
80
|
+
└── ci.yml
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Generated foundry.toml
|
|
86
|
+
|
|
87
|
+
```toml
|
|
88
|
+
[profile.default]
|
|
89
|
+
src = "src"
|
|
90
|
+
out = "out"
|
|
91
|
+
libs = ["lib"]
|
|
92
|
+
solc = "0.8.24"
|
|
93
|
+
optimizer = true
|
|
94
|
+
optimizer_runs = 200
|
|
95
|
+
via_ir = false
|
|
96
|
+
|
|
97
|
+
[profile.default.fuzz]
|
|
98
|
+
runs = 1000
|
|
99
|
+
max_test_rejects = 65536
|
|
100
|
+
|
|
101
|
+
[profile.default.invariant]
|
|
102
|
+
runs = 256
|
|
103
|
+
depth = 15
|
|
104
|
+
|
|
105
|
+
[fmt]
|
|
106
|
+
bracket_spacing = true
|
|
107
|
+
int_types = "long"
|
|
108
|
+
line_length = 120
|
|
109
|
+
multiline_func_header = "attributes_first"
|
|
110
|
+
number_underscore = "thousands"
|
|
111
|
+
quote_style = "double"
|
|
112
|
+
tab_width = 4
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Post-Scaffold
|
|
118
|
+
|
|
119
|
+
```markdown
|
|
120
|
+
## ✅ Contract Project Created!
|
|
121
|
+
|
|
122
|
+
### Quick Start
|
|
123
|
+
1. `cp .env.example .env`
|
|
124
|
+
2. Add deployer private key and RPC URLs
|
|
125
|
+
3. `forge build` — compile
|
|
126
|
+
4. `forge test` — run tests
|
|
127
|
+
5. `forge script script/Deploy.s.sol --rpc-url $RPC_URL --broadcast` — deploy
|
|
128
|
+
|
|
129
|
+
### Next Steps
|
|
130
|
+
- [ ] Write contract logic
|
|
131
|
+
- [ ] Add comprehensive tests (unit + fuzz + invariant)
|
|
132
|
+
- [ ] Run `/audit` before deploying
|
|
133
|
+
- [ ] Deploy to testnet first
|
|
134
|
+
```
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Scaffold a new DApp with wallet integration, contract hooks, and multi-chain support.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# /create-dapp - Scaffold New DApp
|
|
6
|
+
|
|
7
|
+
$ARGUMENTS
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Purpose
|
|
12
|
+
|
|
13
|
+
Scaffold a complete DApp frontend with wallet connection, contract interaction, and multi-chain configuration.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Sub-commands
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
/create-dapp - Interactive DApp wizard
|
|
21
|
+
/create-dapp next - Next.js + RainbowKit
|
|
22
|
+
/create-dapp vite - Vite + RainbowKit
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Scaffold Wizard
|
|
28
|
+
|
|
29
|
+
### Step 1: Framework
|
|
30
|
+
```
|
|
31
|
+
Which framework?
|
|
32
|
+
1. Next.js 15 (App Router) — recommended
|
|
33
|
+
2. Vite + React
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Step 2: Wallet Kit
|
|
37
|
+
```
|
|
38
|
+
Which wallet integration?
|
|
39
|
+
1. RainbowKit — recommended (beautiful, customizable)
|
|
40
|
+
2. ConnectKit — minimal
|
|
41
|
+
3. Privy — embedded wallets + social login
|
|
42
|
+
4. Dynamic — enterprise
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Step 3: Chains
|
|
46
|
+
```
|
|
47
|
+
Which chains? (multi-select)
|
|
48
|
+
1. Ethereum
|
|
49
|
+
2. Polygon
|
|
50
|
+
3. Arbitrum
|
|
51
|
+
4. Base
|
|
52
|
+
5. Optimism
|
|
53
|
+
6. Monad
|
|
54
|
+
7. Custom chain
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Step 4: Features
|
|
58
|
+
```
|
|
59
|
+
Include? (multi-select)
|
|
60
|
+
1. SIWE (Sign-In with Ethereum)
|
|
61
|
+
2. Contract interaction hooks
|
|
62
|
+
3. ENS resolution
|
|
63
|
+
4. Token gating
|
|
64
|
+
5. Dark mode
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Generated Structure
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
my-dapp/
|
|
73
|
+
├── app/
|
|
74
|
+
│ ├── layout.tsx # Root + Providers
|
|
75
|
+
│ ├── page.tsx # Landing
|
|
76
|
+
│ └── providers.tsx # Wagmi + Rainbow + Query
|
|
77
|
+
├── components/
|
|
78
|
+
│ ├── ConnectButton.tsx
|
|
79
|
+
│ └── TransactionButton.tsx
|
|
80
|
+
├── hooks/
|
|
81
|
+
│ └── useContract.ts
|
|
82
|
+
├── lib/
|
|
83
|
+
│ ├── wagmi.ts # Config
|
|
84
|
+
│ ├── chains.ts # Chain definitions
|
|
85
|
+
│ └── contracts.ts # ABIs + addresses
|
|
86
|
+
├── .env.example
|
|
87
|
+
├── package.json
|
|
88
|
+
└── next.config.ts
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Post-Scaffold
|
|
94
|
+
|
|
95
|
+
```markdown
|
|
96
|
+
## ✅ DApp Scaffolded!
|
|
97
|
+
|
|
98
|
+
### Quick Start
|
|
99
|
+
1. `cp .env.example .env.local`
|
|
100
|
+
2. Add your WalletConnect Project ID
|
|
101
|
+
3. Add your RPC URLs
|
|
102
|
+
4. `npm run dev`
|
|
103
|
+
|
|
104
|
+
### Next Steps
|
|
105
|
+
- [ ] Add contract ABIs to `lib/contracts.ts`
|
|
106
|
+
- [ ] Create contract interaction pages
|
|
107
|
+
- [ ] Deploy smart contracts
|
|
108
|
+
- [ ] Connect frontend to deployed contracts
|
|
109
|
+
```
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Deploy and verify smart contracts on EVM chains using Foundry or Hardhat.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# /deploy-contract - Smart Contract Deployment
|
|
6
|
+
|
|
7
|
+
$ARGUMENTS
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Purpose
|
|
12
|
+
|
|
13
|
+
Deploy and verify smart contracts on EVM-compatible chains with pre-flight security checks.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Sub-commands
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
/deploy-contract - Interactive deployment wizard
|
|
21
|
+
/deploy-contract testnet - Deploy to testnet
|
|
22
|
+
/deploy-contract mainnet - Deploy to mainnet
|
|
23
|
+
/deploy-contract verify - Verify already-deployed contract
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Pre-Deployment Checklist
|
|
29
|
+
|
|
30
|
+
```markdown
|
|
31
|
+
## 🚀 Smart Contract Pre-Deploy Checklist
|
|
32
|
+
|
|
33
|
+
### Security
|
|
34
|
+
- [ ] All tests passing (`forge test` or `npx hardhat test`)
|
|
35
|
+
- [ ] No Slither critical/high findings
|
|
36
|
+
- [ ] Access control verified on all admin functions
|
|
37
|
+
- [ ] Reentrancy guards in place
|
|
38
|
+
- [ ] Custom errors used (not require strings)
|
|
39
|
+
|
|
40
|
+
### Gas Optimization
|
|
41
|
+
- [ ] Storage variables packed
|
|
42
|
+
- [ ] `calldata` used for read-only params
|
|
43
|
+
- [ ] No unbounded loops
|
|
44
|
+
|
|
45
|
+
### Configuration
|
|
46
|
+
- [ ] Constructor args correct for target chain
|
|
47
|
+
- [ ] RPC URL and deployer key set in `.env`
|
|
48
|
+
- [ ] Etherscan/Blockscout API key for verification
|
|
49
|
+
- [ ] Chain ID matches target network
|
|
50
|
+
|
|
51
|
+
### Ready to deploy? (y/n)
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Deployment Flow
|
|
57
|
+
|
|
58
|
+
### Foundry
|
|
59
|
+
```bash
|
|
60
|
+
# Deploy
|
|
61
|
+
forge script script/Deploy.s.sol \
|
|
62
|
+
--rpc-url $RPC_URL \
|
|
63
|
+
--broadcast \
|
|
64
|
+
--verify \
|
|
65
|
+
--etherscan-api-key $ETHERSCAN_KEY \
|
|
66
|
+
-vvvv
|
|
67
|
+
|
|
68
|
+
# Verify separately
|
|
69
|
+
forge verify-contract <ADDRESS> MyContract \
|
|
70
|
+
--chain <CHAIN_ID> \
|
|
71
|
+
--etherscan-api-key $ETHERSCAN_KEY
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Hardhat
|
|
75
|
+
```bash
|
|
76
|
+
# Deploy
|
|
77
|
+
npx hardhat run scripts/deploy.ts --network mainnet
|
|
78
|
+
|
|
79
|
+
# Verify
|
|
80
|
+
npx hardhat verify --network mainnet <ADDRESS> <CONSTRUCTOR_ARGS>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Post-Deployment
|
|
86
|
+
|
|
87
|
+
```markdown
|
|
88
|
+
## ✅ Deployment Complete
|
|
89
|
+
|
|
90
|
+
### Summary
|
|
91
|
+
- **Contract:** MyToken
|
|
92
|
+
- **Address:** 0x...
|
|
93
|
+
- **Chain:** Base (8453)
|
|
94
|
+
- **Tx Hash:** 0x...
|
|
95
|
+
- **Block:** 12345678
|
|
96
|
+
- **Gas Used:** 1,234,567
|
|
97
|
+
|
|
98
|
+
### Verification
|
|
99
|
+
- ✅ Verified on BaseScan
|
|
100
|
+
- 🔗 https://basescan.org/address/0x...
|
|
101
|
+
|
|
102
|
+
### Next Steps
|
|
103
|
+
- [ ] Transfer ownership to multisig
|
|
104
|
+
- [ ] Set up monitoring (Tenderly/OpenZeppelin Defender)
|
|
105
|
+
- [ ] Update frontend contract addresses
|
|
106
|
+
- [ ] Create subgraph for indexing
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Supported Chains
|
|
112
|
+
|
|
113
|
+
| Chain | RPC | Explorer |
|
|
114
|
+
|-------|-----|----------|
|
|
115
|
+
| Ethereum | `ETH_RPC_URL` | etherscan.io |
|
|
116
|
+
| Polygon | `POLYGON_RPC_URL` | polygonscan.com |
|
|
117
|
+
| Arbitrum | `ARBITRUM_RPC_URL` | arbiscan.io |
|
|
118
|
+
| Base | `BASE_RPC_URL` | basescan.org |
|
|
119
|
+
| Optimism | `OP_RPC_URL` | optimistic.etherscan.io |
|
|
120
|
+
| Monad | `MONAD_RPC_URL` | monadexplorer.com |
|