Skip to content
Open
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
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ npx openskills install anthropics/skills --universal

```bash
npx openskills install <source> [options] # Install from GitHub, local path, or private repo
npx openskills sync [-y] [-o <path>] # Update AGENTS.md (or custom output)
npx openskills sync [-y] [-o <path>] [--cli-tool <name>] # Update AGENTS.md (or custom output) with your agent's CLI tool name
npx openskills list # Show installed skills
npx openskills read <name> # Load skill (for agents)
npx openskills update [name...] # Update installed skills (default: all)
Expand All @@ -186,6 +186,7 @@ npx openskills remove <name> # Remove specific skill
- `--universal` — Install to `.agent/skills/` instead of `.claude/skills/`
- `-y, --yes` — Skip prompts (useful for CI)
- `-o, --output <path>` — Output file for sync (default: `AGENTS.md`)
- `--cli-tool <name>` — Redefining the CLI tool name used by the agent to invoke openskills (default: `Bash`)

---

Expand Down
1 change: 1 addition & 0 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ program
.description('Update AGENTS.md with installed skills (interactive, pre-selects current state)')
.option('-y, --yes', 'Skip interactive selection, sync all skills')
.option('-o, --output <path>', 'Output file path (default: AGENTS.md)')
.option('-t, --cli-tool <name>', 'Custom tool name to use instead of "Bash" (e.g., "bash", "Bash", "Shell")')
.action(syncAgentsMd);

program
Expand Down
3 changes: 2 additions & 1 deletion src/commands/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import type { Skill } from '../types.js';
export interface SyncOptions {
yes?: boolean;
output?: string;
cliTool?: string;
}

/**
Expand Down Expand Up @@ -92,7 +93,7 @@ export async function syncAgentsMd(options: SyncOptions = {}): Promise<void> {
}
}

const xml = generateSkillsXml(skills);
const xml = generateSkillsXml(skills, { tool: options.cliTool });
const content = readFileSync(outputPath, 'utf-8');
const updated = replaceSkillsSection(content, xml);

Expand Down
9 changes: 6 additions & 3 deletions src/utils/agents-md.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ export function parseCurrentSkills(content: string): string[] {

/**
* Generate skills XML section for AGENTS.md
* @param skills - Array of skills to include
* @param options - Generation options
* @param options.tool - Custom tool name to use instead of "Bash" (default: "Bash")
*/
export function generateSkillsXml(skills: Skill[]): string {
export function generateSkillsXml(skills: Skill[], options: { tool?: string } = {}): string {
const toolName = options.tool || 'Bash';
const skillTags = skills
.map(
(s) => `<skill>
Expand All @@ -40,8 +44,7 @@ export function generateSkillsXml(skills: Skill[]): string {
When users ask you to perform tasks, check if any of the available skills below can help complete the task more effectively. Skills provide specialized capabilities and domain knowledge.

How to use skills:
- Invoke: \`npx openskills read <skill-name>\` (run in your shell)
- For multiple: \`npx openskills read skill-one,skill-two\`
- Invoke: ${toolName}("openskills read <skill-name>")
- The skill content will load with detailed instructions on how to complete the task
- Base directory provided in output for resolving bundled resources (references/, scripts/, assets/)

Expand Down
16 changes: 14 additions & 2 deletions tests/commands/sync.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,27 @@ describe('sync utilities (agents-md.ts)', () => {
expect(xml).toContain('</skills_system>');
});

it('should include usage instructions', () => {
it('should include usage instructions with default tool name', () => {
const skills: Skill[] = [
{ name: 'test', description: 'Test skill', location: 'project', path: '/path' },
];

const xml = generateSkillsXml(skills);

expect(xml).toContain('<usage>');
expect(xml).toContain('npx openskills read');
expect(xml).toContain('Bash("openskills read <skill-name>")');
expect(xml).toContain('</usage>');
});

it('should include usage instructions with custom tool name', () => {
const skills: Skill[] = [
{ name: 'test', description: 'Test skill', location: 'project', path: '/path' },
];

const xml = generateSkillsXml(skills, { tool: 'Shell' });

expect(xml).toContain('<usage>');
expect(xml).toContain('Shell("openskills read <skill-name>")');
expect(xml).toContain('</usage>');
});

Expand Down