/desktop-avalonia:desktop-build-publishfrom desktop-avalonia
Avalonia 桌面應用的建置與發佈——dotnet build 驗證、跨平台單一執行檔發佈(win/osx/linux RID)、macOS .app/.dmg 打包與輸出位置。Use when 使用者說「建置」「build」「編譯」「發佈」「publish」「打包」「產生執行檔」「single file」「self-contained」或要建立 Windows/macOS/Linux 可執行檔。
Ships in desktop-avalonia. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Avalonia 桌面應用的建置驗證與跨平台單一執行檔發佈流程。
執行 dotnet build 建置整個解決方案,作為能否編譯的快速驗證:
dotnet build
建置失敗時分析錯誤訊息並提供修正建議;成功後回報結果。
將桌面應用發佈為 self-contained 單一執行檔,支援 Windows、macOS、Linux。
由參數指定目標平台,未指定時依目前作業系統自動偵測:
win-x64osx-arm64(Apple Silicon)或 osx-x64(Intel)linux-x64參數與 Runtime Identifier(RID)對照:
| 參數 | RID |
|---|---|
win / win-x64 | win-x64 |
win-arm64 | win-arm64 |
mac / osx-x64 | osx-x64 |
mac-arm / osx-arm64 | osx-arm64 |
linux / linux-x64 | linux-x64 |
linux-arm64 | linux-arm64 |
dotnet publish <桌面專案路徑> -c Release -r <rid> --self-contained -p:PublishSingleFile=true
<桌面專案路徑>:桌面 app 進入點專案(含 OutputType=WinExe 或 Avalonia app 主專案)。<rid>:上表對照的 Runtime Identifier。--self-contained:內含 .NET runtime,目標機器免安裝 runtime。-p:PublishSingleFile=true:打包成單一 exe。osx-*)macOS 平台在 dotnet publish 完成後,另需將 publish 產物包成原生格式。以打包腳本產生:
./scripts/create-macos-bundle.sh <version> <rid> <publish 輸出目錄> <發佈輸出目錄>
<version> 從桌面專案 .csproj 的 <Version> 取得。.app bundle(macOS 原生應用程式格式)與 .dmg 安裝映像檔(使用者可直接點兩下安裝)。若專案尚無此腳本:
.app為含Contents/MacOS/、Contents/Info.plist、Contents/Resources/的目錄結構,.dmg可用hdiutil(macOS 內建)從.app產生。
<桌面專案>/bin/Release/<tfm>/<rid>/publish/<AppName>-<version>-<rid>.dmg發佈完成後,可為使用者建立桌面捷徑指向產出的執行檔:
.lnk(指向 publish/ 內的 .exe)。~/.local/share/applications/ 或桌面建立 .desktop 檔(含 Exec= 指向執行檔、Icon= 指向圖示)。.app 拖入 /Applications 或於桌面建立 alias 即可。What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub kerryhuang/kerryhuang-plugins --plugin desktop-avalonia3 skills in this plugin
/avalonia-mvvmAvalonia + CommunityToolkit.Mvvm 桌面專案的 MVVM 慣例——ViewModel 結構、ObservableProperty/RelayCommand、compiled bindings、設計時支援與 AXAML 特殊情境。Use when 撰寫或修改 Avalonia View/ViewModel、寫 AXAML binding、處理對話框回傳、DataGrid 命令綁定、avalonia mvvm、observableproperty、relaycommand。/cross-platformAvalonia 桌面專案的跨平台慣例——Windows/macOS/Linux 相容的路徑處理、平台判斷、腳本語法與 null 裝置寫法。Use when 寫檔案路徑、判斷作業系統、寫 shell 腳本或 CI workflow、避免 Windows 專用指令、cross platform、path.combine、跨平台腳本。