Claude Marketplaces
SkillsMCP serversMarketplacesDigestTools
Submit

This week in Claude

Every Monday: Claude Code, Agent SDK, MCP, and the Anthropic platform moves worth your time.

Skills by category
Frontend DevelopmentBackend & APIsTesting & QASecurityDevOps & CI/CDGit & Pull RequestsDocumentationCode Review & QualityAI & Agent BuildingSkill Development
MCP servers by category
Sales & MarketingWeb & Browser AutomationDatabasesAI & LLM ToolsCloud & InfrastructureCommunication & MessagingDeveloper ToolsDesign & CreativeDocuments & KnowledgeSearch & Web Crawling
Marketplaces by category
AI Agents & OrchestrationLLM IntegrationDevelopment ToolsFrontend & UIBackend & APIsDatabasesTesting & Code QualityDevOps & CloudSecurity & ComplianceGit & Version Control
Claude Marketplaces

An independent directory of skills, plugins and MCP servers for Claude Code. Not affiliated with Anthropic.

Browse

  • Skills
  • MCP servers
  • Marketplaces
  • Weekly digest
  • Skill index
  • MCP index
  • Marketplace index

Site

  • About
  • Tools
  • Submit
  • Feedback
  • Privacy
  • llms.txt
  • Plugins reference

Maker

  • Snug
  • Agent Caffeine
  • knobs
  • Wax
  • Vectoys
  • mertduzgun.com
Crafted at
Skills/DevOps & CI/CD
wshobson avatar

Bash Defensive Patterns

wshobson/agents

Built for developers who've been burned by shell scripts failing in production. Implements bash strict mode, proper error trapping, and variable quoting patterns that prevent the usual disasters. Covers atomic file operations, signal handling for background processes, and idempotent script design. The argument parsing and logging templates alone will save you from reinventing wheels. Most valuable for CI/CD pipelines and system automation where a script failure at 2 AM costs real money. Takes the guesswork out of defensive bash programming with patterns that actually work in the wild.

installs
13.5K
GitHub stars
41.8K
last updated
Aug 21, 2026
View on GitHubSave

Install

$ npx -y skills add wshobson/agents --skill bash-defensive-patterns --agent claude-code

Installs into .claude/skills of the current project.

Files

Bash Defensive Patterns

Comprehensive guidance for writing production-ready Bash scripts using defensive programming techniques, error handling, and safety best practices to prevent common pitfalls and ensure reliability.

When to Use This Skill

  • Writing production automation scripts
  • Building CI/CD pipeline scripts
  • Creating system administration utilities
  • Developing error-resilient deployment automation
  • Writing scripts that must handle edge cases safely
  • Building maintainable shell script libraries
  • Implementing comprehensive logging and monitoring
  • Creating scripts that must work across different platforms

Detailed patterns and worked examples

Detailed pattern documentation lives in references/details.md. Read that file when the navigation tier above is insufficient.

Best Practices Summary

  1. Always use strict mode - set -Eeuo pipefail
  2. Quote all variables - "$variable" prevents word splitting
  3. Use [[]] conditionals - More robust than [ ]
  4. Implement error trapping - Catch and handle errors gracefully
  5. Validate all inputs - Check file existence, permissions, formats
  6. Use functions for reusability - Prefix with meaningful names
  7. Implement structured logging - Include timestamps and levels
  8. Support dry-run mode - Allow users to preview changes
  9. Handle temporary files safely - Use mktemp, cleanup with trap
  10. Design for idempotency - Scripts should be safe to rerun
  11. Document requirements - List dependencies and minimum versions
  12. Test error paths - Ensure error handling works correctly
  13. Use command -v - Safer than which for checking executables
  14. Prefer printf over echo - More predictable across systems
SKILL.md on GitHub

Sponsors

SnugThe clipboard manager you and your agent can use, safelyAgent CaffeineClose your lid, come back to finished workWaxBlock anything with supervision, without erasing your iPhoneOpen StepsSponsoredFree and open-source skills that make AI coding agents easier to understand, verify, and control.

Details

Repository
github.com/wshobson/agents
Categories
DevOps & CI/CD, Documentation, CLI & Terminal

More from wshobson/agents

All 174
  • Debugging Strategies13.5K
  • Stripe Integration13.5K
  • Python Anti Patterns13.4K
  • Microservices Patterns13.3K
  • Web Component Design13.3K
  • Langchain Architecture13.2K
  • Secrets Management13.2K
  • Gitlab Ci Patterns13.2K
  • Grafana Dashboards13.2K
  • Python Packaging13K
  • Llm Evaluation12.9K
  • Protocol Reverse Engineering12.8K
  • Python Type Safety12.8K
  • React Modernization12.7K
  • Startup Financial Modeling12.7K
  • Wcag Audit Patterns12.6K
  • Workflow Orchestration Patterns12.1K
  • Unity Ecs Patterns12.1K
  • Helm Chart Scaffolding12.1K
  • Python Resilience11.9K
  • Memory Safety Patterns11.8K
  • Market Sizing Analysis11.8K
  • Gitops Workflow11.8K
  • Python Observability11.6K

Recommended

More DevOps & CI/CD
1resend avatarresend-cliresend/resend-skillsOperate the Resend platform from the terminal — send emails (including React Email .tsx templates via --react-email), manage domains, contacts, broadcasts, temp13.4Kinstalls
2tw93 avatarkamitw93/kamiTypeset professional documents and product landing pages: resumes, one-pagers, white papers, letters, portfolios, slide decks, landing pages. Warm parchment, in13.3Kinstalls
3antfu avatarturborepoantfu/skillsTurborepo monorepo build system guidance. Triggers on: turbo.json, task pipelines, dependsOn, caching, remote cache, the "turbo" CLI, --filter, --affected, CI o13.3Kinstalls
4wshobson avatarsecrets-managementwshobson/agentsImplement secure secrets management for CI/CD pipelines using Vault, AWS Secrets Manager, or native platform solutions. Use when handling sensitive credentials,13.2Kinstalls
5github avatargame-enginegithub/awesome-copilotExpert skill for building web-based game engines and games using HTML5, Canvas, WebGL, and JavaScript. Use when asked to create games, build game engines, imple13.2Kinstalls
6github avatarpenpot-uiux-designgithub/awesome-copilotComprehensive guide for creating professional UI/UX designs in Penpot using MCP tools. Use this skill when: (1) Creating new UI/UX designs for web, mobile, or d12.8Kinstalls