Agent Skill
@earnforge/skill follows the Agent Skill
standard. It bundles a SKILL.md file plus 5 reference files that any coding agent
(Claude Code, Cursor, Windsurf, Aider, etc.) can read to understand the LI.FI Earn API
and use EarnForge correctly.
Installation
Section titled “Installation”The quickest way: installs into whichever agent you use, and works with Claude Code, Cursor, Codex, Gemini CLI and a dozen others:
npx skills add FarseenSh/earnforgeOr as an npm dependency, if you want it pinned in a project:
npm i @earnforge/skillIt is also served over MCP as resources under skill://earnforge/*, so
connecting to the MCP server gives an agent the tools and these
instructions over one connection. No install at all.
The installed package contains:
@earnforge/skill/ SKILL.md references/ pitfalls.md protocols.md chains.md examples.md strategies.mdWhat is SKILL.md?
Section titled “What is SKILL.md?”SKILL.md is a structured file that agents read to learn what tools are available and
how to use them. It contains:
- Frontmatter – Machine-readable name and description
- Commands – Every CLI command with full usage and flags
- Rules – Critical integration rules the agent must follow
- References – Links to detailed reference files
Frontmatter
Section titled “Frontmatter”---name: earnforgedescription: > Discovers, compares, risk-scores, and builds unsigned deposit and withdrawal quotes for DeFi yield vaults across every chain indexed by the LI.FI Earn API. Surfaces LI.FI's undocumented verificationStatus signal, which flags roughly 9% of vaults as suspect. Handles all 24 known API pitfalls by default.---Commands in SKILL.md
Section titled “Commands in SKILL.md”The skill documents the CLI’s full surface: 19 commands, all accepting --json.
Vault Discovery
Section titled “Vault Discovery”| Command | Description |
|---|---|
earnforge list [--asset] [--chain] [--min-tvl] [--strategy] |
List vaults with filters |
earnforge top --asset <sym> [--chain] [--limit] [--strategy] |
Top vaults by APY |
earnforge vault <slug> |
Single vault, full detail |
earnforge compare <slug> <slug> |
Side-by-side comparison |
Analysis
Section titled “Analysis”| Command | Description |
|---|---|
earnforge risk <slug> |
Seven-dimension risk breakdown and flags |
earnforge apy-history <address> <chainId> |
30-day APY history from DeFiLlama |
earnforge suggest --amount <n> [--asset] [--strategy] |
Portfolio allocation |
earnforge portfolio <wallet> |
Current wallet positions |
Deposit and Withdraw
Section titled “Deposit and Withdraw”| Command | Description |
|---|---|
earnforge quote --vault <slug> --amount <n> --wallet <addr> |
Build a deposit quote |
earnforge withdraw --vault <slug> --amount <n> --wallet <addr> |
Build a redeem quote |
earnforge allowance / earnforge approve |
ERC-20 allowance check and approval tx |
earnforge simulate --vault <slug> --amount <n> --wallet <addr> |
Simulate against the chain head via Composer |
Safety and Monitoring
Section titled “Safety and Monitoring”| Command | Description |
|---|---|
earnforge doctor --vault <slug> |
Run 22 checks: 18 pitfall guards plus 4 environment checks |
earnforge preflight <slug> <wallet> |
Pre-deposit validation |
earnforge watch <slug> [--apy-drop] [--tvl-drop] |
Monitor APY/TVL changes |
Reference Data
Section titled “Reference Data”| Command | Description |
|---|---|
earnforge chains |
Every chain with an indexed vault |
earnforge protocols |
Every indexed protocol, with risk tiers |
earnforge init <name> |
Scaffold a project with EarnForge wired up |
SKILL.md defines 12 rules agents must follow. The ones that most often go
wrong:
-
Never submit transactions. Only build unsigned quotes; the user signs.
-
Check ERC-20 allowance before depositing, using the quote’s
approvalAddressas spender. -
Check
isTransactionalbefore quoting a deposit, andisRedeemablebefore quoting a withdrawal. -
Risk thresholds are 8 / 6:
>= 8low,6–7.9medium,< 6high. Always show the score and its flags alongside APY. -
Never recommend a verification-flagged vault without saying so. LI.FI flags roughly 9% of vaults. A flagged vault can never reach 8, so it can never read as low risk, and
suggestexcludes them by default. -
APY is already a percentage (3.84 = 3.84%). Do not multiply by 100. LI.FI’s own spec and quickstart say to, and they are wrong; doing so overstates every yield 100×.
-
Never hardcode a protocol id. A stale one returns
200with zero results rather than an error, so the failure is silent. Resolve viaearnforge protocols. -
Cross-chain deposits need an explicit
--from-token, and are not atomic: a bridge can succeed while the destination deposit fails.
Reference Files
Section titled “Reference Files”references/pitfalls.md
Section titled “references/pitfalls.md”All 23 API pitfalls with descriptions and fixes. Agents reference this when debugging integration issues or understanding why certain guards exist.
references/protocols.md
Section titled “references/protocols.md”The 27 protocols with risk tiers. Used by agents to understand protocol maturity when making recommendations.
references/chains.md
Section titled “references/chains.md”All 17 chains with chainId mappings. Agents use this to convert between chain names and numeric IDs.
references/examples.md
Section titled “references/examples.md”8 worked examples showing common workflows:
- Find top USDC yield on Base
- Compare two vaults
- Build a deposit quote
- Get a diversified allocation
- Run doctor checks
- Monitor a vault
- Cross-chain gas optimization
- Portfolio lookup
references/strategies.md
Section titled “references/strategies.md”The 4 yield strategy presets with their filter configs, sort behavior, and recommended use cases.
Using the Skill
Section titled “Using the Skill”In Claude Code
Section titled “In Claude Code”Place the skill package in your project’s dependencies. Claude Code will automatically
discover the SKILL.md and reference files.
In Cursor / Windsurf
Section titled “In Cursor / Windsurf”Point your agent to the SKILL.md file:
@earnforge/skill/SKILL.mdThe agent will read the file and understand all available commands, rules, and references.
In Custom Agents
Section titled “In Custom Agents”Read SKILL.md as part of your system prompt or tool documentation:
import { readFileSync } from 'fs';import { resolve } from 'path';
const skillPath = resolve('node_modules/@earnforge/skill/SKILL.md');const skill = readFileSync(skillPath, 'utf-8');// Include `skill` in your agent's context