|
| 1 | +# Contributing to ag-ui-4k |
| 2 | + |
| 3 | +Thank you for your interest in contributing to ag-ui-4k! We welcome contributions from the community and are grateful for any help you can provide. |
| 4 | + |
| 5 | +## Code of Conduct |
| 6 | + |
| 7 | +By participating in this project, you agree to abide by our Code of Conduct: |
| 8 | +- Be respectful and inclusive |
| 9 | +- Welcome newcomers and help them get started |
| 10 | +- Focus on constructive criticism |
| 11 | +- Respect differing viewpoints and experiences |
| 12 | + |
| 13 | +## How to Contribute |
| 14 | + |
| 15 | +### Reporting Issues |
| 16 | + |
| 17 | +Before creating an issue, please check if a similar issue already exists. When creating a new issue: |
| 18 | + |
| 19 | +1. Use a clear and descriptive title |
| 20 | +2. Provide a detailed description of the issue |
| 21 | +3. Include steps to reproduce the problem |
| 22 | +4. Specify your environment (OS, Kotlin version, etc.) |
| 23 | +5. Include relevant code snippets or error messages |
| 24 | + |
| 25 | +### Suggesting Enhancements |
| 26 | + |
| 27 | +We welcome suggestions for new features or improvements! Please: |
| 28 | + |
| 29 | +1. Check if the enhancement has already been suggested |
| 30 | +2. Create an issue with the `enhancement` label |
| 31 | +3. Clearly describe the proposed feature |
| 32 | +4. Explain why this enhancement would be useful |
| 33 | +5. Provide examples of how it would work |
| 34 | + |
| 35 | +### Pull Requests |
| 36 | + |
| 37 | +1. **Fork the Repository**: Create your own fork of the project |
| 38 | + |
| 39 | +2. **Create a Branch**: Create a feature branch from `main` |
| 40 | + ```bash |
| 41 | + git checkout -b feature/your-feature-name |
| 42 | + ``` |
| 43 | + |
| 44 | +3. **Make Your Changes**: |
| 45 | + - Follow the existing code style |
| 46 | + - Add tests for new functionality |
| 47 | + - Update documentation as needed |
| 48 | + - Ensure all tests pass |
| 49 | + |
| 50 | +4. **Commit Your Changes**: Use clear and meaningful commit messages |
| 51 | + ```bash |
| 52 | + git commit -m "Add feature: description of your changes" |
| 53 | + ``` |
| 54 | + |
| 55 | +5. **Push to Your Fork**: |
| 56 | + ```bash |
| 57 | + git push origin feature/your-feature-name |
| 58 | + ``` |
| 59 | + |
| 60 | +6. **Create a Pull Request**: |
| 61 | + - Provide a clear title and description |
| 62 | + - Reference any related issues |
| 63 | + - Include screenshots if applicable |
| 64 | + - Ensure CI checks pass |
| 65 | + |
| 66 | +## Development Setup |
| 67 | + |
| 68 | +### Prerequisites |
| 69 | + |
| 70 | +- JDK 11 or higher (JDK 17 recommended) |
| 71 | +- Android Studio or IntelliJ IDEA |
| 72 | +- Kotlin 2.1.21 or higher (with K2 compiler) |
| 73 | +- Gradle 8.5 or higher |
| 74 | + |
| 75 | +### Building the Project |
| 76 | + |
| 77 | +```bash |
| 78 | +# Clone the repository |
| 79 | +git clone https://github.com/contextable/ag-ui-4k.git |
| 80 | +cd ag-ui-4k |
| 81 | + |
| 82 | +# Navigate to the library directory |
| 83 | +cd library |
| 84 | + |
| 85 | +# Build the project |
| 86 | +./gradlew build |
| 87 | + |
| 88 | +# Run tests |
| 89 | +./gradlew test |
| 90 | + |
| 91 | +# Run specific platform tests |
| 92 | +./gradlew androidTest |
| 93 | +./gradlew iosSimulatorArm64Test |
| 94 | +./gradlew jvmTest |
| 95 | +``` |
| 96 | + |
| 97 | +### Code Style |
| 98 | + |
| 99 | +We follow the official [Kotlin Coding Conventions](https://kotlinlang.org/docs/coding-conventions.html). Key points: |
| 100 | + |
| 101 | +- Use 4 spaces for indentation (no tabs) |
| 102 | +- Maximum line length: 120 characters |
| 103 | +- Use meaningful variable and function names |
| 104 | +- Add KDoc comments for public APIs |
| 105 | +- Prefer immutability (`val` over `var`) |
| 106 | + |
| 107 | +### Project Structure |
| 108 | + |
| 109 | +- Main library code is in `library/src/` |
| 110 | +- Platform-specific code goes in appropriate source sets (e.g., `library/src/androidMain/`) |
| 111 | +- Tests go in `library/src/commonTest/` or platform-specific test directories |
| 112 | + |
| 113 | +### Testing Guidelines |
| 114 | + |
| 115 | +- Write unit tests for new functionality |
| 116 | +- Aim for high test coverage |
| 117 | +- Use descriptive test names |
| 118 | +- Test edge cases and error conditions |
| 119 | +- Use mocks for external dependencies |
| 120 | + |
| 121 | +Example test structure: |
| 122 | +```kotlin |
| 123 | +@Test |
| 124 | +fun `should handle event when condition is met`() { |
| 125 | + // Given |
| 126 | + val agent = TestAgent() |
| 127 | + |
| 128 | + // When |
| 129 | + val result = agent.processEvent(event) |
| 130 | + |
| 131 | + // Then |
| 132 | + assertEquals(expected, result) |
| 133 | +} |
| 134 | +``` |
| 135 | + |
| 136 | +## Documentation |
| 137 | + |
| 138 | +- Update README.md if adding new features |
| 139 | +- Add KDoc comments for public APIs |
| 140 | +- Include code examples in documentation |
| 141 | +- Update the changelog for significant changes |
| 142 | + |
| 143 | +## Platform-Specific Guidelines |
| 144 | + |
| 145 | +### Android |
| 146 | +- Minimum SDK: 26 |
| 147 | +- Target latest stable Android version |
| 148 | +- Test on both emulators and real devices |
| 149 | + |
| 150 | +### iOS |
| 151 | +- Minimum iOS version: 13.0 |
| 152 | +- Test on both simulators and real devices |
| 153 | +- Ensure compatibility with both Intel and Apple Silicon |
| 154 | + |
| 155 | +### JVM |
| 156 | +- Target Java 11 compatibility |
| 157 | +- Test on multiple JVM implementations if possible |
| 158 | + |
| 159 | +## Release Process |
| 160 | + |
| 161 | +1. Update version in `build.gradle.kts` |
| 162 | +2. Update CHANGELOG.md |
| 163 | +3. Create a release branch |
| 164 | +4. Run full test suite |
| 165 | +5. Create a pull request |
| 166 | +6. After merge, tag the release |
| 167 | +7. Publish to Maven Central |
| 168 | + |
| 169 | +## Community |
| 170 | + |
| 171 | +- Join our [Discord server](https://discord.gg/ag-ui-4k) |
| 172 | +- Follow us on [Twitter](https://twitter.com/agui4k) |
| 173 | +- Read our [blog](https://blog.contextable.com) |
| 174 | + |
| 175 | +## License |
| 176 | + |
| 177 | +By contributing, you agree that your contributions will be licensed under the MIT License. |
| 178 | + |
| 179 | +## Questions? |
| 180 | + |
| 181 | +If you have questions about contributing, please: |
| 182 | +- Check our [FAQ](https://github.com/contextable/ag-ui-4k/wiki/FAQ) |
| 183 | +- Ask in our [Discord server](https://discord.gg/ag-ui-4k) |
| 184 | +- Open a [discussion](https://github.com/contextable/ag-ui-4k/discussions) |
| 185 | + |
| 186 | +Thank you for contributing to ag-ui-4k! 🎉 |
0 commit comments