Zhiyuan Song
← Home
Architecture v3.0 Architecture v2.0 Architecture v1.0

Investment Skill System Design

This document is the governing spec for a multi-agent Investment Skill that runs in Claude Code: boundaries, routing, roles, state, output contracts, and upgrade/downgrade rules—not a pile of disconnected prompts.

Status: the capabilities described here are implemented and in day-to-day testing against a personal live workflow; details may evolve with feedback while the constitution and contract stay stable in intent.

Later changes should still align with these principles.

1. System goal

  • Maintain positions and cash (settled / unsettled)
  • Track an 8-name Tracklist
  • Analyze thesis, structure, regime, catalysts, sentiment
  • Compare opportunity cost—“who deserves the main sleeve now”
  • Emit sizing, trims, rotations, and watch items with discipline
  • Respect real constraints (e.g., sale proceeds not reusable until settled)

1.1 Strategy model

Swing rotation in common stock with a fixed sleeve model: ~60% main, ~10% scout, ~30% cash—not intraday, not options, not passive buy-and-hold forever.

1.2 Independence from TSLA Options War Room

Fully separate skills: no shared state and no cross-calls.

2. What this is not

Not an auto-trader, oracle, self-rewriting strategist, “full workflow every time” script, report spammer, or options system.

Does not chase fake certainty, force portfolio-level answers on thin inputs, or recycle stale opinions as fresh state.

3. Core philosophy

  • Constraints before rigid paths
  • Open reasoning, bounded roles
  • State yes, stale narratives no
  • Analysis quality over “feeling right”
  • Decision-first: every name needs a Decision Hook for main-sleeve fit
  • Fixed strategy frame: agents cannot rewrite core rules

4. Constitution layer (summary)

Allows single- and multi-name work, portfolio suggestions, formal cards when inputs suffice, principled downgrade otherwise.

Forbids (samples): stale news as catalyst; precise buy plans without cash clarity; heavy cards on single-name questions; fake confirmations; ignoring unsettled; headline-only actions; heavy rotation without structure; false certainty; agents rewriting core policy; main-sleeve entries when timeframe alignment is unclear.

Hand-off/stop rules and Quick/Focused/Full completion bars follow the v3 spec (sections 4 and 12 in the source doc).

5. UX and data model

The surface layer classifies intent, picks depth, shapes length, and asks for missing inputs.

5.1 Request classes

A quick lookup; B themed analysis; C full portfolio / rotation / formal card.

5.2 Data: automated + user

  • Silent automation: scripts/fetch_market_data.py via Bash + yfinance, one batch for Tracklist + QQQ/SPY (~3M dailies), derived stats.
  • User-supplied: intraday screenshots, news leads, portfolio and settled/unsettled updates in state/portfolio.json.

5.3 UX tenets

Single voice, progressive depth, useful default brevity, advisor tone, ask when blind.

6. Role architecture (v3 vs v2)

Collapsed to three functional roles + eight ticker analysts (agents/{ticker}.md).

Chief Advisor lives in SKILL.md, not a separate agent file.

Risk Officer: required on Full; on Focused when trades are in play; skipped on Quick.

Market Context: merged macro regime + 24–48h catalyst vetting and mapping.

Ticker analysts: read as files; in Full flow they are not spawned as sub-agents—chief synthesizes.

7. Standard analysis framework

  • Structure across horizons and key levels
  • Timeframe alignment → must label uptrend vs bounce vs chop vs bearish continuation; if unclear, no aggressive entry
  • Breadth vs QQQ/SPY; higher weight for high-beta names
  • Momentum signal for cross-name ranking
  • Decision Hook YES/NO/CONDITIONAL with ≤3-sentence rationale
  • Snapshot fields + trigger layer (entry/upgrade/downgrade/emergency, verifiable, ≤5 each)

Chain: Thesis → Status → Triggers → Timeframe alignment → Decision Hook.

8. Ticker-specific layer

Each agents/{ticker}.md holds Core Thesis, thesis gates, unique angles, role, correlations, idiosyncratic risks, triggers. Shared dimensions stay in SKILL.md.

Core thesis changes require explicit user confirmation; logs under state/.

9. Scheduling

The router (part of the chief process) picks Quick/Focused/Full, execution sensitivity, portfolio reads, dispatched agents, and card type.

Level Typical use Dispatch Output
Quick Single name/news/thesis Read ticker file; no sub-agent fan-out Quick answer
Focused 1–2 names, partial sizing, catalyst impact Ticker files + state; optional context/risk Mini decision note
Full Book-level moves, rotations, deployment Always risk + market context (parallel OK) Full decision card

10. Collaboration flow (Full)

Seven steps: load context → market context → risk pre-check (can parallelize) → set focus → read tickers and complete per-name views → cross-name sizing → final card.

Design point: at most two delegated agents; tickers are file-backed synthesis for ~1–2 minute turnaround instead of a long committee chain.

11. Output contract

Quick: concise; still emits a Decision Hook when direction is implied.

Mini note: verdict, reasons, risk, Decision Hook, what to watch next.

Full card: regime, one-line tracklist digest, cross-name view, timeframe alignment, actions, risk warnings, today vs tomorrow execution with cash state, re-check triggers, plus the closing executive summary block per the v3 template.

12. State management

portfolio.json (example path) tracks sleeves, cash buckets, pending actions—separating theoretical optima from what is executable today.

Positions update only on user-confirmed trades; prices are user-fed; watchlist notes capture current conclusions, not a debate history.

13. Skill file layout

~/.claude/skills/investment-portfolio/
├── SKILL.md
├── agents/ …
├── scripts/fetch_market_data.py
├── state/
├── schemas/
└── docs/system-design-v3.md

14. Learning and iteration

No autonomous strategy edits: chief-led focus plus user nudges; forbidden self-rewrites of constitution, risk floor, or thesis without confirmation.

15. Fit to the strategy

Built for concentrated rotation with guardrails: opportunity-cost framing, sleeve model, dedicated skeptic, catalyst mapping, timeframe gating, constitution stops, real settlement math.

16. Rollout stage

The staged MVP in the source doc has matured into an implemented stack—constitution, chief process, routing, risk and market context, eight ticker files, yfetch script, and state files—with ongoing tuning while already in personal live testing.

17. Build principles (excerpt)

  1. This spec outranks single prompts.
  2. Ship boundaries, checkpoints, contracts first.
  3. Keep routing from becoming a brittle full script.
  4. Ticker files = unique layer only; state = facts.
  5. Ask for missing data; do not hallucinate completeness.

18. Summary

Loop: classify → read agents + state → dispatch context/risk when required → standard + unique analysis → Decision Hooks → rank → respond.

North star: which Tracklist name deserves the main sleeve right now—everything else serves that question.