Agent skill

Asset Allocation

by JoelLewis in JoelLewis/finance_skills

Determine how to distribute capital across asset classes using strategic and tactical allocation frameworks.

MITAuto-check passedBusiness, Finance & HR

Install Asset Allocation

skills CLI
$ npx skills add JoelLewis/finance_skills --skill asset-allocation -a claude-code

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

GitHub CLI
$ gh skill install JoelLewis/finance_skills asset-allocation --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/JoelLewis/finance_skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/wealth-management/skills/asset-allocation .claude/skills/asset-allocation && 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
asset-allocation
GitHub stars
205
Token cost
~2.5k tokens
SKILL.md length
1,171 words
Files
2 (incl. scripts)
Skills in repo
91
Repo updated
First seen
Licence
MIT

At a glance

Determine how to distribute capital across asset classes using strategic and tactical allocation frameworks.

  • The user asks about portfolio allocation
  • SKILL.md covers Core Concepts, Key Formulas, Worked Examples and Common Pitfalls, plus 2 more sections
  • Runs Python scripts from its folder; calls uv, python3 and python
  • Mean-variance optimization

What it does

Asset Allocation is an agent skill from JoelLewis/finance_skills. Determine how to distribute capital across asset classes using strategic and tactical allocation frameworks. Use when the user asks about portfolio allocation, mean-variance optimization, Black-Litterman, risk parity, glide paths, or target-date strategies. Also trigger when users mention 'how much in stocks vs bonds', '60/40 portfolio', 'policy portfolio', 'core-satellite', 'liability-driven investing', 'asset-liability matching', or ask how to split their money across investments.

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/asset_allocation.py`).

It sits in Business, Finance & HR. 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.

When your agent uses it

  • The user asks about portfolio allocation
  • Mean-variance optimization
  • Black-Litterman
  • Target-date strategies

Example prompts

  • “how much in stocks vs bonds”
  • “60/40 portfolio”
  • “policy portfolio”
  • “/asset-allocation”

Requirements

  • Python 3

What it can do on your machine

Read from SKILL.md and the folder at commit 5c498ea. 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 1 file in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • uv
    • python3
    • python

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

  • Network

    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.

  • 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

Asset Allocation loads about 2.5k tokens when it runs. Until then it costs about 126 tokens; SKILL.md has 1,171 words of instructions outside code blocks.

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

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); the scripts in this folder are not scanned.

SKILL.md

The full file from JoelLewis/finance_skills at commit 5c498ea, republished under its MIT licence (© JoelLewis). 1,171 words, ~2,542 tokens.

Download SKILL.mdSave it as .claude/skills/asset-allocation/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
asset-allocation
description
Determine how to distribute capital across asset classes using strategic and tactical allocation frameworks. Use when the user asks about portfolio allocation, mean-variance optimization, Black-Litterman, risk parity, glide paths, or target-date strategies. Also trigger when users mention 'how much in stocks vs bonds', '60/40 portfolio', 'policy portfolio', 'core-satellite', 'liability-driven investing', 'asset-liability matching', or ask how to split their money across investments.

Asset Allocation

Core Concepts

Strategic Asset Allocation (SAA)

The long-term policy portfolio based on an investor's risk tolerance, return objectives, time horizon, and constraints. SAA determines the baseline target weights (e.g., 60% equity / 30% bonds / 10% alternatives) and is the dominant driver of long-term portfolio returns. SAA should be revisited when investor circumstances change, not in response to market movements.

Tactical Asset Allocation (TAA)

Short-to-medium-term deviations from the SAA based on market views, valuations, or momentum signals. TAA requires a disciplined process to avoid becoming ad hoc market timing. Key considerations:

  • Define allowable deviation bands (e.g., +/- 10% from SAA)
  • Have a clear signal framework (valuation, momentum, macro)
  • Set reversion rules: when to return to SAA weights
Mean-Variance Optimization (MVO)

Markowitz's framework for finding optimal portfolio weights that maximize risk-adjusted return:

max w'*mu - (lambda/2) * w'Sigmaw

subject to: sum(w_i) = 1, w_i >= 0 (if long-only), and any additional constraints.

Where:

  • w = weight vector
  • mu = expected return vector
  • Sigma = covariance matrix
  • lambda = risk aversion parameter

MVO requires three inputs: expected returns, the covariance matrix, and risk aversion. The solution is highly sensitive to expected return inputs.

Black-Litterman Model

Combines market equilibrium returns with investor views to produce more stable, intuitive portfolio weights. Two-step process:

Step 1 — Implied Equilibrium Returns: Pi = lambda * Sigma * w_mkt

where w_mkt is the market-capitalization weight vector, lambda is the risk aversion parameter, and Sigma is the covariance matrix. These are the returns the market implicitly expects given current prices.

Step 2 — Blending with Views: E(R) = [(tau*Sigma)^(-1) + P'*Omega^(-1)P]^(-1) * [(tauSigma)^(-1)*Pi + P'*Omega^(-1)*Q]

where:

  • tau = scalar (uncertainty of equilibrium, typically 0.025-0.05)
  • P = pick matrix (identifies assets in each view)
  • Q = view vector (expected returns from views)
  • Omega = diagonal matrix of view uncertainties

The result is a posterior expected return vector that tilts away from equilibrium toward the investor's views, proportional to confidence.

Risk Parity

Equalizes the risk contribution from each asset (or factor) rather than equalizing capital allocation:

RC_i = w_i * (Sigma*w)_i / sigma_p

Set RC_i = RC_j for all i, j.

In a simple two-asset case with no correlation: w_i is proportional to 1/sigma_i

Risk parity portfolios allocate more capital to lower-volatility assets (typically bonds) and often require leverage to achieve competitive return targets.

Glide Path

An age-based or time-based allocation that systematically shifts from growth assets to defensive assets as the investor ages or the target date approaches:

Common rule of thumb: Equity % = 110 - Age

Target-date fund glide paths typically:

  • Start at 90% equity for young investors
  • Decrease by ~1-2% per year
  • Reach 30-40% equity at retirement
  • Continue to "through" allocation post-retirement
Core-Satellite

A hybrid approach combining:

  • Core (60-80%): Low-cost, broadly diversified index funds or ETFs
  • Satellites (20-40%): Active strategies, factor tilts, alternatives, or concentrated positions

This structure captures the market return efficiently (core) while allowing alpha generation or specific exposures (satellites).

Asset-Liability Matching

For investors with defined liabilities (pensions, insurance, endowments with spending rules):

  • Match asset duration and cash flows to liability duration and timing
  • Surplus optimization: optimize the portfolio relative to liabilities, not absolute return
  • Liability-driven investing (LDI): hedge liability risk with duration-matched bonds, invest surplus in return-seeking assets

Key Formulas

FormulaExpressionUse Case
MVO Objectivemax w'*mu - (lambda/2)*w'SigmawOptimal portfolio weights
Equilibrium ReturnsPi = lambda * Sigma * w_mktBlack-Litterman starting point
BL PosteriorE(R) = [(tau*Sigma)^(-1) + P'*Omega^(-1)P]^(-1) * [(tauSigma)^(-1)*Pi + P'*Omega^(-1)*Q]Blended expected returns
Risk ContributionRC_i = w_i * (Sigma*w)_i / sigma_pRisk parity target
Risk Parity ConditionRC_i = RC_j for all i, jEqual risk contribution
Glide Path RuleEquity % = 110 - AgeAge-based allocation

Worked Examples

Example 1: Three-Asset Mean-Variance Optimization

Given:

  • Assets: US Equity (mu=8%, sigma=16%), Int'l Equity (mu=7%, sigma=18%), US Bonds (mu=3%, sigma=4%)
  • Correlations: US/Intl Equity = 0.75, US Equity/Bonds = 0.10, Intl Equity/Bonds = 0.05
  • Risk aversion: lambda = 4
  • Constraints: long-only, fully invested

Calculate: Optimal weights

Solution:

Covariance matrix:

  • Cov(US,US) = 0.16^2 = 0.0256
  • Cov(Intl,Intl) = 0.18^2 = 0.0324
  • Cov(Bond,Bond) = 0.04^2 = 0.0016
  • Cov(US,Intl) = 0.75 * 0.16 * 0.18 = 0.0216
  • Cov(US,Bond) = 0.10 * 0.16 * 0.04 = 0.00064
  • Cov(Intl,Bond) = 0.05 * 0.18 * 0.04 = 0.00036

MVO with lambda=4 (solving numerically or via quadratic programming):

Optimal weights (long-only):

  • US Equity: 51.9%
  • Int'l Equity: 0%
  • US Bonds: 48.1%

Portfolio: expected return = 5.60%, volatility = 8.71%

Note: International equity is driven to zero — it is highly correlated with US equity (0.75) but has a lower expected return, so the optimizer sees no reason to hold it. This is classic MVO behavior: small input differences produce corner solutions. Adding a maximum-weight or minimum-allocation constraint would force diversification. The high bond allocation reflects the heavy variance penalty (lambda=4); reducing lambda shifts toward equities.

Show full SKILL.md (442 more words)Show less
Example 2: Black-Litterman with a Relative View

Given: The same three assets and covariance matrix as Example 1.

  • Market-cap weights: US Equity 55%, Int'l Equity 30%, US Bonds 15%
  • Risk aversion lambda = 2.5, tau = 0.05
  • Investor view: Int'l Equity will outperform US Bonds by 3% (view uncertainty Omega = [0.001]; lower = higher confidence)

Calculate: Equilibrium and posterior expected returns

Solution:

Step 1 — Equilibrium returns, Pi = lambda × Sigma × w_mkt:

  • US Equity: 5.16%
  • Int'l Equity: 5.41%
  • US Bonds: 0.18%

Step 2 — View specification: P = [0, 1, -1], Q = [3%].

The equilibrium already implies Int'l beats Bonds by 5.23%, so a 3% view is bearish relative to equilibrium. Applying the Black-Litterman posterior formula:

  • US Equity: 4.28% (pulled down via its 0.75 correlation with Int'l)
  • Int'l Equity: 4.07% (down from 5.41%)
  • US Bonds: 0.23% (up slightly)

The posterior tilts returns toward the view in proportion to confidence. Fed into MVO, these returns shift weights away from equities and toward bonds relative to market-cap weights — moderately, avoiding the extreme corner solutions that raw MVO produces (compare Example 1). Note that views are always evaluated relative to what equilibrium already implies, not in isolation.

Common Pitfalls

  • MVO is highly sensitive to expected return inputs and has been called an "error maximizer" — small changes in returns produce large changes in weights
  • Unconstrained MVO often produces extreme, concentrated positions — always add constraints (long-only, max weight, turnover limits)
  • Black-Litterman requires the analyst to specify confidence in views (Omega), which is itself uncertain
  • Risk parity portfolios require leverage to achieve equity-like returns, introducing borrowing costs and leverage risk
  • Ignoring implementation costs: transaction costs, bid-ask spreads, and taxes can significantly erode theoretical optimal returns
  • Ignoring liquidity constraints: some asset classes (private equity, real estate) cannot be rebalanced quickly
  • Glide paths assume a generic investor — individual circumstances may require customization
  • Over-reliance on historical covariance matrices that may not reflect future relationships

Cross-References

  • historical-risk (wealth-management plugin): volatility and correlation inputs for mean-variance optimization
  • forward-risk (wealth-management plugin): expected return forecasts and scenario analysis for portfolio optimization
  • diversification (wealth-management plugin): diversification principles underpin all allocation frameworks
  • bet-sizing (wealth-management plugin): position sizing within the allocated asset classes
  • rebalancing (wealth-management plugin): maintaining allocation targets over time
  • quantitative-valuation (wealth-management plugin): valuation signals can inform TAA decisions
  • retirement-decumulation (wealth-management plugin): decumulation-phase glide paths and the sequence-of-returns risk that allocation choices must manage
  • factor-investing (wealth-management plugin): sizing factor tilts as deliberate, survivable deviations from the policy portfolio

Running the Script

bash
uv run scripts/asset_allocation.py            # run the demo (uses PEP 723 inline deps)
uv run scripts/asset_allocation.py --verify   # check demo outputs against the worked examples (exit 1 on mismatch)
python3 scripts/asset_allocation.py            # alternative (requires: pip install numpy scipy)

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 asset_allocation.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

Files

SKILL.md and 1 other file (scripts) in plugins/wealth-management/skills/asset-allocation of JoelLewis/finance_skills.

  • SKILL.md
  • scripts/asset_allocation.py

Open the folder on GitHubat commit 5c498ea

Compare with similar skills

Asset Allocation 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.

Asset Allocation compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Asset Allocation this skillJoelLewis/finance_skills205—~2.5kAutomated safety check: PassMIT
Technical Analysttradermonty/claude-trading-skills3k4 repos~4.6kAutomated safety check: PassMIT
Theme Detectortradermonty/claude-trading-skills3k2 repos~4.9kAutomated safety check: PassMIT
Creating Financial ModelsChen-zexi/open-ptc-agent7293 repos~1.3kAutomated safety check: PassMIT
Stock APIzhangxiangliang/stock-api2k—~507Automated safety check: PassMIT
Itr Walakaranb192/itr-wala871—~3.6kAutomated safety check: PassMIT

Similar skills

  • Technical Analyst

    tradermonty/claude-trading-skills

    This skill should be used when analyzing weekly price charts for stocks, stock indices, cryptocurrencies, or forex pairs.

    3k GitHub starsUsed in 4 repos~4.6k tokens
    Business, Finance & HRAuto-check passed
  • Theme Detector

    tradermonty/claude-trading-skills

    Detect and analyze trending market themes across sectors. An agent skill from tradermonty/claude-trading-skills.

    3k GitHub starsUsed in 2 repos~4.9k tokens
    Business, Finance & HRAuto-check passed
  • Creating Financial Models

    Chen-zexi/open-ptc-agent

    This skill provides an advanced financial modeling suite with DCF analysis, sensitivity testing, Monte Carlo simulations, and scenario planning for investment decisions

    729 GitHub starsUsed in 3 repos~1.3k tokens
    Business, Finance & HRAuto-check passed
  • Stock API

    zhangxiangliang/stock-api

    Fetch real-time stock quotes, K-line (candlestick) history, and search symbols for China A-shares, Hong Kong, and US markets.

    2k GitHub stars~507 tokensUpdated today
    Business, Finance & HRAuto-check passed
  • Itr Wala

    karanb192/itr-wala

    File Indian income tax returns (ITR) for FY 2025-26 / AY 2026-27.

    871 GitHub stars~3.6k tokensUpdated 5 days ago
    Business, Finance & HRAuto-check passed
  • Tushare Data

    zillionare/zillionare

    面向中文自然语言的 Tushare 数据研究技能。用于把“看看这只股票最近怎么样”“帮我查财报趋势”“最近哪个板块最强”“北向资金在买什么”“给我导出一份行情数据”这类请求,转成可执行的数据获取、清洗、对比、筛选、导出与简要分析流程。适用于 A 股、指数、ETF/基金、财务、估值、资金流、公告新闻、板块概念与宏观数据等研究场景。

    321 GitHub starsUsed in 2 repos~2.3k tokens
    Business, Finance & HRAuto-check passed

More from JoelLewis/finance_skills

All 91 skills in this repo
  • Bet Sizing

    JoelLewis/finance_skills

    Determine how much capital to allocate to individual positions within a portfolio.

    205 GitHub stars~2.5k tokensUpdated 2 mo ago
    Auto-check passed
  • Commodities

    JoelLewis/finance_skills

    Analyze commodity markets including futures curve dynamics, roll yield, and supply/demand fundamentals.

    205 GitHub stars~1.9k tokensUpdated 2 mo ago
    Auto-check passed
  • Currencies And Fx

    JoelLewis/finance_skills

    Analyze currency markets, exchange rate mechanics, and FX risk management for international portfolios.

    205 GitHub stars~1.9k tokensUpdated 2 mo ago
    Auto-check passed
  • Debt Management

    JoelLewis/finance_skills

    Provide frameworks for managing and paying off personal debt effectively.

    205 GitHub stars~2.5k tokensUpdated 2 mo ago
    Auto-check passed
  • Diversification

    JoelLewis/finance_skills

    Build diversified portfolios using correlation analysis, efficient frontier construction, and factor-based diversification.

    205 GitHub stars~2.3k tokensUpdated 2 mo ago
    Auto-check passed
  • Emergency Fund

    JoelLewis/finance_skills

    Size and structure an emergency fund based on individual circumstances, income stability, and expense profile.

    205 GitHub stars~2.7k tokensUpdated 2 mo ago
    Auto-check passed

Questions about Asset Allocation

What does Asset Allocation do?

Determine how to distribute capital across asset classes using strategic and tactical allocation frameworks. Asset Allocation is an agent skill from JoelLewis/finance_skills. Determine how to distribute capital across asset classes using strategic and tactical allocation frameworks.

When should I use Asset Allocation?

Asset Allocation fits situations like: the user asks about portfolio allocation; mean-variance optimization; black-Litterman; target-date strategies.

How do I install Asset Allocation in Claude Code?

Run `npx skills add JoelLewis/finance_skills --skill asset-allocation -a claude-code`. Or copy the skill folder (plugins/wealth-management/skills/asset-allocation in JoelLewis/finance_skills) into .claude/skills/asset-allocation in your project. Claude Code loads it when a task matches its description.

How do I install Asset Allocation in Codex?

Run `npx skills add JoelLewis/finance_skills --skill asset-allocation -a codex`. Or copy the skill folder (plugins/wealth-management/skills/asset-allocation in JoelLewis/finance_skills) into .agents/skills/asset-allocation in your project. Codex loads it when a task matches its description.

Can I use Asset Allocation 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 JoelLewis/finance_skills --skill asset-allocation -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/asset-allocation, .gemini/skills/asset-allocation, .github/skills/asset-allocation and .opencode/skills/asset-allocation in your project.

What does Asset Allocation need to run?

Going by SKILL.md and its folder, Asset Allocation 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.

Does Asset Allocation access the network?

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.

Is Asset Allocation 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. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Asset Allocation use?

Asset Allocation 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 Asset Allocation use?

About 2.5k tokens (SKILL.md is roughly 10k 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 Asset Allocation?

Skills that share tags, products or a category with Asset Allocation: Technical Analyst (tradermonty/claude-trading-skills, 3k stars), Theme Detector (tradermonty/claude-trading-skills, 3k stars), Creating Financial Models (Chen-zexi/open-ptc-agent, 729 stars) and Stock API (zhangxiangliang/stock-api, 2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Asset Allocation?

JoelLewis (a GitHub user) maintains it in JoelLewis/finance_skills, which has 205 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.