> ## Documentation Index
> Fetch the complete documentation index at: https://aisa.one/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Portfolio Management

> Track positions, allocation, and live P&L.

[View on GitHub ->](https://github.com/AIsa-team/agent-skills/tree/main/stock-portfolio)

**Portfolio tracking for agents.** Manage positions, allocation, and live P\&L snapshots with AIsa market data.

## Install

First, install the AIsa CLI if you have not already:

```bash theme={null}
npm install -g @aisa-one/cli
```

Then install the skill:

```bash theme={null}
aisa skills install stock-portfolio
```

## What can agents do with it?

<CardGroup cols={2}>
  <Card title="Position tracking" icon="wallet">
    Summarize portfolio holdings and exposure.
  </Card>

  <Card title="Allocation review" icon="chart-pie">
    Check concentration by asset, sector, or theme.
  </Card>

  <Card title="Live P&L" icon="chart-line">
    Estimate current profit and loss from market data.
  </Card>

  <Card title="Rebalance notes" icon="scale-balanced">
    Flag positions that need review.
  </Card>
</CardGroup>

## Usage

```bash theme={null}
# Create a new portfolio
python3 "${CLAUDE_PLUGIN_ROOT}/skills/stock-portfolio/scripts/portfolio.py" create "My Portfolio"

# Add a position
python3 "${CLAUDE_PLUGIN_ROOT}/skills/stock-portfolio/scripts/portfolio.py" add AAPL --quantity 10 --cost 150
python3 "${CLAUDE_PLUGIN_ROOT}/skills/stock-portfolio/scripts/portfolio.py" add BTC-USD --quantity 0.5 --cost 40000

# Show portfolio with live P&L
python3 "${CLAUDE_PLUGIN_ROOT}/skills/stock-portfolio/scripts/portfolio.py" show
python3 "${CLAUDE_PLUGIN_ROOT}/skills/stock-portfolio/scripts/portfolio.py" show --portfolio "My Portfolio"

# Update a position
python3 "${CLAUDE_PLUGIN_ROOT}/skills/stock-portfolio/scripts/portfolio.py" update AAPL --quantity 15 --cost 160

# Remove a position
python3 "${CLAUDE_PLUGIN_ROOT}/skills/stock-portfolio/scripts/portfolio.py" remove AAPL

# List all portfolios
python3 "${CLAUDE_PLUGIN_ROOT}/skills/stock-portfolio/scripts/portfolio.py" list

# Rename a portfolio
python3 "${CLAUDE_PLUGIN_ROOT}/skills/stock-portfolio/scripts/portfolio.py" rename "My Portfolio" "Tech Holdings"

# Delete a portfolio
python3 "${CLAUDE_PLUGIN_ROOT}/skills/stock-portfolio/scripts/portfolio.py" delete "Old Portfolio"
```

### Actions

| Action           | Description                                 |
| ---------------- | ------------------------------------------- |
| `create NAME`    | Create a new portfolio                      |
| `list`           | List all portfolios                         |
| `show`           | Show portfolio summary with live P\&L       |
| `add TICKER`     | Add position with `--quantity` and `--cost` |
| `update TICKER`  | Update position quantity/cost               |
| `remove TICKER`  | Remove position from portfolio              |
| `rename OLD NEW` | Rename a portfolio                          |
| `delete NAME`    | Delete a portfolio                          |

## Data Storage

Portfolio data is stored in `${CLAUDE_PLUGIN_DATA}/portfolios.json` for persistence across sessions.

**NOT FINANCIAL ADVICE.** For informational purposes only.

## Get started

1. Sign up at [aisa.one](https://aisa.one) (new accounts start with \$2 free credit).
2. Generate an API key from the console.
3. Set your key and install the skill:
   ```bash theme={null}
   export AISA_API_KEY="your-key"
   npm install -g @aisa-one/cli
   aisa skills install stock-portfolio
   ```
4. Start a new agent session so the runtime loads the updated skill instructions.

## Related

<CardGroup cols={3}>
  <Card title="Watchlist Management" icon="list-check" href="/agent-skills/stock-watchlist">
    Track targets and alert checks.
  </Card>

  <Card title="Stock & Crypto Analysis" icon="file-chart-line" href="/agent-skills/stock-analysis">
    Analyze individual holdings.
  </Card>

  <Card title="AIsa Market" icon="chart-line" href="/agent-skills/market">
    Market data for portfolio review.
  </Card>
</CardGroup>
