[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6JGKYZCTCHF2R3BY82JC7CX":3,"skill-same:01M6JGKYZCTCHF2R3BY82JC7CX":62},{"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":41,"commitSha":42,"skillDirectory":43,"forksCount":44,"repositoryHtmlUrl":45,"repositoryHomepageUrl":6,"ownerHtmlUrl":46,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":47,"install":48,"resources":61},"01M6JGKYZCTCHF2R3BY82JC7CX","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\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\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,"license":15,"description":7},"master","b4819add93efbaf4d80627118ec34680406b309b","packages\u002Fai-hats-library\u002Fsrc\u002Fai_hats_library\u002Fusage\u002Fskills\u002Fbash-mastery",1,"https:\u002F\u002Fgithub.com\u002Fmuratovv\u002Fai-hats","https:\u002F\u002Fgithub.com\u002Fmuratovv","2026-11-05 20:59:10",{"source":8,"skillName":5,"commands":49,"prompt":59,"zipAvailable":60},[50,53,56],{"tool":51,"command":52},"npx","npx skills add muratovv\u002Fai-hats --skill bash-mastery",{"tool":54,"command":55},"bunx","bunx skills add muratovv\u002Fai-hats --skill bash-mastery",{"tool":57,"command":58},"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\u002Fusage\u002Fskills\u002Fbash-mastery\u002FSKILL.md",true,[],[63,87,112,135,159,173],{"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":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",[],[70,71,72,73,74,75,76,77,78,31,27,79,80,81,82,83,84,22,85,86],"protocol","Evaluation","tool","tool evaluation protocol","testing","ml","libraries","adoption","methodology","dependency","up","frameworks","time","project","recommendation","bounded","candidate",{"skillNo":88,"name":89,"nameZh":6,"description":90,"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":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",[],[94,95,96,97,70,98,99,100,101,102,27,103,104,105,106,107,108,109,110,111],"systematic debugging","debugging","systematic","test","monitoring","hypothesis","verify","behavior","fix","evidence","bug","reports","pattern","users","error","with","bug-fix","phase",{"skillNo":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":116,"categories":117,"keywords":123,"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",[118],{"categoryNo":119,"categoryName":120,"taxonomyType":121,"taxonomyTypeDesc":122},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[124,125,126,127,128,101,129,27,130,106,131,132,133,22,134],"template","skill template","validation","compliance","hats","guide","new skill","structural","canonical","which","Existing",{"skillNo":136,"name":137,"nameZh":6,"description":138,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":139,"categories":140,"keywords":142,"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",[141],{"categoryNo":119,"categoryName":120,"taxonomyType":121,"taxonomyTypeDesc":122},[143,144,145,146,147,148,149,150,151,152,27,153,154,155,156,157,158],"Optimization","skill optimization","components","component","issues","library","audit","refactor","Budget","Rules","periodic","maintenance","token","token budget","role","high",{"skillNo":160,"name":161,"nameZh":6,"description":162,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":163,"categories":164,"keywords":165,"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",[],[166,167,168,169,170,171,27,172,22],"gate","fallback","silent fallback gate","python","write","edit","hook",{"skillNo":174,"name":175,"nameZh":6,"description":176,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":177,"categories":178,"keywords":180,"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",[179],{"categoryNo":119,"categoryName":120,"taxonomyType":121,"taxonomyTypeDesc":122},[181,182,183,184,146,185,186,187,152,101,27,188,189,83,190,191,192,193,194,195],"framework","retro","retro to framework","change","retrospective","projects","convert","incident","across","problem","about","more","skill update","single","generic"]