Welcome
Thank you for your interest in contributing to Sorty. This guide provides comprehensive guidelines for development, testing, and submitting changes.Code of Conduct
This project follows our Code of Conduct. By participating, you agree to uphold these standards. Report violations via GitHub Discussions.Development Environment
Prerequisites
- macOS 15.1 or later
- Xcode 16.0 or later (including Swift 6.0)
- Git
- Optional: Ollama for local AI testing
Initial Setup
Make Commands
Sorty uses a Makefile for common development tasks:| Command | Purpose |
|---|---|
make build | Full build with tests |
make run | Build and launch app |
make now | Fast debug build + launch (recommended for dev) |
make dev | Fastest build (debug, no tests, no launch) |
make test | Run unit tests |
make test-fast | Run fast unit tests only |
make quick | Compile only, skip tests |
make cli | Build the learnings CLI tool |
make install | Install app to /Applications |
make harness | Preview harness for rapid UI iteration |
make benchmark | Measure build times |
For the full fast development loop guide, see docs/agent-guides/fast-loop.md.
Code Style Guidelines
Swift Conventions
Follow the Swift API Design Guidelines:- Use descriptive names that read well at call sites
- Prefer methods and properties over free functions
- Use
lowerCamelCasefor variables,UpperCamelCasefor types - Prefer strong type inference where clear
Sorty-Specific Conventions
Manager Classes:Naming Conventions
- Files:
PascalCase.swift - Tests:
ComponentNameTests.swift - Views: Suffix with
View(e.g.,SettingsView) - Managers: Suffix with
Manager(e.g.,FileSystemManager) - Protocols: Describe capability (e.g.,
AIClientProtocol)
Testing Requirements
Unit Tests
All new functionality requires unit tests:Testing Standards
- Use
MockAIClientfor testing AI-dependent features - Create temporary directories in
setUp(), clean intearDown() - Test edge cases (empty inputs, invalid paths, network failures)
- Use
XCTAssertThrowsErrorfor error conditions
UI Tests
AddaccessibilityIdentifier to all interactive elements:
Pull Request Process
Before Submitting
Check Code Style
- No warnings in Xcode
- Consistent with existing code
- Proper documentation comments for public APIs
PR Requirements
- Clear description of what changed and why
- Link to related issues (e.g., “Fixes #123”)
- Screenshots for UI changes
- Test results showing what was verified
Review Process
- Automated CI runs tests and security checks
- Maintainers review for code quality and architecture alignment
- Feedback provided within 48 hours
- Changes may be requested before approval
Commit Message Guidelines
Use clear, descriptive commit messages that capture the user-facing impact:Commit Types
feat: New featurefix: Bug fixdocs: Documentation onlytest: Adding or fixing testsrefactor: Code change that neither fixes nor adds featuresperf: Performance improvementchore: Build process or auxiliary tool changes
Architecture Patterns
MVVM + Service Layers
Sorty uses MVVM with dependency injection:AI Provider System
All AI clients implementAIClientProtocol and register in AIClientFactory:
State Transitions
Use validated state transitions in managers:FolderOrganizer.swift:13-147 for complete example.
Documentation
Code Documentation
Document public APIs with documentation comments:User-Facing Documentation
When adding features that affect users:- Update relevant
HelpView.swiftsections - Add to README.md if significant
- Update CHANGELOG.md with user-facing description
Common Contribution Scenarios
Adding a New AI Provider
See the complete guide: Adding AI Providers Quick checklist:- Add to
AIProviderenum with metadata - Create client implementing
AIClientProtocol - Register in
AIClientFactory - Add unit tests
- Update documentation
Adding a New View
- Add to navigation structure
- Add accessibility identifiers
- Add preview
- Follow Sorty’s UX guidelines (haptics, animations, hover effects)
Adding a New Manager
- Create as
@MainActor ObservableObject - Add to
SortyAppas@StateObject - Inject via
.environmentObject() - Add unit tests
UX & Microinteractions
Sorty is a polished, detail-oriented Mac app. Be thoughtful about the small things: Haptics: UseHapticFeedbackManager.shared for tactile feedback
.animatedAppearance(delay:) for staggered entrances
AGENTS.md:28-34 for complete UX guidelines.
Questions and Support
- General questions: Open a GitHub Discussion
- Bug reports: Use the bug report template
- Security issues: Use GitHub’s private vulnerability reporting (do not open public issues)
- Code of Conduct violations: Report via GitHub Discussions
License
By contributing to Sorty, you agree that your contributions will be licensed under the GPL v3 license.Next Steps
- Read the Architecture Guide
- Learn how to add AI providers
- Explore the agent guides
- Check out open issues
Thank you for helping make Sorty better!