Files
oh-my-opencode/src/features/opencode-skill-loader/AGENTS.md
T
YeonGyu-Kim 73453a7191 docs(agents): update hook counts 44→46, add hashline-edit documentation
- Update root AGENTS.md: hook count 44→46, commit fcb90d92, generated 2026-02-24
- Update src/AGENTS.md: core hooks 35→37, session hooks 21→23
- Update src/hooks/AGENTS.md: 46 hooks total, add modelFallback/noSisyphusGpt/noHephaestusNonGpt/runtimeFallback, jsonErrorRecovery moved to tool-guard (tier 2)
- Create src/tools/hashline-edit/AGENTS.md (93 lines): documents three-op model, LINE#ID format, execution pipeline
- Refresh timestamps: 2026-02-21→2026-02-24 on 28 files
- Update plugin/AGENTS.md hook composition counts

🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
2026-02-25 00:02:05 +09:00

1.8 KiB

src/features/opencode-skill-loader/ — 4-Scope Skill Discovery

Generated: 2026-02-24

OVERVIEW

28 files (~3.2k LOC). Discovers, parses, merges, and resolves SKILL.md files from 4 scopes with priority deduplication.

4-SCOPE PRIORITY (highest → lowest)

1. Project (.opencode/skills/)
2. OpenCode config (~/.config/opencode/skills/)
3. User (~/.config/opencode/oh-my-opencode/skills/)
4. Global (built-in skills)

Same-named skill at higher scope overrides lower.

KEY FILES

File Purpose
loader.ts Main loadSkills() — orchestrates discovery → parse → merge
async-loader.ts Async variant for non-blocking skill loading
blocking.ts Sync variant for initial load
merger.ts Priority-based deduplication across scopes
skill-content.ts YAML frontmatter parsing from SKILL.md
skill-discovery.ts Find SKILL.md files in directory trees
skill-directory-loader.ts Load all skills from a single directory
config-source-discovery.ts Discover scope directories from config
skill-template-resolver.ts Variable substitution in skill templates
skill-mcp-config.ts Extract MCP configs from skill YAML
types.ts LoadedSkill, SkillScope, SkillDiscoveryResult

SKILL FORMAT (SKILL.md)

---
name: my-skill
description: What this skill does
tools: [Bash, Read, Write]
mcp:
  - name: my-mcp
    type: stdio
    command: npx
    args: [-y, my-mcp-server]
---

Skill content (instructions for the agent)...

MERGER SUBDIRECTORY

Handles complex merge logic when skills from multiple scopes have overlapping names or MCP configs.

TEMPLATE RESOLUTION

Variables like {{directory}}, {{agent}} in skill content get resolved at load time based on current context.