|
| 1 | +# Agents |
| 2 | + |
| 3 | +This file provides critical development and deployment guidelines for AI agents working with this app project. |
| 4 | + |
| 5 | +## Development |
| 6 | + |
| 7 | +### Project Structure |
| 8 | +- App-specific logic belongs in framework targets. |
| 9 | +- **External SwiftPM dependencies** contain shared logic and helper functions. |
| 10 | +- UI code should be separated from business logic. |
| 11 | +- For app development focus on the **Xcode project**. Package.swift typically supports building CLI tools only. |
| 12 | + |
| 13 | +### Code Patterns |
| 14 | +- Use appropriate logging frameworks instead of print statements. |
| 15 | +- Follow protocol-oriented design patterns. |
| 16 | +- **CRITICAL: Always check FoundationKit, LoggerKit, SwiftUIKit, and other core frameworks before implementing basic functionality.** These frameworks contain extensive extensions and utilities that avoid code duplication. |
| 17 | + |
| 18 | +#### Core Frameworks Extensions Examples |
| 19 | +- **NSError**: `NSError(description:, recoverySuggestion:)` convenience initializer |
| 20 | +- **NSAppleScript**: `execute()` method with proper Swift error handling |
| 21 | +- **ProcessInfo**: `launchExtensionsPaneInSystemSettings()`, `launchPrivacyAndSecurityPaneInSystemSettings()` |
| 22 | +- **URL**: `open(withAppBundleIdentifier:)` for cross-platform URL opening |
| 23 | +- **Process**: Enhanced execution utilities with output capture |
| 24 | +- **UserDefaults**: `@UserDefaults.Wrapper` property wrapper for cleaner app preferences |
| 25 | + |
| 26 | +### Working with External SwiftPM Dependencies |
| 27 | +- External dependencies are separate SwiftPM repositories shared across multiple apps. |
| 28 | +- Changes to core models, utilities, business rules must be made in their respective packages (typically you can find them in the project parent directory). |
| 29 | +- To build or test a SwiftPM project use `DeveloperBuildTool` instead of `swift build`. |
| 30 | +- Workflow: Edit external package → Build → Commit & Push → Return to main project → Reload package dependencies → Rebuild. |
| 31 | + |
| 32 | +### Verification Requirements |
| 33 | +- **Always verify changes work** by building or testing before considering task complete. |
| 34 | +- Build or test external dependencies if changes were made to them. |
| 35 | +- Build main project to ensure all changes integrate properly. |
| 36 | +- Run the application when possible to ensure functionality works as expected. Make sure to terminate any running instances of the app before running again. |
| 37 | +- Changes are not complete until successfully built and verified. |
| 38 | + |
| 39 | +### Development Workflow |
| 40 | +- All development work is done from the `master` branch. |
| 41 | +- By default, feature development, bug fixes, and general improvements happen directly on `master`. |
| 42 | +- Optionally, `feature/` or `fix/` branches can be created for parallel work. |
| 43 | + |
| 44 | +## Deployment |
| 45 | + |
| 46 | +### Release Process |
| 47 | +For app releases: |
| 48 | +1. **Version Update**: Update the Xcode project Marketing Version setting and / or the `CFBundleShortVersionString` in all relevant Info.plist files. Use the standard versioning format (eg. `1.0`, then `1.1` or `1.0.1` for minor updates). Ensure the version is consistent across all targets (app, extensions, frameworks). |
| 49 | +2. **Commit Changes**: Add, commit, and push all pending changes to `master` branch. |
| 50 | +3. **Merge to Release**: Switch to `release` branch, merge from `master`, and push to remote. Note: Only the `release` branch is linked to Xcode Cloud for automated builds. |
| 51 | +4. **Tag Release**: After pushing to `release` branch, you MUST ALWAYS create and push a git tag. Use the `v1.0` or `v1.0.1` format for tags and a message like `ProjectName v1.0.1`. Create or replace the new tag and push to remote with force flag. Always use the same version number as the one in the Xcode project, if it did not change, use the same tag as the previous release. |
| 52 | +5. **Back to Master**: Switch back to `master` branch for further development. |
| 53 | + |
| 54 | +**CRITICAL**: Each time you push to the `release` branch make sure to **always** tag it with current project version. This is crucial for maintaining a clear version history. |
| 55 | + |
| 56 | +--- |
| 57 | + |
| 58 | +**IMPORTANT**: This is a generic development guide for AI agents shared and available on multiple app projects, so avoid adding project-specific information here. Refer to README.md and the source code for project-specific details. |
0 commit comments