Token导航 LogoToken导航

Agent Skill · 研究检索

bash-script-generator(bash 脚本生成器)

bash-script-generator 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

bash-script-generator 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证为 MIT,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 63,559。

总安装 315周安装 13GitHub Stars 3下载 103核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:bash-script-generator(bash 脚本生成器)
来源仓库:https://github.com/asteroid-belt-llc/skills
仓库路径:skills/bash-script-generator
安装命令:
npx skills add https://github.com/asteroid-belt-llc/skills --skill bash-script-generator
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/asteroid-belt-llc/skills --skill bash-script-generator

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

用于生成兼容 Bash 3.2 的脚本骨架,包含依赖检查和 safe defaults 设置。适用于快速构建可移植的 shell 脚本,支持参数校验、外部程序依赖管理和 shfmt 格式化。使用时需提供脚本目标、参数和环境变量要求,返回可直接使用的结构化代码。

安装方式为 GitHub,支持 Codex、Claude、Cursor 和 Gemini CLI,需确保 macOS/Linux 环境可用。bash-script-generator 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/bash-script-generator

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/asteroid-belt-llc/skills --skill bash-script-g…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

bash-script-generator 怎么安装?

在终端执行 npx skills add https://github.com/asteroid-belt-llc/skills --skill bash-script-generator。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

bash-script-generator 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

bash-script-generator 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

bash-script-generator 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

bash-script-generator 用的人多吗?

公开数据是累计安装 315 次,近一周安装 13 次,下载 103 次,GitHub 3 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

bash-script-generator 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
bash-script-generator

bash 脚本生成器 · 本页

3153接触敏感数据MIT通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Structured Bash Script Generator

What You'll Do

  • 📥 Gather the script's goal, required positional/flag arguments, environment variables, and external program dependencies
  • 🧱 Produce a Bash 3.2-compatible script skeleton with a check_requirements function that validates inputs and dependencies kindly
  • 🛡️ Ensure the script sets safe defaults (set -euo pipefail), quotes expansions, and keeps logic portable to macOS/Linux Bash 3.2
  • ✨ Format the script with shfmt when available and return a polished result ready for immediate use

When to Use This Skill

Use this skill whenever the user asks for a new bash script or a major refactor of an existing script and they expect:

  • Guardrails around required arguments, environment variables, or external tools
  • Friendly, actionable error messages when prerequisites are missing
  • Compatibility with older Bash versions (macOS default 3.2)

Do not use this skill for:

  • POSIX sh-only scripts (no Bash-specific features allowed)
  • Small one-liners or trivial command snippets (respond inline instead)
  • Advanced Bash (>3.2) needs such as associative arrays or coproc

Phase 1 · Clarify the Script Brief

  1. Confirm the script's purpose, expected inputs, outputs, and typical usage examples.
  2. Identify all positional arguments and flags that must be provided. Capture human-friendly labels for each so the usage text and errors are clear.
  3. List required environment variables (names + meaning) and external commands (e.g., curl, jq). Note install hints when useful.
  4. Ask about optional inputs or defaults that should be applied when values are omitted.
  5. Determine whether the script writes files, consumes stdin/stdout, or needs cleanup logic.
Deliverable: A short table (in notes or your head) of arguments, env vars, and commands you will feed into check_requirements and usage messaging.

Phase 2 · Plan the Script Structure

Lay out the sections before writing code:

  1. Header & Safety

- #!/usr/bin/env bash - set -euo pipefail - IFS=$'\n\t' only if tighter word splitting is needed.

  1. Metadata Comments (optional)

- Summarize script purpose and prerequisites in commented lines for discoverability.

  1. Usage Helper

- A usage() function that prints how to run the script, expected args, environment variables, and examples.

  1. Requirement Configuration

- Define REQUIRED_ARGS, REQUIRED_ENV_VARS, and REQUIRED_PROGRAMS as indexed arrays (compatible with Bash 3.2). When nothing is required, keep the arrays empty but present. - Optionally define associative-looking notes via comments or simple case statements; do not use declare -A (requires Bash ≥4).

  1. check_requirements Function (see Phase 3 for exact pattern)

- Accepts parsed arguments (or a struct) and validates all prerequisites. - Emits kind, actionable errors to STDERR and returns non-zero on failure.

  1. Argument Parsing

- Prefer getopts for short flags. For long options, parse manually with a while loop; avoid getopt if portability is uncertain. - Populate variables for downstream logic (use ${VAR:-} to coexist with set -u).

  1. Main Logic

- Encapsulate primary workflow in main() and finish with main "$@".


Phase 3 · Compose the Script

Follow this recipe while writing the actual script content.

Required Guardrail: check_requirements

check_requirements() {
  local -r provided_arg_count=$1
  local missing=0

  if [ ${#REQUIRED_ARGS[@]} -gt 0 ] && [ "$provided_arg_count" -lt ${#REQUIRED_ARGS[@]} ]; then
    printf 'Error: Expected %s arguments (%s) but received %s.\n' \
      ${#REQUIRED_ARGS[@]} "${REQUIRED_ARGS[*]}" "$provided_arg_count" >&2
    missing=1
  fi

  local env_var
  for env_var in "${REQUIRED_ENV_VARS[@]}"; do
    if [ -z "${!env_var:-}" ]; then
      printf 'Error: Missing required environment variable %s. Please set it before rerunning.\n' "$env_var" >&2
      missing=1
    fi
  done

  local program
  for program in "${REQUIRED_PROGRAMS[@]}"; do
    if ! command -v "$program" >/dev/null 2>&1; then
      printf 'Error: Required program %s is not installed or not on PATH. Please install it first.\n' "$program" >&2
      missing=1
    fi
  done

  if [ "$missing" -ne 0 ]; then
    printf '\n' >&2
    usage >&2
    return 1
  fi
}

Implementation notes:

  • Always invoke check_requirements right after argument parsing, e.g. check_requirements "$#".
  • If the script allows optional trailing arguments, keep REQUIRED_ARGS limited to the mandatory ones and validate optional parameters separately after check_requirements "$#" succeeds.
  • Keep error language supportive (“Please install…”) rather than punitive.
  • Route any diagnostics to STDERR (>&2) and exit gracefully with return 1 so the caller can exit 1 or handle it.
  • Only call usage from error paths (like failed requirement checks) so successful runs stay quiet unless the user explicitly asks for help.

Bash 3.2 Compatibility Guardrails

  • Use indexed arrays only; no associative arrays or namerefs (local -n).
  • Avoid [[string =~ regex]] with capture groups that rely on Bash ≥3.2. Basic regex is fine, but keep patterns simple.
  • Do not rely on mapfile, readarray, coproc, printf -v, or process substitution that requires /dev/fd (often missing on macOS).
  • Prefer $(command) subshells over backticks and quote every expansion.
  • Use printf instead of echo -e for reliable escape handling.

Usage Function Pattern

usage() {
  cat <<'EOF'
Usage: my_script.sh <source> <destination> [--dry-run]

Required arguments:
  source        Path to the input file (must exist)
  destination   Output directory (will be created if missing)

Environment variables:
  API_TOKEN     Token used to authenticate API requests

External tools:
  curl, jq

Examples:
  my_script.sh ./input.csv ./out --dry-run
EOF
}

Tailor the body to the specific script; keep instructions kind and explicit.

Script Assembly Checklist

  1. Write header, safety settings, and optional metadata comments.
  2. Define requirement arrays (even if empty) and defaults for optional values.
  3. Implement usage() and check_requirements() exactly once.
  4. Parse arguments safely (getopts or manual loop) and convert into named variables.
  5. Call check_requirements immediately after parsing. If it fails, exit with exit 1.
  6. Implement main() with clear, modular helpers; rely on functions instead of sprawling inline code.
  7. End with main "$@" and ensure the script returns appropriate exit codes.

Phase 4 · Validate, Format, and Hand Off

  1. Self-check

- Does the script run without arguments and show usage? - Do missing env vars and programs produce the friendly errors described earlier? - Do all branches respect set -euo pipefail (guard nullable variables with ${VAR:-})?

  1. Formatting via shfmt

- Detect availability: if command -v shfmt >/dev/null 2>&1; then... fi - Run shfmt -i 2 -bn -ci -sr -w <path-to-script> after writing the file. - Mention in your response whether formatting ran or was skipped (and why).

  1. Final Response Checklist

- Provide the complete script in a fenced code block (label it bash). - Summarize how requirements are enforced. - If manual formatting was necessary (no shfmt), note it explicitly. - Suggest any quick validation commands (dry runs, linting) if relevant.


Reference Template

Use this skeleton as a starting point and adapt each section based on the user's requirements:

#!/usr/bin/env bash
set -euo pipefail

# Script: <name>
# Purpose: <one-line description>
# Requirements: <short summary of args/env/programs>

REQUIRED_ARGS=("arg1" "arg2")
REQUIRED_ENV_VARS=("ENV_VAR")
REQUIRED_PROGRAMS=("curl" "jq")

usage() {
  cat <<'EOF'
Usage: <script-name> <arg1> <arg2>

Required arguments:
  arg1   <describe>
  arg2   <describe>

Environment variables:
  ENV_VAR   <describe>

External tools:
  curl, jq
EOF
}

check_requirements() {
  local -r provided_arg_count=$1
  local missing=0

  if [ ${#REQUIRED_ARGS[@]} -gt 0 ] && [ "$provided_arg_count" -lt ${#REQUIRED_ARGS[@]} ]; then
    printf 'Error: Expected %s arguments (%s) but received %s.\n' \
      ${#REQUIRED_ARGS[@]} "${REQUIRED_ARGS[*]}" "$provided_arg_count" >&2
    missing=1
  fi

  local env_var
  for env_var in "${REQUIRED_ENV_VARS[@]}"; do
    if [ -z "${!env_var:-}" ]; then
      printf 'Error: Missing required environment variable %s. Please set it before rerunning.\n' "$env_var" >&2
      missing=1
    fi
  done

  local program
  for program in "${REQUIRED_PROGRAMS[@]}"; do
    if ! command -v "$program" >/dev/null 2>&1; then
      printf 'Error: Required program %s is not installed or not on PATH. Please install it first.\n' "$program" >&2
      missing=1
    fi
  done

  if [ "$missing" -ne 0 ]; then
    printf '\n' >&2
    usage >&2
    return 1
  fi
}

parse_args() {
  # TODO: replace with real parsing
  SOURCE=${1:-}
  DEST=${2:-}
}

main() {
  parse_args "$@"
  check_requirements "$#" || exit 1

  # TODO: script logic goes here
  printf 'Running with source=%s dest=%s\n' "$SOURCE" "$DEST"
}

main "$@"

Update placeholders, replace TODO sections, and adjust arrays when a requirement does not apply (leave the array empty—do not delete it).


Quality Checklist Before Finishing

  • Script declares all requirement arrays and the check_requirements function
  • Error messages are friendly, specific, and routed to STDERR
  • Script avoids Bash ≥4 features and has been reviewed for 3.2 compatibility
  • usage() accurately reflects arguments, env vars, and dependencies
  • Formatting completed with shfmt (or explicitly noted why it was skipped)
  • Final response contains both summary guidance and the full script for copy/paste

平台分布

Claude Code

28.36%
按下载量换算29

windsurf

24.38%
按下载量换算25

OpenCode

17.9%
按下载量换算18

Codex

12.83%
按下载量换算13

Gemini CLI

8.51%
按下载量换算9

Cursor

4.08%
按下载量换算4

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

继续浏览同类 Skills