Sources/CodexBar: Swift 6 menu bar app (usage/credits probes, icon renderer, settings). Keep changes small and reuse existing helpers.Tests/CodexBarTests: XCTest coverage for usage parsing, status probes, icon patterns; mirror new logic with focused tests.Scripts: build/package helpers (package_app.sh,sign-and-notarize.sh,make_appcast.sh,build_icon.sh,compile_and_run.sh).docs: release notes and process (docs/RELEASING.md, screenshots). Root-level zips/appcast are generated artifacts—avoid editing except during releases.
- Dev loop:
./Scripts/compile_and_run.shkills old instances, runsswift build+swift test, packages, relaunchesCodexBar.app, and confirms it stays running. - Quick build/test:
swift build(debug) orswift build -c release;swift testfor the full XCTest suite. - Package locally:
./Scripts/package_app.shto refreshCodexBar.app, then restart withpkill -x CodexBar || pkill -f CodexBar.app || true; cd /Users/steipete/Projects/codexbar && open -n /Users/steipete/Projects/codexbar/CodexBar.app. - Release flow:
./Scripts/sign-and-notarize.sh(arm64 notarized zip) and./Scripts/make_appcast.sh <zip> <feed-url>; follow validation steps indocs/RELEASING.md.
- Enforce SwiftFormat/SwiftLint: run
swiftformat Sources Testsandswiftlint --strict. 4-space indent, 120-char lines, explicitselfis intentional—do not remove. - Favor small, typed structs/enums; maintain existing
MARKorganization. Use descriptive symbols; match current commit tone.
- Add/extend XCTest cases under
Tests/CodexBarTests/*Tests.swift(FeatureNameTestswithtest_caseDescriptionmethods). - Always run
swift test(or./Scripts/compile_and_run.sh) before handoff; add fixtures for new parsing/formatting scenarios. - After any code change, run
pnpm checkand fix all reported format/lint issues before handoff.
- Commit messages: short imperative clauses (e.g., “Improve usage probe”, “Fix icon dimming”); keep commits scoped.
- PRs/patches should list summary, commands run, screenshots/GIFs for UI changes, and linked issue/reference when relevant.
- Use the provided scripts and package manager (SwiftPM); avoid adding dependencies or tooling without confirmation.
- Validate behavior against the freshly built bundle; restart via the pkill+open command above to avoid running stale binaries.
- To guarantee the right bundle is running after a rebuild, use:
pkill -x CodexBar || pkill -f CodexBar.app || true; cd /Users/steipete/Projects/codexbar && open -n /Users/steipete/Projects/codexbar/CodexBar.app. - After any code change that affects the app, always rebuild with
Scripts/package_app.shand restart the app using the command above before validating behavior. - If you edited code, run
scripts/compile_and_run.shbefore handoff; it kills old instances, builds, tests, packages, relaunches, and verifies the app stays running. - Per user request: after every edit (code or docs), rebuild and restart using
./Scripts/compile_and_run.shso the running app reflects the latest changes. - Release script: keep it in the foreground; do not background it—wait until it finishes.
- Release keys: find in
~/.profileif missing (Sparkle + App Store Connect). - Prefer modern SwiftUI/Observation macros: use
@Observablemodels with@Stateownership and@Bindablein views; avoidObservableObject,@ObservedObject, and@StateObject. - Favor modern macOS 15+ APIs over legacy/deprecated counterparts when refactoring (Observation, new display link APIs, updated menu item styling, etc.).
- Keep provider data siloed: when rendering usage or account info for a provider (Claude vs Codex), never display identity/plan fields sourced from a different provider.***
- Claude CLI status line is custom + user-configurable; never rely on it for usage parsing.
- Cookie imports: default Chrome-only when possible to avoid other browser prompts; override via browser list when needed.