cc-core-defensive

Guides minimal, evidence-based code modifications with scoped verification across languages.

1.0k|109|Updated Jan 4, 2026
One-click install
npx skills add https://github.com/doccker/cc-use-exp --skill cc-core-defensive
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cc-core-defensive
Source: https://github.com/doccker/cc-use-exp/tree/main/.codex/skills/cc-core-defensive
Command: npx skills add https://github.com/doccker/cc-use-exp --skill cc-core-defensive

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

When AI assistants modify existing code, they often over-engineer: adding unnecessary abstractions, swallowing errors for hypothetical risks, refactoring unrelated modules, or changing tests to fit broken implementations. This Skill enforces disciplined, minimal, evidence-driven code changes.

Core Features & Use Cases

  • Minimal Change Discipline: Prioritizes the smallest effective modification and reuses existing patterns before introducing new abstractions.
  • Real Boundary Handling: Distinguishes genuine edge cases (real inputs, external dependencies, async IO) from hypothetical risks that do not deserve defensive code.
  • Scoped Verification: Defines verification depth per change type, from local tests for small edits to syntax checks for config changes.
  • Use Case: When asking an AI to fix a bug in a cross-language project, this Skill prevents it from rewriting surrounding modules, modifying tests to mask errors, or adding unneeded fallback layers.

Quick Start

Apply the cc-core-defensive skill to fix this bug with the smallest possible change and verify only the affected code paths.

Frequently Asked Questions about cc-core-defensive

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

FAQPage Schema
How do I stop AI from over-engineering code changes?

Apply defensive coding rules that prioritize minimal effective changes, reuse of existing patterns, and local fixes over refactoring. This Skill instructs the AI to avoid new abstractions, error-swallowing wrappers, and容灾 states unless a real boundary justifies them.

How to control the scope of AI code modifications?

Define change boundaries by call chains and impact surfaces rather than file counts. The Skill requires reading relevant code paths first, making the minimal change, and explicitly justifying any scope expansion before implementing it.

Should AI modify tests to make failing code pass?

No. This Skill explicitly forbids modifying tests to适配 incorrect implementations. When root cause is unclear, the AI must gather more evidence instead of guessing or masking the failure.

When should defensive error handling be added to code?

Only for real boundaries: actual user input, external dependencies, async IO, or unstable interfaces. The Skill prohibits adding try-catch wrappers, fallback states, or validation layers for hypothetical risks without concrete evidence.

What verification is needed after a small code change?

Small changes need local tests, syntax checks, or minimal command verification; config changes need structural validation; behavior fixes should re-test the original problem path. If verification is impossible, the reason and risks must be stated.

When is this defensive coding skill not applicable?

It does not cover language or framework-specific details, formal code review workflows, structured debugging processes, or production/system-level operational safety. Use dedicated skills for those scenarios.