# Chain construct smart contract

> Chain construct smart contract is an open-source agent skill for security. Builds and reproduces exploit proof-of-concepts for smart contract vulnerabilities. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/mtarcure/claude-vibe-squad/tree/main/.agents/skills/chain-construct-smart-contract
- **Repository:** https://github.com/mtarcure/claude-vibe-squad
- **GitHub stars:** 227
- **License:** MIT
- **Skill name:** chain-construct-smart-contract
- **Collection:** https://github.com/mtarcure/claude-vibe-squad
- **Categories:** [security](https://ai-powered.com/categories/security)
- **Listing updated:** 2026-12-02

## About

This skill guides an agent through turning a confirmed on-chain vulnerability hypothesis into a passing proof-of-concept. It covers EVM primitives such as reentrancy, flash-loan manipulation, delegatecall overwrites and proxy upgrade bypasses, and Solana primitives such as CPI privilege escalation, account substitution and arithmetic overflow.

The workflow starts by identifying the first externally callable function or instruction the attacker controls, then selects a matching primitive and writes an attacker contract or crafted instruction sequence. The agent is asked to add explicit assertions on the final state so that a passing test demonstrates real impact, and to document the entry point, numbered steps, impact and preconditions as evidence.

The skill expects a Solidity or Rust smart contract codebase and uses native host tools: Forge for EVM tests, including fork testing with a block number, and LiteSVM, Trident or cargo-fuzz for Solana. It also explains how to handle multi-block chains with time and block advancement, and it excludes attacks that depend on compromised admin keys.

## When your agent uses it

> Use when you have a confirmed on-chain vulnerability hypothesis and must demonstrate it with a passing proof-of-concept — author an attacker contract or crafted instruction sequence for an EVM reentrancy, flash-loan, delegatecall-overwrite, or proxy-upgrade primitive (or a Solana CPI-privilege, account-substitution, or overflow primitive) and reproduce it under Forge, LiteSVM, or Trident.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/mtarcure/claude-vibe-squad/tree/HEAD/.agents/skills/chain-construct-smart-contract)
- [License: MIT](https://github.com/mtarcure/claude-vibe-squad/tree/HEAD/.agents/skills/chain-construct-smart-contract)

## Features

- **EVM exploit primitives:** Scaffolds for reentrancy, flash-loan, delegatecall-overwrite and proxy-upgrade attack contracts.
- **Solana exploit primitives:** Guidance for CPI privilege escalation, account substitution and token overflow chains.
- **Forge reproduction tests:** Runs attacker contracts under Forge with verbose traces and optional mainnet fork blocks.
- **Solana test harnesses:** Uses LiteSVM, Trident and cargo-fuzz to reproduce instruction-level exploits.
- **State-based impact gating:** Requires assertions on final state so a passing test shows a real demonstrated impact.
- **Chain documentation:** Structures findings as entry point, numbered steps, impact and preconditions.

## Good for

- Reproduce a suspected reentrancy bug in a Solidity vault with a Forge test
- Write a flash-loan attacker contract that manipulates an oracle price
- Test whether an unprotected delegatecall lets an attacker overwrite the owner slot
- Check a Solana instruction for CPI signer-seed abuse using LiteSVM
- Document an exploit chain with preconditions and a fork block number

## Install

### Claude Code

Copy the skill folder to `~/.claude/skills/chain-construct-smart-contract` to use it in all your projects:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mtarcure/claude-vibe-squad.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/chain-construct-smart-contract &&
cp -R "$tmp/.agents/skills/chain-construct-smart-contract" ~/.claude/skills/chain-construct-smart-contract &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/chain-construct-smart-contract` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/chain-construct-smart-contract` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mtarcure/claude-vibe-squad.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/chain-construct-smart-contract &&
cp -R "$tmp/.agents/skills/chain-construct-smart-contract" ~/.agents/skills/chain-construct-smart-contract &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/chain-construct-smart-contract` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/chain-construct-smart-contract` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mtarcure/claude-vibe-squad.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/chain-construct-smart-contract &&
cp -R "$tmp/.agents/skills/chain-construct-smart-contract" ~/.cursor/skills/chain-construct-smart-contract &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/chain-construct-smart-contract` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/mtarcure/claude-vibe-squad.git --path .agents/skills/chain-construct-smart-contract
```

Or copy the folder to `~/.gemini/skills/chain-construct-smart-contract` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/chain-construct-smart-contract`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mtarcure/claude-vibe-squad.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/chain-construct-smart-contract &&
cp -R "$tmp/.agents/skills/chain-construct-smart-contract" ~/.copilot/skills/chain-construct-smart-contract &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/chain-construct-smart-contract` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/mtarcure/claude-vibe-squad.git
```

Then copy `claude-vibe-squad/.agents/skills/chain-construct-smart-contract` into your agent's skills folder as `chain-construct-smart-contract`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What tools does Chain construct smart contract need?

It calls native host CLIs directly: forge for EVM, and cargo test with LiteSVM, trident or cargo-fuzz for Solana. Anchor is also listed as a tool.

### Does Chain construct smart contract change or deploy anything on mainnet?

It runs tests locally, and for live state it uses forge test with a fork URL and block number rather than submitting transactions.

### When should the skill be used?

It is meant for cases where a vulnerability hypothesis is already confirmed and needs a passing proof-of-concept.

### Does Chain construct smart contract handle attacks that need compromised admin keys?

No. The skill says such chains are out of scope because the precondition cannot be established by an attacker.

### How do I install Chain construct smart contract in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/chain-construct-smart-contract to use it in all your projects, or to .claude/skills/chain-construct-smart-contract in one project.

### Does Chain construct smart contract run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Chain construct smart contract?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Chain construct smart contract?

The closest alternatives to Chain construct smart contract are Blockchain security, Chain construct, Solana audit flow, Systematic attacking and Systematic bug hunting.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Blockchain security](https://ai-powered.com/skills/blockchain-security): Blockchain security is an open-source agent skill for security.
- [Chain construct](https://ai-powered.com/skills/chain-construct): Chain construct is an open-source agent skill for security.
- [Solana audit flow](https://ai-powered.com/skills/solana-audit-flow): Solana audit flow is an open-source agent skill for security.
- [Systematic attacking](https://ai-powered.com/skills/systematic-attacking): Systematic attacking is an open-source agent skill for security.
- [Systematic bug hunting](https://ai-powered.com/skills/systematic-bug-hunting): Systematic bug hunting is an open-source agent skill for security.
- [Solana vulnerability scanner](https://ai-powered.com/skills/solana-vulnerability-scanner): Solana vulnerability scanner is an open-source agent skill for security.
- [Evm audit flow](https://ai-powered.com/skills/evm-audit-flow): Evm audit flow is an open-source agent skill for security.
- [Defi amm security](https://ai-powered.com/skills/defi-amm-security): Defi amm security is an open-source agent skill for security.

---
Source: https://ai-powered.com/skills/chain-construct-smart-contract
