# Portfolio ledger

> Portfolio ledger is an open-source agent skill for finance and payments. Reads positions, exposure and P&L from an append-only trading ledger with chain checks. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/swcstudiospace/PumpGrok/tree/main/skills/portfolio-ledger
- **Repository:** https://github.com/swcstudiospace/pumpgrok
- **GitHub stars:** 93
- **License:** AGPL-3.0
- **Skill name:** portfolio-ledger
- **Collection:** https://github.com/swcstudiospace/PumpGrok
- **Categories:** [finance and payments](https://ai-powered.com/categories/finance-and-payments)
- **Listing updated:** 2026-12-04

## About

This skill sets up rules for how an agent reads a hash-chained, append-only portfolio ledger. Reads go through named portfolio tools for event history, current exposure and realised and unrealised P&L, rather than querying the underlying sqlite file directly. The skill names two roles: a journal owner who handles reports and reconciliation, and a risk reader who uses exposure and P&L for limit decisions.

After a restart, the agent is instructed to verify the chain first: sequence numbers must be contiguous and each previous-hash link must match. If verification fails, reads stop until the ledger is repaired from the last good snapshot. Event kinds are limited to an enumerated snake_case set, and the agent may only write journal notes and escalations through the journal append and event emit paths.

The skill expects an existing ledger and the named portfolio tools to be available. It describes JSONL exports as derived views for reports and audits, with the chain remaining the source of truth. It has no bundled scripts and references companion skills for folder layout and report rendering.

## When your agent uses it

> Read positions, exposure, and P&L from the append-only ledger with restart reconciliation and JSONL export, owned by JOURNAL with RISK reading.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/swcstudiospace/PumpGrok/tree/HEAD/skills/portfolio-ledger)
- [License: AGPL-3.0](https://github.com/swcstudiospace/PumpGrok/tree/HEAD/skills/portfolio-ledger)

## Features

- **Tool-based ledger reads:** Directs the agent to fetch event history, exposure and P&L through named portfolio tools instead of raw database access.
- **Hash chain verification:** Checks sequence continuity and previous-hash links after restarts before any numbers are served.
- **Event kind enforcement:** Restricts filtering and writing to the enumerated ledger event kinds and limits which roles may append them.
- **JSONL snapshot export:** Covers versioned JSONL exports for reports and audits, treated as derived views of the chain.
- **Failure handling table:** Lists common faults such as chain gaps, direct database reads and invented event kinds with the expected response.

## Good for

- Reconcile the portfolio ledger after a service restart
- Report current exposure across open positions
- Calculate realised and unrealised P&L from ledger events
- Export ledger history to JSONL for an audit
- Filter ledger events by kind and ticket

## Install

### Claude Code

Copy the skill folder to `~/.claude/skills/portfolio-ledger` to use it in all your projects:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/swcstudiospace/PumpGrok.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/portfolio-ledger &&
cp -R "$tmp/skills/portfolio-ledger" ~/.claude/skills/portfolio-ledger &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/portfolio-ledger` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/portfolio-ledger` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/swcstudiospace/PumpGrok.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/portfolio-ledger &&
cp -R "$tmp/skills/portfolio-ledger" ~/.agents/skills/portfolio-ledger &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/portfolio-ledger` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/portfolio-ledger` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/swcstudiospace/PumpGrok.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/portfolio-ledger &&
cp -R "$tmp/skills/portfolio-ledger" ~/.cursor/skills/portfolio-ledger &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/portfolio-ledger` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/swcstudiospace/PumpGrok.git --path skills/portfolio-ledger
```

Or copy the folder to `~/.gemini/skills/portfolio-ledger` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/portfolio-ledger`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/swcstudiospace/PumpGrok.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/portfolio-ledger &&
cp -R "$tmp/skills/portfolio-ledger" ~/.copilot/skills/portfolio-ledger &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/portfolio-ledger` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/swcstudiospace/PumpGrok.git
```

Then copy `PumpGrok/skills/portfolio-ledger` into your agent's skills folder as `portfolio-ledger`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does the skill need to run?

It relies on the portfolio tools portfolio.ledger_read, portfolio.exposure and portfolio.pnl being available, and on an existing append-only ledger to read from.

### Does Portfolio ledger change anything in the ledger?

Writes are limited to journal_note and escalation events through journal.append or desk.event_emit. Other event types are appended only by library code.

### What happens if the hash chain fails verification?

The skill says reads stop, and the ledger should be reconciled from the last good snapshot before reporting the issue to the risk role.

### Which event kinds are recognised?

The ledger uses order, fill, halt, kill, approval, journal_note and escalation. New kinds are not to be invented and arrive through a reviewed schema change.

### How do I install Portfolio ledger in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/portfolio-ledger to use it in all your projects, or to .claude/skills/portfolio-ledger in one project.

### Does Portfolio ledger run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Portfolio ledger?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Portfolio ledger?

The closest alternatives to Portfolio ledger are Desk post trade review, Daily report, Portfolio, Desk monitoring and Desk operating model.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Desk post trade review](https://ai-powered.com/skills/desk-post-trade-review): Desk post trade review is an open-source agent skill for finance and payments.
- [Daily report](https://ai-powered.com/skills/daily-report): Daily report is an open-source agent skill for finance and payments.
- [Portfolio](https://ai-powered.com/skills/portfolio-merrymen-labs): Portfolio is an open-source agent skill for finance and payments.
- [Desk monitoring](https://ai-powered.com/skills/desk-monitoring): Desk monitoring is an open-source agent skill for finance and payments.
- [Desk operating model](https://ai-powered.com/skills/desk-operating-model): Desk operating model is an open-source agent skill for finance and payments.
- [Live gate procedure](https://ai-powered.com/skills/live-gate-procedure): Live gate procedure is an open-source agent skill for finance and payments.
- [Desk strategy lab](https://ai-powered.com/skills/desk-strategy-lab): Desk strategy lab is an open-source agent skill for finance and payments.
- [Solana rpc and wallet](https://ai-powered.com/skills/solana-rpc-and-wallet): Solana rpc and wallet is an open-source agent skill for finance and payments.

---
Source: https://ai-powered.com/skills/portfolio-ledger
