Agent skills for working on Hardhat 3 projects following the Agent Skills format.
npx skills add nomicfoundation/hardhat-skillsThis launches an interactive CLI that walks you through installing Hardhat skills for your agent. For instance, you can install into your current project (as opposed to globally) and specifically for Claude, which writes the skill files into .claude/skills/ at the repository root.
Once installed, each skill is available to your agents. For Claude the skill can be invoked by name:
/migrate-hardhat2-to-hardhat3
The agent loads the instructions and structure from the installed skill file and uses them to drive the work e.g. for the migration skills, that means kicking off a step-by-step campaign to migrate the repo.
The core skill for Hardhat 3 projects. It provides context whenever your agent is writing or modifying contracts, tests, or config. It teaches the agent:
- When to reach for Solidity tests vs. TypeScript tests, and how to run each layer.
forge-stdcheatcodes and the Solidity test conventions Hardhat expects.- The
network.create()connection API andnetworkHelpers(fixtures, time/block manipulation). - The compile-then-typecheck workflow that keeps contract changes and tests in sync.
A companion to the hardhat skill for projects using @nomicfoundation/hardhat-toolbox-viem. It adds information about:
- The viem clients exposed on
network.create()(public, wallet, and test clients). - Typed contract interaction —
viem.deployContract,read,write, andgetContractAt. viem.assertionsfor revert, event, and balance checks.
A companion to the hardhat skill for projects using @nomicfoundation/hardhat-toolbox-mocha-ethers. It adds information about:
- The ethers helpers on
network.create()(provider, signers, utilities). - Contract interaction via
ethers.deployContract, calling functions, andconnect. - TypeChain-typed contract instances and the
hardhat buildworkflow that generates them. - The chai matchers (
.to.emit,.to.be.revertedWith*,.to.changeEtherBalance(s)).
Migrate a Hardhat 2 project to Hardhat 3. The agent migrate the project by running through sequential phases, pausing at a user checkpoint after each:
- Project setup —
tsconfig.jsonfor ESM and thepackage.jsonHardhat 2 → Hardhat 3 dependency swap. - Config — rewrite
hardhat.config.tsto the declarativedefineConfig(plugins, networks, tasks, solidity, verify). - Solidity tests — migrate
.t.solfiles to Hardhat 3 conventions. - Source files — convert
.ts/.jssources CJS→ESM and update Hardhat 2 APIs to Hardhat 3 (plus TypeChain import fixes). - Test fix-up — get the TypeScript test suite passing under Hardhat 3.
- Script validation — run and fix the
package.jsonscripts you select.
Migrate a Solidity project from Foundry to Hardhat 3. The agent will migrate the project by systematically working through the following steps in order:
- Analyze the Foundry project —
foundry.toml, remappings, submodules, inline config, and scripts. - Add Hardhat to the project with the detected package manager.
- Create
hardhat.config.ts, mapping everyfoundry.tomlsection across. - Handle absolute imports and remapping differences.
- Compile the contracts.
- Run Solidity tests and get them passing.
- Migration report — migration gaps and a Foundry cleanup checklist (originals are preserved, not deleted).