[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EMCSQ4KVEAP2TMMT1P1FM5":3,"skill-same:01M7EMCSQ4KVEAP2TMMT1P1FM5":47},{"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":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":6,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":6,"updatedAt":32,"install":33,"resources":46},"01M7EMCSQ4KVEAP2TMMT1P1FM5","bash-pro",null,"Bash scripting guidance — safe scripting patterns, quoting, error handling, pipes, and maintainable shell code.","TanNhatCMS\u002Fjarvis","TanNhatCMS","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F113796420?v=4","01M753MV17KG5CD3152G3WQEQY","KietNT","01M7EKEDYVYQ6PWVJJMZ911VMX",0,"MIT","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-bash-pro\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: bash-pro\ndescription: Bash scripting guidance — safe scripting patterns, quoting, error handling, pipes, and maintainable shell code.\ncategory: development\n---\n\n## Overview\n\nBash is the glue of Unix systems: deployment scripts, CI steps, cron jobs, and one-liners that would take fifty lines in another language. It's also a footgun collection — unquoted variables, silent failures, and pipe errors have caused legendary outages. The difference is discipline: a few strict habits make bash scripts reliable instead of terrifying.\n\nThis skill covers the safe subset of bash: strict mode, quoting, error handling, and the patterns for writing scripts you'd trust in production — plus knowing when to reach for Python instead.\n\n## When to use\n\n- Writing shell scripts (deploy, backup, CI, automation).\n- Debugging existing bash scripts.\n- Choosing between bash and Python for a task.\n- Writing safe one-liners and pipelines.\n- Handling arguments, config, and logging in scripts.\n- Making scripts idempotent and testable.\n\n## Core concepts\n\n- **Strict mode.** `set -euo pipefail` — exit on error, fail on undefined variables, propagate pipe failures. The single most important bash habit; without it, scripts fail silently and continue.\n- **Quoting.** Always quote `\"$variables\"` — unquoted expansions undergo word splitting and globbing. The #1 source of \"works until the filename has a space\" bugs. Use `\"$@\"` for argument arrays.\n- **Exit codes.** `0` success, non-zero failure; check explicitly where it matters (`if ! command; then`). `$?` captures the last status — use it immediately before anything overwrites it.\n- **Pipes and pipefail.** `cmd1 | cmd2` — without `pipefail`, a failing `cmd1` is masked by `cmd2`'s success. `set -o pipefail` fixes it; still, avoid mega-pipes that are undebuggable — break complex logic into steps with temp files or variables.\n- **Conditionals.** `[[ ]]` over `[ ]` (fewer surprises, pattern matching, no word splitting); `-f`\u002F`-d`\u002F`-n`\u002F`-z` tests; `(( ))` for arithmetic. Quote inside `[[ ]]` only where needed — it's safer than `[ ]` by design.\n- **Functions.** Named functions with `local` variables — `local` prevents global-namespace pollution, the source of subtle cross-function bugs. Return values via stdout or namerefs, not just exit codes.\n- **Arguments.** `$1`, `$@`, `$#`; `getopts` for flags; validate argument counts and show usage. Scripts with undocumented arguments are write-only.\n- **Error handling.** `trap` for cleanup (temp files, locks) on EXIT\u002FERR\u002FINT — scripts must clean up after themselves even when interrupted.\n- **Idempotency.** Scripts should be safe to re-run: check before creating (`mkdir -p`, `grep -q || append`), use locks (`flock`) for cron jobs that might overlap.\n- **Here-docs and here-strings.** `\u003C\u003CEOF` for multiline input, `\u003C\u003C\u003C` for single strings — cleaner than `echo` chains for generating config files.\n- **Process substitution.** `\u003C(cmd)` and `>(cmd)` — diffing command outputs, feeding pipelines as files. Powerful for comparisons without temp files.\n- **Arrays.** `arr=(a b c)`, `\"${arr[@]}\"` — for lists that survive spaces. Associative arrays (`declare -A`) for key-value maps.\n- **Debugging.** `set -x` traces execution; `bash -n` syntax-checks without running; ShellCheck (the linter) catches most bugs statically — run it in CI on every script.\n- **When not bash.** Complex data structures, JSON\u002FXML processing beyond `jq`, error handling with retries, anything over ~100 lines — that's Python's job. Bash for orchestration, Python for logic.\n- **Portability.** `#!\u002Fusr\u002Fbin\u002Fenv bash`, avoid bashisms in `sh` scripts, beware GNU vs BSD tool differences (macOS vs Linux `sed`\u002F`date`).\n\n## Practical workflow\n\n1. **Start every script with the template.** Strict mode, usage function, main guard:\n   ```bash\n   #!\u002Fusr\u002Fbin\u002Fenv bash\n   set -euo pipefail\n   IFS=$'\\n\\t'\n\n   usage() { echo \"Usage: $(basename \"$0\") \u003Cenv>\"; exit 1; }\n   [[ $# -eq 1 ]] || usage\n\n   main() {\n     local env=\"$1\"\n     # ... script logic ...\n   }\n   main \"$@\"\n   ```\n2. **Quote everything.** `\"$var\"`, `\"$@\"`, `\"${arr[@]}\"` — make unquoted expansion a code-review red flag.\n3. **Handle errors explicitly.** Check critical commands; `trap` cleanup for temp files and locks:\n   ```bash\n   tmpdir=$(mktemp -d)\n   trap 'rm -rf \"$tmpdir\"' EXIT INT TERM\n   ```\n4. **Use locks for scheduled scripts.** `flock` prevents overlapping cron runs from corrupting state:\n   ```bash\n   exec 9>\u002Fvar\u002Flock\u002Fmyscript.lock\n   flock -n 9 || { echo \"Already running\"; exit 0; }\n   ```\n5. **Log with timestamps.** Consistent log functions beat bare `echo`; log to stderr for diagnostics, stdout for data:\n   ```bash\n   log() { echo \"[$(date '+%F %T')] $*\" >&2; }\n   ```\n6. **Parse args with getopts.** Flags, defaults, validation — scripts grow options, plan for it:\n   ```bash\n   while getopts \"e:v\" opt; do\n     case $opt in e) env=\"$OPTARG\";; v) verbose=1;; *) usage;; esac\n   done\n   ```\n7. **Lint with ShellCheck.** In CI and in the editor; treat warnings as errors for new scripts. It catches quoting, pipefail, and portability issues mechanically.\n8. **Know when to switch.** Hitting arrays-of-associative-arrays, complex retries, or 150 lines? Rewrite in Python — bash's job was orchestration, and it's done.\n\n## Common pitfalls\n\n- **No `set -euo pipefail`** — silent failures continuing; strict mode always.\n- **Unquoted variables** — word splitting and globbing; quote `\"$var\"` everywhere.\n- **Parsing `ls`** — filenames with spaces\u002Fnewlines break it; use globs or `find -print0`.\n- **`cd` without checking** — `cd $dir; rm -rf *` in the wrong directory; `cd \"$dir\" || exit 1`.\n- **Overwriting with `>`** — clobbering files accidentally; `set -o noclobber` in interactive shells, care in scripts.\n- **Ignoring pipe failures** — `set -o pipefail` or explicit `${PIPESTATUS[@]}` checks.\n- **Global variables in functions** — cross-function contamination; `local` everything.\n- **No trap cleanup** — temp files and locks leaking on interrupt; trap EXIT\u002FINT\u002FTERM.\n- **Overlapping cron runs** — no locking; `flock` for scheduled scripts.\n- **Bash for complex logic** — 200-line scripts with nested JSON parsing; switch to Python.\n- **Hardcoded paths** — `\u002Ftmp` races and assumptions; `mktemp`, configurable paths.\n- **`echo` for data** — mixing diagnostics and output; log to stderr, data to stdout.\n- **Assuming GNU tools** — macOS\u002FBSD differences in `sed`, `date`, `stat`; test on target platforms or use portable constructs.\n","## Overview\n\nBash is the glue of Unix systems: deployment scripts, CI steps, cron jobs, and one-liners that would take fifty lines in another language. It's also a footgun collection — unquoted variables, silent failures, and pipe errors have caused legendary outages. The difference is discipline: a few strict habits make bash scripts reliable instead of terrifying.\n\nThis skill covers the safe subset of bash: strict mode, quoting, error handling, and the patterns for writing scripts you'd trust in production — plus knowing when to reach for Python instead.\n\n## When to use\n\n- Writing shell scripts (deploy, backup, CI, automation).\n- Debugging existing bash scripts.\n- Choosing between bash and Python for a task.\n- Writing safe one-liners and pipelines.\n- Handling arguments, config, and logging in scripts.\n- Making scripts idempotent and testable.\n\n## Core concepts\n\n- **Strict mode.** `set -euo pipefail` — exit on error, fail on undefined variables, propagate pipe failures. The single most important bash habit; without it, scripts fail silently and continue.\n- **Quoting.** Always quote `\"$variables\"` — unquoted expansions undergo word splitting and globbing. The #1 source of \"works until the filename has a space\" bugs. Use `\"$@\"` for argument arrays.\n- **Exit codes.** `0` success, non-zero failure; check explicitly where it matters (`if ! command; then`). `$?` captures the last status — use it immediately before anything overwrites it.\n- **Pipes and pipefail.** `cmd1 | cmd2` — without `pipefail`, a failing `cmd1` is masked by `cmd2`'s success. `set -o pipefail` fixes it; still, avoid mega-pipes that are undebuggable — break complex logic into steps with temp files or variables.\n- **Conditionals.** `[[ ]]` over `[ ]` (fewer surprises, pattern matching, no word splitting); `-f`\u002F`-d`\u002F`-n`\u002F`-z` tests; `(( ))` for arithmetic. Quote inside `[[ ]]` only where needed — it's safer than `[ ]` by design.\n- **Functions.** Named functions with `local` variables — `local` prevents global-namespace pollution, the source of subtle cross-function bugs. Return values via stdout or namerefs, not just exit codes.\n- **Arguments.** `$1`, `$@`, `$#`; `getopts` for flags; validate argument counts and show usage. Scripts with undocumented arguments are write-only.\n- **Error handling.** `trap` for cleanup (temp files, locks) on EXIT\u002FERR\u002FINT — scripts must clean up after themselves even when interrupted.\n- **Idempotency.** Scripts should be safe to re-run: check before creating (`mkdir -p`, `grep -q || append`), use locks (`flock`) for cron jobs that might overlap.\n- **Here-docs and here-strings.** `\u003C\u003CEOF` for multiline input, `\u003C\u003C\u003C` for single strings — cleaner than `echo` chains for generating config files.\n- **Process substitution.** `\u003C(cmd)` and `>(cmd)` — diffing command outputs, feeding pipelines as files. Powerful for comparisons without temp files.\n- **Arrays.** `arr=(a b c)`, `\"${arr[@]}\"` — for lists that survive spaces. Associative arrays (`declare -A`) for key-value maps.\n- **Debugging.** `set -x` traces execution; `bash -n` syntax-checks without running; ShellCheck (the linter) catches most bugs statically — run it in CI on every script.\n- **When not bash.** Complex data structures, JSON\u002FXML processing beyond `jq`, error handling with retries, anything over ~100 lines — that's Python's job. Bash for orchestration, Python for logic.\n- **Portability.** `#!\u002Fusr\u002Fbin\u002Fenv bash`, avoid bashisms in `sh` scripts, beware GNU vs BSD tool differences (macOS vs Linux `sed`\u002F`date`).\n\n## Practical workflow\n\n1. **Start every script with the template.** Strict mode, usage function, main guard:\n   ```bash\n   #!\u002Fusr\u002Fbin\u002Fenv bash\n   set -euo pipefail\n   IFS=$'\\n\\t'\n\n   usage() { echo \"Usage: $(basename \"$0\") \u003Cenv>\"; exit 1; }\n   [[ $# -eq 1 ]] || usage\n\n   main() {\n     local env=\"$1\"\n     # ... script logic ...\n   }\n   main \"$@\"\n   ```\n2. **Quote everything.** `\"$var\"`, `\"$@\"`, `\"${arr[@]}\"` — make unquoted expansion a code-review red flag.\n3. **Handle errors explicitly.** Check critical commands; `trap` cleanup for temp files and locks:\n   ```bash\n   tmpdir=$(mktemp -d)\n   trap 'rm -rf \"$tmpdir\"' EXIT INT TERM\n   ```\n4. **Use locks for scheduled scripts.** `flock` prevents overlapping cron runs from corrupting state:\n   ```bash\n   exec 9>\u002Fvar\u002Flock\u002Fmyscript.lock\n   flock -n 9 || { echo \"Already running\"; exit 0; }\n   ```\n5. **Log with timestamps.** Consistent log functions beat bare `echo`; log to stderr for diagnostics, stdout for data:\n   ```bash\n   log() { echo \"[$(date '+%F %T')] $*\" >&2; }\n   ```\n6. **Parse args with getopts.** Flags, defaults, validation — scripts grow options, plan for it:\n   ```bash\n   while getopts \"e:v\" opt; do\n     case $opt in e) env=\"$OPTARG\";; v) verbose=1;; *) usage;; esac\n   done\n   ```\n7. **Lint with ShellCheck.** In CI and in the editor; treat warnings as errors for new scripts. It catches quoting, pipefail, and portability issues mechanically.\n8. **Know when to switch.** Hitting arrays-of-associative-arrays, complex retries, or 150 lines? Rewrite in Python — bash's job was orchestration, and it's done.\n\n## Common pitfalls\n\n- **No `set -euo pipefail`** — silent failures continuing; strict mode always.\n- **Unquoted variables** — word splitting and globbing; quote `\"$var\"` everywhere.\n- **Parsing `ls`** — filenames with spaces\u002Fnewlines break it; use globs or `find -print0`.\n- **`cd` without checking** — `cd $dir; rm -rf *` in the wrong directory; `cd \"$dir\" || exit 1`.\n- **Overwriting with `>`** — clobbering files accidentally; `set -o noclobber` in interactive shells, care in scripts.\n- **Ignoring pipe failures** — `set -o pipefail` or explicit `${PIPESTATUS[@]}` checks.\n- **Global variables in functions** — cross-function contamination; `local` everything.\n- **No trap cleanup** — temp files and locks leaking on interrupt; trap EXIT\u002FINT\u002FTERM.\n- **Overlapping cron runs** — no locking; `flock` for scheduled scripts.\n- **Bash for complex logic** — 200-line scripts with nested JSON parsing; switch to Python.\n- **Hardcoded paths** — `\u002Ftmp` races and assumptions; `mktemp`, configurable paths.\n- **`echo` for data** — mixing diagnostics and output; log to stderr, data to stdout.\n- **Assuming GNU tools** — macOS\u002FBSD differences in `sed`, `date`, `stat`; test on target platforms or use portable constructs.\n",{"name":5,"category":24,"description":7},"development","main","af388a77c2fe5e0b4fd879cca4300a0ffa9a6579","skills\u002Fams-bash-pro",1,"https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis","https:\u002F\u002Fgithub.com\u002FTanNhatCMS","https:\u002F\u002Fmrkiet.name.vn","2026-11-07 14:23:08",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add TanNhatCMS\u002Fjarvis --skill bash-pro",{"tool":39,"command":40},"bunx","bunx skills add TanNhatCMS\u002Fjarvis --skill bash-pro",{"tool":42,"command":43},"pnpm","pnpm dlx skills add TanNhatCMS\u002Fjarvis --skill bash-pro","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-bash-pro\u002FSKILL.md",true,[],[48,55,63,70,77,84],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":19},"01M7EWYJR0J8DARY7E59Z6Y9MV","web-scrape","Turn web pages into LLM-ready markdown via the Firecrawl API (renders JS, anti-bot handling). Use when browser_open\u002Ffetch fails on JS-heavy pages, or when you need clean markdown\u002Fstructured extraction from a site. Requires FIRECRAWL_API_KEY.","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fweb-scrape\u002FSKILL.md",[],[],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":59,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M7EWYBN5P6F2AJG3FR24T9BP","design-taste-frontend","tasteskill v2, the anti-slop frontend skill. Art direction for websites, distilled from a study of 247 curated gallery sites (One Page Love, Awwwards Sites of the Day). Deals researched directions (idea, composition, type, palette, photographs, section blueprints) from a library, enforces a strict no-slop house style with a real-browser inspector, and runs a look-and-fix loop on screenshots. Use this whenever you build, design, redesign, restyle, polish or review a landing page, marketing site, portfolio, product page, one-pager, hero or any public-facing web page, in any stack (HTML\u002FCSS, React, Next.js, Vue, Svelte, Astro, Tailwind) — also when the user says a page looks generic, templated, \"AI-made\", sloppy, or asks to make it look designed, premium, award-level or less like every other site. Not for dashboards or app screens.","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Ftaste-design\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Ftaste-design\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M7EWY8FQFNQ2GB7NZZWGSSDX","test-driven-development","Use when implementing any feature or bugfix, before writing implementation code","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-tdd\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M7EWY5SHBFRH1HDHVWM9K7TV","systematic-debugging","Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-debugging\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M7EWY3NM0Z0JAKS7HDZ24K66","requesting-code-review","Use when completing tasks, implementing major features, or before merging to verify work meets requirements","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-code-review\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M7EWY0WRMWX4M9ZFY0WKC593","brainstorming","You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-brainstorming\u002FSKILL.md",[],[]]