agentleFS
Noumenon-aiNoumenon-ai/noumenon-free-starter-pack/risk-calculator/SKILL.md

risk-calculator

Skill0 starsChanged 7 months agoMITView on GitHub

Use when the user wants position sizing, stop-loss math, risk/reward math, leverage checks, portfolio risk, ATR sizing, Kelly sizing, or says "how many shares," "size this trade," "what's my risk," "position sizing for," "calculate my stop," "how big should this position be," or "risk/reward on this trade.

The file

We split this skill into the rules it gives an agent

10 rules. About 0 are common, 7 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Always show the full math block.

    line 138
  2. Distinctive:

    If the stop equals the entry, reject the trade sizing because stop distance is zero.

    line 139
  3. Distinctive:

    Use fixed percentage risk sizing by default unless the user explicitly provides Kelly inputs or ATR inputs.

    line 140
  4. Distinctive:

    When Kelly inputs are present, show both Kelly and Half-Kelly.

    line 141
  5. Distinctive:

    If Kelly is zero or negative, say there is no positive edge and do not force a size from Kelly.

    line 142
  6. Distinctive:

    When ATR is present, compute ATR sizing alongside fixed percentage sizing and call out the difference.

    line 143
  7. Very specific:

    If the user gives account, entry, risk, and units but no stop, solve the maximum stop from Risk Per Unit = Dollar Risk / Units.

    line 144
  8. Distinctive:

    If leverage is mentioned, calculate gross leverage, initial margin used, and margin call estimate only when leverage and maintenance margin …

    line 145
  9. Very specific:

    Use SAFE only when no flags are triggered and post-trade portfolio risk stays at or below 6% of account.

    line 148
  10. Very specific:

    If existing open risk is provided, show the post-trade portfolio risk math explicitly in the MATH block and verdict.

    line 149

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

Risk Calculator

Output Format

POSITION RISK REPORT
--------------------------------------------------
Instrument:           [ticker or asset]
Side:                 [LONG or SHORT]
Account:              $[account]
Risk model:           [Fixed % / Kelly / Half-Kelly / ATR]
Risk %:               [risk%]
Dollar risk:          $[dollar risk]
Entry:                $[entry]
Stop:                 $[stop]
Stop distance:        $[stop distance] ([stop %])
Position size:        [units]
Position value:       $[position value]
Open portfolio risk:  $[existing open risk]
Post-trade risk:      $[existing + new risk] ([% of account])

MATH
Dollar Risk     = [account] x [risk%] = [dollar risk]
Stop Distance   = abs([entry] - [stop]) = [stop distance]
Position Size   = floor([dollar risk] / [stop distance]) = [units]
Position Value  = [units] x [entry] = [position value]
Post-Trade Risk = [existing open risk] + [dollar risk] = [post-trade risk]

R TARGETS
1R target:           $[price] -> [PnL]
2R target:           $[price] -> [PnL]
3R target:           $[price] -> [PnL]

VOLATILITY MODEL
ATR:                 [atr or n/a]
ATR multiple:        [multiplier or n/a]
ATR stop distance:   $[atr x multiplier or n/a]
ATR position size:   [units or n/a]

KELLY MODEL
Win rate W:          [value or n/a]
Reward/Risk R:       [value or n/a]
Kelly %:             [W - ((1 - W) / R)]
Half-Kelly %:        [Kelly / 2]
Execution note:      [Use Half-Kelly / No positive edge]

LEVERAGE
Gross leverage:      [position value / account]x
Requested leverage:  [value or 1.00x]
Initial margin used: $[position value / leverage]
Maintenance margin:  [maintenance margin % or n/a]
Margin call est.:    $[price or n/a]

FLAGS
Flag                 Status   Trigger
OVERSIZED            [Y/N]    [reason]
HIGH RISK            [Y/N]    [reason]
STOP TOO TIGHT       [Y/N]    [reason]
STOP TOO WIDE        [Y/N]    [reason]
CONCENTRATION RISK   [Y/N]    [reason]

STOP SOLVER
Given units:         [units or n/a]
Risk per unit:       $[dollar risk / units or n/a]
Max long stop:       $[entry - risk per unit or n/a]
Max short stop:      $[entry + risk per unit or n/a]

VERDICT
[SAFE / ADJUST / REJECT]
Reason: [single clear sentence]

Core Formulas

FIXED % RISK
Dollar Risk        = Account x Risk%
Stop Distance      = abs(Entry - Stop)
Position Size      = floor(Dollar Risk / Stop Distance)
Position Value     = Position Size x Entry

R TARGETS
Long 1R target     = Entry + Stop Distance
Long 2R target     = Entry + (2 x Stop Distance)
Long 3R target     = Entry + (3 x Stop Distance)
Short 1R target    = Entry - Stop Distance
Short 2R target    = Entry - (2 x Stop Distance)
Short 3R target    = Entry - (3 x Stop Distance)

KELLY CRITERION
Kelly %            = W - ((1 - W) / R)
Where:
W                  = win rate as decimal
R                  = average win / average loss
Half-Kelly         = Kelly % / 2

ATR VOLATILITY SIZING
ATR Stop Distance  = ATR x Stop Multiplier
ATR Position Size  = floor(Dollar Risk / ATR Stop Distance)

STOP SOLVER
Risk Per Unit      = Dollar Risk / Units
Long Max Stop      = Entry - Risk Per Unit
Short Max Stop     = Entry + Risk Per Unit

LEVERAGE + MARGIN
Gross Leverage     = Position Value / Account
Initial Margin     = Position Value / Leverage
Adverse Move %     = (1 / Leverage) - Maintenance Margin%
Long Call Est.     = Entry x (1 - Adverse Move %)
Short Call Est.    = Entry x (1 + Adverse Move %)

PORTFOLIO RISK
Post-Trade Risk    = Existing Open Risk + Dollar Risk
Post-Trade Risk %  = Post-Trade Risk / Account

Risk Flags

RISK FLAGS
--------------------------------------------------
OVERSIZED           Position Value > 25% of account
HIGH RISK           Risk per trade > 2% of account
STOP TOO TIGHT      Stop distance < max(0.50% of entry, 0.50 x ATR if ATR exists)
STOP TOO WIDE       Stop distance > min(15.00% of entry, 3.00 x ATR if ATR exists)
CONCENTRATION RISK  Single position > 30% of account
                    OR post-trade open portfolio risk > 6%

RULES

  • Always show the full math block. Never give only the final share count.
  • If the stop equals the entry, reject the trade sizing because stop distance is zero.
  • Use fixed percentage risk sizing by default unless the user explicitly provides Kelly inputs or ATR inputs.
  • When Kelly inputs are present, show both Kelly and Half-Kelly; prefer Half-Kelly for execution unless the user explicitly asks for full Kelly.
  • If Kelly is zero or negative, say there is no positive edge and do not force a size from Kelly.
  • When ATR is present, compute ATR sizing alongside fixed percentage sizing and call out the difference.
  • If the user gives account, entry, risk, and units but no stop, solve the maximum stop from Risk Per Unit = Dollar Risk / Units.
  • If leverage is mentioned, calculate gross leverage, initial margin used, and margin call estimate only when leverage and maintenance margin are available; if maintenance margin is missing, state that the estimate requires it.
  • Flag HIGH RISK above 2% account risk even if the math works.
  • Flag OVERSIZED and CONCENTRATION RISK separately; a trade can be one, both, or neither.
  • Use SAFE only when no flags are triggered and post-trade portfolio risk stays at or below 6% of account.
  • If existing open risk is provided, show the post-trade portfolio risk math explicitly in the MATH block and verdict.
  • Round displayed currency to 2 decimals and position size down to whole units unless the asset supports fractional sizing.

EXAMPLE TRIGGER PHRASES

  • "how many shares can I buy with a $25k account and 1% risk?"
  • "size this trade: entry 84.50 stop 81.90 account 12000"
  • "what's my risk if I buy 200 shares at 42 with a stop at 39?"
  • "position sizing for a BTC long with 3x leverage"
  • "calculate my stop if I only want to risk $150"
  • "show ATR sizing for this setup"
  • "how much margin will this use and where is the margin call?"

Response Procedure

1. Parse account, side, entry, stop, units, and risk%.
2. Compute fixed-risk size first.
3. If stop is missing but units are present, solve the max stop.
4. Add ATR model if ATR data exists.
5. Add Kelly and Half-Kelly if win-rate data exists.
6. Evaluate all five risk flags.
7. Output verdict: SAFE, ADJUST, or REJECT.

This skill is part of the NOUMENON Trading Skills Pack — gumroad.com/noumenon-ai

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.