feat(skill): add builtin skill infrastructure and improve tool descriptions (#340)
* feat(skill): add builtin skill types and schemas with priority-based merging support - Add BuiltinSkill interface for programmatic skill definitions - Create builtin-skills module with createBuiltinSkills factory function - Add SkillScope expansion to include 'builtin' and 'config' scopes - Create SkillsConfig and SkillDefinition Zod schemas for config validation - Add merger.ts utility with mergeSkills function for priority-based skill merging - Update skill and command types to support optional paths for builtin/config skills - Priority order: builtin < config < user < opencode < project < opencode-project 🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode) * feat(skill): integrate programmatic skill discovery and merged skill support - Add discovery functions for Claude and OpenCode skill directories - Add discoverUserClaudeSkills, discoverProjectClaudeSkills functions - Add discoverOpencodeGlobalSkills, discoverOpencodeProjectSkills functions - Update createSkillTool to support pre-merged skills via options - Add extractSkillBody utility to handle both file and programmatic skills - Integrate mergeSkills in plugin initialization to apply priority-based merging - Support optional path/resolvedPath for builtin and config-sourced skills 🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode) * chore(slashcommand): support optional path for builtin and config command scopes - Update CommandInfo type to make path and content optional properties - Prepare command tool for builtin and config sourced commands - Maintain backward compatibility with file-based command loading 🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode) * docs(tools): improve tool descriptions for interactive-bash and slashcommand - Added use case clarification to interactive-bash tool description (server processes, long-running tasks, background jobs, interactive CLI tools) - Simplified slashcommand description to emphasize 'loading' skills concept and removed verbose documentation 🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode) * refactor(skill-loader): simplify redundant condition in skill merging logic Remove redundant 'else if (loaded)' condition that was always true since we're already inside the 'if (loaded)' block. Simplify to 'else' for clarity. Addresses code review feedback on PR #340 for the skill infrastructure feature. 🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
This commit is contained in:
20
src/index.ts
20
src/index.ts
@@ -38,7 +38,13 @@ import {
|
||||
loadProjectSkills,
|
||||
loadOpencodeGlobalSkills,
|
||||
loadOpencodeProjectSkills,
|
||||
discoverUserClaudeSkills,
|
||||
discoverProjectClaudeSkills,
|
||||
discoverOpencodeGlobalSkills,
|
||||
discoverOpencodeProjectSkills,
|
||||
mergeSkills,
|
||||
} from "./features/opencode-skill-loader";
|
||||
import { createBuiltinSkills } from "./features/builtin-skills";
|
||||
|
||||
import {
|
||||
loadUserAgents,
|
||||
@@ -322,9 +328,17 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
|
||||
|
||||
const callOmoAgent = createCallOmoAgent(ctx, backgroundManager);
|
||||
const lookAt = createLookAt(ctx);
|
||||
const skillTool = createSkillTool({
|
||||
opencodeOnly: pluginConfig.claude_code?.skills === false,
|
||||
});
|
||||
const builtinSkills = createBuiltinSkills();
|
||||
const includeClaudeSkills = pluginConfig.claude_code?.skills !== false;
|
||||
const mergedSkills = mergeSkills(
|
||||
builtinSkills,
|
||||
pluginConfig.skills,
|
||||
includeClaudeSkills ? discoverUserClaudeSkills() : [],
|
||||
discoverOpencodeGlobalSkills(),
|
||||
includeClaudeSkills ? discoverProjectClaudeSkills() : [],
|
||||
discoverOpencodeProjectSkills(),
|
||||
);
|
||||
const skillTool = createSkillTool({ skills: mergedSkills });
|
||||
|
||||
const googleAuthHooks = pluginConfig.google_auth !== false
|
||||
? await createGoogleAntigravityAuthPlugin(ctx)
|
||||
|
||||
Reference in New Issue
Block a user