Contributing
Guidelines for contributing to MMPS.
Code of Conduct
Be respectful, inclusive, and constructive in all interactions.
Getting Started
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR-USERNAME/mmps.git - Create a feature branch:
git checkout -b feature/your-feature - Install dependencies:
npm install - Make your changes
- Test:
npm test - Push to your fork and submit a pull request
Development Workflow
Code Quality
bash
# Format code
npm run format
# Lint code
npm run lint
# Fix linting issues
npm run lint:fix
# Run tests
npm test
# Watch tests
npm test:watch
# Build TypeScript
npm run buildCommit Messages
Use imperative mood:
bash
✅ git commit -m "Add reminder feature to chatbot"
❌ git commit -m "Added reminders"Branching Strategy
feature/...- New featuresfix/...- Bug fixesdocs/...- Documentationrefactor/...- Code refactoring
Code Standards
See Code Style Guide for details.
Key points:
- Use
type, neverinterface - Mark properties as
readonly - Use named exports only
- Always use async/await
- No JSDoc comments
Adding a New Feature
- Create a feature branch
- Write tests first (TDD)
- Implement feature
- Ensure all tests pass:
npm test - Update documentation
- Submit PR with description
Adding a New Bot
Creating a new bot:
- Copy existing bot structure to
features/{newbot}/ - Create required files:
{bot}.init.ts- Initialization{bot}.controller.ts- Telegram handlers{bot}.service.ts- Business logic{bot}.config.ts- Configurationtypes.ts- Type definitionsindex.ts- Barrel exports
- Add bot config to
main.ts - Create corresponding MongoDB database entry
- Add to documentation
Testing
Write tests for new features:
typescript
describe('MyFeature', () => {
test('should do something', () => {
expect(myFunction()).toEqual(expected);
});
test.each([
{ input: 1, expected: true },
{ input: 2, expected: false },
])('should handle $input', ({ input, expected }) => {
expect(myFunction(input)).toEqual(expected);
});
});Run tests:
bash
npm test # Run all
npm test:watch # Watch mode
npm test -- <file> # Specific fileDocumentation
Update docs when:
- Adding features
- Changing architecture
- Modifying configuration
- Adding environment variables
Documentation lives in /docs with VitePress.
Pull Request Process
- Update documentation
- Add tests for new features
- Ensure all tests pass
- Run
npm run lint:fixandnpm run format - Write clear PR description
- Link related issues
GitHub AI Features
PR Code Review
Add the review label to any pull request to get AI-powered code analysis.
The bot will analyze your code and provide:
- Code quality assessment
- Potential issues and bugs
- Performance suggestions
- Best practices recommendations
Issue Implementation
Add the implement label to any issue to generate a pull request with code.
The bot will:
- Analyze the issue requirements
- Generate implementation code
- Open a new pull request with the code
- Reference the original issue
Both features are triggered by labels and configured in .github/workflows/claude.yml.
Questions?
- Open an issue for bugs
- Discuss in PR comments
- Check existing documentation
- Review similar code in codebase