Write Once, Run Anywhere for AI Agent Skills
ไธญๆ็ | English
๐ ๆๆกฃ: ไธญๆ | API Reference
# 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-cliVS Code ๆฉๅฑ๏ผ
vscode-nexa-skill/๏ผไฝไธบๆชๆฅๆฉๅฑ๏ผๅฝๅไธๅจๅผๅ่ๅดๅ ใๅ็ปญ็ๆฌๅฐๆไพ IDE ๅ ้ๆๆฏๆใ
# 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-skillNexa Skill Compiler (NSC) ๆฏไธไธชๅทฅไธ็บง็ๅค็ฎๆ ็ผ่ฏๅจ๏ผๅฐ็ปไธ็ SKILL.md ่ง่่ฝฌๆขไธบๅนณๅฐ็นๅฎ็ AI Agent ๆไปคใๅฎๅฎ็ฐไบ AI Agent ๆ่ฝ็ "ไธๆฌก็ผๅ๏ผๅฐๅค่ฟ่ก"โโๆฏๆ Claude CodeใOpenAI Codex/GPTใGoogle Gemini ๅ Kimi ็ญๅคไธชๅนณๅฐใ
ๅ็ซฏ่งฃๆไธ้ๆๅๆ๏ผ
- YAML Frontmatter Parser - ้ซๆง่ฝไบไปถๆต่งฃๆ
- Type Validation - ๅญๆฎต็ฑปๅๆฃๆฅไธๅฟ ๅกซ้กน้ช่ฏ
- Permission Auditor - ๆ้้ๆๅๆไธๅฎๅ จๅฎก่ฎก
- MCP Dependency Checker - ไพ่ตๅ ณ็ณปๅๆไธ้ช่ฏ
ไธญ็ซฏไผๅไธๅฎๅ จๅขๅผบ๏ผ
- SkillIR - ็ปไธไธญ้ด่กจ็คบ๏ผๅนณๅฐๆ ๅ ณ็ๆฝ่ฑก
- Anti-Skill Injection - ๅๅๆจกๅผๆณจๅ ฅ๏ผ่ชๅจ้ฒๅพกๅฑ้ฉ่กไธบ
- Security Level Analyzer - ๅ็บงๅฎๅ จๆจกๅ้ช่ฏ
- HITL Triggers - ้ซ้ฃ้ฉๆไฝ่ชๅจ่งฆๅไบบๆบไบคไบ็กฎ่ฎค
ๅ็ซฏๅคๅนณๅฐไปฃ็ ็ๆ๏ผ
- Claude Target - ็ๆ Claude Code ๅ ผๅฎน็ SKILL.md
- Codex Target - ็ๆ OpenAI Codex/GPT ๆ ผๅผ
- Gemini Target - ็ๆ Google Gemini ็ณป็ปๆไปค
- Kimi Target - ็ๆ Kimi (Moonshot) Markdown ๆ ผๅผ
- Parallel Emission - ๅนถ่กๅค็ฎๆ ็ๆ๏ผๆๅ็ผ่ฏๆ็
้ซๆง่ฝๅ็ๅฎ็ฐ๏ผ
- Rust Native - ้ซๆง่ฝๅ็็ผ่ฏๅจๅฎ็ฐ
- Structured Pipeline - ๅ้ถๆฎต็ผ่ฏ็ฎก็บฟ๏ผ้ถๆฎต่พน็ๆธ ๆฐ
- Async Emission - ๅผๆญฅๅค็ฎๆ ๅนถ่ก็ๆ
โ ๏ธ ๅฎ้ชๆฐๆฎ่ฏดๆ๏ผๅๆๅฏนๆฏๅฎ้ชๅ Claude Code ๆ้ๆจกๅ้ๅถ๏ผheadlessๆจกๅผไธๆ ๆณไบคไบๅฎกๆน๏ผ๏ผๆๆไปปๅกๅฎ้ ๆๅ็ไธบ 0%๏ผๅ ๆญคๆไธๅผ็จๆง่ก้ๅบฆๅฏนๆฏๆฐๆฎใ่ฏฆ่ง ๅฎกๆฅๆฅๅใ
็ผ่ฏๅจๆ ธๅฟ่ดจ้ๆๆ ๏ผๅบไบๅ ้จๆต่ฏ๏ผ๏ผ
| 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) |
โ ๏ธ ๅๆๅคง่งๆจกๅฏนๆฏๅฎ้ชๅ ๆ้ๆจกๅ้ๅถๅญๅจๆนๆณ่ฎบ็ผบ้ท๏ผๆฐๆฎๆไธๅฏๅผ็จใๅฎ้ชๆกๆถไฟฎๅคๅๅฐ้ๆฐ่ฏไผฐใ
่ฏฆ่ง ๅฎกๆฅๆฅๅ | ๅฎ้ชๆฅๅ
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.
| 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 |
- ๐ 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
# 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# 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"---
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;- 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
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 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
| 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 |
็ผ่ฏๅจๆ ธๅฟ็ฎก็บฟๆง่ฝ๏ผ็ผ่ฏ้ถๆฎต่ๆถ๏ผ๏ผ
| 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%ๆๅ็๏ผๆไธๅฏๅผ็จใ่ฏฆ่ง ๅฎกๆฅๆฅๅใ
| 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 |
- โ 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
- ๐ฒ VS Code extension
- ๐ฒ Web-based skill editor
- ๐ฒ Skill package registry
- ๐ฒ Auto-update mechanism
- ๐ฒ Custom target platform SDK
- ๐ฒ Skill dependency management
- ๐ฒ WASM-based sandbox execution
- ๐ฒ Distributed skill orchestration
We welcome contributions! Please see Development Guide for:
- Code style guidelines
- Commit message conventions
- PR review process
- Testing requirements
# 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-featureMIT License - see LICENSE for details.
NSC is inspired by:
- Anthropic's Skill System - Skill specification design
- awesome-claude-skills - Community skill corpus
- Composio - SaaS automation patterns
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