Skill: jiacode/deepresearchwork (version 1.0.0)

--- name: deep-research description: Comprehensive research framework that combines web search, content analysis, source verification, and iterative investigation to conduct in-depth research on any topic. Use when you need to perform thorough research with multiple sources, cross-validation, and structured findings. --- # Deep Research Framework ## Overview The Deep Research skill provides a systematic approach to conducting thorough investigations on any topic. It combines multiple tools and methodologies to gather, analyze, verify, and synthesize information. ## Core Components ### 1. Research Planning - Define research objectives - Identify key questions - Establish search criteria - Determine validation requirements ### 2. Information Gathering - Multi-source web search - Content extraction from various formats - Source diversity verification - Temporal relevance assessment ### 3. Analysis & Synthesis - Cross-reference multiple sources - Identify patterns and contradictions - Evaluate source credibility - Organize findings systematically ### 4. Validation & Verification - Fact-checking against authoritative sources - Cross-validation of claims - Identify potential biases - Assess information reliability ## Research Workflow ### Phase 1: Initial Investigation 1. **Topic Analysis** - Clarify research scope - Identify key concepts and terms - Define specific questions to answer 2. **Broad Search** - Use `web_search` to identify major sources - Gather diverse perspectives - Map the landscape of available information 3. **Source Prioritization** - Rank sources by authority and relevance - Identify primary vs. secondary sources - Note publication dates and context ### Phase 2: Deep Dive 1. **Detailed Content Extraction** - Use `web_fetch` to retrieve full articles/pages - Extract key information systematically - Maintain source attribution 2. **Cross-Reference Analysis** - Compare claims across multiple sources - Identify agreements and disagreements - Note inconsistencies for further investigation 3. **Expert Sources** - Seek academic papers, expert opinions - Look for peer-reviewed sources - Identify recognized authorities on the topic ### Phase 3: Synthesis & Validation 1. **Pattern Recognition** - Identify consistent themes across sources - Highlight areas of disagreement - Note gaps in available information 2. **Fact Verification** - Cross-check claims against authoritative sources - Verify dates, statistics, and attributions - Identify potential misinformation 3. **Bias Assessment** - Evaluate source objectivity - Identify potential conflicts of interest - Consider temporal context of information ### Phase 4: Report Generation 1. **Structured Summary** - Executive summary of key findings - Detailed findings organized by theme - Supporting evidence for each claim 2. **Source Evaluation** - Assessment of source credibility - Identification of limitations - Confidence levels for different claims 3. **Remaining Questions** - Areas requiring further investigation - Conflicting information needing resolution - Gaps in current knowledge ## Tools Integration ### Web Research - `web_search`: Initial broad search to identify sources - `web_fetch`: Retrieve detailed content from specific URLs - `browser`: For complex sites or when web_fetch fails ### Content Processing - `read`: Process downloaded content or documents - `write`: Create structured research notes - `edit`: Refine and organize findings ### Memory & Organization - `memory_get` / `memory_search`: Reference previous research - `write`: Create persistent research records - Structured file organization for findings ## Research Quality Standards ### Source Diversity - Include multiple perspectives on controversial topics - Balance popular and academic sources - Include international viewpoints when relevant - Seek primary sources when possible ### Temporal Relevance - Prioritize recent information for fast-changing topics - Consider historical context for trend analysis - Note when information was published - Flag potentially outdated information ### Authority Assessment - Prioritize peer-reviewed academic sources - Consider author credentials and institutional affiliation - Check for potential conflicts of interest - Verify organizational reputation ## Iterative Research Approach ### Cycle 1: General Overview - Broad search to understand the topic landscape - Identify key terms, concepts, and stakeholders - Establish initial research questions ### Cycle 2: Focused Investigation - Targeted searches based on initial findings - Deep dive into specific aspects - Begin synthesis of information ### Cycle 3: Validation & Refinement - Verify key claims across multiple sources - Resolve contradictions - Refine understanding based on evidence ### Cycle 4: Synthesis & Reporting - Combine findings into coherent narrative - Identify remaining uncertainties - Prepare final research report ## Output Structure ### Research Report Template ``` # [Research Topic] - Deep Research Report ## Executive Summary [2-3 sentence summary of key findings] ## Research Questions [Specific questions investigated] ## Methodology [Description of research approach and tools used] ## Key Findings [Main discoveries organized by theme] ## Supporting Evidence [Evidence supporting each finding with sources] ## Contradictions/Debates [Areas of disagreement among sources] ## Source Credibility Assessment [Evaluation of information sources] ## Limitations [Identified limitations in research] ## Further Research Needed [Questions requiring additional investigation] ``` ## Use Cases ### Academic Research - Literature reviews - Topic exploration - Source verification ### Business Intelligence - Market analysis - Competitive research - Technology trends ### Fact Checking - Claim verification - Misinformation identification - Source credibility assessment ### Personal Learning - Deep topic exploration - Concept clarification - Question resolution ## Quality Assurance - Always verify critical claims against multiple sources - Flag information that seems unreliable - Maintain skepticism toward sensational claims - Prioritize authoritative sources over anonymous ones - Document all sources for verification purposes

path: README.md
content: # Deep Research Skill

A comprehensive research framework that combines web search, content analysis, source verification, and iterative investigation to conduct in-depth research on any topic.

## Purpose

This skill provides a systematic approach to conducting thorough investigations without relying on any specific AI model. Instead, it orchestrates various OpenClaw tools to gather, analyze, verify, and synthesize information.

## Components

- `SKILL.md`: Main skill definition with research methodology
- `research_template.md`: Template for structured research reports
- `research_workflow.js`: JavaScript implementation of the research workflow
- `README.md`: This file

## Usage

To conduct deep research using this skill, follow these patterns:

### Basic Research Task
```
Research Topic: [Specify the topic you want to investigate]
Research Questions: [List specific questions to answer]
```

### Research Process
1. **Planning**: Define research scope and questions
2. **Gathering**: Collect information from multiple sources
3. **Analysis**: Cross-reference and validate findings
4. **Synthesis**: Combine findings into coherent conclusions
5. **Reporting**: Generate structured research report

## Tool Integration

This skill leverages the following OpenClaw tools:
- `web_search` - For initial topic exploration
- `web_fetch` - For detailed content extraction
- `browser` - For complex web interactions
- `memory_search` - To reference previous research
- `write`/`edit` - To create and refine research reports

## Quality Standards

The research follows these quality standards:
- Source diversity verification
- Cross-validation of claims
- Credibility assessment
- Bias recognition
- Temporal relevance consideration

## Output Format

Research results follow a structured format:
- Executive summary
- Detailed findings
- Source evaluation
- Confidence levels
- Remaining questions for further research

## Integration with Models

While this skill operates independently of any specific AI model, it can work with any model (Qwen, Gemini, etc.) to assist with:
- Content analysis
- Pattern recognition
- Synthesis of findings
- Report generation

path: research_template.md
content: # Deep Research Report Template

Use this template to structure comprehensive research reports.

## Research Topic
[Define the main topic or question being investigated]

## Executive Summary
[2-3 sentences summarizing the key findings and conclusions]

## Research Questions
- [Primary question 1]
- [Secondary question 2]
- [Additional questions as needed]

## Research Methodology
### Tools Used
- Web search queries: [List of search terms used]
- Sources consulted: [Types of sources referenced]
- Validation methods: [How claims were verified]

### Timeline
- Research start date: [Date]
- Sources current as of: [Date]
- Research duration: [Time period]

## Key Findings
### Finding 1: [Title]
- **Evidence**: [Supporting evidence]
- **Sources**: [List sources]
- **Confidence Level**: [High/Medium/Low based on source quality]

### Finding 2: [Title]
- **Evidence**: [Supporting evidence]
- **Sources**: [List sources]
- **Confidence Level**: [High/Medium/Low based on source quality]

[Continue for all major findings]

## Supporting Evidence
### Primary Sources
- [Source 1]: [Brief description and relevance]
- [Source 2]: [Brief description and relevance]

### Secondary Sources
- [Source 1]: [Brief description and relevance]
- [Source 2]: [Brief description and relevance]

## Contradictions and Debates
### Disagreement 1: [Description]
- **Perspective A**: [First viewpoint and sources]
- **Perspective B**: [Alternative viewpoint and sources]
- **Assessment**: [Which seems more credible and why]

### Disagreement 2: [Description]
- **Perspective A**: [First viewpoint and sources]
- **Perspective B**: [Alternative viewpoint and sources]
- **Assessment**: [Which seems more credible and why]

## Source Credibility Assessment
### Highly Reliable Sources
- [Source]: [Why it's reliable]

### Moderately Reliable Sources
- [Source]: [Why reliability is moderate]

### Sources to Be Skeptical Of
- [Source]: [Why to be cautious]

## Limitations of This Research
- [Any limitations in methodology or sources]
- [Gaps in available information]
- [Potential biases in the research]

## Areas for Further Research
- [Questions that remain unanswered]
- [Areas where more information is needed]
- [Contradictions that require resolution]

## References
1. [Complete citation 1]
2. [Complete citation 2]
3. [Continue listing all sources]

---
**Research Conducted By**: [Researcher name]
**Date Completed**: [Date]
**Last Updated**: [Date if updated later]

path: research_workflow.js
content: /**
 * Deep Research Workflow
 * A systematic approach to conducting thorough investigations
 */

class DeepResearchFramework {
  constructor(options = {}) {
    this.maxSearches = options.maxSearches || 5;
    this.maxSources = options.maxSources || 10;
    this.validationThreshold = options.validationThreshold || 0.7; // 70% agreement for high confidence
    this.searchDepth = options.searchDepth || 3; // Number of search iterations
    this.sourceDiversity = options.sourceDiversity || true; // Require diverse sources
  }

  /**
   * Execute a complete deep research cycle
   */
  async conductResearch(topic, researchQuestions = []) {
    console.log(`Starting deep research on: ${topic}`);
    
    const researchPlan = await this.createResearchPlan(topic, researchQuestions);
    const findings = await this.executeResearchPhases(researchPlan);
    const report = await this.generateReport(findings, researchPlan);
    
    return {
      topic,
      researchPlan,
      findings,
      report,
      confidence: this.calculateConfidence(findings)
    };
  }

  /**
   * Phase 1: Create research plan
   */
  async createResearchPlan(topic, researchQuestions) {
    console.log("Creating research plan...");
    
    // Define key concepts and search terms
    const searchTerms = await this.identifySearchTerms(topic);
    
    // Prioritize research questions if not provided
    if (researchQuestions.length === 0) {
      researchQuestions = await this.generateResearchQuestions(topic);
    }
    
    return {
      topic,
      researchQuestions,
      searchTerms,
      objectives: [
        "Gather diverse perspectives",
        "Verify claims against authoritative sources",
        "Identify patterns and contradictions",
        "Synthesize findings systematically"
      ]
    };
  }

  /**
   * Phase 2: Execute research phases
   */
  async executeResearchPhases(researchPlan) {
    const findings = {
      phase1: await this.initialInvestigation(researchPlan),
      phase2: await this.deepDive(researchPlan),
      phase3: await this.synthesisAndValidation(researchPlan),
      phase4: await this.reportGeneration(researchPlan)
    };
    
    return findings;
  }

  /**
   * Phase 1: Initial Investigation
   */
  async initialInvestigation(researchPlan) {
    console.log("Phase 1: Initial Investigation");
    
    const results = {
      searchResults: [],
      sourceList: [],
      keyConcepts: [],
      preliminaryFindings: []
    };
    
    // Perform broad searches
    for (const searchTerm of researchPlan.searchTerms) {
      console.log(`Searching for: ${searchTerm}`);
      
      // Simulate web search (in real implementation, this would call web_search tool)
      const searchResult = {
        query: searchTerm,
        sources: this.generateMockSources(searchTerm, 5),
        summary: `Initial search results for "${searchTerm}"`
      };
      
      results.searchResults.push(searchResult);
      results.sourceList.push(...searchResult.sources);
    }
    
    // Extract key concepts
    results.keyConcepts = this.extractKeyConcepts(results.searchResults);
    
    // Form preliminary findings
    results.preliminaryFindings = this.formPreliminaryFindings(results.searchResults);
    
    return results;
  }

  /**
   * Phase 2: Deep Dive
   */
  async deepDive(researchPlan) {
    console.log("Phase 2: Deep Dive Investigation");
    
    const results = {
      detailedContent: [],
      crossReferences: [],
      expertSources: [],
      comparativeAnalysis: []
    };
    
    // For each prioritized source, fetch detailed content
    const prioritizedSources = this.prioritizeSources(researchPlan.phase1.sourceList);
    
    for (const source of prioritizedSources.slice(0, 5)) { // Limit to top 5 sources
      console.log(`Analyzing source: ${source.url}`);
      
      // Simulate content retrieval (in real implementation, this would call web_fetch tool)
      const detailedContent = {
        source: source,
        content: this.generateMockContent(source.url),
        keyPoints: this.extractKeyPoints(this.generateMockContent(source.url)),
        credibility: this.assessCredibility(source)
      };
      
      results.detailedContent.push(detailedContent);
    }
    
    // Perform cross-reference analysis
    results.crossReferences = this.performCrossReference(results.detailedContent);
    
    // Identify expert sources
    results.expertSources = this.identifyExpertSources(results.detailedContent);
    
    // Comparative analysis
    results.comparativeAnalysis = this.comparePerspectives(results.detailedContent);
    
    return results;
  }

  /**
   * Phase 3: Synthesis & Validation
   */
  async synthesisAndValidation(researchPlan) {
    console.log("Phase 3: Synthesis & Validation");
    
    const results = {
      patterns: [],
      contradictions: [],
      verifiedClaims: [],
      biasAssessment: {},
      confidenceLevels: {}
    };
    
    // Identify patterns across sources
    results.patterns = this.identifyPatterns(researchPlan.phase2.detailedContent);
    
    // Identify contradictions
    results.contradictions = this.identifyContradictions(researchPlan.phase2.detailedContent);
    
    // Verify claims against authoritative sources
    results.verifiedClaims = await this.verifyClaims(researchPlan.phase2.detailedContent);
    
    // Assess bias in sources
    results.biasAssessment = this.assessOverallBias(researchPlan.phase2.detailedContent);
    
    // Calculate confidence levels for different findings
    results.confidenceLevels = this.calculateConfidenceLevels(researchPlan.phase2.detailedContent);
    
    return results;
  }

  /**
   * Phase 4: Report Generation
   */
  async reportGeneration(researchPlan) {
    console.log("Phase 4: Report Generation");
    
    const executiveSummary = this.createExecutiveSummary(researchPlan.phase3);
    const detailedFindings = this.organizeDetailedFindings(researchPlan.phase3);
    const sourceEvaluation = this.evaluateSources(researchPlan.phase2.detailedContent);
    const remainingQuestions = this.identifyRemainingQuestions(researchPlan.researchQuestions, researchPlan.phase3.verifiedClaims);
    
    return {
      executiveSummary,
      detailedFindings,
      sourceEvaluation,
      remainingQuestions,
      researchMethodology: researchPlan.objectives
    };
  }

  /**
   * Helper methods (mock implementations)
   */
  
  generateMockSources(searchTerm, count) {
    const mockSources = [];
    for (let i = 0; i < count; i++) {
      mockSources.push({
        url: `https://${searchTerm.replace(/\s+/g, '-')}-${i+1}.com`,
        title: `${searchTerm} - Source ${i+1}`,
        description: `Information about ${searchTerm}`,
        credibility: Math.random(),
        domainAuthority: Math.random(),
        publicationDate: new Date(Date.now() - Math.floor(Math.random() * 365) * 24 * 60 * 60 * 1000)
      });
    }
    return mockSources;
  }

  generateMockContent(url) {
    return `This is mock content for ${url}. It contains detailed information about the research topic with various perspectives and data points.`;
  }

  extractKeyConcepts(searchResults) {
    return ["concept1", "concept2", "concept3"];
  }

  formPreliminaryFindings(searchResults) {
    return ["finding1", "finding2"];
  }

  prioritizeSources(sources) {
    return sources.sort((a, b) => b.credibility - a.credibility);
  }

  extractKeyPoints(content) {
    return ["keypoint1", "keypoint2"];
  }

  assessCredibility(source) {
    return source.credibility || 0.5;
  }

  performCrossReference(detailedContent) {
    return [{ agreement: 0.8, topic: "common topic" }];
  }

  identifyExpertSources(detailedContent) {
    return ["expert source 1", "expert source 2"];
  }

  comparePerspectives(detailedContent) {
    return ["comparison1", "comparison2"];
  }

  identifyPatterns(detailedContent) {
    return ["pattern1", "pattern2"];
  }

  identifyContradictions(detailedContent) {
    return ["contradiction1", "contradiction2"];
  }

  async verifyClaims(detailedContent) {
    return [{ claim: "claim1", verified: true, sources: ["source1"] }];
  }

  assessOverallBias(detailedContent) {
    return { biasLevel: "medium", biasType: "potential" };
  }

  calculateConfidenceLevels(detailedContent) {
    return { finding1: 0.8, finding2: 0.6 };
  }

  createExecutiveSummary(phase3Results) {
    return "This is a mock executive summary of the research findings.";
  }

  organizeDetailedFindings(phase3Results) {
    return [{ topic: "finding1", evidence: "evidence1" }];
  }

  evaluateSources(detailedContent) {
    return { averageCredibility: 0.7, sourceDiversity: "good" };
  }

  identifyRemainingQuestions(researchQuestions, verifiedClaims) {
    return ["remaining question 1", "remaining question 2"];
  }

  identifySearchTerms(topic) {
    return [topic, `${topic} overview`, `${topic} facts`, `${topic} analysis`];
  }

  async generateResearchQuestions(topic) {
    return [`What is ${topic}?`, `Why is ${topic} important?`, `What are the challenges with ${topic}?`];
  }

  calculateConfidence(findings) {
    // Calculate overall confidence based on various factors
    return 0.75; // Mock confidence calculation
  }
}

// Export the framework
module.exports = DeepResearchFramework;

// Example usage:
/*
const DeepResearchFramework = require('./research_workflow.js');
const researcher = new DeepResearchFramework();

async function example() {
  const researchResult = await researcher.conductResearch(
    "Artificial Intelligence in Healthcare", 
    ["How is AI being used in healthcare?", "What are the benefits?", "What are the risks?"]
  );
  
  console.log(researchResult);
}
*/

Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: clean (LOW)