[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6PVDZVTS8TJ6SRTCTHXVQ6E":3,"skill-same:01M6PVDZVTS8TJ6SRTCTHXVQ6E":64},{"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":36,"linkOnly":37,"markdownContent":38,"markdownBody":39,"frontMatter":40,"refName":44,"commitSha":45,"skillDirectory":46,"forksCount":43,"repositoryHtmlUrl":47,"repositoryHomepageUrl":6,"ownerHtmlUrl":48,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":49,"install":50,"resources":63},"01M6PVDZVTS8TJ6SRTCTHXVQ6E","bash-mastery",null,"Shell scripting, Makefile conventions, and modern CLI tooling. Use when writing or reviewing shell scripts, creating or modifying Makefiles, or choosing CLI tools for automation tasks.","muratovv\u002Fai-hats","muratovv","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F7502801?v=4","01M6JGCBN4KEJX012GPJVSH04T","Fedor Muratov","01M6JGCBSNMN7CW3RGTPPE0MN2",3,"MIT","https:\u002F\u002Fgithub.com\u002Fmuratovv\u002Fai-hats\u002Fblob\u002Fmaster\u002Fpackages\u002Fai-hats-library\u002Fsrc\u002Fai_hats_library\u002Fexperimental\u002Fusage\u002Fskills\u002Fbash-mastery\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35],"bash mastery","Bash","shell scripts","for","scripts","shell scripting","conventions","tooling","use","writing","makefile","shell","Tools","scripting","tasks","automation","cli","2026-11-10 10:12:30",false,"---\nname: bash-mastery\ndescription: >-\n  Shell scripting, Makefile conventions, and modern CLI tooling. Use when\n  writing or reviewing shell scripts, creating or modifying Makefiles, or\n  choosing CLI tools for automation tasks.\nlicense: MIT\nai_hats:\n  schema_version: 1\n  type: skill\n---\n\n# Bash Mastery\n\nShell scripting, Makefile conventions, and modern CLI tooling.\n\n## When to Use\n\nScripting, Makefile, and CLI-tooling *craft* — not git plumbing (→ **git-mastery**)\nand not the Bash-vs-dedicated-tool choice (→ **tool-call-hygiene**, which decides\nwhether to shell out at all versus use Read\u002FGrep\u002FEdit). Reach here once you've\ndecided a shell script is the right tool and need it to be correct and portable.\n\n## Bash Scripts\n\n- Shebang: `#!\u002Fusr\u002Fbin\u002Fenv bash`\n- Always use `set -euo pipefail`.\n- Implement `-h\u002F--help` with usage description.\n- Prefer env vars over positional arguments; define\u002Fdefault at the top.\n- Idempotency: multiple runs must produce the same state.\n- Add brief comments to `if\u002Felif\u002Felse` branches.\n\n### Target bash 3.2, not the one on your PATH\n\nmacOS ships `\u002Fbin\u002Fbash` **3.2.57** (2007 — Apple froze it at the last GPLv2\nrelease). A script that runs on your homebrew bash 5 can still be dead on\narrival for the user, and neither `bash -n` nor a test invoking bare `bash`\nwill tell you: both faults below passed the syntax check and ran clean on 5.\n\n| Don't (bash 4+)                 | Do (3.2-safe)                              |\n| ------------------------------- | ------------------------------------------ |\n| `${v^}` \u002F `${v,,}` case folding | `tr '[:lower:]' '[:upper:]'`               |\n| `declare -A map`                | parallel arrays, or a `case`               |\n| `mapfile -t a \u003C f`              | `while IFS= read -r l; do a+=(\"$l\"); done` |\n| `${v@Q}`                        | `printf '%q'`                              |\n| `cmd &>> log`                   | `cmd >> log 2>&1`                          |\n\n**The empty-array trap.** Under `set -u`, a bare `\"${arr[@]}\"` on an empty\narray is a *fatal* `unbound variable` on 3.2 — and fine on 4.4+. Use one of:\n\n```bash\n\"${arr[@]+\"${arr[@]}\"}\"          # expands to nothing when empty\n\"${arr[@]:-}\"                    # when one empty-string arg is acceptable\n[[ ${#arr[@]} -eq 0 ]] && return # or guard on the count first — this is safe\n```\n\nTwo of these shipped to users before the guard existed.\n`tests\u002Ftest_library_shell_bash32_compat.py` lints the table; hook tests\nparametrize over every bash on the host, so 3.2 is actually executed.\n\n## Makefiles\n\n- Mandatory `help` target as `.DEFAULT_GOAL`:\n  ```\n  @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = \":.*?## \"}; {printf \"\\033[36m%-18s\\033[0m %s\\n\", $$1, $$2}'\n  ```\n- Standard targets: `all`, `build`, `test`, `lint`, `clean`, `deps`, `help`.\n- Use `.PHONY` for all non-file targets.\n- Use variables for tools: `GO ?= go`, `DOCKER ?= docker`.\n- ANSI colors for status messages (green=success, yellow=warning, red=error).\n\n## Tools to use inside the scripts you write\n\nThis is about the code you author. It does **not** license calling these from\nBash for your own searching or reading, which stays under\n`dev_rule_tool_call_hygiene` — that rule names `bat`, `fd` and `eza -R` as the\nsame violation as the classics they replace.\n\n| Task        | Use   | Instead of     |\n| ----------- | ----- | -------------- |\n| Search text | `rg`  | `grep`         |\n| Find files  | `fd`  | `find`         |\n| View files  | `bat` | `cat`          |\n| List dirs   | `eza` | `ls`           |\n| JSON        | `jq`  | manual parsing |\n| YAML        | `yq`  | manual parsing |\n\nA script that ships needs each one guarded — `command -v rg >\u002Fdev\u002Fnull` — or\ndeclared as a dependency in its help text.\n\n## Anti-Patterns\n\n- Scripts without `set -euo pipefail` — silent failures hide bugs\n- Makefiles without `help` target — users can't discover available commands\n- Hardcoded tool paths — use env vars and `?=` defaults\n- Multi-line shell loops in Claude Code Bash calls — write as one-liners:\n  ```bash\n  # WRONG — Claude CLI parses each line as a separate command, generates garbage permissions:\n  for f in *.yaml\n  do\n    echo \"$f\"\n  done\n\n  # CORRECT — single command, one permission entry:\n  for f in *.yaml; do echo \"$f\"; done\n  ```\n","# Bash Mastery\n\nShell scripting, Makefile conventions, and modern CLI tooling.\n\n## When to Use\n\nScripting, Makefile, and CLI-tooling *craft* — not git plumbing (→ **git-mastery**)\nand not the Bash-vs-dedicated-tool choice (→ **tool-call-hygiene**, which decides\nwhether to shell out at all versus use Read\u002FGrep\u002FEdit). Reach here once you've\ndecided a shell script is the right tool and need it to be correct and portable.\n\n## Bash Scripts\n\n- Shebang: `#!\u002Fusr\u002Fbin\u002Fenv bash`\n- Always use `set -euo pipefail`.\n- Implement `-h\u002F--help` with usage description.\n- Prefer env vars over positional arguments; define\u002Fdefault at the top.\n- Idempotency: multiple runs must produce the same state.\n- Add brief comments to `if\u002Felif\u002Felse` branches.\n\n### Target bash 3.2, not the one on your PATH\n\nmacOS ships `\u002Fbin\u002Fbash` **3.2.57** (2007 — Apple froze it at the last GPLv2\nrelease). A script that runs on your homebrew bash 5 can still be dead on\narrival for the user, and neither `bash -n` nor a test invoking bare `bash`\nwill tell you: both faults below passed the syntax check and ran clean on 5.\n\n| Don't (bash 4+)                 | Do (3.2-safe)                              |\n| ------------------------------- | ------------------------------------------ |\n| `${v^}` \u002F `${v,,}` case folding | `tr '[:lower:]' '[:upper:]'`               |\n| `declare -A map`                | parallel arrays, or a `case`               |\n| `mapfile -t a \u003C f`              | `while IFS= read -r l; do a+=(\"$l\"); done` |\n| `${v@Q}`                        | `printf '%q'`                              |\n| `cmd &>> log`                   | `cmd >> log 2>&1`                          |\n\n**The empty-array trap.** Under `set -u`, a bare `\"${arr[@]}\"` on an empty\narray is a *fatal* `unbound variable` on 3.2 — and fine on 4.4+. Use one of:\n\n```bash\n\"${arr[@]+\"${arr[@]}\"}\"          # expands to nothing when empty\n\"${arr[@]:-}\"                    # when one empty-string arg is acceptable\n[[ ${#arr[@]} -eq 0 ]] && return # or guard on the count first — this is safe\n```\n\nTwo of these shipped to users before the guard existed.\n`tests\u002Ftest_library_shell_bash32_compat.py` lints the table; hook tests\nparametrize over every bash on the host, so 3.2 is actually executed.\n\n## Makefiles\n\n- Mandatory `help` target as `.DEFAULT_GOAL`:\n  ```\n  @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = \":.*?## \"}; {printf \"\\033[36m%-18s\\033[0m %s\\n\", $$1, $$2}'\n  ```\n- Standard targets: `all`, `build`, `test`, `lint`, `clean`, `deps`, `help`.\n- Use `.PHONY` for all non-file targets.\n- Use variables for tools: `GO ?= go`, `DOCKER ?= docker`.\n- ANSI colors for status messages (green=success, yellow=warning, red=error).\n\n## Tools to use inside the scripts you write\n\nThis is about the code you author. It does **not** license calling these from\nBash for your own searching or reading, which stays under\n`dev_rule_tool_call_hygiene` — that rule names `bat`, `fd` and `eza -R` as the\nsame violation as the classics they replace.\n\n| Task        | Use   | Instead of     |\n| ----------- | ----- | -------------- |\n| Search text | `rg`  | `grep`         |\n| Find files  | `fd`  | `find`         |\n| View files  | `bat` | `cat`          |\n| List dirs   | `eza` | `ls`           |\n| JSON        | `jq`  | manual parsing |\n| YAML        | `yq`  | manual parsing |\n\nA script that ships needs each one guarded — `command -v rg >\u002Fdev\u002Fnull` — or\ndeclared as a dependency in its help text.\n\n## Anti-Patterns\n\n- Scripts without `set -euo pipefail` — silent failures hide bugs\n- Makefiles without `help` target — users can't discover available commands\n- Hardcoded tool paths — use env vars and `?=` defaults\n- Multi-line shell loops in Claude Code Bash calls — write as one-liners:\n  ```bash\n  # WRONG — Claude CLI parses each line as a separate command, generates garbage permissions:\n  for f in *.yaml\n  do\n    echo \"$f\"\n  done\n\n  # CORRECT — single command, one permission entry:\n  for f in *.yaml; do echo \"$f\"; done\n  ```\n",{"name":5,"ai_hats":41,"license":15,"description":7},{"type":42,"schema_version":43},"skill",1,"master","f922a7f627276366873d546942d9ad899a86f71a","packages\u002Fai-hats-library\u002Fsrc\u002Fai_hats_library\u002Fexperimental\u002Fusage\u002Fskills\u002Fbash-mastery","https:\u002F\u002Fgithub.com\u002Fmuratovv\u002Fai-hats","https:\u002F\u002Fgithub.com\u002Fmuratovv","2026-11-05 20:59:10",{"source":8,"skillName":5,"commands":51,"prompt":61,"zipAvailable":62},[52,55,58],{"tool":53,"command":54},"npx","npx skills add muratovv\u002Fai-hats --skill bash-mastery",{"tool":56,"command":57},"bunx","bunx skills add muratovv\u002Fai-hats --skill bash-mastery",{"tool":59,"command":60},"pnpm","pnpm dlx skills add muratovv\u002Fai-hats --skill bash-mastery","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmuratovv\u002Fai-hats\u002Fblob\u002Fmaster\u002Fpackages\u002Fai-hats-library\u002Fsrc\u002Fai_hats_library\u002Fexperimental\u002Fusage\u002Fskills\u002Fbash-mastery\u002FSKILL.md",true,[],[65,89,114,132,155,169],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":36},"01M6PVFB1SM738R2SRSRSF7CY6","tool-evaluation-protocol","Time-bounded protocol for evaluating new tools, libraries, or methodologies before adoption. Use when evaluating a candidate dependency for the project, researching a methodology (e.g. ML\u002FLLM frameworks, testing approaches), or following up on a hype-driven recommendation.","https:\u002F\u002Fgithub.com\u002Fmuratovv\u002Fai-hats\u002Fblob\u002Fmaster\u002Fpackages\u002Fai-hats-library\u002Fsrc\u002Fai_hats_library\u002Fexperimental\u002Fusage\u002Fskills\u002Ftool-evaluation-protocol\u002FSKILL.md",[],[72,73,74,75,76,77,78,79,80,31,27,81,82,83,84,85,86,22,87,88],"protocol","Evaluation","tool","tool evaluation protocol","testing","ml","libraries","adoption","methodology","dependency","up","frameworks","time","project","recommendation","bounded","candidate",{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":36},"01M6PVF7HATBEX1G7N50E2QT57","systematic-debugging","4-phase bug-fix protocol (evidence, pattern, hypothesis, verify). Use when investigating any error, failure, or unexpected behavior, handling bug reports from users or monitoring, or diagnosing test failures with non-obvious causes.","https:\u002F\u002Fgithub.com\u002Fmuratovv\u002Fai-hats\u002Fblob\u002Fmaster\u002Fpackages\u002Fai-hats-library\u002Fsrc\u002Fai_hats_library\u002Fexperimental\u002Fusage\u002Fskills\u002Fsystematic-debugging\u002FSKILL.md",[],[96,97,98,99,72,100,101,102,103,104,27,105,106,107,108,109,110,111,112,113],"systematic debugging","debugging","systematic","test","monitoring","hypothesis","verify","behavior","fix","evidence","bug","reports","pattern","users","error","with","bug-fix","phase",{"skillNo":115,"name":116,"nameZh":6,"description":117,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":118,"categories":119,"keywords":120,"publishedAt":36},"01M6PVF3MTQN3RPF73AN34856J","skill-template","Canonical template and validation guide for ai-hats skills. Use when creating a new skill, reviewing an existing one for structural compliance, or deciding which pattern fits a new behavior.","https:\u002F\u002Fgithub.com\u002Fmuratovv\u002Fai-hats\u002Fblob\u002Fmaster\u002Fpackages\u002Fai-hats-library\u002Fsrc\u002Fai_hats_library\u002Fexperimental\u002Fusage\u002Fskills\u002Fskill-template\u002FSKILL.md",[],[121,122,123,124,125,103,126,27,127,108,128,129,130,22,131],"template","skill template","validation","compliance","hats","guide","new skill","structural","canonical","which","Existing",{"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":138,"publishedAt":36},"01M6PVF06SCV28QARM5MQPANC9","skill-optimization","Audit and refactor library components to eliminate redundancy and staleness. Use during periodic library maintenance, after adding multiple new skills or rules, when a role's token budget is too high, or after retrospectives identify component issues.","https:\u002F\u002Fgithub.com\u002Fmuratovv\u002Fai-hats\u002Fblob\u002Fmaster\u002Fpackages\u002Fai-hats-library\u002Fsrc\u002Fai_hats_library\u002Fexperimental\u002Fusage\u002Fskills\u002Fskill-optimization\u002FSKILL.md",[],[139,140,141,142,143,144,145,146,147,148,27,149,150,151,152,153,154],"Optimization","skill optimization","components","component","issues","library","audit","refactor","Budget","Rules","periodic","maintenance","token","token budget","role","high",{"skillNo":156,"name":157,"nameZh":6,"description":158,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":159,"categories":160,"keywords":161,"publishedAt":36},"01M6PVEXM9717016T9MW82HDCT","silent-fallback-gate","PreToolUse hook — refuses an Edit or Write that adds an inert broad except. Use when a Python edit was blocked for a silent fallback.","https:\u002F\u002Fgithub.com\u002Fmuratovv\u002Fai-hats\u002Fblob\u002Fmaster\u002Fpackages\u002Fai-hats-library\u002Fsrc\u002Fai_hats_library\u002Fexperimental\u002Fusage\u002Fskills\u002Fsilent-fallback-gate\u002FSKILL.md",[],[162,163,164,165,166,167,27,168,22],"gate","fallback","silent fallback gate","python","write","edit","hook",{"skillNo":170,"name":171,"nameZh":6,"description":172,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":173,"categories":174,"keywords":175,"publishedAt":36},"01M6PVESM49C5NT7SB7N3F76VS","retro-to-framework","Convert an observation about agent behavior — from a retrospective or from a single incident — into a framework-level change (hook, rule, skill, skill update). Use after a retrospective identifies problems that are not project-specific, after an incident where an agent misapplied a component it had read, when CLAUDE.md band-aids accumulate (more than 3 per-project rules that could be generic), or when the same problem recurs across multiple projects.","https:\u002F\u002Fgithub.com\u002Fmuratovv\u002Fai-hats\u002Fblob\u002Fmaster\u002Fpackages\u002Fai-hats-library\u002Fsrc\u002Fai_hats_library\u002Fexperimental\u002Fusage\u002Fskills\u002Fretro-to-framework\u002FSKILL.md",[],[176,177,178,179,142,180,181,182,148,103,27,183,184,85,185,186,187,188,189,190],"framework","retro","retro to framework","change","retrospective","projects","convert","incident","across","problem","about","more","skill update","single","generic"]