Demo: /borsa:hisse THYAO and /borsa:komite TUPRS in Claude Code

Ask a general-purpose chatbot about a Turkish stock and you get one of two things. Either it politely refuses, or it invents a price from its training data with total confidence. Neither helps someone looking at Borsa Istanbul (BIST) on a Tuesday afternoon.

So I built Borsa Zekâ ("market intelligence"), an open-source Claude Code plugin that turns Claude into a BIST analyst. Its centrepiece is /borsa:komite, an "investment committee": four specialist subagents analyse a stock in parallel, and a chair weighs their views into a verdict that has to show its disagreements.

This post covers how it is put together and the design rules that keep it honest. It also covers a few things I learned shipping it, which apply to anyone building a Claude Code plugin.

Everything below is informational. The tool is an analysis aid, not investment advice.

The core rule: Claude never supplies a number

LLMs are good at reasoning about markets and bad at remembering market data. The plugin's main rule follows from that: every price, indicator and headline must come from a tool call. The model's job is to read, reconcile and explain.

That rule shapes the architecture:

src/lib (one engine) ├─ yahoo.ts quotes, history, fundamentals, news ├─ indicators.ts RSI, MACD, ADX/DMI, Bollinger, ATR... ├─ analysis.ts signals + composite score (-100..100) └─ backtest.ts strategies, no look-ahead │ ├─► MCP server: stdio, 15 tools, one bundled .mjs ├─► Next.js web app: charts, screener, backtests └─► Remote MCP: Streamable HTTP, stateless 

One engine serves three surfaces. The MCP server is bundled with esbuild into a single file that ships inside the plugin, so users need nothing but Node. The web app reuses the same functions for interactive charts. A stateless HTTP endpoint exposes the read-only tools for clients that can't run local code.

The tools have Turkish names (hisse_analizi, piyasa_tarama, strateji_testi, ...) because the whole product speaks Turkish to its users. Claude handles that without any trouble.

The committee

/borsa:komite TUPRS is a skill (a Markdown file of instructions), not code. It tells Claude to act as the chair and to do four things:

  1. Prepare: read the investor profile, if one is saved, and validate the ticker with a live quote.
  2. Fan out: start four subagents in a single message, so they run concurrently. Each agent is a Markdown file with its own instructions and a narrow remit:
    • Technical analyst: trend, momentum, volume, support and resistance, and which systematic strategy has actually worked on this stock (it runs backtests).
    • Fundamental analyst: P/E, P/B, EV/EBITDA, profitability, leverage and peer comparison.
    • News analyst: company news, public disclosures and macro drivers (central bank, FX, oil).
    • Risk manager: the devil's advocate. It writes the bear case, measures volatility, drawdown, VaR and correlation, and sizes the position.
  3. Reconcile. Every specialist must end its report with one machine-readable line, DURUŞ: olumlu|olumsuz|nötr; İNANÇ: 0-100 (stance; conviction). The chair reads these lines, finds where the experts agree and disagree, and is told explicitly: don't hide the disagreement, say whose evidence is stronger.
  4. Report: a fixed format with votes, a chart, bull and bear scenarios with trigger levels, and a trading plan sized to the profile.

Here is what that looked like in a real run on TUPRS (Tüpraş, the Turkish refiner). It took 2 min 37 s:

Specialist Stance Conviction Reason
Technical Neutral 55 Lower highs below the 50-day average, no volume confirmation
Fundamental Positive 60 ROE 28%, EV/EBITDA 2.7, strong free cash flow
News Positive 62 Quarter beat estimates, margin guidance raised
Risk Neutral 55 40% volatility; reward/risk to consensus target only 1.16

Verdict: Hold, 60% confidence. The thesis is sound but the timing isn't confirmed. Instead of a buy signal the chair gave two conditional plans: buy on a pullback to a named band, or buy on a volume breakout above a named level.

That disagreement is the point of the design. A single prompt tends to flatten into one confident tone. Splitting the work into narrow roles, with one role paid to be pessimistic, gives you tension you can read. The full report is in the repo.

Guardrails that live in code, not prompts

Some honesty can't be delegated to instructions.

The backtest can't see the future. A signal is computed on a bar's close and executed at the next bar's open. Stops and take-profits that gap are filled at the open, not at the level you wished for:

// apply the previous bar's signal at this bar's open if (!inPos && target[i - 1] === 1) { entryPrice = bar.open; /* ... */ } // intrabar stop: a gap down fills at the open, not at the stop price if (sl > 0 && bar.low <= entryPrice * (1 - sl)) exit(i, Math.min(bar.open, entryPrice * (1 - sl)), "stop"); 

The data has to be cleaned before Claude sees it. Yahoo's BIST fundamentals are inconsistent. Some companies (Turkish Airlines, for example) report financials in USD while the stock trades in lira, which makes naive P/E and P/B wrong by a factor of the exchange rate. The engine detects the currency mismatch, corrects price-based ratios, and hides absurd values instead of passing them to the model.

The score is a summary, not a decision. The composite score (-100 to +100) weights trend 40%, momentum 30%, volume 15% and volatility 15%. The server instructions tell Claude to call out contradictions inside the score, for example strong trend with fading momentum, instead of reading out a label.

Turkish lira returns include inflation. The instructions remind Claude to judge performance against USD/TRY and the BIST 100 index, not in nominal lira.

Indicator and backtest logic has reference tests. CI runs type checks, lint, the tests, and an end-to-end smoke test of the bundled MCP server.

Things I learned shipping a Claude Code plugin

1. Plugins are mostly Markdown. The MCP server is the only real code. Agents, commands, the output style and the orchestration are prose. Most iterations were editing instructions, not TypeScript.

2. Charts in a terminal are worth it. A terminal_grafik tool renders a block-character price chart with support and resistance markers, and Claude shows it as-is. It turns out to be the most "wow" part of the output.

3. The Claude plugin directory has strict, sensible rules. Organizations that aren't verified can't submit plugins that ship hooks, local MCP servers or scripts. So I kept the full local plugin for the GitHub marketplace and generated a directory edition from the same source with a build script. That edition has the agents, the commands and a remote MCP server, and no local code.

The validator also flagged something I wouldn't have thought of: the edition's README told users how to install the other edition. That counts as an undeclared server. The fix was to describe the other edition without its install command.

4. Make the demo reproducible. The README GIF isn't a screen recording. It's an HTML scene rendered frame by frame through the Chrome DevTools Protocol into ffmpeg, and every number in it comes from a real run. If the output format changes, the demo can be rebuilt.

Try it

In Claude Code:

/plugin marketplace add Havali55/borsa-zeka /plugin install borsa@borsa-zeka 

Then /borsa:hisse THYAO for a single stock, /borsa:brifing for a market briefing, or /borsa:komite ASELS to convene the committee. No API key is needed, and market data is about 15 minutes delayed.

The code is MIT-licensed: github.com/Havali55/borsa-zeka. Issues tagged good first issue cover dividends, Ichimoku and an English output mode. Contributions are welcome.

Borsa Zekâ is an analysis tool. Nothing it produces is investment advice.