cc-defensive-programming

Audit code against a 24-item defensive programming checklist.

351|31|Updated Jan 9, 2026
One-click install
npx skills add https://github.com/ryanthedev/code-foundations --skill cc-defensive-programming
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cc-defensive-programming
Source: https://github.com/ryanthedev/code-foundations/tree/main/skills/cc-defensive-programming
Command: npx skills add https://github.com/ryanthedev/code-foundations --skill cc-defensive-programming

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps teams enforce defensive programming best practices by auditing code against a comprehensive 24-item checklist to catch issues like empty catch blocks, unvalidated input, and incorrect assertion usage.

Core Features & Use Cases

  • A 24-item defensive programming checklist that guides reviewers through input validation, error handling, and barricade design.
  • Guidance on when to use assertions vs. error handling, and how to triage defects in crisis situations.
  • A structured pattern reuse gate to promote consistent error-handling strategies across modules.

Quick Start

Load the cc-defensive-programming skill and run the CHECKER mode against your codebase. Review the resulting VIOLATION/WARNING/PASS statuses to identify critical issues and recommended improvements.

Frequently Asked Questions about cc-defensive-programming

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I audit my codebase for defensive programming practices?

You can audit defensive programming by running a 24-item checklist against your production code to evaluate error handling, input validation, and exception patterns. The review outputs VIOLATION, WARNING, or PASS statuses to pinpoint critical robustness issues.

When should I use assertions vs error handling in production code?

Assertions verify internal invariants during development, while error handling manages runtime failures in production. This Skill applies a structured decision framework to enforce correct usage boundaries, preventing assertion misuse in live services.

What is the best way to triage defects during a crisis situation?

Crisis triage requires a structured decision framework to prioritize defects based on risk controls and barricade design. This Skill guides reviewers through crisis triage to isolate failures and evaluate documented risk controls.

How do I enforce consistent error handling patterns across modules?

You enforce consistent error handling by applying a pattern reuse gate across modules within your codebase. This ensures uniform exception strategies and barricade design, reducing scattered or incorrect defensive coding implementations.

Does this defensive programming checklist work for auditing libraries and services?

Yes, the defensive programming checklist applies to production code bases, libraries, and services where correctness, robustness, and barricade design matter. It audits unvalidated input and empty catch blocks across these environments.

Why does my code review miss empty catch blocks and unvalidated input?

Code reviews miss empty catch blocks and unvalidated input without a standardized auditing process. Applying a 24-item defensive coding checklist enforces structured validation checks to catch these specific robustness failures.