feat: add defi-cli agent skill for Claude Code#51
Conversation
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>
There was a problem hiding this comment.
💡 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".
|
|
||
| ## Gotchas | ||
|
|
||
| 1. **`--provider` is always required** for lending, yield positions, swap, and bridge commands. There's no auto-selection — you must choose. |
There was a problem hiding this comment.
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>
There was a problem hiding this comment.
💡 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".
|
|
||
| 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` |
There was a problem hiding this comment.
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>
Summary
.claude/skills/defi-cli/SKILL.md) that teaches AI agents how to use defi-cli effectivelylend markets,lend positions,yield opportunities,bridge quote,swap quote, andprotocols fees— so agents use correct field names in--selectandjqpipelineshealth_factorfield; 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:
Key improvements from the skill:
--amount) instead of ambiguous--amount-decimal--selectandjq(supply_apy/borrow_apy, notsupply_apr/variable_borrow_apy)Test plan
.claude/skills/defi-cli/to~/.claude/skills/🤖 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 usedefiwith correct flags, output fields, exit-code handling, and theplan→submit→statusexecution pattern (including key gotchas like missinghealth_factor).Updates
README.md,docs/agents/overview.mdx, anddocs/installation.mdxto advertise installing the skill vianpx 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.