---
name: "bun-shell-scripting-automation"
description: "Write cross-platform automation scripts using Bun Shell with native pipes and redirects."
metadata:
  author: "Jarred Sumner"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "write bun shell script"
  - "pipe commands bun shell"
  - "cross-platform bash javascript"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Bun Shell Cross-Platform Bash-Like Scripting in JS

Authors automation scripts using Bun Shell ($ tagged template): executing shell commands cross-platform on Windows and Linux, piping outputs into JavaScript variables, redirecting to files, and running tasks concurrently.

## When to Invoke
Invoke this skill whenever you need to:
- write bun shell script
- pipe commands bun shell
- cross-platform bash javascript

## Execution SOP & Rules
1. Import shell operator: import { $ } from 'bun'.
2. Execute commands: await $`echo 'Starting build...' && pnpm build`.
3. Capture output: const stdout = (await $`git rev-parse HEAD`.text()).trim().
4. Pipe streams: await $`cat log.txt | grep 'ERROR' > filtered_errors.txt`.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
