Thank you for your interest in contributing. This document explains the process and expectations.
- Fork the repository on GitHub
- Create a branch from
mainfor your changes (feat/my-feature,fix/my-fix) - Make your changes following the guidelines below
- Push your branch to your fork
- Open a Pull Request against
main
- Swift 6.2+ (Xcode 26.2 or later)
- macOS 14+
- SwiftLint —
brew install swiftlint - swift-format —
brew install swift-format
# Build
swift build
# Run all tests
swift test
# Run tests with coverage
swift test --enable-code-coverageThe CI enforces linting before build. Run these locally to catch issues early:
# SwiftLint — must pass with zero violations in strict mode
swiftlint lint --strict
# swift-format — must pass with zero violations
swift-format lint -r Sources/ Tests/Configuration files are included in the repository (.swiftlint.yml and .swift-format).
- 4 spaces indentation, 150 character max line width
- Explicit access control on all public API (
public,packagefor cross-module internal) - Prefer
structoverclass,actorfor stateful types ///doc comments on all public API withParameters,Returns, andThrowssections- No force unwraps (
!), notry!, noas! - No
@preconcurrencyimports (except Apple framework imports where required), nononisolated(unsafe) - All public types must be
Sendable
- All tests must pass:
swift testwith zero failures - Code coverage must not decrease — new code should include tests
- Use Swift Testing (
import Testing) for all new tests, not XCTest - Test files go in
Tests/CaptureKitTests/ - Use
#expectand#requirefor assertions
- Clear title describing the change (e.g., "Add microphone capture source")
- Description explaining what changed and why
- Tests for new features and bug fixes
- One concern per PR — avoid mixing unrelated changes
- PRs must pass CI (lint + build + test on all platforms)
- Follow Conventional Commits:
feat:,fix:,docs:,test:,refactor:,perf:,chore:
Open an issue on GitHub with:
- A clear, descriptive title
- Steps to reproduce (for bugs)
- Expected vs actual behavior
- Swift version and platform
- Minimal code sample if applicable
Sources/CaptureKit/— core library (capture, encoding, output, formats)Tests/CaptureKitTests/— unit and integration tests
By contributing to this project, you agree that your contributions will be licensed under the Apache License 2.0.