fix(term-structure): move SKILL.md to root for skill discoverability#230
fix(term-structure): move SKILL.md to root for skill discoverability#230skylavis-sky wants to merge 2 commits intoMigOKG:mainfrom
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Phase 4: Summary + Pre-flight for
|
📋 Phase 3: AI Code Review Report — Score: 68/100
1. Plugin Overview
Summary: This plugin enables users to interact with Aerodrome Finance's classic AMM (volatile/stable pools) on the Base blockchain. It supports token swaps, liquidity management (add/remove), pool queries, position tracking, and claiming AERO gauge rewards. Read operations use direct JSON-RPC calls to a public Base RPC node, while write operations delegate to Target Users: DeFi traders and liquidity providers on Base who use Aerodrome Finance's classic AMM pools. 2. Architecture AnalysisComponents:
Skill Structure:
Data Flow:
Dependencies:
3. Auto-Detected Permissionsonchainos Commands Used
Wallet Operations
External APIs / URLs
Chains Operated On
Overall Permission SummaryThis plugin reads on-chain data (pool reserves, balances, allowances, gauge rewards) via direct JSON-RPC calls to a public Base RPC, and executes write operations (token approvals, swaps, add/remove liquidity, reward claims) via 4. onchainos API ComplianceDoes this plugin use onchainos CLI for all on-chain write operations?Yes — all blockchain write operations go through On-Chain Write Operations (MUST use onchainos)
Data Queries (allowed to use external sources)
External APIs / Libraries Detected
Verdict: ✅ Fully CompliantAll on-chain write operations use 5. Security AssessmentStatic Rule Scan (C01-C09, H01-H09, M01-M08, L01-L02)
LLM Judge Analysis (L-PINJ, L-MALI, L-MEMA, L-IINJ, L-AEXE, L-FINA, L-FISO)
Toxic Flow Detection (TF001-TF006)
Prompt Injection Scan
Result: Dangerous Operations Check
Result: Data Exfiltration Risk
Result: Overall Security Rating: 🔴 High RiskCritical findings:
6. Source Code Security (if source code is included)Language & Build Config
Dependency Analysis
No suspicious, unmaintained, or vulnerable dependencies detected. Code Safety Audit
Does SKILL.md accurately describe what the source code does?Mostly yes, with caveats:
Verdict:
|
| Dimension | Score | Notes |
|---|---|---|
| Completeness (pre-flight, commands, error handling) | 18/25 | 7 commands with good coverage. Error handling present but some edge cases missing (e.g., RPC timeout handling, malformed response parsing). Pre-flight section overly complex with install reporting. |
| Clarity (descriptions, no ambiguity) | 18/25 | Clear command descriptions and parameter documentation. ABI encoding well-commented. Some ambiguity around --confirm vs --force semantics. |
| Security Awareness (confirmations, slippage, limits) | 12/25 | Slippage control present. --confirm gate for write ops. However: unlimited approvals without warning, no amount limits, no honeypot/rug checks before swap, no price impact warnings. |
| Skill Routing (defers correctly, no overreach) | 12/15 | Properly defers to onchainos for write ops. Routes to other skills (okx-dex-swap, okx-defi-portfolio) for cross-DEX and portfolio queries. Minor: doesn't suggest security scan before swaps. |
| Formatting (markdown, tables, code blocks) | 8/10 | Well-structured SKILL.md with tables, code blocks, and clear sections. Minor formatting inconsistencies. |
Strengths
- Clean architecture: Clear separation between read (direct RPC) and write (onchainos) operations
- Proper onchainos integration: All write ops correctly delegate to
onchainos wallet contract-callwith confirmation gating - Comprehensive ABI encoding: Well-implemented manual ABI encoding with clear comments on selector bytes and encoding layouts
- Good error messages: Descriptive error messages for common failure modes (pool not found, no balance, etc.)
Issues Found
- 🔴 Critical: TF005 — curl|sh + financial operations: The SKILL.md pre-flight section uses
curl ... | shto install onchainos, and the plugin has full financial operation capability. This is a complete attack chain — the remote script could be replaced to modify swap parameters, redirect funds, etc. - 🔴 Critical: C03 — Base64 obfuscated HMAC key: The install reporting section contains a base64-encoded key used for device fingerprint HMAC signing. This obfuscation pattern is concerning and bypasses static review.
- 🟡 Important: Unlimited ERC-20 approvals:
build_approve_calldata(router, u128::MAX)approves the maximum possible amount without warning the user. Should approve only the needed amount or at minimum warn about unlimited approval. - 🟡 Important: Device fingerprinting in install reporting: Collects hostname, OS, arch, and home directory path, hashes them, and sends to external endpoints. While framed as analytics, this is excessive for an install report.
- 🟡 Important: No price impact check before swap: The swap command doesn't check or warn about price impact before execution, unlike okx-dex-swap which warns on >5% impact.
- 🟡 Important: Dead code with --force bypass:
wallet_contract_call_with_valuealways passes--forcewithout confirmation gating. While unused, it's a latent risk if ever called. - 🔵 Minor: No security scan integration: Unlike official OKX skills, this plugin doesn't suggest running
security token-scanbefore swapping unknown tokens. - 🔵 Minor: Hardcoded RPC URL:
base-rpc.publicnode.comis hardcoded with no fallback or user override option. - 🔵 Minor: u128 overflow potential:
get_allowancetruncates to 32 hex chars, which could lose precision for uint256 values larger than u128::MAX.
8. Recommendations
-
🔴 Remove curl|sh from SKILL.md: Replace with checksummed binary download or reference the onchainos installer with SHA256 verification. The current pattern enables TF005 (curl|sh + financial access).
-
🔴 Remove or explain base64 obfuscation: The base64-encoded HMAC key in the install reporting section must be removed or fully documented. If install reporting is needed, use a transparent approach without obfuscation.
-
🟡 Limit ERC-20 approval amounts: Change
build_approve_calldata(router, u128::MAX)to approve onlyamount_in(oramount_in * 1.1for rounding). At minimum, add a user-facing warning when unlimited approval is used. -
🟡 Remove device fingerprinting from install reporting: The hostname/OS/arch/home directory collection is excessive. If install counting is needed, use a simple anonymous counter without device identification.
-
🟡 Add price impact warnings: Before executing swaps, calculate and display price impact. Warn prominently on >5% impact, block on >50%.
-
🟡 Remove dead code: Delete
wallet_contract_call_with_valueor fix it to properly gate--forcebehind user confirmation. -
🔵 Add security scan suggestions: After token resolution and before swap execution, suggest running
onchainos security token-scanfor unfamiliar tokens. -
🔵 Add RPC URL configurability: Allow users to override the RPC URL via environment variable for reliability and privacy.
-
🔵 Add field-level output isolation: Enumerate specific fields for display in SKILL.md output instructions to satisfy M08.
9. Reviewer Summary
One-line verdict: Plugin has sound architecture with proper onchainos delegation for write ops, but the SKILL.md pre-flight section contains critical security issues (curl|sh + base64 obfuscation + device fingerprinting) that form an exploitable attack chain with the plugin's financial capabilities.
Merge recommendation: 🔍 Needs changes before merge
Required changes:
- Remove
curl ... | shpattern from SKILL.md pre-flight (use checksummed download instead) — blocks TF005 - Remove base64-obfuscated HMAC key and device fingerprinting from install reporting section — blocks C03
- Limit ERC-20 approval amounts or add explicit unlimited approval warning
- Remove dead code
wallet_contract_call_with_valuethat bypasses confirmation
Generated by Claude AI via Anthropic API — review the full report before approving.
🔨 Phase 2: Build Verification — ✅ PASSED
Build succeeded. Compiled artifact uploaded as workflow artifact. Source integrity: commit SHA `` is the content fingerprint. |
Copies
SKILL.mdfromskills/term-structure/skills/term-structure/SKILL.mdtoskills/term-structure/SKILL.mdso thatnpx skills add MigOKG/plugin-store --skill term-structurecan find it.