Contributing to ztick
On this page
Thank you for considering contributing to ztick. This document explains how to contribute.
Code of Conduct
This project follows the Contributor Covenant. By participating, you agree to uphold this code.
How Can I Contribute?
Reporting Bugs
Before creating bug reports, check existing issues.
Bug Report Template:
- Description: Clear description of the bug
- Steps to Reproduce: Numbered steps
- Expected Behavior: What should happen
- Actual Behavior: What actually happens
- Environment: OS, Zig version, ztick version
Suggesting Features
Open an issue with:
- Problem: What problem does this solve?
- Solution: Proposed solution
- Alternatives: Other solutions considered
Pull Requests
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run tests (
make test) - Run linter (
make lint) - Commit with conventional commits (
feat: add amazing feature) - Push to your fork (
git push origin feature/amazing-feature) - Open a Pull Request
Development Setup
# Clone your fork
git clone https://github.com/your-username/ztick.git
cd ztick
# Build
make build
# Run tests
make test
# Run linter
make lint
Prerequisites
- Zig 0.17.1+
- OpenSSL development headers (for TLS support)
- Make
Style Guide
Code Style
- Follow Zig standard conventions (
zig fmt) - Run
make lintbefore committing - Follow existing patterns in codebase
- Types: PascalCase. Functions: snake_case. Constants: snake_case
Architecture
This project follows Hexagonal/Clean Architecture with four strict layers:
domain/ → application/ → infrastructure/ → interfaces/
- Domain layer has zero dependencies (pure data and types)
- Each layer has a barrel export file (e.g.
domain.zig) - Import layers through barrels only
- Use tagged unions for protocol and runner types
- Use error unions for fallible operations
Code Quality Requirements
All pull requests must pass quality checks before merge.
Required checks:
- Linting:
make lintmust pass with zero issues - Testing:
make testmust pass with no failures - Build:
make buildmust succeed
PR Expectations:
- CI pipeline shows all checks passing
- No linter warnings or errors
- New code includes tests
- Documentation updated if behavior changes
Commit Messages
Follow Conventional Commits:
<type>(<scope>): <subject>
Types: feat, fix, docs, style, refactor, test, chore, perf
Examples:
feat(protocol): add QUERY commandfix(persistence): handle corrupted framedocs(readme): update configuration section
Rules:
- Max 50 characters for subject
- Imperative mood (“add” not “added”)
- No period at the end
Testing
- Co-locate unit tests in
testblocks within source files - Integration tests go in
src/functional_tests.zig - Verbose test names describe behavior (e.g.
test "tick processes query request and routes response") - Use
std.testing.tmpDirfor test files; never hardcode/tmppaths - Layer-specific targets:
zig build test-domain,test-application,test-infrastructure,test-interfaces,test-functional
Project Structure
src/
├── domain/ # Pure data types, zero dependencies
├── application/ # State machines, storage, use cases
├── infrastructure/ # IO adapters (TCP, persistence, telemetry)
└── interfaces/ # CLI, config parsing
docs/ # ADRs, user guides, reference
example/ # Example configuration files
Review Process
- Maintainers review within 1-2 weeks
- Address feedback in new commits
- Squash commits before merge (if requested)
- Celebrate your contribution!
Questions?
Open an issue with the question label.