DEV Community

tellmefrankie
tellmefrankie

Posted on

I built a 9-wave morning briefing agent with Claude Code — here is the architecture

Every trading day at 06:00 KST, a Claude Code skill runs a 9-wave analysis pipeline and delivers a structured briefing to my Telegram.

Not a single-shot prompt. Nine distinct analytical passes, each informing the next.

Here's how it works.


Why 9 waves?

A single LLM call for "give me a market analysis" produces generic output. It has no memory of what came before, no way to let macro context inform a sector read, no critique pass to catch errors.

Nine waves solve this. Each wave receives the outputs of all prior waves as context.


The 9 waves

Wave 1: Macro

Inputs: Fed data, yield curve, DXY, VIX
Output: Risk-on/risk-off stance + confidence level
Enter fullscreen mode Exit fullscreen mode

Anchor context for everything that follows. If Wave 1 says "risk-off with 70% confidence," every subsequent wave adjusts.

Wave 2: Sector

Inputs: Wave 1 output + sector ETF flows (XLI, XLK, XLE, XLF, XLV)
Output: Leading/lagging sectors + rotation signal
Enter fullscreen mode Exit fullscreen mode

This is where the XLI P/C 5.32 anomaly surfaced — Wave 2 flagged industrial put pressure while Wave 1 showed broad market risk-on. Contradiction = signal.

Wave 3: Technical

Inputs: Wave 1-2 + SPY/QQQ/IWM price vs 20/50/200-day MA
Output: Trend alignment score, key levels
Enter fullscreen mode Exit fullscreen mode

Technical context in isolation is noise. Inside macro+sector context, it's actionable.

Wave 4: Portfolio

Inputs: Waves 1-3 + current holdings
Output: Position stress test against current macro regime
Enter fullscreen mode Exit fullscreen mode

Which positions are aligned with the Wave 1-3 read? Which are exposed?

Wave 5: News

Inputs: Waves 1-4 + RSS sentiment, earnings calendar
Output: Catalysts that could override technical signals
Enter fullscreen mode Exit fullscreen mode

Fed speaker today? Earnings tonight? Wave 5 flags conflicts with the current thesis.

Wave 6: Options

Inputs: Waves 1-5 + P/C ratios from scanner (post lottery-filter)
Output: Institutional sentiment overlay
Enter fullscreen mode Exit fullscreen mode

Where is smart money positioned? Wave 6 compares options flow to the technical + macro thesis from prior waves.

Wave 7: Critique

Inputs: Waves 1-6
Output: What's the bull case for being wrong?
Enter fullscreen mode Exit fullscreen mode

Explicit adversarial pass. Forces a counterargument before committing to any trade thesis.

Wave 8: Simulation

Inputs: Waves 1-7 + target positions
Output: EV-weighted scenario modeling
Enter fullscreen mode Exit fullscreen mode

If the macro bear case plays out: what's the drawdown? Bull case: what's the gain? Expected value calculation per position.

Wave 9: Synthesis

Inputs: All prior waves
Output: 3-sentence briefing + action list
Enter fullscreen mode Exit fullscreen mode

Final output. Concise. Actionable. Informed by 8 prior analytical passes.


What this looks like in practice

[2026-05-13 06:00 KST] Investment Briefing — Wave 9 Synthesis

Macro-sector tension: XLI hedge signal persistent (Wave 2) against broad risk-on
read (Wave 1). Options flow confirms institutional downside protection on industrials
while retail lottery-buying inflated CEG call volume (Wave 6).

Action: Hold current allocation. Flag XLI for session 3 monitoring. No new entries
until Wave 2/6 tension resolves.
Enter fullscreen mode Exit fullscreen mode

Eight waves of analysis distilled into three sentences and one action item.


How it's built

This is a Claude Code skill — a SKILL.md file that orchestrates:

  1. Data fetch (Polygon.io options chains, RSS feeds, price APIs)
  2. Nine sequential Claude API calls, each passing prior outputs
  3. Telegram delivery via bot
investment-briefing-agent/
├── SKILL.md          ← the skill definition
├── waves/
│   ├── wave-1-macro.md
│   ├── wave-2-sector.md
│   └── ...           ← each wave has its own prompt template
└── pipeline.ts       ← orchestration logic
Enter fullscreen mode Exit fullscreen mode

The full skill is in the Pro Bundle — $29 one-time. The free EV Calculator and News Sentiment Engine are in the same repo if you want to see the architecture first.


What the wave design gets right

Contradiction detection is automatic. When Wave 1 says risk-on and Wave 6 says institutional put buying, the Wave 9 synthesis surfaces that conflict — you don't have to look for it.

Context accumulates. Every wave builds on real outputs, not assumptions. The critique (Wave 7) sees the full analysis before trying to break it.

No hallucinated confidence. Single-shot market analysis tends toward false certainty. Nine passes with explicit uncertainty propagation produces better-calibrated output.


The signal that validated the design

Week of May 13, 2026: Wave 1 showed risk-on (SPY P/C 0.44, QQQ 0.54). Wave 2 flagged XLI P/C 5.32 — 4-5x above the 0.5-1.2 normal range. Wave 6 confirmed: the put volume was post-lottery-filter, meaning real institutional hedging, not noise.

Wave 9 synthesis: "Macro risk-on with sector-specific industrial hedge. Hold tech longs, reduce cyclical exposure until XLI signal resolves."

Three sessions later, XLI underperformed SPY by 2.3%. The tech longs were fine.

Not prediction. Pattern recognition with structured context.


The repo is open source: github.com/tellmefrankie/ai-investment-skills

The Investment Briefing Agent is in the Pro Bundle ($29). The free skills are cloneable immediately.

Not financial advice.

Top comments (0)