.claude/skills/environment/SKILL.md
Windows/PowerShell environment configuration rules. Applies to all operations. Covers shell commands, file paths, encoding best practices, and .cursor directory protection.
npx skillsauth add Kang-chen/kownledgeBase environmentInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
\)Get-ChildItem, New-Item, Remove-Item-Path parameter and escape sequences$env:VARIABLE_NAMESet-ExecutionPolicy for script execution/) in configuration files when possible/ and \ in most contexts"C:\Program Files\..."Problem: PowerShell has encoding issues with non-ASCII characters when passing strings directly to commands.
| Method | Encoding | Notes |
|--------|----------|-------|
| Set-Content (no -Encoding) | System default | Works for system locale |
| Set-Content -Encoding UTF8 | UTF-8 with BOM | May cause issues with some tools |
| [System.IO.File]::WriteAllText(..., UTF8) | UTF-8 no BOM | Best for cross-platform |
Recommendation:
# For system-default encoding (matches locale)
Set-Content -Path "filename.txt" -Value $content
# For UTF-8 without BOM (cross-platform compatible)
[System.IO.File]::WriteAllText($path, $content, [System.Text.UTF8Encoding]::new($false))
Solutions:
# Write to temp file with UTF-8 (no BOM), then use -F flag
$msg = "Your message here"
$file = "COMMIT_MSG.tmp"
[System.IO.File]::WriteAllText($file, $msg, [System.Text.UTF8Encoding]::new($false))
git commit -F $file
Remove-Item $file
Avoid:
@" "@ | Out-File for non-ASCII text (may cause encoding issues)-m parameter<<'EOF') in PowerShell-ExecutionPolicy Bypass for temporary script execution if needed.cursor/ files when explicitly requested by the user.cursor/ directory contains critical configuration files (rules, skills, settings).cursor/ without explicit user instruction.cursor/ files, proceed with the operationtools
Project-based file organization and rule loading guidance. Defines project memory system, file structure by project, and mandatory rule loading workflow for archival tasks.
documentation
Rules for storing and isolating sensitive/private notes and credentials. Defines detection patterns, handling procedures, and organization guidelines.
development
Rules for categorizing notes into planning, programming, and biology directories. Includes keyword matching, file formatting, and special commands like TODO archival. Trigger on: 归档TODO, 周归档. Also handles [~] cancelled tasks.
development
Organizes notes into the personal knowledge base based on predefined rules. Use when the user wants to save, categorize, or organize notes and ideas, or when content is prefixed with `[[[`. Trigger on: 周回顾, weekly review (runs full weekly review workflow), or any inbox processing request. Proactive: On Fridays/weekends when last review was >5 days ago, suggest "本周还未进行周回顾".