Sources/holds application code, grouped by domain:App/,Features/,Services/,Models/, andExtensions/.Resources/contains app assets and bundled resources.Tests/hosts XCTest-based unit tests.Config/storesInfo.plistand entitlements.project.ymlis the XcodeGen source of truth;CaptureThis.xcodeprojis generated.Scripts/contains packaging helpers (e.g.,package.sh).artifacts/is the output directory for release bundles.docs/contains product/research notes.
Use mise tasks (see .mise.toml):
mise installinstalls Swift, XcodeGen, SwiftLint, and SwiftFormat.mise run generateregenerates the Xcode project fromproject.yml.mise run buildbuilds a Debug macOS app.mise run testruns unit tests.mise run lintruns SwiftLint and SwiftFormat in lint mode.mise run formatauto-formats Swift sources.mise run release-buildbuilds a Release app bundle.mise run packagecreates.app.zipand.dmginartifacts/.
Always run and fix failures in mise run lint, mise run test, and mise run build for any change. If project.yml or build settings change, run mise run generate first to refresh CaptureThis.xcodeproj. Do not hand off work with red gates.
- Swift code uses 2-space indentation and LF line endings (SwiftFormat).
- SwiftLint enforces a 120/160 line length (warning/error) and minimum identifier length of 2.
- Name test files
*Tests.swiftand test methods withtest.... - Keep new features scoped to existing folders (e.g.,
Features/for user flows).
- Tests are written with XCTest in
Tests/. - Run tests with
mise run testbefore submitting changes. - Add or update tests when touching behavior (especially in
Services/andFeatures/).
Commits follow a Conventional style (type(scope): summary), for example fix(ci): add missing settings. Keep summaries imperative and under 72 characters, squash noisy WIPs, and include project.yml/Config/ updates when required to build. PRs should describe user impact, list verification commands, link related issues, attach UI screenshots when visuals change, and call out entitlement/signing or Info.plist updates. Ensure mise run lint, mise run test, and mise run build succeed before requesting review.
Never commit signing assets (*.p12, *.mobileprovision), API keys, or .env* files. Keep secrets out of Config/Info.plist, and update entitlements in Config/CaptureThis.entitlements only when adding capabilities.
Use Xcode refactoring when structure matters. It understands symbols and updates references without touching comments/strings.
- Refactors: rename types/functions, change initializer signatures, update protocol conformances.
- Safe API migrations across
Sources/.
Use rg when text is enough. It is fastest for literals, TODOs, config values, or non-code assets.
Rule of thumb:
- Need correctness and you plan to change code → Xcode Refactor.
- Need raw speed or you are just hunting text →
rg.
Snippets:
rg -n 'NSStatusItem' -t swift Sourcesrg -n 'TODO|FIXME' -t swiftopen CaptureThis.xcodeproj