Home / Skills / davila7/claude-code-templates

perplexity

Web search and research using Perplexity AI. Use when user says "search", "find", "look up", "ask", "research", or "what's the latest" for generic queries. NOT for library/framework docs (use Context7) or workspace questions.

skillLicense: MIT Source: davila7/claude-code-templates

Install

Copy this folder into your Claude Code project (needs Node.js):

npx degit davila7/claude-code-templates/cli-tool/components/skills/ai-research/perplexity .claude/skills/perplexity

Or install it for every project:

npx degit davila7/claude-code-templates/cli-tool/components/skills/ai-research/perplexity ~/.claude/skills/perplexity

File content

Made by its original authors and shared under MIT. We show it unchanged, with credit and a link to the source. Source β†—

---
name: perplexity
description: Web search and research using Perplexity AI. Use when user says "search", "find", "look up", "ask", "research", or "what's the latest" for generic queries. NOT for library/framework docs (use Context7) or workspace questions.
---

# Perplexity Tools

Use ONLY when user says "search", "find", "look up", "ask", "research", or "what's the latest" for generic queries. NOT for library/framework docs (use Context7), gt CLI (use Graphite MCP), or workspace questions (use Nx MCP).

## Quick Reference

**Which Perplexity tool?**
- Need search results/URLs? β†’ **Perplexity Search**
- Need conversational answer? β†’ **Perplexity Ask**
- Need deep research? β†’ **Researcher agent** (`/research <topic>`)

**NOT Perplexity - use these instead:**
- Library/framework docs β†’ **Context7 MCP**
- Graphite `gt` CLI β†’ **Graphite MCP**
- THIS workspace β†’ **Nx MCP**
- Specific URL β†’ **URL Crawler**

## Perplexity Search

**When to use:**
- Generic searches, finding resources
- Current best practices, recent information
- Tutorial/blog post discovery
- User says "search for...", "find...", "look up..."

**Default parameters (ALWAYS USE):**
```typescript
mcp__perplexity__perplexity_search({
  query: "your search query",
  max_results: 3,           // Default is 10 - too many!
  max_tokens_per_page: 512  // Reduce per-result content
})
```

**When to increase limits:**
Only if:
- User explicitly needs comprehensive results
- Initial search found nothing useful
- Complex topic needs multiple sources

```typescript
// Increased limits (use sparingly)
mcp__perplexity__perplexity_search({
  query: "complex topic",
  max_results: 5,
  max_tokens_per_page: 1024
})
```

## Perplexity Ask

**When to use:**
- Need conversational explanation, not search results
- Synthesize information from web
- Explain concepts with current context

**Usage:**
```typescript
mcp__perplexity__perplexity_ask({
  messages: [
    {
      role: "user",
      content: "Explain how postgres advisory locks work"
    }
  ]
})
```

**NOT for:**
- Library documentation (use Context7)
- Deep multi-source research (use researcher agent)

## Prohibited Tool

**NEVER use:** `mcp__perplexity__perplexity_research`

**Use instead:** Researcher agent (`/research <topic>`)
- Token cost: 30-50k tokens
- Provides multi-source synthesis with citations
- Use sparingly for complex questions only

## Tool Selection Chain

**Priority order:**
1. **Context7 MCP** - Library/framework docs
2. **Graphite MCP** - Any `gt` CLI mention
3. **Nx MCP** - THIS workspace questions
4. **Perplexity Search** - Generic searches
5. **Perplexity Ask** - Conversational answers
6. **Researcher agent** - Deep multi-source research
7. **WebSearch** - Last resort (after Perplexity exhausted)

## Examples

**βœ… CORRECT - Use Perplexity Search:**
- "Find postgres migration best practices"
- "Search for React testing tutorials"
- "Look up latest trends in microservices"

**βœ… CORRECT - Use Perplexity Ask:**
- "Explain how postgres advisory locks work"
- "What are the trade-offs of microservices?"

**❌ WRONG - Use Context7 instead:**
- "Search for React hooks documentation" β†’ Context7 MCP
- "Find Next.js routing docs" β†’ Context7 MCP
- "Look up Temporal workflow API" β†’ Context7 MCP

**❌ WRONG - Use Graphite MCP instead:**
- "Search for gt stack commands" β†’ Graphite MCP
- "Find gt branch workflow" β†’ Graphite MCP

**❌ WRONG - Use Nx MCP instead:**
- "Search for build config" (in THIS workspace) β†’ Nx MCP
- "Find project dependencies" (in THIS workspace) β†’ Nx MCP

## Key Points

- **Default to limited results** - avoid context bloat
- **Library docs = Context7** - ALWAYS try Context7 first
- **"gt" = Graphite MCP** - ANY "gt" mention uses Graphite
- **Deep research = /research** - NOT perplexity_research tool
- **Fallback chain** - Search β†’ Ask β†’ WebSearch (last resort)