portfolio

portfolio is a skill for Claude Code, Codex from gauss314/skills. It costs 85 tokens per session (2,819 once invoked), scanned A, original, MIT.

A toolkit for building investment portfolios with mathematical allocation methods. It includes Markowitz mean-variance optimisation, Black-Litterman, and hierarchical methods such as risk parity, which spreads risk across investments.

In plain words
What is it for?
Use it to simulate portfolios, find efficient allocations, combine market assumptions with personal views, group related assets, and apply risk or allocation constraints.
Why use it?
It provides several ways to turn asset data and investor views into portfolio weights, including methods that do not rely only on expected returns. It focuses on portfolio construction, not on measuring performance afterward.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to simulate portfolios, find efficient allocations, combine market assumptions with personal views, group related assets, and apply risk or allocation constraints.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/gauss314/skills/portfolio
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add gauss314/skills --skill portfolio
Clone the repo
git clone --depth 1 https://github.com/gauss314/skills

Made for: Claude Code, Codex.

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 portfolio

README.md
[![agentmods](https://agentmods.dev/badge/skills/gauss314/skills/portfolio/github.svg)](https://agentmods.dev/skills/gauss314/skills/portfolio)
Your own site
<a href="https://agentmods.dev/skills/gauss314/skills/portfolio"><img src="https://agentmods.dev/badge/skills/gauss314/skills/portfolio/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 portfolio

Your own site · 80×15
<a href="https://agentmods.dev/skills/gauss314/skills/portfolio"><img src="https://agentmods.dev/badge/skills/gauss314/skills/portfolio.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 85 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,819 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00085 $0.02819
Opus 5.5 $0.00034 $0.01128
Sonnet 5.5 $0.00017 $0.00564
Haiku 4.5 $0.00009 $0.00282

Measured 3mo ago against content hash 0ad591366259, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

portfolio 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 3mo ago.

The scan reads SKILL.md. This mod also ships 9 executable files (scripts/__init__.py, scripts/black_litterman.py, scripts/cli.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/portfolio/SKILL.md · 241 lines

How it starts

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

Portfolio — Optimización Cuantitativa de Portafolios

Este skill implementa 3 enfoques de optimización de portafolios desde el material del curso (notebook Clase_08_teoria_2025_portafolio.ipynb y PDF Portafolios 2025 Ucema.pdf):

  1. Markowitz / Media-Varianza — Optimización convexa vía scipy.optimize
    • simulación Monte Carlo + frontera eficiente + CML.
  2. Black-Litterman — Combinación bayesiana de retornos de equilibrio de mercado (CAPM inverso) con views del inversor, incluyendo matriz de incertidumbre Ω (método Idzorek).
  3. HRP / HERC / NCO — Construcción jerárquica de portafolios mediante clustering (single/complete/average/ward), risk parity y NCO con restricciones.

Todos los scripts usan solo numpy, pandas y scipy. Sin dependencias pesadas. Este skill es autónomo: funciona sin skills/backtesting.

Para ratios de performance post-optimización (Sharpe, Sortino, VaR, drawdowns, etc.) consultar el skill hermana: skills/backtesting.

Part of the Gauss314 Skills Repository.


File Map

skills/portfolio/
├── SKILL.md                           ← Este archivo
├── references/
│   ├── PORTFOLIO_THEORY.md            ← MPT, Markowitz, frontera eficiente (ES)
│   ├── BLACK_LITTERMAN.md             ← BL: prior, views, posterior, omega (ES)
│   ├── HIERARCHICAL.md                ← HRP, HERC, NCO, clustering (ES)
│   └── RISK_MEASURES.md               ← VaR, CVaR, MAD, MSV, DR, MDD (ES)
├── assets/
│   ├── sample_prices.csv              ← Precios multi-activo para ejemplos
│   ├── sample_returns.csv             ← Retornos multi-activo
│   ├── sample_mcaps.json              ← Market caps para Black-Litterman
│   └── defaults.json                  ← Parámetros default
├── scripts/
│   ├── __init__.py
│   ├── portfolio.py                   ← Core: Markowitz, Sharpe, Monte Carlo, frontera
│   ├── black_litterman.py             ← BL: prior, posterior, omega, views
│   ├── hierarchical.py                ← HRP/HERC/NCO: clustering, risk parity, constraints
│   ├── risk_measures.py               ← VaR, CVaR, MAD, MSV, MDD, DR
│   ├── covariance.py                  ← Covarianza: hist, ledoit-wolf, oas, ewma
│   └── cli.py                         ← CLI unificada (12 modos)
└── tests/
    ├── __init__.py
    └── test_portfolio.py              ← Tests + validación contra notebook

Read the full file on GitHub · 241 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. 3mo ago First seen · 241 lines · 85 tokens per session scan A 0ad591366259

Subscribe to this mod's changes

portfolio is a skill published in the GitHub repository gauss314/skills (258 stars, last pushed 5mo ago), licensed MIT. It adds 85 tokens to every session and 2,819 once invoked, about $0.0003 per session on Opus 5.5. 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-30.

Related

portfolio compared with skills from other repositories

portfolio next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
portfoliogauss314/skillsSkill2585mo agoMITA85Claude Code, Codex
pier-cloudfabricioctelles/skillsSkill1505d agoApache-2.0A75Claude Code, Codex
tfw-economicssaubakirov/trace-first-starterSkill3311d agoMITA20Claude Code, Codex
financejjyaoao/HelloAgentsSkill3.5k1mo agononeA79Claude Code, Codex
bin-lookup-get-{bin}bobadilla-tech/requiems-api-skillsSkill218d agoMITA21Claude Code
commodities-get-{commodity}bobadilla-tech/requiems-api-skillsSkill218d agoMITA27Claude Code
inflation-get-inflationbobadilla-tech/requiems-api-skillsSkill218d agoMITA27Claude Code