Thank you for your interest in contributing to TaskFlow! This document provides guidelines and instructions for contributing.
- Go 1.18 or higher
- Git
- Make (optional, but recommended)
-
Fork the repository
-
Clone your fork:
git clone https://github.com/YOUR_USERNAME/go-taskflow cd go-taskflow -
Install dependencies:
make deps # or go mod download -
Build the project:
make build # or go build -o taskflow main.go
# Build for current platform
make build
# Build for all platforms
make build-all
# Clean build artifacts
make clean# Run tests
make test
# Run example workflows
./taskflow run examples/simple.yaml-
Follow standard Go conventions
-
Use
gofmtto format your code:make fmt # or go fmt ./... -
Run linters if available:
make lint
go-taskflow/
├── cmd/taskflow/ # CLI commands
│ ├── root.go # Root command
│ └── run.go # Run command
├── pkg/
│ ├── types/ # Core type definitions
│ ├── parser/ # YAML parser
│ ├── executor/ # Task executors
│ └── workflow/ # Workflow engine
├── examples/ # Example workflows
├── main.go # Entry point
├── Makefile # Build automation
└── README.md # Documentation
- Add the new task type to
pkg/types/types.goif new fields are needed - Implement the executor in
pkg/executor/executor.go - Add handling in the
Executemethod's switch statement - Create an example workflow in
examples/ - Update the README.md documentation
// In pkg/executor/executor.go
case "database":
output, err = e.executeDatabase(ctx, task)
// Implement the executor
func (e *Executor) executeDatabase(ctx context.Context, task types.Task) (string, error) {
// Implementation here
}- Create a new file in
cmd/taskflow/ - Define the command using Cobra:
var myCmd = &cobra.Command{ Use: "mycommand", Short: "Description", Run: func(cmd *cobra.Command, args []string) { // Implementation }, } func init() { rootCmd.AddCommand(myCmd) }
- Use clear, descriptive commit messages
- Start with a verb in present tense (Add, Fix, Update, etc.)
- Reference issue numbers if applicable
Examples:
Add support for PostgreSQL tasksFix retry logic for HTTP requestsUpdate documentation for parallel execution
-
Create a feature branch:
git checkout -b feature/your-feature-name
-
Make your changes and commit:
git add . git commit -m "Add your feature"
-
Push to your fork:
git push origin feature/your-feature-name
-
Open a Pull Request on GitHub
-
Ensure all checks pass
-
Wait for review and address any feedback
- Provide a clear description of the changes
- Include examples or test cases if applicable
- Update documentation as needed
- Keep changes focused and atomic
- Ensure backwards compatibility when possible
When reporting issues, please include:
- TaskFlow version (
./taskflow --version) - Go version (
go version) - Operating system
- Steps to reproduce
- Expected behavior
- Actual behavior
- Sample workflow file (if applicable)
- Be respectful and inclusive
- Welcome newcomers
- Focus on constructive feedback
- Maintain a professional tone
If you have questions about contributing, feel free to:
- Open an issue on GitHub
- Reach out to the maintainers
By contributing to TaskFlow, you agree that your contributions will be licensed under the GPL-3.0 License.
Thank you for contributing to TaskFlow! 🎉