cc-defensive-programming
Applies Code Complete's defensive programming rules: barricade design, assertion vs error-handling selection, input validation policy, and correctness-vs-robustness strategy for the current context.
cc-pseudocode-programming
Structures routine design through pseudocode-first iteration: clarifies naming and purpose before any code, catches design flaws cheaply, and prevents compile-debug loops on poorly understood routines.
Full skill instructions
Design a routine in pseudocode before writing it. Iterating on intent is cheaper than iterating on code, and four questions catch the expensive mistakes early:
| Question | Why |
|---|---|
| Can you name it clearly? | Naming difficulty signals an unclear design — clarify purpose first |
| Is there pseudocode before the code? | Refining pseudocode is cheaper than refining code |
| Do you understand why it works? | Working code you can't explain probably doesn't really work |
| Did you consider an alternative? | The first design is rarely the best |
If the user asks to skip pseudocode, comply or surface the tradeoff once (the routine will likely cost more in debugging) — don't refuse.
Shared CC vocabulary and thresholds (cohesion, parameters, routine length): Read(${CLAUDE_PLUGIN_ROOT}/references/cc-foundations.md).
Skip the process only when one of these holds:
getValue()/setName() with no validation, transformation, or side effects.A routine you're debating as "trivial enough" is not trivial — design it.
Guide routine design with the Pseudocode Programming Process. Produces pseudocode design, header comments, and an implementation plan.
"Convinced it's correct" means you can mentally trace every path — happy, error, edge — and explain why each produces the right output. "It looks right" is not convinced.
Pseudocode at the level of intent, no target-language syntax:
If another resource is available
Allocate a dialog box structure
If a dialog box structure could be allocated
Note that one more resource is in use
Initialize the resource
Store the resource number at the location provided by the caller
Return success
Endif
Endif
Return failure
This reads as English, becomes excellent comments, and is precise enough to generate code from. The anti-pattern instead writes *hRsrcPtr, malloc(), return 1 — target-language detail that focuses on HOW, exposes implementation, and makes poor comments.
Verify the produced pseudocode and resulting routine. Checklist: Read(${CLAUDE_SKILL_DIR}/checklists.md). Assess the artifacts:
| After | Next |
|---|---|
| Pseudocode complete | Read(${CLAUDE_PLUGIN_ROOT}/skills/cc-routine-and-class-design/SKILL.md) |
| Implementation done | Read(${CLAUDE_PLUGIN_ROOT}/skills/cc-defensive-programming/SKILL.md) |
Applies Code Complete's defensive programming rules: barricade design, assertion vs error-handling selection, input validation policy, and correctness-vs-robustness strategy for the current context.
Transforms complex code by applying APOSD's pull-complexity-downward principle: resolves error hierarchies, collapses configuration, and moves caller-side logic into modules. Produces edited code, not just assessment.
Guides safe refactoring using Code Complete's fix-first-then-refactor discipline: decides between refactor, rewrite, and fix-first; enforces separate commits; applies small-change rigor to high-error-rate one-liners.
Guides module and API design using APOSD principles: generates multiple design alternatives, compares them on information hiding and interface depth, and produces a documented design decision.
Assesses existing module and interface design for complexity symptoms: information leakage, shallow interfaces, pass-through layers, and unknown unknowns. Produces a structured assessment — not transformations.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience