Thank you for your interest in contributing! This document provides guidelines and instructions for contributing to the project.
- Code of Conduct
- Getting Started
- Development Setup
- Making Changes
- Testing
- Submitting Changes
- Style Guidelines
This project adheres to a Code of Conduct that all contributors are expected to follow:
- Be respectful and inclusive
- Welcome newcomers
- Focus on constructive feedback
- Respect differing viewpoints and experiences
- Node.js 20.x or higher
- npm 9.x or higher
- Git
- TypeScript knowledge
- Familiarity with MCP and UTCP
-
Fork the repository
# Click "Fork" on GitHub -
Clone your fork
git clone https://github.com/your-username/utcp-docs-mcp-server.git cd utcp-docs-mcp-server -
Install dependencies
npm install
-
Build the project
npm run build
-
Run tests
npm test -
Set up development environment
# Link for local testing npm link # Run in watch mode npm run watch
Use descriptive branch names:
feature/add-semantic-search- New featuresfix/validation-error- Bug fixesdocs/update-readme- Documentationrefactor/improve-generator- Code improvementstest/add-converter-tests- Test additions
Follow conventional commits:
type(scope): description
[optional body]
[optional footer]
Types:
feat: New featurefix: Bug fixdocs: Documentationstyle: Code style (formatting)refactor: Code refactoringtest: Testschore: Maintenance
Examples:
git commit -m "feat(validator): add support for SSE protocol validation"
git commit -m "fix(converter): handle OpenAPI path parameters correctly"
git commit -m "docs(readme): add troubleshooting section"# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Run specific test file
npm test tests/services/validator.test.ts
# Generate coverage report
npm run test:coverage- Create test files in
tests/directory matching source structure - Name test files with
.test.tssuffix - Use descriptive test names
- Cover edge cases
Example:
import { describe, it, expect } from 'vitest';
import { YourService } from '../src/services/your-service.js';
describe('YourService', () => {
describe('methodName', () => {
it('should handle valid input', () => {
const service = new YourService();
const result = service.methodName('valid input');
expect(result).toBe('expected output');
});
it('should throw error on invalid input', () => {
const service = new YourService();
expect(() => service.methodName('')).toThrow();
});
});
});-
Update your fork
git remote add upstream https://github.com/original/utcp-docs-mcp-server.git git fetch upstream git rebase upstream/main
-
Make your changes
git checkout -b feature/your-feature # Make changes git add . git commit -m "feat: your feature description"
-
Run tests
npm test npm run build -
Push changes
git push origin feature/your-feature
-
Create Pull Request
- Go to GitHub
- Click "New Pull Request"
- Fill in the template
- Link related issues
## Description
Brief description of changes
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
## Testing
- [ ] Tests pass locally
- [ ] Added new tests
- [ ] Updated existing tests
## Checklist
- [ ] Code follows style guidelines
- [ ] Self-review completed
- [ ] Documentation updated
- [ ] No new warnings
- [ ] Tests added/updated
- [ ] Changelog updated// Use explicit types
function processData(input: string): ProcessedData {
// ...
}
// Use interfaces for objects
interface ToolConfig {
name: string;
protocol: Protocol;
}
// Use enums for constants
enum Protocol {
HTTP = 'http',
CLI = 'cli',
MCP = 'mcp',
}
// Document complex functions
/**
* Validates a UTCP manual against the specification
* @param manual - The UTCP manual to validate
* @returns Validation result with errors
*/
function validate(manual: UtcpManual): ValidationResult {
// ...
}- One class per file
- Group related functions
- Use meaningful names
- Keep functions small (< 50 lines)
- Extract complex logic
// Good: Clear, explains why
// Convert {param} to ${param} for UTCP variable syntax
const utcpPath = path.replace(/\{([^}]+)\}/g, '${$1}');
// Bad: States obvious
// Replace text
const utcpPath = path.replace(/\{([^}]+)\}/g, '${$1}');// Good: Specific errors with context
if (!manual.utcp_version) {
throw new Error('Missing required field: utcp_version');
}
// Bad: Generic errors
if (!manual.utcp_version) {
throw new Error('Invalid manual');
}- Semantic search with embeddings
- More protocol support (WebSocket, gRPC)
- GraphQL to UTCP converter
- Enhanced validation rules
- Performance optimizations
- Web UI for manual builder
- VS Code extension
- More example manuals
- Integration tests
- Documentation improvements
Look for issues labeled good-first-issue on GitHub. These are:
- Well-documented
- Relatively simple
- Good for learning the codebase
- 💬 GitHub Discussions
- 📧 Email: maintainers@example.com
- 💭 Comment on relevant issues
Contributors will be:
- Listed in CONTRIBUTORS.md
- Mentioned in release notes
- Acknowledged in README
Thank you for contributing! 🙏