2026-02-18 01:26:19 +09:00
|
|
|
# src/features/ — 19 Feature Modules
|
2026-02-17 11:17:01 +09:00
|
|
|
|
2026-03-06 17:59:05 +09:00
|
|
|
**Generated:** 2026-03-06
|
2025-12-24 17:11:18 +09:00
|
|
|
|
|
|
|
|
## OVERVIEW
|
2026-01-17 22:01:56 +09:00
|
|
|
|
2026-02-17 11:17:01 +09:00
|
|
|
Standalone feature modules wired into plugin/ layer. Each is self-contained with own types, implementation, and tests.
|
|
|
|
|
|
|
|
|
|
## MODULE MAP
|
|
|
|
|
|
|
|
|
|
| Module | Files | Complexity | Purpose |
|
|
|
|
|
|--------|-------|------------|---------|
|
2026-03-06 17:59:05 +09:00
|
|
|
| **opencode-skill-loader** | 33 | HIGH | YAML frontmatter skill loading from 4 scopes |
|
|
|
|
|
| **background-agent** | 31 | HIGH | Task lifecycle, concurrency (5/model), polling, spawner pattern |
|
|
|
|
|
| **tmux-subagent** | 30 | HIGH | Tmux pane management, grid planning, session orchestration |
|
|
|
|
|
| **mcp-oauth** | 18 | HIGH | OAuth 2.0 + PKCE + DCR (RFC 7591) for MCP servers |
|
|
|
|
|
| **builtin-skills** | 17 | LOW | 6 skills: git-master, playwright, playwright-cli, agent-browser, dev-browser, frontend-ui-ux |
|
|
|
|
|
| **skill-mcp-manager** | 12 | MEDIUM | MCP client lifecycle per session (stdio + HTTP) |
|
2026-02-17 11:17:01 +09:00
|
|
|
| **claude-code-plugin-loader** | 10 | MEDIUM | Unified plugin discovery from .opencode/plugins/ |
|
2026-03-06 17:59:05 +09:00
|
|
|
| **builtin-commands** | 11 | LOW | Command templates: refactor, init-deep, handoff, etc. |
|
|
|
|
|
| **claude-tasks** | 7 | MEDIUM | Task schema + file storage + OpenCode todo sync |
|
|
|
|
|
| **claude-code-mcp-loader** | 6 | MEDIUM | .mcp.json loading with ${VAR} env expansion |
|
|
|
|
|
| **context-injector** | 6 | MEDIUM | AGENTS.md/README.md injection into context |
|
2026-02-18 01:26:19 +09:00
|
|
|
| **run-continuation-state** | 5 | LOW | Persistent state for `run` command continuation across sessions |
|
2026-03-06 17:59:05 +09:00
|
|
|
| **hook-message-injector** | 5 | MEDIUM | System message injection for hooks |
|
|
|
|
|
| **boulder-state** | 5 | LOW | Persistent state for multi-step operations |
|
|
|
|
|
| **task-toast-manager** | 4 | MEDIUM | Task progress notifications |
|
|
|
|
|
| **tool-metadata-store** | 3 | LOW | Tool execution metadata cache |
|
|
|
|
|
| **claude-code-session-state** | 3 | LOW | Subagent session state tracking |
|
|
|
|
|
| **claude-code-command-loader** | 3 | LOW | Load commands from .opencode/commands/ |
|
|
|
|
|
| **claude-code-agent-loader** | 3 | LOW | Load agents from .opencode/agents/ |
|
2025-12-24 17:11:18 +09:00
|
|
|
|
2026-02-17 11:17:01 +09:00
|
|
|
## KEY MODULES
|
2026-02-09 14:29:53 +09:00
|
|
|
|
2026-03-06 17:59:05 +09:00
|
|
|
### background-agent (31 files, ~10k LOC)
|
2026-02-09 14:29:53 +09:00
|
|
|
|
2026-02-17 11:17:01 +09:00
|
|
|
Core orchestration engine. `BackgroundManager` manages task lifecycle:
|
|
|
|
|
- States: pending → running → completed/error/cancelled/interrupt
|
|
|
|
|
- Concurrency: per-model/provider limits via `ConcurrencyManager` (FIFO queue)
|
|
|
|
|
- Polling: 3s interval, completion via idle events + stability detection (10s unchanged)
|
|
|
|
|
- spawner/: 8 focused files composing via `SpawnerContext` interface
|
2026-02-10 14:53:39 +09:00
|
|
|
|
2026-03-06 17:59:05 +09:00
|
|
|
### opencode-skill-loader (33 files, ~3.2k LOC)
|
2026-02-09 14:29:53 +09:00
|
|
|
|
2026-02-17 11:17:01 +09:00
|
|
|
4-scope skill discovery (project > opencode > user > global):
|
|
|
|
|
- YAML frontmatter parsing from SKILL.md files
|
|
|
|
|
- Skill merger with priority deduplication
|
|
|
|
|
- Template resolution with variable substitution
|
|
|
|
|
- Provider gating for model-specific skills
|
2026-02-10 14:53:39 +09:00
|
|
|
|
2026-03-06 17:59:05 +09:00
|
|
|
### tmux-subagent (30 files, ~3.6k LOC)
|
2026-02-08 17:09:12 +09:00
|
|
|
|
2026-02-17 11:17:01 +09:00
|
|
|
State-first tmux integration:
|
|
|
|
|
- `TmuxSessionManager`: pane lifecycle, grid planning
|
|
|
|
|
- Spawn action decider + target finder
|
|
|
|
|
- Polling manager for session health
|
|
|
|
|
- Event handlers for pane creation/destruction
|
2026-02-08 17:09:12 +09:00
|
|
|
|
2026-02-17 11:17:01 +09:00
|
|
|
### builtin-skills (6 skill objects)
|
2026-02-09 14:29:53 +09:00
|
|
|
|
2026-02-17 11:17:01 +09:00
|
|
|
| Skill | Size | MCP | Tools |
|
|
|
|
|
|-------|------|-----|-------|
|
|
|
|
|
| git-master | 1111 LOC | — | Bash |
|
|
|
|
|
| playwright | 312 LOC | @playwright/mcp | — |
|
|
|
|
|
| agent-browser | (in playwright.ts) | — | Bash(agent-browser:*) |
|
|
|
|
|
| playwright-cli | 268 LOC | — | Bash(playwright-cli:*) |
|
|
|
|
|
| dev-browser | 221 LOC | — | Bash |
|
|
|
|
|
| frontend-ui-ux | 79 LOC | — | — |
|
2026-02-09 14:29:53 +09:00
|
|
|
|
2026-02-17 11:17:01 +09:00
|
|
|
Browser variant selected by `browserProvider` config: playwright (default) | playwright-cli | agent-browser.
|