docs: regenerate all AGENTS.md files from comprehensive codebase exploration
- Fired 33 parallel explore agents across all major directories
- Analyzed 1164 TS files, 133k LOC, 41 hooks, 26 tools, 11 agents, 18 features
- Regenerated 13 AGENTS.md files with 905 total lines
- Root: plugin architecture, initialization flow, 7 OpenCode hook handlers
- src/: entry point orchestration, hook composition pipeline
- agents/: 11 agent inventory with tool restrictions and factory patterns
- hooks/: 41 hooks organized by 5 tiers, key complex hooks documented
- tools/: 26 tools across 14 directories, delegation categories
- features/: 18 modules mapped by complexity (HIGH/MEDIUM/LOW)
- shared/: 101 utilities in 13 categories, model resolution pipeline
- config/: 22 schema files, Zod v4 validation system
- cli/: 5 commands, doctor checks, model fallback system
- mcp/: 3-tier MCP system architecture
- plugin-handlers/: 6-phase config loading pipeline
- claude-code-hooks/: CC settings.json compatibility layer
- claude-tasks/: task schema + file-based persistence
🤖 Generated with assistance of oh-my-opencode
This commit is contained in:
+96
-70
@@ -1,83 +1,109 @@
|
||||
# TOOLS KNOWLEDGE BASE
|
||||
# src/tools/ — 26 Tools Across 14 Directories
|
||||
|
||||
**Generated:** 2026-02-17
|
||||
|
||||
## OVERVIEW
|
||||
|
||||
26 tools across 14 directories. Two patterns: Direct ToolDefinition (static) and Factory Function (context-dependent).
|
||||
26 tools registered via `createToolRegistry()`. Two patterns: factory functions (`createXXXTool`) for 19 tools, direct `ToolDefinition` for 7 (LSP + interactive_bash).
|
||||
|
||||
## STRUCTURE
|
||||
```
|
||||
tools/
|
||||
├── delegate-task/ # Category routing (constants.ts 569 lines, tools.ts 213 lines)
|
||||
├── task/ # 4 tools: create, list, get, update (task-create.ts, task-list.ts, task-get.ts, task-update.ts)
|
||||
├── lsp/ # 6 LSP tools: goto_definition, find_references, symbols, diagnostics, prepare_rename, rename
|
||||
├── ast-grep/ # 2 tools: search, replace (25 languages)
|
||||
├── grep/ # Content search (60s timeout, 10MB limit)
|
||||
├── glob/ # File pattern matching (60s timeout, 100 file limit)
|
||||
├── session-manager/ # 4 tools: list, read, search, info
|
||||
├── call-omo-agent/ # Direct agent invocation (explore/librarian)
|
||||
├── background-task/ # background_output, background_cancel
|
||||
├── interactive-bash/ # Tmux session management (135 lines)
|
||||
├── look-at/ # Multimodal PDF/image analysis (156 lines)
|
||||
├── skill/ # Skill execution with MCP support (211 lines)
|
||||
├── skill-mcp/ # MCP tool/resource/prompt operations (182 lines)
|
||||
└── slashcommand/ # Slash command dispatch
|
||||
```
|
||||
## TOOL CATALOG
|
||||
|
||||
## TOOL INVENTORY
|
||||
### Task Management (4)
|
||||
|
||||
| Tool | Category | Pattern | Key Logic |
|
||||
|------|----------|---------|-----------|
|
||||
| `task_create` | Task | Factory | Auto-generated T-{uuid} ID, threadID recording, dependency management |
|
||||
| `task_list` | Task | Factory | Active tasks with summary (excludes completed/deleted), filters unresolved blockers |
|
||||
| `task_get` | Task | Factory | Full task object by ID |
|
||||
| `task_update` | Task | Factory | Status/field updates, additive addBlocks/addBlockedBy for dependencies |
|
||||
| `task` | Delegation | Factory | Category routing with skill injection, background execution |
|
||||
| `call_omo_agent` | Agent | Factory | Direct explore/librarian invocation |
|
||||
| `background_output` | Background | Factory | Retrieve background task result (block, timeout, full_session) |
|
||||
| `background_cancel` | Background | Factory | Cancel running/all background tasks |
|
||||
| `lsp_goto_definition` | LSP | Direct | Jump to symbol definition |
|
||||
| `lsp_find_references` | LSP | Direct | Find all usages across workspace |
|
||||
| `lsp_symbols` | LSP | Direct | Document or workspace symbol search |
|
||||
| `lsp_diagnostics` | LSP | Direct | Get errors/warnings from language server |
|
||||
| `lsp_prepare_rename` | LSP | Direct | Validate rename is possible |
|
||||
| `lsp_rename` | LSP | Direct | Rename symbol across workspace |
|
||||
| `ast_grep_search` | Search | Factory | AST-aware code search (25 languages) |
|
||||
| `ast_grep_replace` | Search | Factory | AST-aware code replacement (dry-run default) |
|
||||
| `grep` | Search | Factory | Regex content search with safety limits |
|
||||
| `glob` | Search | Factory | File pattern matching |
|
||||
| `session_list` | Session | Factory | List all sessions |
|
||||
| `session_read` | Session | Factory | Read session messages with filters |
|
||||
| `session_search` | Session | Factory | Search across sessions |
|
||||
| `session_info` | Session | Factory | Session metadata and stats |
|
||||
| `interactive_bash` | System | Direct | Tmux session management |
|
||||
| `look_at` | System | Factory | Multimodal PDF/image analysis via dedicated agent |
|
||||
| `skill` | Skill | Factory | Load skill instructions with MCP support |
|
||||
| `skill_mcp` | Skill | Factory | Call MCP tools/resources/prompts from skill-embedded servers |
|
||||
| `slashcommand` | Command | Factory | Slash command dispatch with argument substitution |
|
||||
| Tool | Factory | Parameters |
|
||||
|------|---------|------------|
|
||||
| `task_create` | `createTaskCreateTool` | subject, description, blockedBy, blocks, metadata, parentID |
|
||||
| `task_list` | `createTaskList` | (none) |
|
||||
| `task_get` | `createTaskGetTool` | id |
|
||||
| `task_update` | `createTaskUpdateTool` | id, subject, description, status, addBlocks, addBlockedBy, owner, metadata |
|
||||
|
||||
## DELEGATION SYSTEM (delegate-task)
|
||||
### Delegation (1)
|
||||
|
||||
8 built-in categories with domain-optimized models:
|
||||
| Tool | Factory | Parameters |
|
||||
|------|---------|------------|
|
||||
| `task` | `createDelegateTask` | description, prompt, category, subagent_type, run_in_background, session_id, load_skills, command |
|
||||
|
||||
**8 Built-in Categories**: visual-engineering, ultrabrain, deep, artistry, quick, unspecified-low, unspecified-high, writing
|
||||
|
||||
### Agent Invocation (1)
|
||||
|
||||
| Tool | Factory | Parameters |
|
||||
|------|---------|------------|
|
||||
| `call_omo_agent` | `createCallOmoAgent` | description, prompt, subagent_type, run_in_background, session_id |
|
||||
|
||||
### Background Tasks (2)
|
||||
|
||||
| Tool | Factory | Parameters |
|
||||
|------|---------|------------|
|
||||
| `background_output` | `createBackgroundOutput` | task_id, block, timeout, full_session, include_thinking, message_limit |
|
||||
| `background_cancel` | `createBackgroundCancel` | taskId, all |
|
||||
|
||||
### LSP Refactoring (6) — Direct ToolDefinition
|
||||
|
||||
| Tool | Parameters |
|
||||
|------|------------|
|
||||
| `lsp_goto_definition` | filePath, line, character |
|
||||
| `lsp_find_references` | filePath, line, character, includeDeclaration |
|
||||
| `lsp_symbols` | filePath, scope (document/workspace), query, limit |
|
||||
| `lsp_diagnostics` | filePath, severity |
|
||||
| `lsp_prepare_rename` | filePath, line, character |
|
||||
| `lsp_rename` | filePath, line, character, newName |
|
||||
|
||||
### Code Search (4)
|
||||
|
||||
| Tool | Factory | Parameters |
|
||||
|------|---------|------------|
|
||||
| `ast_grep_search` | `createAstGrepTools` | pattern, lang, paths, globs, context |
|
||||
| `ast_grep_replace` | `createAstGrepTools` | pattern, rewrite, lang, paths, globs, dryRun |
|
||||
| `grep` | `createGrepTools` | pattern, path, include (60s timeout, 10MB limit) |
|
||||
| `glob` | `createGlobTools` | pattern, path (60s timeout, 100 file limit) |
|
||||
|
||||
### Session History (4)
|
||||
|
||||
| Tool | Factory | Parameters |
|
||||
|------|---------|------------|
|
||||
| `session_list` | `createSessionManagerTools` | (none) |
|
||||
| `session_read` | `createSessionManagerTools` | session_id, include_todos, limit |
|
||||
| `session_search` | `createSessionManagerTools` | query, session_id, case_sensitive, limit |
|
||||
| `session_info` | `createSessionManagerTools` | session_id |
|
||||
|
||||
### Skill/Command (3)
|
||||
|
||||
| Tool | Factory | Parameters |
|
||||
|------|---------|------------|
|
||||
| `skill` | `createSkillTool` | name |
|
||||
| `skill_mcp` | `createSkillMcpTool` | mcp_name, tool_name/resource_name/prompt_name, arguments, grep |
|
||||
| `slashcommand` | `createSlashcommandTool` | command, user_message |
|
||||
|
||||
### System (2)
|
||||
|
||||
| Tool | Factory | Parameters |
|
||||
|------|---------|------------|
|
||||
| `interactive_bash` | Direct | tmux_command |
|
||||
| `look_at` | `createLookAt` | file_path, image_data, goal |
|
||||
|
||||
### Editing (1) — Conditional
|
||||
|
||||
| Tool | Factory | Parameters |
|
||||
|------|---------|------------|
|
||||
| `hashline_edit` | `createHashlineEditTool` | file, edits[] |
|
||||
|
||||
## DELEGATION CATEGORIES
|
||||
|
||||
| Category | Model | Domain |
|
||||
|----------|-------|--------|
|
||||
| `visual-engineering` | gemini-3-pro | UI/UX, design, styling |
|
||||
| `ultrabrain` | gpt-5.3-codex xhigh | Deep logic, architecture |
|
||||
| `deep` | gpt-5.3-codex medium | Autonomous problem-solving |
|
||||
| `artistry` | gemini-3-pro high | Creative, unconventional |
|
||||
| `quick` | claude-haiku-4-5 | Trivial tasks |
|
||||
| `unspecified-low` | claude-sonnet-4-5 | Moderate effort |
|
||||
| `unspecified-high` | claude-opus-4-6 max | High effort |
|
||||
| `writing` | kimi-k2p5 | Documentation, prose |
|
||||
| visual-engineering | gemini-3-pro | Frontend, UI/UX |
|
||||
| ultrabrain | gpt-5.3-codex xhigh | Hard logic |
|
||||
| deep | gpt-5.3-codex medium | Autonomous problem-solving |
|
||||
| artistry | gemini-3-pro high | Creative approaches |
|
||||
| quick | claude-haiku-4-5 | Trivial tasks |
|
||||
| unspecified-low | claude-sonnet-4-5 | Moderate effort |
|
||||
| unspecified-high | claude-opus-4-6 max | High effort |
|
||||
| writing | kimi-k2p5 | Documentation |
|
||||
|
||||
## HOW TO ADD
|
||||
## HOW TO ADD A TOOL
|
||||
|
||||
1. Create `src/tools/[name]/` with index.ts, tools.ts, types.ts, constants.ts
|
||||
2. Static tools → `builtinTools` export, Factory → separate export
|
||||
3. Register in `src/plugin/tool-registry.ts`
|
||||
|
||||
## NAMING
|
||||
|
||||
- **Tool names**: snake_case (`lsp_goto_definition`)
|
||||
- **Functions**: camelCase (`createDelegateTask`)
|
||||
- **Directories**: kebab-case (`delegate-task/`)
|
||||
1. Create `src/tools/{name}/index.ts` exporting factory
|
||||
2. Create `src/tools/{name}/types.ts` for parameter schemas
|
||||
3. Create `src/tools/{name}/tools.ts` for implementation
|
||||
4. Register in `src/plugin/tool-registry.ts`
|
||||
|
||||
Reference in New Issue
Block a user