Skip to content

Commit fd72ce5

Browse files
committed
docs: update AGENTS.md knowledge base (043b1a3)
- Add 7 missing hooks, remove deleted background-compaction - Update line counts (atlas 572, sisyphus 450, config-manager 664) - Add 18 undocumented shared utilities, remove stale references - Add task-toast-manager, remove-deadcode command - Update test count 90→95, add 4 complexity hotspots
1 parent 043b1a3 commit fd72ce5

7 files changed

Lines changed: 58 additions & 24 deletions

File tree

AGENTS.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# PROJECT KNOWLEDGE BASE
22

3-
**Generated:** 2026-01-23T15:59:00+09:00
4-
**Commit:** 599fad0e
3+
**Generated:** 2026-01-25T13:10:00+09:00
4+
**Commit:** 043b1a33
55
**Branch:** dev
66

77
## OVERVIEW
@@ -21,7 +21,7 @@ oh-my-opencode/
2121
│ ├── cli/ # CLI installer, doctor - see src/cli/AGENTS.md
2222
│ ├── mcp/ # Built-in MCPs - see src/mcp/AGENTS.md
2323
│ ├── config/ # Zod schema, TypeScript types
24-
│ └── index.ts # Main plugin entry (593 lines)
24+
│ └── index.ts # Main plugin entry (601 lines)
2525
├── script/ # build-schema.ts, build-binaries.ts
2626
├── packages/ # 7 platform-specific binaries
2727
└── dist/ # Build output (ESM + .d.ts)
@@ -36,6 +36,7 @@ oh-my-opencode/
3636
| Add tool | `src/tools/` | Dir with index/types/constants/tools.ts |
3737
| Add MCP | `src/mcp/` | Create config, add to index.ts |
3838
| Add skill | `src/features/builtin-skills/` | Create dir with SKILL.md |
39+
| Add command | `src/features/builtin-commands/` | Add template + register in commands.ts |
3940
| Config schema | `src/config/schema.ts` | Zod schema, run `bun run build:schema` |
4041
| Background agents | `src/features/background-agent/` | manager.ts (1335 lines) |
4142
| Orchestrator | `src/hooks/atlas/` | Main orchestration hook (773 lines) |
@@ -60,7 +61,7 @@ oh-my-opencode/
6061
- **Build**: `bun build` (ESM) + `tsc --emitDeclarationOnly`
6162
- **Exports**: Barrel pattern via index.ts
6263
- **Naming**: kebab-case dirs, `createXXXHook`/`createXXXTool` factories
63-
- **Testing**: BDD comments, 90 test files
64+
- **Testing**: BDD comments, 95 test files
6465
- **Temperature**: 0.1 for code agents, max 0.3
6566

6667
## ANTI-PATTERNS
@@ -99,7 +100,7 @@ oh-my-opencode/
99100
bun run typecheck # Type check
100101
bun run build # ESM + declarations + schema
101102
bun run rebuild # Clean + Build
102-
bun test # 90 test files
103+
bun test # 95 test files
103104
```
104105

105106
## DEPLOYMENT
@@ -118,7 +119,11 @@ bun test # 90 test files
118119
| `src/agents/prometheus-prompt.ts` | 1196 | Planning agent |
119120
| `src/tools/delegate-task/tools.ts` | 1039 | Category-based delegation |
120121
| `src/hooks/atlas/index.ts` | 773 | Orchestrator hook |
121-
| `src/cli/config-manager.ts` | 641 | JSONC config parsing |
122+
| `src/cli/config-manager.ts` | 664 | JSONC config parsing |
123+
| `src/features/builtin-commands/templates/refactor.ts` | 619 | Refactor command template |
124+
| `src/index.ts` | 601 | Main plugin entry |
125+
| `src/tools/lsp/client.ts` | 596 | LSP JSON-RPC client |
126+
| `src/agents/atlas.ts` | 572 | Atlas orchestrator agent |
122127

123128
## MCP ARCHITECTURE
124129

src/agents/AGENTS.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@
88

99
```
1010
agents/
11-
├── atlas.ts # Master Orchestrator (543 lines)
12-
├── sisyphus.ts # Main prompt (615 lines)
13-
├── sisyphus-junior.ts # Delegated task executor
14-
├── dynamic-agent-prompt-builder.ts # Dynamic prompt generation
11+
├── atlas.ts # Master Orchestrator (572 lines)
12+
├── sisyphus.ts # Main prompt (450 lines)
13+
├── sisyphus-junior.ts # Delegated task executor (135 lines)
14+
├── dynamic-agent-prompt-builder.ts # Dynamic prompt generation (359 lines)
1515
├── oracle.ts # Strategic advisor (GPT-5.2)
16-
├── librarian.ts # Multi-repo research (GLM-4.7-free)
16+
├── librarian.ts # Multi-repo research (326 lines)
1717
├── explore.ts # Fast grep (Grok Code)
1818
├── multimodal-looker.ts # Media analyzer (Gemini 3 Flash)
1919
├── prometheus-prompt.ts # Planning (1196 lines)
20-
├── metis.ts # Plan consultant
21-
├── momus.ts # Plan reviewer
20+
├── metis.ts # Plan consultant (315 lines)
21+
├── momus.ts # Plan reviewer (444 lines)
2222
├── types.ts # AgentModelConfig, AgentPromptMetadata
2323
├── utils.ts # createBuiltinAgents(), resolveModelWithFallback()
2424
└── index.ts # builtinAgents export

src/cli/AGENTS.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ CLI entry: `bunx oh-my-opencode`. Interactive installer, doctor diagnostics. Com
1010
cli/
1111
├── index.ts # Commander.js entry
1212
├── install.ts # Interactive TUI (520 lines)
13-
├── config-manager.ts # JSONC parsing (641 lines)
13+
├── config-manager.ts # JSONC parsing (664 lines)
1414
├── types.ts # InstallArgs, InstallConfig
15+
├── model-fallback.ts # Model fallback configuration
1516
├── doctor/
1617
│ ├── index.ts # Doctor entry
1718
│ ├── runner.ts # Check orchestration
@@ -25,6 +26,7 @@ cli/
2526
│ ├── dependencies.ts # AST-Grep, Comment Checker
2627
│ ├── lsp.ts # LSP connectivity
2728
│ ├── mcp.ts # MCP validation
29+
│ ├── model-resolution.ts # Model resolution check
2830
│ └── gh.ts # GitHub CLI
2931
├── run/
3032
│ └── index.ts # Session launcher

src/features/AGENTS.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ features/
1212
│ ├── manager.ts # Launch → poll → complete
1313
│ ├── concurrency.ts # Per-provider limits
1414
│ └── types.ts # BackgroundTask, LaunchInput
15-
├── skill-mcp-manager/ # MCP client lifecycle
15+
├── skill-mcp-manager/ # MCP client lifecycle (520 lines)
1616
│ ├── manager.ts # Lazy loading, cleanup
1717
│ └── types.ts # SkillMcpConfig
1818
├── builtin-skills/ # Playwright, git-master, frontend-ui-ux
1919
│ └── skills.ts # 1203 lines
20-
├── builtin-commands/ # ralph-loop, refactor, init-deep
20+
├── builtin-commands/ # ralph-loop, refactor, init-deep, start-work, remove-deadcode
21+
│ ├── commands.ts # Command registry
22+
│ └── templates/ # Command templates (4 files)
2123
├── claude-code-agent-loader/ # ~/.claude/agents/*.md
2224
├── claude-code-command-loader/ # ~/.claude/commands/*.md
2325
├── claude-code-mcp-loader/ # .mcp.json
@@ -26,7 +28,8 @@ features/
2628
├── opencode-skill-loader/ # Skills from 6 directories
2729
├── context-injector/ # AGENTS.md/README.md injection
2830
├── boulder-state/ # Todo state persistence
29-
└── hook-message-injector/ # Message injection
31+
├── hook-message-injector/ # Message injection
32+
└── task-toast-manager/ # Background task notifications
3033
```
3134

3235
## LOADER PRIORITY

src/hooks/AGENTS.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
hooks/
1111
├── atlas/ # Main orchestration (773 lines)
1212
├── anthropic-context-window-limit-recovery/ # Auto-summarize
13-
├── todo-continuation-enforcer.ts # Force TODO completion
13+
├── todo-continuation-enforcer.ts # Force TODO completion (489 lines)
1414
├── ralph-loop/ # Self-referential dev loop
1515
├── claude-code-hooks/ # settings.json compat layer - see AGENTS.md
1616
├── comment-checker/ # Prevents AI slop
@@ -28,7 +28,15 @@ hooks/
2828
├── prometheus-md-only/ # Planner read-only mode
2929
├── agent-usage-reminder/ # Specialized agent hints
3030
├── auto-update-checker/ # Plugin update check
31-
└── tool-output-truncator.ts # Prevents context bloat
31+
├── tool-output-truncator.ts # Prevents context bloat
32+
├── compaction-context-injector/ # Injects context on compaction
33+
├── delegate-task-retry/ # Retries failed delegations
34+
├── interactive-bash-session/ # Tmux session management
35+
├── non-interactive-env/ # Non-TTY environment handling
36+
├── start-work/ # Sisyphus work session starter
37+
├── task-resume-info/ # Resume info for cancelled tasks
38+
├── question-label-truncator/ # Auto-truncates question labels >30 chars
39+
└── index.ts # Hook aggregation + registration
3240
```
3341

3442
## HOOK EVENTS

src/shared/AGENTS.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## OVERVIEW
44

5-
50 cross-cutting utilities: path resolution, token truncation, config parsing, model resolution.
5+
34 cross-cutting utilities: path resolution, token truncation, config parsing, model resolution, agent display names.
66

77
## STRUCTURE
88

@@ -19,12 +19,27 @@ shared/
1919
├── migration.ts # Legacy config migration
2020
├── opencode-version.ts # Version comparison
2121
├── external-plugin-detector.ts # OAuth spoofing detection
22-
├── env-expander.ts # ${VAR} expansion
2322
├── model-requirements.ts # Agent/Category requirements
2423
├── model-availability.ts # Models fetch + fuzzy match
2524
├── model-resolver.ts # 3-step resolution
25+
├── model-sanitizer.ts # Model ID normalization
2626
├── shell-env.ts # Cross-platform shell
27-
├── prompt-parts-helper.ts # Prompt manipulation
27+
├── agent-display-names.ts # Agent display name mapping
28+
├── agent-tool-restrictions.ts # Tool restriction helpers
29+
├── agent-variant.ts # Agent variant detection
30+
├── command-executor.ts # Subprocess execution
31+
├── config-errors.ts # Config error types
32+
├── deep-merge.ts # Deep object merge
33+
├── file-reference-resolver.ts # File path resolution
34+
├── file-utils.ts # File utilities
35+
├── hook-disabled.ts # Hook enable/disable check
36+
├── pattern-matcher.ts # Glob pattern matching
37+
├── session-cursor.ts # Session cursor tracking
38+
├── snake-case.ts # String case conversion
39+
├── system-directive.ts # System prompt helpers
40+
├── tool-name.ts # Tool name constants
41+
├── zip-extractor.ts # ZIP file extraction
42+
├── index.ts # Barrel export
2843
└── *.test.ts # Colocated tests
2944
```
3045

@@ -40,6 +55,7 @@ shared/
4055
| Resolve paths | `getOpenCodeConfigDir()` |
4156
| Compare versions | `isOpenCodeVersionAtLeast("1.1.0")` |
4257
| Resolve model | `resolveModelWithFallback()` |
58+
| Agent display name | `getAgentDisplayName(agentName)` |
4359

4460
## PATTERNS
4561

src/tools/AGENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ tools/
2525
├── skill-mcp/ # Skill MCP operations
2626
├── slashcommand/ # Slash command dispatch
2727
├── call-omo-agent/ # Direct agent invocation
28-
└── background-task/ # background_output, background_cancel
28+
└── background-task/ # background_output, background_cancel (513 lines)
2929
```
3030

3131
## TOOL CATEGORIES
@@ -48,7 +48,7 @@ tools/
4848

4949
## LSP SPECIFICS
5050

51-
- **Client**: `client.ts` manages stdio, JSON-RPC
51+
- **Client**: `client.ts` manages stdio, JSON-RPC (596 lines)
5252
- **Singleton**: `LSPServerManager` with ref counting
5353
- **Capabilities**: definition, references, symbols, diagnostics, rename
5454

0 commit comments

Comments
 (0)