# Defi amm security

> Defi amm security is an open-source agent skill for security. Checklist and hardened patterns for auditing or writing Solidity AMM and swap code. 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/smartworldarafath/REA_Skill/tree/main/.agents/skills/defi-amm-security
- **Repository:** https://github.com/smartworldarafath/rea_skill
- **GitHub stars:** 66
- **License:** MIT
- **Skill name:** defi-amm-security
- **Collection:** https://github.com/smartworldarafath/REA_Skill
- **Categories:** [security](https://ai-powered.com/categories/security)
- **Listing updated:** 2026-12-01

## About

This skill gives the agent a security review checklist for Solidity automated market makers, liquidity pool vaults and swap functions. It walks through the main vulnerability classes, including reentrancy, checks-effects-interactions ordering, donation and inflation attacks on share math, spot-price oracle manipulation, slippage and deadline checks, overflow-prone reserve arithmetic and privileged admin functions, and pairs each with a vulnerable and a safer code pattern.

When reviewing code, the agent is directed to check each user entrypoint against these categories and to prefer established libraries such as OpenZeppelin guards and SafeERC20 over hand-written variants. The skill also includes a closing checklist covering access control, emergency pause and testing coverage.

The skill expects Solidity contracts as input and refers to tools such as Slither, Echidna and Foundry's forge fuzzing. Its shell commands are presented as local audit examples, and the skill tells the agent to run them only in a trusted checkout or sandbox and to ask before installing tools or starting long jobs.

## When your agent uses it

> Security checklist for Solidity AMM contracts, liquidity pools, and swap flows. Covers reentrancy, CEI ordering, donation or inflation attacks, oracle manipulation, slippage, admin controls, and integer math. Use when auditing or writing Solidity AMM, liquidity pool, or swap code.

## What it can access

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

- [Instructions only, no scripts](https://github.com/smartworldarafath/REA_Skill/tree/HEAD/.agents/skills/defi-amm-security)
- [License: MIT](https://github.com/smartworldarafath/REA_Skill/tree/HEAD/.agents/skills/defi-amm-security)

## Features

- **Reentrancy and CEI ordering:** Checks that external calls follow checks-effects-interactions and that risky entrypoints use a reentrancy guard.
- **Donation and inflation defenses:** Covers share math that relies on raw token balances and recommends tracking internal accounting.
- **Oracle manipulation checks:** Explains why spot prices are manipulable and shows reading a Uniswap V3 TWAP instead.
- **Slippage and deadline guards:** Requires caller-provided minimum output and a deadline on every swap path.
- **Safe reserve math:** Points to overflow-resistant multiplication and division such as mulDiv for large reserve calculations.
- **Admin control review:** Covers access control on privileged functions, two-step ownership transfer and emergency pause.
- **Audit tool commands:** Lists example commands for Slither, Echidna and Foundry fuzzing to run against a contract.

## Good for

- Audit a Solidity liquidity pool for reentrancy and CEI ordering issues
- Review a swap function for missing slippage limits and deadlines
- Check a vault's share calculation for donation or inflation attack exposure
- Replace spot price reads in an AMM with a TWAP oracle
- Write a deposit and withdraw flow that uses SafeERC20 and a reentrancy guard

## Install

### Claude Code

This skill ships in the `rea-skills` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add smartworldarafath/REA_Skill
/plugin install rea-skills@smartworldarafath
```

Or copy only this skill to `~/.claude/skills/defi-amm-security`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/defi-amm-security &&
cp -R "$tmp/.agents/skills/defi-amm-security" ~/.claude/skills/defi-amm-security &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/defi-amm-security` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/defi-amm-security` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/defi-amm-security &&
cp -R "$tmp/.agents/skills/defi-amm-security" ~/.agents/skills/defi-amm-security &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/defi-amm-security` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/defi-amm-security` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/defi-amm-security &&
cp -R "$tmp/.agents/skills/defi-amm-security" ~/.cursor/skills/defi-amm-security &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/defi-amm-security` 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/smartworldarafath/REA_Skill.git --path .agents/skills/defi-amm-security
```

Or copy the folder to `~/.gemini/skills/defi-amm-security` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/defi-amm-security`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/defi-amm-security &&
cp -R "$tmp/.agents/skills/defi-amm-security" ~/.copilot/skills/defi-amm-security &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/defi-amm-security` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git
```

Then copy `REA_Skill/.agents/skills/defi-amm-security` into your agent's skills folder as `defi-amm-security`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does Defi amm security need to run?

It is a checklist and pattern library for Solidity code. Its audit commands use Slither, Echidna and Foundry, and it says to run them only in a trusted checkout or sandbox and to ask before installing tools or starting long jobs.

### When does the agent use Defi amm security?

It applies when auditing or writing Solidity AMM, liquidity pool or swap code.

### Does Defi amm security change any files or contracts?

The skill itself only provides instructions and code examples. It does not include scripts.

### Which vulnerability categories does Defi amm security cover?

Reentrancy, CEI ordering, donation or inflation attacks, oracle manipulation, slippage, admin controls and integer math.

### How do I install Defi amm security in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/defi-amm-security to use it in all your projects, or to .claude/skills/defi-amm-security in one project. Or install the rea-skills plugin, which includes it: /plugin marketplace add smartworldarafath/REA_Skill, then /plugin install rea-skills@smartworldarafath.

### Does Defi amm security 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 Defi amm security?

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 Defi amm security?

The closest alternatives to Defi amm security are Secure workflow guide, Token integration analyzer, Entry point analyzer, Solana vulnerability scanner and Agent security hardening.

## Where this comes from

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

## Alternatives

- [Secure workflow guide](https://ai-powered.com/skills/secure-workflow-guide): Secure workflow guide is an open-source agent skill for security.
- [Token integration analyzer](https://ai-powered.com/skills/token-integration-analyzer): Token integration analyzer is an open-source agent skill for security.
- [Entry point analyzer](https://ai-powered.com/skills/entry-point-analyzer): Entry point analyzer is an open-source agent skill for legal and government.
- [Solana vulnerability scanner](https://ai-powered.com/skills/solana-vulnerability-scanner): Solana vulnerability scanner is an open-source agent skill for security.
- [Agent security hardening](https://ai-powered.com/skills/agent-security-hardening): Agent security hardening is an open-source agent skill for security.
- [Substrate vulnerability scanner](https://ai-powered.com/skills/substrate-vulnerability-scanner): Substrate vulnerability scanner is an open-source agent skill for security.
- [Rust review](https://ai-powered.com/skills/rust-review): Rust review is an open-source agent skill for security.
- [Audit integrity](https://ai-powered.com/skills/audit-integrity): Audit integrity is an open-source agent skill for security.

---
Source: https://ai-powered.com/skills/defi-amm-security
