[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7F667ZG3DTKS9TC9VY2GSC4":3,"skill-same:01M7F667ZG3DTKS9TC9VY2GSC4":50},{"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":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":29,"install":30,"resources":43},"01M7F667ZG3DTKS9TC9VY2GSC4","bash-defensive-patterns",null,"Master defensive Bash programming techniques for production-grade scripts. Use when writing robust shell scripts, CI\u002FCD pipelines, or system utilities requiring fault tolerance and safety.","carsimax\u002Fconstruct","carsimax","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F42248429?v=4","01M7F6660B38RMTKRYJ2DQM39T","Maximiliano Carsi","01M7F6661MDPBN2351WPZNV6CT",1,"MIT","https:\u002F\u002Fgithub.com\u002Fcarsimax\u002Fconstruct\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fbash-defensive-patterns\u002FSKILL.md",[],[],"2026-11-16 10:05:34",false,"---\nname: bash-defensive-patterns\ndescription: Master defensive Bash programming techniques for production-grade scripts. Use when writing robust shell scripts, CI\u002FCD pipelines, or system utilities requiring fault tolerance and safety.\n---\n\n# Bash Defensive Patterns\n\nComprehensive guidance for writing production-ready Bash scripts using defensive programming techniques, error handling, and safety best practices to prevent common pitfalls and ensure reliability.\n\n## When to Use This Skill\n\n- Writing production automation scripts\n- Building CI\u002FCD pipeline scripts\n- Creating system administration utilities\n- Developing error-resilient deployment automation\n- Writing scripts that must handle edge cases safely\n- Building maintainable shell script libraries\n- Implementing comprehensive logging and monitoring\n- Creating scripts that must work across different platforms\n\n## Detailed patterns and worked examples\n\nDetailed pattern documentation lives in `references\u002Fdetails.md`. Read that file when the navigation tier above is insufficient.\n\n## Best Practices Summary\n\n1. **Always use strict mode** - `set -Eeuo pipefail`\n2. **Quote all variables** - `\"$variable\"` prevents word splitting\n3. **Use [[]] conditionals** - More robust than [ ]\n4. **Implement error trapping** - Catch and handle errors gracefully\n5. **Validate all inputs** - Check file existence, permissions, formats\n6. **Use functions for reusability** - Prefix with meaningful names\n7. **Implement structured logging** - Include timestamps and levels\n8. **Support dry-run mode** - Allow users to preview changes\n9. **Handle temporary files safely** - Use mktemp, cleanup with trap\n10. **Design for idempotency** - Scripts should be safe to rerun\n11. **Document requirements** - List dependencies and minimum versions\n12. **Test error paths** - Ensure error handling works correctly\n13. **Use `command -v`** - Safer than `which` for checking executables\n14. **Prefer printf over echo** - More predictable across systems\n","# Bash Defensive Patterns\n\nComprehensive guidance for writing production-ready Bash scripts using defensive programming techniques, error handling, and safety best practices to prevent common pitfalls and ensure reliability.\n\n## When to Use This Skill\n\n- Writing production automation scripts\n- Building CI\u002FCD pipeline scripts\n- Creating system administration utilities\n- Developing error-resilient deployment automation\n- Writing scripts that must handle edge cases safely\n- Building maintainable shell script libraries\n- Implementing comprehensive logging and monitoring\n- Creating scripts that must work across different platforms\n\n## Detailed patterns and worked examples\n\nDetailed pattern documentation lives in `references\u002Fdetails.md`. Read that file when the navigation tier above is insufficient.\n\n## Best Practices Summary\n\n1. **Always use strict mode** - `set -Eeuo pipefail`\n2. **Quote all variables** - `\"$variable\"` prevents word splitting\n3. **Use [[]] conditionals** - More robust than [ ]\n4. **Implement error trapping** - Catch and handle errors gracefully\n5. **Validate all inputs** - Check file existence, permissions, formats\n6. **Use functions for reusability** - Prefix with meaningful names\n7. **Implement structured logging** - Include timestamps and levels\n8. **Support dry-run mode** - Allow users to preview changes\n9. **Handle temporary files safely** - Use mktemp, cleanup with trap\n10. **Design for idempotency** - Scripts should be safe to rerun\n11. **Document requirements** - List dependencies and minimum versions\n12. **Test error paths** - Ensure error handling works correctly\n13. **Use `command -v`** - Safer than `which` for checking executables\n14. **Prefer printf over echo** - More predictable across systems\n",{"name":5,"description":7},"main","22badcb55851e82eb81a14d18204460bd3881d4a",".agents\u002Fskills\u002Fbash-defensive-patterns","https:\u002F\u002Fgithub.com\u002Fcarsimax\u002Fconstruct","https:\u002F\u002Fgithub.com\u002Fcarsimax","2026-10-30 09:50:40",{"source":8,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add carsimax\u002Fconstruct --skill bash-defensive-patterns",{"tool":36,"command":37},"bunx","bunx skills add carsimax\u002Fconstruct --skill bash-defensive-patterns",{"tool":39,"command":40},"pnpm","pnpm dlx skills add carsimax\u002Fconstruct --skill bash-defensive-patterns","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fcarsimax\u002Fconstruct\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fbash-defensive-patterns\u002FSKILL.md",true,[44],{"path":45,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":48,"sourceHtmlUrl":49},"references\u002Fdetails.md","REFERENCE","参考文档",9770,"https:\u002F\u002Fgithub.com\u002Fcarsimax\u002Fconstruct\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fbash-defensive-patterns\u002Freferences\u002Fdetails.md",[51,58,65,72,79,86],{"skillNo":52,"name":53,"nameZh":6,"description":54,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":55,"categories":56,"keywords":57,"publishedAt":19},"01M7F69PT3SMFA4AEETFGW0WFH","workflow","The ADD protocol for every implementation request, feature plan, resume, task sizing, and the closing Risk line.","https:\u002F\u002Fgithub.com\u002Fcarsimax\u002Fconstruct\u002Fblob\u002Fmain\u002Fplugins\u002Fconstruct\u002Fskills\u002Fworkflow\u002FSKILL.md",[],[],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":19},"01M7F69J7R3HG57HMVY7QNQNX8","sources","Ground version-dependent code in official documentation. Use when you name a specific uncertainty about a library or framework API, a version-dependent pattern, or a deprecation. Skip when the repository already shows the pattern.","https:\u002F\u002Fgithub.com\u002Fcarsimax\u002Fconstruct\u002Fblob\u002Fmain\u002Fplugins\u002Fconstruct\u002Fskills\u002Fsources\u002FSKILL.md",[],[],{"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":19},"01M7F69CZ1YC0WHK90EV82CB1M","review","Mandatory outside review of high-risk work units, by lens agents the hooks feed and record, plus the dual blind review on request. Trigger: a unit whose Risk names an item is ready to publish, the publication gate denied a push, PR, or release, or the user asks for a review, a dual review, or an adversarial review.","https:\u002F\u002Fgithub.com\u002Fcarsimax\u002Fconstruct\u002Fblob\u002Fmain\u002Fplugins\u002Fconstruct\u002Fskills\u002Freview\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":19},"01M7F699XTX8F3PNZB0P86XH44","migration","Plan and verify risky migrations and removals. Use when changing a schema or stored data, removing or renaming a public API, flag, config format, or export, replacing a system, or when the task's Risk names item 1 or 3.","https:\u002F\u002Fgithub.com\u002Fcarsimax\u002Fconstruct\u002Fblob\u002Fmain\u002Fplugins\u002Fconstruct\u002Fskills\u002Fmigration\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M7F6953SF387B7GX75V6MXE0","delivery","Plan commits, branches, and pull requests as reviewable units. Use when deciding commit contents, opening or preparing a PR, splitting large work into sub-branches of a feature branch, or preparing a release.","https:\u002F\u002Fgithub.com\u002Fcarsimax\u002Fconstruct\u002Fblob\u002Fmain\u002Fplugins\u002Fconstruct\u002Fskills\u002Fdelivery\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M7F68YK43AQ6BM0KQPN0BVP4","delegation","When and how the ADD orchestrator delegates to construct agents: role mapping, allowed edit surfaces, parallel writers, verifier timing, handoff prompts, and relaying a subagent's blocking question or choice menu. Trigger: deciding to delegate, launching an agent, writing a handoff, or a subagent or tool returns a question, menu, or consent request.","https:\u002F\u002Fgithub.com\u002Fcarsimax\u002Fconstruct\u002Fblob\u002Fmain\u002Fplugins\u002Fconstruct\u002Fskills\u002Fdelegation\u002FSKILL.md",[],[]]