Financial deep research

From rebyteai-template/rebyte-skills · View interactive version

Financial deep research is an AI agent skill from the GitHub repository rebyteai-template/rebyte-skills. Conduct enterprise-grade financial research with multi-source synthesis, regulatory compliance tracking, and verified market analysis. Use when user needs comprehensive financial analysis requiring 10+ sources, verified claims, market comparisons, or investment research. Triggers include "financial

How to use this skill

Skill file

Financial Deep Research

<!-- STATIC CONTEXT BLOCK START - Optimized for prompt caching -->

<!-- All static instructions, methodology, and templates below this line -->

<!-- Dynamic content (user queries, results) added after this block -->

Core System Instructions

Purpose: Deliver citation-backed, verified financial research reports through 8-phase pipeline (Scope > Plan > Retrieve > Triangulate > Synthesize > Critique > Refine > Package) with financial source credibility scoring, regulatory compliance tracking, and progressive context management.

Financial Focus: This skill specializes in:

Context Strategy: This skill uses 2025 context engineering best practices:


Decision Tree (Execute First)

Request Analysis
|-- Simple stock quote? -> STOP: Use WebSearch, not this skill
|-- Basic company lookup? -> STOP: Use WebSearch, not this skill
|-- Debugging code? -> STOP: Use standard tools, not this skill
+-- Complex financial analysis needed? -> CONTINUE

Mode Selection
|-- Quick market check? -> quick (3 phases, 2-5 min)
|-- Standard analysis? -> standard (6 phases, 5-10 min) [DEFAULT]
|-- Investment decision? -> deep (8 phases, 10-20 min)
|-- Due diligence/M&A? -> ultradeep (8+ phases, 20-45 min)

Execution Loop (per phase)
|-- Load phase instructions from [methodology](./reference/methodology.md#phase-N)
|-- Execute phase tasks
|-- Spawn parallel agents if applicable
+-- Update progress

Validation Gate
|-- Run `python scripts/validate_report.py --report [path]`
|-- Pass? -> Deliver
+-- Fail? -> Fix (max 2 attempts) -> Still fails? -> Escalate

Workflow (Clarify > Plan > Act > Verify > Report)

AUTONOMY PRINCIPLE: This skill operates independently. Infer assumptions from query context. Only stop for critical errors or incomprehensible queries.

1. Clarify (Rarely Needed - Prefer Autonomy)

DEFAULT: Proceed autonomously. Derive assumptions from query signals.

ONLY ask if CRITICALLY ambiguous:

When in doubt: PROCEED with standard mode. User will redirect if incorrect.

Default assumptions:


2. Plan

Mode selection criteria:

Announce plan and execute:


3. Act (Phase Execution)

All modes execute:

Standard/Deep/UltraDeep execute:

Deep/UltraDeep execute:

Critical: Avoid "Loss in the Middle"

Progressive Context Loading:

Anti-Hallucination Protocol (CRITICAL for Financial Data):

Parallel Execution Requirements (CRITICAL for Speed):

Phase 3 RETRIEVE - Mandatory Parallel Financial Search:

  1. Decompose query into 5-10 independent search angles before ANY searches
  2. Launch ALL searches in single message with multiple tool calls (NOT sequential)
  3. Quality threshold monitoring for FFS pattern:
  1. Spawn 3-5 parallel agents using Task tool for deep-dive investigations

Financial Search Decomposition Strategy:

[Single message with 8+ parallel tool calls]
WebSearch #1: Company fundamentals + recent filings
WebSearch #2: Earnings/financial performance
WebSearch #3: Industry/sector analysis
WebSearch #4: Competitive landscape
WebSearch #5: Regulatory/compliance news
WebSearch #6: Analyst ratings/price targets
WebSearch #7: Risk factors/bear case
WebSearch #8: Recent news + catalysts
Task agent #1: SEC filing deep dive (10-K, 10-Q analysis)
Task agent #2: Financial statement analysis
Task agent #3: Industry comparison/benchmarking

4. Verify (Always Execute)

Step 1: Citation Verification (Catches Fabricated Sources)

python scripts/verify_citations.py --report [path]

Financial-Specific Checks:

If suspicious citations found:

Step 2: Structure & Quality Validation

python scripts/validate_report.py --report [path]

9 automated checks (financial-enhanced):

  1. Executive summary length (50-250 words)
  2. Required sections present (+ recommended: Risk Factors, Valuation)
  3. Citations formatted [1], [2], [3]
  4. Bibliography matches citations
  5. No placeholder text (TBD, TODO)
  6. Word count reasonable (500-10000)
  7. Minimum 10 sources
  8. No broken internal links
  9. Financial data consistency (dates, currencies, units)

If fails:


5. Report

CRITICAL: Generate COMPREHENSIVE, DETAILED financial markdown reports

File Organization (CRITICAL - Clean Accessibility):

1. Create Organized Folder in /code:

2. Save All Formats to Same Folder:

Markdown (Primary Source):

HTML (McKinsey Style - ALWAYS GENERATE):

PDF (Professional Print - ALWAYS GENERATE):

3. File Naming Convention:

All files use same base name for easy matching:

Length Requirements (UNLIMITED with Progressive Assembly):

How Unlimited Length Works:

Progressive file assembly allows ANY report length by generating section-by-section.

Each section is written to file immediately (avoiding output token limits).

Complex analyses with many findings? Generate 20, 30, 50+ findings - no constraint!

Content Requirements:

Writing Standards (Financial Precision):

Source Attribution Standards (Critical for Financial Research):

Deliver to user:

  1. Executive summary with key investment thesis (inline in chat)
  2. Organized folder path (e.g., "All files saved to: /code/AAPL_Financial_Research_20251104/")
  3. Confirmation of all three formats generated:
  1. Source quality assessment summary (source count, regulatory vs news mix)
  2. Key financial metrics summary
  3. Risk factors summary
  4. Next steps (if relevant)

Generation Workflow: Progressive File Assembly (Unlimited Length)

[Same progressive assembly workflow as base skill - see deep-research SKILL.md]


Financial Data Sources (Priority Order)

Tier 1: Primary/Regulatory Sources (Highest Credibility)

Tier 2: Financial Data Providers (High Credibility)

Tier 3: Financial News & Research (Moderate-High Credibility)

Tier 4: General Business Sources (Moderate Credibility)

Source Verification Requirements:


Output Contract

Format: Comprehensive financial markdown report following template EXACTLY

Required sections (all must be detailed):

Financial-Specific Sections (include when relevant):

Bibliography Requirements (ZERO TOLERANCE):

Strictly Prohibited:

Quality gates (enforced by validator):


Error Handling & Stop Rules

Stop immediately if:

Graceful degradation:

Error format:

Issue: [Description]
Context: [What was attempted]
Tried: [Resolution attempts]
Options:
   1. [Option 1]
   2. [Option 2]
   3. [Option 3]

Quality Standards (Always Enforce)

Every financial report must:

Priority: Accuracy over speed. Financial data must be verified.


Inputs & Assumptions

Required:

Optional:

Assumptions:


When to Use / NOT Use

Use when:

Do NOT use:


Scripts (Offline, Python stdlib only)

Location: ./scripts/

No external dependencies required.


Progressive References (Load On-Demand)

Do not inline these - reference only:

Context Management: Load files on-demand for current phase only. Do not preload all content.


<!-- STATIC CONTEXT BLOCK END -->

<!-- Above content is cacheable (>1024 tokens, static) -->

<!-- Below: Dynamic content (user queries, retrieved data, generated reports) -->

<!-- This structure enables 85% latency reduction via prompt caching -->


Dynamic Execution Zone

User Query Processing:

[User financial research question will be inserted here during execution]

Retrieved Information:

[Search results and sources will be accumulated here]

Generated Analysis:

[Findings, synthesis, and report content generated here]

Note: This section remains empty in the skill definition. Content populated during runtime only.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.