Contributing to XendCode
February 10, 2026 ยท View on GitHub
Thank you for your interest in contributing to XendCode! This document provides guidelines and instructions for contributing.
๐ฏ Project Vision
XendCode aims to democratize AI-assisted coding by making it affordable for everyone. Our core principles:
- Cost-First: Every feature should consider cost implications
- Multi-Model: Support diverse AI providers
- Transparency: Users should always know what they're using
- Quality: Free doesn't mean low quality
๐ Getting Started
Development Setup
- Fork and Clone
git clone https://github.com/yourusername/xendcode.git
cd xendcode
- Install Dependencies
npm install
- Build Extension
npm run compile
- Run in Development
- Open project in VSCode
- Press
F5to launch Extension Development Host - Test your changes
Project Structure
xendcode/
โโโ src/
โ โโโ extension.ts # Entry point
โ โโโ core/ # Core managers
โ โ โโโ ModelManager.ts # Model selection logic
โ โ โโโ TokenManager.ts # Token tracking
โ โ โโโ ContextManager.ts # Context optimization
โ โโโ models/ # AI provider implementations
โ โ โโโ OpenAIProvider.ts
โ โ โโโ GeminiProvider.ts
โ โ โโโ ...
โ โโโ providers/ # UI providers
โ โ โโโ ChatProvider.ts
โ โ โโโ ...
โ โโโ types/ # TypeScript types
โโโ package.json # Extension manifest
โโโ README.md
๐ค How to Contribute
1. Adding a New Model Provider
Want to add support for a new AI model? Great! Here's how:
- Create Provider File
// src/models/YourModelProvider.ts
import { IModelProvider, ModelConfig, ... } from '../types';
export class YourModelProvider implements IModelProvider {
// Implement all interface methods
}
- Register in ModelManager
// src/core/ModelManager.ts
import { YourModelProvider } from '../models/YourModelProvider';
// In initializeProviders()
providers.push(
new YourModelProvider(config.get('models.yourmodel.apiKey', ''))
);
- Add Configuration
// package.json - in contributes.configuration.properties
"xendcode.models.yourmodel.apiKey": {
"type": "string",
"default": "",
"description": "Your Model API Key"
}
- Update Documentation
- Add to README.md
- Add to SETUP_GUIDE.md
- Document free tier details
2. Improving Token Optimization
Token usage is critical for cost. Improvements welcome in:
src/core/ContextManager.ts- Better context selectionsrc/core/TokenManager.ts- More accurate tracking- Compression techniques
- Semantic deduplication
3. Enhancing Model Selection
Better model routing = better cost/quality balance:
src/core/ModelManager.ts- Selection algorithms- Task type detection
- Quality scoring
- Cost prediction
4. UI Improvements
- Chat interface enhancements
- Better dashboard visualizations
- Usage predictions
- Settings UI
๐ Pull Request Process
- Create Feature Branch
git checkout -b feature/your-feature-name
- Make Changes
- Write clean, documented code
- Follow existing code style
- Add TypeScript types
- Test Thoroughly
- Test in Extension Development Host
- Verify no regressions
- Test with multiple models
- Commit with Clear Messages
git commit -m "Add: Support for NewModel provider"
git commit -m "Fix: Token counting for streaming responses"
git commit -m "Improve: Context selection algorithm"
- Push and Create PR
git push origin feature/your-feature-name
- Create PR on GitHub
- Fill out PR template
- Link related issues
- Code Review
- Address feedback
- Update as needed
- Maintain clean commit history
๐จ Code Style
TypeScript
// Use clear, descriptive names
async function selectOptimalModel(task: ModelCapability): Promise<IModelProvider> {
// Implementation
}
// Add JSDoc comments for public APIs
/**
* Records token usage for a model
* @param model - Model name
* @param tokensInput - Input tokens used
* @param tokensOutput - Output tokens generated
* @param cost - Estimated cost in USD
*/
async recordUsage(model: string, tokensInput: number, ...): Promise<void> {
// Implementation
}
// Use interfaces for contracts
interface IModelProvider {
getName(): string;
complete(messages: ChatMessage[]): Promise<CompletionResponse>;
}
// Prefer async/await over promises
async function fetchData() {
try {
const result = await api.call();
return result;
} catch (error) {
console.error('Error:', error);
throw error;
}
}
File Organization
- One class per file
- Group related functionality
- Keep files under 500 lines
- Use meaningful folder structure
๐ Reporting Bugs
Before Submitting
- Check existing issues
- Try latest version
- Verify it's not a configuration issue
Bug Report Template
**Description**
Clear description of the bug
**To Reproduce**
1. Step 1
2. Step 2
3. See error
**Expected Behavior**
What should happen
**Actual Behavior**
What actually happens
**Environment**
- VSCode Version:
- XendCode Version:
- OS:
- Models Configured:
**Logs**
Paste relevant logs from VSCode Developer Console
๐ก Feature Requests
We love new ideas! When requesting features:
- Check Roadmap: Might already be planned
- Describe Use Case: Why is this needed?
- Cost Implications: How does it affect costs?
- Alternative Solutions: What else did you consider?
Feature Request Template
**Feature Description**
What feature do you want?
**Use Case**
Why do you need this?
**Cost Impact**
How does this affect token usage/costs?
**Proposed Implementation**
Any ideas on how to implement?
**Alternatives**
What alternatives did you consider?
๐งช Testing
Manual Testing Checklist
- Extension activates without errors
- Chat interface works
- Model selection works correctly
- Token tracking is accurate
- Usage dashboard displays correctly
- Settings are respected
- Error handling works
Testing with Multiple Models
Please test with at least 2 different models:
- One free tier (Gemini recommended)
- One paid tier (if available)
๐ Documentation
When adding features, update:
README.md- User-facing featuresSETUP_GUIDE.md- Configuration steps- Code comments - Implementation details
CHANGELOG.md- Version changes
๐ Recognition
Contributors will be:
- Listed in README.md
- Mentioned in release notes
- Given credit in documentation
โ Questions?
- Open a GitHub Discussion
- Comment on related issues
- Reach out to maintainers
๐ Code of Conduct
Our Standards
- Be respectful and inclusive
- Welcome newcomers
- Accept constructive criticism
- Focus on what's best for the community
- Show empathy
Unacceptable Behavior
- Harassment or discrimination
- Trolling or insulting comments
- Personal or political attacks
- Publishing others' private information
๐ License
By contributing, you agree that your contributions will be licensed under the MIT License.
Thank you for making AI coding assistance affordable for everyone! ๐
Every contribution, no matter how small, makes a difference.