agentleFS
JakeschincariolJakeschincariol/trader-skill/trader-risk/SKILL.md

trader-risk

Skill14 starsChanged 29 days agoMITView on GitHub

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.

5 other projects use a version of this, 4 of them edited; 3 new projects in the last 4 weeks, against 0 the 4 before.

Adopted by

Surging: 3 new projects took it in the last 4 weeks, none the 4 weeks before.thin data

Week of Sep 13: 0 new projectsWeek of Sep 20: 0 new projectsWeek of Sep 27: 0 new projectsWeek of Oct 4: 0 new projectsWeek of Oct 11: 0 new projectsWeek of Oct 18: 2 new projectsWeek of Oct 25: 0 new projectsWeek of Nov 1: 1 new project
Sep 2026Oct 2026Nov 2026
New projects taking a version of this file each week, over the 8 weeks our latest run read: only 3 in all, so this is a hint, not a trend.

Most recently taken up by

Used with

Projects with it also use trader-entry, trader-exit and 2 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • JakeschincariolSkill

    trader-entry

    Entry Timer. Watches a setup bar by bar and tells you the moment to get in. Reads free Yahoo 1-minute or 5-minute bars, builds the opening range (the first 15 minutes by default) and calls the entry on the first completed bar that CLOSES above the range high, or above a level you give it (like a 20-day high from the scanner), with an optional volume check. Says waiting and how far, triggered with the time and the price, expired, or not open yet, and writes trader/entry.json for /trader-exit. Long side only. It never places an order. Use when the user says "tell me when to get in", "watch TSLA", "has it broken out", "did it break the opening range", "entry signal", "time my entry", "check my watchlist", or after /trader-scanner and /trader-news, before /trader-exit.

    Also in 4 projects that use this

  • JakeschincariolSkill

    trader-exit

    Exit Planner. Sets your stop and your target before you enter, so you know when to get out. Reads the entry from trader-entry (or a price you give), puts the stop at the opening-range midpoint by default (or the range low, your price, a percent, or a multiple of the ATR), rounds it down to the cent, and sets the target at 2R (or 1R, or your price). Refuses a stop at or above the entry, a target at or below it, or a stop too tight to survive the spread, and says why. Writes trader/plan.json for the Time Machine, the Budget Manager and Price Alerts. Long side only. Use when the user says "where's my stop", "set my stop and target", "plan the exit", "when do I get out", "stop loss", "what's my R", "risk reward", or right after /trader-entry triggers, before /trader-timemachine.

    Also in 4 projects that use this

  • +2 more from Jakeschincariol

The file

We split this skill into the rules it gives an agent

4 rules. 2 are common, 0 are distinctive, and 2 are very specific to this project.

  • 2

    Common

    Most of the 5 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    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 …

    line 64
  2. Very specific:

    Run check.py. Exit code 0 means every order passed, 1 means at least one was blocked.

    line 66
  3. Common:

    If the orders change in any way, run the check again.

    line 71
  4. Common:

    No options, margin, short selling or leverage unless the config allows it and the user confirms.

    line 108

“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.