Claude Deep Research Skill

repository·main·Indexed 21 days ago

https://github.com/199-biotechnologies/claude-deep-research-skill

An enterprise-grade research engine for Claude Code that produces citation-backed reports using multi-agent orchestration and multi-provider search. It features a multi-phase pipeline (Scope to Package), multiple research modes (Quick, Standard, Deep, UltraDeep), and an Auto-Continuation Protocol for reports exceeding 18,000 words. The system integrates with search-cli for aggregated search across Brave, Serper, Exa, Jina, and Firecrawl, and generates outputs in Markdown, McKinsey-style HTML, and PDF formats.

Tokens
12.5K
Snippets
23
Records
56
Agent score
76%

What's inside claude-deep-research-skill

  1. Understand the Research Pipeline and Features

    main

    The research engine follows a multi-phase pipeline: Scope $\rightarrow$ Plan $\rightarrow$ Retrieve (parallel search + agents) $\rightarrow$ Triangulate $\rightarrow$ Outline Refinement $\rightarrow$ Synthesize $\rightarrow$ Critique (with loop-back) $\rightarrow$ Refine $\rightarrow$ Package.

    Key Pipeline Features:

    • Step 0 (Date Detection): Retrieves the current date before searching to prevent stale training-data year assumptions.
    • Parallel Retrieval: Executes 5-10 concurrent searches and uses 2-3 focused sub-agents to return structured evidence.
    • Critique Loop-back: In Phase 6, the engine can return to Phase 3 with delta-queries if critical information gaps are identified.
    • Multi-persona Red Teaming: For Deep/UltraDeep modes, the engine uses personas like Skeptical Practitioner, Adversarial Reviewer, and Implementation Engineer to validate findings.
    • Disk-persisted Citations: Citations are stored in sources.json to ensure they survive context compaction and agent handoffs.
  2. Identify when to use the deep-research skill

    main

    The deep-research skill is designed for complex, multi-source research tasks that require citation tracking, evidence persistence, and structured report generation.

    Use it for:

    • Comprehensive analysis
    • Technology comparisons
    • State-of-the-art reviews
    • Multi-perspective investigations
    • Market analysis

    Do NOT use it for:

    • Simple lookups
    • Debugging
    • Questions answerable with 1-2 searches
    • Quick, time-sensitive queries

    Trigger Phrases: The skill is triggered by phrases such as "deep research", "comprehensive analysis", "research report", "compare X vs Y", "analyze trends", or "state of the art".

  3. Structure of the Research Report Appendix

    main

    The research report includes a detailed Appendix designed to provide transparency regarding the methodology, sources, and verification processes used during the research. This section is critical for establishing the credibility of the findings.

    Key components of the Appendix include:

    1. Research Process: A detailed description of the phases executed (e.g., SCOPE, PLAN, RETRIEVE).
    2. Sources Consulted: A breakdown of total sources by type (Academic, Industry, News, etc.), geographic coverage, and temporal coverage.
    3. Verification Approach: Documentation of how claims were triangulated, how source credibility was scored (0-100), and quality control checks performed.
    4. Claims-Evidence Table: A structured mapping of major claims to their supporting evidence and confidence levels.
    5. Report Metadata: Summary data including Research Mode (Quick/Standard/Deep/UltraDeep), total sources, word count, duration, and validation status.
  4. Adhere to writing and bullet point policies

    main

    To maintain high signal-to-noise ratios and professional standards, follow these writing constraints:

    Bullet Point Policy

    • Use bullets sparingly: Only for distinct lists (e.g., product names, company rosters, enumerated steps).
    • No bullets as primary content: Every finding requires substantive prose (3-5+ paragraphs).
    • Conversion Example: Instead of * Market size: $2.4B, use The global market reached $2.4 billion in 2023, driven by increasing consumer demand [1].

    Section Quality Checks

    Before considering a section complete, verify:

    • Paragraph count: At least 3 paragraphs for major sections.
    • Prose-first: Less than 20% bullets (at least 80% flowing prose).
    • No placeholders: Zero instances of "Content continues", "Due to length", or "[Sections X-Y]".
    • Evidence-rich: Include specific data points, statistics, and quotes.
    • Citation density: Major claims must be cited in the same sentence.
    • Evidence-backed: Every factual claim must have a corresponding entry in evidence.jsonl.
  5. Meet Bibliography and Citation requirements

    main

    A report is considered unusable if it lacks a complete bibliography. Follow these strict rules:

    Bibliography Format

    • Inclusion: Every citation [N] used in the report body must be included.
    • Entry Format: [N] Author/Org (Year). "Title". Publication. URL (Retrieved: Date)
    • Structure: Each entry must be on its own line and complete.
    • Zero Tolerance for Placeholders: Never use [8-75] Additional citations, ...continue..., or ranges like [3-50].

    Source Attribution Standards

    • Immediate Citation: Every factual claim must be followed by [N] in the same sentence.
    • Direct Quoting: Use patterns like "According to [1]..." or "[1] reports...".
    • Distinguish Fact from Synthesis: Clearly separate source-grounded facts from your own analysis.
    • Avoid Vague Attributions: Never use "Research suggests..." or "Experts believe...". Always use specific names: "Smith et al. (2024) found..." [1].
    • Label Speculation: Use phrases like "This suggests a potential mechanism..." to distinguish inferences from facts.
  6. Select a research mode based on complexity

    main

    The skill operates in four distinct modes depending on the required depth and time investment. The standard mode is the default.

    ModeDescriptionPhasesEstimated Time
    quickInitial exploration3 phases2-5 min
    standardStandard research (DEFAULT)6 phases5-10 min
    deepCritical decision making8 phases10-20 min
    ultradeepComprehensive review8+ phases20-45 min
  7. Understand the Progressive File Assembly Strategy

    main

    The Deep Research Skill uses a Progressive File Assembly Strategy to generate large, high-quality reports (up to 20,000 words) while managing Claude Code's output token limits (approx. 32,000 tokens).

    Instead of generating the entire report in one go, the skill generates and writes each section to the file immediately using Write/Edit tools. This prevents truncation and allows for natural section sizing based on content complexity.

    Generation Workflow:

    1. Executive Summary: Generate and write.
    2. Introduction: Edit/append to file.
    3. Findings: Generate each finding (1, 2, 3, etc.) as a separate step, editing/appending to the file. Each finding is sized based on evidence (e.g., 400 words for simple findings, 1,200+ for complex ones).
    4. Synthesis & Insights: Generate and append.
    5. Limitations & Caveats: Generate and append.
    6. Recommendations: Generate and append.
    7. Bibliography: Generate and append.
    8. Methodology: Generate and append.

    Key Constraints:

    • Individual Generation Limit: Keep each individual section generation under ~2,000 words to avoid output limits. If a section requires more, break it into subsections.
    • Total Report Limit: A single skill run can handle up to ~20,000 words. For reports exceeding this, run the skill multiple times for different parts.
  8. Implement Anti-Hallucination and Error Handling protocols

    main

    To prevent hallucinations and manage process failures, follow these protocols:

    Anti-Hallucination Protocol

    • Source grounding: Every factual claim MUST cite a specific source immediately [N].
    • Explicit markers: Use "According to [1]..." for source-grounded statements.
    • No speculation without labeling: Mark inferences as "This suggests...".
    • Verify before citing: If you are unsure what a source says, do NOT fabricate a citation. If no sources exist for a topic, state: "No sources found for X".

    Error Handling and Stopping Conditions

    Stop immediately if:

    • You encounter 2 validation failures on the same error.
    • You find fewer than 5 sources after an exhaustive search.
    • The user interrupts or changes the scope.

    Graceful Degradation:

    • 5-10 sources: Note this in the limitations section and perform extra verification.
    • Time constraints: Package a partial report and document the gaps.

    Error Reporting Format: When reporting an issue, use the following structure:

    Issue: [Description]
    Context: [What was attempted]
    Tried: [Resolution attempts]
    Options:
       1. [Option 1]
       2. [Option 2]
  9. Configure report length requirements by research mode

    main

    The research process supports four distinct modes, each with specific target word counts for the final report. Choose a mode based on the required depth of investigation:

    • Quick: 2,000-4,000 words (Baseline quality)
    • Standard: 4,000-8,000 words (Comprehensive analysis)
    • Deep: 8,000-15,000 words (Thorough investigation)
    • UltraDeep: 15,000-20,000+ words (Maximum rigor)

    Note on Token Limits: Claude Code has a default output limit of 32,000 tokens (~24,000 words). To ensure stability and leave margin for tool call overhead, aim for a total output of <= 20,000 words. Reports exceeding this limit require auto-continuation.

  10. Implement the First Finish Search (FFS) pattern

    main

    The FFS pattern allows for adaptive completion of the retrieval phase based on a quality threshold. Once a threshold is met, the agent can proceed to Phase 4 (Triangulate) while continuing remaining parallel searches in the background to add depth later.

    Quality Gates:

    • Quick mode: 10+ sources (avg credibility >60/100) OR 2 minutes elapsed.
    • Standard mode: 15+ sources (avg credibility >60/100) OR 5 minutes elapsed.
    • Deep mode: 25+ sources (avg credibility >70/100) OR 10 minutes elapsed.
    • UltraDeep mode: 30+ sources (avg credibility >75/100) OR 15 minutes elapsed.
  11. Structure of a Research Report

    main

    A complete research report generated by this skill follows a specific hierarchical structure. Use this as a reference for the expected output format:

    1. Research Report: [Topic] (Title)
    2. Executive Summary: 3-5 bullet points (200-400 words) and a Primary Recommendation.
    3. Introduction:
      • Research Question: Clear statement of the question and context.
      • Scope & Methodology: Details on what was investigated, inclusions/exclusions, methods used, and sources consulted.
      • Key Assumptions: 3-5 important assumptions made.
    4. Main Analysis: 4-8 detailed findings (600-2,000 words each). Each finding includes:
      • Descriptive Title
      • Detailed evidence, data, and statistics
      • Key Evidence list
      • Implications
      • Sources list (e.g., [1], [2], [3])
    5. Synthesis & Insights: 500-1,000 words identifying Patterns Identified, Novel Insights, and Implications (User, Broader, and Second-Order).
    6. Limitations & Caveats:
      • Counterevidence Register: Documenting contradictory findings.
      • Known Gaps: Missing information or unanswered questions.
      • Assumptions: Re-evaluating validity.
      • Areas of Uncertainty: Disagreements in sources or thin evidence.
    7. Recommendations:
      • Immediate Actions (What, Why, How, Timeline)
      • Next Steps (1-3 months)
      • Further Research Needs
    8. Bibliography: A complete list of all cited sources.
    9. Methodology: (Final section)