🤖 AI-Assisted Development with Claude
GPT Researcher includes a comprehensive skill file that enables AI assistants like Claude to understand, use, and extend the codebase effectively. This guide explains how to leverage Claude Code for contributing to GPT Researcher.
Overview​
We maintain a .claude/skills/ directory containing detailed documentation that Claude automatically discovers and uses when working with this repository. This enables:
- Faster onboarding - Claude understands the architecture instantly
- Consistent contributions - Follows established patterns
- Fewer errors - Knows common gotchas and best practices
- End-to-end features - Can implement complete features following the 8-step pattern
The Skills Directory​
.claude/
└── skills/
├── SKILL.md # Comprehensive development guide (~1,500 lines)
└── REFERENCE.md # Quick lookup for config, API, WebSocket events
What's in SKILL.md​
| Section | Description |
|---|---|
| Architecture Deep Dive | Full system diagram with all layers and components |
| Core Components | Method signatures for GPTResearcher, ResearchConductor, etc. |
| End-to-End Flow | Complete code paths from request to report |
| Data Flow | What gets passed between components |
| Prompt System | Real prompt examples from prompts.py |
| Retriever System | All 14 retrievers, how to add new ones |
| MCP Integration | Strategy options, configuration, processing logic |
| Deep Research | Recursive exploration configuration |
| Multi-Agent System | LangGraph-based 8-agent workflow |
| Image Generation Case Study | Complete real implementation as reference |
| 8-Step Feature Pattern | How to add new features |
| Advanced Usage | Callbacks, LangChain, vector stores |
| Error Handling | Graceful degradation patterns |
| Testing Guide | pytest setup and examples |
| Critical Gotchas | Common mistakes to avoid |
What's in REFERENCE.md​
- All environment variables
- REST API endpoints
- WebSocket message types
- Python client parameters
Using Claude Code​
Installation​
- Install Claude Code (VS Code extension or CLI)
- Open the GPT Researcher repository
- Claude automatically discovers the skills in
.claude/skills/
Example Prompts​
Understanding the codebase:
How does the research flow work from query to report?
Adding a feature:
I want to add a feature that generates audio summaries of reports.
Follow the 8-step pattern from the skills file.
Debugging:
Why might images not be appearing in the report? Check the image generation flow.
Extending functionality:
Add a new retriever for Wikipedia. Follow the retriever pattern in the skills.
What Claude Can Do​
With the skills loaded, Claude can:
- Explain any part of the codebase - Architecture, data flow, component interactions
- Implement features end-to-end - Config → Provider → Skill → Agent → Prompts → Frontend
- Debug issues - Understands common gotchas and error patterns
- Write tests - Knows the testing patterns and pytest setup
- Add retrievers - Follows the exact pattern for new search engines
- Modify prompts - Understands the PromptFamily system
- Extend the API - Knows FastAPI patterns and WebSocket events
Contributing with Claude​
Before You Start​
- Fork and clone the repository
- Install in editable mode:
pip install -e . - Set up your
.envfile with required API keys - Open in an editor with Claude Code
Contribution Workflow​
- Describe your feature/fix to Claude with context
- Let Claude implement following the established patterns
- Review the changes - Claude will explain what it did
- Test thoroughly -
python -m pytest tests/ - Submit PR with clear description
Example: Adding a New Feature​
I want to add a feature that allows users to specify a custom
writing style for reports (e.g., "academic", "blog post", "executive summary").
This should:
1. Be configurable via environment variable
2. Affect the report generation prompt
3. Be optional with a sensible default
Please implement following the 8-step pattern.
Claude will:
- Add
REPORT_STYLEto config defaults - Add type to
BaseConfig - Update the prompt in
prompts.py - Show you exactly what changed
- Explain any gotchas (like lowercase config access)
Updating the Skills​
If you add significant features or change the architecture:
- Update
.claude/skills/SKILL.mdwith the new patterns - Add any new config vars to
.claude/skills/REFERENCE.md - Include your feature as a case study if it's a good example
Skills File Best Practices​
- Keep code examples real (from actual implementation)
- Include both "what" and "why"
- Document gotchas prominently
- Update data flow diagrams when adding components
- Add new features to the "Supported Options" sections
Why This Matters​
AI-assisted development is becoming standard practice. By maintaining high-quality skills files:
- New contributors can onboard in minutes instead of hours
- Experienced contributors can work faster with AI assistance
- Code quality stays consistent across contributions
- Documentation stays up-to-date as a side effect
The skills file is essentially a "brain dump" of everything an expert developer knows about GPT Researcher, made available to AI assistants.