Thank you for your interest in contributing to LLMAgent! This document provides guidelines and instructions for contributing to this project.
Please read and follow our Code of Conduct. We expect all contributors to adhere to these guidelines to ensure a welcoming and productive environment.
- Fork the repository on GitHub.
- Clone your fork locally:
git clone https://github.com/YOUR-USERNAME/llm_agent.git cd llm_agent
- Install dependencies:
mix deps.get
- Create a branch for your changes:
git checkout -b feature/your-feature-name
LLMAgent follows the standard Elixir style guidelines:
-
Use
mix format
to format your code before submitting -
Follow the naming conventions:
- Modules: CamelCase, descriptive of purpose
- Functions: snake_case, verb-based, descriptive
- Variables: snake_case, clear purpose
- Signals: Atom types, descriptive of state
- Constants: ALL_CAPS for true constants, CamelCase for configuration
-
Write clear and expressive code, preferring readability over cleverness
All code contributions should be properly documented:
-
Module Documentation:
- Every module must have a
@moduledoc
- Explain the module's purpose and responsibilities
- Document how it fits in the overall architecture
- Every module must have a
-
Function Documentation:
- All public functions must have a
@doc
comment - Include
@spec
type specifications - Document parameters and return values
- Provide examples for non-trivial functions
- All public functions must have a
-
All new features or bug fixes should include tests:
mix test
-
Ensure your changes don't break existing functionality.
-
Test coverage should be maintained or improved:
mix test --cover
-
For LLM-related components, include appropriate mocks to avoid API calls during tests.
Before submitting changes, run:
mix lint # Alias for format and credo
This checks code formatting and runs Credo for static analysis.
-
Commit your changes with clear, descriptive commit messages:
git commit -m "Add feature X that solves problem Y"
-
Push to your fork:
git push origin feature/your-feature-name
-
Create a Pull Request against the
develop
branch of the original repository. -
Describe your changes in the PR description, including:
- What problem your PR solves
- How your implementation works
- Any potential side effects or considerations
- Links to related issues
-
Wait for review. Maintainers will review your PR and might request changes.
If you're fixing a bug:
- Ensure the bug is documented in an issue
- Reference the issue in your PR
- Add a test that reproduces the bug
- Explain your approach to fixing it
For new features:
- Open an issue discussing the feature before implementing
- Explain how the feature aligns with project goals
- Consider edge cases and performance implications
- Include comprehensive tests and documentation
Documentation improvements are always welcome:
- Correct inaccuracies in existing docs
- Expand explanations for clarity
- Add examples where useful
- Ensure formatting is consistent
When contributing to LLMAgent, follow these architectural principles:
- Signal-Driven Architecture: Maintain the separation between signals, handlers, and state.
- Immutability: State should be immutable and transformations explicit.
- Composability: Components should be composable and reusable.
- Separation of Concerns: Clearly delineate responsibilities between modules.
- Testability: Design for testability, avoid hidden dependencies.
Only maintainers can release new versions. The process involves:
- Updating the CHANGELOG.md
- Bumping version in mix.exs
- Tagging the release
- Publishing to Hex.pm
If you need help with the contribution process:
- Check existing documentation
- Open a discussion on GitHub
- Reach out to maintainers
Thank you for contributing to LLMAgent!