agentleFS
pablodiazjorgepablodiazjorge/prompt-forge/.github/skills/powershell-patterns/SKILL.md

powershell-patterns

Skill2 starsChanged 5 months agoMITView on GitHub

PowerShell 5.1 patterns, pitfalls, and best practices for Windows development. Use when running terminal commands, writing PowerShell scripts, working with Node.js/npm on Windows, or encountering PowerShell errors. Covers nvm-windows, Angular template escaping, execution policy, and cmdlet selection.

  • Installs packages

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Native cmdlets: not aliases: Get-ChildItem not ls, Select-String not findstr

    line 62
  2. Very specific:

    Test-Path: before reading/writing

    line 66

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

PowerShell Patterns for Development

Critical Pitfalls

Templates with {{ }} — NEVER use Set-Content or heredocs

PowerShell interprets {{ }} as variable interpolation. Use the agent's create_file tool for any file containing {{ }}, ${{}}, or Angular syntax.

# ❌ NEVER:
Set-Content file.html @"<div>{{ title }}</div>"@

# ✅ Always: agent create_file tool
# Editing existing files: replace_string_in_file
# Commands WITHOUT {{ }}: Set-Content with single quotes works fine

nvm-windows

  • nvm install X.Y.Z does NOT auto-activate → nvm use X.Y.Z is mandatory
  • nvm list shows installed versions, * = active
  • Global packages (@angular/cli) are NOT migrated between versions
  • Requires Admin shell — run PowerShell as Administrator
  • @angular/cli@22 → Node ^22.22.3 || ^24.15.0 || >=26.0.0

Chaining — NEVER &&

&& is not valid in PowerShell 5.1:

npm install; npm run build   # OK
npm install                  # Better: separate commands
npm run build

Execution Policy

Windows 11/10 default to Restricted — .ps1 scripts won't execute.

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned              # Requires admin
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser  # Without admin

Best Practices

  1. Native cmdlets not aliases: Get-ChildItem not ls, Select-String not findstr
  2. Quote paths: "C:\Path With Spaces\file.txt"
  3. Select-Object -First N to limit output
  4. 2>$null to suppress stderr
  5. Test-Path before reading/writing
  6. NEVER Start-Sleep — the agent is notified when async commands finish
  7. Remove-Item -Force to delete; Push-Location/Pop-Location to navigate

File Operations Decision Table

TaskTool
Create file with {{ }}Agent create_file
Edit existing filereplace_string_in_file
Multiple simultaneous editsmulti_replace_string_in_file
Simple script without templatesSet-Content with single quotes
Overwrite existing fileRemove-Item -Force → create_file

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.