Token导航 LogoToken导航

Agent Skill · 研究检索

coding-guidance-bash(编码指导 bash)

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

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

总安装 233周安装 10GitHub Stars 3下载 82核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/n-n-code/n-n-code-skills --skill coding-guidance-bash

这个 Skill 是做什么的

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

coding-guidance-bash 提供便携式 Bash 脚本编写、重构与安全审查指导,适配 POSIX 兼容环境。可与 thinking、security 等流程技能组合,增强脚本健壮性与威胁建模能力。避免使用 Bash 专属语法,必要时降级为 sh 兼容写法以确保最大可移植性。

使用前请评估目标系统 shell 类型,防止因解释器差异导致命令失效或安全风险。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

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

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

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

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

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

常见问题

6 条

coding-guidance-bash 怎么安装?

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

coding-guidance-bash 支持哪些 AI 工具?

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

coding-guidance-bash 需要什么权限?

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

coding-guidance-bash 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

coding-guidance-bash 用的人多吗?

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

coding-guidance-bash 安全吗?

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

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

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 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调用外部服务未明确有提醒
coding-guidance-bash

编码指导 bash · 本页

2333接触敏感数据未明确通过

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

SKILL.md 原文

Bash Coding Guidance

This skill adds portable Bash implementation, refactoring, and review guidance.

Adjacent Skills

This skill provides portable Bash engineering principles. Compose with:

  • Workflow: thinking (planning), recursive-thinking (stress-testing), security (threat modeling)
  • Domain overlays: project-core-dev (repo-specific build/test commands), project-platform-diagnose (environment-sensitive diagnosis)

When Not to Lean on This Skill

  • non-shell work
  • POSIX sh portability work where Bash-only features are not allowed (adapt the guidance to the repo's POSIX-shell contract instead of importing Bash-only defaults)
  • large data processing jobs that should realistically move to Python, awk, or another language with stronger structure

Implementation Workflow

  1. Read the touched scripts, entrypoints, call sites, and nearby docs before editing.
  2. Infer the intended contract from current usage text, flags, tests, and environment assumptions. Ask only when multiple plausible script behaviors would change semantics.
  3. Keep the contract narrow: inputs, outputs, exit codes, environment dependencies, filesystem effects, and external tool requirements should be explicit.
  4. Implement with defensive mode, safe quoting, arrays for argv construction, functions for meaningful substeps, and cleanup traps for temporary state.
  5. Add or update shell tests when the repo has them; otherwise add the smallest reproducible validation path you can run directly.
  6. Run the narrowest relevant formatter, linter, and script tests the repo supports.

Refactoring Workflow

Use this instead of the default implementation workflow when the task is primarily cleanup or restructuring:

  1. Capture current behavior, flags, environment assumptions, platform dependencies, and failure modes.
  2. Break the refactor into small slices that preserve behavior.
  3. Replace copy-pasted command assembly, hidden globals, unsafe loops, and tangled control flow one step at a time.
  4. Keep tests or runnable validation passing after each slice; add characterization coverage first when behavior is unclear.
  5. Stop when the script is easier to read, safer to invoke, and easier to debug.

Review Workflow

When reviewing (not implementing), skip the implementation workflow and use this instead:

  1. Read the change in full before commenting.
  2. Identify findings, ordered by severity: Critical > Important > Suggestion.
  3. Prioritize quoting and word-splitting bugs, globbing hazards, accidental masking of failing commands, trap and cleanup bugs, unsafe temp-file handling, destructive command risks, portability mismatches, environment assumptions, and missing tests.
  4. State findings with concrete evidence and the likely consequence.

Bash Rules

First tier - causes bugs

  • Start executable Bash scripts with #!/usr/bin/env bash unless the repo has a stricter shebang convention
  • Use set -Eeuo pipefail unless the script has a documented reason to manage failures differently; scope exceptions narrowly
  • Quote expansions by default: "$var", "${arr[@]}", and "$(cmd)"
  • Use arrays for argument vectors; do not build command lines with string concatenation
  • Distinguish stdout data from stderr diagnostics so callers can compose the script safely
  • Check exit statuses deliberately; do not rely on pipelines, subshells, or command substitutions without understanding how failures propagate
  • Clean up temp files and directories with trap when the script allocates them
  • Treat $IFS, globs, current working directory, and environment variables as boundary conditions, not stable ambient assumptions

Second tier - prevents mistakes

  • Prefer functions for meaningful units of behavior; keep top-level script flow readable
  • Use local inside functions unless a variable is intentionally shared
  • Prefer [[...]] for Bash conditionals and case for multi-branch string matching
  • Prefer printf over echo when escaping, flags, or portability ambiguity matter
  • Use command substitution $() instead of backticks
  • Name flags, env vars, and functions for what they do; shell scripts become unreadable quickly when names get vague
  • Keep shellcheck findings at zero in repo-owned code unless the script has a documented exception

Defensive patterns

  • Consider shopt -s inherit_errexit when the Bash version and repo contract allow it and command-substitution failures must propagate cleanly
  • Validate required env vars explicitly with : "${VAR:?message}"
  • Detect missing external tools up front with command -v tool >/dev/null 2>&1
  • Use mktemp for temp files and directories; never hand-roll temp paths in shared locations
  • Prefer dry-run modes and idempotent behavior before destructive or expensive operations
  • Use trap for cleanup and, when helpful, targeted ERR reporting with line or function context

Command and process discipline

  • Pass user-controlled values as individual argv elements, not through eval or re-parsed strings
  • Avoid eval unless the script is explicitly a shell metaprogramming tool and the risk is justified
  • Prefer explicit path resolution and file existence checks before destructive operations
  • When calling external tools, preserve argument boundaries and treat tool exit codes as part of the contract
  • Be deliberate about cd; either scope it to a subshell or restore the prior directory clearly
  • End option parsing with -- when forwarding user arguments to external commands
  • If the script spawns background jobs, make ownership explicit: track PIDs, aggregate wait results deliberately, and forward or handle termination signals rather than abandoning children
  • Avoid casual parallel destructive work; if concurrency matters, define the locking, isolation, or idempotency rule up front
  • If concurrent invocations can interfere with each other, use an explicit lock strategy such as flock or a documented equivalent instead of hoping paths or timing stay unique

Input, output, and contract design

  • Provide --help or usage text for non-trivial scripts
  • Make required env vars, positional args, flags, and side effects explicit near the top of the file
  • Exit with non-zero status on real failure and reserve zero for success
  • Print machine-consumable output in a stable format when other tools are meant to parse it
  • Avoid silent fallbacks on missing tools or files unless the script is explicitly best-effort
  • Use stable exit-code meanings when the script is likely to be called by other automation

Safe iteration and file handling

  • Prefer while IFS= read -r line; do...; done over loops that split on whitespace implicitly
  • Use NUL-safe patterns for filenames from find, git, or similar tools: -print0, xargs -0, or read -r -d ''
  • Use readarray or mapfile when populating arrays from command output in Bash-specific scripts
  • Avoid for f in $(...) for filenames or untrusted data; it is usually a bug
  • Prefer built-ins and parameter expansion over unnecessary subprocesses when they make the script clearer and safer

Portability and platform fit

  • Use Bash-specific features only when the shebang and repo contract allow them
  • If the script must run on multiple platforms, check GNU vs. BSD tool differences before adding flags with inconsistent behavior
  • If platform behavior matters, detect it explicitly instead of assuming Linux
  • Prefer the repo's existing helper scripts and path conventions over ad hoc temp locations or duplicated wrappers
  • Move non-trivial parsing, JSON handling, or data shaping to a better-suited language when shell stops being the clearest tool

Style, testing, and tooling

  • Prefer long, readable option names for user-facing interfaces when the repo does not already prescribe a short-only style
  • Keep functions small enough to understand locally; split when one function starts owning parsing, validation, execution, and reporting all at once
  • Run shellcheck and shfmt where the repo uses them
  • Prefer Bats or the repo's existing shell-test framework for non-trivial scripts
  • Document required tools and minimum Bash features when the script depends on them

Decision Heuristics

Use these when the right choice is not obvious:

  • Language fit: if the task needs nested data structures, complex parsing, or large in-memory transforms, shell may be the wrong tool.
  • Quoting pressure: if command construction becomes hard to reason about, switch to arrays or redesign the interface before adding more flags.
  • Failure visibility: if set -e behavior is unclear in a construct, make the check explicit rather than assuming the shell will fail the right way.
  • Process ownership: if the script backgrounds work, define who waits, cleans up, and reports failures before adding more parallelism.
  • Portability pressure: if a script relies on GNU-only flags, a Bash 5.x feature, or OS-specific tools, document and validate that boundary instead of hiding it.
  • Repo conventions: if the repo has established patterns for shebangs, strict mode, shellcheck, shfmt, or helper libraries, follow them unless they create a correctness or safety problem.
  • Narrowness vs. quality: implement the narrowest change that solves the problem. When narrowness conflicts with correctness or safety, prefer correctness. When it conflicts with style alone, prefer narrowness unless the task is explicitly a cleanup.
  • Refactor boundary: outside explicit refactor work, fix at most one small adjacent issue while you are in the file.
  • Abstraction threshold: three similar command sequences or repeated flag parsing pain is a pattern; before extracting, check whether a function, a helper script, or a small move to another language is the simpler move.
  • External-tool boundary: if a script depends on jq, awk, sed, or platform-specific tooling, treat that dependency as part of the user-facing contract.

Validation

A change is done when:

  • shellcheck or the repo's equivalent linter reports no new findings
  • shell formatting is run when the repo has a formatter
  • changed --help, argument parsing, or top-level script startup paths are smoke-tested before deeper functional validation
  • existing shell tests pass
  • new or changed behavior has test coverage, or the lack of coverage is called out with a concrete reason
  • non-trivial scripts have a direct smoke path such as --help or a minimal fixture invocation
  • destructive or environment-mutating paths were verified against a safe test fixture rather than assumed correct
  • portability-sensitive changes were tested on the affected platform or the remaining platform risk was called out explicitly
  • review findings at Critical and Important severity are addressed

Examples

  • Review this Bash deploy script for quoting, traps, and rollback safety
  • Refactor this repo automation script to use arrays, safe temp files, and better argument parsing

平台分布

Codex

35.42%
按下载量换算29

Claude

29.31%
按下载量换算24

Cursor

19.36%
按下载量换算16

Gemini CLI

8.66%
按下载量换算7

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

接触敏感数据

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

安装前确认

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

继续浏览同类 Skills