跳到正文
cccskills
免费在 GitHub 公开

trader-risk

Risk Manager. Checks every proposed order against your limits before it can reach the broker and blocks anything over them: blocked tickers, max order size, minimum order, max position percent after the fill, the cash buffer, margin, short sales, options and crypto (off unless allowed), malformed orders, duplicates and a daily order limit. Prints PASS or BLOCK with the reason for each order and records the verdicts so trader-broker only shows an order that passed. Use when the user says "check my orders", "is this safe", "risk check", "does this break my rules", "can I place this", or before /trader-broker, always.

中文简介正在准备中。当前显示原文说明。

实测评分 未实测

查看安装方法

包含的文件(2)

  • SKILL.md5.2 KB
  • check.py17.2 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

trader-risk

The Risk Manager is the gate between a proposal and the broker. Every order written by trader-budget, trader-rebalance or trader-tax passes through it. A BLOCK is final for that order: it does not go to the user for a yes, and it does not go to the broker.

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

python3 "${CLAUDE_SKILL_DIR}/check.py"             # trader/ files; writes trader/state/risk.json
python3 "${CLAUDE_SKILL_DIR}/check.py" --json
python3 "${CLAUDE_SKILL_DIR}/check.py" --no-write  # look without recording

What it reads and writes

filewhat
trader/orders.jsonthe proposed orders
trader/config.jsonthe limits (trader-budget ships config.example.json)
trader/portfolio.jsoncash and holdings; if missing, a fresh account funded with the budget
trader/prices.jsonneeded to size share-count orders and value holdings
trader/state/broker.jsonwhat was placed today, for duplicates and the daily limit
trader/state/risk.jsonthe verdicts it writes, with a fingerprint of each exact order

The checks

Orders are checked in file order, as if each passed order had filled, so a batch that is fine order by order but breaks a rule together is caught.

checkblocks when
formatno symbol, side not buy or sell, both or neither of qty and notional, a notional order that is not market + day (Alpaca's rule), a limit order with no limit price
assetan option symbol while allow_options is false; crypto or anything that is not a US stock or ETF ticker
blockedthe ticker is on the blocked list
sizeunder min_order_usd or over max_order_usd
positionthe stock would be over max_position_pct of the account after the fill
cashthe buy would leave less than the cash buffer, or need margin (allow_margin false)
shorta sell of more than you hold (allow_short false)
duplicatethe same symbol and side twice in one batch, or already placed today
daily limitmore than max_orders_per_day placed today

Warnings do not block, but say them to the user: a LIVE account, a number sent as a number instead of a string, an advanced (bracket) order.

Steps

  1. Make sure trader/prices.json is fresh if any order is a share count or any holding needs a value (trader-alerts: alerts.py quote --holdings --write).
  2. Run check.py. Exit code 0 means every order passed, 1 means at least one was blocked.
  3. Tell the user the result in plain words, order by order. For a BLOCK, give the reason and the fix (a smaller amount, a different stock, or a rule the user may decide to change). Never change a limit yourself.
  4. If the orders change in any way, run the check again. trader-broker matches each order to its verdict by fingerprint, so an edited order is not ready until it passes again, and a verdict from yesterday does not count today.

Example: the reel

The five buys from trader-budget (AAPL $1,250, AXP $1,119, GOOGL $823, KO $708, BAC $600) on a fresh $5,000 paper account with the example config:

PASS  #1 buy AAPL $1,250
PASS  #2 buy AXP $1,119
PASS  #3 buy GOOGL $823
PASS  #4 buy KO $708
PASS  #5 buy BAC $600
5 passed, 0 blocked. Cash after the passed orders: $500 (paper account).

AAPL lands exactly on the 25% cap ($1,250 of $5,000), which is allowed. A sixth order, another $100 of AAPL, is blocked three ways: it would dip into the $500 cash buffer, put AAPL over its 25% cap, and repeat AAPL in the same batch.

What it never does

It never places an order, never edits an order to make it pass, never loosens a limit, and never treats a PASS as the user's yes. A PASS only means the order is allowed to be shown to the user.

Safety

  • Education and tooling, not financial advice. A PASS is a rules check, not a recommendation.
  • Paper trading by default ("paper": true). Going live is the user's own decision, in their own config.
  • 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-skill5172026年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-skill5172026年10月15日 更新

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.

中文简介正在准备中。当前显示原文说明。

Jakeschincariol/trader-skill5172026年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-skill5172026年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-skill5172026年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-skill5172026年10月15日 更新

查看 Jakeschincariol 的全部技能

报告此技能的问题