Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add instructions/refraction-ray/xalpha/agents-mdgit clone --depth 1 https://github.com/refraction-ray/xalphaWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00917 | $0.00917 |
| Opus 5 | $0.00458 | $0.00458 |
| Sonnet 5 | $0.00183 | $0.00183 |
| Haiku 4.5 | $0.00092 | $0.00092 |
Grade A, and why
xalpha AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 43 lines — stays where its author put it; the contents beside it link to each section on GitHub.
XAlpha Agent Platform Guidelines
Welcome to xalpha. This document defines the operational rules for AI agents and contributors.
Core Identity: xalpha is not just a quantitative finance Python library—it is an AI Agent Platform. Agents are expected to use natural language instructions to automatically write xalpha code, perform financial data mining, backtest strategies, and generate analytical reports.
1. The Agentic Workflow
When a user asks for financial analysis or data mining via natural language:
- Understand the Domain: Use
xalpha.universal,xalpha.fundinfo, andxalpha.policyas your primary tools. - Write Scripts: Do not just explain how to do it; write and execute Python scripts utilizing
xalphato fetch real data, compute metrics (e.g., XIRR, volatility, correlation), and save results. - Be Proactive: If a data source (like Investing.com or Xueqiu) throws an error or requires an ID mapping, autonomously debug and ask the user for the fix plan.
- Synthesize: Present the final financial analysis clearly to the user, backed by the data you mined.
2. Core Compatibility Contracts
Code written or modified by agents MUST be broadly compatible across the scientific Python ecosystem:
- Pandas 1.x up to 3.x: Handle frequency format changes (
"M"vs"ME"). Always wrap HTML strings inio.StringIO()beforepd.read_html(). Use explicitly strict type casting (.astype(float)) to avoidLossySetitemError. - Numpy 1.x through 2.x: Avoid deprecated aliases like
np.float. Usefloatornp.float64.
3. Data Scraping & API Resilience
xalpha heavily relies on web scraping (beautifulsoup4) and API endpoints.
- Robust Parsing: Upstream HTML changes frequently. Avoid fragile exact string matches
soup.find(string="text"). Use iterative tag searching andget_text(strip=True). - Graceful Fallbacks: If an endpoint fails (e.g., anti-scraping on Investing.com), agents should implement or utilize fallback logic (e.g., JSON APIs vs HTML parsing) and use the
rgetdecorator for network resilience. - Never Break the DataFrame: Ensure that any updated scraping logic exactly restores the original DataFrame schema expected by
xalpha.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 43 lines · 917 tokens per session scan A 11ed3f699684
xalpha AGENTS.md is an instructions file published in the GitHub repository refraction-ray/xalpha (2,688 stars, last pushed 1mo ago), licensed MIT. It adds 917 tokens to every session, about $0.0046 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other instructions, from other repositories
machine-learning-for-trading copilot-instructions.md
Instructions for stefan-jansen/machine-learning-for-trading, covering repository conventions for code review, prose and comment style, notebooks, data schema and results and dataframes.
DeepTraderX AGENTS.md
Instructions for armandcismaru/DeepTraderX, covering agents.md — guidance for ai agents working on deeptraderx, 1. what this project is, 2. how to run & verify, from repo root and expect occasional flaky trials.
DeepTraderX CLAUDE.md
Instructions for armandcismaru/DeepTraderX, covering claude.md, quick reference and things to remember (high-signal).
metatrader-mcp-server CLAUDE.md
Instructions for ariadng/metatrader-mcp-server, covering claude development guide - metatrader mcp server, project overview, architecture (3 packages), 1. metatraderclient - core mt5 library and 2. metatradermcp - mcp server.
nhplug-sdk AGENTS.md
Instructions for PLUG-OpenAPI/nhplug-sdk, covering agents.md — nh투자증권 open api 개발 규칙 (ai 에이전트용), 설치 — pip install nhplug (패키지명 nhplug, 저장소명 nhplug-sdk), 저장소 개요, 🗺️ 파일 지도 — 무엇을 알고 싶을 때 어디를 여는가 and 문서 (source of truth) — 도메인이 정본(ssot).
thai-personal-finance-planner CLAUDE.md
Claude Code instructions for satasuk03/thai-personal-finance-planner, covering claude.md, quick orientation for claude, before you start editing, where you'll be tempted to do the wrong thing and "i'll just add this section to skill.md".