| layout | default |
|---|---|
| title | Chapter 1: Getting Started |
| nav_order | 1 |
| parent | OpenSkills Tutorial |
Welcome to Chapter 1: Getting Started. In this part of OpenSkills Tutorial: Universal Skill Loading for Coding Agents, you will build an intuitive mental model first, then move into concrete implementation details and practical production tradeoffs.
This chapter gets OpenSkills installed and synchronizing skills into your agent environment.
npx openskills install anthropics/skills
npx openskills sync- install first skills package
- generate/update
AGENTS.mdskill block - verify
openskills readinvocation
You now have OpenSkills running with a synced baseline skill set.
Next: Chapter 2: Skill Format and Loader Architecture
The syncAgentsMd function in src/commands/sync.ts handles a key part of this chapter's functionality:
* Sync installed skills to a markdown file
*/
export async function syncAgentsMd(options: SyncOptions = {}): Promise<void> {
const outputPath = options.output || 'AGENTS.md';
const outputName = basename(outputPath);
// Validate output file is markdown
if (!outputPath.endsWith('.md')) {
console.error(chalk.red('Error: Output file must be a markdown file (.md)'));
process.exit(1);
}
// Create file if it doesn't exist
if (!existsSync(outputPath)) {
const dir = dirname(outputPath);
if (dir && dir !== '.' && !existsSync(dir)) {
mkdirSync(dir, { recursive: true });
}
writeFileSync(outputPath, `# ${outputName.replace('.md', '')}\n\n`);
console.log(chalk.dim(`Created ${outputPath}`));
}
let skills = findAllSkills();
if (skills.length === 0) {
console.log('No skills installed. Install skills first:');
console.log(` ${chalk.cyan('npx openskills install anthropics/skills --project')}`);
return;
}
// Interactive mode by default (unless -y flag)
if (!options.yes) {This function is important because it defines how OpenSkills Tutorial: Universal Skill Loading for Coding Agents implements the patterns covered in this chapter.
The SyncOptions interface in src/commands/sync.ts handles a key part of this chapter's functionality:
import type { Skill } from '../types.js';
export interface SyncOptions {
yes?: boolean;
output?: string;
}
/**
* Sync installed skills to a markdown file
*/
export async function syncAgentsMd(options: SyncOptions = {}): Promise<void> {
const outputPath = options.output || 'AGENTS.md';
const outputName = basename(outputPath);
// Validate output file is markdown
if (!outputPath.endsWith('.md')) {
console.error(chalk.red('Error: Output file must be a markdown file (.md)'));
process.exit(1);
}
// Create file if it doesn't exist
if (!existsSync(outputPath)) {
const dir = dirname(outputPath);
if (dir && dir !== '.' && !existsSync(dir)) {
mkdirSync(dir, { recursive: true });
}
writeFileSync(outputPath, `# ${outputName.replace('.md', '')}\n\n`);
console.log(chalk.dim(`Created ${outputPath}`));
}
let skills = findAllSkills();This interface is important because it defines how OpenSkills Tutorial: Universal Skill Loading for Coding Agents implements the patterns covered in this chapter.
The Skill interface in src/types.ts handles a key part of this chapter's functionality:
export interface Skill {
name: string;
description: string;
location: 'project' | 'global';
path: string;
}
export interface SkillLocation {
path: string;
baseDir: string;
source: string;
}
export interface InstallOptions {
global?: boolean;
universal?: boolean;
yes?: boolean;
}
export interface SkillMetadata {
name: string;
description: string;
context?: string;
}This interface is important because it defines how OpenSkills Tutorial: Universal Skill Loading for Coding Agents implements the patterns covered in this chapter.
The SkillLocation interface in src/types.ts handles a key part of this chapter's functionality:
}
export interface SkillLocation {
path: string;
baseDir: string;
source: string;
}
export interface InstallOptions {
global?: boolean;
universal?: boolean;
yes?: boolean;
}
export interface SkillMetadata {
name: string;
description: string;
context?: string;
}This interface is important because it defines how OpenSkills Tutorial: Universal Skill Loading for Coding Agents implements the patterns covered in this chapter.
flowchart TD
A[syncAgentsMd]
B[SyncOptions]
C[Skill]
D[SkillLocation]
E[InstallOptions]
A --> B
B --> C
C --> D
D --> E