/workspace:cross-platformfrom workspace
跨平台(Windows/macOS/Linux)撰寫程式與腳本的通用做法——路徑與分隔符、換行(LF/CRLF)、檔名大小寫、shell 語法差異、null 裝置、環境變數與編碼;附 .NET 寫法。Use when 寫檔案路徑、判斷作業系統、寫 shell 腳本或 CI workflow、避免 Windows 專用指令、處理換行或大小寫問題、"cross platform"、"跨平台"、"path.combine"、"在 Mac/Linux 上壞掉"。
Ships in workspace. 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.
Read when SKILL.md points to them.
程式、腳本、CI 要在 Windows、macOS、Linux 都能跑。原則:不假設分隔符、不假設大小寫、不假設換行、不假設 shell。
先看專案的 *.csproj、package.json、go.mod、pyproject.toml、.editorconfig、.gitattributes,對照下表載入附錄,並在回報第一行寫「附錄:<檔名>」。
| 偵測到 | 附錄 |
|---|---|
*.csproj、*.sln | references/dotnet.md |
沒有對應附錄:照本 skill 的通用方法,加上專案既有程式的寫法(先找 2–3 個同類檔當樣板;照 convention-first skill)。做完問使用者要不要整理成新附錄 references/<stack>.md,回報寫「附錄:無(照既有程式)」。
Path.Combine、path.join、pathlib、filepath.Join),不手接字串、不硬編碼 \ 或 /。%APPDATA%、macOS ~/Library/Application Support、Linux $XDG_CONFIG_HOME),不寫死 C:\ 或 /home/...。Foo.cs vs foo.cs、import './Utils' vs utils.js 壞掉。git mv(必要時分兩步),否則 Windows/macOS 不會偵測到。con、nul、aux、com1…)與結尾的點或空格。.gitattributes 設 * text=auto eol=lf(批次檔、.ps1、.sln 之類需要 CRLF 的另外指定),.editorconfig 設 end_of_line = lf。bad interpreter 或 \r: command not found;修法是轉 LF,不是改直譯器。\n。OperatingSystem.IsWindows()、process.platform、runtime.GOOS、sys.platform),不靠環境變數或路徑字串猜。if windows。腳本以 POSIX/Git Bash 語法為準,路徑分隔符用 /,shebang 寫 #!/usr/bin/env bash,並設可執行位(git update-index --chmod=+x)。
統一用 /dev/null,不要用 Windows 的 nul:
command > /dev/null # 正確
command > /dev/null 2>&1 # 正確
command > nul # 錯誤(在 Git Bash 會實際建立一個名為 nul 的檔案)
| 避免 | 跨平台替代 |
|---|---|
dir | ls |
copy / move / del | cp / mv / rm |
type | cat |
set VAR= | export VAR= |
taskkill | 用語言/SDK 的程序管理 API |
sed -i:GNU 直接 sed -i 's/a/b/' f,BSD(macOS)要 sed -i '' ...;要可攜就用 perl -pi -e 或臨時檔。date、readlink -f、xargs -r、grep -P 在 macOS 預設行為不同或不存在;用到先確認,或改用 Python/Node 腳本。mkdir -p、rm -rf、cp -R 是可攜寫法。export;CI 內用平台的語法(GitHub Actions 的 env:、$GITHUB_ENV)。ubuntu-latest、windows-latest、macos-latest)。shell: bash,讓 Windows runner 也用同一套語法。runner.os。C:\\、/home/、/Users/)與手接的反斜線。What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub kerryhuang/plugharbor --plugin workspace13 skills in this plugin
/agent-orchestration適用於多階段 agent chain(≥2 個 agent 接力)、需要用 output file 交棒、把多步工作流展示給使用者確認、偵測到「工作完成」需清理階段性產物、跨 agent 任務串接決策。涵蓋 chain 規範、output 路徑、清理流程、工作流呈現格式、subagent 作為 context 隔離工具的使用時機。觸發語:「召喚某 agent」「多階段流程」「工作流規劃」「agent 交棒」。/commit建立符合 Conventional Commits 規範的提交訊息,支援 Git Flow+Semantic Release。Use when 你自己要下 git commit(含自動流程中)、使用者說「commit」「幫我提交」。/context-hygieneUse when 對話很長 / context 快滿 / 連續修同一錯誤失敗 / 即將切換到無關任務 / 要讀大量檔案探索 / agent 交接(handoff)/ 對話要搬到別的專案目錄 / 使用者說「對話太長」「感覺變笨」「context 滿了」「要不要清一下」「clean context」時。Other plugins' skills for the same job