OpenBridge / macos
AGENTS.md430 starsChanged 6 months agoMITView on GitHub
This file provides guidance to coding agents working in macos/. Read repo-wide rules first: /AGENTS.md OpenBridge macOS app is a SwiftUI + AppKit + WebKit application that combines: Run from macos: After finishing a macOS app feature, prefer doing one end-to-end smoke pass with the mini-machine OpenBridge debug skill in DevKit/skill/ before wrapping up. Start with DevKit/skill/skill.md, use machine.sh to manage the remote macOS session, use publish_branch_for_machine.sh to snapshot local changes after a successful compile pass when needed, use setup_bridge_on_machine.sh…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,774 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 repository18 other files it gives its agents.
- AGENTS.mdAGENTS.md
- sandbox-vm/AGENTS.mdAGENTS.md
- web/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- macos/CLAUDE.mdCLAUDE.md
- sandbox-vm/CLAUDE.mdCLAUDE.md
- app-store-changelogSkill
- bridge-agent-log-analyzerSkill
- gh-issue-fix-flowSkill
- githubSkill
- react-component-performanceSkill
- swift-concurrency-expertSkill
- swift-concurrencySkill
- swift-testing-expertSkill
- swiftui-expert-skillSkill
- swiftui-performance-auditSkill
- swiftui-ui-patternsSkill
- swiftui-view-refactorSkill
The file
We split this AGENTS.md into the rules it gives an agent
8 rules. About 0 are common, 2 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 47
Use DevKit scripts instead of invoking xcodebuild manually.
- Distinctive: line 90
If you change payload shape in Go, update corresponding Swift + web mirror types together.
- Very specific: line 102
use String(localized:) for user-visible strings
- Very specific: line 103
never edit .xcstrings directly
- Very specific: line 108
Do not reference removed symbols like AgentTaskManager.
- Very specific: line 109
Do not document session storage as ~/.bridge/tasks.
- Very specific: line 110
Keep docs and bridge contracts aligned across Swift, Go, and web/src/embedded/*.
- Distinctive: line 111
Do not add comments that only explain chat context.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 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
macOS App (macos)
This file provides guidance to coding agents working in macos/.
Read repo-wide rules first:
/AGENTS.md
What This Component Is
OpenBridge macOS app is a SwiftUI + AppKit + WebKit application that combines:
- embedded AI chat UI
- local agent orchestration through vendored
kwwk - sandbox VM execution through
sandbox-vm
Current Structure
macos/
├── OpenBridge/
│ ├── Application/ app lifecycle (`AppDelegate`)
│ ├── Agent/ agent bridge (`AgentSessionManager`, `Session`, `SessionHistory`)
│ ├── Backend/ local services (settings, skills, storage helpers, etc.)
│ ├── Interface/ SwiftUI/AppKit views + controllers
│ ├── Helpers/ shared utilities + WebKitBridgeUI
│ ├── Resources/ kernel/rootfs, built-in assets, skills
│ └── ResourcesBundles/ localized strings + app assets
├── Frameworks/ local Swift packages (ComposerEditor, ...)
├── JSBridge/ bridge macros/codegen package
├── DevKit/Scripts/ build/test/release scripts
├── OpenBridgeUITests/
└── OpenBridgeUnitTests/Build and Test
Run from macos:
bash DevKit/Scripts/workspace_build_debug.shBUILD_CONFIGURATION=UnsignedDebug bash DevKit/Scripts/workspace_build_debug.shonly when the user explicitly asks for an unsigned local build or the target machine truly lacks signing certificatesbash DevKit/Scripts/workspace_test_unit.shbash DevKit/Scripts/workspace_test_ui.sh
After finishing a macOS app feature, prefer doing one end-to-end smoke pass with the mini-machine OpenBridge debug skill in DevKit/skill/ before wrapping up. Start with DevKit/skill/skill.md, use machine.sh to manage the remote macOS session, use publish_branch_for_machine.sh to snapshot local changes after a successful compile pass when needed, use setup_bridge_on_machine.sh to clone/build/open OpenBridge on the machine, and drive the actual UI with the vnc computer-use loop (get_screenshot -> inspect -> click/type/key -> re-screenshot).
Notes:
- Use DevKit scripts instead of invoking
xcodebuildmanually. - Build output goes to
.build/DerivedData/Build/Products/Debug/OpenBridge.app. - Default to signed
DebugorReleasefor local debugging, reproduction, UI validation, and anylocal-vmwork. TheUnsignedDebugconfiguration/profile uses ad-hoc bundle signing without a developer certificate and switches session auth storage from Keychain to local disk, so keep it limited to explicit unsigned requests or machines that cannot sign. - UI test script writes result bundle to
.build/TestResults/OpenBridgeUITests.xcresult. - Unit test script writes result bundle to
.build/TestResults/OpenBridgeUnitTests.xcresult.
Swift ↔ Go Agent Boundary
Main bridge code:
OpenBridge/Agent/AgentSessionManager.swiftOpenBridge/Agent/LocalRuntime/LocalAgentSession.swiftOpenBridge/Agent/SessionHistory.swiftOpenBridge/Agent/LocalRuntime/LocalAgentEventAdapter.swift
Important behaviors:
- app preloads VM runtime on launch (
AgentSessionManager.shared.preload()) - each chat conversation maps to one local KWWK agent session
- history and runtime events are emitted locally into the existing chat UI contract
- workspace accept/discard flows call
applySessionDiff/discardSessionAllChanges
Swift ↔ WebView Boundary
Key files:
OpenBridge/Interface/WebViews/ChatWebView.swiftOpenBridge/Interface/Chat/MessagesBridge.swift
Embedded assets loaded from app bundle:
WebKitBridgeResources/ChatAssets/chat.htmlWebKitBridgeResources/PreviewAssets/preview.html
In Debug, embedded surfaces can be pointed at localhost dev servers explicitly via environment configuration; do not rely on missing bundled assets as the switch.
Event Contracts You Must Respect
History message schema in Swift mirror:
SessionHistoryMessage(message,task,question,question_reply,sandbox_*)AssistantState
If you change payload shape in Go, update corresponding Swift + web mirror types together.
High-Impact Areas
OpenBridge/Backend/SettingsManager/: persisted local settings and feature togglesOpenBridge/Backend/Skills/: local skill install/update lifecycleOpenBridge/Backend/Supplements/: local media and storage helpersOpenBridge/Interface/Chat/: message sending, retry, confirmations, attachmentsOpenBridge/Interface/Windows/: panel/window lifecycle
Localization Rules
- use
String(localized:)for user-visible strings - never edit
.xcstringsdirectly - use
macos/DevKit/XcodeStringsHelper/i18n.py apply
Guardrails for Agents
- Do not reference removed symbols like
AgentTaskManager. - Do not document session storage as
~/.bridge/tasks; runtime now uses sessions. - Keep docs and bridge contracts aligned across Swift, Go, and
web/src/embedded/*. - Do not add comments that only explain chat context; comments must be durable.
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.

