# Financial Rules Base

> Source of truth for financial analysis rules. Abstract skill — do not invoke directly.

- **Type:** Skill
- **Install:** `agentstack add skill-gugastork-agente-skill-oop-financial-rules-base`
- **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/financial-rules-base

## Install

```sh
agentstack add skill-gugastork-agente-skill-oop-financial-rules-base
```

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

## About

# Financial Rules Base

## GUARD

> ⚠️ **SKILL ABSTRATA**
>
> Se você foi invocado diretamente (não via outra skill que declare dependência),
> responda: "Esta é uma skill abstrata. Use `risk-analyzer`, `portfolio-optimizer` ou
> `investment-orchestrator` para tarefas específicas."

## PROPÓSITO

Esta skill é uma **ABSTRAÇÃO**. Ela não executa ações — apenas fornece definições, fórmulas e regras que outras skills devem carregar e aplicar.

---

## [SUMMARY]

### Visão Geral das Regras (~200 tokens)

**Risk Metrics:** Value at Risk (VaR), Conditional VaR (CVaR), Beta,
Standard Deviation, Maximum Drawdown.

**Portfolio Theory:** Modern Portfolio Theory (Markowitz), Efficient Frontier,
Capital Asset Pricing Model (CAPM), Sharpe Ratio.

**Compliance Rules:** Diversification limits, concentration risk thresholds,
liquidity requirements, regulatory constraints.

**Métodos Abstratos:**
- `analyze_risk(portfolio) → RiskReport`
- `optimize_allocation(portfolio) → OptimalAllocation`

---

## [FULL]

### Risk Metrics Detailed

#### Value at Risk (VaR)
- Measures maximum expected loss over a time period at a confidence level
- Parametric VaR: VaR = μ - Zα × σ (assumes normal distribution)
- Historical VaR: Based on actual historical returns
- Monte Carlo VaR: Simulated scenarios
- Standard confidence levels: 95% (1.65σ) and 99% (2.33σ)

#### Conditional VaR (CVaR / Expected Shortfall)
- Expected loss given that VaR has been exceeded
- More conservative than VaR
- Better captures tail risk
- CVaR ≥ VaR always

#### Beta
- Measures systematic risk relative to market
- β = Cov(Ri, Rm) / Var(Rm)
- β > 1: More volatile than market
- β  1 is good, > 2 is very good, > 3 is excellent

#### Capital Asset Pricing Model (CAPM)
- E(Ri) = Rf + βi × (E(Rm) - Rf)
- Expected return based on systematic risk
- Risk premium = β × Market premium

#### Asset Allocation Strategies
- Strategic: Long-term target allocation based on goals
- Tactical: Short-term deviations to exploit opportunities
- Dynamic: Adjusts with market conditions
- Constant-proportion: Fixed allocation ratios

---

### [FULL:compliance]

#### Diversification Rules
- No single asset > 10% of portfolio (institutional standard)
- No single sector > 25% of portfolio
- Minimum 5 asset classes for balanced portfolios
- International exposure: 20-40% for developed market investors

#### Liquidity Requirements
- Maintain minimum 5% in highly liquid assets
- Match investment horizon to asset liquidity
- Emergency fund: 3-6 months expenses in liquid assets

#### Regulatory Constraints
- Know Your Customer (KYC) requirements
- Suitability assessment for risk profile
- Reporting obligations for large positions
- Tax-efficient structuring within legal limits

---

## [ABSTRACT] Métodos a Implementar

Skills que "herdam" desta base devem implementar:

```
analyze_risk(portfolio: Portfolio) → RiskReport
  - Recebe composição do portfólio
  - Retorna métricas de risco (VaR, Beta, Sharpe, etc.)
  - Deve classificar nível de risco: Low / Medium / High / Critical

optimize_allocation(portfolio: Portfolio, constraints: Constraints) → OptimalAllocation
  - Recebe portfólio atual e restrições
  - Retorna alocação otimizada via fronteira eficiente
  - Deve respeitar regras de compliance

generate_report(portfolio: Portfolio) → InvestmentReport
  - Recebe portfólio completo
  - Retorna relatório consolidado com análise e recomendações
```

---

## CHANGELOG

- **v1.0.0** (2026-03-13): Initial release with VaR, Sharpe, MPT, compliance rules

## 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-financial-rules-base
- 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%.
