一键导入
powershell-windows
Use when user wants to PowerShell Windows patterns. Critical pitfalls, operator syntax, error handling.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when user wants to PowerShell Windows patterns. Critical pitfalls, operator syntax, error handling.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Use when user wants to Coding patterns and conventions extracted from the Win dotfiles repository. Covers commit style, PowerShell script structure, file organization, CI behavior, and issue tracking. Load when writing scripts, commits, or docs for this repo.
Use when the user wants to commit local changes, sync with GitHub, and push. Triggers on "merge my changes", "push to remote", "commit and push", "merge into main", "sync local changes", "get my changes onto main", or any request to integrate local/branch work into main and push to GitHub.
Platform-neutral guidance for using Open Computer Use, the open-source Computer Use MCP server and CLI for macOS, Linux, and Windows. Use when an agent needs to install, verify, troubleshoot, configure, or operate Open Computer Use through its native CLI, stdio MCP server, or direct Computer Use tool calls.
Orchestrates repository and file system cleanup through sequential phases: separating code from docs, organizing folder structure (both repos and general directories), removing legacy code, removing script clutter, pruning documentation sprawl, cleaning documentation content (emojis, hyperbole, 'comprehensive'), and eliminating duplicate files. Use when cleaning repositories, organizing projects, removing legacy code, pruning AI-generated docs, organizing Downloads/Documents/project folders, finding duplicates, restructuring folder hierarchies, or establishing organizational systems. Triggers on: 'clean up repo', 'janitor', 'organize', 'repository cleanup', 'remove legacy', 'prune docs', 'find duplicates', 'organize folder', 'project structure', 'tidy workspace', 'folder cleanup', 'downloads organization'.
Use whenever the user wants Claude to connect to, inspect, run commands on, or move files to/from a device on the local network via SSH - a Raspberry Pi, home server, NAS, router, or any other LAN box, whether referenced by a ~/.ssh/config alias, a raw IP (e.g. 192.168.1.x), or a hostname like "the pi" / "my nas" / "the server in the closet". Also use for discovering what's alive on the LAN, setting up key-based auth to a new device, or running the same check across several LAN hosts. Trigger even if the user doesn't say "SSH" explicitly - e.g. "restart the service on the pi", "grab the logs off my nas", "what's running on 192.168.1.50", "copy this file to my server".
Transforms complex projects into clear, actionable plans through design exploration and strategic breakdown. Guides design validation before implementation, decomposes features into atomic tasks, maps dependencies and critical paths, assesses risks, estimates effort and timeline. Use for new features, refactoring, migrations, team scaling, complex debugging. Provides both design options and implementation roadmaps.
| name | powershell-windows |
| description | Use when user wants to PowerShell Windows patterns. Critical pitfalls, operator syntax, error handling. |
| allowed-tools | Read, Write, Edit, Glob, Grep, Bash(git:*) |
Critical patterns and pitfalls for Windows PowerShell.
| ❌ Wrong | ✅ Correct |
|---|---|
if (Test-Path "a" -or Test-Path "b") | if ((Test-Path "a") -or (Test-Path "b")) |
if (Get-Item $x -and $y -eq 5) | if ((Get-Item $x) -and ($y -eq 5)) |
Rule: Each cmdlet call MUST be in parentheses when using logical operators.
| Purpose | ❌ Don't Use | ✅ Use |
|---|---|---|
| Success | ✅ ✓ | [OK] [+] |
| Error | ❌ ✗ 🔴 | [!] [X] |
| Warning | ⚠️ 🟡 | [*] [WARN] |
| Info | ℹ️ 🔵 | [i] [INFO] |
| Progress | ⏳ | [...] |
Rule: Use ASCII characters only in PowerShell scripts.
| ❌ Wrong | ✅ Correct |
|---|---|
$array.Count -gt 0 | $array -and $array.Count -gt 0 |
$text.Length | if ($text) { $text.Length } |
| ❌ Wrong | ✅ Correct |
|---|---|
"Value: $($obj.prop.sub)" | Store in variable first |
Pattern:
$value = $obj.prop.sub
Write-Output "Value: $value"
| Value | Use |
|---|---|
| Stop | Development (fail fast) |
| Continue | Production scripts |
| SilentlyContinue | When errors expected |
| Pattern | Use |
|---|---|
| Literal path | C:/Users/User/file.txt |
| Variable path | Join-Path $env:USERPROFILE "file.txt" |
| Relative | Join-Path $ScriptDir "data" |
Rule: Use Join-Path for cross-platform safety.
| Operation | Syntax |
|---|---|
| Empty array | $array = @() |
| Add item | $array += $item |
| ArrayList add | `$list.Add($item) |
| ❌ Wrong | ✅ Correct |
|---|---|
ConvertTo-Json | ConvertTo-Json -Depth 10 |
Rule: Always specify -Depth for nested objects.
| Operation | Pattern |
|---|---|
| Read | `Get-Content "file.json" -Raw |
| Write | `$data |
| Error Message | Cause | Fix |
|---|---|---|
| "parameter 'or'" | Missing parentheses | Wrap cmdlets in () |
| "Unexpected token" | Unicode character | Use ASCII only |
| "Cannot find property" | Null object | Check null first |
| "Cannot convert" | Type mismatch | Use .ToString() |
# Strict mode
Set-StrictMode -Version Latest
$ErrorActionPreference = "Continue"
# Paths
$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
# Main
try {
# Logic here
Write-Output "[OK] Done"
exit 0
}
catch {
Write-Warning "Error: $_"
exit 1
}
Remember: PowerShell has unique syntax rules. Parentheses, ASCII-only, and null checks are non-negotiable.