Thank you for your interest in contributing to DevFlow! This document provides guidelines and information for contributors.
By participating in this project, you agree to abide by our Code of Conduct. Please read it before contributing.
Before creating an issue:
- Search existing issues to avoid duplicates
- Use a clear, descriptive title
- Provide detailed steps to reproduce
- Include system information (OS, Rust version, etc.)
- Add relevant labels
We welcome feature suggestions! Please:
- Check if the feature already exists or is planned
- Open an issue with the "enhancement" label
- Describe the problem you're trying to solve
- Explain your proposed solution
- Consider implementation complexity
- Rust 1.70 or later
- Git
- Basic understanding of async Rust
- Familiarity with CLI development
- Fork the repository
- Clone your fork:
git clone https://github.com/yourusername/devflow.git cd devflow - Create a new branch:
git checkout -b feature/your-feature-name
- Install dependencies and build:
cargo build
- Follow Rust conventions and idioms
- Use
cargo fmtto format code - Run
cargo clippyand fix warnings - Add documentation for public APIs
- Write tests for new functionality
# Run all tests
cargo test
# Run with coverage
cargo tarpaulin --out Html
# Test specific module
cargo test ai::testsFollow conventional commits format:
feat:new featuresfix:bug fixesdocs:documentation changesstyle:code style changesrefactor:code refactoringtest:test additions/changeschore:maintenance tasks
Example:
feat(ai): add support for Claude API provider
- Implement ClaudeProvider struct
- Add async trait implementation
- Update configuration to support Claude
- Add tests for Claude integration
Closes #123
- Ensure all tests pass
- Update documentation if needed
- Add/update tests for your changes
- Ensure code follows style guidelines
- Create a clear PR description
- Link related issues
- Request review from maintainers
devflow/
├── src/
│ ├── main.rs # Entry point
│ ├── cli/ # CLI interface
│ │ ├── mod.rs
│ │ └── commands/ # Command implementations
│ ├── ai/ # AI provider integrations
│ │ ├── mod.rs
│ │ ├── openai.rs
│ │ ├── claude.rs
│ │ └── ollama.rs
│ ├── templates/ # Template system
│ ├── generators/ # Code generators
│ ├── config/ # Configuration management
│ └── utils/ # Utility functions
├── templates/ # Built-in templates
├── tests/ # Integration tests
├── docs/ # Documentation
└── examples/ # Usage examples
- 🐛 Bug fixes
- 📚 Documentation improvements
- 🧪 Test coverage improvements
- 🔧 Performance optimizations
- 🎨 New project templates
- 🌐 Additional language support
- 🔌 New AI provider integrations
- ⚙️ Configuration enhancements
- 🎯 Feature enhancements
- 🖥️ UI improvements
- 📦 Package management
- 🚀 Performance monitoring
To add a new project template:
-
Create template directory:
mkdir templates/my-template
-
Create
template.toml:[metadata] name = "my-template" description = "My awesome template" version = "1.0.0" author = "Your Name" tech_stack = ["React", "Node.js"] [dependencies] runtime = { react = "^18.0.0" } development = { "@types/react" = "^18.0.0" } system = ["nodejs", "npm"] [scripts] dev = "npm run dev" build = "npm run build" test = "npm test"
-
Add template files in
files/directory -
Use variables like
{{ project_name }}for customization -
Add tests in
tests/templates/ -
Update documentation
To add a new AI provider:
-
Create provider module:
// src/ai/myprovider.rs use super::{AIProvider, AIResponse}; pub struct MyProvider { // provider fields } #[async_trait::async_trait] impl AIProvider for MyProvider { async fn generate_project_config(&self, config: &ProjectConfig) -> Result<AIResponse> { // implementation } // ... other methods }
-
Update
src/ai/mod.rs:pub mod myprovider; pub enum AIProviderEnum { // ... existing providers MyProvider(myprovider::MyProvider), }
-
Add configuration support
-
Add tests
-
Update documentation
- Test individual functions and modules
- Mock external dependencies
- Use descriptive test names
- Follow AAA pattern (Arrange, Act, Assert)
- Test complete workflows
- Use temporary directories for file operations
- Clean up resources after tests
- Test error conditions
#[cfg(test)]
mod tests {
use super::*;
use tempfile::TempDir;
#[tokio::test]
async fn test_project_generation() {
// Arrange
let temp_dir = TempDir::new().unwrap();
let config = ProjectConfig {
name: "test-project".to_string(),
// ... other fields
};
// Act
let result = generate_project(&config, temp_dir.path()).await;
// Assert
assert!(result.is_ok());
assert!(temp_dir.path().join("package.json").exists());
}
}- Document all public APIs
- Use rustdoc conventions
- Include examples in doc comments
- Keep documentation up-to-date
- Update README.md for new features
- Add examples to
examples/directory - Update CLI help text
- Create tutorials for complex features
- Update version in
Cargo.toml - Update CHANGELOG.md
- Create release branch
- Test thoroughly
- Create GitHub release
- Publish to crates.io (maintainers only)
- 💬 Join our Discord
- 📧 Email: dev@devflow.dev
- 🐛 Open an issue for bugs
- 💡 Start a discussion for questions
Contributors will be:
- Listed in CONTRIBUTORS.md
- Mentioned in release notes
- Invited to maintainer team (for significant contributions)
Thank you for making DevFlow better! 🚀