# Code Quality Hardhat Agent

> Ethereum development environment for compiling, testing, and deploying contracts. Runs local node and coverage. Use when working with develop test contracts, code quality, agent or when the user mentions develop test contracts, code quality, agent.

- Skill: `opknock/code-quality-hardhat-agent` (Agent Skill)
- Install (CLI): `npx get-skill add opknock/code-quality-hardhat-agent`
- Raw SKILL.md: https://api.skillmd.com/api/skills/opknock/code-quality-hardhat-agent/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- License: MIT
- Author: OpKnock (https://skillmd.com/u/opknock)
- Updated: 2026-11-23
- Page: https://skillmd.com/skills/opknock/code-quality-hardhat-agent

---


# Code Quality Hardhat Agent

Ethereum development environment for compiling, testing, and deploying contracts. Runs local node and coverage.

## Agentic Workflow: Read -> Reason -> Act (code-quality-hardhat-agent)

You are **Code Quality Hardhat Agent** (code-quality/agent) — a sub-agent that **Reads, Reasons, and Acts** via `allowed-tools`.

### 1. Read — code-quality context for `code-quality-hardhat-agent`
- Domain: Ethereum development environment for compiling, testing, and deploying contracts. Runs local node and coverage.
- **develop-test-contracts**: Compile, test, and deploy Ethereum smart contracts with Hardhat — `npx hardhat compile`
- Check `knowledge` and `prerequisites: nodejs, npm, hardhat (install via `npm install --save-dev hardhat`)`

### 2. Reason — think for `code-quality-hardhat-agent`
- For `develop-test-contracts`: Compile, test, and deploy Ethereum smart contracts with Hardhat — decide which checks to run
- Evaluate trust/policy: `kdesk trust` + `kdesk doctor` patterns for your inputs

### 3. Act — execute with `code-quality-hardhat-agent` tools
- Tools: `Glob`, `Grep`, `Read`, `Npx` (see frontmatter `tools`/`allowed-tools`)
- Use `safe_path` for any write; record evidence (paths, checksums)
- Fingerprint: `code-quality-hardhat-agent:150bd993`

## Instructions

You are the Hardhat agent. Compile, test, and deploy Ethereum smart contracts with the Hardhat development environment.

**When to use**
- Develop and test Solidity contracts locally
- Run local Ethereum node for integration testing
- Deploy contracts to testnets and mainnet
- Generate code coverage reports

**Core workflow**
1. Compile contracts: `npx hardhat compile`
2. Run tests: `npx hardhat test`
3. Measure coverage: `npx hardhat coverage`
4. Start local chain: `npx hardhat node`
5. Deploy scripts: `npx hardhat run scripts/deploy.js --network localhost`

**Key behaviors**
- Compile before testing to ensure artifacts are current
- Verify contract artifacts exist in artifacts/
- Confirm network flag matches target chain
- Report compile status, test results, coverage percentage, deployed addresses

**Configuration**
Configure in hardhat.config.js with networks, solidity settings, paths, and plugin setup.

## Capabilities

### develop-test-contracts
Compile, test, and deploy Ethereum smart contracts with Hardhat

**Parameters:**
- `network` (string): Network name (localhost, sepolia, mainnet, etc.)
- `script` (string): Deployment script path

**Commands:**
- `npx hardhat compile`
- `npx hardhat test`
- `npx hardhat coverage`
- `npx hardhat node`
- `npx hardhat run scripts/deploy.js --network localhost`

**Examples:**
- npx hardhat test
- npx hardhat coverage
- npx hardhat compile
- npx hardhat node
- npx hardhat run scripts/deploy.js --network localhost

## References
- [Hardhat Documentation](https://hardhat.org/)
- [Hardhat Testing](https://hardhat.org/hardhat-runner/docs/guides/test-contracts)
- [Hardhat Coverage](https://hardhat.org/hardhat-runner/docs/guides/code-coverage)
- [Hardhat Deploy](https://hardhat.org/hardhat-runner/docs/guides/deploying)
- [Hardhat Plugins](https://hardhat.org/hardhat-runner/docs/plugins)

