
DeFi Protocol Templates
Gives the agent Solidity starting templates for staking, AMM, governance and flash-loan contracts.
- Repository
- wshobson/agents
- Stars
- 42,095
- Licence
- MIT
- Files
- 2 files
What it does
When installed, the agent can draft smart contract code for decentralized finance (DeFi) features such as token staking with reward payouts, a simple token-swap exchange (AMM), governance token systems and flash loans. It starts from example Solidity contracts built on OpenZeppelin libraries, so you get a working-looking structure instead of writing everything from scratch. The contracts are templates for learning and prototyping, not audited code ready to hold real money.
Great for
- Developers learning how staking or AMM contracts are structured
- Teams prototyping a DeFi idea on a test network before any security review
- Blockchain engineers who want a reference skeleton to adapt
Skip it if
- Deploying contracts that hold real user funds without a professional security audit, since the templates are illustrative and may contain flaws (the included AMM and staking code has known simplifications)
- Non-developers who would not be able to review or test Solidity code
- Anyone expecting legal, financial or tokenomics advice
Try asking
- “Write a staking contract where users deposit a token and earn a reward token per second”
- “Show me a simple constant-product AMM with add liquidity, remove liquidity and swap functions”
- “Draft a governance token contract with voting for a small DAO prototype”
- “Outline a flash loan contract I can test on a local blockchain”
Install in 3 steps
- 1
Download the skill
The ZIP contains the 2 original files, the MIT licence and an attribution note.
defi-protocol-templates.zip - 2
Add it to your agent
Claude Code (all projects)
mkdir -p ~/.claude/skills && unzip defi-protocol-templates.zip -d ~/.claude/skills/Claude Code / Agent SDK (this project only)
mkdir -p .claude/skills && unzip defi-protocol-templates.zip -d .claude/skills/Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.
- 3
Ask for the task
No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.
Get better results
- Ask the agent to add tests (for example with Hardhat or Foundry) and to run them on a local chain before any deployment
- Ask for a security review checklist, such as reentrancy, rounding and access control checks, and get a professional audit before mainnet use
- Specify your token standard, fee model and reward math up front so the template is adapted rather than copied
What's inside
- references/details.md
- SKILL.md
Redistributed unmodified from wshobson/agents under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.