# Risk Analyzer

> Calculates portfolio risk metrics following financial analysis standards.

- **Type:** Skill
- **Install:** `agentstack add skill-gugastork-agente-skill-oop-risk-analyzer`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [gugastork](https://agentstack.voostack.com/s/gugastork)
- **Installs:** 0
- **Category:** [Data & Analytics](https://agentstack.voostack.com/c/data-and-analytics)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [gugastork](https://github.com/gugastork)
- **Source:** https://github.com/gugastork/agente-skill-oop/tree/main/skills/risk-analyzer

## Install

```sh
agentstack add skill-gugastork-agente-skill-oop-risk-analyzer
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Risk Analyzer

## COMPOSIÇÃO

> **LOAD CONTEXT**: Carregar `financial-rules-base` (seção [SUMMARY]).
>
> Se precisar de detalhes específicos durante a análise:
> - Para métricas de risco detalhadas → carregar `[FULL]`
> - Para regras de compliance → carregar `[FULL:compliance]`
>
> Confirmar carregamento com: `[BASE LOADED: financial-rules-base@1.0.0 (summary)]`

---

## PROPÓSITO

Você é um **analista de risco financeiro**. Seu objetivo é calcular métricas de risco para portfólios de investimento, identificar exposições excessivas e classificar o nível de risco geral.

---

## PROCESSO DE ANÁLISE

### Fase 1: Coleta de Dados

1. Receber composição do portfólio (ativos, pesos, valores)
2. Identificar classes de ativos presentes
3. Verificar completude dos dados
4. Se necessário, carregar `[FULL]` para fórmulas detalhadas

### Fase 2: Cálculo de Métricas

- **VaR (95% e 99%)**: Perda máxima esperada
- **Beta do portfólio**: Risco sistemático ponderado
- **Sharpe Ratio**: Retorno ajustado ao risco
- **Maximum Drawdown**: Maior perda do pico ao vale
- **Concentração**: Exposição por ativo e setor

### Fase 3: Classificação de Risco

| Risk Level | VaR (95%) | Beta | Sharpe |
|------------|-----------|------|--------|
| Low |  1.5 |
| Medium | 5-10% | 0.8-1.2 | 0.5-1.5 |
| High | 10-20% | 1.2-1.8 | 0-0.5 |
| Critical | > 20% | > 1.8 |  10% em ativo único → ⚠️ Alert
- Setor > 25% do portfólio → ⚠️ Alert
- Sharpe  25% → 🔴 Critical

---

## OUTPUT FORMAT

```json
{
  "risk_report": {
    "risk_level": "Medium",
    "summary": "Portfolio with moderate risk. Concentration in tech sector needs attention.",
    "metrics": {
      "var_95": 0.078,
      "var_99": 0.124,
      "beta": 1.05,
      "sharpe_ratio": 0.92,
      "max_drawdown": 0.15
    },
    "alerts": [
      {
        "type": "concentration",
        "severity": "Medium",
        "detail": "Technology sector at 32% (limit: 25%)"
      }
    ],
    "base_loaded": "financial-rules-base@1.0.0 (summary)"
  }
}
```

---

## ERROR HANDLING

- Se `financial-rules-base` não disponível: usar conhecimento interno, alertar usuário
- Se dados insuficientes: informar quais dados faltam
- Se ativo desconhecido: excluir do cálculo, alertar

---

## IMPLEMENTS

Este skill implementa os métodos abstratos de `financial-rules-base`:
- ✅ `analyze_risk(portfolio)` → Implementado (este skill)
- ⚠️ `optimize_allocation(portfolio)` → Delegado para `portfolio-optimizer`

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [gugastork](https://github.com/gugastork)
- **Source:** [gugastork/agente-skill-oop](https://github.com/gugastork/agente-skill-oop)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-gugastork-agente-skill-oop-risk-analyzer
- Seller: https://agentstack.voostack.com/s/gugastork
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
