[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6WYZF4ZV75MHCT60KQ09TH2":3,"skill-same:01M6WYZF4ZV75MHCT60KQ09TH2":87},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":28,"publishedAt":48,"linkOnly":49,"markdownContent":50,"markdownBody":51,"frontMatter":52,"refName":60,"commitSha":61,"skillDirectory":62,"forksCount":14,"repositoryHtmlUrl":63,"repositoryHomepageUrl":64,"ownerHtmlUrl":65,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":66,"install":67,"resources":80},"01M6WYZF4ZV75MHCT60KQ09TH2","shell-scripting",null,"Bash scripting — strict mode, quoting, arg parsing, traps, shellcheck compliance. Use when writing or reviewing bash scripts, adding error handling and argument parsing, or fixing shellcheck warnings.","projectious-work\u002Fprocesskit","projectious-work","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F263889726?v=4","01M6N97TJJ118WQ35CHRV8RD0E","projectious.work","01M6N97TPWJPF0BMKYQ4PBY5W8",0,"MIT","https:\u002F\u002Fgithub.com\u002Fprojectious-work\u002Fprocesskit\u002Fblob\u002Fmain\u002Farchive\u002Fprocesskit-install-20261101\u002Fcontext\u002Ftemplates\u002Fprocesskit\u002Fv0.17.0\u002Fcontext\u002Fskills\u002Fengineering\u002Fshell-scripting\u002FSKILL.md",[18,23],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000018","写作与文案","SCENARIO","使用场景",{"categoryNo":24,"categoryName":25,"taxonomyType":26,"taxonomyTypeDesc":27},"01JBSEEDCAT000000000000036","内容创作者","PROFESSION","适用职业",[29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47],"scripting","shell","shell scripting","use","when","v1","mode","argument","ShellCheck","error","scripts","bash scripting","writing","work","Bash","parsing","compliance","engineering","error handling","2026-11-10 10:12:30",false,"---\nname: shell-scripting\ndescription: |\n  Bash scripting — strict mode, quoting, arg parsing, traps, shellcheck compliance. Use when writing or reviewing bash scripts, adding error handling and argument parsing, or fixing shellcheck warnings.\nmetadata:\n  processkit:\n    apiVersion: processkit.projectious.work\u002Fv1\n    id: SKILL-shell-scripting\n    version: \"1.1.0\"\n    created: 2026-04-06T00:00:00Z\n    category: engineering\n---\n\n# Shell Scripting\n\n## Intro\n\nEvery bash script starts with `#!\u002Fusr\u002Fbin\u002Fenv bash` and\n`set -euo pipefail`, quotes every variable expansion, traps for\ncleanup, and passes `shellcheck -o all` cleanly. Anything less is\na bug in waiting.\n\n## Overview\n\n### Script header\n\n```bash\n#!\u002Fusr\u002Fbin\u002Fenv bash\nset -euo pipefail\n```\n\n- `set -e` — exit on any command failure\n- `set -u` — error on unset variables\n- `set -o pipefail` — propagate failures through pipes\n\nUse `#!\u002Fusr\u002Fbin\u002Fenv bash` rather than `#!\u002Fbin\u002Fbash` for\nportability across macOS and Linux.\n\n### Variable quoting\n\nAlways double-quote variable expansions to prevent word splitting\nand glob expansion:\n\n```bash\n# Correct\ncp \"$source\" \"$dest\"\nfor file in \"$dir\"\u002F*; do\n  echo \"Processing: $file\"\ndone\n\n# Wrong — breaks on paths with spaces\ncp $source $dest\n```\n\nUse `${var:-default}` for defaults and `${var:?error message}`\nfor required variables:\n\n```bash\nconfig_file=\"${1:?Usage: $0 \u003Cconfig-file>}\"\nlog_dir=\"${LOG_DIR:-\u002Fvar\u002Flog\u002Fmyapp}\"\n```\n\n### Argument parsing\n\nFor simple positional arguments use `${1:?...}`. For options use\n`getopts`:\n\n```bash\nverbose=false\noutput=\"\"\nwhile getopts \":vo:h\" opt; do\n  case $opt in\n    v) verbose=true ;;\n    o) output=\"$OPTARG\" ;;\n    h) usage; exit 0 ;;\n    :) echo \"Option -$OPTARG requires an argument\" >&2; exit 1 ;;\n    \\?) echo \"Unknown option: -$OPTARG\" >&2; exit 1 ;;\n  esac\ndone\nshift $((OPTIND - 1))\n```\n\n### Functions\n\nDefine functions with `name()`. Use `local` for every function\nvariable. Return data via stdout (captured with `$()`), not via\nreturn codes — codes are limited to 0–255 and conflate errors\nwith values.\n\n```bash\nlog() {\n  local level=\"$1\"\n  shift\n  printf '[%s] [%s] %s\\n' \"$(date '+%Y-%m-%d %H:%M:%S')\" \"$level\" \"$*\" >&2\n}\n\ndie() { log \"ERROR\" \"$@\"; exit 1; }\n```\n\n### Cleanup with trap\n\n```bash\ncleanup() { rm -rf \"${tmpdir:-}\"; }\ntrap cleanup EXIT\n\ntmpdir=\"$(mktemp -d)\"\n```\n\n`EXIT` fires on normal exit, errors (via `set -e`), and signals.\nAdd `trap 'echo Interrupted >&2; exit 130' INT TERM` when you\nneed distinct handling for user interrupts.\n\n### Arrays\n\nUse arrays for lists of items — never a space-separated string:\n\n```bash\nfiles=()\nwhile IFS= read -r -d '' file; do\n  files+=(\"$file\")\ndone \u003C \u003C(find \u002Fpath -name \"*.txt\" -print0)\n\nfor file in \"${files[@]}\"; do\n  process \"$file\"\ndone\necho \"Found ${#files[@]} files\"\n```\n\n### Shellcheck\n\nRun `shellcheck -o all script.sh` on every script before\ncommitting. When a warning is a genuine false positive, disable\nit locally with a comment, never globally:\n\n```bash\n# shellcheck disable=SC2034  # variable used in sourced file\nunused_var=\"value\"\n```\n\n## Gotchas\n\nAgent-specific failure modes — provider-neutral pause-and-self-check items:\n\n- **Missing `set -euo pipefail` at the top of every script.** Without `set -e`, a command that fails silently allows the script to continue and produce incorrect results or corrupt state. Without `set -u`, an unset variable expands to an empty string, which can turn `rm -rf \"${dir}\u002F\"` into `rm -rf \"\u002F\"`. Without `set -o pipefail`, a failed command in a pipe is masked by the exit code of the last command. These three flags are non-optional.\n- **Unquoted variable expansions.** `cp $source $dest` splits on whitespace and expands globs — a path with spaces becomes multiple arguments, and a path containing `*` expands to matching files. Every variable expansion must be double-quoted: `cp \"$source\" \"$dest\"`. The only exception is when word-splitting is explicitly desired, which is rare.\n- **Parsing `ls` output.** `ls` output is formatted for humans — file names can contain spaces, newlines, and control characters that break any parsing approach. Use `for f in \u002Fpath\u002F*` for simple iteration, `find -print0` piped to `read -d ''` for robust handling of arbitrary filenames, or `find -exec` to run a command on each result.\n- **Using `[ ]` instead of `[[ ]]` for conditionals.** Single brackets are POSIX `test` — they require quoting of every variable, don't support `&&` and `||` inside the brackets, and treat `\u003C` as file redirection. Double brackets `[[ ]]` are a bash built-in that handles unquoted variables safely, supports pattern matching with `=~`, and behaves predictably. Use `[[ ]]` in bash scripts.\n- **Leaving temporary files without a cleanup trap.** A script that creates a temporary directory with `mktemp -d` and exits early due to an error will leave that directory on disk forever. Set up `trap cleanup EXIT` immediately after creating any temporary resource so cleanup runs on both normal exit and error exit.\n- **Returning data via exit codes.** Bash exit codes are 0–255. Using `return 42` to pass a numeric result and `$?` to read it is limited, conflates success\u002Ffailure with data values, and does not work for strings. Return data from functions by printing to stdout and capturing with `$(function_call)`. Use the return code only for success (0) or failure (non-zero).\n- **Not running shellcheck before committing.** Shell scripts contain an enormous variety of subtle bugs — quoting issues, portability problems, unused variables, and incorrect conditionals — that are invisible to casual reading but immediately caught by `shellcheck`. Run `shellcheck -o all script.sh` on every script as part of the commit process or CI pipeline.\n\n## Full reference\n\n### Common pitfalls\n\n- Never parse `ls` output — use globs (`for f in *.txt`) or\n  `find -print0` with `read -d ''`.\n- Use `[[ ]]` instead of `[ ]` — safer, supports regex and\n  pattern matching.\n- Use `$(command)` instead of backticks.\n- Always use `\"$@\"` (quoted) to forward arguments, never `$*`.\n- Check for commands with `command -v cmd`, not `which cmd`.\n- Use `printf` instead of `echo` for portable output (`echo`\n  behavior varies across shells).\n\n### Structured logging with levels\n\n```bash\nreadonly LOG_LEVEL=\"${LOG_LEVEL:-INFO}\"\n\nlog() {\n  local level=\"$1\"; shift\n  local -A levels=([DEBUG]=0 [INFO]=1 [WARN]=2 [ERROR]=3)\n  local threshold=\"${levels[$LOG_LEVEL]:-1}\"\n  local current=\"${levels[$level]:-1}\"\n  (( current >= threshold )) || return 0\n  printf '[%s] [%-5s] %s\\n' \"$(date '+%Y-%m-%d %H:%M:%S')\" \"$level\" \"$*\" >&2\n}\n```\n\n### Lock file (prevent concurrent runs)\n\n```bash\nreadonly LOCKFILE=\"\u002Fvar\u002Flock\u002F$(basename \"$0\").lock\"\n\nacquire_lock() {\n  if ! mkdir \"$LOCKFILE\" 2>\u002Fdev\u002Fnull; then\n    local pid\n    pid=\"$(cat \"$LOCKFILE\u002Fpid\" 2>\u002Fdev\u002Fnull || echo unknown)\"\n    echo \"Already running (PID: $pid)\" >&2\n    exit 1\n  fi\n  echo $$ > \"$LOCKFILE\u002Fpid\"\n  trap 'rm -rf \"$LOCKFILE\"' EXIT\n}\n```\n\n`mkdir` is atomic, which works reliably on NFS where `flock`\nsometimes does not.\n\n### Retry with exponential backoff\n\n```bash\nretry() {\n  local max_attempts=\"$1\" delay=\"$2\"\n  shift 2\n  local attempt=1\n  until \"$@\"; do\n    if (( attempt >= max_attempts )); then\n      echo \"Failed after $attempt attempts: $*\" >&2\n      return 1\n    fi\n    echo \"Attempt $attempt failed, retrying in ${delay}s...\" >&2\n    sleep \"$delay\"\n    (( attempt++ ))\n    (( delay *= 2 ))\n  done\n}\n\nretry 5 2 curl -sSf \"https:\u002F\u002Fapi.example.com\u002Fhealth\"\n```\n\n### Safe file writing (atomic)\n\n```bash\nsafe_write() {\n  local target=\"$1\"\n  local tmpfile\n  tmpfile=\"$(mktemp \"${target}.tmp.XXXXXXXXXX\")\"\n  cat > \"$tmpfile\"\n  mv \"$tmpfile\" \"$target\"\n}\n\ngenerate_config | safe_write \u002Fetc\u002Fmyapp\u002Fconfig.toml\n```\n\n### Command existence check\n\n```bash\nrequire_commands() {\n  local missing=()\n  for cmd in \"$@\"; do\n    command -v \"$cmd\" &>\u002Fdev\u002Fnull || missing+=(\"$cmd\")\n  done\n  if (( ${#missing[@]} > 0 )); then\n    echo \"Missing required commands: ${missing[*]}\" >&2\n    return 1\n  fi\n}\n\nrequire_commands curl jq git docker\n```\n\n### Script self-identification\n\n```bash\nreadonly SCRIPT_DIR=\"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)\"\nreadonly SCRIPT_NAME=\"$(basename \"${BASH_SOURCE[0]}\")\"\n\nsource \"$SCRIPT_DIR\u002Flib\u002Futils.sh\"\nconfig=\"$SCRIPT_DIR\u002F..\u002Fconfig\u002Fdefaults.toml\"\n```\n\n### Color output with NO_COLOR support\n\n```bash\nif [[ -t 2 ]] && [[ -z \"${NO_COLOR:-}\" ]]; then\n  readonly RED=$'\\033[0;31m' GREEN=$'\\033[0;32m' RESET=$'\\033[0m'\nelse\n  readonly RED=\"\" GREEN=\"\" RESET=\"\"\nfi\ninfo()  { echo \"${GREEN}[INFO]${RESET} $*\" >&2; }\nerror() { echo \"${RED}[ERROR]${RESET} $*\" >&2; }\n```\n\nRespects the `NO_COLOR` convention (\u003Chttps:\u002F\u002Fno-color.org\u002F>) and\ndetects non-TTY output.\n\n### Here-documents\n\n```bash\n# With variable expansion\ncat \u003C\u003C EOF\nHello, $USER. Today is $(date).\nEOF\n\n# Without expansion (quote the delimiter)\ncat \u003C\u003C 'EOF'\nThis $variable is not expanded.\nEOF\n```\n\n### Further reading\n\n- `references\u002Fbash-patterns.md` — full reusable pattern library.\n","# Shell Scripting\n\n## Intro\n\nEvery bash script starts with `#!\u002Fusr\u002Fbin\u002Fenv bash` and\n`set -euo pipefail`, quotes every variable expansion, traps for\ncleanup, and passes `shellcheck -o all` cleanly. Anything less is\na bug in waiting.\n\n## Overview\n\n### Script header\n\n```bash\n#!\u002Fusr\u002Fbin\u002Fenv bash\nset -euo pipefail\n```\n\n- `set -e` — exit on any command failure\n- `set -u` — error on unset variables\n- `set -o pipefail` — propagate failures through pipes\n\nUse `#!\u002Fusr\u002Fbin\u002Fenv bash` rather than `#!\u002Fbin\u002Fbash` for\nportability across macOS and Linux.\n\n### Variable quoting\n\nAlways double-quote variable expansions to prevent word splitting\nand glob expansion:\n\n```bash\n# Correct\ncp \"$source\" \"$dest\"\nfor file in \"$dir\"\u002F*; do\n  echo \"Processing: $file\"\ndone\n\n# Wrong — breaks on paths with spaces\ncp $source $dest\n```\n\nUse `${var:-default}` for defaults and `${var:?error message}`\nfor required variables:\n\n```bash\nconfig_file=\"${1:?Usage: $0 \u003Cconfig-file>}\"\nlog_dir=\"${LOG_DIR:-\u002Fvar\u002Flog\u002Fmyapp}\"\n```\n\n### Argument parsing\n\nFor simple positional arguments use `${1:?...}`. For options use\n`getopts`:\n\n```bash\nverbose=false\noutput=\"\"\nwhile getopts \":vo:h\" opt; do\n  case $opt in\n    v) verbose=true ;;\n    o) output=\"$OPTARG\" ;;\n    h) usage; exit 0 ;;\n    :) echo \"Option -$OPTARG requires an argument\" >&2; exit 1 ;;\n    \\?) echo \"Unknown option: -$OPTARG\" >&2; exit 1 ;;\n  esac\ndone\nshift $((OPTIND - 1))\n```\n\n### Functions\n\nDefine functions with `name()`. Use `local` for every function\nvariable. Return data via stdout (captured with `$()`), not via\nreturn codes — codes are limited to 0–255 and conflate errors\nwith values.\n\n```bash\nlog() {\n  local level=\"$1\"\n  shift\n  printf '[%s] [%s] %s\\n' \"$(date '+%Y-%m-%d %H:%M:%S')\" \"$level\" \"$*\" >&2\n}\n\ndie() { log \"ERROR\" \"$@\"; exit 1; }\n```\n\n### Cleanup with trap\n\n```bash\ncleanup() { rm -rf \"${tmpdir:-}\"; }\ntrap cleanup EXIT\n\ntmpdir=\"$(mktemp -d)\"\n```\n\n`EXIT` fires on normal exit, errors (via `set -e`), and signals.\nAdd `trap 'echo Interrupted >&2; exit 130' INT TERM` when you\nneed distinct handling for user interrupts.\n\n### Arrays\n\nUse arrays for lists of items — never a space-separated string:\n\n```bash\nfiles=()\nwhile IFS= read -r -d '' file; do\n  files+=(\"$file\")\ndone \u003C \u003C(find \u002Fpath -name \"*.txt\" -print0)\n\nfor file in \"${files[@]}\"; do\n  process \"$file\"\ndone\necho \"Found ${#files[@]} files\"\n```\n\n### Shellcheck\n\nRun `shellcheck -o all script.sh` on every script before\ncommitting. When a warning is a genuine false positive, disable\nit locally with a comment, never globally:\n\n```bash\n# shellcheck disable=SC2034  # variable used in sourced file\nunused_var=\"value\"\n```\n\n## Gotchas\n\nAgent-specific failure modes — provider-neutral pause-and-self-check items:\n\n- **Missing `set -euo pipefail` at the top of every script.** Without `set -e`, a command that fails silently allows the script to continue and produce incorrect results or corrupt state. Without `set -u`, an unset variable expands to an empty string, which can turn `rm -rf \"${dir}\u002F\"` into `rm -rf \"\u002F\"`. Without `set -o pipefail`, a failed command in a pipe is masked by the exit code of the last command. These three flags are non-optional.\n- **Unquoted variable expansions.** `cp $source $dest` splits on whitespace and expands globs — a path with spaces becomes multiple arguments, and a path containing `*` expands to matching files. Every variable expansion must be double-quoted: `cp \"$source\" \"$dest\"`. The only exception is when word-splitting is explicitly desired, which is rare.\n- **Parsing `ls` output.** `ls` output is formatted for humans — file names can contain spaces, newlines, and control characters that break any parsing approach. Use `for f in \u002Fpath\u002F*` for simple iteration, `find -print0` piped to `read -d ''` for robust handling of arbitrary filenames, or `find -exec` to run a command on each result.\n- **Using `[ ]` instead of `[[ ]]` for conditionals.** Single brackets are POSIX `test` — they require quoting of every variable, don't support `&&` and `||` inside the brackets, and treat `\u003C` as file redirection. Double brackets `[[ ]]` are a bash built-in that handles unquoted variables safely, supports pattern matching with `=~`, and behaves predictably. Use `[[ ]]` in bash scripts.\n- **Leaving temporary files without a cleanup trap.** A script that creates a temporary directory with `mktemp -d` and exits early due to an error will leave that directory on disk forever. Set up `trap cleanup EXIT` immediately after creating any temporary resource so cleanup runs on both normal exit and error exit.\n- **Returning data via exit codes.** Bash exit codes are 0–255. Using `return 42` to pass a numeric result and `$?` to read it is limited, conflates success\u002Ffailure with data values, and does not work for strings. Return data from functions by printing to stdout and capturing with `$(function_call)`. Use the return code only for success (0) or failure (non-zero).\n- **Not running shellcheck before committing.** Shell scripts contain an enormous variety of subtle bugs — quoting issues, portability problems, unused variables, and incorrect conditionals — that are invisible to casual reading but immediately caught by `shellcheck`. Run `shellcheck -o all script.sh` on every script as part of the commit process or CI pipeline.\n\n## Full reference\n\n### Common pitfalls\n\n- Never parse `ls` output — use globs (`for f in *.txt`) or\n  `find -print0` with `read -d ''`.\n- Use `[[ ]]` instead of `[ ]` — safer, supports regex and\n  pattern matching.\n- Use `$(command)` instead of backticks.\n- Always use `\"$@\"` (quoted) to forward arguments, never `$*`.\n- Check for commands with `command -v cmd`, not `which cmd`.\n- Use `printf` instead of `echo` for portable output (`echo`\n  behavior varies across shells).\n\n### Structured logging with levels\n\n```bash\nreadonly LOG_LEVEL=\"${LOG_LEVEL:-INFO}\"\n\nlog() {\n  local level=\"$1\"; shift\n  local -A levels=([DEBUG]=0 [INFO]=1 [WARN]=2 [ERROR]=3)\n  local threshold=\"${levels[$LOG_LEVEL]:-1}\"\n  local current=\"${levels[$level]:-1}\"\n  (( current >= threshold )) || return 0\n  printf '[%s] [%-5s] %s\\n' \"$(date '+%Y-%m-%d %H:%M:%S')\" \"$level\" \"$*\" >&2\n}\n```\n\n### Lock file (prevent concurrent runs)\n\n```bash\nreadonly LOCKFILE=\"\u002Fvar\u002Flock\u002F$(basename \"$0\").lock\"\n\nacquire_lock() {\n  if ! mkdir \"$LOCKFILE\" 2>\u002Fdev\u002Fnull; then\n    local pid\n    pid=\"$(cat \"$LOCKFILE\u002Fpid\" 2>\u002Fdev\u002Fnull || echo unknown)\"\n    echo \"Already running (PID: $pid)\" >&2\n    exit 1\n  fi\n  echo $$ > \"$LOCKFILE\u002Fpid\"\n  trap 'rm -rf \"$LOCKFILE\"' EXIT\n}\n```\n\n`mkdir` is atomic, which works reliably on NFS where `flock`\nsometimes does not.\n\n### Retry with exponential backoff\n\n```bash\nretry() {\n  local max_attempts=\"$1\" delay=\"$2\"\n  shift 2\n  local attempt=1\n  until \"$@\"; do\n    if (( attempt >= max_attempts )); then\n      echo \"Failed after $attempt attempts: $*\" >&2\n      return 1\n    fi\n    echo \"Attempt $attempt failed, retrying in ${delay}s...\" >&2\n    sleep \"$delay\"\n    (( attempt++ ))\n    (( delay *= 2 ))\n  done\n}\n\nretry 5 2 curl -sSf \"https:\u002F\u002Fapi.example.com\u002Fhealth\"\n```\n\n### Safe file writing (atomic)\n\n```bash\nsafe_write() {\n  local target=\"$1\"\n  local tmpfile\n  tmpfile=\"$(mktemp \"${target}.tmp.XXXXXXXXXX\")\"\n  cat > \"$tmpfile\"\n  mv \"$tmpfile\" \"$target\"\n}\n\ngenerate_config | safe_write \u002Fetc\u002Fmyapp\u002Fconfig.toml\n```\n\n### Command existence check\n\n```bash\nrequire_commands() {\n  local missing=()\n  for cmd in \"$@\"; do\n    command -v \"$cmd\" &>\u002Fdev\u002Fnull || missing+=(\"$cmd\")\n  done\n  if (( ${#missing[@]} > 0 )); then\n    echo \"Missing required commands: ${missing[*]}\" >&2\n    return 1\n  fi\n}\n\nrequire_commands curl jq git docker\n```\n\n### Script self-identification\n\n```bash\nreadonly SCRIPT_DIR=\"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)\"\nreadonly SCRIPT_NAME=\"$(basename \"${BASH_SOURCE[0]}\")\"\n\nsource \"$SCRIPT_DIR\u002Flib\u002Futils.sh\"\nconfig=\"$SCRIPT_DIR\u002F..\u002Fconfig\u002Fdefaults.toml\"\n```\n\n### Color output with NO_COLOR support\n\n```bash\nif [[ -t 2 ]] && [[ -z \"${NO_COLOR:-}\" ]]; then\n  readonly RED=$'\\033[0;31m' GREEN=$'\\033[0;32m' RESET=$'\\033[0m'\nelse\n  readonly RED=\"\" GREEN=\"\" RESET=\"\"\nfi\ninfo()  { echo \"${GREEN}[INFO]${RESET} $*\" >&2; }\nerror() { echo \"${RED}[ERROR]${RESET} $*\" >&2; }\n```\n\nRespects the `NO_COLOR` convention (\u003Chttps:\u002F\u002Fno-color.org\u002F>) and\ndetects non-TTY output.\n\n### Here-documents\n\n```bash\n# With variable expansion\ncat \u003C\u003C EOF\nHello, $USER. Today is $(date).\nEOF\n\n# Without expansion (quote the delimiter)\ncat \u003C\u003C 'EOF'\nThis $variable is not expanded.\nEOF\n```\n\n### Further reading\n\n- `references\u002Fbash-patterns.md` — full reusable pattern library.\n",{"name":5,"metadata":53,"description":59},{"processkit":54},{"id":55,"created":56,"version":57,"category":46,"apiVersion":58},"SKILL-shell-scripting",1775433600000,"1.1.0","processkit.projectious.work\u002Fv1","Bash scripting — strict mode, quoting, arg parsing, traps, shellcheck compliance. Use when writing or reviewing bash scripts, adding error handling and argument parsing, or fixing shellcheck warnings.\n","main","4876a92620ee792aac2ac9a1a806322d8a572367","archive\u002Fprocesskit-install-20261101\u002Fcontext\u002Ftemplates\u002Fprocesskit\u002Fv0.17.0\u002Fcontext\u002Fskills\u002Fengineering\u002Fshell-scripting","https:\u002F\u002Fgithub.com\u002Fprojectious-work\u002Fprocesskit","https:\u002F\u002Fprojectious-work.github.io\u002Fprocesskit\u002F","https:\u002F\u002Fgithub.com\u002Fprojectious-work","2026-11-11 23:24:18",{"source":8,"skillName":5,"commands":68,"prompt":78,"zipAvailable":79},[69,72,75],{"tool":70,"command":71},"npx","npx skills add projectious-work\u002Fprocesskit --skill shell-scripting",{"tool":73,"command":74},"bunx","bunx skills add projectious-work\u002Fprocesskit --skill shell-scripting",{"tool":76,"command":77},"pnpm","pnpm dlx skills add projectious-work\u002Fprocesskit --skill shell-scripting","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fprojectious-work\u002Fprocesskit\u002Fblob\u002Fmain\u002Farchive\u002Fprocesskit-install-20261101\u002Fcontext\u002Ftemplates\u002Fprocesskit\u002Fv0.17.0\u002Fcontext\u002Fskills\u002Fengineering\u002Fshell-scripting\u002FSKILL.md",true,[81],{"path":82,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":85,"sourceHtmlUrl":86},"references\u002Fbash-patterns.md","REFERENCE","参考文档",4563,"https:\u002F\u002Fgithub.com\u002Fprojectious-work\u002Fprocesskit\u002Fblob\u002Fmain\u002Farchive\u002Fprocesskit-install-20261101\u002Fcontext\u002Ftemplates\u002Fprocesskit\u002Fv0.17.0\u002Fcontext\u002Fskills\u002Fengineering\u002Fshell-scripting\u002Freferences\u002Fbash-patterns.md",[88,95,102,108,132,151],{"skillNo":89,"name":90,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":94},"01M7665G2ED3624R3X93304265","standard-ui-design","https:\u002F\u002Fgithub.com\u002Fprojectious-work\u002Fprocesskit\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fstandard-ui-design\u002FSKILL.md",[],[],"2026-11-12 13:55:43",{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":94},"01M76651QTC6W0HJ4AFW2MMR3V","standard-agent-use","Company standard for working with AI agents. Use when deciding what to delegate to agents, capturing open work, keeping agent memory or knowledge notes, improving an agent workflow, or introducing agent work in a team or for a client.","https:\u002F\u002Fgithub.com\u002Fprojectious-work\u002Fprocesskit\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fstandard-agent-use\u002FSKILL.md",[],[],{"skillNo":103,"name":104,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":94},"01M76650NN4T8P241021NBR64S","standard-agent-building","https:\u002F\u002Fgithub.com\u002Fprojectious-work\u002Fprocesskit\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fstandard-agent-building\u002FSKILL.md",[],[],{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":117,"publishedAt":48},"01M6X5MTC89B4ZGXW3JVSQCPF8","skill-management","Manage Skill package manifests as v1 ontology entities.","https:\u002F\u002Fgithub.com\u002Fprojectious-work\u002Fprocesskit\u002Fblob\u002Fmain\u002Fsrc\u002Fcontext\u002Fskills\u002Fprocesskit\u002Fskill-management\u002FSKILL.md",[114],{"categoryNo":115,"categoryName":116,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",[118,119,120,34,121,122,42,123,124,125,126,127,110,128,129,130,131],"management","skill management","ontology","create","as","transition","get","manage","update","alpha","list","package","skill package","manifests",{"skillNo":133,"name":134,"nameZh":6,"description":135,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":136,"categories":137,"keywords":139,"publishedAt":48},"01M6X5MCV74NHW5MEDNHZRF2C8","schema-management","Manage generated processkit schema contracts through deterministic MCP rebuild and inspection workflows.","https:\u002F\u002Fgithub.com\u002Fprojectious-work\u002Fprocesskit\u002Fblob\u002Fmain\u002Fsrc\u002Fcontext\u002Fskills\u002Fprocesskit\u002Fschema-management\u002FSKILL.md",[138],{"categoryNo":115,"categoryName":116,"taxonomyType":21,"taxonomyTypeDesc":22},[140,141,118,142,143,144,145,146,147,148,149,150,42,124,125,127,35],"schema","schema management","contract","rebuild","contracts","workflows","wed","generated","MCP","validation","deterministic",{"skillNo":152,"name":153,"nameZh":6,"description":154,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":155,"categories":156,"keywords":157,"publishedAt":48},"01M6X5M5G6YJ96AMZGSCZJ1D13","proposition-management","Record claims, risks, beliefs, world facts, WSJF estimates, and assumptions through the Proposition interface.","https:\u002F\u002Fgithub.com\u002Fprojectious-work\u002Fprocesskit\u002Fblob\u002Fmain\u002Fsrc\u002Fcontext\u002Fskills\u002Fprocesskit\u002Fproposition-management\u002FSKILL.md",[],[158,118,159,160,121,161,162,163,42,124,164,165,126,166,127,167,168,169,170,171],"proposition management","proposition","interface","claims","record","world","creation","event","WSJF","index","updates","query","facts","log"]