Skip to content

feat: add defi-cli agent skill for Claude Code#51

Open
ggonzalez94 wants to merge 3 commits intomainfrom
skill
Open

feat: add defi-cli agent skill for Claude Code#51
ggonzalez94 wants to merge 3 commits intomainfrom
skill

Conversation

@ggonzalez94
Copy link
Copy Markdown
Owner

@ggonzalez94 ggonzalez94 commented Mar 26, 2026

Summary

  • Adds a comprehensive Claude Code skill (.claude/skills/defi-cli/SKILL.md) that teaches AI agents how to use defi-cli effectively
  • Covers install, output format, exit codes, schema self-discovery, chain/asset resolution, all read commands, execution patterns (plan/submit/status), wallet identity (OWS vs legacy), structured input, and 10 critical gotchas
  • Includes exact output field schemas for lend markets, lend positions, yield opportunities, bridge quote, swap quote, and protocols fees — so agents use correct field names in --select and jq pipelines
  • Documents the health factor gap explicitly (positions output has no health_factor field; workaround provided)

Eval Results

Tested with 5 realistic agent prompts (yield discovery+deposit, multi-chain position monitoring, bridge route comparison, protocol fee analysis, Taiko swap execution) across 2 iterations:

Eval With Skill (iter 1) Without Skill With Skill (iter 2)
Yield Discovery + Deposit 9/9 8/9 -
Position Monitoring 6/7 7/7 7/7
Bridge Comparison 8/8 8/8 -
Protocol Fees + Rates 7/7 7/7 7/7 (correct field names)
Taiko Swap 8/8 7/8 -

Key improvements from the skill:

  • Agents consistently use base units (--amount) instead of ambiguous --amount-decimal
  • Correct field names in --select and jq (supply_apy/borrow_apy, not supply_apr/variable_borrow_apy)
  • Proper health factor workaround instead of assuming a nonexistent field
  • No confusion between TaikoSwap (standard EVM) and Tempo (type 0x76) execution paths

Test plan

  • Install the skill: copy .claude/skills/defi-cli/ to ~/.claude/skills/
  • Start a Claude Code session and ask: "Find the best USDC yield on Base across Aave and Moonwell, then deposit 1000 USDC using my OWS wallet"
  • Verify the response uses correct commands, flags, field names, and base unit amounts
  • Ask: "Write a script to monitor my Aave positions on Ethereum and Arbitrum" — verify it acknowledges the health_factor limitation

🤖 Generated with Claude Code


Note

Low Risk
Documentation-only additions introducing a new skill guide and install links; low risk aside from potential docs/command drift if the CLI interface changes.

Overview
Adds a bundled skills/defi-cli/SKILL.md “open skill” that teaches agents how to use defi with correct flags, output fields, exit-code handling, and the plansubmitstatus execution pattern (including key gotchas like missing health_factor).

Updates README.md, docs/agents/overview.mdx, and docs/installation.mdx to advertise installing the skill via npx skills add ggonzalez94/defi-cli (or manual copy) and link to the agent docs.

Written by Cursor Bugbot for commit c634898. This will update automatically on new commits. Configure here.

Add a comprehensive skill that teaches AI agents how to use defi-cli
effectively. The skill covers installation, command reference, output
field schemas, execution patterns (plan/submit/status), wallet identity,
chain/asset resolution, and common gotchas.

Evaluated with 5 realistic test prompts across yield discovery, position
monitoring, bridge comparison, protocol analysis, and swap execution.
Iteration 2 achieved 100% assertion pass rate on the critical fields
reference (health_factor gap, correct field names).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6c472f63ad

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread skills/defi-cli/SKILL.md

## Gotchas

1. **`--provider` is always required** for lending, yield positions, swap, and bridge commands. There's no auto-selection — you must choose.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Correct provider-flag guidance for yield/bridge commands

This guidance is inaccurate and will cause command failures: yield positions does not accept --provider (it uses optional --providers), and not all bridge subcommands require a provider (bridge list/bridge details have no provider flag). I verified this against defi yield positions --help and defi bridge list --help, and in internal/app/runner.go where yield positions defines only --providers; agents following this line will issue invalid flags and fail on otherwise valid workflows.

Useful? React with 👍 / 👎.

… clarity

- Add "Agent Skill" section to README with `npx skills add` instructions
- Add skill install block to docs/installation.mdx
- Add skill install section to docs/agents/overview.mdx
- SKILL.md: add smoke test commands after install
- SKILL.md: add error handling pattern for scripts
- SKILL.md: remove redundant --json flag from agent-essential table
- SKILL.md: tighten wording for clarity

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: edab51b25f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread skills/defi-cli/SKILL.md

These are the exact field names returned by the most-used commands. Use these with `--select` for precise field projection.

**`lend markets` / `lend rates`**: `protocol`, `provider`, `chain_id`, `asset_id`, `provider_native_id`, `provider_native_id_kind`, `supply_apy`, `borrow_apy`, `tvl_usd`, `liquidity_usd`, `source_url`, `fetched_at`
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Correct lend rates field list in skill output schema

The combined lend markets/lend rates field list is incorrect for lend rates: it documents tvl_usd and liquidity_usd but omits utilization. In the actual model (internal/model/types.go, LendRate), lend rates returns utilization and does not include TVL/liquidity fields, so agents following this guidance will use invalid --select/jq fields and silently drop the real rate-specific metric from automation.

Useful? React with 👍 / 👎.

The `npx skills add` CLI looks for skills under `skills/` at the repo
root, not `.claude/skills/`. Move to the standard location so
`npx skills add ggonzalez94/defi-cli` works out of the box.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant