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