Examples & agent skills
git clone https://gitlab.com/cotes-ai-public/spectraledge-examples.gitcd spectraledge-examplesexport SPECTRALEDGE_API_KEY=cotes_sk_...Sample apps
Section titled “Sample apps”| Sample | Language | Does |
|---|---|---|
python/stream_client.py |
Python | Prints contest.opened, signal.emitted and contest.settled events; reconnects with backoff |
node/stream.ts |
TypeScript / Node | The same with fetch and no runtime dependencies |
python/discord_alerts.py |
Python | Posts each new signal to a Discord webhook, with an optional --min-confidence |
python/paper_trade_logger.py |
Python | Logs each signal next to Kalshi’s current ask to CSV; never places orders |
cd python && uv run stream_client.py # Python 3.10+cd node && npm start # Node 22.18+The stream clients follow the rules in Streaming (SSE): one stream instead of polling, backoff from 1 s to 30 s with jitter, Last-Event-ID resume, a reconnect after 45 s without bytes, and a clean exit on 401, 402 or the in-stream unauthorized event. spectraledge_stream.py and sse.ts are importable on their own.
Agent skills
Section titled “Agent skills”agent-skills/ is a Claude Code plugin (spectraledge-signals) with five skills. The analysis runs in a bundled standard-library Python script, so hundreds of contests never pass through the model’s context.
| Skill | Answers |
|---|---|
spectraledge-contest-readings |
What did the model say through the last, current or a given contest? |
spectraledge-threshold-backtest |
At my confidence threshold, how often is the first qualifying reading right, and does it beat its entry price? |
spectraledge-calibration-check |
Does 80% mean 80%, and is the model closer to the outcome than the market price? |
spectraledge-edge-backtest |
Do positive-edge readings pay off, bucket by bucket? |
spectraledge-live-watch |
Tell me when a live reading crosses my threshold, and how it settled. |
Install
Section titled “Install”Claude Code:
/plugin marketplace add https://gitlab.com/cotes-ai-public/spectraledge-examples.git/plugin install spectraledge-signals@spectraledgeclaude.ai and the Claude apps: Customize → Plugins → Add → Add marketplace, paste https://gitlab.com/cotes-ai-public/spectraledge-examples.git, then install spectraledge-signals.
Other agents: copy the whole agent-skills/ folder, keeping skills/ and scripts/ side by side.
The plugin registers the MCP server. Sign in there, or set SPECTRALEDGE_API_KEY so the script fetches from the API itself. spectraledge-live-watch needs the API key, since it reads the event stream.
Backtests report P&L before Kalshi fees, and every skill asks for your confidence threshold before counting a hit rate.
Charting indicators
Section titled “Charting indicators”cotes-ai-public/companion-indicators (MIT) has free TradingView indicators for KXBTC15M: a window and strike overlay and a distance-to-strike pane. They don’t call the API.
Contributing
Section titled “Contributing”Issues and merge requests are welcome on GitLab. Questions go to Discord.