本文へ移動
cccskills
無料GitHub で公開

trader-broker

Order Executor. Places APPROVED orders through your brokerage connector, one at a time, and never without your explicit yes. Shows each order as a plain ticket plus the exact JSON for Alpaca's place_stock_order, records your yes word for word, then Claude's own Allow once / Deny card asks again. Covers setting up Alpaca's official MCP server in Claude Desktop (paper trading by default, keys in env vars, never in chat), the Interactive Brokers connector (orders go to your IBKR account for your approval), and setting order tools to "Needs approval". Use when the user says "place the orders", "buy it", "execute", "send it to my broker", "connect Alpaca", "connect Interactive Brokers", "set up paper trading", or after /trader-risk passes.

日本語の概要は準備中です。原文の説明を表示しています。

連携ツールInteractive Brokers

実行スコア 未検証

インストール方法を見る

含まれるファイル(3)

  • SKILL.md8.3 KB
  • claude_desktop_config.example.json378 B
  • ticket.py21.0 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

trader-broker

The Order Executor is the only skill in this pack that can lead to a real order, so it is the strictest. An order reaches the market only after three separate gates, every time, for every order:

  1. trader-risk passed this exact order today (matched by fingerprint).
  2. The user typed an explicit yes for this one order in the chat.
  3. The user clicked Allow once on Claude's own permission card, which appears because the order tool is set to "Needs approval".

Two yeses from the user, one PASS from the rules. No yes, no order.

${CLAUDE_SKILL_DIR} below is this skill's folder (where this SKILL.md lives).

python3 "${CLAUDE_SKILL_DIR}/ticket.py" show                     # every ticket, READY or not
python3 "${CLAUDE_SKILL_DIR}/ticket.py" approve --index 1 --reply "yes"
python3 "${CLAUDE_SKILL_DIR}/ticket.py" result --index 1 --status placed --broker-id ID
python3 "${CLAUDE_SKILL_DIR}/ticket.py" fill --symbol AAPL --side buy --qty 3.6628 --price 341.27
python3 "${CLAUDE_SKILL_DIR}/ticket.py" log

ticket.py never talks to a broker. It renders tickets, checks that a reply is a real yes for that order, and keeps the log in trader/state/broker.json.

Setup A: Alpaca (official MCP server, Claude Desktop)

Alpaca's own server is github.com/alpacahq/alpaca-mcp-server (MIT). It runs on the user's computer inside Claude Desktop. It is not in Claude's connector directory. It trades on a paper account unless told otherwise.

  1. The user makes an Alpaca account and creates paper trading API keys in the Alpaca dashboard. Paper keys are separate from live keys.
  2. The user installs uv (it provides uvx), from docs.astral.sh/uv.
  3. In Claude Desktop: Settings > Developer > Edit Config. That opens claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/, Windows: %APPDATA%\Claude\). The user adds this block (also in claude_desktop_config.example.json here) and types their own keys into the file:
{
  "mcpServers": {
    "alpaca": {
      "command": "uvx",
      "args": ["alpaca-mcp-server"],
      "env": {
        "ALPACA_API_KEY": "paste your paper key here, in this file only",
        "ALPACA_SECRET_KEY": "paste your paper secret here, in this file only",
        "ALPACA_PAPER_TRADE": "true",
        "ALPACA_TOOLSETS": "account,trading,stock-data"
      }
    }
  }
}

The env block hands the keys to the server as environment variables. Keys never go in the chat. Never ask for them, never read this file back into the conversation, and if the user pastes a key anyway, tell them to delete that message and make new keys in the Alpaca dashboard. ALPACA_PAPER_TRADE is already true by default; writing it makes it visible. ALPACA_TOOLSETS is optional and hides the tools they do not need. 4. Restart Claude Desktop. 5. Set the tool permissions. Customize > Connectors (Settings > Connectors in older versions), open alpaca, and for each tool pick Always allow, Needs approval or Blocked:

  • place_stock_order: Needs approval. Never Always allow.
  • every other tool that places, changes, cancels or closes anything (cancel_order_by_id, close_position, update_account_config): Needs approval.
  • place_option_order, place_crypto_order, close_all_positions, cancel_all_orders, exercise_options_position: Blocked unless the user has a reason and says so.
  • read-only tools (get_account_info, get_all_positions, get_stock_snapshot, get_stock_latest_quote): Always allow is fine.
  1. Check it: ask Claude for the Alpaca account info (read only) and confirm in the Alpaca dashboard that it is the paper account.

In Claude Code instead of Claude Desktop, keep the order tool on ask in .claude/settings.json: "permissions": {"ask": ["mcp__alpaca__place_stock_order"]}, and never put an order tool in allow.

Setup B: Interactive Brokers (connector in Claude's directory)

Interactive Brokers publishes a verified connector: claude.ai/directory/interactive-brokers (connector URL https://api.ibkr.com/v1/api/mcp). Add it from Customize > Connectors > Browse connectors and sign in to IBKR there, not in the chat. Its listing says Claude can draft trade instructions that are sent to the user's IBKR account for their review and approval, and that Claude never submits orders directly to the market. So with IBKR the final yes happens in IBKR as well. Set "broker": "ibkr" in trader/config.json, and size with --whole-shares if IBKR wants share counts. Set its tools that draft orders to Needs approval too.

Steps, for each order

  1. ticket.py show. Only READY tickets go to the user. A ticket that is NOT READY or BLOCKED goes back to /trader-risk.
  2. Show ONE ticket and ask: "Place this order? Reply yes or no." One order per question. Never offer "yes to all".
  3. Run ticket.py approve --index N --reply "<the user's reply, word for word>". If it prints "Not recorded", the reply was not an explicit yes for this order (for example "sure", "yes to all", or a yes that names a different stock or amount). Ask again. Never turn a reply into a yes yourself.
  4. Only after "Recorded your yes", call place_stock_order with exactly the JSON the ticket printed. Claude's card appears: Allow once or Deny.
  5. Record what happened: ticket.py result --index N --status placed --broker-id <id from the response>, or --status denied if they pressed Deny, or --status failed with --note for an error. A failed order is not retried without a new check and a new yes.
  6. When the fill is known (the tool's response, or later from get_all_positions), ticket.py fill adds it to trader/portfolio.json as a tax lot for trader-tax. Then the next ticket.

Example: the reel

ORDER 1 of 5, PAPER account, Alpaca
  BUY $1,250 of AAPL, market order, good for today
  READY: trader-risk PASS, waiting for your yes
  Claude will call place_stock_order with exactly:
    {"symbol": "AAPL", "side": "buy", "notional": "1250",
     "type": "market", "time_in_force": "day"}

The user replies "yes". Claude records it, calls place_stock_order, and the card reads "Claude wants to use Place stock order" with that JSON and two buttons: Allow once, Deny. Allow once sends it to the paper account.

What it never does

  • Never places an order without all three gates, and never two orders on one yes.
  • Never places orders from a scheduled or background task: nobody is there to say yes.
  • Never asks for, reads, stores or repeats API keys or passwords.
  • Never switches ALPACA_PAPER_TRADE or "paper" to live. The user does that themselves.
  • Never calls close_all_positions, cancel_all_orders, option or crypto order tools on its own.

Safety

  • Education and tooling, not financial advice. No order here is a recommendation, and nothing promises returns.
  • Paper trading by default ("paper": true, ALPACA_PAPER_TRADE true). Going live is the user's own decision.
  • Nothing in this pack places an order except trader-broker, and only when all three hold: trader-risk passed that exact order today, the user typed an explicit yes for that one order in the chat, and the user clicked Allow once on Claude's own card because the order tool is set to "Needs approval" (Customize > Connectors > tool permissions). Never set an order tool to "Always allow".
  • No options, margin, short selling or leverage unless the config allows it and the user confirms.
  • Broker keys live in environment variables or the Claude Desktop config, never in the chat.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

Price Alerts. Rings when a price target, a stop or the opening bell hits: above / below / stop rules, percent moves from the previous close, and the NYSE opening bell, each ringing once so you are not spammed. Knows NYSE hours with the 2026 and 2027 holidays and 1:00 p.m. early closes, fetches free delayed quotes (Yahoo chart JSON, Stooq CSV) one ticker at a time, and writes trader/prices.json for the other skills. Use when the user says "alert me when", "tell me if AAPL hits", "set a stop", "price target", "watch my stocks", "is the market open", "when does the market open", "get me prices", or to refresh prices before sizing, risk or tax.

日本語の概要は準備中です。原文の説明を表示しています。

Jakeschincariol/trader-skill4502026年10月15日 更新

The Earnings Analyst. Reads a company's reported numbers straight from SEC EDGAR (XBRL company facts from its 10-Qs and 10-Ks, plus the latest earnings 8-K and its press release) and sums up what changed: revenue, gross, operating and net margins, net income and diluted EPS, quarter by quarter, each against the same quarter a year earlier, with the trailing twelve months. Writes a metrics file the screener reads. Use when the user says "how did Apple's earnings look", "analyze the earnings", "what changed this quarter", "is revenue growing", "check the 10-Q", "compare margins", or "run the analyst on my holdings".

日本語の概要は準備中です。原文の説明を表示しています。

Jakeschincariol/trader-skill4502026年10月15日 更新

Budget Manager. Sizes every position to your budget before anything is bought: keeps a cash buffer, caps any one stock (the excess is shared out to the others), drops slices under your minimum order, rounds so every dollar is used, supports fractional or whole shares, and writes the proposed buy orders to trader/orders.json in the exact shape of Alpaca's place_stock_order (notional as a string). Nothing is placed. Use when the user says "I have $5,000", "size my trades", "how much of each should I buy", "manage my budget", "split my money", "keep 10% in cash", "no stock over 25%", "set my rules", or after /trader-copycat writes targets.

日本語の概要は準備中です。原文の説明を表示しています。

Jakeschincariol/trader-skill4502026年10月15日 更新

The Reverse Engineer. Reads a famous investor's public SEC filings (the quarterly 13F-HR, plus Form 4 if you want the insider trades) and rebuilds their portfolio as weights you can copy: every position, its share of the fund, what they bought, added, trimmed and sold since the last quarter, with tickers matched to every CUSIP. Then it writes trader/targets.json so the budget skill can size it to your money. Use when the user says "copy Buffett", "copy Berkshire", "what does Ackman own", "reverse engineer this investor", "show me their 13F", "what did they buy last quarter", "copy the top 5", or names any fund or famous investor.

日本語の概要は準備中です。原文の説明を表示しています。

Jakeschincariol/trader-skill4502026年10月15日 更新

The News Monitor. Watches breaking market news and SEC filings for the stocks you hold (or are about to copy): Yahoo Finance headlines per ticker and each company's 8-K filings on SEC EDGAR (earnings, CEO changes, deals, restatements, bankruptcy). Shows only what is new since the last check, newest first, flags what touches your positions and why it matters, and never repeats an item. Use when the user says "any news on my stocks", "what's happening with Apple", "monitor the news", "watch my portfolio", "did anything break", "check the 8-Ks", or "morning briefing".

日本語の概要は準備中です。原文の説明を表示しています。

Jakeschincariol/trader-skill4502026年10月15日 更新

The Pelosi Tracker. Watches the stock trades members of Congress must disclose under the STOCK Act: reads the House Clerk's public Periodic Transaction Reports (PTRs) as soon as they are posted, alerts once per new filing, and turns each PDF into clean rows (who, owner, stock, ticker, buy or sell, options strike and expiry, trade date, amount range, how many days it took to disclose). Flags trades in stocks you hold. Senate reports are covered by a documented manual route. Use when the user says "what is Pelosi buying", "track Nancy Pelosi", "Congress trades", "politician stock trades", "did any congressman buy X", "alert me when Pelosi files", or "run the Pelosi skill".

日本語の概要は準備中です。原文の説明を表示しています。

Jakeschincariol/trader-skill4502026年10月15日 更新

Jakeschincariol のスキルをすべて見る

このスキルの問題を報告する