Borrowing it
Nothing to install: this file belongs to fadwen/Powershell-Copilot-Standards. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/fadwen/Powershell-Copilot-Standards/main/.github/prompts/code-analysis.prompt.mdgit clone --depth 1 https://github.com/fadwen/Powershell-Copilot-StandardsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/fadwen/powershell-copilot-standards/code-analysis)<a href="https://agentmods.dev/commands/fadwen/powershell-copilot-standards/code-analysis"><img src="https://agentmods.dev/badge/commands/fadwen/powershell-copilot-standards/code-analysis/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/commands/fadwen/powershell-copilot-standards/code-analysis"><img src="https://agentmods.dev/badge/commands/fadwen/powershell-copilot-standards/code-analysis.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00009 | $0.00453 |
| Opus 5.5 | $0.00004 | $0.00181 |
| Sonnet 5.5 | $0.00002 | $0.00091 |
| Haiku 4.5 | $0.00001 | $0.00045 |
Grade A, and why
code-analysis scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
Perform thorough analysis of this PowerShell code against modern best practices:
Selected Code:
${selection}
Analysis Framework:
1. Modern PowerShell Patterns ✅
- Error handling: Verify $_ usage in catch blocks (not $Error[0])
- Credential creation: Check for [PSCredential]::new() vs New-Object
- Parameter validation: Ensure appropriate validation without redundancy
- String operations: Context-appropriate concatenation vs StringBuilder
2. Comment-Based Help Quality ✅
- Proper block comment syntax with opening markers
- Complete parameter documentation
- Meaningful examples with descriptions
- Appropriate .INPUTS and .OUTPUTS sections
- Avoid maintenance-heavy versioning in .NOTES
3. Performance Patterns ✅
- Context-aware string operations (simple vs complex)
- Collection handling: flag
+=only where the declared target is below 7.5, in which it is still O(n²), or where the loop is unbounded. PowerShell 7.5 optimised it. Never suggestArrayList - Appropriate use of pipeline vs loops
- Memory-conscious patterns for large datasets
4. Output Type Design ✅
- Descriptive type names instead of misleading [PSCustomObject]
- Custom classes for complex objects
- Meaningful IntelliSense support
- Proper type declarations
5. Enterprise Standards ✅
- Correlation ID implementation
- Structured logging patterns
- Configuration-driven behavior
- Environment-appropriate error handling
6. Security & Compliance ✅
- Modern security patterns
- Input validation best practices
- Audit trail requirements
- Compliance framework alignment
7. Code Quality Metrics ✅
- Approved PowerShell verb usage
- Consistent style and formatting
- Appropriate function complexity
- Clear separation of concerns
Analysis Output: Provide prioritized recommendations with:
- ❌ Issues found with severity rating
- ✅ Best practices already implemented
- 🔧 Specific code corrections
- 💡 Optimization opportunities
- 📋 Compliance gaps
Include corrected code examples demonstrating proper modern PowerShell patterns.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 78 lines · 9 tokens per session scan A 5a3cfd94cc88
code-analysis is a command published in the GitHub repository fadwen/Powershell-Copilot-Standards (19 stars, last pushed 1mo ago), licensed MIT. It adds 9 tokens to every session and 453 once invoked, about $0.0000 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-16.
Other commands, from other repositories
sql-developer
Comprehensive SQL Server development assistance for T-SQL queries, stored procedures, performance tuning, and code review with Microsoft documentation verification.
swift-developer
Comprehensive Swift development assistance for iOS/macOS apps, Swift packages, SwiftUI, Swift 6 concurrency, and code review with Apple documentation verification.
mx-design-review
Fresh-context reviewer for a proposed Mendix design. Audits against the /mx-discover inventory for naming collisions, anti-patterns, missing tests, security, marketplace overlap, migration risk. Read-only.
mx-impact
Blast-radius analysis for a Mendix entity/attribute/microflow/page. Read-only. Answers "what breaks if I rename or change X?" before the change. Wraps mxcli refs/callers/impact.
review-branch
Review the current branch's diff against base by dispatching atomic-reviewer. No orchestration loop, no spec required — pre-flight before /commit pr or /commit merge.
refactor
Systematic code refactoring with smart scope detection.