agentsclimarketplace

Powershell patterns

Skill pablodiazjorge/prompt-forge/packages/claude/.claude/skills/powershell-patterns

Drop-in toolkit that gives AI coding agents persistent memory across sessions. Agent Skills, cross-session learning loop, and knowledge persistence. Zero dependencies, no backend.

Install
npx -y skills add pablodiazjorge/prompt-forge --skill powershell-patterns

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

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.

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

2.7 KB, as published. Nobody here has run it

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-activatenvm 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 -Forcecreate_file

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.