LangAlpha is an agent workspace for researching financial markets and supporting investment decisions through persistent research, news analysis, and parallel subagents. It is for investors who want to develop and update trading theses over time, including generating long-short pair-trade ideas. The catalogue entries provide the skills, instructions, MCP servers, and plugin that make up its agent workflow.
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 skills add ginlix-ai/LangAlpha --skill portfolio-diagnosisgit clone --depth 1 https://github.com/ginlix-ai/LangAlphaWrote 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.
[](https://agentmods.dev/skills/ginlix-ai/langalpha/portfolio-diagnosis)<a href="https://agentmods.dev/skills/ginlix-ai/langalpha/portfolio-diagnosis"><img src="https://agentmods.dev/badge/skills/ginlix-ai/langalpha/portfolio-diagnosis/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.
<a href="https://agentmods.dev/skills/ginlix-ai/langalpha/portfolio-diagnosis"><img src="https://agentmods.dev/badge/skills/ginlix-ai/langalpha/portfolio-diagnosis.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00077 | $0.01529 |
| Opus 5.5 | $0.00031 | $0.00612 |
| Sonnet 5.5 | $0.00015 | $0.00306 |
| Haiku 4.5 | $0.00008 | $0.00153 |
Grade A, and why
portfolio-diagnosis 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 yesterday.
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 — 65 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Portfolio Diagnosis
A one-minute read of what the user holds, measured against what they told you they want. Every finding carries a number and what that number is compared with. No lecture and no trade calls.
1. Inputs
.agents/user/profile/portfolio.json: the holdings. When this turn already read it, use that copy.- The
## Investment Profileblock in your system prompt: its Risk level, Investor type, Experience, Markets, Wants to trade, Analysis approaches, Investing styles, Holding horizon and Sectors lines. A line may hold an older profile's free text: read what is there. When the block has no line for what you need, an older profile may keep it in a free-text key of.agents/user/profile/preference.json, such asrisk_toleranceorholding_period. With no risk level at all, report the risk numbers without a fit verdict. - A brokerage in
<mcp-servers>: take positions and cash balances from it, unless this turn already fetched them. Its quantities and market values win over the file. If they differ fromportfolio.json, say so in one line and offer to re-import. Don't write the file here. - No holdings: say the diagnosis needs them and ask for a few positions as ticker and quantity.
2. Compute, in one execute_code call
from tools.yf_price import get_multiple_stocks_history # 1y daily bars, many symbols
from tools.yf_fundamentals import get_company_info # sector, country, quoteType, category, currency
from tools.price_data import get_stock_data, get_asset_data # fallback bars; crypto and forex
- Prices: one
get_multiple_stocks_history(symbols, period="1y")holding every position, the benchmark, and any currency pairs, with crypto asBTC-USDand pairs asHKDUSD=X. It keys results by canonical symbol (600519.SH,HKD-USD), not always your spelling. Retry what lands inerrorswithget_stock_data, orget_asset_data("BTCUSD", "crypto")andget_asset_data("HKDUSD", "forex"). When a server is missing from<mcp-servers>, use the other. - Benchmark: the one for the market holding the most weight. US
SPY, Hong Kong2800.HK, mainland China510300.SH, Japan1306.T, EuropeEXSA.DE. - Base currency: the currency most of the value is in. Convert every other series at the pair's daily close, forward-filled, inverting the reverse pair when the direct one fails.
- Value and weights: quantity times the latest close, or the broker's market value. Cash counts toward the total.
- Concentration: the largest position's weight, the top five's combined weight, and effective N (1 / Σw² over invested positions). A broad index ETF is diversified on its own, so judge single-name risk without it.
- Exposure:
- Sector: from
sector, or for an ETF itscategory. - Region: from the listing. No suffix is
us,.HKishk,.SH/.SZiscn,.Tisjp, European exchanges areeu. Note it when a holding lists in one market and does business mainly in another. - Asset class: from
instrument_type. - Compare each with the stated Markets, Wants to trade and Sectors: the weight outside them, and any stated one with nothing in it. Read Wants to trade against only the values
instrument_typeshares with it (stock,etf,option,crypto,bond,fund), and skip that comparison when none of those is stated.
- Sector: from
- Cash share, and the currency mix when more than one currency is held.
- Risk: replay today's weights over the past year on the benchmark's trading days, forward-filling a holding across its own market's holidays. From that series, take annualized volatility (daily standard deviation × √252), beta to the benchmark, and the one-year maximum drawdown. Holdings with under 60 days of history stay out of the risk figures.
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.
- yesterday First seen · 65 lines · 77 tokens per session scan A fbbea1398cc8
portfolio-diagnosis is a skill published in the GitHub repository ginlix-ai/LangAlpha (1,869 stars, last pushed today), licensed Apache-2.0. It adds 77 tokens to every session and 1,529 once invoked, about $0.0003 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-10-21.
Other skills, from other repositories
creating-financial-models
This skill provides an advanced financial modeling suite with DCF analysis, sensitivity testing, Monte Carlo simulations, and scenario planning for investment decisions.
dividend-analysis
Comprehensive capital allocation analysis: dividends, buybacks, M&A, debt management, and FCF deployment.
options-analysis
Analyze options Greeks, implied volatility, and strategy selection for US stocks.
position-ladder
Plan a staged position — entry ladder, share-count floor/ceiling, and the trim/re-add cycle that lowers average cost — with lot accounting, wash-sale checks, total-return honesty, and a thesis-break exit gate.
report-generator
Generate professional HTML/PDF investment reports with interactive visualizations.
stock-eval
Evaluate US stocks with comprehensive fundamental and valuation analysis.