Agent skill
perplexity-sonar
Use Perplexity Sonar API for real-time, citation-backed answers. Ideal for up-to-date information and quick synthesis. Requires PERPLEXITY_API_KEY
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/design/perplexity-sonar
SKILL.md
Perplexity Sonar Skill
This skill utilizes the Perplexity Sonar API to provide synthesized answers backed by real-time web sources. It uses the OpenAI Python library for compatibility.
Setup
-
Dependencies:
bashpip install openai python-dotenv -
API Key Configuration: The skill requires the
PERPLEXITY_API_KEY. Ensure it is set in a.envfile in the project root.bash# If the script fails due to a missing key, run the following: echo "It seems the Perplexity API key is not set up." read -p "Enter your Perplexity API key: " PPLX_KEY echo "PERPLEXITY_API_KEY=$PPLX_KEY" >> .env # Ensure .env is ignored by git if [ -f .gitignore ] && ! grep -q ".env" .gitignore; then echo ".env" >> .gitignore; fi echo "API key saved to .env."
Usage
Use the scripts/ask.py script to query the Sonar API.
Command
python3 scripts/ask.py --prompt "<your_research_question>" [--model <model_name>]
Parameters
--prompt(Required): The research question.--model(Optional): Defaults tosonar-medium-online. Usesonar-large-onlinefor comprehensive analysis.
Example
python3 scripts/ask.py --prompt "What are the latest developments in the EV market in Q4 2025?" --model sonar-large-online
Output
The script outputs the synthesized answer directly to stdout, with citations integrated by the Perplexity model.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?