[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CVHY25MCCNQ5FK2K5K36T8":3,"skill-same:01M7CVHY25MCCNQ5FK2K5K36T8":45},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":13,"repositoryHtmlUrl":26,"repositoryHomepageUrl":6,"ownerHtmlUrl":27,"ownerBlogUrl":28,"ownerDescription":29,"updatedAt":30,"install":31,"resources":44},"01M7CVHY25MCCNQ5FK2K5K36T8","setup-local-sdk",null,"Install a .NET SDK locally for safe preview testing, specific-version pinning, or reproducible team setups — without modifying the system-wide installation. USE FOR: trying .NET previews safely, testing specific SDK versions, installing MAUI or other workloads on a preview, updating or replacing an existing local SDK, creating reproducible team\u002FCI install scripts, configuring global.json paths. DO NOT USE FOR: system-wide SDK installs, .NET hosts older than 10, runtime-only installs, or projects not using SDK-style commands.","deadmade\u002Fdead-agent-skills","deadmade","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F130925709?v=4","01M7CTQ65AGYR4J9K9TX0YR9V3","01M7CTQ66B4VMJFEDZP4EKKE6K",0,"MIT","https:\u002F\u002Fgithub.com\u002Fdeadmade\u002Fdead-agent-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fopt-in\u002Fimplementation\u002Fcsharp-skills\u002Flibrary\u002Fsetup-local-sdk\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: setup-local-sdk\nlicense: MIT\ndescription: >\n  Install a .NET SDK locally for safe preview testing, specific-version pinning, or\n  reproducible team setups — without modifying the system-wide installation.\n  USE FOR: trying .NET previews safely, testing specific SDK versions, installing MAUI\n  or other workloads on a preview, updating or replacing an existing local SDK,\n  creating reproducible team\u002FCI install scripts, configuring global.json paths.\n  DO NOT USE FOR: system-wide SDK installs, .NET hosts older than 10, runtime-only\n  installs, or projects not using SDK-style commands.\n---\n\n# setup-local-sdk\n\n## Purpose\n\nGuide the user through installing a .NET SDK into a project-local `.dotnet\u002F`\ndirectory and wiring it up via the `global.json` `paths` feature (.NET 10+).\nThe examples use .NET 11, but this works with any version — prerelease or stable.\n\nThe result is a fully isolated SDK that:\n- Does **not** modify the system-wide .NET installation.\n- Is picked up automatically by `dotnet` commands from the project root.\n- Can be deleted to revert (`rm -rf .dotnet\u002F` or `Remove-Item -Recurse -Force .\\.dotnet`).\n\n## When NOT to use\n\n- User wants a **system-wide** install — direct to the official installer.\n- Host `dotnet` is **older than v10** — `paths` doesn't exist; explain and stop.\n- User needs a **runtime-only** install — `paths` applies to SDK resolution only.\n\n## Inputs \u002F Prerequisites\n\n| Input | Required | Default | Notes |\n|---|---|---|---|\n| Channel or version | No | `11.0` | e.g. `11.0`, `STS`, `LTS`, or an exact version like `11.0.100-preview.2.26159.112` |\n| Quality | No | `preview` | One of: `daily`, `preview`, `ga` |\n| jq | No | — | Optional for bash team scripts when patching an existing `global.json`; without it, do not overwrite the file |\n\n### Prerequisites\n\n1. **A .NET 10+ SDK is installed globally** — run `dotnet --version`; major ≥ 10.\n2. **curl** (macOS\u002FLinux) or **PowerShell** (Windows) is available.\n\n## Workflow\n\n### Step 1 — Clarify what to install\n\nIf the user didn't specify, ask what .NET SDK version they want (e.g., \"latest\n.NET 11 preview\" or an exact version like `11.0.100-preview.2.26159.112`).\nMap the answer to `--channel`\u002F`--quality` or `--version` flags.\n\n### Step 2 — Verify .NET 10+ host\n\nIf the user already provided `dotnet --version` output, treat that as the\nauthoritative version for their machine. Do not override it with the agent\nworkspace's version; if the two differ, explain that the workspace differs and\ncontinue advising for the user's machine.\n\n```bash\ndotnet --version\n```\n\nIf major version \u003C 10, stop before downloading anything: the `paths` feature\nrequires a .NET 10+ host SDK. Tell the user to install .NET 10 or later\nsystem-wide first, then return to the local SDK setup.\n\n### Step 3 — Detect operating system\n\nRun `uname -s 2>\u002Fdev\u002Fnull`. If it succeeds (including `MINGW*`, `MSYS*`, `CYGWIN*` —\nthese are bash-capable environments like Git Bash) → use bash\u002F`dotnet-install.sh`.\nIf it fails (native Windows without Git Bash) → use PowerShell\u002F`dotnet-install.ps1`.\n\n### Step 4 — Check for existing local SDK\n\n**macOS \u002F Linux:**\n\n```bash\ntest -d .dotnet && echo \"exists\" || echo \"not found\"\n```\n\n**Windows (PowerShell):**\n\n```powershell\nif (Test-Path -LiteralPath .\\.dotnet) { \"exists\" } else { \"not found\" }\n```\n\nIf `.dotnet\u002F` exists, ask: update with the new version, or skip and keep it?\n\n### Step 5 — Download and run the install script\n\n**macOS \u002F Linux:**\n\n```bash\nINSTALL_SCRIPT=\"$(mktemp \"${TMPDIR:-\u002Ftmp}\u002Fdotnet-install.XXXXXX\")\"\ntrap 'rm -f \"$INSTALL_SCRIPT\"' EXIT\ncurl -fsSL https:\u002F\u002Fdot.net\u002Fv1\u002Fdotnet-install.sh -o \"$INSTALL_SCRIPT\"\nbash \"$INSTALL_SCRIPT\" --channel \u003CCHANNEL> --quality \u003CQUALITY> --install-dir .dotnet\n```\n\n**Windows (PowerShell):**\n\n```powershell\n$installScript = Join-Path $env:TEMP \"dotnet-install-$([guid]::NewGuid()).ps1\"\ntry {\n    Invoke-WebRequest -Uri 'https:\u002F\u002Fdot.net\u002Fv1\u002Fdotnet-install.ps1' -OutFile $installScript\n    & $installScript -Channel \u003CCHANNEL> -Quality \u003CQUALITY> -InstallDir .dotnet\n}\nfinally {\n    if (Test-Path -LiteralPath $installScript) {\n        Remove-Item -LiteralPath $installScript -Force\n    }\n}\n```\n\nFor exact versions: use `--version \u003CVERSION>` (bash) or `-Version \u003CVERSION>` (PowerShell)\ninstead of channel\u002Fquality flags. The install scripts are from Microsoft's official\nURLs: `https:\u002F\u002Fdot.net\u002Fv1\u002Fdotnet-install.sh` and `https:\u002F\u002Fdot.net\u002Fv1\u002Fdotnet-install.ps1`.\n\n### Step 6 — Identify the installed version\n\n```bash\n.\u002F.dotnet\u002Fdotnet --version          # macOS\u002FLinux\n.\\.dotnet\\dotnet.exe --version      # Windows\n```\n\nRecord the exact version string (e.g., `11.0.100-preview.2.26159.112`) for `global.json`.\n\n### Step 7 — Create or update global.json\n\n```json\n{\n  \"sdk\": {\n    \"version\": \"\u003CINSTALLED_VERSION>\",\n    \"allowPrerelease\": true,\n    \"rollForward\": \"latestFeature\",\n    \"paths\": [\".dotnet\", \"$host$\"],\n    \"errorMessage\": \"Required .NET SDK not found. Run .\u002Finstall-dotnet.sh (or .ps1) to install it locally.\"\n  }\n}\n```\n\n- `paths`: `.dotnet` first (local priority), `$host$` = system-wide fallback.\n- `rollForward: \"latestFeature\"`: use for latest-preview or floating feature-band installs.\n- Exact version requests: use `rollForward: \"disable\"` so SDK resolution doesn't move to a different feature band.\n- `allowPrerelease`: set to `true` only when installing a prerelease SDK. Omit for stable versions.\n- `errorMessage`: include only when team install scripts are created (Step 10). Otherwise omit.\n\nIf `global.json` already exists, **merge** carefully: preserve existing properties (`msbuild-sdks`,\n`tools`, etc.) and only add\u002Fupdate the `sdk` section. Read the existing file first, update\u002Fadd\nthe `sdk` object, then write it back. This ensures cross-project config (e.g., MSBuild settings)\nisn't lost. Always back up the original file (e.g., `global.json.bak`) before modifying.\n\n**Minimal config** (when version pinning isn't needed):\n`{\"sdk\":{\"paths\":[\".dotnet\",\"$host$\"]}}`\n\n### Step 8 — Update .gitignore\n\n**macOS \u002F Linux (or Git Bash):**\n\n```bash\ngrep -qxF '.dotnet\u002F' .gitignore 2>\u002Fdev\u002Fnull || printf '\\n.dotnet\u002F\\n' >> .gitignore\n```\n\n**Windows (PowerShell):**\n\n```powershell\nif (-not (Test-Path .gitignore) -or -not (Select-String -Path .gitignore -Pattern '^\\.dotnet\u002F$' -Quiet)) {\n    Add-Content -Path .gitignore -Value '.dotnet\u002F'\n}\n```\n\n### Step 9 — Install workloads (if requested)\n\nOnly do this after `global.json` and `.gitignore` are complete, so a slow or\nplatform-limited workload install does not prevent the base local SDK setup from\nbeing usable.\n\nIf the user mentioned MAUI, mobile, workload, Blazor WASM, or cross-platform,\ninstall using the **local** binary (no sudo needed):\n\n```bash\n.\u002F.dotnet\u002Fdotnet workload install \u003Cworkload>       # macOS\u002FLinux\n.\\.dotnet\\dotnet.exe workload install \u003Cworkload>   # Windows\n```\n\nVerify: `.\u002F.dotnet\u002Fdotnet workload list` (or `.\\.dotnet\\dotnet.exe workload list`).\n\nFor MAUI, pick a workload supported by the current OS and target platform. On\nLinux, the full `maui` meta-workload is not available; use a supported workload\nsuch as `maui-android` when Android is the target, or explain the platform\nlimitation and ask which target to configure.\n\n> **Always use the local dotnet binary for workload commands.** Workload metadata\n> is stored relative to the host process's dotnet root. The system `dotnet` puts\n> metadata in the wrong location. (See [dotnet\u002Fsdk#49825](https:\u002F\u002Fgithub.com\u002Fdotnet\u002Fsdk\u002Fissues\u002F49825).)\n\n### Step 10 — Create team install scripts\n\nCreate if user mentioned \"team\", \"share\", \"CI\", \"scripts\", etc. Otherwise offer.\nThese examples back up `global.json` and preserve existing settings. The bash script\nuses `jq` when an existing `global.json` must be patched; if `jq` is unavailable,\nit refuses to overwrite the file and prints the settings to merge manually.\nAdapt script variables to the install choice from Step 1: exact versions should\nuse `--version` \u002F `-Version` and `rollForward: \"disable\"`; channel installs should\nuse channel\u002Fquality and only set `allowPrerelease: true` for prerelease SDKs.\nIf `global.json` already pins `sdk.version` and the user mainly needs team\nscripts, reuse that version in the scripts and update `global.json` first; do\nnot start a long SDK download just to discover the version. When the user asks\nfor both setup and scripts, create the scripts\u002Fconfig before any long install so\nthe reproducible setup exists even if download or workload installation is slow.\n\n**install-dotnet.sh:**\n\n```bash\n#!\u002Fusr\u002Fbin\u002Fenv bash\nset -euo pipefail\nINSTALL_DIR=\".dotnet\"\nCHANNEL=\"11.0\"\nQUALITY=\"preview\"\nVERSION=\"\"\nROLL_FORWARD=\"latestFeature\"\nALLOW_PRERELEASE=\"true\"\nWORKLOADS=(\"${@}\")\nERROR_MESSAGE=\"Required .NET SDK not found. Run .\u002Finstall-dotnet.sh (or .ps1) to install it locally.\"\nINSTALL_SCRIPT=\"$(mktemp \"${TMPDIR:-\u002Ftmp}\u002Fdotnet-install.XXXXXX\")\"\nGLOBAL_JSON_TMP=\"\"\ncleanup() {\n    rm -f \"$INSTALL_SCRIPT\"\n    [ -n \"$GLOBAL_JSON_TMP\" ] && rm -f \"$GLOBAL_JSON_TMP\"\n}\ntrap cleanup EXIT\ncurl -fsSL https:\u002F\u002Fdot.net\u002Fv1\u002Fdotnet-install.sh -o \"$INSTALL_SCRIPT\"\nINSTALL_ARGS=(--install-dir \"$INSTALL_DIR\")\nif [ -n \"$VERSION\" ]; then\n    INSTALL_ARGS+=(--version \"$VERSION\")\n    ROLL_FORWARD=\"disable\"\nelse\n    INSTALL_ARGS+=(--channel \"$CHANNEL\" --quality \"$QUALITY\")\nfi\nbash \"$INSTALL_SCRIPT\" \"${INSTALL_ARGS[@]}\"\nSDK_VERSION=$(\"$INSTALL_DIR\u002Fdotnet\" --version)\nwrite_global_json() {\n    if [ -f global.json ]; then\n        cp global.json global.json.bak\n        if ! command -v jq >\u002Fdev\u002Fnull 2>&1; then\n            echo \"global.json exists; install succeeded, but this script will not overwrite it without jq.\" >&2\n            echo \"Merge these sdk settings manually so existing global.json properties are preserved:\" >&2\n            cat >&2 \u003C\u003CEOF\n{\n  \"sdk\": {\n    \"version\": \"$SDK_VERSION\",\n    \"allowPrerelease\": $ALLOW_PRERELEASE,\n    \"rollForward\": \"$ROLL_FORWARD\",\n    \"paths\": [\".dotnet\", \"\\$host\\$\"],\n    \"errorMessage\": \"$ERROR_MESSAGE\"\n  }\n}\nEOF\n            exit 1\n        fi\n        GLOBAL_JSON_TMP=\"$(mktemp \"${TMPDIR:-\u002Ftmp}\u002Fglobal-json.XXXXXX\")\"\n        jq --arg version \"$SDK_VERSION\" --arg rollForward \"$ROLL_FORWARD\" --argjson allowPrerelease \"$ALLOW_PRERELEASE\" --arg errorMessage \"$ERROR_MESSAGE\" '\n          .sdk = ((.sdk \u002F\u002F {}) + {\n            version: $version,\n            allowPrerelease: $allowPrerelease,\n            rollForward: $rollForward,\n            paths: [\".dotnet\", \"$host$\"],\n            errorMessage: $errorMessage\n          })\n        ' global.json > \"$GLOBAL_JSON_TMP\"\n        mv \"$GLOBAL_JSON_TMP\" global.json\n        GLOBAL_JSON_TMP=\"\"\n    else\n        cat > global.json \u003C\u003CEOF\n{\n  \"sdk\": {\n    \"version\": \"$SDK_VERSION\",\n    \"allowPrerelease\": $ALLOW_PRERELEASE,\n    \"rollForward\": \"$ROLL_FORWARD\",\n    \"paths\": [\".dotnet\", \"\\$host\\$\"],\n    \"errorMessage\": \"$ERROR_MESSAGE\"\n  }\n}\nEOF\n    fi\n}\nwrite_global_json\ngrep -qxF '.dotnet\u002F' .gitignore 2>\u002Fdev\u002Fnull || printf '\\n.dotnet\u002F\\n' >> .gitignore\n[ ${#WORKLOADS[@]} -gt 0 ] && \"$INSTALL_DIR\u002Fdotnet\" workload install \"${WORKLOADS[@]}\"\necho \"Done. SDK: $SDK_VERSION\"\n```\n\n```bash\nchmod +x install-dotnet.sh\n```\n\n**install-dotnet.ps1:**\n\n```powershell\nparam([string[]]$Workloads = @())\n$ErrorActionPreference = 'Stop'\n$installDir = '.dotnet'; $channel = '11.0'; $quality = 'preview'\n$version = ''; $rollForward = 'latestFeature'; $allowPrerelease = $true\n$errorMessage = 'Required .NET SDK not found. Run .\u002Finstall-dotnet.sh (or .ps1) to install it locally.'\n$installScript = Join-Path $env:TEMP \"dotnet-install-$([guid]::NewGuid()).ps1\"\ntry {\n    Invoke-WebRequest -Uri 'https:\u002F\u002Fdot.net\u002Fv1\u002Fdotnet-install.ps1' -OutFile $installScript\n    $installArgs = @('-InstallDir', $installDir)\n    if ($version) {\n        $installArgs += @('-Version', $version)\n        $rollForward = 'disable'\n    } else {\n        $installArgs += @('-Channel', $channel, '-Quality', $quality)\n    }\n    & $installScript @installArgs\n}\nfinally {\n    if (Test-Path -LiteralPath $installScript) {\n        Remove-Item -LiteralPath $installScript -Force\n    }\n}\n$sdkVersion = & \"$installDir\\dotnet.exe\" --version\n$globalJson = if (Test-Path 'global.json') {\n    Copy-Item 'global.json' 'global.json.bak'\n    Get-Content -Path 'global.json' -Raw | ConvertFrom-Json\n} else {\n    [pscustomobject]@{}\n}\nif (-not $globalJson.PSObject.Properties['sdk']) {\n    $globalJson | Add-Member -MemberType NoteProperty -Name 'sdk' -Value ([pscustomobject]@{})\n}\n$updates = [ordered]@{\n    version = $sdkVersion\n    allowPrerelease = $allowPrerelease\n    rollForward = $rollForward\n    paths = @('.dotnet', '$host$')\n    errorMessage = $errorMessage\n}\nforeach ($entry in $updates.GetEnumerator()) {\n    $property = $globalJson.sdk.PSObject.Properties[$entry.Key]\n    if ($property) {\n        $property.Value = $entry.Value\n    } else {\n        $globalJson.sdk | Add-Member -MemberType NoteProperty -Name $entry.Key -Value $entry.Value\n    }\n}\n$globalJson | ConvertTo-Json -Depth 10 | Set-Content -Path 'global.json' -Encoding UTF8\nif (-not (Test-Path .gitignore) -or -not (Select-String -Path .gitignore -Pattern '^\\.dotnet\u002F$' -Quiet)) {\n    Add-Content -Path .gitignore -Value '.dotnet\u002F'\n}\nif ($Workloads.Count -gt 0) { & \"$installDir\\dotnet.exe\" workload install @Workloads }\nWrite-Host \"Done. SDK: $sdkVersion\"\n```\n\nCommit these scripts to the repo so teammates can run them.\n\n### Step 11 — Verify SDK resolution\n\n```bash\ndotnet --version\n```\n\nOutput should match the locally installed version. If not, check: global.json\nlocation, `paths` array contents, host dotnet version ≥ 10.\n\n### Step 12 — Summarize and explain cleanup\n\nTell the user: SDK installed, global.json configured, .dotnet\u002F gitignored, system\ninstall untouched. Cleanup: delete `.dotnet\u002F`, remove `paths`\u002F`errorMessage` from\nglobal.json, optionally delete install scripts. Include the final `global.json`\n`sdk` values (or a short snippet) so the user can see the configured version,\n`paths`, and any `errorMessage`. If workloads were requested, include the local\n`dotnet workload install ...` command used and the workload verification result\nor the exact blocker if the workload could not be installed.\n\n## Common pitfalls\n\n| Pitfall | Cause | Fix |\n|---|---|---|\n| `paths` ignored | Host `dotnet` \u003C v10 | Install .NET 10+ system-wide |\n| Wrong SDK resolves | `global.json` in parent directory | Check for global.json up the tree |\n| Teammates get \"SDK not found\" | `.dotnet\u002F` gitignored, no install script run | Use `errorMessage` in global.json |\n| Workloads missing | Used system `dotnet` instead of local | Use `.\u002F.dotnet\u002Fdotnet workload install` |\n| `dotnet app.dll` wrong runtime | `paths` is SDK-only, not apphost | Use `dotnet run` or set `DOTNET_ROOT` |\n","# setup-local-sdk\n\n## Purpose\n\nGuide the user through installing a .NET SDK into a project-local `.dotnet\u002F`\ndirectory and wiring it up via the `global.json` `paths` feature (.NET 10+).\nThe examples use .NET 11, but this works with any version — prerelease or stable.\n\nThe result is a fully isolated SDK that:\n- Does **not** modify the system-wide .NET installation.\n- Is picked up automatically by `dotnet` commands from the project root.\n- Can be deleted to revert (`rm -rf .dotnet\u002F` or `Remove-Item -Recurse -Force .\\.dotnet`).\n\n## When NOT to use\n\n- User wants a **system-wide** install — direct to the official installer.\n- Host `dotnet` is **older than v10** — `paths` doesn't exist; explain and stop.\n- User needs a **runtime-only** install — `paths` applies to SDK resolution only.\n\n## Inputs \u002F Prerequisites\n\n| Input | Required | Default | Notes |\n|---|---|---|---|\n| Channel or version | No | `11.0` | e.g. `11.0`, `STS`, `LTS`, or an exact version like `11.0.100-preview.2.26159.112` |\n| Quality | No | `preview` | One of: `daily`, `preview`, `ga` |\n| jq | No | — | Optional for bash team scripts when patching an existing `global.json`; without it, do not overwrite the file |\n\n### Prerequisites\n\n1. **A .NET 10+ SDK is installed globally** — run `dotnet --version`; major ≥ 10.\n2. **curl** (macOS\u002FLinux) or **PowerShell** (Windows) is available.\n\n## Workflow\n\n### Step 1 — Clarify what to install\n\nIf the user didn't specify, ask what .NET SDK version they want (e.g., \"latest\n.NET 11 preview\" or an exact version like `11.0.100-preview.2.26159.112`).\nMap the answer to `--channel`\u002F`--quality` or `--version` flags.\n\n### Step 2 — Verify .NET 10+ host\n\nIf the user already provided `dotnet --version` output, treat that as the\nauthoritative version for their machine. Do not override it with the agent\nworkspace's version; if the two differ, explain that the workspace differs and\ncontinue advising for the user's machine.\n\n```bash\ndotnet --version\n```\n\nIf major version \u003C 10, stop before downloading anything: the `paths` feature\nrequires a .NET 10+ host SDK. Tell the user to install .NET 10 or later\nsystem-wide first, then return to the local SDK setup.\n\n### Step 3 — Detect operating system\n\nRun `uname -s 2>\u002Fdev\u002Fnull`. If it succeeds (including `MINGW*`, `MSYS*`, `CYGWIN*` —\nthese are bash-capable environments like Git Bash) → use bash\u002F`dotnet-install.sh`.\nIf it fails (native Windows without Git Bash) → use PowerShell\u002F`dotnet-install.ps1`.\n\n### Step 4 — Check for existing local SDK\n\n**macOS \u002F Linux:**\n\n```bash\ntest -d .dotnet && echo \"exists\" || echo \"not found\"\n```\n\n**Windows (PowerShell):**\n\n```powershell\nif (Test-Path -LiteralPath .\\.dotnet) { \"exists\" } else { \"not found\" }\n```\n\nIf `.dotnet\u002F` exists, ask: update with the new version, or skip and keep it?\n\n### Step 5 — Download and run the install script\n\n**macOS \u002F Linux:**\n\n```bash\nINSTALL_SCRIPT=\"$(mktemp \"${TMPDIR:-\u002Ftmp}\u002Fdotnet-install.XXXXXX\")\"\ntrap 'rm -f \"$INSTALL_SCRIPT\"' EXIT\ncurl -fsSL https:\u002F\u002Fdot.net\u002Fv1\u002Fdotnet-install.sh -o \"$INSTALL_SCRIPT\"\nbash \"$INSTALL_SCRIPT\" --channel \u003CCHANNEL> --quality \u003CQUALITY> --install-dir .dotnet\n```\n\n**Windows (PowerShell):**\n\n```powershell\n$installScript = Join-Path $env:TEMP \"dotnet-install-$([guid]::NewGuid()).ps1\"\ntry {\n    Invoke-WebRequest -Uri 'https:\u002F\u002Fdot.net\u002Fv1\u002Fdotnet-install.ps1' -OutFile $installScript\n    & $installScript -Channel \u003CCHANNEL> -Quality \u003CQUALITY> -InstallDir .dotnet\n}\nfinally {\n    if (Test-Path -LiteralPath $installScript) {\n        Remove-Item -LiteralPath $installScript -Force\n    }\n}\n```\n\nFor exact versions: use `--version \u003CVERSION>` (bash) or `-Version \u003CVERSION>` (PowerShell)\ninstead of channel\u002Fquality flags. The install scripts are from Microsoft's official\nURLs: `https:\u002F\u002Fdot.net\u002Fv1\u002Fdotnet-install.sh` and `https:\u002F\u002Fdot.net\u002Fv1\u002Fdotnet-install.ps1`.\n\n### Step 6 — Identify the installed version\n\n```bash\n.\u002F.dotnet\u002Fdotnet --version          # macOS\u002FLinux\n.\\.dotnet\\dotnet.exe --version      # Windows\n```\n\nRecord the exact version string (e.g., `11.0.100-preview.2.26159.112`) for `global.json`.\n\n### Step 7 — Create or update global.json\n\n```json\n{\n  \"sdk\": {\n    \"version\": \"\u003CINSTALLED_VERSION>\",\n    \"allowPrerelease\": true,\n    \"rollForward\": \"latestFeature\",\n    \"paths\": [\".dotnet\", \"$host$\"],\n    \"errorMessage\": \"Required .NET SDK not found. Run .\u002Finstall-dotnet.sh (or .ps1) to install it locally.\"\n  }\n}\n```\n\n- `paths`: `.dotnet` first (local priority), `$host$` = system-wide fallback.\n- `rollForward: \"latestFeature\"`: use for latest-preview or floating feature-band installs.\n- Exact version requests: use `rollForward: \"disable\"` so SDK resolution doesn't move to a different feature band.\n- `allowPrerelease`: set to `true` only when installing a prerelease SDK. Omit for stable versions.\n- `errorMessage`: include only when team install scripts are created (Step 10). Otherwise omit.\n\nIf `global.json` already exists, **merge** carefully: preserve existing properties (`msbuild-sdks`,\n`tools`, etc.) and only add\u002Fupdate the `sdk` section. Read the existing file first, update\u002Fadd\nthe `sdk` object, then write it back. This ensures cross-project config (e.g., MSBuild settings)\nisn't lost. Always back up the original file (e.g., `global.json.bak`) before modifying.\n\n**Minimal config** (when version pinning isn't needed):\n`{\"sdk\":{\"paths\":[\".dotnet\",\"$host$\"]}}`\n\n### Step 8 — Update .gitignore\n\n**macOS \u002F Linux (or Git Bash):**\n\n```bash\ngrep -qxF '.dotnet\u002F' .gitignore 2>\u002Fdev\u002Fnull || printf '\\n.dotnet\u002F\\n' >> .gitignore\n```\n\n**Windows (PowerShell):**\n\n```powershell\nif (-not (Test-Path .gitignore) -or -not (Select-String -Path .gitignore -Pattern '^\\.dotnet\u002F$' -Quiet)) {\n    Add-Content -Path .gitignore -Value '.dotnet\u002F'\n}\n```\n\n### Step 9 — Install workloads (if requested)\n\nOnly do this after `global.json` and `.gitignore` are complete, so a slow or\nplatform-limited workload install does not prevent the base local SDK setup from\nbeing usable.\n\nIf the user mentioned MAUI, mobile, workload, Blazor WASM, or cross-platform,\ninstall using the **local** binary (no sudo needed):\n\n```bash\n.\u002F.dotnet\u002Fdotnet workload install \u003Cworkload>       # macOS\u002FLinux\n.\\.dotnet\\dotnet.exe workload install \u003Cworkload>   # Windows\n```\n\nVerify: `.\u002F.dotnet\u002Fdotnet workload list` (or `.\\.dotnet\\dotnet.exe workload list`).\n\nFor MAUI, pick a workload supported by the current OS and target platform. On\nLinux, the full `maui` meta-workload is not available; use a supported workload\nsuch as `maui-android` when Android is the target, or explain the platform\nlimitation and ask which target to configure.\n\n> **Always use the local dotnet binary for workload commands.** Workload metadata\n> is stored relative to the host process's dotnet root. The system `dotnet` puts\n> metadata in the wrong location. (See [dotnet\u002Fsdk#49825](https:\u002F\u002Fgithub.com\u002Fdotnet\u002Fsdk\u002Fissues\u002F49825).)\n\n### Step 10 — Create team install scripts\n\nCreate if user mentioned \"team\", \"share\", \"CI\", \"scripts\", etc. Otherwise offer.\nThese examples back up `global.json` and preserve existing settings. The bash script\nuses `jq` when an existing `global.json` must be patched; if `jq` is unavailable,\nit refuses to overwrite the file and prints the settings to merge manually.\nAdapt script variables to the install choice from Step 1: exact versions should\nuse `--version` \u002F `-Version` and `rollForward: \"disable\"`; channel installs should\nuse channel\u002Fquality and only set `allowPrerelease: true` for prerelease SDKs.\nIf `global.json` already pins `sdk.version` and the user mainly needs team\nscripts, reuse that version in the scripts and update `global.json` first; do\nnot start a long SDK download just to discover the version. When the user asks\nfor both setup and scripts, create the scripts\u002Fconfig before any long install so\nthe reproducible setup exists even if download or workload installation is slow.\n\n**install-dotnet.sh:**\n\n```bash\n#!\u002Fusr\u002Fbin\u002Fenv bash\nset -euo pipefail\nINSTALL_DIR=\".dotnet\"\nCHANNEL=\"11.0\"\nQUALITY=\"preview\"\nVERSION=\"\"\nROLL_FORWARD=\"latestFeature\"\nALLOW_PRERELEASE=\"true\"\nWORKLOADS=(\"${@}\")\nERROR_MESSAGE=\"Required .NET SDK not found. Run .\u002Finstall-dotnet.sh (or .ps1) to install it locally.\"\nINSTALL_SCRIPT=\"$(mktemp \"${TMPDIR:-\u002Ftmp}\u002Fdotnet-install.XXXXXX\")\"\nGLOBAL_JSON_TMP=\"\"\ncleanup() {\n    rm -f \"$INSTALL_SCRIPT\"\n    [ -n \"$GLOBAL_JSON_TMP\" ] && rm -f \"$GLOBAL_JSON_TMP\"\n}\ntrap cleanup EXIT\ncurl -fsSL https:\u002F\u002Fdot.net\u002Fv1\u002Fdotnet-install.sh -o \"$INSTALL_SCRIPT\"\nINSTALL_ARGS=(--install-dir \"$INSTALL_DIR\")\nif [ -n \"$VERSION\" ]; then\n    INSTALL_ARGS+=(--version \"$VERSION\")\n    ROLL_FORWARD=\"disable\"\nelse\n    INSTALL_ARGS+=(--channel \"$CHANNEL\" --quality \"$QUALITY\")\nfi\nbash \"$INSTALL_SCRIPT\" \"${INSTALL_ARGS[@]}\"\nSDK_VERSION=$(\"$INSTALL_DIR\u002Fdotnet\" --version)\nwrite_global_json() {\n    if [ -f global.json ]; then\n        cp global.json global.json.bak\n        if ! command -v jq >\u002Fdev\u002Fnull 2>&1; then\n            echo \"global.json exists; install succeeded, but this script will not overwrite it without jq.\" >&2\n            echo \"Merge these sdk settings manually so existing global.json properties are preserved:\" >&2\n            cat >&2 \u003C\u003CEOF\n{\n  \"sdk\": {\n    \"version\": \"$SDK_VERSION\",\n    \"allowPrerelease\": $ALLOW_PRERELEASE,\n    \"rollForward\": \"$ROLL_FORWARD\",\n    \"paths\": [\".dotnet\", \"\\$host\\$\"],\n    \"errorMessage\": \"$ERROR_MESSAGE\"\n  }\n}\nEOF\n            exit 1\n        fi\n        GLOBAL_JSON_TMP=\"$(mktemp \"${TMPDIR:-\u002Ftmp}\u002Fglobal-json.XXXXXX\")\"\n        jq --arg version \"$SDK_VERSION\" --arg rollForward \"$ROLL_FORWARD\" --argjson allowPrerelease \"$ALLOW_PRERELEASE\" --arg errorMessage \"$ERROR_MESSAGE\" '\n          .sdk = ((.sdk \u002F\u002F {}) + {\n            version: $version,\n            allowPrerelease: $allowPrerelease,\n            rollForward: $rollForward,\n            paths: [\".dotnet\", \"$host$\"],\n            errorMessage: $errorMessage\n          })\n        ' global.json > \"$GLOBAL_JSON_TMP\"\n        mv \"$GLOBAL_JSON_TMP\" global.json\n        GLOBAL_JSON_TMP=\"\"\n    else\n        cat > global.json \u003C\u003CEOF\n{\n  \"sdk\": {\n    \"version\": \"$SDK_VERSION\",\n    \"allowPrerelease\": $ALLOW_PRERELEASE,\n    \"rollForward\": \"$ROLL_FORWARD\",\n    \"paths\": [\".dotnet\", \"\\$host\\$\"],\n    \"errorMessage\": \"$ERROR_MESSAGE\"\n  }\n}\nEOF\n    fi\n}\nwrite_global_json\ngrep -qxF '.dotnet\u002F' .gitignore 2>\u002Fdev\u002Fnull || printf '\\n.dotnet\u002F\\n' >> .gitignore\n[ ${#WORKLOADS[@]} -gt 0 ] && \"$INSTALL_DIR\u002Fdotnet\" workload install \"${WORKLOADS[@]}\"\necho \"Done. SDK: $SDK_VERSION\"\n```\n\n```bash\nchmod +x install-dotnet.sh\n```\n\n**install-dotnet.ps1:**\n\n```powershell\nparam([string[]]$Workloads = @())\n$ErrorActionPreference = 'Stop'\n$installDir = '.dotnet'; $channel = '11.0'; $quality = 'preview'\n$version = ''; $rollForward = 'latestFeature'; $allowPrerelease = $true\n$errorMessage = 'Required .NET SDK not found. Run .\u002Finstall-dotnet.sh (or .ps1) to install it locally.'\n$installScript = Join-Path $env:TEMP \"dotnet-install-$([guid]::NewGuid()).ps1\"\ntry {\n    Invoke-WebRequest -Uri 'https:\u002F\u002Fdot.net\u002Fv1\u002Fdotnet-install.ps1' -OutFile $installScript\n    $installArgs = @('-InstallDir', $installDir)\n    if ($version) {\n        $installArgs += @('-Version', $version)\n        $rollForward = 'disable'\n    } else {\n        $installArgs += @('-Channel', $channel, '-Quality', $quality)\n    }\n    & $installScript @installArgs\n}\nfinally {\n    if (Test-Path -LiteralPath $installScript) {\n        Remove-Item -LiteralPath $installScript -Force\n    }\n}\n$sdkVersion = & \"$installDir\\dotnet.exe\" --version\n$globalJson = if (Test-Path 'global.json') {\n    Copy-Item 'global.json' 'global.json.bak'\n    Get-Content -Path 'global.json' -Raw | ConvertFrom-Json\n} else {\n    [pscustomobject]@{}\n}\nif (-not $globalJson.PSObject.Properties['sdk']) {\n    $globalJson | Add-Member -MemberType NoteProperty -Name 'sdk' -Value ([pscustomobject]@{})\n}\n$updates = [ordered]@{\n    version = $sdkVersion\n    allowPrerelease = $allowPrerelease\n    rollForward = $rollForward\n    paths = @('.dotnet', '$host$')\n    errorMessage = $errorMessage\n}\nforeach ($entry in $updates.GetEnumerator()) {\n    $property = $globalJson.sdk.PSObject.Properties[$entry.Key]\n    if ($property) {\n        $property.Value = $entry.Value\n    } else {\n        $globalJson.sdk | Add-Member -MemberType NoteProperty -Name $entry.Key -Value $entry.Value\n    }\n}\n$globalJson | ConvertTo-Json -Depth 10 | Set-Content -Path 'global.json' -Encoding UTF8\nif (-not (Test-Path .gitignore) -or -not (Select-String -Path .gitignore -Pattern '^\\.dotnet\u002F$' -Quiet)) {\n    Add-Content -Path .gitignore -Value '.dotnet\u002F'\n}\nif ($Workloads.Count -gt 0) { & \"$installDir\\dotnet.exe\" workload install @Workloads }\nWrite-Host \"Done. SDK: $sdkVersion\"\n```\n\nCommit these scripts to the repo so teammates can run them.\n\n### Step 11 — Verify SDK resolution\n\n```bash\ndotnet --version\n```\n\nOutput should match the locally installed version. If not, check: global.json\nlocation, `paths` array contents, host dotnet version ≥ 10.\n\n### Step 12 — Summarize and explain cleanup\n\nTell the user: SDK installed, global.json configured, .dotnet\u002F gitignored, system\ninstall untouched. Cleanup: delete `.dotnet\u002F`, remove `paths`\u002F`errorMessage` from\nglobal.json, optionally delete install scripts. Include the final `global.json`\n`sdk` values (or a short snippet) so the user can see the configured version,\n`paths`, and any `errorMessage`. If workloads were requested, include the local\n`dotnet workload install ...` command used and the workload verification result\nor the exact blocker if the workload could not be installed.\n\n## Common pitfalls\n\n| Pitfall | Cause | Fix |\n|---|---|---|\n| `paths` ignored | Host `dotnet` \u003C v10 | Install .NET 10+ system-wide |\n| Wrong SDK resolves | `global.json` in parent directory | Check for global.json up the tree |\n| Teammates get \"SDK not found\" | `.dotnet\u002F` gitignored, no install script run | Use `errorMessage` in global.json |\n| Workloads missing | Used system `dotnet` instead of local | Use `.\u002F.dotnet\u002Fdotnet workload install` |\n| `dotnet app.dll` wrong runtime | `paths` is SDK-only, not apphost | Use `dotnet run` or set `DOTNET_ROOT` |\n",{"name":5,"license":14,"description":7},"main","ccab8dffc0ecc173838f51e4c5f0d3b51a704f41","plugins\u002Fopt-in\u002Fimplementation\u002Fcsharp-skills\u002Flibrary\u002Fsetup-local-sdk","https:\u002F\u002Fgithub.com\u002Fdeadmade\u002Fdead-agent-skills","https:\u002F\u002Fgithub.com\u002Fdeadmade","https:\u002F\u002Fdeadmade.github.io\u002F","Blood, an Ocean of blood","2026-11-14 02:03:31",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add deadmade\u002Fdead-agent-skills --skill setup-local-sdk",{"tool":37,"command":38},"bunx","bunx skills add deadmade\u002Fdead-agent-skills --skill setup-local-sdk",{"tool":40,"command":41},"pnpm","pnpm dlx skills add deadmade\u002Fdead-agent-skills --skill setup-local-sdk","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fdeadmade\u002Fdead-agent-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fopt-in\u002Fimplementation\u002Fcsharp-skills\u002Flibrary\u002Fsetup-local-sdk\u002FSKILL.md",true,[],[46,53,62,70,77,84],{"skillNo":47,"name":48,"nameZh":6,"description":49,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":50,"categories":51,"keywords":52,"publishedAt":18},"01M7CVRBFTXSTTQ7F5P6PJEFYA","rust-best-practices","Guide for writing idiomatic Rust code based on Apollo GraphQL's best practices handbook. Use this skill when: (1) writing new Rust code or functions, (2) reviewing or refactoring existing Rust code, (3) deciding between borrowing vs cloning or ownership patterns, (4) implementing error handling with Result types, (5) optimizing Rust code for performance, (6) writing tests or documentation for Rust projects.","https:\u002F\u002Fgithub.com\u002Fdeadmade\u002Fdead-agent-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fopt-in\u002Fimplementation\u002Frust-skills\u002Fskills\u002Frust-best-practices\u002FSKILL.md",[],[],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":57,"licenseFileUrl":58,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":18},"01M7CVR0W7B8EGTNPSPA7FPC4Z","postgres-database-migration","Use this skill for planning, testing, and safely executing PostgreSQL schema migrations — especially when working with production data or shared databases.\n\n**Trigger when user asks to:**\n- Test a schema migration before applying it to production\n- Add, remove, or rename columns safely on a live table\n- Change a column's data type without downtime\n- Add or drop indexes, constraints, or foreign keys on large tables\n- Understand which ALTER TABLE operations lock the table\n- Roll back a failed migration\n- Plan a zero-downtime migration strategy\n- Fork a database to test a migration safely\n\nCovers: lock-level reference for every common DDL operation, safe migration patterns, fork-based testing, zero-downtime column changes, index creation, constraint addition, backfill strategies, pre\u002Fpost-migration validation, and rollback planning.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fdeadmade\u002Fdead-agent-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fopt-in\u002Fimplementation\u002Fpostgres\u002Fskills\u002Fpostgres-database-migration\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fdeadmade\u002Fdead-agent-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fopt-in\u002Fimplementation\u002Fpostgres\u002Fskills\u002Fpostgres-database-migration\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":57,"licenseFileUrl":66,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":18},"01M7CVQWK20ASAZN5VETZC8J99","postgres-best-practices","Best practices and guidelines for working with Postgres. Covers schema design, indexing strategies, query optimization, migrations, and common pitfalls. Use when writing SQL, designing database schemas, optimizing queries, or setting up a Postgres database.","https:\u002F\u002Fgithub.com\u002Fdeadmade\u002Fdead-agent-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fopt-in\u002Fimplementation\u002Fpostgres\u002Fskills\u002Fpostgres-best-practices\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fdeadmade\u002Fdead-agent-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fopt-in\u002Fimplementation\u002Fpostgres\u002Fskills\u002Fpostgres-best-practices\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":18},"01M7CVQ5CY7AQHY7A2Y99RE6A7","writing-mstest-tests","ALWAYS USE when asked to fix, rewrite, update, improve, modernize, show corrected code for, or explain existing MSTest tests or MSTest-specific configuration. Use for \"review\" when corrected code or edits are wanted, even for one pasted assertion or passing tests with bad failure output. Covers expected\u002Factual labels; generic Boolean, collection, string, numeric, null, identity, exception, hard-cast, and object[] checks; TestContext\u002Flifecycle; timeout\u002Fcancellation; OS\u002FCI conditions, retry, cleanup, parallelization, MSTest.Sdk project setup, and MSTESTxxxx. Honor the installed MSTest version. DO NOT USE to design new test cases (code-testing), perform report-only audits, create project files rather than explain MSTest setup, run tests, migrate frameworks, or handle non-MSTest\u002Fnon-.NET code.","https:\u002F\u002Fgithub.com\u002Fdeadmade\u002Fdead-agent-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fopt-in\u002Fimplementation\u002Fcsharp-skills\u002Flibrary\u002Fwriting-mstest-tests\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":18},"01M7CVPWJZ63GB0810F0SCGZ1K","winforms-expert","Create, modify, debug, or review Windows Forms applications only when the request contains a concrete Windows Forms marker. USE FOR: WinForms, Windows Forms, System.Windows.Forms, WinForms Form or UserControl designer files (*.Designer.cs or *.Designer.vb), Visual Studio WinForms Designer, TableLayoutPanel, BindingSource, DataGridView, Control.InvokeAsync, component-tray ownership, or custom control serialization. DO NOT USE FOR: WPF or WPF XAML, including Window.InputBindings, KeyBinding, commands, or DataContext; .NET MAUI; Avalonia; or any request where none of the listed Windows Forms markers is present.","https:\u002F\u002Fgithub.com\u002Fdeadmade\u002Fdead-agent-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fopt-in\u002Fimplementation\u002Fcsharp-skills\u002Flibrary\u002Fwinforms-expert\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":18},"01M7CVPR0QFZ1HMJ6GZRBQAQ7W","vectorization","Design, implement, optimize, and review SIMD code in .NET. USE FOR: vectorizing scalar loops with TensorPrimitives, Vector64\u002F128\u002F256\u002F512, or platform hardware intrinsics; reviewing existing SIMD code, including the generic Vector type, for contract equivalence, tail handling, memory safety, portability, fallbacks, and measured performance. DO NOT USE FOR: performance work unrelated to SIMD or vectorization.","https:\u002F\u002Fgithub.com\u002Fdeadmade\u002Fdead-agent-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fopt-in\u002Fimplementation\u002Fcsharp-skills\u002Flibrary\u002Fvectorization\u002FSKILL.md",[],[]]