Skip to content

Nexa-Language/Skill-Compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

35 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

NSC Logo

Nexa Skill Compiler

Write Once, Run Anywhere for AI Agent Skills

License Version Rust Status

ไธญๆ–‡็‰ˆ | English

๐Ÿ“š ๆ–‡ๆกฃ: ไธญๆ–‡ | API Reference


๐Ÿ“ฆ Installation

# Via npm (recommended for Node.js users)
npm install -g nexa-skill-compiler

# Via cargo (recommended for Rust users)
cargo install nexa-skill-cli

# From source
git clone https://github.com/ouyangyipeng/Skill-Compiler.git
cd Skill-Compiler
cargo install --path nexa-skill-cli

VS Code Extension (ๆš‚ไธๅฎž็Žฐ)

VS Code ๆ‰ฉๅฑ•๏ผˆvscode-nexa-skill/๏ผ‰ไฝœไธบๆœชๆฅๆ‰ฉๅฑ•๏ผŒๅฝ“ๅ‰ไธๅœจๅผ€ๅ‘่Œƒๅ›ดๅ†…ใ€‚ๅŽ็ปญ็‰ˆๆœฌๅฐ†ๆไพ› IDE ๅ†…้›†ๆˆๆ”ฏๆŒใ€‚


๐Ÿš€ Quick Start

# Compile a skill for all platforms
nsc build skill.md

# Compile for specific target
nsc build skill.md --target claude

# Validate a skill file
nsc validate skill.md

# Initialize a new skill from template
nsc init my-skill

โšก What is NSC?

Nexa Skill Compiler (NSC) ๆ˜ฏไธ€ไธชๅทฅไธš็บง็š„ๅคš็›ฎๆ ‡็ผ–่ฏ‘ๅ™จ๏ผŒๅฐ†็ปŸไธ€็š„ SKILL.md ่ง„่Œƒ่ฝฌๆขไธบๅนณๅฐ็‰นๅฎš็š„ AI Agent ๆŒ‡ไปคใ€‚ๅฎƒๅฎž็Žฐไบ† AI Agent ๆŠ€่ƒฝ็š„ "ไธ€ๆฌก็ผ–ๅ†™๏ผŒๅˆฐๅค„่ฟ่กŒ"โ€”โ€”ๆ”ฏๆŒ Claude Codeใ€OpenAI Codex/GPTใ€Google Gemini ๅ’Œ Kimi ็ญ‰ๅคšไธชๅนณๅฐใ€‚


๐Ÿ”ฅ Key Features

๐Ÿ” Frontend: Parsing & Validation

ๅ‰็ซฏ่งฃๆžไธŽ้™ๆ€ๅˆ†ๆž๏ผš

  • YAML Frontmatter Parser - ้ซ˜ๆ€ง่ƒฝไบ‹ไปถๆต่งฃๆž
  • Type Validation - ๅญ—ๆฎต็ฑปๅž‹ๆฃ€ๆŸฅไธŽๅฟ…ๅกซ้กน้ชŒ่ฏ
  • Permission Auditor - ๆƒ้™้™ๆ€ๅˆ†ๆžไธŽๅฎ‰ๅ…จๅฎก่ฎก
  • MCP Dependency Checker - ไพ่ต–ๅ…ณ็ณปๅˆ†ๆžไธŽ้ชŒ่ฏ

๐Ÿง  Mid-end: IR & Optimization

ไธญ็ซฏไผ˜ๅŒ–ไธŽๅฎ‰ๅ…จๅขžๅผบ๏ผš

  • SkillIR - ็ปŸไธ€ไธญ้—ด่กจ็คบ๏ผŒๅนณๅฐๆ— ๅ…ณ็š„ๆŠฝ่ฑก
  • Anti-Skill Injection - ๅๅ‘ๆจกๅผๆณจๅ…ฅ๏ผŒ่‡ชๅŠจ้˜ฒๅพกๅฑ้™ฉ่กŒไธบ
  • Security Level Analyzer - ๅ››็บงๅฎ‰ๅ…จๆจกๅž‹้ชŒ่ฏ
  • HITL Triggers - ้ซ˜้ฃŽ้™ฉๆ“ไฝœ่‡ชๅŠจ่งฆๅ‘ไบบๆœบไบคไบ’็กฎ่ฎค

๐Ÿš€ Backend: Multi-Target Emission

ๅŽ็ซฏๅคšๅนณๅฐไปฃ็ ็”Ÿๆˆ๏ผš

  • Claude Target - ็”Ÿๆˆ Claude Code ๅ…ผๅฎน็š„ SKILL.md
  • Codex Target - ็”Ÿๆˆ OpenAI Codex/GPT ๆ ผๅผ
  • Gemini Target - ็”Ÿๆˆ Google Gemini ็ณป็ปŸๆŒ‡ไปค
  • Kimi Target - ็”Ÿๆˆ Kimi (Moonshot) Markdown ๆ ผๅผ
  • Parallel Emission - ๅนถ่กŒๅคš็›ฎๆ ‡็”Ÿๆˆ๏ผŒๆๅ‡็ผ–่ฏ‘ๆ•ˆ็އ

โšก High Performance

้ซ˜ๆ€ง่ƒฝๅŽŸ็”Ÿๅฎž็Žฐ๏ผš

  • Rust Native - ้ซ˜ๆ€ง่ƒฝๅŽŸ็”Ÿ็ผ–่ฏ‘ๅ™จๅฎž็Žฐ
  • Structured Pipeline - ๅ››้˜ถๆฎต็ผ–่ฏ‘็ฎก็บฟ๏ผŒ้˜ถๆฎต่พน็•Œๆธ…ๆ™ฐ
  • Async Emission - ๅผ‚ๆญฅๅคš็›ฎๆ ‡ๅนถ่กŒ็”Ÿๆˆ

โš ๏ธ ๅฎž้ชŒๆ•ฐๆฎ่ฏดๆ˜Ž๏ผšๅ‰ๆœŸๅฏนๆฏ”ๅฎž้ชŒๅ›  Claude Code ๆƒ้™ๆจกๅž‹้™ๅˆถ๏ผˆheadlessๆจกๅผไธ‹ๆ— ๆณ•ไบคไบ’ๅฎกๆ‰น๏ผ‰๏ผŒๆ‰€ๆœ‰ไปปๅŠกๅฎž้™…ๆˆๅŠŸ็އไธบ 0%๏ผŒๅ› ๆญคๆš‚ไธๅผ•็”จๆ‰ง่กŒ้€Ÿๅบฆๅฏนๆฏ”ๆ•ฐๆฎใ€‚่ฏฆ่ง ๅฎกๆŸฅๆŠฅๅ‘Šใ€‚


๐Ÿ“ˆ Compilation Quality

็ผ–่ฏ‘ๅ™จๆ ธๅฟƒ่ดจ้‡ๆŒ‡ๆ ‡๏ผˆๅŸบไบŽๅ†…้ƒจๆต‹่ฏ•๏ผ‰๏ผš

Metric Value Description
Compilation Success Rate 100% 32 skills ๆˆๅŠŸ็ผ–่ฏ‘๏ผˆๅซๅˆๆˆๆต‹่ฏ•ๆ•ฐๆฎ๏ผ‰
Validation Rules ~10 Schema + Permission + Anti-Skill ๆฃ€ๆŸฅ่ง„ๅˆ™
Target Platforms 4 Claude (XML), Codex (Markdown), Gemini (Markdown+YAML), Kimi (Markdown)

โš ๏ธ ๅ‰ๆœŸๅคง่ง„ๆจกๅฏนๆฏ”ๅฎž้ชŒๅ› ๆƒ้™ๆจกๅž‹้™ๅˆถๅญ˜ๅœจๆ–นๆณ•่ฎบ็ผบ้™ท๏ผŒๆ•ฐๆฎๆš‚ไธๅฏๅผ•็”จใ€‚ๅฎž้ชŒๆก†ๆžถไฟฎๅคๅŽๅฐ†้‡ๆ–ฐ่ฏ„ไผฐใ€‚

่ฏฆ่ง ๅฎกๆŸฅๆŠฅๅ‘Š | ๅฎž้ชŒๆŠฅๅ‘Š


Overview

Nexa Skill Compiler (NSC) is an industrial-grade compiler that transforms unified SKILL.md specifications into platform-specific agent instructions. It enables Write Once, Run Anywhere for AI agent skills across Claude Code, OpenAI Codex/GPT, Google Gemini, and Kimi.

Why NSC?

Problem Solution
Skills are platform-specific Unified SKILL.md specification
Manual adaptation is error-prone Automated compilation pipeline
No semantic validation Built-in analyzer with schema, permission, and anti-skill checks
Security risks in skills Permission auditor & Anti-Skill injection

Key Features

  • ๐Ÿš€ Multi-Target Compilation - Single source to Claude, Codex, Gemini, Kimi
  • ๐Ÿ”’ Security-First Design - Permission auditing, HITL triggers, Anti-Skill patterns
  • ๐Ÿ“Š Semantic Validation - Schema, permission, and anti-skill validation with actionable diagnostics
  • โšก High Performance - Rust-native compiler with async parallel emission
  • ๐Ÿ› ๏ธ Developer Experience - Beautiful CLI with miette error reporting
  • ๐Ÿ“ฆ Extensible Architecture - Plugin-based Analyzer and Emitter system

Quick Start

Installation

# From crates.io (recommended)
cargo install nexa-skill-compiler

# From source
git clone https://github.com/ouyangyipeng/Skill-Compiler
cd Skill-Compiler
cargo install --path nexa-skill-cli

Basic Usage

# Compile a skill for all platforms
nsc build skill.md --target all --output dist/

# Compile for specific platform
nsc build skill.md --target claude --output dist/

# Validate skill specification
nsc check skill.md

# Initialize a new skill project
nsc init my-skill --author "Your Name"

Example: Database Migration Skill

---
name: database-migration
description: PostgreSQL schema migration with safety guarantees
version: 1.0.0
security_level: critical
permissions:
  - kind: database
    scope: "postgresql://localhost:5432/*"
mcp_servers:
  - postgres-admin
hitl_required: true
---

# PostgreSQL Schema Migration

## Procedures

### 1. Context Gathering
- Analyze current schema state
- Identify affected tables and constraints
- Estimate migration impact

### 2. Execution
- Generate migration SQL with rollback
- Execute in transaction block
- Verify schema integrity

### 3. Fallbacks
- On failure: rollback transaction
- Log error details for debugging
- Notify administrator for manual intervention

## Examples

### Adding a Column
```sql
ALTER TABLE users ADD COLUMN last_login TIMESTAMP;

Constraints

  • NEVER execute without backup
  • ALWAYS use transaction blocks
  • REQUIRE human approval for production

Compile it:

```bash
nsc build database-migration.md --target claude codex gemini

Output structure:

dist/
โ”œโ”€โ”€ claude/
โ”‚   โ””โ”€โ”€ database-migration/
โ”‚       โ”œโ”€โ”€ SKILL.md
โ”‚       โ””โ”€โ”€ manifest.json
โ”œโ”€โ”€ codex/
โ”‚   โ””โ”€โ”€ database-migration/
โ”‚       โ”œโ”€โ”€ AGENTS.md
โ”‚       โ””โ”€โ”€ manifest.json
โ”œโ”€โ”€ gemini/
โ”‚   โ””โ”€โ”€ database-migration/
โ”‚       โ”œโ”€โ”€ SYSTEM.md
โ”‚       โ””โ”€โ”€ manifest.json
โ””โ”€โ”€ manifest.json

Architecture

NSC follows a classic compiler architecture with four phases:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    Nexa Skill Compiler Pipeline                  โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                 โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚ Frontend โ”‚โ”€โ”€โ”€โ–ถโ”‚ IR Build โ”‚โ”€โ”€โ”€โ–ถโ”‚ Analyzer โ”‚โ”€โ”€โ”€โ–ถโ”‚ Backend  โ”‚  โ”‚
โ”‚  โ”‚          โ”‚    โ”‚          โ”‚    โ”‚          โ”‚    โ”‚          โ”‚  โ”‚
โ”‚  โ”‚ โ€ข YAML   โ”‚    โ”‚ โ€ข SkillIRโ”‚    โ”‚ โ€ข Schema โ”‚    โ”‚ โ€ข Claude โ”‚  โ”‚
โ”‚  โ”‚ โ€ข Markdownโ”‚    โ”‚ โ€ข Valid โ”‚    โ”‚ โ€ข MCP    โ”‚    โ”‚ โ€ข Codex  โ”‚  โ”‚
โ”‚  โ”‚ โ€ข AST    โ”‚    โ”‚          โ”‚    โ”‚ โ€ข Perm   โ”‚    โ”‚ โ€ข Gemini โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚ โ€ข Anti   โ”‚    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚                                   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                  โ”‚
โ”‚                                                                 โ”‚
โ”‚  Input: SKILL.md  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ถ  Output:     โ”‚
โ”‚                                                    Platform     โ”‚
โ”‚                                                    Skills       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Module Structure

Crate Purpose
nexa-skill-core Compiler pipeline, IR, Analyzer, Backend
nexa-skill-cli Command-line interface with beautiful UX
nexa-skill-templates Template utilities for skill scaffolding

Performance

็ผ–่ฏ‘ๅ™จๆ ธๅฟƒ็ฎก็บฟๆ€ง่ƒฝ๏ผˆ็ผ–่ฏ‘้˜ถๆฎต่€—ๆ—ถ๏ผ‰๏ผš

Metric Value Description
Compilation Time <100ms ๅ•ๆ–‡ไปถๅ››้˜ถๆฎต็ผ–่ฏ‘่€—ๆ—ถ๏ผˆRust native๏ผ‰
Compilation Success Rate 100% ๅ†…้ƒจๆต‹่ฏ•ๆ•ฐๆฎ้›†ๅ…จ้ƒจ็ผ–่ฏ‘ๆˆๅŠŸ
Target Coverage 4 platforms Claude XML, Codex Markdown, Gemini Markdown+YAML, Kimi Markdown

โš ๏ธ ๅ‰ๆœŸๆ‰ง่กŒ้€Ÿๅบฆๅฏนๆฏ”ๅฎž้ชŒ๏ผˆๅฃฐ็งฐ"16.9% faster"๏ผ‰ๅ› ๅฎž้ชŒๆ–นๆณ•่ฎบ็ผบ้™ท๏ผˆ0%ๆˆๅŠŸ็އ๏ผ‰ๆš‚ไธๅฏๅผ•็”จใ€‚่ฏฆ่ง ๅฎกๆŸฅๆŠฅๅ‘Šใ€‚


Documentation

Document Description
User Guide Comprehensive user documentation
Specification SKILL.md format specification
Architecture System architecture overview
API Reference Compiler API documentation
Development Guide Contributing guidelines
Security Model Security architecture

Roadmap

v1.0 (Current)

  • โœ… Multi-target compilation (Claude, Codex, Gemini, Kimi)
  • โœ… Semantic validation with schema, permission, and anti-skill rules
  • โœ… Permission auditing & security levels
  • โœ… Anti-Skill pattern injection
  • โœ… Beautiful CLI with miette diagnostics

v1.1 (Planned)

  • ๐Ÿ”ฒ VS Code extension
  • ๐Ÿ”ฒ Web-based skill editor
  • ๐Ÿ”ฒ Skill package registry
  • ๐Ÿ”ฒ Auto-update mechanism

v2.0 (Future)

  • ๐Ÿ”ฒ Custom target platform SDK
  • ๐Ÿ”ฒ Skill dependency management
  • ๐Ÿ”ฒ WASM-based sandbox execution
  • ๐Ÿ”ฒ Distributed skill orchestration

Contributing

We welcome contributions! Please see Development Guide for:

  • Code style guidelines
  • Commit message conventions
  • PR review process
  • Testing requirements

Quick Contribution Guide

# 1. Fork and clone
git clone https://github.com/YOUR_USERNAME/Skill-Compiler

# 2. Create feature branch
git checkout -b feat/my-feature

# 3. Make changes and test
cargo test
cargo clippy

# 4. Commit with conventional format
git commit -m ":sparkles: feat: add new feature"

# 5. Push and create PR
git push origin feat/my-feature

License

MIT License - see LICENSE for details.


Acknowledgments

NSC is inspired by:


Citation

If you use NSC in your research, please cite:

@software{nexa_skill_compiler_2026,
  author = {Ouyang, Yipeng},
  title = {Nexa Skill Compiler: A Multi-Target Skill Compiler for AI Agent Platforms},
  year = {2026},
  url = {https://github.com/ouyangyipeng/Skill-Compiler},
  note = {Version 1.0}
}

Made with โค๏ธ by the Nexa Team

GitHub ยท Issues ยท Discussions

About

Write Once, Run Anywhere for AI Agent Skills. Claude Code. Codex. OpenClaw. Gemini.

Resources

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors