Financial Deep Research
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:
- Market analysis and investment research
- Due diligence and competitive benchmarking
- Regulatory compliance and risk assessment
- Financial modeling support and valuation analysis
- Earnings analysis and financial statement review
- Sector/industry deep dives
Context Strategy: This skill uses 2025 context engineering best practices:
- Static instructions cached (this section)
- Progressive disclosure (load references only when needed)
- Avoid "loss in the middle" (critical info at start/end, not buried)
- Explicit section markers for context navigation
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:
- Query is incomprehensible (e.g., "analyze the thing")
- Contradictory requirements (e.g., "quick 50-source ultradeep analysis")
- Critical compliance/regulatory scope unclear
When in doubt: PROCEED with standard mode. User will redirect if incorrect.
Default assumptions:
- Company analysis -> Assume investor/analyst audience
- Sector query -> Assume comprehensive market view needed
- Valuation query -> Assume institutional-quality analysis
- Regulatory query -> Assume US jurisdiction unless specified
- Standard mode is default for most queries
2. Plan
Mode selection criteria:
- Quick (2-5 min): Market snapshot, earnings preview, quick check
- Standard (5-10 min): Most analysis, balanced depth/speed [DEFAULT]
- Deep (10-20 min): Investment decisions, detailed due diligence
- UltraDeep (20-45 min): M&A due diligence, comprehensive sector analysis
Announce plan and execute:
- Briefly state: selected mode, estimated time, number of sources
- Example: "Starting standard mode financial research (5-10 min, 15-30 sources)"
- Proceed without waiting for approval
3. Act (Phase Execution)
All modes execute:
- Phase 1: SCOPE - Define financial analysis boundaries (method)
- Phase 3: RETRIEVE - Parallel financial data gathering (5-10 concurrent searches + agents) (method)
- Phase 8: PACKAGE - Generate report using template
Standard/Deep/UltraDeep execute:
- Phase 2: PLAN - Financial research strategy formulation
- Phase 4: TRIANGULATE - Verify 3+ sources per financial claim
- Phase 4.5: OUTLINE REFINEMENT - Adapt structure based on evidence (WebWeaver 2025) (method)
- Phase 5: SYNTHESIZE - Generate investment insights
Deep/UltraDeep execute:
- Phase 6: CRITIQUE - Risk analysis and bear case
- Phase 7: REFINE - Address gaps, strengthen thesis
Critical: Avoid "Loss in the Middle"
- Place key findings at START and END of sections, not buried
- Use explicit headers and markers
- Structure: Summary > Details > Conclusion (not Details sandwiched)
Progressive Context Loading:
- Load methodology sections on-demand
- Load template only for Phase 8
- Do not inline everything - reference external files
Anti-Hallucination Protocol (CRITICAL for Financial Data):
- Source grounding: Every financial claim MUST cite a specific source immediately [N]
- Clear boundaries: Distinguish between FACTS (from filings/data) and ANALYSIS (your interpretation)
- Explicit markers: Use "According to [1]..." or "[1] reports..." for source-grounded statements
- No speculation without labeling: Mark inferences as "This suggests..." not "Data shows..."
- Verify before citing: If unsure whether source actually says X, do NOT fabricate citation
- When uncertain: Say "No sources found for X" rather than inventing references
- Financial precision: Always include specific numbers, dates, and currency when available
Parallel Execution Requirements (CRITICAL for Speed):
Phase 3 RETRIEVE - Mandatory Parallel Financial Search:
- Decompose query into 5-10 independent search angles before ANY searches
- Launch ALL searches in single message with multiple tool calls (NOT sequential)
- Quality threshold monitoring for FFS pattern:
- Track source count and avg credibility score
- Proceed when threshold reached (mode-specific, see methodology)
- Continue background searches for additional depth
- 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:
- SEC filing references (verify EDGAR links)
- Financial data accuracy (cross-check key metrics)
- Date accuracy (earnings dates, filing dates)
- Flags suspicious entries (future financials, impossible metrics)
If suspicious citations found:
- Review flagged entries manually
- Remove or replace fabricated sources
- Re-run until clean
Step 2: Structure & Quality Validation
python scripts/validate_report.py --report [path]
9 automated checks (financial-enhanced):
- Executive summary length (50-250 words)
- Required sections present (+ recommended: Risk Factors, Valuation)
- Citations formatted [1], [2], [3]
- Bibliography matches citations
- No placeholder text (TBD, TODO)
- Word count reasonable (500-10000)
- Minimum 10 sources
- No broken internal links
- Financial data consistency (dates, currencies, units)
If fails:
- Attempt 1: Auto-fix formatting/links
- Attempt 2: Manual review + correction
- After 2 failures: STOP > Report issues > Ask user
5. Report
CRITICAL: Generate COMPREHENSIVE, DETAILED financial markdown reports
File Organization (CRITICAL - Clean Accessibility):
1. Create Organized Folder in /code:
- ALWAYS create dedicated folder:
/code/[TickerOrTopic]_Financial_Research_[YYYYMMDD]/
- Extract clean topic name from research question
- Examples:
- "AAPL investment analysis" ->
/code/AAPL_Financial_Research_20251104/
- "compare cloud providers" ->
/code/Cloud_Sector_Analysis_20251104/
- "fintech due diligence" ->
/code/Fintech_Due_Diligence_20251104/
- If folder exists, use it; if not, create it
- This ensures clean organization and easy accessibility
2. Save All Formats to Same Folder:
Markdown (Primary Source):
- Save to:
[Documents folder]/financial_report_[YYYYMMDD]_[topic_slug].md
- Also save copy to:
/code/research_output/ (internal tracking)
- Full detailed report with all findings
HTML (McKinsey Style - ALWAYS GENERATE):
- Save to:
[Documents folder]/financial_report_[YYYYMMDD]_[topic_slug].html
- Use McKinsey template: mckinsey_template
- Design principles: Sharp corners (NO border-radius), muted corporate colors (navy #003d5c, gray #f8f9fa), ultra-compact layout, info-first structure
- Place critical financial metrics dashboard at top (extract 3-4 key metrics: market cap, P/E, revenue growth, etc.)
- Use data tables for dense financial information
- 14px base font, compact spacing, no decorative gradients or colors
- OPEN in browser automatically after generation
PDF (Professional Print - ALWAYS GENERATE):
- Save to:
[Documents folder]/financial_report_[YYYYMMDD]_[topic_slug].pdf
- Use generating-pdf skill (via Task tool with general-purpose agent)
- Professional formatting with headers, page numbers
- OPEN in default PDF viewer after generation
3. File Naming Convention:
All files use same base name for easy matching:
financial_report_20251104_aapl_analysis.md
financial_report_20251104_aapl_analysis.html
financial_report_20251104_aapl_analysis.pdf
Length Requirements (UNLIMITED with Progressive Assembly):
- Quick mode: 2,000+ words (baseline quality threshold)
- Standard mode: 4,000+ words (comprehensive analysis)
- Deep mode: 6,000+ words (thorough investigation)
- UltraDeep mode: 10,000-50,000+ words (NO UPPER LIMIT)
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:
- Use template as exact structure
- Generate each section to APPROPRIATE depth (determined by evidence, not word targets)
- Include specific financial data, statistics, dates, numbers
- Multiple paragraphs per finding with evidence
- Each section gets focused generation attention
- DO NOT write summaries - write FULL analysis
Writing Standards (Financial Precision):
- Data-driven: Every claim backed by specific numbers from sources
- Precision: Exact figures with currency, dates, and units
- Economy: No fluff, eliminate unnecessary modifiers
- Clarity: Financial terminology used correctly and consistently
- Directness: State findings without embellishment
- High signal-to-noise: Dense information, respect reader's time
- Examples:
- Bad: "revenue increased significantly" -> Good: "revenue grew 23% YoY to $94.8B in FY2024 [1]"
- Bad: "strong margins" -> Good: "gross margin of 43.2%, up 180bps YoY [2]"
- Bad: "expensive valuation" -> Good: "trades at 28x forward P/E vs sector median 22x [3]"
Source Attribution Standards (Critical for Financial Research):
- Immediate citation: Every financial claim followed by [N] citation in same sentence
- Quote sources directly: Use "According to [1]..." or "[1] reports..." for factual statements
- Distinguish fact from analysis:
- GOOD: "Q3 revenue was $24.9B, up 8% YoY [1]."
- BAD: "Revenue grew strongly last quarter."
- No vague attributions:
- NEVER: "Analysts believe...", "Market expects...", "Sources indicate..."
- ALWAYS: "Goldman Sachs estimates..." [1], "Per SEC 10-K filing..." [2]
- Label speculation explicitly:
- GOOD: "This suggests potential margin expansion..." (analysis, not fact)
- BAD: "Margins will expand..." (presented as fact without citation)
Deliver to user:
- Executive summary with key investment thesis (inline in chat)
- Organized folder path (e.g., "All files saved to: /code/AAPL_Financial_Research_20251104/")
- Confirmation of all three formats generated:
- Markdown (source)
- HTML (McKinsey-style, opened in browser)
- PDF (professional print, opened in viewer)
- Source quality assessment summary (source count, regulatory vs news mix)
- Key financial metrics summary
- Risk factors summary
- 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)
- SEC EDGAR: 10-K, 10-Q, 8-K, proxy statements, insider filings
- Federal Reserve: FRED data, monetary policy, banking data
- FDIC/OCC: Banking regulation, call reports
- Treasury: Economic data, fiscal policy
- Company IR: Investor relations, earnings calls, presentations
- Exchange Filings: NYSE, NASDAQ company disclosures
Tier 2: Financial Data Providers (High Credibility)
- Bloomberg: Real-time data, analysis, news
- Reuters: News, data, analysis
- S&P Global: Ratings, research, Capital IQ data
- Moody's/Fitch: Credit ratings, research
- FactSet: Financial data, analytics
- Morningstar: Fund data, equity research
- PitchBook: Private market data, VC/PE
Tier 3: Financial News & Research (Moderate-High Credibility)
- Wall Street Journal: Business news, analysis
- Financial Times: Global finance news
- Barron's: Investment analysis
- Institutional research: Goldman, Morgan Stanley, JPM research
- Industry publications: American Banker, Insurance Journal
Tier 4: General Business Sources (Moderate Credibility)
- CNBC, Yahoo Finance: Market news (verify with primary sources)
- Seeking Alpha: Analysis (note: user-generated, verify claims)
- Industry blogs: Supplement only, not primary citation
Source Verification Requirements:
- Tier 1 sources: Can cite directly, highest trust
- Tier 2 sources: Reliable, cross-check major claims
- Tier 3 sources: Good for analysis, verify data with Tier 1-2
- Tier 4 sources: Use sparingly, always verify with higher tiers
Output Contract
Format: Comprehensive financial markdown report following template EXACTLY
Required sections (all must be detailed):
- Executive Summary with Investment Thesis (50-250 words)
- Company/Topic Overview (background, business model)
- Financial Analysis (revenue, margins, cash flow, balance sheet)
- Valuation Analysis (multiples, DCF if applicable, peer comparison)
- Competitive Position (market share, moat, competitive dynamics)
- Risk Factors (business, financial, regulatory, market risks)
- Investment Thesis / Recommendations
- Bibliography (CRITICAL - see rules below)
- Methodology Appendix
Financial-Specific Sections (include when relevant):
- Earnings Analysis (quarterly trends, guidance vs actual)
- Management Assessment (track record, insider activity)
- Regulatory Environment (compliance, pending regulation)
- ESG Considerations (if material to thesis)
- Catalyst Timeline (upcoming events, catalysts)
Bibliography Requirements (ZERO TOLERANCE):
- MUST include EVERY citation [N] used in report body
- Format: [N] Source (Date). "Title". Publication/Filing. URL (Retrieved: Date)
- Each entry on its own line, complete with all metadata
- NO placeholders, NO ranges, NO truncation
- Validation WILL FAIL if bibliography is incomplete
Strictly Prohibited:
- Placeholder text (TBD, TODO, [citation needed])
- Uncited financial claims
- Forward-looking statements presented as facts
- Broken links
- Missing required sections
- Short summaries instead of detailed analysis
- Vague statements without specific data
Quality gates (enforced by validator):
- Minimum 2,000 words (standard mode)
- Average credibility score >70/100 (higher bar for financial)
- 3+ sources per major financial claim
- Clear facts vs. analysis distinction
- All sections present and detailed
- Key financial metrics included with sources
Error Handling & Stop Rules
Stop immediately if:
- 2 validation failures on same error > Pause, report, ask user
- <5 sources after exhaustive search > Report limitation, request direction
- Critical financial data unavailable > Note gap, proceed with caveats
- User interrupts/changes scope > Confirm new direction
Graceful degradation:
- 5-10 sources > Note in limitations, proceed with extra verification
- Missing recent filing > Note, use most recent available
- Private company (limited data) > Acknowledge, use available sources
- Time constraint reached > Package partial results, document gaps
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:
- 10+ sources (document if fewer)
- 3+ sources per major financial claim
- Executive summary <250 words with clear thesis
- Full citations with URLs to filings/sources
- Credibility assessment (source tier breakdown)
- Risk factors section
- Methodology documented
- Key metrics with sources
- No placeholders
Priority: Accuracy over speed. Financial data must be verified.
Inputs & Assumptions
Required:
- Financial research question (string)
Optional:
- Mode (quick/standard/deep/ultradeep)
- Time constraints
- Specific data requirements (valuation focus, risk focus, etc.)
- Output format preferences
- Jurisdiction (default: US)
Assumptions:
- User requires verified, citation-backed financial information
- Institutional-quality analysis expected
- 10-50 sources available on topic
- Time investment: 5-45 minutes
- USD unless otherwise specified
- US regulatory framework unless specified
When to Use / NOT Use
Use when:
- Investment analysis (buy/sell/hold thesis)
- Company due diligence
- Sector/industry deep dives
- M&A analysis
- Competitive benchmarking
- Earnings analysis
- Regulatory impact assessment
- Financial modeling research
Do NOT use:
- Simple stock quotes (use WebSearch)
- Basic company lookups (use WebSearch)
- Real-time trading decisions (need live data)
- Personal financial advice (not qualified)
- Tax/legal advice (not qualified)
Scripts (Offline, Python stdlib only)
Location: ./scripts/
- research_engine.py - Orchestration engine
- validate_report.py - Quality validation (9 checks, financial-enhanced)
- citation_manager.py - Citation tracking
- source_evaluator.py - Financial source credibility scoring (0-100)
- verify_citations.py - Citation verification with SEC filing checks
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.
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.
1---
2name: financial-deep-research
3description: 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 research", "market analysis", "investment analysis", "due diligence", "financial deep dive", "compare stocks/funds", or "analyze [company/sector]". Do NOT use for simple stock quotes, basic company lookups, or questions answerable with 1-2 searches.
4metadata:
5 source: https://skillmd.com/skills/aibot88/financial-deep-research
6---
7
8# Financial Deep Research
9
10<!-- STATIC CONTEXT BLOCK START - Optimized for prompt caching -->
11<!-- All static instructions, methodology, and templates below this line -->
12<!-- Dynamic content (user queries, results) added after this block -->
13
14## Core System Instructions
15
16**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.
17
18**Financial Focus:** This skill specializes in:
19- Market analysis and investment research
20- Due diligence and competitive benchmarking
21- Regulatory compliance and risk assessment
22- Financial modeling support and valuation analysis
23- Earnings analysis and financial statement review
24- Sector/industry deep dives
25
26**Context Strategy:** This skill uses 2025 context engineering best practices:
27- Static instructions cached (this section)
28- Progressive disclosure (load references only when needed)
29- Avoid "loss in the middle" (critical info at start/end, not buried)
30- Explicit section markers for context navigation
31
32---
33
34## Decision Tree (Execute First)
35
36```
37Request Analysis
38|-- Simple stock quote? -> STOP: Use WebSearch, not this skill
39|-- Basic company lookup? -> STOP: Use WebSearch, not this skill
40|-- Debugging code? -> STOP: Use standard tools, not this skill
41+-- Complex financial analysis needed? -> CONTINUE
42
43Mode Selection
44|-- Quick market check? -> quick (3 phases, 2-5 min)
45|-- Standard analysis? -> standard (6 phases, 5-10 min) [DEFAULT]
46|-- Investment decision? -> deep (8 phases, 10-20 min)
47|-- Due diligence/M&A? -> ultradeep (8+ phases, 20-45 min)
48
49Execution Loop (per phase)
50|-- Load phase instructions from [methodology](./reference/methodology.md#phase-N)
51|-- Execute phase tasks
52|-- Spawn parallel agents if applicable
53+-- Update progress
54
55Validation Gate
56|-- Run `python scripts/validate_report.py --report [path]`
57|-- Pass? -> Deliver
58+-- Fail? -> Fix (max 2 attempts) -> Still fails? -> Escalate
59```
60
61---
62
63## Workflow (Clarify > Plan > Act > Verify > Report)
64
65**AUTONOMY PRINCIPLE:** This skill operates independently. Infer assumptions from query context. Only stop for critical errors or incomprehensible queries.
66
67### 1. Clarify (Rarely Needed - Prefer Autonomy)
68
69**DEFAULT: Proceed autonomously. Derive assumptions from query signals.**
70
71**ONLY ask if CRITICALLY ambiguous:**
72- Query is incomprehensible (e.g., "analyze the thing")
73- Contradictory requirements (e.g., "quick 50-source ultradeep analysis")
74- Critical compliance/regulatory scope unclear
75
76**When in doubt: PROCEED with standard mode. User will redirect if incorrect.**
77
78**Default assumptions:**
79- Company analysis -> Assume investor/analyst audience
80- Sector query -> Assume comprehensive market view needed
81- Valuation query -> Assume institutional-quality analysis
82- Regulatory query -> Assume US jurisdiction unless specified
83- Standard mode is default for most queries
84
85---
86
87### 2. Plan
88
89**Mode selection criteria:**
90- **Quick** (2-5 min): Market snapshot, earnings preview, quick check
91- **Standard** (5-10 min): Most analysis, balanced depth/speed [DEFAULT]
92- **Deep** (10-20 min): Investment decisions, detailed due diligence
93- **UltraDeep** (20-45 min): M&A due diligence, comprehensive sector analysis
94
95**Announce plan and execute:**
96- Briefly state: selected mode, estimated time, number of sources
97- Example: "Starting standard mode financial research (5-10 min, 15-30 sources)"
98- Proceed without waiting for approval
99
100---
101
102### 3. Act (Phase Execution)
103
104**All modes execute:**
105- Phase 1: SCOPE - Define financial analysis boundaries ([method](./reference/methodology.md#phase-1-scope))
106- Phase 3: RETRIEVE - Parallel financial data gathering (5-10 concurrent searches + agents) ([method](./reference/methodology.md#phase-3-retrieve---parallel-information-gathering))
107- Phase 8: PACKAGE - Generate report using [template](./templates/report_template.md)
108
109**Standard/Deep/UltraDeep execute:**
110- Phase 2: PLAN - Financial research strategy formulation
111- Phase 4: TRIANGULATE - Verify 3+ sources per financial claim
112- Phase 4.5: OUTLINE REFINEMENT - Adapt structure based on evidence (WebWeaver 2025) ([method](./reference/methodology.md#phase-45-outline-refinement---dynamic-evolution-webweaver-2025))
113- Phase 5: SYNTHESIZE - Generate investment insights
114
115**Deep/UltraDeep execute:**
116- Phase 6: CRITIQUE - Risk analysis and bear case
117- Phase 7: REFINE - Address gaps, strengthen thesis
118
119**Critical: Avoid "Loss in the Middle"**
120- Place key findings at START and END of sections, not buried
121- Use explicit headers and markers
122- Structure: Summary > Details > Conclusion (not Details sandwiched)
123
124**Progressive Context Loading:**
125- Load [methodology](./reference/methodology.md) sections on-demand
126- Load [template](./templates/report_template.md) only for Phase 8
127- Do not inline everything - reference external files
128
129**Anti-Hallucination Protocol (CRITICAL for Financial Data):**
130- **Source grounding**: Every financial claim MUST cite a specific source immediately [N]
131- **Clear boundaries**: Distinguish between FACTS (from filings/data) and ANALYSIS (your interpretation)
132- **Explicit markers**: Use "According to [1]..." or "[1] reports..." for source-grounded statements
133- **No speculation without labeling**: Mark inferences as "This suggests..." not "Data shows..."
134- **Verify before citing**: If unsure whether source actually says X, do NOT fabricate citation
135- **When uncertain**: Say "No sources found for X" rather than inventing references
136- **Financial precision**: Always include specific numbers, dates, and currency when available
137
138**Parallel Execution Requirements (CRITICAL for Speed):**
139
140**Phase 3 RETRIEVE - Mandatory Parallel Financial Search:**
1411. **Decompose query** into 5-10 independent search angles before ANY searches
1422. **Launch ALL searches in single message** with multiple tool calls (NOT sequential)
1433. **Quality threshold monitoring** for FFS pattern:
144 - Track source count and avg credibility score
145 - Proceed when threshold reached (mode-specific, see methodology)
146 - Continue background searches for additional depth
1474. **Spawn 3-5 parallel agents** using Task tool for deep-dive investigations
148
149**Financial Search Decomposition Strategy:**
150```
151[Single message with 8+ parallel tool calls]
152WebSearch #1: Company fundamentals + recent filings
153WebSearch #2: Earnings/financial performance
154WebSearch #3: Industry/sector analysis
155WebSearch #4: Competitive landscape
156WebSearch #5: Regulatory/compliance news
157WebSearch #6: Analyst ratings/price targets
158WebSearch #7: Risk factors/bear case
159WebSearch #8: Recent news + catalysts
160Task agent #1: SEC filing deep dive (10-K, 10-Q analysis)
161Task agent #2: Financial statement analysis
162Task agent #3: Industry comparison/benchmarking
163```
164
165---
166
167### 4. Verify (Always Execute)
168
169**Step 1: Citation Verification (Catches Fabricated Sources)**
170
171```bash
172python scripts/verify_citations.py --report [path]
173```
174
175**Financial-Specific Checks:**
176- SEC filing references (verify EDGAR links)
177- Financial data accuracy (cross-check key metrics)
178- Date accuracy (earnings dates, filing dates)
179- Flags suspicious entries (future financials, impossible metrics)
180
181**If suspicious citations found:**
182- Review flagged entries manually
183- Remove or replace fabricated sources
184- Re-run until clean
185
186**Step 2: Structure & Quality Validation**
187
188```bash
189python scripts/validate_report.py --report [path]
190```
191
192**9 automated checks (financial-enhanced):**
1931. Executive summary length (50-250 words)
1942. Required sections present (+ recommended: Risk Factors, Valuation)
1953. Citations formatted [1], [2], [3]
1964. Bibliography matches citations
1975. No placeholder text (TBD, TODO)
1986. Word count reasonable (500-10000)
1997. Minimum 10 sources
2008. No broken internal links
2019. Financial data consistency (dates, currencies, units)
202
203**If fails:**
204- Attempt 1: Auto-fix formatting/links
205- Attempt 2: Manual review + correction
206- After 2 failures: **STOP** > Report issues > Ask user
207
208---
209
210### 5. Report
211
212**CRITICAL: Generate COMPREHENSIVE, DETAILED financial markdown reports**
213
214**File Organization (CRITICAL - Clean Accessibility):**
215
216**1. Create Organized Folder in /code:**
217- ALWAYS create dedicated folder: `/code/[TickerOrTopic]_Financial_Research_[YYYYMMDD]/`
218- Extract clean topic name from research question
219- Examples:
220 - "AAPL investment analysis" -> `/code/AAPL_Financial_Research_20251104/`
221 - "compare cloud providers" -> `/code/Cloud_Sector_Analysis_20251104/`
222 - "fintech due diligence" -> `/code/Fintech_Due_Diligence_20251104/`
223- If folder exists, use it; if not, create it
224- This ensures clean organization and easy accessibility
225
226**2. Save All Formats to Same Folder:**
227
228**Markdown (Primary Source):**
229- Save to: `[Documents folder]/financial_report_[YYYYMMDD]_[topic_slug].md`
230- Also save copy to: `/code/research_output/` (internal tracking)
231- Full detailed report with all findings
232
233**HTML (McKinsey Style - ALWAYS GENERATE):**
234- Save to: `[Documents folder]/financial_report_[YYYYMMDD]_[topic_slug].html`
235- Use McKinsey template: [mckinsey_template](./templates/mckinsey_report_template.html)
236- Design principles: Sharp corners (NO border-radius), muted corporate colors (navy #003d5c, gray #f8f9fa), ultra-compact layout, info-first structure
237- Place critical financial metrics dashboard at top (extract 3-4 key metrics: market cap, P/E, revenue growth, etc.)
238- Use data tables for dense financial information
239- 14px base font, compact spacing, no decorative gradients or colors
240- OPEN in browser automatically after generation
241
242**PDF (Professional Print - ALWAYS GENERATE):**
243- Save to: `[Documents folder]/financial_report_[YYYYMMDD]_[topic_slug].pdf`
244- Use generating-pdf skill (via Task tool with general-purpose agent)
245- Professional formatting with headers, page numbers
246- OPEN in default PDF viewer after generation
247
248**3. File Naming Convention:**
249All files use same base name for easy matching:
250- `financial_report_20251104_aapl_analysis.md`
251- `financial_report_20251104_aapl_analysis.html`
252- `financial_report_20251104_aapl_analysis.pdf`
253
254**Length Requirements (UNLIMITED with Progressive Assembly):**
255- Quick mode: 2,000+ words (baseline quality threshold)
256- Standard mode: 4,000+ words (comprehensive analysis)
257- Deep mode: 6,000+ words (thorough investigation)
258- UltraDeep mode: 10,000-50,000+ words (NO UPPER LIMIT)
259
260**How Unlimited Length Works:**
261Progressive file assembly allows ANY report length by generating section-by-section.
262Each section is written to file immediately (avoiding output token limits).
263Complex analyses with many findings? Generate 20, 30, 50+ findings - no constraint!
264
265**Content Requirements:**
266- Use [template](./templates/report_template.md) as exact structure
267- Generate each section to APPROPRIATE depth (determined by evidence, not word targets)
268- Include specific financial data, statistics, dates, numbers
269- Multiple paragraphs per finding with evidence
270- Each section gets focused generation attention
271- DO NOT write summaries - write FULL analysis
272
273**Writing Standards (Financial Precision):**
274- **Data-driven**: Every claim backed by specific numbers from sources
275- **Precision**: Exact figures with currency, dates, and units
276- **Economy**: No fluff, eliminate unnecessary modifiers
277- **Clarity**: Financial terminology used correctly and consistently
278- **Directness**: State findings without embellishment
279- **High signal-to-noise**: Dense information, respect reader's time
280- **Examples**:
281 - Bad: "revenue increased significantly" -> Good: "revenue grew 23% YoY to $94.8B in FY2024 [1]"
282 - Bad: "strong margins" -> Good: "gross margin of 43.2%, up 180bps YoY [2]"
283 - Bad: "expensive valuation" -> Good: "trades at 28x forward P/E vs sector median 22x [3]"
284
285**Source Attribution Standards (Critical for Financial Research):**
286- **Immediate citation**: Every financial claim followed by [N] citation in same sentence
287- **Quote sources directly**: Use "According to [1]..." or "[1] reports..." for factual statements
288- **Distinguish fact from analysis**:
289 - GOOD: "Q3 revenue was $24.9B, up 8% YoY [1]."
290 - BAD: "Revenue grew strongly last quarter."
291- **No vague attributions**:
292 - NEVER: "Analysts believe...", "Market expects...", "Sources indicate..."
293 - ALWAYS: "Goldman Sachs estimates..." [1], "Per SEC 10-K filing..." [2]
294- **Label speculation explicitly**:
295 - GOOD: "This suggests potential margin expansion..." (analysis, not fact)
296 - BAD: "Margins will expand..." (presented as fact without citation)
297
298**Deliver to user:**
2991. Executive summary with key investment thesis (inline in chat)
3002. Organized folder path (e.g., "All files saved to: /code/AAPL_Financial_Research_20251104/")
3013. Confirmation of all three formats generated:
302 - Markdown (source)
303 - HTML (McKinsey-style, opened in browser)
304 - PDF (professional print, opened in viewer)
3054. Source quality assessment summary (source count, regulatory vs news mix)
3065. Key financial metrics summary
3076. Risk factors summary
3087. Next steps (if relevant)
309
310**Generation Workflow: Progressive File Assembly (Unlimited Length)**
311
312[Same progressive assembly workflow as base skill - see deep-research SKILL.md]
313
314---
315
316## Financial Data Sources (Priority Order)
317
318### Tier 1: Primary/Regulatory Sources (Highest Credibility)
319- **SEC EDGAR**: 10-K, 10-Q, 8-K, proxy statements, insider filings
320- **Federal Reserve**: FRED data, monetary policy, banking data
321- **FDIC/OCC**: Banking regulation, call reports
322- **Treasury**: Economic data, fiscal policy
323- **Company IR**: Investor relations, earnings calls, presentations
324- **Exchange Filings**: NYSE, NASDAQ company disclosures
325
326### Tier 2: Financial Data Providers (High Credibility)
327- **Bloomberg**: Real-time data, analysis, news
328- **Reuters**: News, data, analysis
329- **S&P Global**: Ratings, research, Capital IQ data
330- **Moody's/Fitch**: Credit ratings, research
331- **FactSet**: Financial data, analytics
332- **Morningstar**: Fund data, equity research
333- **PitchBook**: Private market data, VC/PE
334
335### Tier 3: Financial News & Research (Moderate-High Credibility)
336- **Wall Street Journal**: Business news, analysis
337- **Financial Times**: Global finance news
338- **Barron's**: Investment analysis
339- **Institutional research**: Goldman, Morgan Stanley, JPM research
340- **Industry publications**: American Banker, Insurance Journal
341
342### Tier 4: General Business Sources (Moderate Credibility)
343- **CNBC, Yahoo Finance**: Market news (verify with primary sources)
344- **Seeking Alpha**: Analysis (note: user-generated, verify claims)
345- **Industry blogs**: Supplement only, not primary citation
346
347**Source Verification Requirements:**
348- Tier 1 sources: Can cite directly, highest trust
349- Tier 2 sources: Reliable, cross-check major claims
350- Tier 3 sources: Good for analysis, verify data with Tier 1-2
351- Tier 4 sources: Use sparingly, always verify with higher tiers
352
353---
354
355## Output Contract
356
357**Format:** Comprehensive financial markdown report following [template](./templates/report_template.md) EXACTLY
358
359**Required sections (all must be detailed):**
360- Executive Summary with Investment Thesis (50-250 words)
361- Company/Topic Overview (background, business model)
362- Financial Analysis (revenue, margins, cash flow, balance sheet)
363- Valuation Analysis (multiples, DCF if applicable, peer comparison)
364- Competitive Position (market share, moat, competitive dynamics)
365- Risk Factors (business, financial, regulatory, market risks)
366- Investment Thesis / Recommendations
367- **Bibliography (CRITICAL - see rules below)**
368- Methodology Appendix
369
370**Financial-Specific Sections (include when relevant):**
371- Earnings Analysis (quarterly trends, guidance vs actual)
372- Management Assessment (track record, insider activity)
373- Regulatory Environment (compliance, pending regulation)
374- ESG Considerations (if material to thesis)
375- Catalyst Timeline (upcoming events, catalysts)
376
377**Bibliography Requirements (ZERO TOLERANCE):**
378- MUST include EVERY citation [N] used in report body
379- Format: [N] Source (Date). "Title". Publication/Filing. URL (Retrieved: Date)
380- Each entry on its own line, complete with all metadata
381- NO placeholders, NO ranges, NO truncation
382- Validation WILL FAIL if bibliography is incomplete
383
384**Strictly Prohibited:**
385- Placeholder text (TBD, TODO, [citation needed])
386- Uncited financial claims
387- Forward-looking statements presented as facts
388- Broken links
389- Missing required sections
390- **Short summaries instead of detailed analysis**
391- **Vague statements without specific data**
392
393**Quality gates (enforced by validator):**
394- Minimum 2,000 words (standard mode)
395- Average credibility score >70/100 (higher bar for financial)
396- 3+ sources per major financial claim
397- Clear facts vs. analysis distinction
398- All sections present and detailed
399- Key financial metrics included with sources
400
401---
402
403## Error Handling & Stop Rules
404
405**Stop immediately if:**
406- 2 validation failures on same error > Pause, report, ask user
407- <5 sources after exhaustive search > Report limitation, request direction
408- Critical financial data unavailable > Note gap, proceed with caveats
409- User interrupts/changes scope > Confirm new direction
410
411**Graceful degradation:**
412- 5-10 sources > Note in limitations, proceed with extra verification
413- Missing recent filing > Note, use most recent available
414- Private company (limited data) > Acknowledge, use available sources
415- Time constraint reached > Package partial results, document gaps
416
417**Error format:**
418```
419Issue: [Description]
420Context: [What was attempted]
421Tried: [Resolution attempts]
422Options:
423 1. [Option 1]
424 2. [Option 2]
425 3. [Option 3]
426```
427
428---
429
430## Quality Standards (Always Enforce)
431
432Every financial report must:
433- 10+ sources (document if fewer)
434- 3+ sources per major financial claim
435- Executive summary <250 words with clear thesis
436- Full citations with URLs to filings/sources
437- Credibility assessment (source tier breakdown)
438- Risk factors section
439- Methodology documented
440- Key metrics with sources
441- No placeholders
442
443**Priority:** Accuracy over speed. Financial data must be verified.
444
445---
446
447## Inputs & Assumptions
448
449**Required:**
450- Financial research question (string)
451
452**Optional:**
453- Mode (quick/standard/deep/ultradeep)
454- Time constraints
455- Specific data requirements (valuation focus, risk focus, etc.)
456- Output format preferences
457- Jurisdiction (default: US)
458
459**Assumptions:**
460- User requires verified, citation-backed financial information
461- Institutional-quality analysis expected
462- 10-50 sources available on topic
463- Time investment: 5-45 minutes
464- USD unless otherwise specified
465- US regulatory framework unless specified
466
467---
468
469## When to Use / NOT Use
470
471**Use when:**
472- Investment analysis (buy/sell/hold thesis)
473- Company due diligence
474- Sector/industry deep dives
475- M&A analysis
476- Competitive benchmarking
477- Earnings analysis
478- Regulatory impact assessment
479- Financial modeling research
480
481**Do NOT use:**
482- Simple stock quotes (use WebSearch)
483- Basic company lookups (use WebSearch)
484- Real-time trading decisions (need live data)
485- Personal financial advice (not qualified)
486- Tax/legal advice (not qualified)
487
488---
489
490## Scripts (Offline, Python stdlib only)
491
492**Location:** `./scripts/`
493
494- **research_engine.py** - Orchestration engine
495- **validate_report.py** - Quality validation (9 checks, financial-enhanced)
496- **citation_manager.py** - Citation tracking
497- **source_evaluator.py** - Financial source credibility scoring (0-100)
498- **verify_citations.py** - Citation verification with SEC filing checks
499
500**No external dependencies required.**
501
502---
503
504## Progressive References (Load On-Demand)
505
506**Do not inline these - reference only:**
507- [Complete Methodology](./reference/methodology.md) - 8-phase details with financial focus
508- [Report Template](./templates/report_template.md) - Financial output structure
509- [README](./README.md) - Usage docs
510- [QUICK_START](./QUICK_START.md) - Fast reference
511
512**Context Management:** Load files on-demand for current phase only. Do not preload all content.
513
514---
515
516<!-- STATIC CONTEXT BLOCK END -->
517<!-- Above content is cacheable (>1024 tokens, static) -->
518<!-- Below: Dynamic content (user queries, retrieved data, generated reports) -->
519<!-- This structure enables 85% latency reduction via prompt caching -->
520
521---
522
523## Dynamic Execution Zone
524
525**User Query Processing:**
526[User financial research question will be inserted here during execution]
527
528**Retrieved Information:**
529[Search results and sources will be accumulated here]
530
531**Generated Analysis:**
532[Findings, synthesis, and report content generated here]
533
534**Note:** This section remains empty in the skill definition. Content populated during runtime only.