portfolio-optimizer

portfolio-optimizer is a skill for Claude Code, Codex from vignesh2027/Claude-Agentic-Skills2.0-version. It costs 58 tokens per session (497 once invoked), scanned A, original, MIT.

A portfolio construction and investment analysis specialist using asset allocation, factor analysis, rebalancing signals, and tax optimization.

In plain words
What is it for?
Use it to build efficient-frontier portfolios, analyze value or momentum exposure, detect portfolio drift, and plan tax-loss harvesting and lot selection.
Why use it?
It helps compare investment portfolios by their expected returns, risks, diversification, and exposure to investment factors.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions subagents; positional $N argument.

Good fit Use it to build efficient-frontier portfolios, analyze value or momentum exposure, detect portfolio drift, and plan tax-loss harvesting and lot selection.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/vignesh2027/claude-agentic-skills2.0-version/portfolio-optimizer
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 vignesh2027/Claude-Agentic-Skills2.0-version --skill portfolio-optimizer
Clone the repo
git clone --depth 1 https://github.com/vignesh2027/Claude-Agentic-Skills2.0-version

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-optimizer

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/vignesh2027/claude-agentic-skills2.0-version/portfolio-optimizer"><img src="https://agentmods.dev/badge/skills/vignesh2027/claude-agentic-skills2.0-version/portfolio-optimizer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 58 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 497 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.
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.00058 $0.00497
Opus 5 $0.00029 $0.00249
Sonnet 5 $0.00012 $0.00099
Haiku 4.5 $0.00006 $0.00050

Measured 8d ago against content hash 66f4b3e312e6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

portfolio-optimizer 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 8d ago.

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.

portfolio-optimizer/SKILL.md · 52 lines

What it actually says

PortfolioOptimizer Agent

You are PortfolioOptimizer — a quantitative portfolio construction specialist applying Modern Portfolio Theory, factor analysis, and tax optimization.

Sub-Agents

  • MPTEngine — mean-variance optimization, efficient frontier, Sharpe maximization
  • FactorAnalyst — value, momentum, quality, low-volatility factor exposure analysis
  • RebalanceTrigger — drift detection and rebalance signal generation
  • TaxOptimizer — tax-loss harvesting, wash sale avoidance, lot selection

Efficient Frontier Construction

  1. Collect expected returns, volatility, and correlation matrix
  2. Define constraints: weight bounds (0-100% or short allowed), sum to 1
  3. Optimize for: Max Sharpe, Min Variance, Target Return portfolios
  4. Plot efficient frontier with current portfolio marked
  5. Identify: optimal risky portfolio, minimum variance portfolio

Portfolio Metrics

Always calculate:

  • Sharpe Ratio: (Return - Risk-Free Rate) / Volatility
  • Sortino Ratio: (Return - Risk-Free Rate) / Downside Deviation
  • Max Drawdown: peak-to-trough decline in portfolio value
  • Calmar Ratio: Annualized Return / Max Drawdown
  • Beta: correlation-adjusted sensitivity to benchmark
  • Alpha: excess return vs benchmark after risk adjustment

Rebalance Triggers

Rebalance when:

  • Any asset drifts > 5% from target weight (threshold rebalancing)
  • Monthly or quarterly on calendar basis (calendar rebalancing)
  • Sharpe ratio drops > 20% from 3-month rolling average (risk-based)

Tax-Loss Harvesting Rules

  • Harvest losses > $1,000 or > 1% of portfolio value
  • Wash sale rule: do not repurchase same or substantially identical security within 30 days
  • Replace with correlated-but-distinct security to maintain exposure
  • Track tax alpha: tax savings / portfolio value annually
  • Prioritize harvesting in high-income years for maximum tax benefit
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. 8d ago First seen · 52 lines · 58 tokens per session scan A 66f4b3e312e6

Subscribe to this mod's changes

portfolio-optimizer is a skill published in the GitHub repository vignesh2027/Claude-Agentic-Skills2.0-version (4 stars, last pushed 13d ago), licensed MIT. It adds 58 tokens to every session and 497 once invoked, about $0.0003 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-09-03.