CodexBar-Mobile
AGENTS.md71 starsChanged 57 days agoMITView on GitHub
This file is the repo-level routing and quality gate for AI agents working on CodexBar Mobile (iOS). Detailed operational workflows live in skills. Scope: We only work on the iOS app (CodexBarMobile/). Mac-side code is maintained upstream. Current upstream alignment: see version.env at repo root — UPSTREAM_VERSION and UPSTREAM_SYNC_DATE are the authoritative fields. Do NOT consult plan.md for this — it's a human-curated planning doc and lags reality. - Use $codexbar-git-workflow for branch creation, commit cadence, Git/GitHub push, PR, review…
- Reads credentials
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository6 other files it gives its agents.
- docs/claude.mdCLAUDE.md
- docs/llms.txtllms.txt
- codexbar-git-workflowSkill
- codexbarSkill
- qa-testSkill
- release-codexbarSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
45 rules. About 0 are common, 19 are distinctive, and 26 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈19
Distinctive · estimate
This author's own choices. Worth a look.
26
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 12
Use $codexbar-git-workflow for branch creation, commit cadence, Git/GitHub push, PR, review loop, branch cleanup, and Todoist handoff.
- Very specific: line 14
Use $release-codexbar for Mac signing/notarization/appcast/GitHub release work.
- Very specific: line 16
Use $qa-test for live provider QA, menu proof, and release smoke tests.
- Distinctive: line 22
Every feature or fix follows these 7 steps in order:
- Very specific: line 56
Use Git/GitHub for branch and commit operations.
- Distinctive: line 97
Before writing any code, understand the problem space.
- Distinctive: line 99
Read relevant source code, SDK docs, and real synced data
- Distinctive: line 100
Check upstream (steipete/CodexBar) for existing implementations or open PRs
- Distinctive: line 105
Write or update the research doc with chosen approach, data models, key files
- Distinctive: line 122
Follow protocol-first design: define interfaces before writing logic
- Distinctive: line 124
Follow all coding rules below (localization, file conventions, etc.)
- Distinctive: line 129
Run unit tests if applicable
- Distinctive: line 130
Verify on simulator or real device as needed
- Distinctive: line 131
Add or extend XCTest / Swift Testing coverage for provider, parser, model, and settings changes.
- Very specific: line 134
Run focused swift test --filter ...
- Very specific: line 136
Never run tests/checks or ad-hoc validation that can display macOS Keychain prompts.
- Very specific: line 148
Every PR update runs only PR Fast Checks (portable lint and policy guards).
- Very specific: line 155
Never resolve an upstream workflow conflict by restoring heavy CI on PR synchronize events.
- Distinctive: line 164
After code is complete:
- Very specific: line 166
Update CodexBarMobile/CHANGELOG.md — Keep a Changelog format (Added / Changed / Fixed)
- Very specific: line 167
Update in-app release notes in MobileReleaseNotesCatalog (in ContentView.swift) — plain language, 4-language localized
- Distinctive: line 169
Check if an existing line already covers this feature area.
- Distinctive: line 170
If yes → merge the new detail into that line (rewrite it to include the update).
- Distinctive: line 171
If no existing line covers it → add a new line.
- Very specific: line 172
Only create a separate ReleaseNotesVersion entry when MARKETING_VERSION itself changes (e.g.
- Very specific: line 173
Update research doc status to done
- Very specific: line 184
When work needs a branch, commit, push, PR, review loop, branch cleanup, or Todoist status update, load and follow $codexbar-git-workflow.
- Very specific: line 187
Before merging any PR, wait for Codex Code Review on the exact current head, fix and retest every finding, reply and explicitly resolve …
- Very specific: line 190
Run Scripts/check_pr_review_gate.sh <pr> immediately before merge.
- Distinctive: line 228
All builds (Mac and iOS) must use CloudKit Production environment:
- Distinctive: line 234
If this entitlement is missing, Mac defaults to Development environment and TestFlight iOS uses Production — data goes to different …
- Very specific: line 238
Before every Mac release: run the audit in docs/cloudkit-deploy-audit.md to decide whether the Production schema needs a Dashboard deploy.
- Distinctive: line 242
When the user asks to upload / archive / release:
- Very specific: line 265
Update CHANGELOG.md — Mobile changes first, upstream second
- Very specific: line 268
Create GitHub release on o1xhack/CodexBar-Mobile (not upstream)
- Very specific: line 279
Use Git/GitHub for branch, commit, push, PR, review, and branch cleanup work.
- Very specific: line 280
Do not use jj unless the user explicitly re-enables it.
- Very specific: line 285
Do not modify Mac-only files such as Sources/ or Tests/ unless the user explicitly asks for Mac/upstream-sync/release work.
- Very specific: line 287
Never push to upstream; only push to origin.
- Distinctive: line 291
After the merge, separately audit the upstream README diff for factual product, security, or troubleshooting changes and deliberately adapt …
- Very specific: line 297
Do not hand-edit .xcodeproj.
- Distinctive: line 299
Do not skip build numbers, changelog, release notes, CloudKit audit, or localization checks when their step applies.
- Very specific: line 301
Do not add full build/test matrices to PR update events.
- Very specific: line 311
All strings use String(localized:) — the key is the English text itself
- Very specific: line 313
Every entry must have all 4 translations with "state": "translated"
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CodexBar Mobile — Agent Workflow
This file is the repo-level routing and quality gate for AI agents working on CodexBar Mobile (iOS). Detailed operational workflows live in skills.
Scope: We only work on the iOS app (
CodexBarMobile/). Mac-side code is maintained upstream.Current upstream alignment: see
version.envat repo root —UPSTREAM_VERSIONandUPSTREAM_SYNC_DATEare the authoritative fields. Do NOT consultplan.mdfor this — it's a human-curated planning doc and lags reality.
Required Skills
- Use
$codexbar-git-workflowfor branch creation, commit cadence, Git/GitHub push, PR, review loop, branch cleanup, and Todoist handoff. - Use
$release-codexbarfor Mac signing/notarization/appcast/GitHub release work. - Use
$qa-testfor live provider QA, menu proof, and release smoke tests.
Development Lifecycle
Every feature or fix follows these 7 steps in order:
┌───────────────────┬─────────────────────────────────────────────────┬─────────────────────┐
│ Step │ Description │ Output │
├───────────────────┼─────────────────────────────────────────────────┼─────────────────────┤
│ 1. Research │ Understand the problem, read code/SDK/data │ Root cause or │
│ │ Check upstream repo + PRs for prior art │ requirements doc │
├───────────────────┼─────────────────────────────────────────────────┼─────────────────────┤
│ 2. Design │ Write research doc in Research/, mark draft │ Research/NNN-*.md │
│ │ Get user confirmation on approach │ │
├───────────────────┼─────────────────────────────────────────────────┼─────────────────────┤
│ 3. Implementation │ Write code in phases, protocol-first │ Code changes │
├───────────────────┼─────────────────────────────────────────────────┼─────────────────────┤
│ 4. Testing │ Build, simulator, real device if needed │ Tests pass │
├───────────────────┼─────────────────────────────────────────────────┼─────────────────────┤
│ 5. Documentation │ Update CHANGELOG, in-app release notes, │ Traceable record │
│ │ research doc status → done │ │
├───────────────────┼─────────────────────────────────────────────────┼─────────────────────┤
│ 6. Commit │ Branch/commit/GitHub handoff via skill │ git commit / PR │
├───────────────────┼─────────────────────────────────────────────────┼─────────────────────┤
│ 7. Push & Release │ Push to remote, archive, upload to TestFlight │ User-installable │
└───────────────────┴─────────────────────────────────────────────────┴─────────────────────┘Repository map
| Remote / branch | Role |
upstream / steipete/CodexBar | Original open-source repo, read only |
origin / o1xhack/CodexBar-Mobile | Our fork |
mobile-dev | Main working branch |
main | Upstream-alignment branch; do not modify directly |
Use Git/GitHub for branch and commit operations. Create a task branch before
implementation unless the request is read-only. Do not require Goal prompts to
spell out branch names; choose the right branch shape from
$codexbar-git-workflow.
Definition of Done for release / upstream-sync work
For release and upstream-sync tasks, done means user-installable artifacts exist, not just "code committed" or "pushed":
- Mac: signed + notarized Sparkle draft/release flow completed as requested
- iOS: archive/export/upload flow completed when upload/TestFlight is in scope
- appcast, versioning, CloudKit audit, release notes, and Todoist state are updated
Credentials live on the user's Mac. CodexBar-specific release secrets such as
Sparkle live under ~/.codexbar-secrets/; Apple App Store Connect App Manager
credentials are global Apple release/signing credentials under
~/.codex-secrets/apple/app-store-connect/; the Developer ID certificate is in
Keychain. When the user has authorized release/upload work, run the release
commands on this machine instead of only listing commands for the user. The
complete release gate is
docs/RELEASE-CHECKLIST.md; read it before every
release or upstream-sync completion check.
Collaboration roles
| User intent | Agent role | Action |
| 调研 / research | Architect | Run Steps 1-2 and write/update Research/ |
| 开发 / implement | Developer | Run Steps 3-4 with focused implementation + tests |
| 开分支 / branch | Developer | Use $codexbar-git-workflow |
| 提交 | Release Engineer | Use $codexbar-git-workflow commit flow |
| 提交推送 / PR | Release Engineer | Use $codexbar-git-workflow push/PR/Todoist flow |
| 上传 / Archive | Release Engineer | Run Step 7 archive/upload flow |
| 安装到手机 | Release Engineer | Generate project if needed and install to a real device |
Step 1 — Research
Before writing any code, understand the problem space.
- Read relevant source code, SDK docs, and real synced data
- Check upstream (steipete/CodexBar) for existing implementations or open PRs
- Save findings to
CodexBarMobile/Research/NNN-feature-name.md
Step 2 — Design
- Write or update the research doc with chosen approach, data models, key files
- Set status appropriately (see research status flow below)
- Get user confirmation before proceeding to implementation
Research document status flow
draft → ready → in-progress → done
│
├→ blocked-upstream (waiting for upstream PR to merge)
└→ dropped (decided not to pursue)Full status definitions and index are in CodexBarMobile/Research/README.md.
Step 3 — Implementation
- Follow protocol-first design: define interfaces before writing logic
- Phase large features into incremental, buildable steps
- Follow all coding rules below (localization, file conventions, etc.)
Step 4 — Testing
- Build with
xcodebuildto verify compilation - Run unit tests if applicable
- Verify on simulator or real device as needed
- Add or extend XCTest / Swift Testing coverage for provider, parser, model, and settings changes. Prefer backticked sentence names for Swift Testing cases and clear fictitious model names when test data is synthetic.
- Run focused
swift test --filter ...checks for parser/provider fixes when possible, then the broader gate required by the release checklist. - Never run tests/checks or ad-hoc validation that can display macOS Keychain prompts. Live provider probes, browser-cookie imports,
codexbar usageagainst real accounts, and real SecItem reads must be explicitly requested; otherwise use parser tests, stubs, test stores, orKeychainNoUIQuery. - App-group migration tests must inject dictionary-backed defaults, both snapshot URLs, a synthetic home, and a contained recording FileManager. UUID defaults suites and Keychain isolation flags do not isolate defaults search domains or filesystem access. Ordinary SettingsStore tests must not discover shared defaults or run app-group migration.
- macOS CI is brittle around headless AppKit status/menu tests. Prefer covering menu behavior through stable state/model seams (
MenuDescriptor,ProvidersPane,CodexAccountsSectionState, etc.) instead of constructing liveNSStatusBar/NSMenuflows unless the AppKit wiring itself is the thing under test.
Multi-device iCloud Sync Compatibility Gate
When a release changes Mac→CloudKit→iOS sync, Shared payloads, CloudKit schema, provider display data, cache behavior, or cross-version rendering, testing must follow docs/ios-sync-compatibility-testing.md. This is the canonical 2 Mac × 2 iPhone old/new compatibility gate. The release Research/NNN-*/03-testing.md records that release's actual pass/fail/substituted evidence; it is not the source of the reusable rule.
CI Policy — Fork Invariant
CI uses the durable two-layer policy in docs/ci-policy.md:
- Every PR update runs only
PR Fast Checks(portable lint and policy guards). - Expensive macOS/Linux matrices run once after merge, selected by the final diff, or by explicit manual full-CI dispatch.
- A verified
upstream-sync/*merge reuses the published upstream release's successful heavy checks; fork-specific local/release gates still apply. - During upstream merges, preserve
.github/workflows/pr-fast.yml, the fork trigger model in.github/workflows/ci.yml, andScripts/check_ci_policy.sh. Never resolve an upstream workflow conflict by restoring heavy CI on PRsynchronizeevents.
Scripts/check_ci_policy.sh is part of portable lint and fails if another
workflow adds a PR update trigger or the fast workflow gains heavy jobs. This
policy is repository state, not agent memory.
Step 5 — Documentation
After code is complete:
- Update
CodexBarMobile/CHANGELOG.md— Keep a Changelog format (Added / Changed / Fixed) - Update in-app release notes in
MobileReleaseNotesCatalog(inContentView.swift) — plain language, 4-language localized- Same MARKETING_VERSION = same release notes block. As long as only the build number changes (e.g. 1.0.0 (15) → 1.0.0 (16)), all changes belong to the same release notes entry. Before adding a new line:
- Check if an existing line already covers this feature area.
- If yes → merge the new detail into that line (rewrite it to include the update).
- If no existing line covers it → add a new line.
- Only create a separate
ReleaseNotesVersionentry whenMARKETING_VERSIONitself changes (e.g. 1.0.0 → 1.1.0).
- Same MARKETING_VERSION = same release notes block. As long as only the build number changes (e.g. 1.0.0 (15) → 1.0.0 (16)), all changes belong to the same release notes entry. Before adding a new line:
- Update research doc status to
done
Release notes — two audiences
| File | Audience | Style |
CodexBarMobile/CHANGELOG.md | Developers, App Review | Technical, concise |
MobileReleaseNotesCatalog in ContentView.swift | End users (in-app) | Plain language, no jargon, localized |
Step 6 — Branch, Commit & GitHub Handoff
When work needs a branch, commit, push, PR, review loop, branch cleanup, or
Todoist status update, load and follow $codexbar-git-workflow.
Before merging any PR, wait for Codex Code Review on the exact current head,
fix and retest every finding, reply and explicitly resolve every review thread,
then request another review. PR Fast Checks being green is not sufficient.
Run Scripts/check_pr_review_gate.sh <pr> immediately before merge. If review
exceeds five rounds, pause before round six to audit the shared root/design
problem and revise the approach; do not keep stacking symptom-level patches.
The PR comment must use the exact non-empty Head, Repeated finding pattern,
Root design/requirements problem, and Revised approach fields documented in
$codexbar-git-workflow.
Merge, tag creation, and public release/appcast work remain blocked until this gate passes.
TestFlight is an independent beta workflow: an authorized upload does not require
a PR, a clean CR gate, a merge, or remote CI completion. Keep local build/test,
versioning, four-language notes, signing, and CloudKit Production checks; record
the source commit and any known beta validation gaps. Before App Review/public
release, verify that the selected ASC build was archived from the clean reviewed
release code/resources/build configuration/version, using recorded source and
artifact provenance. If review fixes changed shipped inputs or provenance is
missing, archive/upload a new build; a later clean PR does not validate an older
unreviewed binary.
For large Goals, the agent may make staged Git commits when the Goal or user authorizes implementation work. Do not push, merge, tag, publish a live release, or upload unless the user explicitly asks or the active Goal explicitly includes that handoff.
Version number format
iOS (project.yml) — these are CFBundle fields:
MARKETING_VERSION= user-facing version, e.g.1.7.0(feature releases only)CURRENT_PROJECT_VERSION= build number, e.g.129- Displayed as: 1.7.0 (129)
Mac (version.env) — fork-specific scheme with subdecimal patches.
Full rules + decision tree + sparkle:version explanation:
→ docs/versioning.md (read this first when bumping
Mac MARKETING_VERSION / BUILD_NUMBER / MOBILE_VERSION / UPSTREAM_VERSION).
Step 7 — Push & Release
CloudKit Environment — CRITICAL
All builds (Mac and iOS) must use CloudKit Production environment:
- Mac (
Scripts/package_app.sh): entitlements must includecom.apple.developer.icloud-container-environment=Production - iOS (
CodexBarMobile/CodexBarMobile.entitlements): must includecom.apple.developer.icloud-container-environment=Production - iOS via Xcode debug: also uses Production (set in entitlements), so Xcode installs and TestFlight share the same CloudKit database
If this entitlement is missing, Mac defaults to Development environment and TestFlight iOS uses Production — data goes to different databases and sync appears broken.
CloudKit Schema Deploy — pre-release audit
Before every Mac release: run the audit in docs/cloudkit-deploy-audit.md to decide whether the Production schema needs a Dashboard deploy. Catches the recurring "I added a field but forgot to deploy" trap. Verdict table + grep commands + historical record live in that doc.
iOS — Archive & Upload
When the user asks to upload / archive / release:
# 1. Generate Xcode project
cd CodexBarMobile && xcodegen generate
# 2. Archive
xcodebuild -project CodexBarMobile.xcodeproj -scheme CodexBarMobile \
-destination 'generic/platform=iOS' -configuration Release \
-archivePath /tmp/CodexBarMobile.xcarchive archive -allowProvisioningUpdates
# 3. Export & upload to App Store Connect
xcodebuild -exportArchive \
-archivePath /tmp/CodexBarMobile.xcarchive \
-exportOptionsPlist /tmp/ExportOptions.plist \
-allowProvisioningUpdatesMac — Sign, Notarize & Release
Complete workflow: docs/RELEASING-MOBILE.md
Quick summary:
- Update
CHANGELOG.md— Mobile changes first, upstream second ./Scripts/sign-and-notarize.sh— builds, signs withDeveloper ID Application: Yuxiao Wang (3TUERHN53E), notarizes- Generate appcast with
make_appcast.sh(setSPARKLE_DOWNLOAD_URL_PREFIXto full tag URL) - Create GitHub release on
o1xhack/CodexBar-Mobile(not upstream) - Push appcast to
mobile-dev
Build number: BUILD_NUMBER.MOBILE_VERSION (e.g. 53.1.1.0). See docs/sparkle.md for details.
Coding Rules
Version Control — Git/GitHub
Use Git/GitHub for branch, commit, push, PR, review, and branch cleanup work.
Do not use jj unless the user explicitly re-enables it. Operational details
belong in $codexbar-git-workflow, not in individual Goal prompts.
Operational guardrails
- Do not modify Mac-only files such as
Sources/orTests/unless the user explicitly asks for Mac/upstream-sync/release work. - Never push to
upstream; only push toorigin. README.mdis the fork-owned iOS/Mac download entrypoint. During every upstream merge or conflict resolution, keep it byte-for-byte from the fork (mobile-dev) side; never accept or incidentally port the upstream README. After the merge, separately audit the upstream README diff for factual product, security, or troubleshooting changes and deliberately adapt only applicable text without replacing fork identity/download content.Scripts/check_fork_readme.shenforces the resulting reviewed fork content hash. Do not update that hash merely to make an upstream sync pass; update it only with an intentional, separately reviewed fork README change.- Do not hand-edit
.xcodeproj; updateproject.ymland runxcodegen generate. - Do not skip build numbers, changelog, release notes, CloudKit audit, or localization checks when their step applies.
- Do not add full build/test matrices to PR update events. Follow
docs/ci-policy.md; full CI belongs after merge or explicit manual dispatch.
Localization — Mandatory 4-Language Rule
Every user-facing text change MUST include all 4 languages. No exceptions.
Languages: English (en), Simplified Chinese (zh-Hans), Traditional Chinese (zh-Hant), Japanese (ja).
- Source language is English
- All strings use
String(localized:)— the key is the English text itself - Translations live in
Localizable.xcstrings(JSON format) - Every entry must have all 4 translations with
"state": "translated"
Needs translation: UI labels, buttons, titles, descriptions, footers, placeholders, error messages, in-app release notes, onboarding text, empty states.
Does NOT need translation: Code comments, log messages, debug strings, accessibility identifiers, keys, enum raw values, format specifiers.
Self-check before finishing
- Every new
String(localized:)has a matching entry inLocalizable.xcstrings - Every entry has all 4 languages with
"state": "translated" - No
"state": "new"or missing language keys left behind
Quick Reference
Trigger phrases
| User says | Action |
| 调研 | Steps 1–2 (research, save to Research/) |
| 开发 / implement | Steps 3–4 (implementation + tests) |
| 开分支 / branch | Use $codexbar-git-workflow |
| 提交 | Use $codexbar-git-workflow commit flow |
| 提交推送 / PR | Use $codexbar-git-workflow push/PR/Todoist flow |
| 上传 / Archive | Step 7 (xcodegen, archive, upload to TestFlight) |
| 安装到手机 | Generate project if needed, then install to a real device |
Key paths
| Path | Purpose |
AGENTS.md | This file — repo routing and quality gates |
.agents/skills/codexbar-git-workflow/SKILL.md | Git/GitHub branch, commit, push, PR, and handoff workflow |
CodexBarMobile/Research/ | Feature research docs |
CodexBarMobile/project.yml | Build number + version |
CodexBarMobile/CHANGELOG.md | Technical changelog |
CodexBarMobile/CodexBarMobile/ContentView.swift | Main views + in-app release notes |
CodexBarMobile/CodexBarMobile/Localizable.xcstrings | 4-language translations |
CodexBarMobile/CodexBarMobile/Views/ | Feature views |
CodexBarMobile/CodexBarMobile/Models/ | Data models and formatters |
CodexBarMobile/CodexBarMobile/Preview Content/PreviewData.swift | Demo / preview data |
CodexBarMobile/Shared/ | Shared iCloud sync layer |
version.env | Current ship version + upstream alignment (UPSTREAM_VERSION, UPSTREAM_SYNC_DATE) |
docs/versioning.md | Mac/iOS versioning decision tree and Sparkle rules |
docs/cloudkit-deploy-audit.md | CloudKit Production schema deploy audit |
docs/ios-sync-compatibility-testing.md | Canonical 2 Mac × 2 iPhone old/new sync compatibility gate |
docs/RELEASE-CHECKLIST.md | Release/upstream-sync Definition of Done and acceptance checklist |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

