Token导航 LogoToken导航

Agent Skill · 研究检索

bash-pro(bash 专业版)

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

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

总安装 1,740周安装 74GitHub Stars 692下载 610核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/rmyndharis/antigravity-skills --skill bash-pro

这个 Skill 是做什么的

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

bash-pro 专注于 Bash 脚本的编写与审查,提供自动化、CI/CD 和安全加固方面的专业指导。适用于需要跨平台兼容性和高安全性要求的 shell 脚本开发场景,如系统运维和部署流程。内置严格模式、输入验证和防御性编程模式,支持 Bats 测试框架与 ShellCheck 静态分析。

使用前请确保环境满足 Bash 4.0+ 要求,避免在 POSIX-only 环境中使用非标准特性。bash-pro 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

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

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

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

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

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

常见问题

6 条

bash-pro 怎么安装?

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

bash-pro 支持哪些 AI 工具?

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

bash-pro 需要什么权限?

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

bash-pro 是免费的吗?

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

bash-pro 用的人多吗?

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

bash-pro 安全吗?

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

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

值得选的地方

  • 同时适配 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-pro

bash 专业版 · 本页

1,740692接触敏感数据MIT通过

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

SKILL.md 原文

Use this skill when

  • Writing or reviewing Bash scripts for automation, CI/CD, or ops
  • Hardening shell scripts for safety and portability

Do not use this skill when

  • You need POSIX-only shell without Bash features
  • The task requires a higher-level language for complex logic
  • You need Windows-native scripting (PowerShell)

Instructions

  1. Define script inputs, outputs, and failure modes.
  2. Apply strict mode and safe argument parsing.
  3. Implement core logic with defensive patterns.
  4. Add tests and linting with Bats and ShellCheck.

Safety

  • Treat input as untrusted; avoid eval and unsafe globbing.
  • Prefer dry-run modes before destructive actions.

Focus Areas

  • Defensive programming with strict error handling
  • POSIX compliance and cross-platform portability
  • Safe argument parsing and input validation
  • Robust file operations and temporary resource management
  • Process orchestration and pipeline safety
  • Production-grade logging and error reporting
  • Comprehensive testing with Bats framework
  • Static analysis with ShellCheck and formatting with shfmt
  • Modern Bash 5.x features and best practices
  • CI/CD integration and automation workflows

Approach

  • Always use strict mode with set -Eeuo pipefail and proper error trapping
  • Quote all variable expansions to prevent word splitting and globbing issues
  • Prefer arrays and proper iteration over unsafe patterns like for f in $(ls)
  • Use [[]] for Bash conditionals, fall back to [] for POSIX compliance
  • Implement comprehensive argument parsing with getopts and usage functions
  • Create temporary files and directories safely with mktemp and cleanup traps
  • Prefer printf over echo for predictable output formatting
  • Use command substitution $() instead of backticks for readability
  • Implement structured logging with timestamps and configurable verbosity
  • Design scripts to be idempotent and support dry-run modes
  • Use shopt -s inherit_errexit for better error propagation in Bash 4.4+
  • Employ IFS=$'\n\t' to prevent unwanted word splitting on spaces
  • Validate inputs with : "${VAR:?message}" for required environment variables
  • End option parsing with -- and use rm -rf -- "$dir" for safe operations
  • Support --trace mode with set -x opt-in for detailed debugging
  • Use xargs -0 with NUL boundaries for safe subprocess orchestration
  • Employ readarray/mapfile for safe array population from command output
  • Implement robust script directory detection: SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)"
  • Use NUL-safe patterns: find -print0 | while IFS= read -r -d '' file; do...; done

Compatibility & Portability

  • Use #!/usr/bin/env bash shebang for portability across systems
  • Check Bash version at script start: ((BASH_VERSINFO[0] >= 4 && BASH_VERSINFO[1] >= 4)) for Bash 4.4+ features
  • Validate required external commands exist: command -v jq &>/dev/null || exit 1
  • Detect platform differences: case "$(uname -s)" in Linux*)...;; Darwin*)...;; esac
  • Handle GNU vs BSD tool differences (e.g., sed -i vs sed -i '')
  • Test scripts on all target platforms (Linux, macOS, BSD variants)
  • Document minimum version requirements in script header comments
  • Provide fallback implementations for platform-specific features
  • Use built-in Bash features over external commands when possible for portability
  • Avoid bashisms when POSIX compliance is required, document when using Bash-specific features

Readability & Maintainability

  • Use long-form options in scripts for clarity: --verbose instead of -v
  • Employ consistent naming: snake_case for functions/variables, UPPER_CASE for constants
  • Add section headers with comment blocks to organize related functions
  • Keep functions under 50 lines; refactor larger functions into smaller components
  • Group related functions together with descriptive section headers
  • Use descriptive function names that explain purpose: validate_input_file not check_file
  • Add inline comments for non-obvious logic, avoid stating the obvious
  • Maintain consistent indentation (2 or 4 spaces, never tabs mixed with spaces)
  • Place opening braces on same line for consistency: function_name() {
  • Use blank lines to separate logical blocks within functions
  • Document function parameters and return values in header comments
  • Extract magic numbers and strings to named constants at top of script

Safety & Security Patterns

  • Declare constants with readonly to prevent accidental modification
  • Use local keyword for all function variables to avoid polluting global scope
  • Implement timeout for external commands: timeout 30s curl... prevents hangs
  • Validate file permissions before operations: [[-r "$file"]] || exit 1
  • Use process substitution <(command) instead of temporary files when possible
  • Sanitize user input before using in commands or file operations
  • Validate numeric input with pattern matching: [[$num =~ ^[0-9]+$]]
  • Never use eval on user input; use arrays for dynamic command construction
  • Set restrictive umask for sensitive operations: (umask 077; touch "$secure_file")
  • Log security-relevant operations (authentication, privilege changes, file access)
  • Use -- to separate options from arguments: rm -rf -- "$user_input"
  • Validate environment variables before using: : "${REQUIRED_VAR:?not set}"
  • Check exit codes of all security-critical operations explicitly
  • Use trap to ensure cleanup happens even on abnormal exit

Performance Optimization

  • Avoid subshells in loops; use while read instead of for i in $(cat file)
  • Use Bash built-ins over external commands: [[]] instead of test, ${var//pattern/replacement} instead of sed
  • Batch operations instead of repeated single operations (e.g., one sed with multiple expressions)
  • Use mapfile/readarray for efficient array population from command output
  • Avoid repeated command substitutions; store result in variable once
  • Use arithmetic expansion $(()) instead of expr for calculations
  • Prefer printf over echo for formatted output (faster and more reliable)
  • Use associative arrays for lookups instead of repeated grepping
  • Process files line-by-line for large files instead of loading entire file into memory
  • Use xargs -P for parallel processing when operations are independent

Documentation Standards

  • Implement --help and -h flags showing usage, options, and examples
  • Provide --version flag displaying script version and copyright information
  • Include usage examples in help output for common use cases
  • Document all command-line options with descriptions of their purpose
  • List required vs optional arguments clearly in usage message
  • Document exit codes: 0 for success, 1 for general errors, specific codes for specific failures
  • Include prerequisites section listing required commands and versions
  • Add header comment block with script purpose, author, and modification date
  • Document environment variables the script uses or requires
  • Provide troubleshooting section in help for common issues
  • Generate documentation with shdoc from special comment formats
  • Create man pages using shellman for system integration
  • Include architecture diagrams using Mermaid or GraphViz for complex scripts

Modern Bash Features (5.x)

  • Bash 5.0: Associative array improvements, ${var@U} uppercase conversion, ${var@L} lowercase
  • Bash 5.1: Enhanced ${parameter@operator} transformations, compat shopt options for compatibility
  • Bash 5.2: varredir_close option, improved exec error handling, EPOCHREALTIME microsecond precision
  • Check version before using modern features: [[${BASH_VERSINFO[0]} -ge 5 && ${BASH_VERSINFO[1]} -ge 2]]
  • Use ${parameter@Q} for shell-quoted output (Bash 4.4+)
  • Use ${parameter@E} for escape sequence expansion (Bash 4.4+)
  • Use ${parameter@P} for prompt expansion (Bash 4.4+)
  • Use ${parameter@A} for assignment format (Bash 4.4+)
  • Employ wait -n to wait for any background job (Bash 4.3+)
  • Use mapfile -d delim for custom delimiters (Bash 4.4+)

CI/CD Integration

  • GitHub Actions: Use shellcheck-problem-matchers for inline annotations
  • Pre-commit hooks: Configure .pre-commit-config.yaml with shellcheck, shfmt, checkbashisms
  • Matrix testing: Test across Bash 4.4, 5.0, 5.1, 5.2 on Linux and macOS
  • Container testing: Use official bash:5.2 Docker images for reproducible tests
  • CodeQL: Enable shell script scanning for security vulnerabilities
  • Actionlint: Validate GitHub Actions workflow files that use shell scripts
  • Automated releases: Tag versions and generate changelogs automatically
  • Coverage reporting: Track test coverage and fail on regressions
  • Example workflow: shellcheck *.sh && shfmt -d *.sh && bats test/

Security Scanning & Hardening

  • SAST: Integrate Semgrep with custom rules for shell-specific vulnerabilities
  • Secrets detection: Use gitleaks or trufflehog to prevent credential leaks
  • Supply chain: Verify checksums of sourced external scripts
  • Sandboxing: Run untrusted scripts in containers with restricted privileges
  • SBOM: Document dependencies and external tools for compliance
  • Security linting: Use ShellCheck with security-focused rules enabled
  • Privilege analysis: Audit scripts for unnecessary root/sudo requirements
  • Input sanitization: Validate all external inputs against allowlists
  • Audit logging: Log all security-relevant operations to syslog
  • Container security: Scan script execution environments for vulnerabilities

Observability & Logging

  • Structured logging: Output JSON for log aggregation systems
  • Log levels: Implement DEBUG, INFO, WARN, ERROR with configurable verbosity
  • Syslog integration: Use logger command for system log integration
  • Distributed tracing: Add trace IDs for multi-script workflow correlation
  • Metrics export: Output Prometheus-format metrics for monitoring
  • Error context: Include stack traces, environment info in error logs
  • Log rotation: Configure log file rotation for long-running scripts
  • Performance metrics: Track execution time, resource usage, external call latency
  • Example: log_info() {logger -t "$SCRIPT_NAME" -p user.info "$*"; echo "[INFO] $*" >&2;}

Quality Checklist

  • Scripts pass ShellCheck static analysis with minimal suppressions
  • Code is formatted consistently with shfmt using standard options
  • Comprehensive test coverage with Bats including edge cases
  • All variable expansions are properly quoted
  • Error handling covers all failure modes with meaningful messages
  • Temporary resources are cleaned up properly with EXIT traps
  • Scripts support --help and provide clear usage information
  • Input validation prevents injection attacks and handles edge cases
  • Scripts are portable across target platforms (Linux, macOS)
  • Performance is adequate for expected workloads and data sizes

Output

  • Production-ready Bash scripts with defensive programming practices
  • Comprehensive test suites using bats-core or shellspec with TAP output
  • CI/CD pipeline configurations (GitHub Actions, GitLab CI) for automated testing
  • Documentation generated with shdoc and man pages with shellman
  • Structured project layout with reusable library functions and dependency management
  • Static analysis configuration files (.shellcheckrc,.shfmt.toml,.editorconfig)
  • Performance benchmarks and profiling reports for critical workflows
  • Security review with SAST, secrets scanning, and vulnerability reports
  • Debugging utilities with trace modes, structured logging, and observability
  • Migration guides for Bash 3→5 upgrades and legacy modernization
  • Package distribution configurations (Homebrew formulas, deb/rpm specs)
  • Container images for reproducible execution environments

Essential Tools

Static Analysis & Formatting

  • ShellCheck: Static analyzer with enable=all and external-sources=true configuration
  • shfmt: Shell script formatter with standard config (-i 2 -ci -bn -sr -kp)
  • checkbashisms: Detect bash-specific constructs for portability analysis
  • Semgrep: SAST with custom rules for shell-specific security issues
  • CodeQL: GitHub's security scanning for shell scripts

Testing Frameworks

  • bats-core: Maintained fork of Bats with modern features and active development
  • shellspec: BDD-style testing framework with rich assertions and mocking
  • shunit2: xUnit-style testing framework for shell scripts
  • bashing: Testing framework with mocking support and test isolation

Modern Development Tools

  • bashly: CLI framework generator for building command-line applications
  • basher: Bash package manager for dependency management
  • bpkg: Alternative bash package manager with npm-like interface
  • shdoc: Generate markdown documentation from shell script comments
  • shellman: Generate man pages from shell scripts

CI/CD & Automation

  • pre-commit: Multi-language pre-commit hook framework
  • actionlint: GitHub Actions workflow linter
  • gitleaks: Secrets scanning to prevent credential leaks
  • Makefile: Automation for lint, format, test, and release workflows

Common Pitfalls to Avoid

  • for f in $(ls...) causing word splitting/globbing bugs (use find -print0 | while IFS= read -r -d '' f; do...; done)
  • Unquoted variable expansions leading to unexpected behavior
  • Relying on set -e without proper error trapping in complex flows
  • Using echo for data output (prefer printf for reliability)
  • Missing cleanup traps for temporary files and directories
  • Unsafe array population (use readarray/mapfile instead of command substitution)
  • Ignoring binary-safe file handling (always consider NUL separators for filenames)

Dependency Management

  • Package managers: Use basher or bpkg for installing shell script dependencies
  • Vendoring: Copy dependencies into project for reproducible builds
  • Lock files: Document exact versions of dependencies used
  • Checksum verification: Verify integrity of sourced external scripts
  • Version pinning: Lock dependencies to specific versions to prevent breaking changes
  • Dependency isolation: Use separate directories for different dependency sets
  • Update automation: Automate dependency updates with Dependabot or Renovate
  • Security scanning: Scan dependencies for known vulnerabilities
  • Example: basher install username/repo@version or bpkg install username/repo -g

Advanced Techniques

  • Error Context: Use trap 'echo "Error at line $LINENO: exit $?" >&2' ERR for debugging
  • Safe Temp Handling: trap 'rm -rf "$tmpdir"' EXIT; tmpdir=$(mktemp -d)
  • Version Checking: ((BASH_VERSINFO[0] >= 5)) before using modern features
  • Binary-Safe Arrays: readarray -d '' files < <(find. -print0)
  • Function Returns: Use declare -g result for returning complex data from functions
  • Associative Arrays: declare -A config=([host]="localhost" [port]="8080") for complex data structures
  • Parameter Expansion: ${filename%.sh} remove extension, ${path##*/} basename, ${text//old/new} replace all
  • Signal Handling: trap cleanup_function SIGHUP SIGINT SIGTERM for graceful shutdown
  • Command Grouping: {cmd1; cmd2;} > output.log share redirection, (cd dir && cmd) use subshell for isolation
  • Co-processes: coproc proc {cmd;}; echo "data" >&"${proc[1]}"; read -u "${proc[0]}" result for bidirectional pipes
  • Here-documents: cat <<-'EOF' with - strips leading tabs, quotes prevent expansion
  • Process Management: wait $pid to wait for background job, jobs -p list background PIDs
  • Conditional Execution: cmd1 && cmd2 run cmd2 only if cmd1 succeeds, cmd1 || cmd2 run cmd2 if cmd1 fails
  • Brace Expansion: touch file{1..10}.txt creates multiple files efficiently
  • Nameref Variables: declare -n ref=varname creates reference to another variable (Bash 4.3+)
  • Improved Error Trapping: set -Eeuo pipefail; shopt -s inherit_errexit for comprehensive error handling
  • Parallel Execution: xargs -P $(nproc) -n 1 command for parallel processing with CPU core count
  • Structured Output: jq -n --arg key "$value" '{key: $key}' for JSON generation
  • Performance Profiling: Use time -v for detailed resource usage or TIMEFORMAT for custom timing

References & Further Reading

Style Guides & Best Practices

Tools & Frameworks

  • ShellCheck - Static analysis tool and extensive wiki documentation
  • shfmt - Shell script formatter with detailed flag documentation
  • bats-core - Maintained Bash testing framework
  • shellspec - BDD-style testing framework for shell scripts
  • bashly - Modern Bash CLI framework generator
  • shdoc - Documentation generator for shell scripts

Security & Advanced Topics

平台分布

Codex

25.29%
按下载量换算154

Claude Code

23.29%
按下载量换算142

OpenCode

17.03%
按下载量换算104

Gemini CLI

12.58%
按下载量换算77

github-copilot

7.65%
按下载量换算47

Antigravity

3.43%
按下载量换算21

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

接触敏感数据

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

安装前确认

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

继续浏览同类 Skills