xalpha: Instructions file for Codex

AGENTS.md

xalpha AGENTS.md is an instructions file for Codex, OpenCode from refraction-ray/xalpha. It costs 917 tokens per session, scanned A, original, MIT.

A set of project instructions for xalpha, a Python platform for financial data analysis, strategy backtesting, and report generation.

In plain words
What is it for?
Use it for financial analysis, data mining, investment-strategy backtesting, and analytical reports built with xalpha.
Why use it?
It tells an agent how to handle financial requests, fetch data, calculate measures, deal with unreliable data sources, and present evidence-backed results.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md.

This is refraction-ray/xalpha's own configuration. It tells Codex and OpenCode how to work on xalpha itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything xalpha configures →

About the project

xalpha is a Python toolkit for managing and analyzing fund investments, including market-data retrieval, portfolio records, visualization, and strategy backtesting. It is for investors and quantitative researchers who track recurring or grid-based investments across financial markets, including through supported quantitative platforms. The catalogue add-ons provide agent workflows for using xalpha.

refraction-ray/xalpha · 2,746 stars · on GitHub · xalpha.readthedocs.io

Reuse

Borrowing it

Nothing to install: this file belongs to refraction-ray/xalpha. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/refraction-ray/xalpha/master/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/refraction-ray/xalpha

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for xalpha AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/refraction-ray/xalpha/agents-md/github.svg)](https://agentmods.dev/instructions/refraction-ray/xalpha/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/refraction-ray/xalpha/agents-md"><img src="https://agentmods.dev/badge/instructions/refraction-ray/xalpha/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for xalpha AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/refraction-ray/xalpha/agents-md"><img src="https://agentmods.dev/badge/instructions/refraction-ray/xalpha/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 917 This file is loaded in full into every session.
When invoked 917 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What 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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00917 $0.00917
Opus 5.5 $0.00367 $0.00367
Sonnet 5.5 $0.00183 $0.00183
Haiku 4.5 $0.00092 $0.00092

Measured 2mo ago against content hash 11ed3f699684, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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 2mo 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.

AGENTS.md · 43 lines

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, and xalpha.policy as your primary tools.
  • Write Scripts: Do not just explain how to do it; write and execute Python scripts utilizing xalpha to 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 in io.StringIO() before pd.read_html(). Use explicitly strict type casting (.astype(float)) to avoid LossySetitemError.
  • Numpy 1.x through 2.x: Avoid deprecated aliases like np.float. Use float or np.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 and get_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 rget decorator for network resilience.
  • Never Break the DataFrame: Ensure that any updated scraping logic exactly restores the original DataFrame schema expected by xalpha.

Read the full file on GitHub · 43 lines

Changes

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.

  1. 2mo ago First seen · 43 lines · 917 tokens per session scan A 11ed3f699684

Subscribe to this mod's changes

xalpha AGENTS.md is an instructions file published in the GitHub repository refraction-ray/xalpha (2,746 stars, last pushed 3mo ago), licensed MIT. It adds 917 tokens to every session, about $0.0037 per session on Opus 5.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.

Related

xalpha AGENTS.md compared with instructions from other repositories

xalpha AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
xalpha AGENTS.mdrefraction-ray/xalphaInstructions file2.7k3mo agoMITA917Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,516GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode