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 $0.00043 $0.01409
Sonnet 5 $0.00017 $0.00564
Haiku 4.5 $0.00009 $0.00282

Measured 10d ago against content hash 0ad591366259, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, 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 10d 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. 10d 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 (237 stars, last pushed 2mo ago), licensed MIT. It adds 85 tokens to every session and 2,819 once invoked, about $0.0004 per session on Opus 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

Other skills, from other repositories

pier-cloud

This skill should be used when the user needs to consume the Pier Cloud (Lighthouse) API for cloud cost management — including JWT authentication, listing contexts, workspaces, and FinOps data views. Trigger whenever there is a need to integrate, automate, or debug calls to the Pier Cloud platform via Python, Node.js…

fabricioctelles/skills · 72 tokens

finance

Comprehensive Finance API integration skill for real-time and historical financial data analysis, market research, and investment decision-making. Priority use cases: stock price queries, market data analysis, company financial information, portfolio tracking, market news retrieval, stock screening, technical…

jjyaoao/HelloAgents · 79 tokens

money

Revenue advisor — scans the Obsidian vault for work history and active projects, diagnoses the revenue system, and surfaces monetization opportunities the user can't see from inside their own perspective. Make sure to use this skill whenever the user says "/money", "how can I make more money", "review my revenue"…

kriscard/Skills · 103 tokens

bin-lookup-get-{bin}

Returns card metadata for the given 6–8 digit BIN prefix.

bobadilla-tech/requiems-api-skills · 21 tokens

commodities-get-{commodity}

Returns the latest annual average price and up to 10 years of historical data for the requested commodity slug.

bobadilla-tech/requiems-api-skills · 27 tokens

inflation-post-batch

Returns inflation data for up to 50 countries in a single request. Results are in the same order as the input. Countries with no data return found: false instead of failing the whole request. Billing: 1 credit per country (not per HTTP request).

bobadilla-tech/requiems-api-skills · 58 tokens