Agent skills
Agent skills are markdown files that AI agents read as context or instructions. They teach the agent how to use the@contextwtf/sdk to interact with Context Markets — from reading market data to placing orders and managing wallets.
The skills live in the @contextwtf/sdk package under the skills/ directory.
Available skills
The skill system has 4 files, designed to be loaded together or individually depending on context window size:SKILL.md — entry point
~130 lines. Start here. Covers:- What Context Markets is and what the SDK does
- Installation and initialization (read-only vs. trading client)
- The 3 signer formats (private key, viem account, wallet client)
- Overview of the 4 core modules (markets, orders, portfolio, account)
- 8 critical rules (prices in cents, outcomes as “yes”/“no”, must call
setup()before trading, etc.) - 3 quick recipes: list markets, place an order, wallet setup
api-reference.md — full method signatures
~760 lines. Complete reference for every method across all 4 modules:ctx.markets— 11 methods:list,get,quotes,orderbook,simulate,priceHistory,oracle,oracleQuotes,requestOracleQuote,activity,globalActivityctx.orders— 13 methods:list,listAll,mine,allMine,get,recent,simulate,create,cancel,cancelReplace,bulkCreate,bulkCancel,bulkctx.portfolio— 5 methods:get,claimable,stats,balance,tokenBalancectx.account— 9 methods:status,setup,mintTestUsdc,deposit,withdraw,mintCompleteSets,burnCompleteSets,relayOperatorApproval,relayDeposit
Market, Order, error classes).
patterns.md — common workflows
~1000 lines. Recipes and patterns for real-world usage:- Client setup patterns (read-only vs. trading, signer formats)
- Wallet onboarding sequence (the critical
status → setup → mint → depositflow) - Market discovery and pagination
- Order lifecycle (place, check, cancel, replace, bulk)
- Error handling (3 error types with recovery paths)
- Polling and monitoring patterns
- 9 gotchas and pitfalls (must
setup(), prices in cents not decimals, testnet-only mint, no env var reading, and more)
examples.md — copy-paste scripts
~230 lines. Six self-contained TypeScript scripts:- Read-only market scanner — browse markets and print quotes (no auth)
- Place a buy order — full flow from wallet setup to order placement to cancellation
- Portfolio dashboard — fetch positions, balances, claimable, and stats in parallel
- Market monitoring loop — poll prices on an interval with change detection
- Bulk operations — place a ladder of orders and cancel them all
- Orderbook analysis — fetch books, calculate spread and depth, detect crossed books
How to use
Load the skill files into your agent’s context window. The method depends on your agent framework:| Framework | How to load |
|---|---|
| Claude Code | Add to your project’s CLAUDE.md or use as a skill file |
| Cursor | Add to .cursor/rules or reference in project settings |
| Copilot / Codex | Include in system prompt or project instructions |
| Custom agents | Read the files and include in your LLM’s system or user message |
SKILL.md alone provides enough to get started.