diff --git a/README.md b/README.md index d5f3490..f8f65d0 100644 --- a/README.md +++ b/README.md @@ -81,9 +81,9 @@ Or just describe what you want: "I want to build..." | Tool | Description | |------|-------------| -| `use_skill` | Load a skill by name (e.g., `locus:product-manager`) | -| `find_skills` | List skills with optional category/tier/search filters | -| `find_agents` | List available agent definitions | +| `locus_skill` | Load a skill by name (e.g., `locus:product-manager`) | +| `locus_skills` | List skills with optional category/tier/search filters | +| `locus_agents` | List available agent definitions | ## Skills Library (46) diff --git a/skills/using-locus/SKILL.md b/skills/using-locus/SKILL.md index 2b586db..7c0e324 100644 --- a/skills/using-locus/SKILL.md +++ b/skills/using-locus/SKILL.md @@ -13,7 +13,7 @@ This is not negotiable. This is not optional. You cannot rationalize your way ou ## How to Access Skills -**In OpenCode:** Use the `use_skill` tool. When you invoke a skill, its content is loaded and presented to you - follow it directly. +**In OpenCode:** Use the `locus_skill` tool. When you invoke a skill, its content is loaded and presented to you - follow it directly. **In Claude Code:** Use the `Skill` tool if available, or load from the skills directory. @@ -121,6 +121,6 @@ Use `/locus` to start a planning session, or say "I want to build..." | Tool | Description | |------|-------------| -| `use_skill` | Load a specific skill | -| `find_skills` | List all available skills | -| `find_agents` | List all available agents | +| `locus_skill` | Load a specific skill | +| `locus_skills` | List all available skills | +| `locus_agents` | List all available agents | diff --git a/src/index.ts b/src/index.ts index b1c8890..88de14c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -42,7 +42,7 @@ export const LocusPlugin: Plugin = async ({ client, directory }) => { /** * Load and read a specific skill to guide work */ - use_skill: tool({ + locus_skill: tool({ description: 'Load and read a specific skill to guide your work.', args: { skill_name: tool.schema.string().describe('Name of the skill to load') @@ -94,7 +94,7 @@ export const LocusPlugin: Plugin = async ({ client, directory }) => { /** * List all available skills */ - find_skills: tool({ + locus_skills: tool({ description: 'List all available skills.', args: { category: tool.schema.string().optional().describe('Filter by category'), @@ -172,7 +172,7 @@ export const LocusPlugin: Plugin = async ({ client, directory }) => { /** * List all available agents */ - find_agents: tool({ + locus_agents: tool({ description: 'List all available agent definitions.', args: {}, execute: async () => { diff --git a/src/lib/skills-core.ts b/src/lib/skills-core.ts index 6c2db4b..093deb2 100644 --- a/src/lib/skills-core.ts +++ b/src/lib/skills-core.ts @@ -630,14 +630,14 @@ export function getBootstrapContent( const content = stripFrontmatter(fullContent); const toolMapping = compact - ? `**Tool Mapping:** TodoWrite->update_plan, Task->@mention, Skill->use_skill + ? `**Tool Mapping:** TodoWrite->update_plan, Task->@mention, Skill->locus_skill **Skills naming (priority order):** project: > personal: > locus:` : `**Tool Mapping for OpenCode:** When skills reference tools you don't have, substitute OpenCode equivalents: - \`TodoWrite\` -> \`update_plan\` - \`Task\` tool with subagents -> Use OpenCode's subagent system (@mention) -- \`Skill\` tool -> \`use_skill\` custom tool +- \`Skill\` tool -> \`locus_skill\` custom tool - \`Read\`, \`Write\`, \`Edit\`, \`Bash\` -> Your native tools **Skills naming (priority order):** diff --git a/tests/plugin.test.ts b/tests/plugin.test.ts index 1e5414b..59c1a52 100644 --- a/tests/plugin.test.ts +++ b/tests/plugin.test.ts @@ -136,8 +136,8 @@ describe('Plugin Integration', () => { expect(content).not.toBeNull(); expect(content).toContain('EXTREMELY_IMPORTANT'); - expect(content).toContain('use_skill'); - expect(content).toContain('find_skills'); + expect(content).toContain('locus_skill'); + expect(content).toContain('locus_skills'); }); it('should generate compact bootstrap content', () => { @@ -205,10 +205,9 @@ describe('Plugin Integration', () => { expect(plugin).toBeDefined(); expect(plugin.tool).toBeDefined(); - expect(plugin.tool?.use_skill).toBeDefined(); - expect(plugin.tool?.find_skills).toBeDefined(); - expect(plugin.tool?.find_agents).toBeDefined(); - expect(plugin.event).toBeDefined(); + expect(plugin.tool?.locus_skill).toBeDefined(); + expect(plugin.tool?.locus_skills).toBeDefined(); + expect(plugin.tool?.locus_agents).toBeDefined(); }); }); @@ -236,8 +235,8 @@ describe('Plugin Integration', () => { plugin = await LocusPlugin(mockInput as any); }); - it('find_skills should return skills', async () => { - const result = await plugin.tool!.find_skills.execute({}, { sessionID: 'test', agent: 'test' } as any); + it('locus_skills should return skills', async () => { + const result = await plugin.tool!.locus_skills.execute({}, { sessionID: 'test', agent: 'test' } as any); // Should find some skills (from any source) expect(result).toMatch(/Found \d+ skill/); @@ -245,10 +244,10 @@ describe('Plugin Integration', () => { expect(result).toContain('## '); }); - it('find_skills should filter by tier when locus skills available', async () => { + it('locus_skills should filter by tier when locus skills available', async () => { // This test works best with the compiled dist version // where locus skills are properly resolved - const result = await plugin.tool!.find_skills.execute( + const result = await plugin.tool!.locus_skills.execute( { tier: 'executive' }, { sessionID: 'test', agent: 'test' } as any ); @@ -257,9 +256,9 @@ describe('Plugin Integration', () => { expect(typeof result).toBe('string'); }); - it('find_skills should filter by category when locus skills available', async () => { + it('locus_skills should filter by category when locus skills available', async () => { // This test works best with the compiled dist version - const result = await plugin.tool!.find_skills.execute( + const result = await plugin.tool!.locus_skills.execute( { category: 'core' }, { sessionID: 'test', agent: 'test' } as any ); @@ -267,8 +266,8 @@ describe('Plugin Integration', () => { expect(typeof result).toBe('string'); }); - it('find_skills should filter by search term', async () => { - const result = await plugin.tool!.find_skills.execute( + it('locus_skills should filter by search term', async () => { + const result = await plugin.tool!.locus_skills.execute( { search: 'kubernetes' }, { sessionID: 'test', agent: 'test' } as any ); @@ -276,16 +275,16 @@ describe('Plugin Integration', () => { expect(result).toContain('kubernetes'); }); - it('find_agents should return all agents', async () => { - const result = await plugin.tool!.find_agents.execute({}, { sessionID: 'test', agent: 'test' } as any); + it('locus_agents should return all agents', async () => { + const result = await plugin.tool!.locus_agents.execute({}, { sessionID: 'test', agent: 'test' } as any); expect(result).toContain('agents'); expect(result).toContain('ceo-strategist'); expect(result).toContain('tech-lead'); }); - it('use_skill should load existing skill', async () => { - const result = await plugin.tool!.use_skill.execute( + it('locus_skill should load existing skill', async () => { + const result = await plugin.tool!.locus_skill.execute( { skill_name: 'locus:ceo-strategist' }, { sessionID: 'test', agent: 'test' } as any ); @@ -294,8 +293,8 @@ describe('Plugin Integration', () => { expect(result).toMatch(/Launching skill|ceo-strategist/i); }); - it('use_skill should error on non-existent skill', async () => { - const result = await plugin.tool!.use_skill.execute( + it('locus_skill should error on non-existent skill', async () => { + const result = await plugin.tool!.locus_skill.execute( { skill_name: 'non-existent-skill' }, { sessionID: 'test', agent: 'test' } as any ); @@ -351,8 +350,8 @@ describe('Plugin Integration', () => { const plugin = await CompiledPlugin(mockInput as any); - // find_skills should return locus skills, which means it found the skills directory - const result = await plugin.tool!.find_skills.execute({}, { sessionID: 'test', agent: 'test' } as any); + // locus_skills should return locus skills, which means it found the skills directory + const result = await plugin.tool!.locus_skills.execute({}, { sessionID: 'test', agent: 'test' } as any); expect(result).toContain('locus:'); expect(result).toContain('ceo-strategist'); }); @@ -377,17 +376,17 @@ describe('Plugin Integration', () => { const plugin = await LocusPlugin(mockInput as any); // All tool execute functions should return strings - const findSkillsResult = await plugin.tool!.find_skills.execute({}, { sessionID: 'test', agent: 'test' } as any); - expect(typeof findSkillsResult).toBe('string'); + const locusSkillsResult = await plugin.tool!.locus_skills.execute({}, { sessionID: 'test', agent: 'test' } as any); + expect(typeof locusSkillsResult).toBe('string'); - const findAgentsResult = await plugin.tool!.find_agents.execute({}, { sessionID: 'test', agent: 'test' } as any); - expect(typeof findAgentsResult).toBe('string'); + const locusAgentsResult = await plugin.tool!.locus_agents.execute({}, { sessionID: 'test', agent: 'test' } as any); + expect(typeof locusAgentsResult).toBe('string'); - const useSkillResult = await plugin.tool!.use_skill.execute( + const locusSkillResult = await plugin.tool!.locus_skill.execute( { skill_name: 'locus:ceo-strategist' }, { sessionID: 'test', agent: 'test' } as any ); - expect(typeof useSkillResult).toBe('string'); + expect(typeof locusSkillResult).toBe('string'); }); }); });