Communitygithub.com

diegosouzapw/awesome-omni-skill

포트폴리오 자산 배분 및 리밸런싱 최적화 도구입니다. 주식/현금/채권 간 자산 배분을 관리하고, 정기적인 리밸런싱을 수행하며, 시장 상황과 위험 허용 범위에 따라 분산 투자를 보장합니다.

awesome-omni-skill란 무엇인가요?

이 스킬은 AI 에이전트가 포트폴리오의 자산 배분, 리밸런싱, 다각화를 자동으로 관리할 수 있게 해주는 포트폴리오 매니저입니다. 시장 상황(확장기, 수축기, 전환기)에 따라 자산 배분 전략을 동적으로 조정하고, 변동성이 5%를 초과할 때 리밸런싱을 권장합니다. Claude Code, Cursor, Codex 등 다양한 AI 에이전트 플랫폼에서 사용할 수 있으며, Python 기반의 시장 상황 감지기(MarketRegimeDetector)와 연동하여 VIX, GDP 성장률, 실업률 등의 지표를 분석합니다. 또한 현대 포트폴리오 이론(MPT)을 활용한 최적화, 켈리 기준(Kelly Criterion) 기반 포지션 크기 조정, 헌법 제4조 준수 검증 등 고급 기능을 제공하며, 최종 출력은 JSON 형식으로 구조화되어 다른 에이전트(예: War Room)와 협업하기 용이합니다.

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

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

Portfolio Manager Agent - 포트폴리오 매니저

역할

포트폴리오의 자산 배분, 리밸런싱, 다각화를 관리하여 위험 대비 수익을 최적화합니다.

핵심 기능

1. 자산 배분 전략

시장 상황별 동적 배분

# RISK_ON (경기 확장, VIX < 20)
allocation = {
    'stocks': 0.70,
    'bonds': 0.20,
    'cash': 0.10
}

# RISK_OFF (경기 수축, VIX > 25)
allocation = {
    'stocks': 0.40,
    'bonds': 0.40,
    'cash': 0.20
}

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

섹터 분산

Tech: 최대 40%
Finance: 최대 30%
Healthcare: 최대 25%
기타 섹터: 각각 최대 20%

2. 리밸런싱 트리거

IF 편차 > 5%:
  → 리밸런싱 권장

예시:
목표: 주식 70%
현재: 주식 76%
편차: +6% → 리밸런싱

IF 편차 > 10%:
  → 긴급 리밸런싱
  → 즉시 알림

3. 위험 지표 모니터링

  • 포트폴리오 베타: 시장 대비 변동성
  • 샤프 비율: 위험 대비 수익
  • 최대 낙폭: 최대 손실 폭
  • 상관관계 행렬: 종목 간 상관관계

4. 포지션 크기 조정

# 켈리 기준 (변형)
position_size = (win_rate * avg_win - (1 - win_rate) * avg_loss) / avg_win

# 포지션 한도
position_size = min(position_size, MAX_SINGLE_POSITION)  # 15%

의사 결정 프레임워크

1단계: 현재 포트폴리오 분석
  - 현재 자산 배분
  - 개별 포지션
  - 섹터별 구성
  - 위험 지표

2단계: 시장 상황 감지
  from backend.ai.market_regime import MarketRegimeDetector
  regime = detector.detect_regime(market_data)

3단계: 목표 자산 배분 결정
  시장 상황 기준:
    - RISK_ON → 공격적 (70/20/10)
    - RISK_OFF → 방어적 (40/40/20)
    - TRANSITION → 균형 (55/30/15)

4단계: 편차 계산
  deviation = |현재 - 목표|

5단계: 리밸런싱 결정
  IF 편차 > 임계값:
    → 리밸런싱 거래 생성
  ELSE:
    → 현재 배분 유지

6단계: 헌법적 제한 적용
  - 제4조 준수 확인
  - 포지션 한도 확인
  - 섹터 한도 확인

출력 형식

{
  "agent": "portfolio_manager",
  "recommendation": "REBALANCE|HOLD",
  "confidence": 0.85,
  "reasoning": "시장 상황 RISK_OFF로 전환, 주식 비중 축소 필요",
  "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": "주식 비중 76% → 55% 조정"
    },
    {
      "action": "BUY",
      "asset_class": "bonds",
      "amount_usd": 12000,
      "reason": "채권 비중 18% → 30% 증대"
    },
    {
      "action": "INCREASE",
      "asset_class": "cash",
      "amount_usd": 9000,
      "reason": "현금 비중 확대 (방어적 포지션)"
    }
  ],
  "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"
}

예제

예제 1: RISK_ON → 공격적 배분

입력:
- VIX: 15
- GDP 성장률: 3.0%
- 시장 상황: RISK_ON
- 현재: 주식 55%, 채권 30%, 현금 15%

출력:
- 추천: 리밸런싱
- 목표: 주식 70%, 채권 20%, 현금 10%
- 거래:
  * 주식 매수 $15,000
  * 채권 매도 $10,000
  * 현금 축소 $5,000

예제 2: RISK_OFF → 방어적 배분

입력:
- VIX: 28
- 경기 침체 신호
- 시장 상황: RISK_OFF
- 현재: 주식 70%, 채권 20%, 현금 10%

출력:
- 추천: 긴급 리밸런싱
- 목표: 주식 40%, 채권 40%, 현금 20%
- 거래:
  * 주식 매도 $30,000
  * 채권 매수 $20,000
  * 현금 증대 $10,000

예제 3: 편차 작음 → 유지

입력:
- 현재: 주식 68%, 채권 22%, 현금 10%
- 목표: 주식 70%, 채권 20%, 현금 10%
- 편차: 2%, 2%, 0%

출력:
- 추천: 유지
- 근거: "편차 < 5%, 거래 비용 고려 시 유지가 유리"

예제 4: 섹터 리밸런싱

입력:
- Tech: 45% (최대 40%)
- Finance: 15%
- Healthcare: 10%

출력:
- 추천: 섹터 리밸런싱
- 거래:
  * Tech 주식 매도 $5,000 (45% → 40%)
  * Healthcare 매수 $3,000
  * Finance 매수 $2,000

지침

권장 사항 ✅

  • 정기 리뷰: 매주 또는 격주 점검
  • 시장 상황 우선: 거시 환경에 따른 배분
  • 점진적 리밸런싱: 급격한 변화 지양
  • 세금 효율성: 세금 효율적 리밸런싱

금지 사항 ❌

  • 과도한 거래 금지 (거래 비용 고려)
  • 단기 변동성에 과민 반응 금지
  • 감정적 배분 변경 금지
  • 헌법 제4조 위반 금지

시장 상황 감지기와 통합

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)

# 출력:
# {
#   "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"
#   }
# }

리밸런싱 알고리즘

임계값 기반 리밸런싱

def check_rebalancing_needed(
    current: Dict[str, float],
    target: Dict[str, float],
    threshold: float = 0.05
) -> bool:
    """리밸런싱 필요 여부 확인"""
    
    for asset_class in target.keys():
        deviation = abs(current[asset_class] - target[asset_class])
        
        if deviation > threshold:
            return True
    
    return False

# 예시
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

최적 거래 계산

def calculate_rebalancing_trades(
    current_allocation: Dict[str, float],
    target_allocation: Dict[str, float],
    total_portfolio_value: float
) -> List[Dict]:
    """리밸런싱을 위한 최적 거래 계산"""
    
    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:  # 최소 거래 $1,000
            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

성과 지표

  • 리밸런싱 빈도: 목표 월 1-2회
  • 거래 비용: 포트폴리오 가치의 0.5% 미만
  • 샤프 비율 개선: 목표 매수 후 보유 대비 +10%
  • 낙폭 감소: 목표 비관리 포트폴리오 대비 -20%

헌법 준수

from backend.constitution import Constitution

constitution = Constitution()

# 리밸런싱 거래 검증
for trade in rebalancing_trades:
    # 새로운 배분이 제4조를 위반하는지 확인
    new_allocation = apply_trade(current_allocation, trade)
    
    is_valid, violations, _ = constitution.validate_allocation(
        new_allocation,
        current_positions
    )
    
    if not is_valid:
        # 준수를 위해 거래 조정
        trade = adjust_trade_for_compliance(trade, violations)

위험 조정 포지션 크기 설정

현대 포트폴리오 이론(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:
    """MPT를 사용하여 포트폴리오 최적화"""
    
    n_assets = len(returns)
    
    # 목적: 샤프 비율 최대화
    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  # 음의 샤프 최소화
    
    # 제약 조건
    constraints = [
        {'type': 'eq', 'fun': lambda w: np.sum(w) - 1},  # 합계 = 1
        {'type': 'ineq', 'fun': lambda w: w}  # 음수 없음
    ]
    
    # 범위 (주당 최대 15%)
    bounds = tuple((0, 0.15) for _ in range(n_assets))
    
    # 초기 추정
    x0 = np.array([1/n_assets] * n_assets)
    
    # 최적화
    result = minimize(objective, x0, method='SLSQP', bounds=bounds, constraints=constraints)
    
    return result.x

다른 에이전트와의 협업

War Room → 거래 신호
  ↓
포트폴리오 매니저 → 현재 배분 확인
  ↓
새 포지션이 불균형을 초래하는 경우:
  → 부분 포지션 크기 제안
  또는
  → 다른 포지션을 먼저 매도 권장

예시:
War Room: AAPL $15,000 매수
포트폴리오 매니저: "Tech 섹터가 이미 38%, $10,000만 매수"

보고

주간 포트폴리오 보고서

# 포트폴리오 성과 보고서 - 2025-12-21 주

## 자산 배분
- 주식: 68% (목표: 70%) ✓
- 채권: 22% (목표: 20%) ⚠️
- 현금: 10% (목표: 10%) ✓

## 성과
- 주간 수익률: +2.3%
- 연간 누적 수익률: +15.7%
- 샤프 비율: 1.45
- 최대 낙폭: -8.2%

## 수행된 조치
- 없음 (허용 범위 내)

## 다음 검토: 2025-12-28

버전 기록

  • v1.0 (2025-12-21): MPT 최적화 및 시장 상황 통합을 포함한 최초 릴리스

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.

관련 스킬