Thank you for your interest in contributing to OpenAgent! We welcome contributions from developers of all skill levels.
- Node.js 18+ and npm
- Git
- TypeScript knowledge
- Anthropic API key for testing
# Fork the repository on GitHub
# Clone your fork
git clone https://github.com/YOUR-USERNAME/OpenAgent.git
cd OpenAgent
# Install dependencies
npm install
# Set up environment
cp .env.example .env
# Add your ANTHROPIC_API_KEY to .env
# Build the project
npm run build
# Run in development mode
npm run dev- Check Issues for open tasks
- Look for issues labeled
good first issueorhelp wanted - Propose new features by creating an issue first
# Create and switch to a new branch
git checkout -b feature/your-feature-name
# or
git checkout -b fix/issue-descriptionFollow our coding standards (see below) and make your changes.
# Run tests
npm test
# Build to check for errors
npm run build
# Test the CLI manually
node ./dist/index.js# Commit your changes
git add .
git commit -m "feat: add your feature description"
# Push to your fork
git push origin feature/your-feature-nameThen create a Pull Request on GitHub.
- Use strict TypeScript configuration
- Define proper interfaces and types
- Use meaningful variable and function names
- Add JSDoc comments for public APIs
/**
* Processes user message and returns AI response
* @param message - User input message
* @param options - Optional processing configuration
* @returns Promise resolving to agent response
*/
async function processMessage(message: string, options?: ProcessOptions): Promise<AgentResponse> {
// Implementation
}src/
├── agents/ # AI agent implementations
├── cli/ # Command-line interface
├── core/ # Core functionality (context, memory, validation)
├── mcp/ # MCP client and server integration
├── tools/ # Built-in tools and utilities
├── types/ # TypeScript type definitions
└── utils/ # General utility functions
- Files: PascalCase for classes (
ContextManager.ts), kebab-case for utilities (file-utils.ts) - Classes: PascalCase (
class TokenOptimizer) - Functions: camelCase (
processMessage()) - Constants: UPPER_SNAKE_CASE (
API_ENDPOINTS) - Interfaces: PascalCase with descriptive names (
interface AgentConfig)
try {
const result = await riskyOperation();
return { success: true, data: result };
} catch (error) {
console.error('Operation failed:', error);
return {
success: false,
error: error instanceof Error ? error.message : 'Unknown error'
};
}- Unit tests: Test individual functions and classes
- Integration tests: Test component interactions
- CLI tests: Test command-line interface
import { describe, it, expect, beforeEach } from 'vitest';
import { ContextManager } from '../src/core/context/ContextManager.js';
describe('ContextManager', () => {
let contextManager: ContextManager;
beforeEach(() => {
contextManager = new ContextManager();
});
it('should initialize with empty context', () => {
expect(contextManager.getContext()).toEqual({});
});
it('should update context correctly', async () => {
await contextManager.updateContext('key', 'value');
expect(contextManager.getContext().key).toBe('value');
});
});# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Run tests with coverage
npm run test:coverage- Add JSDoc comments for all public APIs
- Include parameter types and return types
- Provide usage examples for complex functions
- Update README.md if you add new features
- Include configuration examples
- Update the feature list if applicable
Follow Conventional Commits:
# Examples
feat: add MCP server integration
fix: resolve spinner interference issue
docs: update configuration examples
test: add unit tests for TokenOptimizer
refactor: simplify context management logicWhen reporting bugs, please include:
-
Environment Details
- Node.js version
- Operating system
- OpenAgent version
-
Steps to Reproduce
- Clear, step-by-step instructions
- Input that caused the issue
-
Expected vs Actual Behavior
- What should happen
- What actually happened
-
Additional Context
- Error messages or logs
- Screenshots if relevant
When requesting features:
- Use Case: Describe the problem you're trying to solve
- Proposed Solution: Your ideas for implementation
- Alternatives: Other approaches you've considered
- Impact: Who would benefit from this feature
- Functionality: Does the code work as intended?
- Code Quality: Is it readable and maintainable?
- Performance: Are there any performance concerns?
- Security: Are there any security implications?
- Tests: Are there adequate tests for the changes?
- Code follows our style guidelines
- All tests pass
- Documentation is updated if needed
- No breaking changes (or properly documented)
- Error handling is appropriate
- Performance impact is considered
- MCP Server Integration: Add support for new MCP servers
- Model Support: Integrate additional AI models
- Testing: Improve test coverage
- Documentation: Enhance user guides and API docs
- Performance Optimization: Token usage and response time improvements
- Error Handling: Better error messages and recovery
- CLI Interface: Enhanced user experience
- Memory System: Advanced learning and context management
- Validation Engine: Code quality and security checks
- Discussions: Use GitHub Discussions for questions
- Issues: Report bugs and request features in Issues
By contributing to OpenAgent, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing to OpenAgent! 🙏