cc-code-quality-principles

Reviews module design against six classic modularity principles during coding and code review.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

When designing new modules, refactoring, or reviewing code, engineers often lack a consistent checklist to catch structural problems like deep call chains, excessive dependencies, and inconsistent API contracts before they become technical debt.

Core Features & Use Cases

  • Six-Principle Checklist: Covers module size, call depth, fan-in/fan-out, interface boundaries, scope cohesion, and predictability with concrete thresholds (e.g., call depth ≤ 3, fan-out ≤ 5).
  • Detailed Anti-Pattern References: Provides Go, Java, TypeScript, and Python examples of bad and good designs for call depth, fan-out, unified Result types, idempotency keys, and side-effect isolation.
  • PR Review Checklist: A ready-to-use checklist for reviewing new modules covering size, depth, fan-out, boundaries, scope, idempotency, and implicit dependencies.
  • Use Case: When asked to design a new order service or review a pull request, the skill walks through each principle, flags a 6-layer call chain or a service with 8 injected dependencies, and suggests event-driven decoupling or facade patterns.

Quick Start

Ask the AI to review this new module design against the six modularity principles and list any violations with fixes.

Frequently Asked Questions about cc-code-quality-principles

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

FAQPage Schema
How do I review code for modularity and design quality?

Use the six-principle checklist covering module size, call depth, fan-in/fan-out, interface boundaries, scope cohesion, and predictability. Each principle has measurable thresholds, such as call depth at or below 3 layers and fan-out at or below 5 dependencies.

What is a healthy call stack depth in service design?

A call depth of 1-3 layers is healthy, 4-5 layers is acceptable but worth watching, and 6 or more layers is a design smell. Fix deep chains with guard clauses, merging pass-through adapter layers, event-driven decoupling, and dependency inversion.

How do I reduce fan-out in a service class?

Extract a core service that depends only on repositories and domain logic, move notifications, auditing, caching, and metrics to event listeners, and use a facade to collapse multiple related services into one entry point for callers.

How do I make write operations idempotent against retries?

Require an idempotency key on every write operation and back it with a database unique constraint or INSERT ON CONFLICT semantics. Pass the same key to downstream payment gateways so duplicate requests return the original result instead of executing twice.

When should I not use this modularity checklist?

This skill is a decision framework and checklist, not an executor. For concrete enforcement of file size limits, refactoring safety, time zone handling, or API contract rules, it delegates to specialized skills like cc-size-check and cc-refactor-safety.