Thank you for your interest in contributing to AI Blog Automation! This document provides guidelines and information for contributors.
- Code of Conduct
- How Can I Contribute?
- Development Setup
- Pull Request Process
- Reporting Bugs
- Suggesting Enhancements
- Code Style Guidelines
- Testing Guidelines
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code.
- Use welcoming and inclusive language
- Be respectful of differing viewpoints and experiences
- Gracefully accept constructive criticism
- Focus on what is best for the community
- Show empathy towards other community members
Before creating bug reports, please check the issue list as you might find out that you don't need to create one. When you are creating a bug report, please include as many details as possible:
- Use a clear and descriptive title
- Describe the exact steps which reproduce the problem
- Provide specific examples to demonstrate the steps
- Describe the behavior you observed after following the steps
- Explain which behavior you expected to see instead and why
- Include details about your configuration and environment
If you have a suggestion for a new feature or enhancement, please:
- Use a clear and descriptive title
- Provide a step-by-step description of the suggested enhancement
- Provide specific examples to demonstrate the steps
- Describe the current behavior and explain which behavior you expected to see instead
- Fork the repo and create your branch from
main - If you've added code that should be tested, add tests
- If you've changed APIs, update the documentation
- Ensure the test suite passes
- Make sure your code lints
- Issue that pull request!
- Node.js 18+
- npm or yarn
- Git
-
Fork and Clone
git clone https://github.com/yourusername/ai-blog-automation.git cd ai-blog-automation -
Install Dependencies
npm install
-
Environment Setup
cp env.example .env # Edit .env with your test credentials -
Run Tests
npm run test-gemini npm run test-prompts npm run test-auto
-
Start Development Server
npm run dev
- Update the README.md with details of changes if applicable
- Update the CHANGELOG.md with a note describing your changes
- The PR will be merged once you have the sign-off of at least one maintainer
- Title: Use conventional commit format (e.g.,
feat: add new AI model support) - Description: Clearly describe what the PR does and why
- Tests: Include tests for new functionality
- Documentation: Update relevant documentation
- Breaking Changes: Clearly mark any breaking changes
- Check if the bug has already been reported
- Check if the bug has been fixed in the latest version
- Try to reproduce the bug with the latest code
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Environment:**
- OS: [e.g. macOS, Windows, Linux]
- Node.js Version: [e.g. 18.0.0]
- npm Version: [e.g. 9.0.0]
**Additional context**
Add any other context about the problem here.**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is.
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.- Use ES6+ features where appropriate
- Follow Airbnb JavaScript Style Guide
- Use async/await instead of promises when possible
- Add JSDoc comments for functions and classes
- Use meaningful variable names
/**
* Generates blog content using Gemini AI
* @param {string} topic - The topic to generate content about
* @returns {Promise<string>} Generated blog content
*/
async function generateBlogContent(topic) {
try {
const model = genAI.getGenerativeModel({ model: "gemini-2.5-flash" });
const result = await model.generateContent(topic);
return result.response.text();
} catch (error) {
console.error('Error generating content:', error);
throw new Error('Failed to generate blog content');
}
}- Use kebab-case for file names:
test-gemini.js - Use PascalCase for classes:
BlogGenerator - Use camelCase for functions and variables:
generateBlog
- Write tests for all new functionality
- Use descriptive test names
- Test both success and error cases
- Mock external dependencies
describe('Blog Generation', () => {
it('should generate blog content successfully', async () => {
const content = await generateBlogContent('AI in Healthcare');
expect(content).toBeDefined();
expect(content.length).toBeGreaterThan(100);
});
it('should handle API errors gracefully', async () => {
// Mock API error
jest.spyOn(genAI, 'getGenerativeModel').mockImplementation(() => {
throw new Error('API Error');
});
await expect(generateBlogContent('test')).rejects.toThrow('Failed to generate blog content');
});
});# Run all tests
npm test
# Run specific test file
npm run test-gemini
# Run tests with coverage
npm run test:coverage- Add JSDoc comments for all public functions
- Include examples in comments
- Document complex algorithms
- Explain business logic
- Update README.md for new features
- Add usage examples
- Update configuration options
- Include troubleshooting steps
We use Conventional Commits for commit messages:
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
- feat: A new feature
- fix: A bug fix
- docs: Documentation only changes
- style: Changes that do not affect the meaning of the code
- refactor: A code change that neither fixes a bug nor adds a feature
- perf: A code change that improves performance
- test: Adding missing tests or correcting existing tests
- chore: Changes to the build process or auxiliary tools
feat: add support for multiple AI models
fix: resolve WordPress authentication issue
docs: update deployment instructions
test: add unit tests for blog generation
- Add support for more AI models (OpenAI, Claude, etc.)
- Implement content templates and themes
- Add social media auto-posting
- Create analytics dashboard
- Add multi-language support
- Improve error handling and logging
- Add content scheduling calendar
- Implement A/B testing for content optimization
- Add bulk content generation
- Create WordPress plugin integration
- Add more content types
- Improve documentation
- Add more test coverage
- Performance optimizations
- UI/UX improvements
If you need help with contributing:
- Issues: Create an issue with the
help wantedlabel - Discussions: Use GitHub Discussions for questions
- Documentation: Check the wiki and existing documentation
- Community: Join our community channels
Contributors will be recognized in:
- README.md contributors section
- CHANGELOG.md for significant contributions
- GitHub contributors graph
- Release notes
Thank you for contributing to AI Blog Automation! 🚀