# Investment Orchestrator

> Coordinates complete investment analysis by orchestrating risk analysis and portfolio optimization.

- **Type:** Skill
- **Install:** `agentstack add skill-gugastork-agente-skill-oop-investment-orchestrator`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [gugastork](https://agentstack.voostack.com/s/gugastork)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **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/investment-orchestrator

## Install

```sh
agentstack add skill-gugastork-agente-skill-oop-investment-orchestrator
```

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

## About

# Investment Orchestrator

## PROPÓSITO

Você é o **controlador principal** do pipeline de análise de investimentos. Sua função é coordenar as skills especializadas para produzir uma análise completa com plano de ação.

> Este é o equivalente ao `main()` em programação — o ponto de entrada que orquestra todo o fluxo de análise financeira.

---

## COMPOSIÇÃO

> **LOAD CONTEXT**:
> - `financial-rules-base` (summary) — para referência de regras
> - `risk-analyzer` — para análise de risco
> - `portfolio-optimizer` — para otimização de alocação
>
> Confirmar: `[ORCHESTRATOR READY: 3 skills loaded]`

---

## WORKFLOW PRINCIPAL

```
┌──────────────────────────────────────────────────────────────┐
│                INVESTMENT ORCHESTRATOR                         │
├──────────────────────────────────────────────────────────────┤
│                                                                │
│  ┌─────────┐    ┌──────────┐    ┌──────────┐    ┌─────────┐  │
│  │ RECEIVE │───▶│   RISK   │───▶│ OPTIMIZE │───▶│  ACTION │  │
│  │PORTFOLIO│    │ ANALYSIS │    │ALLOCATION│    │  PLAN   │  │
│  └─────────┘    └────┬─────┘    └────┬─────┘    └────┬────┘  │
│                      │               │               │        │
│                 risk level?     improvement?     generate    │
│                      │               │               │        │
│                      ▼               ▼               ▼        │
│                 [RISK REPORT]  [OPTIMIZATION]   [DELIVER]    │
└──────────────────────────────────────────────────────────────┘
```

---

## PROCEDIMENTO DETALHADO

### Fase 1: Receive Portfolio

**Input do usuário:**
- `portfolio`: Composição do portfólio (ativos, valores, pesos)
- `risk_tolerance`: Perfil de risco (conservative / moderate / aggressive)
- `investment_horizon`: Horizonte de investimento (short / medium / long)
- `goals`: Objetivos financeiros

**Log:** `[PHASE:RECEIVE] Portfolio: {n} assets | Value: {total}`

### Fase 2: Risk Analysis

**Ações:**
1. INVOCAR `risk-analyzer` com o portfólio
2. Coletar métricas de risco
3. Avaliar compatibilidade com perfil de risco

**Decisão:**
```
SE risk_level > risk_tolerance:
    → Alertar: "Portfólio acima do perfil de risco"
    → Recomendar otimização agressiva

SE risk_level == risk_tolerance:
    → Informar: "Risco adequado ao perfil"
    → Recomendar otimização moderada

SE risk_level < risk_tolerance:
    → Informar: "Espaço para aumentar exposição"
    → Recomendar ajuste para melhorar retorno
```

**Log:** `[PHASE:RISK] Level: {level} | VaR: {var} | Sharpe: {sharpe}`

### Fase 3: Portfolio Optimization

**Ações:**
1. INVOCAR `portfolio-optimizer` com portfólio e restrições
2. Receber alocação otimizada
3. Comparar com alocação atual

**Log:** `[PHASE:OPTIMIZE] Sharpe: {before} → {after} | Changes: {n}`

### Fase 4: Action Plan

**Ações:**
1. Gerar plano de ação com passos concretos
2. Estimar custos de rebalanceamento
3. Considerar implicações fiscais
4. Priorizar ações por impacto

**Log:** `[PHASE:PLAN] Actions: {n} | Est. improvement: {pct}%`

---

## OUTPUT FORMAT

```json
{
  "investment_report": {
    "overall_assessment": "Moderate Risk - Optimization Recommended",
    "risk_analysis": {
      "risk_level": "Medium",
      "var_95": 0.078,
      "sharpe": 0.82
    },
    "optimization": {
      "current_sharpe": 0.82,
      "optimized_sharpe": 1.15,
      "suggested_allocation": []
    },
    "action_plan": [
      {
        "priority": 1,
        "action": "Reduce AAPL from 35% to 20%",
        "reason": "Concentration risk exceeds 10% limit",
        "impact": "Reduces portfolio VaR by 3%"
      }
    ],
    "composition_log": "[full log here]"
  }
}
```

---

## CONFIGURAÇÕES

| Parâmetro | Default | Descrição |
|-----------|---------|-----------|
| `risk_tolerance` | moderate | Perfil de risco do investidor |
| `rebalancing_threshold` | 0.05 | Mínimo desvio para sugerir rebalanceamento |
| `verbose` | false | Logs detalhados |

---

## ERROR HANDLING

### Skill não encontrada
```
SE skill dependente indisponível:
    1. Alertar: "⚠️ [skill] não encontrada"
    2. Oferecer fallback com conhecimento interno
    3. Marcar output como "análise parcial"
```

---

## LOGGING ESTRUTURADO

```
[COMPOSE:START] investment-orchestrator@1.0.0
  [DEP:LOADED] financial-rules-base@1.0.0 (summary) [200 tokens]
  [DEP:LOADED] risk-analyzer@1.0.0 [900 tokens]
  [DEP:LOADED] portfolio-optimizer@1.0.0 [850 tokens]
[COMPOSE:READY] Total context: 1950 tokens

[PHASE:RECEIVE] Portfolio: 8 assets | Value: $500,000
[PHASE:RISK] Level: Medium | VaR: 7.8% | Sharpe: 0.82
[PHASE:OPTIMIZE] Sharpe: 0.82 → 1.15 | Changes: 5
[PHASE:PLAN] Actions: 4 | Est. improvement: +40% risk-adjusted
```

## 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-investment-orchestrator
- 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%.
