defi-protocol-templates

Generates Solidity templates for DeFi protocol components like staking, AMMs, governance, and flash loans.

Updated Apr 5, 2026
One-click install
npx skills add https://github.com/Jhabbig/Habbig --skill defi-protocol-templates-jhabbig
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: defi-protocol-templates
Source: https://github.com/Jhabbig/Habbig/tree/main/.claude/plugins/wshobson/blockchain-web3/skills/defi-protocol-templates
Command: npx skills add https://github.com/Jhabbig/Habbig --skill defi-protocol-templates-jhabbig

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill removes the guesswork from building core DeFi primitives by giving you ready-to-adapt contract patterns for staking, liquidity provision, governance, and flash loans.

Core Features & Use Cases

  • Staking systems: Set up reward distribution, deposits, withdrawals, and exit flows with standard security patterns.
  • AMM pools: Implement liquidity minting, burning, swapping, and reserve accounting for token pairs.
  • Governance workflows: Create vote-enabled tokens and proposal execution flows for DAO-style decision making.
  • Flash loan mechanics: Build atomic borrowing and callback-based repayment logic for arbitrage or liquidation strategies.
  • Use Case: A team launching a DeFi app can use these templates to rapidly scaffold the protocol contracts and focus on product logic instead of rewriting foundational smart contract patterns.

Quick Start

Use this skill to generate the appropriate Solidity template for a DeFi feature such as staking, an AMM, governance, or a flash loan.

Frequently Asked Questions about defi-protocol-templates

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a Solidity staking contract with reward distribution and reentrancy protection?

You can use a DeFi protocol template to generate a Solidity staking contract that handles deposits, withdrawals, exit flows, and reward distribution with standard reentrancy protection and access control.

What's the best way to implement reserve accounting and swapping for an AMM liquidity pool?

The best way is to use an AMM template that provides production-ready Solidity patterns for liquidity minting, burning, token swapping, and accurate reserve accounting for token pairs.

How do flash loans handle atomic borrowing and repayment verification in Solidity?

Flash loan templates implement atomic borrowing and callback-based repayment verification, ensuring that borrowed funds and fees are returned within the same transaction block for arbitrage strategies.

Can I create a DAO governance workflow with vote tracking and proposal execution?

Yes, governance templates generate vote-enabled tokens and proposal execution flows, allowing you to create DAO-style decision making with secure vote tracking and access control.

Do I need to write my own ERC20 integration patterns for DeFi protocol components?

No, these templates already require and include standard ERC20 integration patterns, so you can focus on product logic instead of rewriting foundational smart contract patterns from scratch.

What limitations should I expect when adapting DeFi protocol templates for production?

These templates provide foundational patterns for staking, AMMs, governance, and flash loans, but you must adapt the generic logic and access control to fit your specific product requirements before mainnet deployment.