Longbridge Research
helsome/folio
Institution ratings, consensus price targets, EPS/revenue forecasts, finance calendar, shareholder data, fund holders, insider trades (SEC Form 4), short interest, industry rankings, peer group…
Determine how much capital to allocate to individual positions within a portfolio.
$ npx skills add JoelLewis/finance_skills --skill bet-sizing -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install JoelLewis/finance_skills bet-sizing --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/JoelLewis/finance_skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/wealth-management/skills/bet-sizing .claude/skills/bet-sizing && rm -rf skills-srcUse ~/.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/
Install the "bet-sizing" agent skill from https://github.com/JoelLewis/finance_skills/tree/main/plugins/wealth-management/skills/bet-sizing into .claude/skills/bet-sizing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bet-sizing", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/JoelLewis/finance_skills/tree/main/plugins/wealth-management/skills/bet-sizingType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add JoelLewis/finance_skills --skill bet-sizing -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install JoelLewis/finance_skills bet-sizing --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/JoelLewis/finance_skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/plugins/wealth-management/skills/bet-sizing .agents/skills/bet-sizing && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "bet-sizing" agent skill from https://github.com/JoelLewis/finance_skills/tree/main/plugins/wealth-management/skills/bet-sizing into .agents/skills/bet-sizing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bet-sizing", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add JoelLewis/finance_skills --skill bet-sizing -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install JoelLewis/finance_skills bet-sizing --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/JoelLewis/finance_skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/plugins/wealth-management/skills/bet-sizing .cursor/skills/bet-sizing && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "bet-sizing" agent skill from https://github.com/JoelLewis/finance_skills/tree/main/plugins/wealth-management/skills/bet-sizing into .cursor/skills/bet-sizing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bet-sizing", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/JoelLewis/finance_skills.git --path plugins/wealth-management/skills/bet-sizing--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add JoelLewis/finance_skills --skill bet-sizing -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install JoelLewis/finance_skills bet-sizing --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/JoelLewis/finance_skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/plugins/wealth-management/skills/bet-sizing .gemini/skills/bet-sizing && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "bet-sizing" agent skill from https://github.com/JoelLewis/finance_skills/tree/main/plugins/wealth-management/skills/bet-sizing into .gemini/skills/bet-sizing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bet-sizing", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install JoelLewis/finance_skills bet-sizingInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add JoelLewis/finance_skills --skill bet-sizing -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/JoelLewis/finance_skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/plugins/wealth-management/skills/bet-sizing .github/skills/bet-sizing && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "bet-sizing" agent skill from https://github.com/JoelLewis/finance_skills/tree/main/plugins/wealth-management/skills/bet-sizing into .github/skills/bet-sizing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bet-sizing", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add JoelLewis/finance_skills --skill bet-sizing -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install JoelLewis/finance_skills bet-sizing --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/JoelLewis/finance_skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/plugins/wealth-management/skills/bet-sizing .opencode/skills/bet-sizing && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "bet-sizing" agent skill from https://github.com/JoelLewis/finance_skills/tree/main/plugins/wealth-management/skills/bet-sizing into .opencode/skills/bet-sizing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bet-sizing", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
bet-sizingDetermine how much capital to allocate to individual positions within a portfolio.
Bet Sizing is an agent skill from JoelLewis/finance_skills. Determine how much capital to allocate to individual positions within a portfolio. Use when the user asks about position sizing, the Kelly criterion, fractional Kelly, risk budgeting, or conviction weighting. Also trigger when users mention 'how much to put in one stock', 'maximum position size', 'how concentrated should my portfolio be', 'number of holdings', 'VaR budget per position', 'how big a bet', or ask about scaling position sizes with volatility.
Its SKILL.md is about 2.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including scripts (for example `scripts/bet_sizing.py`).
It sits in Business, Finance & HR, covering Budgeting and forecasting. The repository describes itself as: Claude Code skill plugins for financial services — 81 skills across 7 domain plugins covering investment management, compliance, advisory practice, trading, and operations. The licence is MIT.
Read from SKILL.md and the folder at commit 5c498ea. It shows what the files ask for, not the result of running them.
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.
Ships 1 file in scripts/ (Python), which the agent can run.
Shell commands in SKILL.md call:
uvpython3pythonFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md. Its commands use uv, which can reach the network depending on how they are called.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Bet Sizing loads about 2.5k tokens when it runs. Until then it costs about 118 tokens; SKILL.md has 1,222 words of instructions outside code blocks.
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.
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); the scripts in this folder are not scanned.
The full file from JoelLewis/finance_skills at commit 5c498ea, republished under its MIT licence (© JoelLewis). 1,222 words, ~2,455 tokens.
.claude/skills/bet-sizing/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.For a binary bet with payoff odds b, win probability p, and loss probability q = 1-p:
f* = (b*p - q) / b
where f* is the optimal fraction of wealth to wager. The Kelly criterion maximizes the expected logarithm of wealth (geometric growth rate) over repeated bets.
Properties:
Note: the reference script's discrete_kelly clamps negative Kelly fractions to 0 (no bet) rather than returning a negative value — it does not recommend taking the other side.
For a normally distributed investment return with expected excess return mu-r_f and variance sigma^2:
f* = (mu - r_f) / sigma^2
This gives the fraction of total wealth to allocate. For example, an asset with 8% expected excess return and 20% volatility: f* = 0.08 / 0.04 = 2.0 (200% of wealth — implying leverage).
Full Kelly sizing is theoretically optimal but practically too aggressive because:
Practical approach: use a fraction of Kelly, commonly:
The key insight: the growth rate curve is flat near the peak. Reducing from full Kelly to half Kelly only sacrifices 25% of growth but reduces risk dramatically.
Allocate risk (not capital) across positions. The total risk budget is the maximum acceptable portfolio risk (e.g., 10% VaR or 5% tracking error).
VaR-based budgeting:
Tracking error budgeting (for active managers):
Hard limits on individual positions to prevent concentration risk:
Liquidity-based limits:
Risk-based limits:
Regulatory/mandate limits:
Size positions proportional to the strength of the investment thesis:
Framework: Score each position on edge strength (1-5) and certainty (1-5). Size proportional to the product: edge * certainty.
Trade-off between diversification and conviction:
Adjust position sizes inversely with volatility to maintain consistent risk per position:
Adjusted size = Target risk / Current volatility
When volatility doubles, position size halves, keeping the dollar risk constant. This is a core principle in managed futures and risk-targeting strategies.
Increase position sizes after gains (wealth grows, so Kelly fraction applied to larger base) and decrease after losses. This contrasts with martingale strategies (doubling down after losses) which can lead to ruin.
Kelly naturally implements anti-martingale sizing: bet a constant fraction of current wealth, so absolute bet size grows with wealth and shrinks with losses.
| Formula | Expression | Use Case |
|---|---|---|
| Kelly (Discrete) | f* = (b*p - q) / b | Binary bet sizing |
| Kelly (Continuous) | f* = (mu - r_f) / sigma^2 | Investment position sizing |
| Half Kelly | f = f* / 2 | Practical conservative sizing |
| Growth Rate at Kelly | g* = (mu - r_f)^2 / (2*sigma^2) | Maximum geometric growth |
| Growth Rate at f | g(f) = f*(mu - r_f) - f^2*sigma^2/2 | Growth rate for any fraction |
| Volatility-Scaled Size | w = target_risk / sigma_i | Constant risk per position |
| Position VaR | VaR_i = w_i * sigma_i * z_alpha * V | Position-level risk |
Given:
Calculate: Optimal bet size
Solution:
f* = (b*p - q) / b = (1 * 0.55 - 0.45) / 1 = 0.10 / 1 = 10%
Interpretation: Wager 10% of current wealth on each bet. This maximizes long-run geometric growth.
Practical adjustment (half Kelly): f = 10% / 2 = 5% — achieves 75% of the maximum growth rate with much lower drawdown risk.
Full Kelly expected drawdown: the probability of losing 50% of wealth at some point is substantial. Half Kelly dramatically reduces this tail risk.
Given:
Calculate: Kelly-optimal allocation
Solution:
f* = (mu - r_f) / sigma^2 = 0.08 / (0.20)^2 = 0.08 / 0.04 = 2.00 (200%)
This implies 200% allocation (2x leverage), which is extremely aggressive.
Practical adjustments:
Given that the 8% expected return and 20% volatility are estimates with significant uncertainty, half Kelly (100%) or less is prudent. The growth rate curve is:
uv run scripts/bet_sizing.py # run the demo (uses PEP 723 inline deps)
uv run scripts/bet_sizing.py --verify # check demo outputs against the worked examples (exit 1 on mismatch)
python3 scripts/bet_sizing.py # alternative (requires: pip install numpy)The demo prints the calculations covered above; its values match the worked examples in this skill. Run --help for a list of the classes and functions. For programmatic use, import the module rather than running it — the demo only executes under python bet_sizing.py.
© JoelLewis, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 1 other file (scripts) in plugins/wealth-management/skills/bet-sizing of JoelLewis/finance_skills.
Open the folder on GitHubat commit 5c498ea
Bet Sizing 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.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Bet Sizing this skillJoelLewis/finance_skills | 206 | — | ~2.5k | Automated safety check: Pass | MIT | |
| Longbridge Researchhelsome/folio | 271 | 3 repos | ~2.1k | Automated safety check: Pass | MIT | |
| Cre Asset Managementahacker-1/cre-agent-skills | 113 | — | ~1.8k | Automated safety check: Pass | Apache-2.0 | |
| Dd LogsDataDog/pup | 1k | — | ~1.3k | Automated safety check: Pass | Apache-2.0 | |
| Cash Flow ForecastWellApp-ai/Well | 345 | — | ~567 | Automated safety check: Pass | MIT | |
| Cash Flow Snapshotsandbaseai/sandbase-skills | 203 | — | ~1.9k | Automated safety check: Pass | Apache-2.0 |
helsome/folio
Institution ratings, consensus price targets, EPS/revenue forecasts, finance calendar, shareholder data, fund holders, insider trades (SEC Form 4), short interest, industry rankings, peer group…
ahacker-1/cre-agent-skills
CRE Asset Management analysis suite — 9 specialist skills for post-acquisition multifamily operations including annual budgeting, monthly variance analysis, rent collection, renewal decisions…
DataDog/pup
Log management - search, pipelines, archives, and cost control.
WellApp-ai/Well
Forecast cash flow and runway for a Well workspace from booked invoices and collected bank transactions.
sandbaseai/sandbase-skills
Create a 30/60/90-day cash-flow forecast from AR, AP, opening cash, payment timing, and fixed-cost data.
sickn33/agentic-awesome-skills
Budget against actual by department, category and period, with budget and actual amounts, variance, percentage used and linked expenses.
JoelLewis/finance_skills
Determine how to distribute capital across asset classes using strategic and tactical allocation frameworks.
JoelLewis/finance_skills
Analyze commodity markets including futures curve dynamics, roll yield, and supply/demand fundamentals.
JoelLewis/finance_skills
Analyze currency markets, exchange rate mechanics, and FX risk management for international portfolios.
JoelLewis/finance_skills
Provide frameworks for managing and paying off personal debt effectively.
JoelLewis/finance_skills
Build diversified portfolios using correlation analysis, efficient frontier construction, and factor-based diversification.
JoelLewis/finance_skills
Size and structure an emergency fund based on individual circumstances, income stability, and expense profile.
Categories
Determine how much capital to allocate to individual positions within a portfolio. Bet Sizing is an agent skill from JoelLewis/finance_skills. Determine how much capital to allocate to individual positions within a portfolio.
Bet Sizing fits situations like: the user asks about position sizing; the Kelly criterion; fractional Kelly; conviction weighting.
Run `npx skills add JoelLewis/finance_skills --skill bet-sizing -a claude-code`. Or copy the skill folder (plugins/wealth-management/skills/bet-sizing in JoelLewis/finance_skills) into .claude/skills/bet-sizing in your project. Claude Code loads it when a task matches its description.
Run `npx skills add JoelLewis/finance_skills --skill bet-sizing -a codex`. Or copy the skill folder (plugins/wealth-management/skills/bet-sizing in JoelLewis/finance_skills) into .agents/skills/bet-sizing in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add JoelLewis/finance_skills --skill bet-sizing -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/bet-sizing, .gemini/skills/bet-sizing, .github/skills/bet-sizing and .opencode/skills/bet-sizing in your project.
Going by SKILL.md and its folder, Bet Sizing needs Python for the scripts in its folder and the command-line tools its instructions call (uv, python3 and python). Our summary lists: Python 3.
SKILL.md contains no URLs. Its commands use uv, which can reach the network depending on how they are called. This is read from the text; nothing was executed.
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. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.
Bet Sizing is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.5k 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.
Skills that share tags, products or a category with Bet Sizing: Longbridge Research (helsome/folio, 271 stars), Cre Asset Management (ahacker-1/cre-agent-skills, 113 stars), Dd Logs (DataDog/pup, 1k stars) and Cash Flow Forecast (WellApp-ai/Well, 345 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
JoelLewis (a GitHub user) maintains it in JoelLewis/finance_skills, which has 206 GitHub stars. The repository holds 91 skills in this directory. The repository was last updated on July 18, 2026.
Source: JoelLewis/finance_skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.