Build with AI
This guide explains how to use coding agents effectively in Hardhat projects.
Agent skills
Section titled “Agent skills”LLMs are good at working with Hardhat, but they tend to prefer Hardhat 2 APIs. A small amount of extra context about Hardhat 3 is usually enough to steer them in the right direction.
The easiest way to provide that context is to install our main Hardhat skill:
npx skills add nomicfoundation/hardhat-skills --skill hardhatpnpm dlx skills add nomicfoundation/hardhat-skills --skill hardhatyarn dlx skills add nomicfoundation/hardhat-skills --skill hardhatProject-specific skills
Section titled “Project-specific skills”Hardhat projects are extensible and can rely on different plugins, so we also publish skills tailored to specific setups.
If your project is based on hardhat-toolbox-viem, install the corresponding skill:
npx skills add nomicfoundation/hardhat-skills --skill hardhat-toolbox-viempnpm dlx skills add nomicfoundation/hardhat-skills --skill hardhat-toolbox-viemyarn dlx skills add nomicfoundation/hardhat-skills --skill hardhat-toolbox-viemIf your project is based on hardhat-toolbox-mocha-ethers:
npx skills add nomicfoundation/hardhat-skills --skill hardhat-toolbox-mocha-etherspnpm dlx skills add nomicfoundation/hardhat-skills --skill hardhat-toolbox-mocha-ethersyarn dlx skills add nomicfoundation/hardhat-skills --skill hardhat-toolbox-mocha-ethersDocumentation
Section titled “Documentation”Hardhat docs are agent-friendly: we offer an llms.txt index, and any docs page is also available as Markdown. Pointing your agent at our docs should just work.