First off, thank you for considering contributing to Swift AI Agent Core! It's people like you that make this package better for everyone.
This project and everyone participating in it is governed by respect, professionalism, and collaboration. By participating, you are expected to uphold this standard.
Before creating bug reports, please check existing issues to avoid duplicates. When you create a bug report, include as many details as possible:
- Use a clear and descriptive title
- Describe the exact steps to reproduce the problem
- Provide specific examples (code snippets, screenshots)
- Describe the behavior you observed and what you expected
- Include your environment details (iOS version, Xcode version, etc.)
Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion:
- Use a clear and descriptive title
- Provide a detailed description of the suggested enhancement
- Explain why this enhancement would be useful
- List any alternatives you've considered
- Fork the repo and create your branch from
master - Follow the existing code style (see below)
- Add tests for any new functionality
- Update documentation as needed
- Ensure all tests pass with
swift test - Submit your pull request
# Clone your fork
git clone https://github.com/YOUR_USERNAME/Swift-AI-Agent-Core.git
cd Swift-AI-Agent-Core
# Build the package
swift build
# Run tests
swift test- Follow Swift API Design Guidelines
- Use Swift 6.0 features (async/await, actors, structured concurrency)
- All public types must be documented with DocC comments
- Use meaningful variable and function names
- Keep functions focused and small
/// Sends a message to the AI agent and returns the response
///
/// - Parameter message: The message to send
/// - Returns: The AI's response as a string
/// - Throws: `AIError` if the request fails
public func send(message: String) async throws -> String {
// Implementation
}- Use
async/awaitfor asynchronous operations - Mark types as
Sendablewhere appropriate - Use
actorfor mutable shared state - Avoid completion handlers and callbacks
- Use typed errors (
AIError) not genericError - Provide descriptive error messages
- Include recovery suggestions where appropriate
- Write unit tests for all new functionality
- Aim for high code coverage
- Use descriptive test names:
testFunctionName_WhenCondition_ThenExpectedResult - Include edge cases and error scenarios
func testSendMessage_WithValidInput_ReturnsResponse() async throws {
// Given
let agent = try MockAIAgent()
let message = "Hello"
// When
let response = try await agent.send(message: message)
// Then
XCTAssertFalse(response.isEmpty)
}- Update README.md if you change functionality
- Add DocC comments to all public APIs
- Include code examples in documentation
- Update Examples/ if you add new features
- Use present tense ("Add feature" not "Added feature")
- Use imperative mood ("Move cursor to..." not "Moves cursor to...")
- Limit first line to 72 characters
- Reference issues and pull requests when relevant
Add streaming support for Claude API
- Implement AsyncThrowingStream for Claude responses
- Add unit tests for streaming functionality
- Update README with streaming examples
Fixes #123
Maintainers will handle releases. Version numbers follow Semantic Versioning:
- MAJOR: Breaking changes
- MINOR: New features (backward-compatible)
- PATCH: Bug fixes (backward-compatible)
Feel free to open an issue with your question or reach out to the maintainers.
Contributors will be recognized in the project. Thank you for your contributions!
Happy coding! 🚀