itsmejay18/ai-skills-for-my-development-stack/solidity-testing
Claude Code and agent skill by itsmejay18/ai-skills-for-my-development-stack
Trust tier 3
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
[AUTO-INVOKE] MUST be invoked BEFORE writing or modifying any test files (*.t.sol). Covers test structure, naming conventions, coverage requirements, fuzz testing, and Foundry cheatcodes. Trigger: any task involving creating, editing, or running Solidity tests.
Install
npx vskill@latest install itsmejay18/ai-skills-for-my-development-stack/solidity-testingSKILL.md
The same SKILL.md was published earlier as itsmejay18/ai-skills-for-my-development-stack/solidity-testing.
Testing Standards
Language Rule
- Always respond in the same language the user is using. If the user asks in Chinese, respond in Chinese. If in English, respond in English.
Test Organization
- One test contract per source contract:
MyToken.sol→MyToken.t.sol - File location: All tests in
test/directory - Naming:
test_<feature>_<scenario>for passing tests,testFail_<feature>_<scenario>for expected reverts - Example:
test_transfer_revertsWhenInsufficientBalance - Example:
test_stake_updatesBalanceCorrectly - Independence: Each test must run in isolation — use
setUp()for shared state, no cross-test dependencies - Filtering: Support
--match-testand--match-contractfor targeted runs
Coverage Requirements
Every core function must have tests covering:
| Scenario | What to verify | |
|---|---|---|
| Happy path | Standard input → expected output, correct state changes | |
| Permission checks | Unauthorized caller → vm.expectRevert with correct error | |
| Boundary conditions | Zero values, max values (type(uint256).max), off-by-one | |
| Failure scenarios | Every require / revert / custom error path | |
| State changes | Storage updates, balance changes, event emissions (vm.expectEmit) | |
| Edge cases | Empty arrays, duplicate calls, self-transfers |
Foundry Cheatcodes Quick Reference
| Cheatcode | Usage | |
|---|---|---|
vm.prank(addr) | Next call from addr | |
vm.startPrank(addr) | All calls from addr until vm.stopPrank() | |
vm.warp(timestamp) | Set block.timestamp | |
vm.roll(blockNum) | Set block.number | |
vm.deal(addr, amount) | Set ETH balance | |
vm.expectRevert(error) | Next call must revert with specific error | |
vm.expectEmit(true,true,false,true) | Verify event emission (topic checks) | |
vm.record() / vm.accesses() | Track storage reads/writes | |
makeAddr("name") | Create labeled address for readable traces |
Fuzz Testing Rules
- All math-heavy and fund-flow functions must have fuzz tests
- Pattern:
function testFuzz_<name>(uint256 amount) public - Use
vm.assume()to constrain inputs:vm.assume(amount > 0 && amount < MAX_SUPPLY); - Default runs: 256 — increase to 10,000+ for critical functions:
forge test --fuzz-runs 10000
Common Commands
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking06-Blockchain-Web3-Development/solidity-testing/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/itsmejay18/ai-skills-for-my-development-stack/solidity-testing)