Contribution Guide
This document provides comprehensive guidelines for contributing to PromptKit.
Developer Certificate of Origin (DCO)
Section titled “Developer Certificate of Origin (DCO)”This project uses the Developer Certificate of Origin (DCO) to ensure that contributors have the right to submit their contributions. By making a contribution to this project, you certify that:
- The contribution was created in whole or in part by you and you have the right to submit it under the open source license indicated in the file; or
- The contribution is based upon previous work that, to the best of your knowledge, is covered under an appropriate open source license and you have the right under that license to submit that work with modifications, whether created in whole or in part by you, under the same open source license (unless you are permitted to submit under a different license), as indicated in the file; or
- The contribution was provided directly to you by some other person who certified (1), (2) or (3) and you have not modified it.
Signing Your Commits
Section titled “Signing Your Commits”To sign off on your commits, add the -s flag to your git commit command:
git commit -s -m "Your commit message"This adds a “Signed-off-by” line to your commit message:
Signed-off-by: Your Name <your.email@example.com>How to Contribute
Section titled “How to Contribute”Reporting Bugs
Section titled “Reporting Bugs”- Check existing issues first
- Provide clear reproduction steps
- Include version information
- Share relevant configuration/code samples
Suggesting Features
Section titled “Suggesting Features”- Open an issue describing the feature
- Explain the use case and benefits
- Discuss implementation approach
Submitting Changes
Section titled “Submitting Changes”- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature-name - Make your changes
- Write/update tests
- Commit your changes: Use clear, descriptive commit messages with
-sflag for DCO - Pre-commit checks run automatically (linting, tests, coverage on changed code)
- Push to your fork:
git push origin feature/your-feature-name - Open a Pull Request
Tip: Run make verify before pushing to ensure CI will pass.
Development Setup
Section titled “Development Setup”Prerequisites
Section titled “Prerequisites”- Go 1.21 or later
- Make (for build automation)
- golangci-lint (for linting)
- diff-cover (for coverage checks)
# Clone your forkgit clone https://github.com/YOUR_USERNAME/PromptKit.gitcd PromptKit
# Install dependenciesmake install
# Install development toolsbrew install golangci-lintpip3 install diff-cover
# Set up pre-commit hooks./scripts/install-hooks.sh
# Run testsmake test
# Build all componentsmake buildSee the Pre-Commit Hooks guide for details on automated code quality checks.
Project Structure
Section titled “Project Structure”PromptKit/├── runtime/ # Core runtime components├── pkg/ # Shared packages├── tools/arena/ # PromptKit Arena CLI├── tools/packc/ # Pack Compiler tool├── sdk/ # PromptKit SDK├── examples/ # Example configurations└── docs/ # DocumentationComponent-Specific Contribution Guidelines
Section titled “Component-Specific Contribution Guidelines”Arena CLI (tools/arena/)
Section titled “Arena CLI (tools/arena/)”Focus: Testing framework for LLM applications
Key Areas for Contribution:
- New test scenario types and assertions
- Provider integrations (OpenAI, Anthropic, Google, etc.)
- MCP (Model Context Protocol) tool integrations
- Report generation and visualization improvements
- Performance optimizations for large test suites
Testing Arena Changes:
# Build Arenamake build-arena
# Run Arena testscd tools/arena && go test ./...
# Test with example scenarios./bin/promptarena run examples/customer-support/arena.yamlPackC CLI (tools/packc/)
Section titled “PackC CLI (tools/packc/)”Focus: Prompt packaging and compilation tool
Key Areas for Contribution:
- Pack format enhancements and validation
- New output formats and deployment targets
- Template processing improvements
- Schema validation and error reporting
Testing PackC Changes:
# Build PackCmake build-packc
# Run PackC testscd tools/packc && go test ./...
# Test pack compilation./bin/packc build examples/customer-support/packs/SDK (sdk/)
Section titled “SDK (sdk/)”Focus: Production-ready library for deploying LLM applications
Key Areas for Contribution:
- High-level API improvements
- New conversation patterns and middleware
- Integration helpers and utilities
- Performance optimizations
- Example applications and tutorials
Testing SDK Changes:
# Build and test SDKcd sdk && go test ./...
# Run integration testscd sdk && go test -tags=integration ./...
# Test with examplescd examples/customer-support && go run main.goRuntime (runtime/)
Section titled “Runtime (runtime/)”Focus: Core engine and shared components
Key Areas for Contribution:
- Provider implementations and optimizations
- Tool execution framework
- State management and persistence
- Pipeline processing improvements
- Security and error handling
Testing Runtime Changes:
# Build and test runtimecd runtime && go test ./...
# Run comprehensive testsmake test
# Check coveragemake coverageCoding Guidelines
Section titled “Coding Guidelines”Go Code Style
Section titled “Go Code Style”- Follow standard Go conventions
- Use
gofmtfor formatting (included inmake fmt) - Write clear, descriptive variable/function names
- Add package-level documentation comments
- Keep functions focused and testable
Testing
Section titled “Testing”- Write unit tests for new functionality
- Maintain test coverage above 50%
- Use table-driven tests where appropriate
- Mock external dependencies
Documentation
Section titled “Documentation”- Update README.md if adding features
- Add inline comments for complex logic
- Update relevant example configurations
- Add package documentation for new packages
Pull Request Process
Section titled “Pull Request Process”- Ensure CI passes - All tests and linter checks must pass
- Update documentation - README, examples, inline docs
- Add changelog entry - Describe your changes
- Request review - Tag maintainers (see
.github/CODEOWNERS) - Address feedback - Respond to review comments
- Resolve all conversations - All review comments must be marked as resolved
- Sign commits - Use
git commit -sfor DCO compliance - Keep branch updated - Rebase or merge with latest
main - Squash merge - Maintains clean commit history (preferred)
Note: The main branch is protected. See the DevOps documentation for details on branch protection and CI/CD pipelines.
Release Process
Section titled “Release Process”Maintainers handle releases:
- Update version numbers
- Update CHANGELOG.md
- Create git tag
- Build and test release artifacts
- Publish to GitHub releases
Questions?
Section titled “Questions?”- Open a GitHub issue for questions
- Check existing documentation
- Review closed issues and PRs
License
Section titled “License”By contributing, you agree that your contributions will be licensed under the Apache License 2.0.