portfolio_rs/templates/skills/portfolio-rs/SKILL.md
Markus Zoppelt 1cae9c1c63 feat: add agent-native finance features
Turn portfolio_rs into a library + CLI/TUI for the AI era:

- Agent-friendly analysis: context, review, simulate, and validate
  commands with Markdown and camelCase JSON output
- Machine-readable investment policy (portfolio/policy.toml) with
  strategy templates, policy-aware reviews, and rebalance simulations
- Durable financial memory: finance workspaces (init-workspace, doctor,
  agent init) with decision records, weekly reports, and a .gitignore
  that protects private data
- Decision records and weekly reports refuse to overwrite existing
  files in both the CLI and AppState layers, matching the workspace's
  never-overwrite contract (prevents GUI/CLI data loss)
- Portable agent skill (agent skill show/export) and an experimental
  MCP server preview (JSON-RPC over stdio)
- Local HTTP API (axum): positions CRUD, analysis endpoints, file
  persistence, short-TTL quote caching, JSON error responses, and a
  loud warning on non-loopback binds (no auth; local use only)
- Library facade (state::AppState + camelCase DTOs) consumed by the
  HTTP API and the external GUI app
- Robustness: consistent non-zero exit codes, no panics on missing
  subcommands or broken pipes, gpg failures surfaced, and decrypted
  data never written to disk
- Tests: offline e2e suite for the CLI surface, offline HTTP API tests,
  and network tests kept behind #[ignore]

Bump version to 0.8.0.

chore: init AGENTS.md
2026-07-05 11:20:04 +02:00

3.1 KiB

name description
portfolio-rs Use when operating in a portfolio_rs finance workspace, reviewing portfolios, generating reports, drafting decisions, or working with INVESTMENT_POLICY.md, positions.json, portfolio/policy.toml, diary, decisions, theses, reports, or watchlist files.

portfolio_rs Finance Skill

Use portfolio_rs commands as the source of truth. Do not parse raw portfolio JSON unless a command cannot answer the question.

Startup

  1. Read workspace instructions if present: AGENTS.md, CLAUDE.md, or equivalent.
  2. Read INVESTMENT_POLICY.md if present.
  3. Run portfolio_rs doctor ..
  4. Run portfolio_rs context positions.json --format json.
  5. If portfolio/policy.toml exists, run portfolio_rs review positions.json --policy portfolio/policy.toml --format json.

If a policy file is missing, suggest:

portfolio_rs policy init --strategy balanced-growth .
portfolio_rs policy validate portfolio/policy.toml

Safety

  • Do not place trades.
  • Do not interact with brokers or exchanges.
  • Do not provide regulated financial advice.
  • Use --dry-run before any file mutation.
  • Never write decrypted .gpg contents to disk in plaintext.
  • Do not commit private finance files.
  • Do not scrape portfolio data for external services. All analysis stays local.

Read-Only Commands

portfolio_rs context positions.json --format markdown
portfolio_rs review positions.json --policy portfolio/policy.toml
portfolio_rs simulate positions.json --policy portfolio/policy.toml
portfolio_rs doctor .
portfolio_rs validate positions.json

Structured Output (for agents/scripts)

portfolio_rs context positions.json --format json
portfolio_rs review positions.json --policy portfolio/policy.toml --format json
portfolio_rs simulate positions.json --policy portfolio/policy.toml --format json

Durable Memory

portfolio_rs decision draft --title "Rebalance Stocks" --dry-run
portfolio_rs report weekly --dry-run

Workspace Layout

.
  AGENTS.md              <- Local workspace instructions
  CLAUDE.md              <- Pointer for Claude Code
  INVESTMENT_POLICY.md   <- User-owned financial constitution
  portfolio/
    policy.toml          <- Machine-readable policy
    diary/               <- Market observations
    decisions/           <- Structured decision records
    theses/              <- Investment theses
    reports/             <- Generated reports
    watchlist.json       <- Assets being watched

Decision-Making Checklist

Before suggesting any portfolio change:

  1. Does this align with the target allocation in INVESTMENT_POLICY.md?
  2. Does this respect the minimum cash buffer?
  3. Does this respect restricted assets/strategies?
  4. Has this been documented in the diary?
  5. If significant, has a decision record been created?
  6. Are tax implications considered?
  7. Is the rationale clear enough to review in 6 months?

Privacy

Portfolio data is local-first. Encrypted files (.gpg) are supported. Decrypted values are ephemeral and must never be written to disk in plaintext outside this workspace.