Deep Research Skill
This skill allows you to perform long-running "Deep Research" tasks using Perplexity's sonar-deep-research model without hitting client timeouts.
Installation
Copy this file to .opencode/skills/research/SKILL.md in your project.
Skill Definition
markdown
---
name: research
description: Perform deep research using Perplexity's async API. Handles the long-running "Start -> Poll" process automatically.
---
# Deep Research Skill
Executes a `sonar-deep-research` task which can take 5-10 minutes. Uses the async wrapper to avoid timeouts.
## Usage
/research "Your query"
## Implementation
Task(
subagent_type="general",
description="Deep Research: {{query}}",
prompt="""
You are performing a Deep Research task for the user using Perplexity.
**Goal:** Get the full result for query: "{{query}}"
**Protocol:**
1. **Start:** Call `execute_tool("perplexity.research_start", {"query": "{{query}}"})`.
2. **Get ID:** Extract the `Job ID` from the output.
3. **Poll:**
- Call `execute_tool("perplexity.research_check", {"job_id": "..."})`.
- If status is "processing" or "pending":
- **WAIT:** Run `bash` command `sleep 30` (very important to avoid spamming).
- **RETRY:** Call `research_check` again.
- Repeat this loop until completed.
4. **Finish:**
- When `research_check` returns the final text (not "processing"), that is your result.
- Return the **entire** result text to the user.
- **CRITICAL:** Do not summarize, truncate, or remove citations/URLs. Pass the full content through.
"""
)