Communitygithub.com

majiayu000/claude-skill-registry

Optimiert Portfolioallokation und Rebalancing. Verwalte die Vermögensaufteilung auf Aktien, Kasse und Anleihen, führe regelmäßiges Rebalancing durch und stelle eine Diversifikation gemäß Marktphase und Risikotoleranz sicher.

Was ist claude-skill-registry?

Diese Skill für Portfolio Manager optimiert die Vermögensaufteilung und das Rebalancing von Portfolios, um die Rendite pro Risikoeinheit zu maximieren. Sie richtet die Allokation dynamisch an der aktuellen Marktphase aus (RISK_ON/TRANSITION/RISK_OFF) und passt die Gewichtung von Aktien, Anleihen und Kasse entsprechend an. Die Skill überwacht kontinuierlich Abweichungen der Ist- von der Soll-Allokation und löst bei Überschreiten von Schwellenwerten (z.B. >5 %) Rebalancing- oder dringende Umstrukturierungsmaßnahmen aus. Sie berechnet optimale Handelsvorschläge basierend auf der Kelly-Formel und der modernen Portfoliotheorie (MPT), berücksichtigt Sektorgrenzen, Transaktionskosten und verfassungsrechtliche Limits. Die Skill integriert sich mit anderen Agenten wie dem War Room und dem Market Regime Detector und gibt strukturierte JSON-Empfehlungen, die alle relevanten Kennzahlen (Beta, Sharpe Ratio, max. Drawdown) sowie konkrete Trades und eine nächste Überprüfungsdatum enthalten.

Funktioniert mit✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/majiayu000/claude-skill-registry/tree/HEAD/skills/agent/portfolio-manager-agent

In Ihrer bevorzugten KI fragen

Öffnet einen neuen Chat, in dem dieser Agent-Skill bereits geladen ist.

Dokumentation

Portfolio Manager Agent - Portfolio Manager

Rolle

Verwaltet Asset-Allokation, Rebalancing und Diversifikation zur Optimierung des Risiko-Ertrags-Verhältnisses.

Kernfähigkeiten

1. Asset-Allokationsstrategie

Dynamische Allokation nach Marktphase

# RISK_ON (wirtschaftliche Expansion, VIX < 20)
allocation = {
    'stocks': 0.70,
    'bonds': 0.20,
    'cash': 0.10
}

# RISK_OFF (wirtschaftliche Kontraktion, VIX > 25)
allocation = {
    'stocks': 0.40,
    'bonds': 0.40,
    'cash': 0.20
}

# TRANSITION (Übergangsphase, VIX 20-25)
allocation = {
    'stocks': 0.55,
    'bonds': 0.30,
    'cash': 0.15
}

Sektordiversifikation

Technologie: max. 40 %
Finanzen: max. 30 %
Gesundheitswesen: max. 25 %
Andere Sektoren: max. 20 %

2. Rebalancing-Trigger

WENN Abweichung > 5 %:
  → Rebalancing empfohlen

Beispiel:
Ziel: Aktien 70 %
Ist: Aktien 76 %
Abweichung: +6 % → REBALANCE

WENN Abweichung > 10 %:
  → Dringendes Rebalancing
  → Sofortige Benachrichtigung

3. Überwachung von Risikokennzahlen

  • Portfolio-Beta: Volatilität im Vergleich zum Markt
  • Sharpe Ratio: Rendite pro Risikoeinheit
  • Max Drawdown: Maximaler Verlust
  • Korrelationsmatrix: Korrelationen zwischen Positionen

4. Positionsgrößenbestimmung

# Kelly-Kriterium (modifiziert)
position_size = (win_rate * avg_win - (1 - win_rate) * avg_loss) / avg_win

# Positionslimits
position_size = min(position_size, MAX_SINGLE_POSITION)  # 15 %

Entscheidungsrahmen

Schritt 1: Aktuelles Portfolio analysieren
  - Aktuelle Allokation
  - Einzelpositionen
  - Sektoraufteilung
  - Risikokennzahlen

Schritt 2: Marktphase erkennen
  from backend.ai.market_regime import MarketRegimeDetector
  regime = detector.detect_regime(market_data)

Schritt 3: Zielallokation bestimmen
  Basierend auf der Phase:
    - RISK_ON → Aggressiv (70/20/10)
    - RISK_OFF → Konservativ (40/40/20)
    - TRANSITION → Ausgewogen (55/30/15)

Schritt 4: Abweichung berechnen
  deviation = |ist - soll|

Schritt 5: Rebalancing-Entscheidung
  WENN Abweichung > Schwellenwert:
    → Rebalancing-Trades generieren
  SONST:
    → Aktuelle Allokation beibehalten

Schritt 6: Verfassungsgrenzen anwenden
  - Artikel 4 Compliance prüfen
  - Positionslimits sicherstellen
  - Sektorgrenzen überprüfen

Ausgabeformat

{
  "agent": "portfolio_manager",
  "recommendation": "REBALANCE|HOLD",
  "confidence": 0.85,
  "reasoning": "Marktphase auf RISK_OFF gewechselt, Reduzierung des Aktienanteils erforderlich",
  "current_allocation": {
    "stocks": 0.76,
    "bonds": 0.18,
    "cash": 0.06,
    "total_value_usd": 100000
  },
  "target_allocation": {
    "stocks": 0.55,
    "bonds": 0.30,
    "cash": 0.15
  },
  "deviation": {
    "stocks": 0.21,
    "bonds": -0.12,
    "cash": -0.09,
    "max_deviation": 0.21
  },
  "rebalancing_trades": [
    {
      "action": "SELL",
      "asset_class": "stocks",
      "amount_usd": 21000,
      "reason": "Aktienanteil von 76 % auf 55 % reduzieren"
    },
    {
      "action": "BUY",
      "asset_class": "bonds",
      "amount_usd": 12000,
      "reason": "Anleihenanteil von 18 % auf 30 % erhöhen"
    },
    {
      "action": "INCREASE",
      "asset_class": "cash",
      "amount_usd": 9000,
      "reason": "Kassenbestand aufstocken (defensive Position)"
    }
  ],
  "risk_analysis": {
    "portfolio_beta": 1.15,
    "sharpe_ratio": 1.45,
    "max_drawdown": -0.08,
    "expected_volatility": 0.18
  },
  "sector_breakdown": {
    "Technology": 0.35,
    "Finance": 0.20,
    "Healthcare": 0.15,
    "Other": 0.30
  },
  "next_review_date": "2025-12-28"
}

Beispiele

Beispiel 1: RISK_ON → aggressive Allokation

Eingabe:
- VIX: 15
- BIP-Wachstum: 3,0 %
- Marktphase: RISK_ON
- Ist: Aktien 55 %, Anleihen 30 %, Kasse 15 %

Ausgabe:
- Empfehlung: REBALANCE
- Ziel: Aktien 70 %, Anleihen 20 %, Kasse 10 %
- Trades:
  * KAUF Aktien 15.000 USD
  * VERKAUF Anleihen 10.000 USD
  * REDUZIERE Kasse 5.000 USD

Beispiel 2: RISK_OFF → defensive Allokation

Eingabe:
- VIX: 28
- Rezessionssignale
- Marktphase: RISK_OFF
- Ist: Aktien 70 %, Anleihen 20 %, Kasse 10 %

Ausgabe:
- Empfehlung: URGENT_REBALANCE
- Ziel: Aktien 40 %, Anleihen 40 %, Kasse 20 %
- Trades:
  * VERKAUF Aktien 30.000 USD
  * KAUF Anleihen 20.000 USD
  * ERHÖHE Kasse 10.000 USD

Beispiel 3: Geringe Abweichung → Halten

Eingabe:
- Ist: Aktien 68 %, Anleihen 22 %, Kasse 10 %
- Ziel: Aktien 70 %, Anleihen 20 %, Kasse 10 %
- Abweichung: 2 %, 2 %, 0 %

Ausgabe:
- Empfehlung: HOLD
- Begründung: "Abweichung < 5 %, unter Berücksichtigung der Transaktionskosten ist Halten vorteilhaft"

Beispiel 4: Sektor-Rebalancing

Eingabe:
- Technologie: 45 % (MAX 40 %)
- Finanzen: 15 %
- Gesundheitswesen: 10 %

Ausgabe:
- Empfehlung: SECTOR_REBALANCE
- Trades:
  * VERKAUF Technologieaktien 5.000 USD (45 % → 40 %)
  * KAUF Gesundheitswesen 3.000 USD
  * KAUF Finanzen 2.000 USD

Richtlinien

Gebote ✅

  • Regelmäßige Überprüfung: Wöchentliche oder vierzehntägliche Kontrolle
  • Marktphase priorisieren: Allokation an makroökonomische Umgebung anpassen
  • Schrittweises Rebalancing: Abrupte Änderungen vermeiden
  • Steuereffizienz: Steuerlich effizientes Rebalancing

Verbote ❌

  • Übermäßiger Handel vermeiden (Transaktionskosten beachten)
  • Nicht auf kurzfristige Volatilität überreagieren
  • Keine emotionalen Allokationsänderungen
  • Keine Verstöße gegen Artikel 4 der Verfassung

Integration mit dem Marktphasen-Detektor

from backend.ai.market_regime import MarketRegimeDetector
from backend.ai.regime_detector import detect_market_regime

detector = MarketRegimeDetector()

regime_data = {
    'vix': 18,
    'yield_curve_10y2y': 0.3,
    'fed_stance': 'neutral',
    'gdp_growth': 0.025,
    'unemployment': 0.038,
    'cpi': 0.028
}

regime = detector.detect_regime(regime_data)

# Ausgabe:
# {
#   "current_regime": "RISK_ON",
#   "confidence": 0.75,
#   "recommended_asset_allocation": {
#     "stocks": 0.70,
#     "bonds": 0.20,
#     "cash": 0.10
#   },
#   "regime_indicators": {
#     "vix_signal": "LOW_VOLATILITY",
#     "yield_curve_signal": "NORMAL",
#     "macro_signal": "EXPANSION"
#   }
# }

Rebalancing-Algorithmus

Schwellwertbasiertes Rebalancing

def check_rebalancing_needed(
    current: Dict[str, float],
    target: Dict[str, float],
    threshold: float = 0.05
) -> bool:
    """Prüft, ob ein Rebalancing erforderlich ist"""
    
    for asset_class in target.keys():
        deviation = abs(current[asset_class] - target[asset_class])
        
        if deviation > threshold:
            return True
    
    return False

# Beispiel
current = {'stocks': 0.76, 'bonds': 0.18, 'cash': 0.06}
target = {'stocks': 0.70, 'bonds': 0.20, 'cash': 0.10}

needs_rebalance = check_rebalancing_needed(current, target)  # True

Optimale Handelsberechnung

def calculate_rebalancing_trades(
    current_allocation: Dict[str, float],
    target_allocation: Dict[str, float],
    total_portfolio_value: float
) -> List[Dict]:
    """Berechnet optimale Trades für das Rebalancing"""
    
    trades = []
    
    for asset_class, target_pct in target_allocation.items():
        current_pct = current_allocation[asset_class]
        current_value = current_pct * total_portfolio_value
        target_value = target_pct * total_portfolio_value
        
        diff = target_value - current_value
        
        if abs(diff) > 1000:  # Mindesthandelsvolumen 1.000 USD
            action = "BUY" if diff > 0 else "SELL"
            trades.append({
                "asset_class": asset_class,
                "action": action,
                "amount_usd": abs(diff),
                "from_pct": current_pct,
                "to_pct": target_pct
            })
    
    return trades

Leistungskennzahlen

  • Rebalancing-Häufigkeit: Ziel 1-2 Mal pro Monat
  • Transaktionskosten: < 0,5 % des Portfoliowerts
  • Verbesserung der Sharpe Ratio: Ziel +10 % gegenüber Buy-and-Hold
  • Reduzierung des Drawdowns: Ziel -20 % gegenüber unverwaltetem Portfolio

Verfassungskonformität

from backend.constitution import Constitution

constitution = Constitution()

# Rebalancing-Trades validieren
for trade in rebalancing_trades:
    # Prüfen, ob die neue Allokation gegen Artikel 4 verstößt
    new_allocation = apply_trade(current_allocation, trade)
    
    is_valid, violations, _ = constitution.validate_allocation(
        new_allocation,
        current_positions
    )
    
    if not is_valid:
        # Trade anpassen, um Compliance zu gewährleisten
        trade = adjust_trade_for_compliance(trade, violations)

Risikoadjustierte Positionsgrößenbestimmung

Integration der modernen Portfoliotheorie (MPT)

import numpy as np
from scipy.optimize import minimize

def optimize_portfolio(
    returns: np.array,
    covariance: np.array,
    risk_free_rate: float = 0.03
) -> np.array:
    """Optimiert das Portfolio mittels MPT"""
    
    n_assets = len(returns)
    
    # Zielfunktion: Sharpe Ratio maximieren
    def objective(weights):
        portfolio_return = np.dot(weights, returns)
        portfolio_std = np.sqrt(np.dot(weights, np.dot(covariance, weights)))
        sharpe = (portfolio_return - risk_free_rate) / portfolio_std
        return -sharpe  # Negative Sharpe minimieren
    
    # Nebenbedingungen
    constraints = [
        {'type': 'eq', 'fun': lambda w: np.sum(w) - 1},  # Summe = 1
        {'type': 'ineq', 'fun': lambda w: w}  # Nicht-negativ
    ]
    
    # Schranken (max. 15 % pro Aktie)
    bounds = tuple((0, 0.15) for _ in range(n_assets))
    
    # Anfangsschätzung
    x0 = np.array([1/n_assets] * n_assets)
    
    # Optimierung
    result = minimize(objective, x0, method='SLSQP', bounds=bounds, constraints=constraints)
    
    return result.x

Zusammenarbeit mit anderen Agenten

War Room → Handelssignale
  ↓
Portfolio Manager → Aktuelle Allokation prüfen
  ↓
WENN neue Position ein Ungleichgewicht verursacht:
  → Teilweise Positionsgröße vorschlagen
  ODER
  → Vorherigen Verkauf anderer Positionen empfehlen

Beispiel:
War Room: KAUF AAPL 15.000 USD
Portfolio Manager: "Technologiesektor bereits bei 38 %, KAUF nur 10.000 USD"

Berichterstattung

Wöchentlicher Portfolio-Bericht

# Portfolio-Performance-Bericht - KW 2025-12-21

## Vermögensaufteilung
- Aktien: 68 % (Ziel: 70 %) ✓
- Anleihen: 22 % (Ziel: 20 %) ⚠️
- Kasse: 10 % (Ziel: 10 %) ✓

## Performance
- Wochenrendite: +2,3 %
- YTD-Rendite: +15,7 %
- Sharpe Ratio: 1,45
- Max. Drawdown: -8,2 %

## Durchgeführte Maßnahmen
- Keine (innerhalb der Toleranz)

## Nächste Überprüfung: 2025-12-28

Versionsverlauf

  • v1.0 (2025-12-21): Erste Veröffentlichung mit MPT-Optimierung und Marktphasenintegration

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

majiayu000/claude-skill-registry

Builds, edit or validate Agent Skill through conversational discovery. Use when the user requests to "Create an Agent", "Optimize an Agent" or "Edit an Agent".

majiayu000/claude-skill-registry

Edit existing BMAD agents while maintaining compliance

majiayu000/claude-skill-registry

Edit existing BMAD agents while maintaining compliance

majiayu000/claude-skill-registry

Edit existing BMAD modules while maintaining coherence

majiayu000/claude-skill-registry

Edit existing BMAD modules while maintaining coherence

majiayu000/claude-skill-registry

Analyzes current state and user query to answer BMad questions or recommend the next workflow or agent. Use when user says what should I do next, what do I do now, or asks a question about BMad

majiayu000/claude-skill-registry

Build AI agents with Google ADK Python (Agent Development Kit). Use for multi-agent systems, workflow agents (sequential/parallel/loop), Vertex AI deployment, tool integration, human-in-the-loop.

majiayu000/claude-skill-registry

Build AI agents with Google ADK Python (Agent Development Kit). Use for multi-agent systems, workflow agents (sequential/parallel/loop), Vertex AI deployment, tool integration, human-in-the-loop.

majiayu000/claude-skill-registry

Create a hilarious and ultra-realistic video of an anthropomorphic animal acting like a human vlogger in a real-world setting.

majiayu000/claude-skill-registry

Speech-to-text transcription and translation via OpenAI Audio API -- models, response formats, timestamps, prompting, streaming, chunking, and diarization

majiayu000/claude-skill-registry

BlockRun works with Claude Code and Google Antigravity.

majiayu000/claude-skill-registry

This skill should be used when the user asks about libraries, frameworks, API references, or needs code examples. Activates for setup questions, code generation involving libraries, or mentions of specific frameworks like React, Vue, Next.js, Prisma, Supabase, etc.

majiayu000/claude-skill-registry

小省导购员数字人带货版即梦视频提示词生成系统,基于四大智能体协同(提示词生成师、质量管控师、知识库运维师、跨环节适配师),按照"主体+运动+场景+(镜头语言+光影+氛围)"公式输出中英文双版提示词,适配5s短视频。确保人物一致性、视觉连贯性、情绪连贯性,支持知识库智能复用和跨工具适配(Suno音乐、AI绘画),为数字人带货视频提供高质量提示词生成服务。

majiayu000/claude-skill-registry

Upload and manage files using Google Gemini File API via scripts/. Use for uploading images, audio, video, PDFs, and other files for use with Gemini models. Supports file upload, status checking, and file management. Triggers on "upload file", "file API", "upload image", "upload PDF", "upload video", "file management".

majiayu000/claude-skill-registry

CRITICAL: Use for MolyKit AI chat toolkit. Triggers on: BotClient, OpenAI, SSE streaming, AI chat, molykit, PlatformSend, spawn(), ThreadToken, cross-platform async, Chat widget, Messages, PromptInput, Avatar, LLM

majiayu000/claude-skill-registry

AI and machine learning workflow covering LLM application development, RAG implementation, agent architecture, ML pipelines, and AI-powered features.

majiayu000/claude-skill-registry

Analyze images/audio/video with Gemini API (better vision than Claude). Generate images (Imagen 4), videos (Veo 3). Use for vision analysis, transcription, OCR, design extraction, multimodal AI.

majiayu000/claude-skill-registry

Analyze images/audio/video with Gemini API (better vision than Claude). Generate images (Imagen 4), videos (Veo 3). Use for vision analysis, transcription, OCR, design extraction, multimodal AI.

majiayu000/claude-skill-registry

Conduct domain and industry research. Use when the user says "lets create a research report on [domain or industry]

majiayu000/claude-skill-registry

Skill for discovering and researching autonomous AI agents, tools, and ecosystems using the AgentFolio directory.

Verwandte Skills