-
Notifications
You must be signed in to change notification settings - Fork 0
Contributing
Thank you for your interest in contributing to DoPlan CLI! This guide will help you get started.
There are many ways to contribute:
- Report Bugs: Open an issue describing the bug
- Suggest Features: Propose new features or improvements
- Submit Code: Fix bugs or add features via pull requests
- Improve Documentation: Help make our docs better
- Answer Questions: Help others in discussions
- Go >= 1.23.0
- Node.js >= 14.0.0 (for npx wrapper)
- Git for version control
- Make (optional, for build commands)
-
Fork the Repository
Visit GitHub and fork the repository.
-
Clone Your Fork
git clone https://github.com/YOUR_USERNAME/CLI.git cd CLI -
Add Upstream Remote
git remote add upstream https://github.com/DoPlan-dev/CLI.git
-
Install Dependencies
# Go dependencies are managed via go.mod go mod download -
Build the Project
make build # Or go build -o doplan ./cmd/doplan -
Run Tests
make test # Or go test ./...
- Follow Effective Go guidelines
- Use
gofmtfor formatting - Use
golintfor linting - Follow existing code patterns
# Format code
go fmt ./...
# Or use goimports
goimports -w .# Run linter
golangci-lint run- Packages: lowercase, single word
- Exported functions: PascalCase
- Unexported functions: camelCase
- Constants: PascalCase or UPPER_CASE
- Variables: camelCase
- Keep functions focused and small
- Use meaningful names
- Add comments for exported functions
- Group related code together
- Write tests for all new features
- Write tests for bug fixes
- Aim for high test coverage
- Use table-driven tests when appropriate
# Run all tests
go test ./...
# Run tests with coverage
go test -cover ./...
# Run tests with verbose output
go test -v ./...
# Run specific test
go test -run TestName ./...func TestFunctionName(t *testing.T) {
// Arrange
// Act
// Assert
}- Place integration tests in
*_integration_test.gofiles - Use build tags if needed:
//go:build integration
- Document all exported functions, types, and constants
- Use clear, concise comments
- Include examples when helpful
Example:
// GenerateProject creates a new project structure with the given
// configuration. It returns an error if project generation fails.
//
// Example:
// err := GenerateProject(&ProjectRequest{
// Name: "my-project",
// IDE: "cursor",
// })
func GenerateProject(request *ProjectRequest) error {
// ...
}- Use clear headings
- Include code examples
- Keep formatting consistent
- Update related docs when making changes
- Keep docs in
docs/directory - Follow existing structure
- Update
docs/README.mdwhen adding new docs
-
Update Your Fork
git fetch upstream git checkout main git merge upstream/main
-
Create a Branch
git checkout -b feature/your-feature-name # Or git checkout -b fix/your-bug-fix -
Make Your Changes
- Write code
- Add tests
- Update documentation
- Follow code style
-
Test Your Changes
go test ./... go build ./... -
Commit Your Changes
Use Conventional Commits:
git commit -m "feat: add new feature" git commit -m "fix: fix bug in generator" git commit -m "docs: update installation guide"
-
Push Your Branch
git push origin feature/your-feature-name
-
Create Pull Request
- Go to GitHub
- Click "New Pull Request"
- Select your branch
- Fill out the PR template
-
PR Description
Include:
- What changes were made
- Why the changes were made
- How to test the changes
- Related issues
-
Wait for Review
- Address review comments
- Make requested changes
- Update PR as needed
- Code follows style guidelines
- Tests added/updated
- Documentation updated
- All tests pass
- No merge conflicts
- PR description complete
-
Search Existing Issues
Check if the issue already exists.
-
Check Documentation
Verify it's not covered in docs.
-
Reproduce the Issue
Ensure you can reproduce it consistently.
Use the issue template and include:
- Title: Clear, descriptive title
- Description: Detailed description
- Steps to Reproduce: Step-by-step instructions
- Expected Behavior: What should happen
- Actual Behavior: What actually happens
- Environment: OS, Go version, etc.
- Screenshots: If applicable
**Description**
Brief 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: macOS/Windows/Linux
- Go Version: 1.23.0
- DoPlan CLI Version: 1.0.0
**Additional Context**
Any other relevant information.-
Search Existing Issues
Check if the feature was already requested.
-
Consider Alternatives
Is there a workaround?
-
Think About Use Cases
Who would benefit? How would it be used?
Include:
- Title: Clear feature name
- Description: Detailed description
- Use Cases: Who would use it and how
- Alternatives: Other solutions considered
- Additional Context: Any other relevant information
- main: Production-ready code
- develop: Development branch
- feature/: New features
- fix/: Bug fixes
- docs/: Documentation updates
Use Conventional Commits:
-
feat:New feature -
fix:Bug fix -
docs:Documentation -
style:Formatting -
refactor:Code refactoring -
test:Tests -
chore:Maintenance
Examples:
feat: add support for new IDE
fix: resolve binary download issue
docs: update installation guide
- Be respectful and constructive
- Focus on code, not person
- Explain your reasoning
- Be open to feedback
# 1. Create branch
git checkout -b fix/binary-download-error
# 2. Fix the bug
# ... make changes ...
# 3. Add tests
# ... write tests ...
# 4. Test
go test ./...
# 5. Commit
git commit -m "fix: resolve binary download error on Windows"
# 6. Push
git push origin fix/binary-download-error
# 7. Create PR# 1. Create branch
git checkout -b feature/add-new-ide-support
# 2. Implement feature
# ... write code ...
# 3. Add tests
# ... write tests ...
# 4. Update docs
# ... update documentation ...
# 5. Test
go test ./...
go build ./...
# 6. Commit
git commit -m "feat: add support for new IDE"
# 7. Push
git push origin feature/add-new-ide-support
# 8. Create PR# 1. Create branch
git checkout -b docs/update-installation-guide
# 2. Update docs
# ... edit markdown files ...
# 3. Commit
git commit -m "docs: update installation guide with new steps"
# 4. Push
git push origin docs/update-installation-guide
# 5. Create PR- Documentation: Check docs/
- Issues: Search GitHub Issues
- Discussions: Join GitHub Discussions
- Open a discussion for questions
- Check existing issues first
- Be clear and specific
We follow the Contributor Covenant Code of Conduct. Please:
- Be respectful
- Be inclusive
- Be constructive
- Focus on what's best for the community
Contributors will be:
- Listed in CONTRIBUTORS.md
- Recognized in release notes
- Thanked in discussions
- Development Documentation - Development setup
- Code of Conduct - Community guidelines
- FAQ - Frequently asked questions
- Home - Wiki home page
Last Updated: 2025
Maintained By: Documentation Team