Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
8 changes: 4 additions & 4 deletions skills/using-locus/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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 |
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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'),
Expand Down Expand Up @@ -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 () => {
Expand Down
4 changes: 2 additions & 2 deletions src/lib/skills-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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):**
Expand Down
55 changes: 27 additions & 28 deletions tests/plugin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down Expand Up @@ -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();
});
});

Expand Down Expand Up @@ -236,19 +235,19 @@ 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/);
// Should have proper structure
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
);
Expand All @@ -257,35 +256,35 @@ 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
);

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
);

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
);
Expand All @@ -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
);
Expand Down Expand Up @@ -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');
});
Expand All @@ -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');
});
});
});
Loading