library/specializations/cryptography-blockchain/skills/solidity-dev/SKILL.md
Deep expertise in Solidity language features, patterns, and best practices for secure smart contract development. Covers ERC standards, gas optimization, upgradeable contracts, and security patterns.
npx skillsauth add a5c-ai/babysitter solidity-devInstall 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.
Expert-level Solidity smart contract development with emphasis on security patterns, gas optimization, and ERC standard compliance.
function withdraw(uint256 amount) external {
// CHECKS
require(balances[msg.sender] >= amount, "Insufficient balance");
// EFFECTS
balances[msg.sender] -= amount;
// INTERACTIONS
(bool success, ) = msg.sender.call{value: amount}("");
require(success, "Transfer failed");
}
// Instead of require strings
error InsufficientBalance(uint256 requested, uint256 available);
error Unauthorized(address caller);
function withdraw(uint256 amount) external {
if (balances[msg.sender] < amount) {
revert InsufficientBalance(amount, balances[msg.sender]);
}
}
function increment(uint256 i) external pure returns (uint256) {
// Safe when overflow is impossible
unchecked {
return i + 1; // Saves ~80 gas
}
}
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Permit.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Votes.sol";
contract GovernanceToken is ERC20, ERC20Permit, ERC20Votes {
constructor() ERC20("MyToken", "MTK") ERC20Permit("MyToken") {
_mint(msg.sender, 1000000 * 10**decimals());
}
// Required overrides for multiple inheritance
function _afterTokenTransfer(address from, address to, uint256 amount)
internal override(ERC20, ERC20Votes)
{
super._afterTokenTransfer(from, to, amount);
}
function _mint(address to, uint256 amount)
internal override(ERC20, ERC20Votes)
{
super._mint(to, amount);
}
function _burn(address account, uint256 amount)
internal override(ERC20, ERC20Votes)
{
super._burn(account, amount);
}
}
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Royalty.sol";
contract MyNFT is ERC721, ERC721URIStorage, ERC721Royalty {
uint256 private _tokenIdCounter;
constructor() ERC721("MyNFT", "NFT") {
_setDefaultRoyalty(msg.sender, 250); // 2.5%
}
function safeMint(address to, string memory uri) external {
uint256 tokenId = _tokenIdCounter++;
_safeMint(to, tokenId);
_setTokenURI(tokenId, uri);
}
}
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
contract MyContractV1 is UUPSUpgradeable, OwnableUpgradeable {
uint256 public value;
/// @custom:oz-upgrades-unsafe-allow constructor
constructor() {
_disableInitializers();
}
function initialize() public initializer {
__Ownable_init();
__UUPSUpgradeable_init();
}
function _authorizeUpgrade(address newImplementation)
internal override onlyOwner
{}
function setValue(uint256 _value) external {
value = _value;
}
}
// BAD: Uses 3 storage slots (96 bytes)
contract Unpacked {
uint256 a; // slot 0
uint8 b; // slot 1
uint256 c; // slot 2
}
// GOOD: Uses 2 storage slots (64 bytes)
contract Packed {
uint256 a; // slot 0
uint256 c; // slot 1
uint8 b; // slot 1 (packed with previous)
}
// Use calldata for read-only arrays
function processData(uint256[] calldata data) external pure returns (uint256) {
uint256 sum;
for (uint256 i; i < data.length;) {
sum += data[i];
unchecked { ++i; }
}
return sum;
}
function efficientTransfer(address to, uint256 amount) external {
assembly {
// Load balance from storage
let bal := sload(add(balances.slot, caller()))
// Check balance
if lt(bal, amount) {
revert(0, 0)
}
// Update balances
sstore(add(balances.slot, caller()), sub(bal, amount))
sstore(add(balances.slot, to), add(sload(add(balances.slot, to)), amount))
}
}
This skill integrates with:
| Process | Purpose |
|---------|---------|
| smart-contract-development-lifecycle.js | Full development workflow |
| erc20-token-implementation.js | ERC-20 implementation |
| erc721-nft-collection.js | NFT collection development |
| erc1155-multi-token.js | Multi-token development |
| erc4626-tokenized-vault.js | Vault implementation |
| gas-optimization.js | Performance tuning |
| smart-contract-upgrade.js | Proxy upgrades |
| Tool | Purpose | Installation |
|------|---------|--------------|
| Foundry | Development framework | curl -L https://foundry.paradigm.xyz \| bash |
| Hardhat | Development framework | npm install hardhat |
| Solhint | Linter | npm install solhint |
| Prettier Solidity | Formatter | npm install prettier-plugin-solidity |
skills/foundry-framework/SKILL.md - Foundry developmentskills/hardhat-framework/SKILL.md - Hardhat developmentskills/openzeppelin/SKILL.md - OpenZeppelin contractsskills/gas-optimization/SKILL.md - Gas optimizationagents/solidity-auditor/AGENT.md - Security auditor agentdevelopment
Model documentation skill for generating model cards following Google's model card framework.
development
MLflow integration skill for experiment tracking, model registry, and artifact management. Enables LLMs to log experiments, compare runs, manage model lifecycle, and retrieve artifacts through the MLflow API.
data-ai
LIME-based local explanation skill for individual predictions across tabular, text, and image data.
devops
Kubeflow Pipelines skill for ML workflow orchestration, component management, and Kubernetes-native ML.