---
id: gh-native-sdk
name: "native-sdk"
url: https://skills.yangsir.net/skill/gh-native-sdk
author: vercel-labs
domain: ai-dev-tools-workflow
tags: ["native-sdk", "desktop-app", "typescript", "cli", "automation"]
install_count: 1500
rating: 4.30 (120 reviews)
github: https://github.com/vercel-labs/native/tree/main/skills/native-sdk
---

# native-sdk

> 此技能为构建原生桌面应用提供完整指引：基于 TypeScript 与声明式 Native 标记编写应用，编译为无 JS 运行时的原生二进制；支持 Zig 核心与 WebView 嵌入，内置自动化服务器，可完成脚手架、UI 编写、桥接命令、打包与自动化测试全流程，显著降低桌面应用开发门槛。

**Stats**: 1,500 installs · 4.3/5 (120 reviews)

## Before / After 对比

### 搭建原生桌面应用从手动配置到一键初始化

**Before**:

在没有这个技能之前，开发者需要手动查阅文档、配置构建系统、编写原生 UI 样板代码，还要处理跨平台编译问题，往往要花数小时才能跑通一个最小可运行的原生桌面应用，且容易在环境配置上出错。

**After**:

此技能提供完整的 Native SDK 指引，用户通过几条命令即可初始化项目、获取核心技能内容，自动生成 TypeScript + Native 标记的初始三文件结构，并利用内置自动化服务器快速验证，将搭建时间从数小时缩短到几分钟。

| Metric | Before | After | Change |
|---|---|---|---|
| 搭建首个桌面应用耗时 | 300分钟 | 10分钟 | -97% |

## Readme

# Native SDK

The Native SDK is the complete toolkit for building native desktop applications. **The primary authoring path is TypeScript app logic in `src/core.ts` plus declarative Native markup in `.native` files.** The TypeScript core is checked and compiled ahead of time to native code, so the shipped binary contains no browser, WebView, JS runtime, or interpreter. Zig is how the toolkit itself works and is a first-class, explicitly chosen app-core alternative (`--template zig-core`); it is not the default inferred from the SDK's implementation. Every app embeds a deterministic automation server, so agents can snapshot, drive, and screenshot the running window. Desktop is the mature surface (macOS deepest, Linux and Windows exercised in CI); mobile embedding is experimental. WebView surfaces coexist as the optional path for embedding web content or hosting an existing web frontend.

## Start here

This file is a discovery stub for agents that installed the Native SDK once with a skills installer such as `npx skills add native-sdk`. Before implementing or explaining Native SDK app work, use the installed CLI to discover and load the current skill content:

```bash
native skills list
native skills get core
native skills get native-ui
native skills get ts-core
```

Use `native skills get core` for initial orientation. For the default app-authoring path, load **both** `native-ui` (views, bindings, the app loop) and `ts-core` (the TypeScript subset, effects, subscriptions, and modules) before implementing. Load `ts-services` too when the tree has `src/services/` or ordinary TypeScript needs filesystem/process/JSON/regex/Map/Date/class work behind `Cmd.request`. Use `native skills get core --full` when work reaches lower-level runtime wiring, WebViews, bridge/security, native capabilities, packaging, or debugging. Use `native skills get automation` when testing a running app, taking snapshots, requesting reloads, or using the built-in automation server. Use `native skills get zig` only for an existing Zig core, a toolkit extension, SDK implementation work, or a Zig 0.16 compile error.

## Quick orientation

```bash
npm install -g @native-sdk/cli
native init my_app
cd my_app
native dev
```

`native init my_app` generates the primary three-file app: `app.json`, `src/app.native` (the markup view), and `src/core.ts` (`Model`, `Msg`, `update`). Existing `app.zon` manifests remain supported. Inspect the tree before editing an existing app and preserve the core language it already uses. `src/main.zig` means the app explicitly uses the Zig-core template; web-frontend shells additionally carry `frontend/` and usually owned build/runtime wiring.


---
*Source: https://skills.yangsir.net/skill/gh-native-sdk*
*Markdown mirror: https://skills.yangsir.net/api/skill/gh-native-sdk/markdown*