Communitygithub.com

diegosouzapw/awesome-omni-skill

Optimiseur d'allocation et de rééquilibrage de portefeuille. Gère la répartition des actifs entre actions/liquidités/obligations, effectue un rééquilibrage périodique et assure la diversification en fonction du régime de marché et de la tolérance au risque.

Qu'est-ce que awesome-omni-skill ?

Ce skill transforme un agent IA en gestionnaire de portefeuille dynamique. Il optimise l'allocation d'actifs en fonction du régime de marché identifié (RISK_ON, RISK_OFF, TRANSITION), en ajustant les pondérations entre actions, obligations et liquidités. Il déclenche des recommandations de rééquilibrage lorsque les écarts dépassent 5 % (standard) ou 10 % (urgent), en générant des ordres d'achat/vente avec montants et justifications. Il intègre aussi la vérification de la conformité avec une constitution de règles (par ex. limites sectorielles max 40 % tech), le calcul de taille de position via le critère de Kelly modifié, et l'optimisation selon la théorie moderne du portefeuille (maximisation du ratio de Sharpe). Des exemples concrets illustrent son utilisation avec différents régimes et écarts de portefeuille.

Compatible avec~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/diegosouzapw/awesome-omni-skill/tree/HEAD/skills/development/portfolio-manager-agent

Demander à votre IA préférée

Ouvre une nouvelle conversation avec cette compétence d'agent déjà préchargée.

Documentation

Agent Gestionnaire de Portefeuille - Portfolio Manager Agent

Rôle

Gérer l'allocation d'actifs, le rééquilibrage et la diversification du portefeuille afin d'optimiser le rendement ajusté au risque.

Capacités principales

1. Stratégie d'allocation d'actifs

Allocation dynamique selon le régime de marché

# RISK_ON (expansion économique, VIX < 20)
allocation = {
    'actions': 0.70,
    'obligations': 0.20,
    'liquidites': 0.10
}

# RISK_OFF (contraction économique, VIX > 25)
allocation = {
    'actions': 0.40,
    'obligations': 0.40,
    'liquidites': 0.20
}

# TRANSITION (période de transition, VIX 20-25)
allocation = {
    'actions': 0.55,
    'obligations': 0.30,
    'liquidites': 0.15
}

Diversification sectorielle

Technologie : maximum 40 %
Finance : maximum 30 %
Santé : maximum 25 %
Autres secteurs : maximum 20 % chacun

2. Déclencheurs de rééquilibrage

SI écart > 5 % :
  → Rééquilibrage recommandé

Exemple :
Cible : Actions 70 %
Actuel : Actions 76 %
Écart : +6 % → RÉÉQUILIBRER

SI écart > 10 % :
  → Rééquilibrage urgent
  → Notification immédiate

3. Surveillance des métriques de risque

  • Bêta du portefeuille : volatilité relative au marché
  • Ratio de Sharpe : rendement ajusté au risque
  • Drawdown maximal : perte maximale
  • Matrice de corrélation : corrélations entre les titres

4. Dimensionnement des positions

# Critère de Kelly (modifié)
taille_position = (taux_gagnant * gain_moyen - (1 - taux_gagnant) * perte_moyenne) / gain_moyen

# Limites de position
taille_position = min(taille_position, POSITION_MAXIMALE_UNIQUE)  # 15 %

Cadre décisionnel

Étape 1 : Analyser le portefeuille actuel
  - Allocation actuelle
  - Positions individuelles
  - Répartition sectorielle
  - Métriques de risque

Étape 2 : Détecter le régime de marché
  from backend.ai.market_regime import MarketRegimeDetector
  regime = detector.detect_regime(donnees_marche)

Étape 3 : Déterminer l'allocation cible
  En fonction du régime :
    - RISK_ON → Agressif (70/20/10)
    - RISK_OFF → Prudent (40/40/20)
    - TRANSITION → Équilibré (55/30/15)

Étape 4 : Calculer l'écart
  ecart = |actuel - cible|

Étape 5 : Décision de rééquilibrage
  SI ecart > seuil :
    → Générer les ordres de rééquilibrage
  SINON :
    → Conserver l'allocation actuelle

Étape 6 : Appliquer les limites constitutionnelles
  - Vérifier la conformité à l'article 4
  - Respecter les limites de position
  - Vérifier les limites sectorielles

Format de sortie

{
  "agent": "gestionnaire_portefeuille",
  "recommandation": "REBALANCE|HOLD",
  "confiance": 0.85,
  "raisonnement": "Le régime de marché passe en RISK_OFF, réduction nécessaire de la part actions",
  "allocation_actuelle": {
    "actions": 0.76,
    "obligations": 0.18,
    "liquidites": 0.06,
    "valeur_totale_usd": 100000
  },
  "allocation_cible": {
    "actions": 0.55,
    "obligations": 0.30,
    "liquidites": 0.15
  },
  "ecart": {
    "actions": 0.21,
    "obligations": -0.12,
    "liquidites": -0.09,
    "ecart_maximal": 0.21
  },
  "ordres_rebalancement": [
    {
      "action": "SELL",
      "classe_actif": "actions",
      "montant_usd": 21000,
      "raison": "Ajustement de la part actions 76 % → 55 %"
    },
    {
      "action": "BUY",
      "classe_actif": "obligations",
      "montant_usd": 12000,
      "raison": "Augmentation de la part obligations 18 % → 30 %"
    },
    {
      "action": "INCREASE",
      "classe_actif": "liquidites",
      "montant_usd": 9000,
      "raison": "Renforcement de la trésorerie (position défensive)"
    }
  ],
  "analyse_risque": {
    "beta_portefeuille": 1.15,
    "ratio_sharpe": 1.45,
    "drawdown_maximal": -0.08,
    "volatilite_attendue": 0.18
  },
  "repartition_sectorielle": {
    "Technologie": 0.35,
    "Finance": 0.20,
    "Santé": 0.15,
    "Autres": 0.30
  },
  "prochaine_date_revision": "2025-12-28"
}

Exemples

Exemple 1 : RISK_ON → allocation agressive

Entrée :
- VIX : 15
- Croissance PIB : 3,0 %
- Régime de marché : RISK_ON
- Actuel : Actions 55 %, Obligations 30 %, Liquidités 15 %

Sortie :
- Recommandation : REBALANCE
- Cible : Actions 70 %, Obligations 20 %, Liquidités 10 %
- Ordres :
  * ACHETER Actions 15 000 $
  * VENDRE Obligations 10 000 $
  * RÉDUIRE Liquidités 5 000 $

Exemple 2 : RISK_OFF → allocation défensive

Entrée :
- VIX : 28
- Signaux de récession
- Régime de marché : RISK_OFF
- Actuel : Actions 70 %, Obligations 20 %, Liquidités 10 %

Sortie :
- Recommandation : URGENT_REBALANCE
- Cible : Actions 40 %, Obligations 40 %, Liquidités 20 %
- Ordres :
  * VENDRE Actions 30 000 $
  * ACHETER Obligations 20 000 $
  * AUGMENTER Liquidités 10 000 $

Exemple 3 : Écart faible → conservation

Entrée :
- Actuel : Actions 68 %, Obligations 22 %, Liquidités 10 %
- Cible : Actions 70 %, Obligations 20 %, Liquidités 10 %
- Écart : 2 %, 2 %, 0 %

Sortie :
- Recommandation : HOLD
- Raisonnement : "Écart < 5 %, conserver est avantageux compte tenu des frais de transaction"

Exemple 4 : Rééquilibrage sectoriel

Entrée :
- Technologie : 45 % (MAX 40 %)
- Finance : 15 %
- Santé : 10 %

Sortie :
- Recommandation : SECTOR_REBALANCE
- Ordres :
  * VENDRE Actions technologiques 5 000 $ (45 % → 40 %)
  * ACHETER Santé 3 000 $
  * ACHETER Finance 2 000 $

Recommandations

À faire ✅

  • Révision régulière : toutes les semaines ou toutes les deux semaines
  • Priorité au régime de marché : allocation en fonction de l'environnement macro
  • Rééquilibrage progressif : éviter les changements brusques
  • Efficacité fiscale : rééquilibrage fiscalement optimisé

À éviter ❌

  • Transactions excessives (tenir compte des frais)
  • Réactions excessives à la volatilité à court terme
  • Modifications d'allocation émotionnelles
  • Violation de l'article 4 de la constitution

Intégration avec le détecteur de régime de marché

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

detector = MarketRegimeDetector()

donnees_regime = {
    'vix': 18,
    'courbe_taux_10y2y': 0.3,
    'position_fed': 'neutre',
    'croissance_pib': 0.025,
    'chomage': 0.038,
    'ipc': 0.028
}

regime = detector.detect_regime(donnees_regime)

# Sortie :
# {
#   "regime_actuel": "RISK_ON",
#   "confiance": 0.75,
#   "allocation_actifs_recommandee": {
#     "actions": 0.70,
#     "obligations": 0.20,
#     "liquidites": 0.10
#   },
#   "indicateurs_regime": {
#     "signal_vix": "FAIBLE_VOLATILITE",
#     "signal_courbe_taux": "NORMALE",
#     "signal_macro": "EXPANSION"
#   }
# }

Algorithme de rééquilibrage

Rééquilibrage basé sur des seuils

def verifier_necessite_rebalancement(
    actuel: Dict[str, float],
    cible: Dict[str, float],
    seuil: float = 0.05
) -> bool:
    """Vérifie si un rééquilibrage est nécessaire"""
    
    for classe_actif in cible.keys():
        ecart = abs(actuel[classe_actif] - cible[classe_actif])
        
        if ecart > seuil:
            return True
    
    return False

# Exemple
actuel = {'actions': 0.76, 'obligations': 0.18, 'liquidites': 0.06}
cible = {'actions': 0.70, 'obligations': 0.20, 'liquidites': 0.10}

necessite_rebalancement = verifier_necessite_rebalancement(actuel, cible)  # True

Calcul des ordres optimaux

def calculer_ordres_rebalancement(
    allocation_actuelle: Dict[str, float],
    allocation_cible: Dict[str, float],
    valeur_totale_portefeuille: float
) -> List[Dict]:
    """Calcule les ordres optimaux pour le rééquilibrage"""
    
    ordres = []
    
    for classe_actif, pourcentage_cible in allocation_cible.items():
        pourcentage_actuel = allocation_actuelle[classe_actif]
        valeur_actuelle = pourcentage_actuel * valeur_totale_portefeuille
        valeur_cible = pourcentage_cible * valeur_totale_portefeuille
        
        difference = valeur_cible - valeur_actuelle
        
        if abs(difference) > 1000:  # Ordre minimum de 1 000 $
            action = "BUY" if difference > 0 else "SELL"
            ordres.append({
                "classe_actif": classe_actif,
                "action": action,
                "montant_usd": abs(difference),
                "de_pct": pourcentage_actuel,
                "a_pct": pourcentage_cible
            })
    
    return ordres

Métriques de performance

  • Fréquence de rééquilibrage : cible 1 à 2 fois par mois
  • Coûts de transaction : < 0,5 % de la valeur du portefeuille
  • Amélioration du ratio de Sharpe : cible +10 % vs. achat-conservation
  • Réduction du drawdown : cible -20 % vs. portefeuille non géré

Conformité constitutionnelle

from backend.constitution import Constitution

constitution = Constitution()

# Valider les ordres de rééquilibrage
for ordre in ordres_rebalancement:
    # Vérifier si la nouvelle allocation viole l'article 4
    nouvelle_allocation = appliquer_ordre(allocation_actuelle, ordre)
    
    est_valide, violations, _ = constitution.valider_allocation(
        nouvelle_allocation,
        positions_actuelles
    )
    
    if not est_valide:
        # Ajuster l'ordre pour être conforme
        ordre = ajuster_ordre_conformite(ordre, violations)

Dimensionnement des positions ajusté au risque

Intégration de la théorie moderne du portefeuille (MPT)

import numpy as np
from scipy.optimize import minimize

def optimiser_portefeuille(
    rendements: np.array,
    covariance: np.array,
    taux_sans_risque: float = 0.03
) -> np.array:
    """Optimise le portefeuille selon la MPT"""
    
    n_actifs = len(rendements)
    
    # Objectif : maximiser le ratio de Sharpe
    def objectif(poids):
        rendement_portefeuille = np.dot(poids, rendements)
        ecart_type_portefeuille = np.sqrt(np.dot(poids, np.dot(covariance, poids)))
        sharpe = (rendement_portefeuille - taux_sans_risque) / ecart_type_portefeuille
        return -sharpe  # Minimiser le Sharpe négatif
    
    # Contraintes
    contraintes = [
        {'type': 'eq', 'fun': lambda w: np.sum(w) - 1},  # Somme à 1
        {'type': 'ineq', 'fun': lambda w: w}  # Non négatif
    ]
    
    # Bornes (max 15 % par action)
    bornes = tuple((0, 0.15) for _ in range(n_actifs))
    
    # Estimation initiale
    x0 = np.array([1/n_actifs] * n_actifs)
    
    # Optimiser
    resultat = minimize(objectif, x0, method='SLSQP', bounds=bornes, constraints=contraintes)
    
    return resultat.x

Collaboration avec d'autres agents

War Room → Signaux de trading
  ↓
Gestionnaire de portefeuille → Vérifier l'allocation actuelle
  ↓
SI la nouvelle position crée un déséquilibre :
  → Suggérer une taille de position partielle
  OU
  → Recommander la vente d'autres positions en premier

Exemple :
War Room : ACHETER AAPL 15 000 $
Gestionnaire de portefeuille : "Le secteur technologique est déjà à 38 %, n'acheter qu'à 10 000 $"

Rapports

Rapport de portefeuille hebdomadaire

# Rapport de performance du portefeuille - Semaine du 2025-12-21

## Allocation d'actifs
- Actions : 68 % (Cible : 70 %) ✓
- Obligations : 22 % (Cible : 20 %) ⚠️
- Liquidités : 10 % (Cible : 10 %) ✓

## Performance
- Rendement hebdomadaire : +2,3 %
- Rendement YTD : +15,7 %
- Ratio de Sharpe : 1,45
- Drawdown maximal : -8,2 %

## Actions effectuées
- Aucune (dans la tolérance)

## Prochaine révision : 2025-12-28

Historique des versions

  • v1.0 (2025-12-21) : Version initiale avec optimisation MPT et intégration du régime de marché

Individual skills in this repo

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

diegosouzapw/awesome-omni-skill

Build a GitHub portfolio that gets you hired — curate 3-5 polished projects, craft compelling READMEs, deploy live demos, tell a coherent story across your repos, and align everything to AI-native development roles. Use when preparing your GitHub for job searches, deciding what to pin, or auditing your public presence.

diegosouzapw/awesome-omni-skill

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

diegosouzapw/awesome-omni-skill

Factor modeling and portfolio construction (Markowitz, Black-Litterman, constraints, turnover).

diegosouzapw/awesome-omni-skill

Analyze the CustomGPT.ai Labs Innovation workbook and cost tracking data to surface portfolio-level insights, trends, and recommendations for where to focus Innovation efforts.

diegosouzapw/awesome-omni-skill

Optimize project portfolio selection under constraints using mathematical optimization

diegosouzapw/awesome-omni-skill

Rapidly build, prototype, and deploy full-stack software using AI "text-to-app" tools. Use this when you need to create a greenfield application, build a high-fidelity working prototype for user testing, or bypass traditional engineering bottlenecks for internal tools.

diegosouzapw/awesome-omni-skill

Expert in building portfolios that actually land jobs and clients - not just showing work, but creating memorable experiences. Covers developer portfolios, designer portfolios, creative portfolios,...

diegosouzapw/awesome-omni-skill

Minimalist, typography-focused portfolio design system inspired by neo-brutalist and Swiss design principles. Emphasizes bold typography, generous whitespace, monochromatic color schemes, and elegant simplicity for developer/designer portfolios.

diegosouzapw/awesome-omni-skill

Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".

diegosouzapw/awesome-omni-skill

High-converting landing pages. Copy + design + implementation. Triggers: landing page, conversion page.

diegosouzapw/awesome-omni-skill

Detect and explain risk drift in lending portfolios over time using vintage analysis, migration matrices, and concentration metrics. Use when monitoring portfolio credit quality trends, preparing board risk reports, conducting stress testing, or when risk metrics deviate from appetite thresholds.

diegosouzapw/awesome-omni-skill

Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".

diegosouzapw/awesome-omni-skill

Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".

diegosouzapw/awesome-omni-skill

Index-based file discovery using ABOUTME headers. Use INSTEAD of grep or Explore agent when searching for files by purpose or feature. Faster and more accurate than scanning code. Invoke this skill when user asks "which files handle X", "where is Y implemented", or when you need to find files related to a feature or task.

diegosouzapw/awesome-omni-skill

Index-based file discovery using ABOUTME headers. Use INSTEAD of grep or Explore agent when searching for files by purpose or feature. Faster and more accurate than scanning code. Invoke this skill when user asks "which files handle X", "where is Y implemented", or when you need to find files related to a feature or task.

diegosouzapw/awesome-omni-skill

Automate Klipfolio tasks via Rube MCP (Composio). Always search tools first for current schemas.

diegosouzapw/service-website-generator

Orchestrates automated service-based website generation with local SEO optimization. Creates 200+ service+location pages using parallel agents, Unsplash images via Jina AI, NextJS with dynamic routing, and PostgreSQL database. Use when building service business websites (plumbers, electricians, pressure washing, HVAC, etc.) targeting multiple locations.

Skills associés