bengous/agents-skills/harden-bash

Claude Code and agent skill by bengous/agents-skills

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Write, review, and harden non-trivial Bash and POSIX sh scripts for production. Use for shell files and CI, deployment, administration, or automation code involving untrusted input, destructive filesystem operations, privileges, pipelines, traps, signals, concurrency, portability, or failure handling. Skip trivial interactive commands and tasks better served by an existing project tool.

Install

npx vskill@latest install bengous/agents-skills/harden-bash

SKILL.md

The same SKILL.md was published earlier as bengous/agents-skills/harden-bash.

Harden Bash

Gate

Read the script and every caller before changing it. Determine whether it is executed or sourced, which inputs cross trust boundaries, which privileges and side effects it has, and which shell actually parses it.

Contracts

  • Choose Bash or POSIX sh explicitly. Never mix their language or runtime contracts.
  • Control expansions and preserve argument boundaries.
  • Build commands as argv, never as executable strings.
  • Make expected and unexpected failures visible with useful status and context.
  • Keep secrets out of argv, logs, permissive temporary files, and tracing.
  • Validate destructive scope before mutation.
  • Add no abstraction or operational feature without a demonstrated contract.

Workflow

  1. Inspect callers, execution mode, inputs, privileges, side effects, dependencies, and target shells.
  2. Classify the relevant risks with the table below.
  3. Load only the references and examples for those risks.
  4. In an audit, remain read-only and report findings by severity with location, root cause, and minimum correction. In a write or fix task, change the correct common point rather than patching callers independently.
  5. Produce the smallest correction that preserves the intended behavior.
  6. Validate syntax, diagnostics, behavior, failure paths, and every promised shell/runtime boundary.
RiskReferenceExample
Dialect, shebang, versions, utilities`references/dialect-and-portability.md``bash/safe-cli.sh`, `posix/safe-cli.sh`
Inputs, expansions, argv, injection`references/input-and-command-construction.md``bash/safe-cli.sh`, `posix/safe-cli.sh`
set -e, statuses, pipelines, substitutions`references/error-semantics.md``safe-cli.sh`, `atomic-replace.sh`, `supervise-jobs.sh`
Temporary files, traps, atomicity, permissions, deletion`references/filesystem-safety.md``posix/atomic-replace.sh`
Signals, children, concurrency, wait`references/process-lifecycle.md``bash/supervise-jobs.sh`
Logs, dry-run, retry, locks, idempotence, secrets`references/production-controls.md`Read conditionally
Syntax, lint, tests, shell matrix`references/testing.md``scripts/validate-examples.sh`

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/bengous/agents-skills/harden-bash/badge)](https://verified-skill.com/skills/bengous/agents-skills/harden-bash)

Something wrong with this skill or its page? Tell us.