claude-force: Skill for Claude Code

.claude/skills/risk-management-framework/SKILL.md

risk-management-framework is a skill for Claude Code from khanh-vu/claude-force. It costs 0 tokens per session (2,290 once invoked), scanned A, original, MIT.

A set of checks for cryptocurrency trading bots before they submit orders. It validates an order against limits such as position size, portfolio concentration, daily loss, margin, and related-asset exposure.

In plain words
What is it for?
Use it to validate proposed crypto orders before submission and return passed checks, failed checks, and warnings.
Why use it?
It helps stop trades that could make a portfolio too concentrated, lose too much in one day, or leave too little margin for safety.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is khanh-vu/claude-force's own configuration. It tells Claude Code how to work on claude-force itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything claude-force configures →

Reuse

Borrowing it

Nothing to install: this file belongs to khanh-vu/claude-force. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/khanh-vu/claude-force/main/.claude/skills/risk-management-framework/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/khanh-vu/claude-force

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for risk-management-framework

README.md
[![agentmods](https://agentmods.dev/badge/skills/khanh-vu/claude-force/risk-management-framework/github.svg)](https://agentmods.dev/skills/khanh-vu/claude-force/risk-management-framework)
Your own site
<a href="https://agentmods.dev/skills/khanh-vu/claude-force/risk-management-framework"><img src="https://agentmods.dev/badge/skills/khanh-vu/claude-force/risk-management-framework/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for risk-management-framework

Your own site · 80×15
<a href="https://agentmods.dev/skills/khanh-vu/claude-force/risk-management-framework"><img src="https://agentmods.dev/badge/skills/khanh-vu/claude-force/risk-management-framework.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,290 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.02290
Opus 5 $0.00000 $0.01145
Sonnet 5 $0.00000 $0.00458
Haiku 4.5 $0.00000 $0.00229

Measured 9d ago against content hash 7fe4235eae1e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

risk-management-framework scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/risk-management-framework/SKILL.md · 289 lines

How it starts

The opening of the file, as written. The whole thing — 289 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Risk Management Framework

Comprehensive risk management patterns for cryptocurrency trading bots.

Pre-Trade Validation Framework

from dataclasses import dataclass
from decimal import Decimal
from typing import List, Optional

@dataclass
class ValidationResult:
    passed: bool
    failed_checks: List[str]
    warnings: List[str]

class PreTradeValidator:
    """Multi-layer validation before order submission"""

    def __init__(self, config: dict):
        self.max_position_pct = config.get('max_position_pct', Decimal('0.02'))  # 2%
        self.max_concentration = config.get('max_concentration', Decimal('0.20'))  # 20%
        self.max_daily_loss_pct = config.get('max_daily_loss_pct', Decimal('0.05'))  # 5%
        self.min_margin_buffer = config.get('min_margin_buffer', Decimal('0.30'))  # 30%
        self.max_correlated_exposure = config.get('max_correlated_exposure', Decimal('0.40'))  # 40%

    def validate_order(self, order: 'Order', portfolio: 'Portfolio') -> ValidationResult:
        """Run all pre-trade validation checks"""
        failed = []
        warnings = []

        # Check 1: Position size limit (max 2% of portfolio per trade)
        if not self._check_position_size(order, portfolio):
            failed.append(f"Position size exceeds {self.max_position_pct*100}% limit")

        # Check 2: Concentration risk (max 20% in single asset)
        if not self._check_concentration(order, portfolio):
            failed.append(f"Concentration exceeds {self.max_concentration*100}% limit")

        # Check 3: Daily loss limit (max 5% daily loss)
        if not self._check_daily_loss_limit(portfolio):
            failed.append(f"Daily loss limit ({self.max_daily_loss_pct*100}%) triggered")

        # Check 4: Margin health (min 30% buffer)
        margin_check, margin_pct = self._check_margin_health(order, portfolio)
        if not margin_check:
            failed.append(f"Insufficient margin buffer: {margin_pct:.2%} < {self.min_margin_buffer:.2%}")
        elif margin_pct < Decimal('0.40'):
            warnings.append(f"Low margin buffer: {margin_pct:.2%}")

        # Check 5: Correlation exposure (max 40% in correlated assets)
        if not self._check_correlation_exposure(order, portfolio):
            failed.append(f"Correlated exposure exceeds {self.max_correlated_exposure*100}% limit")

        # Check 6: Fat finger detection
        if not self._check_fat_finger(order):
            failed.append("Order price deviates >5% from market - possible fat finger")

        return ValidationResult(
            passed=len(failed) == 0,
            failed_checks=failed,
            warnings=warnings
        )

    def _check_position_size(self, order: 'Order', portfolio: 'Portfolio') -> bool:
        position_value = order.quantity * order.price
        max_position_value = portfolio.total_value * self.max_position_pct
        return position_value <= max_position_value

    def _check_concentration(self, order: 'Order', portfolio: 'Portfolio') -> bool:
        current_exposure = portfolio.get_asset_exposure(order.symbol)
        new_exposure = current_exposure + (order.quantity * order.price)
        concentration = new_exposure / portfolio.total_value
        return concentration <= self.max_concentration

Read the full file on GitHub · 289 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 289 lines · 0 tokens per session scan A 7fe4235eae1e

Subscribe to this mod's changes

risk-management-framework is a skill published in the GitHub repository khanh-vu/claude-force (5 stars, last pushed 9mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,290 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.