applying-code-principles

Apply SOLID, DRY, YAGNI, and related principles to code reviews and refactoring.

11|1|Updated Aug 6, 2025
One-click install
npx skills add https://github.com/thkt/claude-config --skill applying-code-principles
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: applying-code-principles
Source: https://github.com/thkt/claude-config/tree/main/ja/skills/applying-code-principles
Command: npx skills add https://github.com/thkt/claude-config --skill applying-code-principles

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

SOLID/DRY/YAGNI等の原則を、プロジェクト固有の優先順位で適用します。

Core Features & Use Cases

  • SRP/OCP/LSP/ISP/DIPの適用判断
  • DRYと過剰抽象化の回避
  • YAGNIとOccam's Razorを用いた設計選択

Quick Start

「Codeは安全でシンプルに」を最優先に、設計の選択基準を導入します。

Frequently Asked Questions about applying-code-principles

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

FAQPage Schema
How do I apply SOLID principles to improve code design?

SOLID principles—Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, Dependency Inversion—guide class and module design. This Skill evaluates when to apply each principle based on your project's safety and simplicity priorities, helping you make informed refactoring and architectural decisions without over-engineering.

What's the difference between DRY and over-abstraction?

DRY (Don't Repeat Yourself) eliminates code duplication, but excessive abstraction creates unnecessary complexity. This Skill balances DRY with Occam's Razor and YAGNI to help you avoid premature generalization while maintaining code maintainability and safety.

When should I use YAGNI and Occam's Razor in design decisions?

YAGNI (You Aren't Gonna Need It) and Occam's Razor prioritize simplicity by avoiding speculative features and unnecessary complexity. This Skill applies these principles to code reviews, component integration, and design-pattern selection, ensuring your codebase stays minimal and focused on actual requirements.

How do I decide between design patterns for a component?

Design-pattern selection balances safety, simplicity, and architectural fit. This Skill uses Quick Decision Questions and principle-based rationale to guide pattern choices for class redesigns and component integration, producing concrete guidance tailored to your project's constraints.

Can I apply these principles across teams and different projects?

Yes. This Skill handles code reviews, refactoring planning, and complexity evaluation across multiple projects and team structures. It enforces a consistent, project-specific priority order—Safety First, YAGNI, Occam's Razor, SOLID, DRY, Miller's Law—ensuring coherent architectural decisions at scale.

What should I prioritize when multiple design principles conflict?

When principles conflict, this Skill enforces a fixed priority: Safety First, then YAGNI, Occam's Razor, SOLID, DRY, and Miller's Law. This order resolves trade-offs consistently, ensuring safe, simple designs in code reviews and refactoring decisions.