Thank you for your interest in contributing to Stakpak! We're excited to have you join our community. This guide will help you get started with contributing to the project.
- Code of Conduct
- Ways to Contribute
- Getting Started
- Development Workflow
- Code Guidelines
- Testing
- Submitting Changes
- Documentation
- Getting Help
We are committed to providing a welcoming and inclusive environment for all contributors. Please be respectful, constructive, and collaborative in all interactions.
Expected Behavior:
- 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
There are many ways to contribute to Stakpak:
Found a bug? Help us fix it!
- Check if the issue already exists in GitHub Issues
- If not, create a new issue with a clear title and description
- Include steps to reproduce, expected behavior, and actual behavior
- Add relevant labels (e.g.,
bug,windows,performance)
Have an idea for a new feature?
- Open an issue with the
enhancementlabel - Describe the feature, its use case, and potential implementation
- Discuss with maintainers before starting work on large features
Browse our open issues and pick one to work on:
- Issues labeled
good first issueare great for newcomers - Issues labeled
help wantedare actively seeking contributors - Comment on the issue to let others know you're working on it
Help improve our documentation:
- Fix typos or clarify existing docs
- Add examples and tutorials
- Document undocumented features
- Improve code comments
We support Linux, macOS, and Windows. Testing on different platforms is valuable:
- See ISSUES.md for platform testing issues
- Report platform-specific bugs
- Help verify fixes work across platforms
Help review open pull requests:
- Test the changes locally
- Provide constructive feedback
- Check code quality and style
Help spread the word about Stakpak and make it easier for others to learn:
- Share tutorials, deep-dives, and case studies using Stakpak
- Publish on your blog, Medium, Dev.to
- Record walkthroughs, demos
- Publish on YouTube, TikTok, or LinkedIn
- Keep them short, and practical
- Stream deploying sessions, feature demos, or Q&A on Twitch, YouTube, or LinkedIn Live
- Show how you use Stakpak in real-world DevOps workflows
Content creators will be featured on our social media and newsletter.
- Rust 1.94.1 or later - Install from rustup.rs
- Git - For version control
- Cargo - Comes with Rust
- OpenSSL development libraries (Linux only):
- Ubuntu/Debian:
sudo apt-get install pkg-config libssl-dev - Fedora:
sudo dnf install openssl-devel - Arch:
sudo pacman -S openssl
- Ubuntu/Debian:
- Fork the repository on GitHub
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/agent.git cd agent - Add upstream remote:
git remote add upstream https://github.com/stakpak/agent.git
# Build in debug mode (faster compilation)
cargo build
# Build in release mode (optimized)
cargo build --release
# Build a specific crate
cargo build -p stakpak-cli# Run all tests
cargo test --workspace
# Run tests for a specific crate
cargo test -p stakpak-shared
# Run tests with output
cargo test --workspace -- --nocapture# Run in development mode
cargo run
# Run with specific flags
cargo run -- --help
cargo run -- --verbose
# Run a specific command
cargo run -- mcp --tool-mode localAlways create a new branch for your work:
# Sync with upstream
git fetch upstream
git checkout main
git merge upstream/main
# Create a feature branch
git checkout -b feature/my-new-feature
# Or for a bug fix
git checkout -b fix/issue-123-descriptionBranch Naming Conventions:
feature/- New featuresfix/- Bug fixesdocs/- Documentation changesrefactor/- Code refactoringtest/- Adding or updating testsperf/- Performance improvements
- Write clean, readable code
- Follow the Code Guidelines
- Add tests for new functionality
- Update documentation as needed
- Keep commits focused and atomic
Before submitting, ensure:
# Code compiles without errors
cargo check --all-targets
# All tests pass
cargo test --workspace
# Code is properly formatted
cargo fmt --check
# No clippy warnings
cargo clippy --all-targets -- -D warnings
# Build succeeds in release mode
cargo build --releaseWrite clear, descriptive commit messages:
git add .
git commit -m "feat: add GitHub integration tools
- Implement github_read_issues tool
- Add GitHub API client wrapper
- Include error handling and tests
Closes #123"Commit Message Format:
<type>: <subject>
<body>
<footer>
Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringperf: Performance improvementstest: Adding or updating testschore: Maintenance tasks
# Push your branch
git push origin feature/my-new-featureThen create a Pull Request on GitHub.
We follow standard Rust conventions and use rustfmt and clippy:
# Format code
cargo fmt
# Run clippy
cargo clippy --all-targets-
No Unwrap/Expect
- We deny
unwrap()andexpect()via clippy - Use proper error handling with
Resultand?operator - Use
matchorif letforOptiontypes
// ❌ Bad let value = some_option.unwrap(); // ✅ Good let value = match some_option { Some(v) => v, None => return Err("Value not found".into()), };
- We deny
-
Error Handling
- Use
anyhow::Resultfor application errors - Use
thiserrorfor library errors - Provide meaningful error messages
use anyhow::{Result, Context}; fn read_config() -> Result<Config> { let contents = std::fs::read_to_string("config.toml") .context("Failed to read config file")?; // ... Ok(config) }
- Use
-
Async Code
- Use
tokiofor async runtime - Prefer
async/awaitover manual futures - Be mindful of blocking operations in async contexts
- Use
-
Code Organization
- Keep functions small and focused
- Use meaningful variable and function names
- Add comments for complex logic
- Organize related functionality into modules
-
Security
- Never log or print secrets
- Use the secret redaction system for sensitive data
- Validate all external input
- Be cautious with file system operations
cli/ # CLI binary crate
├── src/
│ ├── commands/ # CLI commands
│ ├── config.rs # Configuration handling
│ └── main.rs
tui/ # TUI crate
├── src/
│ └── services/ # TUI services
libs/
├── api/ # API client library
├── mcp/
│ ├── client/ # MCP client
│ └── server/ # MCP server and tools
└── shared/ # Shared utilities
├── src/
│ ├── secrets/ # Secret detection
│ └── models/ # Data models
Add tests for all new functionality:
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_feature_works() {
let result = my_function();
assert_eq!(result, expected_value);
}
#[tokio::test]
async fn test_async_feature() {
let result = my_async_function().await;
assert!(result.is_ok());
}
}- Unit Tests - Test individual functions/modules
- Integration Tests - Test component interactions
- Platform Tests - Test on Linux, macOS, Windows
# Run tests matching a pattern
cargo test test_name
# Run tests in a specific file
cargo test --test integration_test
# Run doc tests
cargo test --doc
# Run with verbose output
cargo test -- --test-threads=1 --nocapture-
Update Your Branch
git fetch upstream git rebase upstream/main
-
Create Pull Request
- Use a clear, descriptive title
- Reference related issues (e.g., "Fixes #123")
- Describe what changes you made and why
- Include screenshots for UI changes
- Add any breaking changes to the description
-
PR Description Template
## Description Brief description of what this PR does. ## Related Issues Fixes #123 ## Changes Made - Change 1 - Change 2 - Change 3 ## Testing - [ ] All tests pass locally - [ ] Added tests for new functionality - [ ] Tested on Linux/macOS/Windows (specify which) ## Screenshots (if applicable) ## Breaking Changes None / List any breaking changes
-
Review Process
- Maintainers will review your PR
- Address feedback and push updates
- Once approved, a maintainer will merge your PR
Before submitting, ensure:
- Code follows style guidelines
- All tests pass (
cargo test --workspace) - No clippy warnings (
cargo clippy) - Code is formatted (
cargo fmt) - Documentation is updated
- Commit messages are clear
- Branch is up to date with
main - No merge conflicts
- Add doc comments for public APIs:
/// Reads a configuration file from the specified path. /// /// # Arguments /// * `path` - Path to the configuration file /// /// # Returns /// Returns `Ok(Config)` on success, or an error if the file cannot be read /// /// # Example /// ``` /// let config = read_config("~/.stakpak/config.toml")?; /// ``` pub fn read_config(path: &str) -> Result<Config> { // ... }
- Update README.md for user-facing changes
- Add examples in
examples/directory - Update the docs site (if applicable)
- Add a brief note about your changes
- Follow the format of existing entries
- Categorize as Added/Changed/Fixed/Removed
- Documentation: stakpak.gitbook.io
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Website: stakpak.dev
- Check existing issues and discussions first
- Create a new discussion for general questions
- Use issues only for bugs and feature requests
- Tag issues appropriately for better visibility
If you're stuck or need help:
- Check the existing documentation
- Search closed issues and PRs
- Ask in GitHub Discussions
- Reach out to maintainers
We value all contributions! Contributors will be:
- Listed in our contributors list
- Mentioned in release notes for significant contributions
- Thanked in commit messages and PR descriptions
By contributing to Stakpak, you agree that your contributions will be licensed under the same license as the project.
Thank you for contributing to Stakpak! 🚀
Your contributions help make DevOps more secure and efficient for everyone.