AGENTS.md
packages/omo-opencode/src/shared/AGENTS.mdAGENTS.md
Quality
62/100
Scores the file, not the repository.Length
387 words
6 headings · 1 code blocksRepository
67k
— · pushed 0 days agoLast changed
2 days ago
First indexed 2 days ago.1# src/shared/ — Shared Adapter Utilities23**Generated:** 2026-05-2045## OVERVIEW67Cross-cutting adapter utilities used throughout the plugin. Barrel-exported from `index.ts`. Logger writes `oh-my-opencode.log` to the OS temp dir (Node's `os.tmpdir()` — `/tmp` on Linux, `%TEMP%` on Windows, etc.); rotated at 50 MB; up to 2 backups at `.1` / `.2`. Includes runtime shims for `Bun.file`, `Bun.write`, `Bun.hash`, `Bun.which`, `Bun.spawn` to support non-Bun runtimes (Electron-hosted OpenCode). Many former utility implementations are now extracted to Core packages such as `utils`, `model-core`, `tmux-core`, `telemetry-core`, and `skills-loader-core`; keep local files as stable OpenCode import shims when existing wiring depends on their paths.89## CATEGORY MAP1011| Category | Files | Key Exports |12|----------|-------|-------------|13| **Model Resolution** | ~22 | `resolveModel()`, `checkModelAvailability()`, `AGENT_MODEL_REQUIREMENTS` |14| **Tmux Integration** | 11 | `createTmuxSession()`, `spawnPane()`, `closePane()`, server health |15| **Configuration & Paths** | 10 | `resolveOpenCodeConfigDir()`, `getDataPath()`, `parseJSONC()` |16| **Session Management** | 8 | `SessionCursor`, `trackInjectedPath()`, `SessionToolsStore` |17| **Git Worktree** | 7 | `parseGitStatusPorcelain()`, `collectGitDiffStats()`, `formatFileChanges()` |18| **Command Execution** | 7 | `executeCommand()`, `executeHookCommand()`, embedded command registry |19| **Migration** | 6 | `migrateConfigFile()`, AGENT_NAME_MAP, HOOK_NAME_MAP, MODEL_VERSION_MAP |20| **String & Tool Utils** | 6 | `toSnakeCase()`, `normalizeToolName()`, `parseFrontmatter()` |21| **Agent Configuration** | 5 | `getAgentVariant()`, `AGENT_DISPLAY_NAMES`, `AGENT_TOOL_RESTRICTIONS` |22| **OpenCode Integration** | 5 | `injectServerAuth()`, `detectExternalPlugins()`, client accessors |23| **Type Helpers** | 4 | `deepMerge()`, `DynamicTruncator`, `matchPattern()`, `isRecord()` |24| **Misc** | 8 | `log()`, `readFile()`, `extractZip()`, `downloadBinary()`, `findAvailablePort()` |2526## MODEL RESOLUTION PIPELINE2728```29resolveModel(input)30 1. Override: UI-selected model (primary agents only)31 2. Category default: From category config32 3. Provider fallback: AGENT_MODEL_REQUIREMENTS chains33 4. System default: Ultimate fallback34```3536Key files: `model-resolver.ts` (entry), `model-resolution-pipeline.ts` (orchestration), `model-requirements.ts` (fallback chains), `model-availability.ts` (fuzzy matching).3738## MIGRATION SYSTEM3940Automatically transforms legacy config on load:41- `agent-names.ts`: Old agent names → new (e.g., `junior` → `sisyphus-junior`)42- `hook-names.ts`: Old hook names → new43- `model-versions.ts`: Old model IDs → current44- `agent-category.ts`: Legacy agent configs → category system4546## MOST IMPORTED4748| Utility | Import Count | Purpose |49|---------|-------------|---------|50| `logger.ts` | 62 | `oh-my-opencode.log` in `os.tmpdir()` (50 MB cap, rotates to `.1`/`.2`) |51| `data-path.ts` | 11 | XDG storage resolution |52| `model-requirements.ts` | 11 | Agent fallback chains |53| `system-directive.ts` | 11 | System message filtering |54| `frontmatter.ts` | 10 | YAML metadata extraction |55
Also in code-yeongyu/oh-my-openagent
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| code-yeongyu/oh-my-openagentpackages/omo-opencode/src/features/claude-code-agent-loader/AGENTS.md · 67k | AGENTS.md | archdeploymentagent-behaviour | 62/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentpackages/omo-opencode/src/features/claude-code-mcp-loader/AGENTS.md · 67k | AGENTS.md | lint-formatarchsecuritydeployment+1 | 66/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentpackages/omo-opencode/src/tools/background-task/AGENTS.md · 67k | AGENTS.md | arch | 70/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentscript/AGENTS.md · 67k | AGENTS.md | buildtestarchdeployment | 80/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentpackages/omo-opencode/src/features/claude-code-plugin-loader/AGENTS.md · 67k | AGENTS.md | archdeploymentagent-behaviour | 70/100 | 2 days ago | |
| code-yeongyu/oh-my-openagent.agents/AGENTS.md · 67k | AGENTS.md | stylearchtesting-strategydatabase | 64/100 | 2 days ago | |
| code-yeongyu/oh-my-openagent.opencode/AGENTS.md · 67k | AGENTS.md | stylearchdo-not | 71/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentAGENTS.md · 67k | AGENTS.md | setupbuildtestlint-format+11 | 84/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentassets/AGENTS.md · 67k | AGENTS.md | buildteststylearch | 88/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentbin/AGENTS.md · 67k | AGENTS.md | teststylearch | 64/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentpackages/AGENTS.md · 67k | AGENTS.md | buildtestlint-formatstyle+3 | 83/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentpackages/agents-md-core/AGENTS.md · 67k | AGENTS.md | archdependenciesapi | 48/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentpackages/boulder-state/AGENTS.md · 67k | AGENTS.md | archapi | 48/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentpackages/claude-code-compat-core/AGENTS.md · 67k | AGENTS.md | archagent-behaviour | 56/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentpackages/comment-checker-core/AGENTS.md · 67k | AGENTS.md | archdependenciesapi | 48/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentpackages/delegate-core/AGENTS.md · 67k | AGENTS.md | stylearchdependenciesapi | 60/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentpackages/git-bash-mcp/AGENTS.md · 67k | AGENTS.md | buildtestlint-formatarch+1 | 82/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentpackages/hashline-core/AGENTS.md · 67k | AGENTS.md | archtypesdependenciesapi | 48/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentpackages/lsp-core/AGENTS.md · 67k | AGENTS.md | archmonorepo | 43/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentpackages/lsp-daemon/AGENTS.md · 67k | AGENTS.md | buildtestlint-formatarch+1 | 89/100 | today |
Diff against packages/omo-opencode/src/features/claude-code-agent-loader/AGENTS.md Diff against packages/omo-opencode/src/features/claude-code-mcp-loader/AGENTS.md Diff against packages/omo-opencode/src/tools/background-task/AGENTS.md Diff against script/AGENTS.md Diff against packages/omo-opencode/src/features/claude-code-plugin-loader/AGENTS.md Diff against .agents/AGENTS.md Diff against .opencode/AGENTS.md Diff against AGENTS.md Diff against assets/AGENTS.md Diff against bin/AGENTS.md Diff against packages/AGENTS.md Diff against packages/agents-md-core/AGENTS.md Diff against packages/boulder-state/AGENTS.md Diff against packages/claude-code-compat-core/AGENTS.md Diff against packages/comment-checker-core/AGENTS.md Diff against packages/delegate-core/AGENTS.md Diff against packages/git-bash-mcp/AGENTS.md Diff against packages/hashline-core/AGENTS.md Diff against packages/lsp-core/AGENTS.md Diff against packages/lsp-daemon/AGENTS.md
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| aaif-goose/gooseAGENTS.md · 52k | AGENTS.md | setupbuildtestlint-format+6 | 100/100 | 3 days ago | |
| TryGhost/Ghoste2e/AGENTS.md · 55k | AGENTS.md | setupteststylearch+2 | 100/100 | 3 days ago | |
| duckduckgo/content-scope-scriptsspecial-pages/AGENTS.md · 70 | AGENTS.md | buildteststylearch+3 | 100/100 | 3 days ago | |
| n8n-io/n8npackages/@n8n/agents/AGENTS.md · 199k | AGENTS.md | buildteststylearch+3 | 100/100 | 3 days ago | |
| mui/material-uiAGENTS.md · 99k | AGENTS.md | setupbuildtestlint-format+9 | 100/100 | 3 days ago | |
| SkeneTechnologies/skene-cookbookAGENTS.md · 51 | AGENTS.md | setupbuildtestlint-format+7 | 100/100 | 2 days ago | |
| trick77/agents-md-syncAGENTS.md · 2 | AGENTS.md | setupbuildteststyle+5 | 100/100 | 3 days ago | |
| code-yeongyu/oh-my-openagentpackages/web/AGENTS.md · 67k | AGENTS.md | setupbuildtestlint-format+6 | 100/100 | 2 days ago |
