用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/akin-ozer/cc-devops-skills --skill bash-script-generator命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Validate, lint, audit, or fix .gitlab-ci.yml pipelines, stages, and jobs.
Generate, create, or scaffold Ansible playbooks, roles, tasks, handlers, inventory, vars.
Validate, lint, audit, or debug Ansible playbooks, roles, inventories, FQCN, tasks.
基于 SOC 职业分类
正在显示 SKILL.md
| name | bash-script-generator |
| description | Create, generate, write, or scaffold bash/shell scripts (.sh), automation, or CLI tools. |
Generate production-ready Bash scripts with clear requirements capture, deterministic generation flow, and validation-first iteration.
Use this skill when the user asks to:
grep, awk, or sedDo not use this skill for validating an existing script only. Use devops-skills:bash-script-validator for validation-only requests.
Follow stages in order. Do not skip a stage; use the documented fallback when blocked.
bashsh| Capability | Default Path | Fallback Path |
|---|---|---|
| Requirement clarification | AskUserQuestion tool | Ask same questions in normal chat; mark unresolved items as assumptions |
| Script scaffold | bash scripts/generate_script_template.sh ... | Copy assets/templates/standard-template.sh manually or hand-craft minimal scaffold |
| Validation | devops-skills:bash-script-validator | Local checks: bash -n, shellcheck if available, sh -n for POSIX mode |
If a fallback path is used, state it explicitly in the final summary.
Collect only what is needed to generate the script correctly:
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:
REQ-*.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.
Use progressive disclosure. Read only docs needed for the current request.
| Need | Reference |
|---|---|
Tool choice (grep vs awk vs sed) | docs/text-processing-guide.md |
| Script structure and argument patterns | docs/script-patterns.md |
| Strict mode, shell differences, safety | docs/bash-scripting-guide.md |
| Naming, organization, and quality baseline | docs/generation-best-practices.md |
Citation format (required):
[Ref: docs/<file>.md -> <section>]bash scripts/generate_script_template.sh standard output-script.sh
Build a script with at least:
usage()parse_args()Default validation path:
devops-skills:bash-script-validatorFallback 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.
Always return:
REQ-* -> implementation)REQ-* table.scripts/generate_script_template.sh.REQ-*.devops-skills:bash-script-validator and rerun until clean.Use this when AskUserQuestion, validator skill, or shellcheck is unavailable:
Captured Requirements.bash -n (and sh -n if relevant).shellcheck is missing, report skip with risk and mitigation.The task is complete only when all items are true:
Captured Requirements table exists with REQ-* IDsscripts/generate_script_template.shscripts/run_ci_checks.shscripts/test_generator.shassets/templates/standard-template.shexamples/log-analyzer.shdocs/bash-scripting-guide.mddocs/script-patterns.mddocs/generation-best-practices.mddocs/text-processing-guide.md