Thank you for your interest in contributing to MOIDVK! This guide will help you get started with contributing to the project.
- Code of Conduct
- Getting Started
- Development Setup
- Contributing Guidelines
- Pull Request Process
- Issue Guidelines
- Documentation
- Testing
- Release Process
We are committed to making participation in our project a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
Examples of behavior that contributes to creating a positive environment include:
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected].
- Bun v1.0+ or Node.js v18+
- Rust v1.70+ (for native components)
- Git for version control
- GitHub account for contributions
# Fork the repository on GitHub
# Clone your fork
git clone https://github.com/YOUR_USERNAME/moidvk.git
cd moidvk
# Add upstream remote
git remote add upstream https://github.com/moikas-code/moidvk.git
# Install dependencies
bun install
# Build native components
bun run build:rust
# Run tests
bun test
# Start development server
bun run dev# Install development dependencies
bun install
# Set up pre-commit hooks
bun run setup:hooks
# Configure environment
cp .env.example .env.local# Install Rust toolchain
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Install additional Rust components
rustup component add clippy rustfmt
# Install Python tools (optional)
pip install ruff black mypy banditInstall recommended extensions:
{
"recommendations": [
"rust-lang.rust-analyzer",
"esbenp.prettier-vscode",
"ms-python.python",
"bradlc.vscode-tailwindcss"
]
}{
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"rust-analyzer.checkOnSave.command": "clippy"
}moidvk/
βββ lib/ # Core library code
β βββ tools/ # Language-specific tools
β βββ rust-core/ # Rust native implementations
β βββ security/ # Security and safety tools
β βββ integration/ # External integrations
β βββ local-ai/ # AI and semantic features
βββ test/ # Test suites
βββ docs/ # Documentation
βββ scripts/ # Build and utility scripts
βββ .github/ # GitHub workflows and templates
βββ examples/ # Usage examples
- Use the bug report template
- Include reproduction steps
- Provide system information
- Include error logs and stack traces
- Use the feature request template
- Explain the use case and motivation
- Provide examples of expected behavior
- Consider implementation complexity
- Follow coding standards
- Include tests for new features
- Update documentation
- Ensure CI passes
- Fix typos and improve clarity
- Add examples and use cases
- Update API documentation
- Translate to other languages
// Use ESLint configuration
// Prefer const over let
const config = {
production: true,
timeout: 30000,
};
// Use descriptive names
function analyzeCodeQuality(sourceCode, options = {}) {
// Implementation
}
// Add JSDoc comments for public APIs
/**
* Analyzes code for quality issues
* @param {string} sourceCode - The source code to analyze
* @param {Object} options - Analysis options
* @returns {Promise<AnalysisResult>} Analysis results
*/
async function analyzeCode(sourceCode, options) {
// Implementation
}// Follow rustfmt formatting
// Use descriptive names
pub fn analyze_code_performance(
source_code: &str,
options: &AnalysisOptions,
) -> Result<PerformanceReport, AnalysisError> {
// Implementation
}
// Add documentation comments
/// Analyzes code for performance issues
///
/// # Arguments
/// * `source_code` - The source code to analyze
/// * `options` - Analysis configuration options
///
/// # Returns
/// A `Result` containing the performance report or an error
pub fn analyze_performance(
source_code: &str,
options: &AnalysisOptions,
) -> Result<PerformanceReport, AnalysisError> {
// Implementation
}# Follow PEP 8 and use Black formatting
def analyze_code_security(
source_code: str,
options: Optional[Dict[str, Any]] = None
) -> SecurityReport:
"""Analyze code for security vulnerabilities.
Args:
source_code: The source code to analyze
options: Optional analysis configuration
Returns:
SecurityReport containing found vulnerabilities
Raises:
AnalysisError: If analysis fails
"""
# ImplementationWe use Conventional Commits format:
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringtest: Adding or updating testschore: Maintenance tasks
feat(tools): add Python type checking tool
Add mypy integration for Python type checking with configurable
strictness levels and error filtering.
Closes #123
fix(security): resolve vulnerability in dependency scanner
Fix path traversal vulnerability in dependency scanning that could
allow access to files outside project directory.
BREAKING CHANGE: Scanner now validates all file paths
feature/description- New featuresfix/description- Bug fixesdocs/description- Documentation updatesrefactor/description- Code refactoringtest/description- Test improvements
- Fork and clone the repository
- Create a feature branch from
main - Make your changes following coding standards
- Add tests for new functionality
- Update documentation as needed
- Run the test suite and ensure all tests pass
- Run linting and fix any issues
- Commit your changes with descriptive messages
- Code follows project style guidelines
- Self-review of code completed
- Tests added for new functionality
- All tests pass locally
- Documentation updated
- No merge conflicts with main branch
- PR description clearly explains changes
## Description
Brief description of changes and motivation.
## Type of Change
- [ ] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as
expected)
- [ ] Documentation update
## Testing
- [ ] Unit tests added/updated
- [ ] Integration tests added/updated
- [ ] Manual testing completed
## Checklist
- [ ] Code follows style guidelines
- [ ] Self-review completed
- [ ] Tests pass locally
- [ ] Documentation updated- Automated checks must pass (CI, linting, tests)
- Code review by at least one maintainer
- Manual testing for significant changes
- Documentation review for user-facing changes
- Final approval and merge by maintainer
Use the bug report template and include:
## Bug Description
Clear description of the bug.
## Steps to Reproduce
1. Step one
2. Step two
3. Step three
## Expected Behavior
What should happen.
## Actual Behavior
What actually happens.
## Environment
- OS: [e.g., Ubuntu 22.04]
- Node.js/Bun version: [e.g., v18.17.0]
- MOIDVK version: [e.g., v1.0.0]
- Rust version: [e.g., 1.70.0]
## Additional Context
Any other relevant information.Use the feature request template:
## Feature Description
Clear description of the proposed feature.
## Use Case
Why is this feature needed? What problem does it solve?
## Proposed Solution
How should this feature work?
## Alternatives Considered
Other approaches you've considered.
## Additional Context
Any other relevant information.bug- Something isn't workingenhancement- New feature or requestdocumentation- Improvements or additions to documentationgood first issue- Good for newcomershelp wanted- Extra attention is neededpriority: high- High priority issuestatus: in progress- Currently being worked on
- Clear and concise writing
- Code examples for all features
- Step-by-step instructions for complex procedures
- Screenshots where helpful
- Version information for compatibility
/**
* Analyzes code for quality issues using ESLint
*
* @param {string} code - Source code to analyze
* @param {Object} options - Analysis options
* @param {boolean} options.production - Use production rules
* @param {string} options.severity - Minimum severity level
* @returns {Promise<AnalysisResult>} Analysis results
*
* @example
* const result = await analyzeCode('const x = 1;', {
* production: true,
* severity: 'warning'
* });
*/- Getting Started - Basic setup and usage
- Tutorials - Step-by-step walkthroughs
- How-to Guides - Specific task instructions
- Reference - Complete API documentation
# Install documentation dependencies
bun install
# Start documentation server
bun run docs:dev
# Build documentation
bun run docs:build
# Check for broken links
bun run docs:checktest/
βββ unit/ # Unit tests
βββ integration/ # Integration tests
βββ e2e/ # End-to-end tests
βββ fixtures/ # Test data and fixtures
βββ helpers/ # Test utilities
import { describe, it, expect } from 'bun:test';
import { analyzeCode } from '../lib/tools/code-analyzer.js';
describe('Code Analyzer', () => {
it('should detect console statements', async () => {
const code = 'console.log("test");';
const result = await analyzeCode(code, { production: true });
expect(result.issues).toHaveLength(1);
expect(result.issues[0].ruleId).toBe('no-console');
});
it('should handle invalid code gracefully', async () => {
const code = 'invalid syntax {';
const result = await analyzeCode(code);
expect(result.error).toBeDefined();
expect(result.error.type).toBe('syntax-error');
});
});import { describe, it, expect, beforeAll, afterAll } from 'bun:test';
import { MoidvkServer } from '../lib/server.js';
describe('MCP Integration', () => {
let server;
beforeAll(async () => {
server = new MoidvkServer({ port: 0 });
await server.start();
});
afterAll(async () => {
await server.stop();
});
it('should handle tool calls via MCP', async () => {
const client = createMCPClient({
command: 'moidvk',
args: ['serve', '--port', server.port],
});
const result = await client.callTool('check_code_practices', {
code: 'const x = 1;',
});
expect(result).toBeDefined();
expect(result.issues).toBeArray();
});
});#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_code_analysis() {
let code = "fn main() { println!(\"test\"); }";
let result = analyze_rust_code(code, &AnalysisOptions::default());
assert!(result.is_ok());
let analysis = result.unwrap();
assert_eq!(analysis.issues.len(), 0);
}
#[test]
fn test_invalid_syntax() {
let code = "invalid rust syntax {";
let result = analyze_rust_code(code, &AnalysisOptions::default());
assert!(result.is_err());
}
}# Run all tests
bun test
# Run specific test file
bun test test/unit/code-analyzer.test.js
# Run tests with coverage
bun test --coverage
# Run Rust tests
cd lib/rust-core && cargo test
# Run integration tests
bun test:integration
# Run end-to-end tests
bun test:e2e- Write tests first (TDD approach preferred)
- Test edge cases and error conditions
- Use descriptive test names that explain what is being tested
- Keep tests isolated and independent
- Mock external dependencies in unit tests
- Maintain high test coverage (aim for >80%)
We follow Semantic Versioning:
- MAJOR version for incompatible API changes
- MINOR version for backwards-compatible functionality
- PATCH version for backwards-compatible bug fixes
- Create release branch from
main - Update version numbers in relevant files
- Update CHANGELOG.md with release notes
- Run full test suite and ensure all tests pass
- Create pull request for release branch
- Review and merge release PR
- Tag release on main branch
- Publish to npm via GitHub Actions
- Create GitHub release with release notes
- Version bumped in
package.json - CHANGELOG.md updated
- Documentation updated
- All tests passing
- Security scan completed
- Performance benchmarks run
- Release notes prepared
For critical bug fixes:
- Create hotfix branch from latest release tag
- Apply minimal fix for the critical issue
- Test thoroughly to ensure fix works
- Create emergency release following abbreviated process
- Backport fix to main branch if needed
We recognize contributors in several ways:
- Contributors list in README.md
- Release notes mention significant contributions
- GitHub achievements and badges
- Special recognition for major contributions
Regular contributors may be invited to become maintainers based on:
- Consistent quality contributions
- Understanding of project goals
- Positive community interaction
- Technical expertise in relevant areas
- GitHub Discussions - General questions and ideas
- Discord - Real-time chat with community
- Stack Overflow - Technical questions
- Email: [email protected]
- GitHub: @moidvk-team
- Discord: #maintainers channel
By contributing to MOIDVK, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing to MOIDVK! Your contributions help make development better for everyone. π