Thank you for your interest in contributing to AgentKern! This document provides guidelines and instructions for contributing.
- Check existing issues: Search GitHub Issues to see if the bug is already reported.
- Create a new issue: If not found, create a new issue with:
- Clear title and description
- Steps to reproduce
- Expected vs actual behavior
- Environment details (OS, Rust version, etc.)
- Relevant logs/error messages
- Check existing issues: Search for similar feature requests.
- Create a feature request: Use the "Feature Request" template with:
- Clear description of the feature
- Use case and motivation
- Proposed implementation approach (if applicable)
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature-name - Make your changes
- Write/update tests: Ensure all tests pass
- Run linters:
cargo fmt --all && cargo clippy --workspace -- -D warnings - Commit with clear messages: Follow Conventional Commits
- Push and create a Pull Request
- Rust: 1.92+ (stable)
- Node.js: 24+ (for SDKs and playground)
- pnpm: 9+ (package manager)
- PostgreSQL: 17+ (for integration tests)
- Docker: (optional, for containerized testing)
# Clone the repository
git clone https://github.com/AgentKern/agentkern.git
cd agentkern
# Install Rust dependencies
cargo build --workspace
# Install Node.js dependencies
pnpm install
# Run tests
cargo test --workspaceagentkern/
├── apps/
│ ├── server/ # Unified Rust HTTP server
│ └── playground/ # TypeScript frontend
├── packages/
│ ├── pillars/ # Six core pillars (Rust)
│ └── foundation/ # Shared infrastructure
├── sdks/ # Client libraries
├── docs/ # Documentation
└── tests/ # Integration tests
- Formatting: Use
cargo fmt --all - Linting: Must pass
cargo clippy --workspace -- -D warnings - Tests: All tests must pass:
cargo test --workspace - Documentation: Public APIs must have doc comments
- Error Handling: Use
Result<T, E>instead ofunwrap()in production code
- Formatting: Use Prettier (configured in repo)
- Linting: Must pass ESLint checks
- Type Safety: Prefer TypeScript, avoid
any
Follow Conventional Commits:
<type>(<scope>): <subject>
<body>
<footer>
Types: feat, fix, docs, style, refactor, test, chore
Examples:
feat(gate): add prompt injection detectionfix(identity): resolve WebAuthn credential parsingdocs: update quickstart guide
# All tests
cargo test --workspace
# Specific pillar
cargo test -p agentkern-gate
# With output
cargo test --workspace -- --nocapture
# Integration tests
cargo test --test integration- Unit tests: In
src/files with#[cfg(test)] - Integration tests: In
tests/directory - Coverage: Aim for >80% coverage on new code
- Update CHANGELOG.md: Add entry under "Unreleased"
- Update documentation: If adding features, update relevant docs
- Ensure CI passes: All checks must be green
- Request review: Tag relevant maintainers
- Address feedback: Respond to review comments
- Squash commits: Before merging (if requested)
- Code follows style guidelines
- Tests added/updated and passing
- Documentation updated
- CHANGELOG.md updated
- No breaking changes (or documented if intentional)
- CI checks passing
For significant changes, consider creating an ADR (Architecture Decision Record):
- Create
docs/governance/adr/ADR-XXX-your-decision.md - Follow the ADR template
- Get approval from maintainers
- Code comments: Use Rust doc comments for public APIs
- README files: Keep package READMEs up to date
- Guides: Add to
docs/guides/for how-to content - Specs: Add to
docs/spec/for design specifications
- Clear, concise language
- Code examples where helpful
- Link to related docs
- Keep up to date with code changes
- Enterprise features:
ee/directory is proprietary - Breaking changes: Discuss in issues first
- Large refactors: Create an ADR first
- Dependencies: Get approval before adding new crates
- Be respectful and inclusive
- Welcome newcomers
- Focus on constructive feedback
- Follow the project's technical decisions
- GitHub Discussions: For questions and discussions
- GitHub Issues: For bugs and feature requests
- Discord: (if available) For real-time chat
Contributors will be:
- Listed in CONTRIBUTORS.md
- Mentioned in release notes (for significant contributions)
- Credited in the project documentation
Thank you for contributing to AgentKern! 🎉