Agent skill

Risk

by alsk1992 in alsk1992/CloddsBot

Unified risk engine with VaR, stress testing, volatility regimes, and automated controls

MITAuto-check passedTesting & QA

Install Risk

skills CLI
$ npx skills add alsk1992/CloddsBot --skill risk -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install alsk1992/CloddsBot risk --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/alsk1992/CloddsBot.git skills-src && mkdir -p .claude/skills && cp -r skills-src/src/skills/bundled/risk .claude/skills/risk && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
risk
GitHub stars
2.9k
Used in
1 other repo
Token cost
~2.4k tokens
SKILL.md length
418 words
Files
2
Skills in repo
116
Repo updated
First seen
Licence
MIT

At a glance

Unified risk engine with VaR, stress testing, volatility regimes, and automated controls

  • Works in 10 steps: Kill switch (SafetyManager) → Circuit breaker (execution-level) → Max order size → …
  • Tasks that involve Load testing
  • SKILL.md covers Chat Commands, TypeScript API Reference, Risk Engine Checks and Circuit Breaker Triggers, plus 5 more sections
  • Runs TypeScript scripts from its folder

What it does

Risk is an agent skill from alsk1992/CloddsBot. Unified risk engine with VaR, stress testing, volatility regimes, and automated controls

Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `index.ts`).

It sits in Testing & QA, covering Load testing. The repository describes itself as: Open Source AI trading agent that operates autonomously across 1000+ markets - Polymarket, Kalshi, Binance, Hyperliquid, Solana DEXs, 5 EVM chains. Scans for edge, executes… The licence is MIT.

When your agent uses it

  • Tasks that involve Load testing

Example prompts

  • “/risk”

Requirements

  • Node.js

Workflow steps

10 steps, taken from the first numbered list in SKILL.md.

  1. Kill switch (SafetyManager)
  2. Circuit breaker (execution-level)
  3. Max order size
  4. Exposure limits
  5. Daily loss limit
  6. Max drawdown
  7. Position concentration
  8. VaR limit
  9. Volatility regime
  10. Kelly sizing recommendation

What it can do on your machine

Read from SKILL.md and the folder at commit c930628. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (TypeScript), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Risk loads about 2.4k tokens when it runs. Until then it costs about 23 tokens; SKILL.md has 418 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~23
When it runs · the whole SKILL.md, loaded when a task matches
~2.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from alsk1992/CloddsBot at commit c930628, republished under its MIT licence (© alsk1992). 418 words, ~2,444 tokens.

Download SKILL.mdSave it as .claude/skills/risk/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
risk
description
Unified risk engine with VaR, stress testing, volatility regimes, and automated controls
emoji
🛑

Risk - Complete API Reference

Full risk management engine: circuit breakers, loss limits, Value-at-Risk, volatility regime detection, stress testing, and kill switches.


Chat Commands

View Risk Status
/risk                               Current risk status
/risk status                        Detailed status with portfolio metrics
/risk limits                        View all limits
/risk dashboard                     Real-time risk metrics (VaR, regime, HHI, etc.)
Risk Analytics
/risk var                           Value-at-Risk and CVaR numbers
/risk regime                        Current volatility regime and size multiplier
/risk stress [scenario]             Run stress test (flash_crash, black_swan, etc.)

Available stress scenarios: flash_crash, liquidity_crunch, platform_down, correlation_spike, black_swan

Configure Limits
/risk set max-loss 1000             Max daily loss ($)
/risk set max-loss-pct 10           Max daily loss (%)
/risk set max-drawdown 20           Max drawdown (%)
/risk set max-position 25           Max single position (%)
/risk set max-trades 50             Max trades per day
/risk set consecutive-losses 5      Stop after N losses
Circuit Breaker
/risk trip "manual stop"            Manually trip breaker
/risk reset                         Reset after cooldown
/risk kill                          Emergency stop all trading
/risk check 500                     Check if a $500 trade is allowed

TypeScript API Reference

Unified Risk Engine

The risk engine is the single entry point for all pre-trade validation. It orchestrates 10 checks in order:

  1. Kill switch (SafetyManager)
  2. Circuit breaker (execution-level)
  3. Max order size
  4. Exposure limits
  5. Daily loss limit
  6. Max drawdown
  7. Position concentration
  8. VaR limit
  9. Volatility regime
  10. Kelly sizing recommendation
typescript
import { createRiskEngine } from 'clodds/risk';

const engine = createRiskEngine(
  {
    varLimit: 500,           // Reject trades if portfolio VaR > $500
    varConfidence: 0.95,
    varWindowSize: 100,
    volatilityConfig: {
      lookbackWindow: 30,
      haltOnExtreme: true,   // Stop trading in extreme volatility
    },
  },
  {
    riskContext,              // From trading/risk.ts
    safetyManager,           // From trading/safety.ts
    circuitBreaker,          // From execution/circuit-breaker.ts
    kellyCalculator,         // From trading/kelly.ts
    getPositions: () => positions,
    getPositionValues: () => positions.map(p => p.value),
  }
);
Validate a Trade
typescript
const decision = engine.validateTrade({
  userId: 'user-123',
  platform: 'polymarket',
  marketId: 'market-456',
  outcome: 'YES',
  side: 'buy',
  size: 500,
  price: 0.65,
  estimatedEdge: 0.05,    // 5% edge
  confidence: 0.8,
  category: 'politics',
});

if (decision.approved) {
  // Use adjustedSize — may be smaller than requested (Kelly + regime)
  await executeTrade(decision.adjustedSize);
  console.log(`Regime: ${decision.regime}`);
  console.log(`Warnings: ${decision.warnings}`);
} else {
  console.log(`Blocked: ${decision.reason}`);
  // Check which step failed:
  for (const check of decision.checks) {
    console.log(`  ${check.name}: ${check.passed ? 'PASS' : 'FAIL'} — ${check.message}`);
  }
}
Record Trade P&L (feeds VaR + volatility)
typescript
engine.recordPnL({
  pnlUsd: -45.20,
  pnlPct: -0.09,
  positionId: 'polymarket:market-456:YES',
  timestamp: new Date(),
});
Portfolio Risk Snapshot
typescript
const risk = engine.getPortfolioRisk();
console.log(`Total value: $${risk.totalValue}`);
console.log(`VaR (95%): $${risk.var95}`);
console.log(`VaR (99%): $${risk.var99}`);
console.log(`CVaR (95%): $${risk.cvar95}`);
console.log(`Regime: ${risk.regime}`);
console.log(`Drawdown: ${risk.drawdownPct}%`);
Value-at-Risk
typescript
import { createVaRCalculator, calculateVaR, calculateCVaR } from 'clodds/risk';

// Full calculator with rolling window
const calc = createVaRCalculator({ windowSize: 100, confidenceLevel: 0.95 });
calc.addObservation({ pnlUsd: -50, pnlPct: -0.05, timestamp: new Date() });
const result = calc.calculateAt(0.99);
console.log(`VaR (99%): $${result.historicalVaR}`);
console.log(`CVaR (99%): $${result.cvar}`);

// Quick one-liners
const var95 = calculateVaR(pnlArray, 0.95);
const cvar95 = calculateCVaR(pnlArray, 0.95);
Volatility Regime Detection
typescript
import { createVolatilityDetector, detectRegime } from 'clodds/risk';

const detector = createVolatilityDetector({
  lookbackWindow: 30,
  haltOnExtreme: false,
  regimeMultipliers: { low: 1.2, normal: 1.0, high: 0.5, extreme: 0.25 },
});

detector.addObservation(0.03);  // 3% P&L
const snapshot = detector.detect();
console.log(`Regime: ${snapshot.regime}`);          // 'low' | 'normal' | 'high' | 'extreme'
console.log(`Size multiplier: ${snapshot.sizeMultiplier}x`);
console.log(`Should halt: ${snapshot.shouldHalt}`);

// One-shot from array
const regime = detectRegime(recentPnLPcts);
Stress Testing
typescript
import { runStressTest, runAllScenarios, getAvailableScenarios } from 'clodds/risk';

const result = runStressTest(positions, 'flash_crash');
console.log(`Estimated loss: $${result.estimatedLoss} (${result.estimatedLossPct}%)`);
console.log(`Severity: ${result.severity}`);
console.log(`Recommendations: ${result.recommendations.join(', ')}`);

// Run all scenarios at once
const all = runAllScenarios(positions);  // sorted by severity

// Override scenario parameters
const custom = runStressTest(positions, 'flash_crash', {
  scenarios: { flash_crash: { lossPct: 30, description: 'Severe crash' } },
});
Risk Dashboard
typescript
import { getRiskDashboard } from 'clodds/risk';

const dashboard = engine.getDashboard();
console.log(`VaR (95%): $${dashboard.portfolioVaR95}`);
console.log(`Regime: ${dashboard.regime} (${dashboard.regimeSizeMultiplier}x)`);
console.log(`Daily P&L: $${dashboard.dailyPnL} / $${dashboard.dailyLossLimit}`);
console.log(`Drawdown: ${dashboard.currentDrawdown}% / ${dashboard.maxDrawdown}%`);
console.log(`Concentration HHI: ${dashboard.concentrationHHI}`);
console.log(`Kill switch: ${dashboard.killSwitchActive}`);
console.log(`Warnings: ${dashboard.warnings}`);
Circuit Breaker (Standalone)
typescript
import { createCircuitBreaker, MODERATE_CONFIG } from 'clodds/risk';

// Feature-engineering circuit breaker (market-condition-aware)
const breaker = createCircuitBreaker(MODERATE_CONFIG);
breaker.startMonitoring();

if (!breaker.canTrade('polymarket', marketId)) {
  return; // Trading halted
}

breaker.recordTrade({ success: true, pnl: 2.5 });
Kill Switch
typescript
// Emergency stop via SafetyManager — no auto-resume
safetyManager.killSwitch('Market anomaly detected');

// Resume manually after review
safetyManager.resumeTrading();

Risk Engine Checks

#CheckModuleBlocks Trade?
1Kill switchSafetyManagerYes
2Circuit breakerCircuitBreakerYes
3Max order sizetrading/riskYes
4Exposure limitstrading/riskYes
5Daily loss limitSafetyManagerYes
6Max drawdownSafetyManagerYes
7ConcentrationSafetyManagerYes
8VaR limitVaRCalculatorYes (if configured)
9Volatility regimeVolatilityDetectorYes (if extreme + halt)
10Kelly sizingDynamicKellyNo (adjusts size)

Circuit Breaker Triggers

TriggerDefaultDescription
Daily loss (USD)$1,000Absolute loss limit
Daily loss (%)10%Percentage of capital
Drawdown20%Peak-to-trough
Consecutive losses5Losses in a row
Error rate50%Failed order rate
Max trades50Trades per day

Volatility Regimes

RegimeSize MultiplierDescription
low1.2xCalm markets, slightly larger positions
normal1.0xBaseline conditions
high0.5xElevated volatility, half size
extreme0.25xCrisis — quarter size or halt trading
Show full SKILL.md (157 more words)Show less

Stress Test Scenarios

ScenarioLossDescription
flash_crash20%All positions lose value instantly
liquidity_crunch10%Slippage doubles, partial fills
platform_down15%Primary platform offline
correlation_spike25%All positions move together
black_swan40%3-sigma tail event

Status Levels

StatusDescription
armedNormal, trading allowed
warningApproaching limits (80%)
trippedLimit exceeded, trading stopped
killedEmergency stop, manual reset required

Recovery Process

  1. Auto-reset: Next day at midnight (daily counters)
  2. Cooldown: Circuit breaker auto-resets after cooldown period
  3. Manual reset: /risk reset to re-arm
  4. Kill recovery: /risk reset after manual review (no auto-resume)

Best Practices

  1. Start conservative — Lower limits while learning
  2. Don't override — Respect the circuit breaker
  3. Review trips — Understand why limits were hit
  4. Monitor VaR — Use /risk var and /risk dashboard regularly
  5. Run stress tests — Use /risk stress before large position changes
  6. Watch regime — Use /risk regime to understand current volatility
  7. Adjust limits — Based on strategy performance and regime

© alsk1992, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in src/skills/bundled/risk of alsk1992/CloddsBot.

  • SKILL.md
  • index.ts

Open the folder on GitHubat commit c930628

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in alsk1992/CloddsBot, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Risk next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Risk compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Risk this skillalsk1992/CloddsBot2.9k1 repos~2.4kAutomated safety check: PassMIT
Writing Livekit Scenarioslivekit-examples/agent-starter-python2641 repos~2.5kAutomated safety check: PassMIT
Go Testingcxuu/golang-skills1701 repos~1.3kAutomated safety check: PassApache-2.0
Goalcraftgrp06/goalcraft102—~3.8kAutomated safety check: PassMIT
Thinking Partnermattnowdev/thinking-partner206—~4.4kAutomated safety check: PassMIT
Visionkunchenguid/vision329—~2.9kAutomated safety check: PassMIT

Similar skills

  • Writing Livekit Scenarios

    livekit-examples/agent-starter-python

    Creates and maintains the scenarios a LiveKit agent simulation runs, and wires the agent to consume them.

    264 GitHub starsUsed in 1 repo~2.5k tokens
    Testing & QAAuto-check passed
  • Go Testing

    cxuu/golang-skills

    A skill your agent uses when writing, reviewing, or improving Go test code — including table-driven tests, subtests, parallel tests, test helpers, test doubles, and assertions with cmp.Diff.

    170 GitHub starsUsed in 1 repo~1.3k tokens
    Testing & QAAuto-check passed
  • Goalcraft

    grp06/goalcraft

    Turn a rough draft, vague ambition, or messy task brief into a powerful Codex /goal objective for persistent, evidence-checked work.

    102 GitHub stars~3.8k tokensUpdated 4 mo ago
    Testing & QAAuto-check passed
  • Thinking Partner

    mattnowdev/thinking-partner

    A deterministic thinking partner that challenges assumptions and applies mental models to sharpen decisions, solve problems, and think more clearly.

    206 GitHub stars~4.4k tokensUpdated 6 mo ago
    Testing & QAAuto-check passed
  • Vision

    kunchenguid/vision

    Draft and stress-test a VISION.md for a repository, then iterate with the author on an interactive review board until approved.

    329 GitHub stars~2.9k tokensUpdated 1 mo ago
    Testing & QAAuto-check passed
  • Volt Load Testing

    owenHochwald/volt

    Safely exercise and evaluate HTTP APIs with the Volt CLI, including authenticated requests, JSON bodies, staged load, machine-readable results, performance baselines, and before/after comparisons.

    141 GitHub stars~1.2k tokensUpdated 2 mo ago
    Testing & QAAuto-check passed

More from alsk1992/CloddsBot

All 116 skills in this repo
  • Qmd

    alsk1992/CloddsBot

    Local hybrid search for markdown notes and docs. An agent skill from alsk1992/CloddsBot.

    2.9k GitHub starsUsed in 3 repos~1.2k tokens
    Auto-check passed
  • Drift SDK

    alsk1992/CloddsBot

    Drift Protocol perpetual futures trading on Solana (direct SDK)

    2.9k GitHub starsUsed in 1 repo~625 tokens
    Auto-check passed
  • Edge

    alsk1992/CloddsBot

    Find mispriced markets by comparing to external models and data sources

    2.9k GitHub starsUsed in 1 repo~472 tokens
    Auto-check passed
  • Embeddings

    alsk1992/CloddsBot

    Vector embeddings configuration and semantic search. An agent skill from alsk1992/CloddsBot.

    2.9k GitHub starsUsed in 1 repo~1.3k tokens
    Auto-check passed
  • News

    alsk1992/CloddsBot

    Monitor news and correlate with prediction market movements. An agent skill from alsk1992/CloddsBot.

    2.9k GitHub starsUsed in 1 repo~462 tokens
    Auto-check passed
  • Opportunity

    alsk1992/CloddsBot

    Find and execute cross-platform arbitrage opportunities across prediction markets

    2.9k GitHub starsUsed in 1 repo~2.2k tokens
    Auto-check passed

Categories

Questions about Risk

What does Risk do?

Unified risk engine with VaR, stress testing, volatility regimes, and automated controls. Risk is an agent skill from alsk1992/CloddsBot.

When should I use Risk?

Risk fits situations like: tasks that involve Load testing.

How do I install Risk in Claude Code?

Run `npx skills add alsk1992/CloddsBot --skill risk -a claude-code`. Or copy the skill folder (src/skills/bundled/risk in alsk1992/CloddsBot) into .claude/skills/risk in your project. Claude Code loads it when a task matches its description.

How do I install Risk in Codex?

Run `npx skills add alsk1992/CloddsBot --skill risk -a codex`. Or copy the skill folder (src/skills/bundled/risk in alsk1992/CloddsBot) into .agents/skills/risk in your project. Codex loads it when a task matches its description.

Can I use Risk in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add alsk1992/CloddsBot --skill risk -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/risk, .gemini/skills/risk, .github/skills/risk and .opencode/skills/risk in your project.

What does Risk need to run?

Going by SKILL.md and its folder, Risk needs TypeScript for the scripts in its folder. Our summary lists: Node.js.

Does Risk access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Risk safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Risk use?

Risk is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Risk use?

About 2.4k tokens (SKILL.md is roughly 9.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Risk?

Skills that share tags, products or a category with Risk: Writing Livekit Scenarios (livekit-examples/agent-starter-python, 264 stars), Go Testing (cxuu/golang-skills, 170 stars), Goalcraft (grp06/goalcraft, 102 stars) and Thinking Partner (mattnowdev/thinking-partner, 206 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Risk?

alsk1992 (a GitHub user) maintains it in alsk1992/CloddsBot, which has 2,903 GitHub stars. The repository holds 116 skills in this directory. The repository was last updated on October 2, 2026.

Source: alsk1992/CloddsBot on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.