Back to Skills

applying-code-principles

verified

Fundamental software principles - SOLID, DRY, Occam's Razor, Miller's Law, YAGNI, Readable Code. Use when applying design principles, refactoring code, or when user mentions 原則, シンプル, 複雑, リファクタリング, 保守性, clean code, best practice.

View on GitHub

Marketplace

thkt-development-workflows

thkt/claude-config

Plugin

development-skills

Development Skills

Repository

thkt/claude-config
3stars

skills/applying-code-principles/SKILL.md

Last Verified

January 22, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/thkt/claude-config/blob/main/skills/applying-code-principles/SKILL.md -a claude-code --skill applying-code-principles

Installation paths:

Claude
.claude/skills/applying-code-principles/
Powered by add-skill CLI

Instructions

# Code Principles

## Priority Order

| Priority | Principle     | When to Apply                                  |
| -------- | ------------- | ---------------------------------------------- |
| 1        | Safety First  | Security, data integrity                       |
| 2        | YAGNI         | Don't build what you don't need                |
| 3        | Occam's Razor | Simplest solution                              |
| 4        | SOLID         | For complex systems                            |
| 5        | DRY           | Eliminate duplication (not at cost of clarity) |
| 6        | Miller's Law  | Respect 7±2 cognitive limit                    |

## Quick Checks

See CLAUDE.md Development Checks section (always loaded, single source of truth).

## Thresholds

| Target        | Ideal | Max | Limit |
| ------------- | ----- | --- | ----- |
| Function args | 3     | 5   | 7     |
| Class methods | 5     | 7   | 9     |
| Conditionals  | 3     | 5   | 7     |

## Rules

| Principle | Rule                                           |
| --------- | ---------------------------------------------- |
| DRY       | Abstract on 3rd duplication (Rule of Three)    |
| SOLID     | Interface only when 2nd implementation appears |
| YAGNI     | Build only if problem exists now               |
| Readable  | New team member understands in < 1 minute      |

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
1022 chars