Token导航 LogoToken导航TokenDH.com
开发执行命令github未标认证来源可访问许可证需确认审计通过

bash-script-generatorbash 脚本生成器

Agent Skill

用于辅助云资源、部署、容器、基础设施和运维自动化任务。它适合让 Agent 检查配置、整理部署步骤、分析资源状态、生成排障思路或辅助云服务接入。使用时需要明确目标环境、账号权限、区域和资源组,区分本地测试与生产操作;涉及删除资源、重启服务、修改网络或权限配置时,应先确认影响范围。

总安装

3,516

周安装

148

GitHub Stars

197

下载量

1,231
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/akin-ozer/cc-devops-skills --skill bash-script-generator

简介

用于辅助云资源、部署、容器、基础设施和运维自动化任务。

  • 适合检查配置、整理部署步骤、分析资源状态或生成排障思路。
  • 使用时需明确目标环境、账号权限、区域和资源组,区分本地测试与生产操作。
  • 涉及删除资源、重启服务或修改网络配置时应先确认影响范围。
  • 安装前建议确认权限范围、维护状态及是否会触发联网或文件读写操作。

SKILL.md

Bash Script Generator

Overview

Generate production-ready Bash scripts with clear requirements capture, deterministic generation flow, and validation-first iteration.

Trigger Phrases

Use this skill when the user asks to:

  • Create, generate, write, or build a Bash/shell script
  • Convert manual CLI steps into an automation script
  • Build a text-processing script using grep, awk, or sed
  • Create an operations helper script, cron script, or CI utility script

Do not use this skill for validating an existing script only. Use devops-skills:bash-script-validator for validation-only requests.

Execution Model

Follow stages in order. Do not skip a stage; use the documented fallback when blocked.

Stage 0: Preflight

  1. Confirm scope and target output path.
  2. Confirm shell target:
  • Default: bash
  • If portability is requested: POSIX sh
  1. Check capabilities and pick fallback path:
CapabilityDefault PathFallback Path
Requirement clarificationAskUserQuestion toolAsk same questions in normal chat; mark unresolved items as assumptions
Script scaffoldbash scripts/generate_script_template.sh...Copy assets/templates/standard-template.sh manually or hand-craft minimal scaffold
Validationdevops-skills:bash-script-validatorLocal checks: bash -n, shellcheck if available, sh -n for POSIX mode

If a fallback path is used, state it explicitly in the final summary.

Stage 1: Capture Requirements

Collect only what is needed to generate the script correctly:

  • Input source and format
  • Output destination and format
  • Error handling behavior (fail-fast/retry/continue)
  • Security constraints (sensitive data, privilege level)
  • Performance constraints (large files, parallelism)
  • Portability requirement (Bash-only vs POSIX)

Then create a Captured Requirements table with stable IDs.

## Captured Requirements

| Requirement ID | Description | Source | Implementation Plan |
|---|---|---|---|
| REQ-001 | Parse nginx logs from file input | User | `parse_args()` + `validate_file()` + `awk` parser |
| REQ-002 | Output top 10 errors | User | `analyze_errors()` + `sort | uniq -c | head -10` |
| REQ-003 | Handle large files efficiently | Assumption | Single-pass `awk`; avoid multi-pass loops |

Rules:

  • Every major design decision maps to at least one REQ-*.
  • Keep assumptions explicit and minimal.

Stage 2: Choose Generation Path

Use this deterministic decision tree:

Need multi-command architecture, unusual control flow, or strict non-template conventions?
├─ Yes -> Custom generation
└─ No
   Need standard CLI skeleton (usage/logging/arg parsing/cleanup)?
   ├─ Yes -> Template-first generation
   └─ No -> Custom generation

Template-first is the default for single-purpose CLI utilities.

Stage 3: Load Only Relevant References

Use progressive disclosure. Read only docs needed for the current request.

NeedReference
Tool choice (grep vs awk vs sed)docs/text-processing-guide.md
Script structure and argument patternsdocs/script-patterns.md
Strict mode, shell differences, safetydocs/bash-scripting-guide.md
Naming, organization, and quality baselinedocs/generation-best-practices.md

Citation format (required):

  • [Ref: docs/<file>.md -> <section>]

Stage 4: Generate Script

Path A: Template-first (default)

  1. Generate scaffold:
bash scripts/generate_script_template.sh standard output-script.sh
  1. Replace placeholders and add business logic.
  2. Keep logging to stderr and data output to stdout unless requirements say otherwise.
  3. Add comments only where logic is non-obvious.

Path B: Custom generation

Build a script with at least:

  • Shebang and strict mode
  • usage()
  • parse_args()
  • Input validation and dependency checks
  • Main workflow function(s)
  • Predictable exit codes

Stage 5: Validate and Iterate

Default validation path:

  1. Invoke devops-skills:bash-script-validator
  2. Apply fixes
  3. Re-run validation
  4. Repeat until checks pass or blocker is identified

Fallback validation path (when validator skill is unavailable):

# Deterministic local gate for this skill:
bash scripts/run_ci_checks.sh --skip-shellcheck

# CI gate (shellcheck required):
bash scripts/run_ci_checks.sh --require-shellcheck

If any check is skipped, include Skipped check, Reason, and Risk in the output.

Stage 6: Final Response Contract

Always return:

  1. Generated script path
  2. Requirements traceability (REQ-* -> implementation)
  3. Validation results with rerun status
  4. Citations in standard format
  5. Any assumptions/fallbacks used

Canonical Example Flows

Example A: Full Flow (Template-first)

  1. Clarify missing data format and output expectations.
  2. Capture REQ-* table.
  3. Choose template-first path.
  4. Generate scaffold with scripts/generate_script_template.sh.
  5. Implement logic and map functions to REQ-*.
  6. Validate with devops-skills:bash-script-validator and rerun until clean.
  7. Return final summary with citations.

Example B: Constrained Environment Flow

Use this when AskUserQuestion, validator skill, or shellcheck is unavailable:

  1. Ask clarifying questions in chat.
  2. Mark unresolved items as assumptions in Captured Requirements.
  3. Generate from template script or template file copy fallback.
  4. Run bash -n (and sh -n if relevant).
  5. If shellcheck is missing, report skip with risk and mitigation.

Done Criteria

The task is complete only when all items are true:

  • Trigger matched and scope confirmed
  • Captured Requirements table exists with REQ-* IDs
  • Template-first vs custom decision is documented
  • Script is generated with deterministic structure
  • Validation executed and rerun policy applied
  • Any skipped checks include explicit reason and risk
  • Final response includes traceability, citations, and assumptions

Helper Scripts and Assets

  • Script generator: scripts/generate_script_template.sh
  • Deterministic CI gate: scripts/run_ci_checks.sh
  • Regression test suite: scripts/test_generator.sh
  • Standard scaffold: assets/templates/standard-template.sh
  • Example output style: examples/log-analyzer.sh

Reference Docs

  • docs/bash-scripting-guide.md
  • docs/script-patterns.md
  • docs/generation-best-practices.md
  • docs/text-processing-guide.md

External References

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

39.01%
按下载量换算480

Claude

28.56%
按下载量换算352

Cursor

20.3%
按下载量换算250

Gemini CLI

9.3%
按下载量换算114

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/akin-ozer/cc-devops-skills --skill bash-script-generator 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills