# Foundry Lifecycle

> Use this skill when the user asks to compile contracts, run tests, analyze gas usage, format code, or deploy to a local/remote EVM network using Forge.

- **Type:** Skill
- **Install:** `agentstack add skill-dor-rondel-agent-skills-foundry-lifecycle`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [dor-rondel](https://agentstack.voostack.com/s/dor-rondel)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [dor-rondel](https://github.com/dor-rondel)
- **Source:** https://github.com/dor-rondel/agent-skills-mcp/tree/main/resources/solidity/foundry-lifecycle

## Install

```sh
agentstack add skill-dor-rondel-agent-skills-foundry-lifecycle
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Foundry Smart Contract Workflow

This skill hooks into the repository's Foundry toolchain (`forge`) to manage the compilation, testing, and deployment lifecycle of the EVM smart contracts.

## 🛠️ Environment Constraints

- **Toolchain Required:** `foundryup` (`forge`, `anvil`)
- **Project Root:** Execute all commands from the directory containing `foundry.toml`.

---

## 🏃‍♂️ Core Development Commands

### 1. Code Compilation & Artifacts

Compile the Solidity source files and generate the necessary ABIs and bytecodes:

```bash
forge build
```

### 2. Testing Suite Execution

Run the contract test suite to verify correctness and safety:

```bash
forge test
```

### 3. Gas Metrics & Analysis

Run tests while generating an inline breakdown of gas consumption per function and deployment:

```bash
forge test --gas-report
```

### 4. Code Formatting

Format all local Solidity source files (`*.sol`) to maintain style guide standards:

```bash
forge fmt
```

---

## 🚀 Local Network & Deployment Workflow

### 1. Spin Up Local Ledger (Anvil)

When debugging or deploying locally, boot a native local EVM node in an isolated terminal or background process:

```bash
anvil
```

### 2. Broadcast Local Deployment Script

Run the deployment script, sign transactions with local test keys, and broadcast them directly to the active Anvil instance:

```bash
forge script script/Deploy.s.sol --rpc-url http://127.0.0.1:8545 --broadcast
```

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [dor-rondel](https://github.com/dor-rondel)
- **Source:** [dor-rondel/agent-skills-mcp](https://github.com/dor-rondel/agent-skills-mcp)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-dor-rondel-agent-skills-foundry-lifecycle
- Seller: https://agentstack.voostack.com/s/dor-rondel
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
