agent-ebpf cross-platform-scripting.instructions.md

A set of rules for writing scripts that work on the operating system and shell versions actually available. It covers Windows, macOS, Linux, PowerShell 5.1, and PowerShell 7 or later.

In plain words
What is it for?
Use it when creating or editing PowerShell, shell, or command files, especially in projects supporting multiple operating systems.
Why use it?
It prevents scripts from using commands or syntax that the developer's machine cannot run.

Instructions file for GitHub Copilot

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/ourobx/agent-ebpf/cross-platform-scripting
Clone the repo
git clone --depth 1 https://github.com/ourobx/agent-ebpf

Made for: GitHub Copilot.

Per session 1,327 This file is loaded in full into every session.
When invoked 1,327 The same file — it is already loaded in full.
Security scan C 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.01327 $0.01327
Opus 5 $0.00664 $0.00664
Sonnet 5 $0.00265 $0.00265
Haiku 4.5 $0.00133 $0.00133

Measured yesterday against content hash 65d338243e7b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

agent-ebpf cross-platform-scripting.instructions.md scanned grade C with 1 finding 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 yesterday.

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.

Hidden instructionshighPrompt injection

Directives inside HTML comments, invisible characters or bidirectional overrides are read by the model and not by the person reviewing the file.

<!-- Copilot Instruction Telemetry: This file was auto-generated by Claude Skills Manager -->
.github/instructions/cross-platform-scripting.instructions.md · 89 lines

How it starts

The opening of the file, as written. The whole thing — 89 lines — stays where its author put it; the contents beside it link to each section on GitHub.

cross-platform-scripting

Cross-Platform Scripting

Detect the actual runtime before assuming what syntax/tools are available — don't write PS7 syntax for a PS5.1 host, or GNU sed flags for macOS.

1. Detect the OS

  • PowerShell 6+/7+: $IsWindows, $IsMacOS, $IsLinux (booleans).
  • PowerShell 5.1: these variables don't exist — PS5.1 only runs on Windows, so its mere presence ($PSVersionTable.PSEdition -eq 'Desktop') implies Windows.
  • From a POSIX shell: uname -sLinux, Darwin (macOS), or MINGW*/MSYS*/CYGWIN* (Git Bash / WSL-adjacent on Windows).
  • If a project ships parallel scripts (setup.ps1 + setup.sh, or *.cmd + *.ps1), that's a signal contributors use multiple OSes — keep both in sync when changing behavior.

2. Detect PowerShell version before writing/editing .ps1

$PSVersionTable.PSVersion          # e.g. 5.1.19041.x or 7.4.x
$PSVersionTable.PSEdition           # "Desktop" (5.1) or "Core" (7+)

Check the project's existing scripts for a stated minimum (a comment like "PS5-compatible" or #Requires -Version 7.0) — match that, don't assume the latest syntax is fine.

3. PS7+-only syntax to avoid on PS5.1

Feature PS7+ PS5.1-safe equivalent
Pipeline chain operators cmd1 && cmd2, cmd1 || cmd2 cmd1; if ($?) { cmd2 }
Ternary $x ? $a : $b if ($x) { $a } else { $b }
Null-coalescing $a ?? $b, $a ??= $b if ($null -eq $a) { $b } else { $a }
ForEach-Object -Parallel available sequential foreach/ForEach-Object, or Start-Job/runspaces
Get-Error available inspect $Error[0] / $_.Exception
&&/|| for native exe stderr capture works as expected redirecting a native command's stderr inside PS5.1 wraps it as a NativeCommandError and can flip $? to $false even on exit 0 — avoid 2>&1 on native exes; capture stdout/stderr separately if needed

Read the full file on GitHub · 89 lines

Changes

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.

  1. yesterday First seen · 89 lines · 1,327 tokens per session scan C 65d338243e7b

Subscribe to this mod's changes

agent-ebpf cross-platform-scripting.instructions.md is an instructions file published in the GitHub repository ourobx/agent-ebpf (1 stars, last pushed 7d ago), licensed MIT. It adds 1,327 tokens to every session, about $0.0066 per session on Opus 5. A static security scan graded it C with 1 finding (hidden instructions). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.