Skip to content

Commit 3dea568

Browse files
committed
Update AGENTS.md
1 parent 00b938d commit 3dea568

File tree

1 file changed

+64
-47
lines changed

1 file changed

+64
-47
lines changed

AGENTS.md

Lines changed: 64 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,115 +1,132 @@
11
# PROJECT KNOWLEDGE BASE
22

3-
**Generated:** 2025-12-05T01:16:20+09:00
4-
**Commit:** 6c9a2ee
3+
**Generated:** 2025-12-14T17:16:30+09:00
4+
**Commit:** 7f27fbc
55
**Branch:** master
66

77
## OVERVIEW
88

9-
OpenCode plugin distribution implementing Claude Code/AmpCode features. Provides multi-model agent orchestration, LSP tools, AST-Grep search, and safe-grep utilities.
9+
OpenCode plugin implementing Claude Code/AmpCode features. Multi-model agent orchestration (GPT-5.2, Claude, Gemini, Grok), LSP tools (11), AST-Grep search, MCP integrations (context7, websearch_exa, grep_app). "oh-my-zsh" for OpenCode.
1010

1111
## STRUCTURE
1212

1313
```
1414
oh-my-opencode/
1515
├── src/
16-
│ ├── agents/ # AI agent definitions (oracle, librarian, explore, etc.)
17-
│ ├── hooks/ # Plugin lifecycle hooks
18-
│ ├── tools/ # LSP, AST-Grep, Safe-Grep tool implementations
19-
│ │ ├── lsp/ # 11 LSP tools (hover, definition, references, etc.)
20-
│ │ ├── ast-grep/ # AST-aware code search
21-
│ │ └── safe-grep/ # Safe grep with limits
22-
│ └── features/ # Terminal features
23-
├── dist/ # Build output (bun + tsc declarations)
24-
└── test-rule.yml # AST-Grep test rules
16+
│ ├── agents/ # AI agents (OmO, oracle, librarian, explore, frontend, document-writer, multimodal-looker)
17+
│ ├── hooks/ # 19 lifecycle hooks (comment-checker, rules-injector, keyword-detector, etc.)
18+
│ ├── tools/ # LSP (11), AST-Grep, Grep, background-task, glob, look-at, skill, slashcommand
19+
│ ├── mcp/ # MCP servers (context7, websearch_exa, grep_app)
20+
│ ├── features/ # Terminal features, Claude Code loaders (agent, command, skill, mcp, session-state)
21+
│ ├── config/ # Zod schema, TypeScript types
22+
│ ├── auth/ # Google Antigravity OAuth
23+
│ ├── shared/ # Utilities (deep-merge, pattern-matcher, logger, etc.)
24+
│ └── index.ts # Main plugin entry (OhMyOpenCodePlugin)
25+
├── script/ # build-schema.ts, publish.ts
26+
├── assets/ # JSON schema
27+
└── dist/ # Build output (ESM + .d.ts)
2528
```
2629

2730
## WHERE TO LOOK
2831

2932
| Task | Location | Notes |
3033
|------|----------|-------|
31-
| Add new agent | `src/agents/` | Export from index.ts |
32-
| Add new hook | `src/hooks/` | Export from index.ts |
33-
| Add new tool | `src/tools/` | Follow lsp/ pattern: index, types, tools, utils |
34-
| Modify LSP behavior | `src/tools/lsp/` | client.ts for connection logic |
35-
| AST-Grep patterns | `src/tools/ast-grep/` | napi.ts for @ast-grep/napi |
36-
| Terminal features | `src/features/terminal/` | title.ts |
37-
| Google Antigravity auth | `src/auth/antigravity/` | OAuth plugin for Google models |
34+
| Add new agent | `src/agents/` | Create .ts file, add to builtinAgents in index.ts, update types.ts |
35+
| Add new hook | `src/hooks/` | Create dir with createXXXHook(), export from index.ts |
36+
| Add new tool | `src/tools/` | Dir with index/types/constants/tools.ts, add to builtinTools |
37+
| Add MCP server | `src/mcp/` | Create config, add to index.ts |
38+
| Modify LSP behavior | `src/tools/lsp/` | client.ts for connection, tools.ts for handlers |
39+
| AST-Grep patterns | `src/tools/ast-grep/` | napi.ts for @ast-grep/napi binding |
40+
| Google OAuth | `src/auth/antigravity/` | OAuth plugin for Google models |
41+
| Config schema | `src/config/schema.ts` | Zod schema, run `bun run build:schema` after changes |
42+
| Claude Code compat | `src/features/claude-code-*-loader/` | Command, skill, agent, mcp loaders |
3843

3944
## CONVENTIONS
4045

41-
- **Package manager**: Bun only (not npm/yarn)
42-
- **Build**: Dual output - `bun build` + `tsc --emitDeclarationOnly`
46+
- **Package manager**: Bun only (`bun run`, `bun build`, `bunx`)
4347
- **Types**: bun-types (not @types/node)
48+
- **Build**: Dual output - `bun build` (ESM) + `tsc --emitDeclarationOnly`
4449
- **Exports**: Barrel pattern - `export * from "./module"` in index.ts
45-
- **Module structure**: index.ts, types.ts, constants.ts, utils.ts, tools.ts per tool
50+
- **Directory naming**: kebab-case (`ast-grep/`, `claude-code-hooks/`)
51+
- **Tool structure**: Each tool has index.ts, types.ts, constants.ts, tools.ts, utils.ts
52+
- **Hook pattern**: `createXXXHook(input: PluginInput)` returning event handlers
4653

4754
## ANTI-PATTERNS (THIS PROJECT)
4855

49-
- **Bash file operations**: Never use mkdir/touch/rm/cp/mv for file creation
5056
- **npm/yarn**: Use bun exclusively
51-
- **@types/node**: Use bun-types instead
57+
- **@types/node**: Use bun-types
58+
- **Bash file operations**: Never use mkdir/touch/rm/cp/mv for file creation in code
5259
- **Generic AI aesthetics**: No Space Grotesk, avoid typical AI-generated UI patterns
60+
- **Direct bun publish**: Use GitHub Actions workflow_dispatch only (OIDC provenance)
61+
- **Local version bump**: Version managed by CI workflow, never modify locally
5362
- **Rush completion**: Never mark tasks complete without verification
5463
- **Interrupting work**: Complete tasks fully before stopping
5564

5665
## UNIQUE STYLES
5766

58-
- **Directory naming**: kebab-case (`ast-grep/`, `safe-grep/`)
59-
- **Tool organization**: Each tool has cli.ts, constants.ts, index.ts, napi.ts/tools.ts, types.ts, utils.ts
6067
- **Platform handling**: Union type `"darwin" | "linux" | "win32" | "unsupported"`
61-
- **Error handling**: Consistent try/catch with async/await
6268
- **Optional props**: Extensive use of `?` for optional interface properties
6369
- **Flexible objects**: `Record<string, unknown>` for dynamic configs
70+
- **Error handling**: Consistent try/catch with async/await in all tools
71+
- **Agent tools restriction**: Use `tools: { include: [...] }` or `tools: { exclude: [...] }`
72+
- **Temperature**: Most agents use `0.1` for consistency
73+
- **Hook naming**: `createXXXHook` function naming convention
6474

6575
## AGENT MODELS
6676

6777
| Agent | Model | Purpose |
6878
|-------|-------|---------|
69-
| oracle | GPT-5.2 | Code review, strategic planning |
70-
| librarian | Claude Haiku | Documentation, example lookup |
71-
| explore | Grok | File/codebase exploration |
72-
| frontend-ui-ux-engineer | Gemini | UI generation |
73-
| document-writer | Gemini | Documentation writing |
79+
| OmO | anthropic/claude-opus-4-5 | Primary orchestrator, team leader |
80+
| oracle | openai/gpt-5.2 | Strategic advisor, code review, architecture |
81+
| librarian | opencode/big-pickle | Multi-repo analysis, docs lookup, GitHub examples |
82+
| explore | opencode/grok-code | Fast codebase exploration, file patterns |
83+
| frontend-ui-ux-engineer | google/gemini-3-pro-preview | UI generation, design-focused |
84+
| document-writer | google/gemini-3-pro-preview | Technical documentation |
85+
| multimodal-looker | google/gemini-2.5-flash | PDF/image/diagram analysis |
7486

7587
## COMMANDS
7688

7789
```bash
7890
# Type check
7991
bun run typecheck
8092

81-
# Build
93+
# Build (ESM + declarations + schema)
8294
bun run build
8395

8496
# Clean + Build
8597
bun run rebuild
98+
99+
# Build schema only
100+
bun run build:schema
86101
```
87102

88103
## DEPLOYMENT
89104

90-
**배포는 GitHub Actions workflow_dispatch로만 진행**
105+
**GitHub Actions workflow_dispatch only**
91106

92-
1. package.json 버전은 수정하지 않음 (워크플로우에서 자동 bump)
93-
2. 변경사항 커밋 & 푸시
94-
3. GitHub Actions에서 `publish` 워크플로우 수동 실행
95-
- `bump`: major | minor | patch 선택
96-
- `version`: (선택) 특정 버전 지정 가능
107+
1. package.json version NOT modified locally (auto-bumped by workflow)
108+
2. Commit & push changes
109+
3. Trigger `publish` workflow manually:
110+
- `bump`: major | minor | patch
111+
- `version`: (optional) specific version override
97112

98113
```bash
99-
# 워크플로우 실행 (CLI)
114+
# Trigger via CLI
100115
gh workflow run publish -f bump=patch
101116

102-
# 워크플로우 상태 확인
117+
# Check status
103118
gh run list --workflow=publish
104119
```
105120

106-
**주의사항**:
107-
- `bun publish` 직접 실행 금지 (OIDC provenance 문제)
108-
- 로컬에서 버전 bump 하지 말 것
121+
**Critical**:
122+
- Never run `bun publish` directly (OIDC provenance issue)
123+
- Never bump version locally
109124

110125
## NOTES
111126

112127
- **No tests**: Test framework not configured
113-
- **CI/CD**: GitHub Actions publish workflow 사용
114-
- **Version requirement**: OpenCode >= 1.0.132 (earlier versions have config bugs)
115-
- **Multi-language docs**: README.md, README.en.md, README.ko.md
128+
- **OpenCode version**: Requires >= 1.0.132 (earlier versions have config bugs)
129+
- **Multi-language docs**: README.md (EN), README.ko.md (KO)
130+
- **Config locations**: `~/.config/opencode/oh-my-opencode.json` (user) or `.opencode/oh-my-opencode.json` (project)
131+
- **Schema autocomplete**: Add `$schema` field in config for IDE support
132+
- **Trusted dependencies**: @ast-grep/cli, @ast-grep/napi, @code-yeongyu/comment-checker

0 commit comments

Comments
 (0)