applying-code-principles
Fundamental software principles - SOLID, DRY, Occam's Razor, Miller's Law, YAGNI, Readable Code. Triggers: 原則, シンプル, 複雑, アーキテクチャ, リファクタリング, 保守性, コード品質, design pattern, best practice, clean code
Installation
Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.
View source ↗GuidesSkill instructions
コード原則
優先順序
| 優先度 | 原則 | 適用場面 |
|---|---|---|
| 1 | 安全第一 | セキュリティ、データ整合性 |
| 2 | YAGNI | 不要なものは作らない |
| 3 | オッカムの剃刀 | 最もシンプルな解決 |
| 4 | SOLID | 複雑なシステム向け |
| 5 | DRY | 重複排除(明確性を犠牲にしない) |
| 6 | ミラーの法則 | 7±2の認知限界を尊重 |
クイックチェック
CLAUDE.md → 開発チェック を参照(常にロード、単一の情報源)。
閾値
| 対象 | 理想 | 最大 | 限界 |
|---|---|---|---|
| 関数引数 | 3 | 5 | 7 |
| クラスメソッド | 5 | 7 | 9 |
| 条件分岐 | 3 | 5 | 7 |
ルール
| 原則 | ルール |
|---|---|
| DRY | 3回目の重複で抽象化(3回ルール) |
| SOLID | 2番目の実装が現れたときのみインターフェース |
| YAGNI | 問題が今存在する場合のみ作る |
| 可読性 | 新しいチームメンバーが1分以内に理解できる |
Examples
Read the usage examples in the source repository.
View source ↗Source history
- Indexed on
- 2026-01-20
- Index updated
- 2026-01-26
- Branch
- main
Index and sync dates describe this directory. View the source repository for code history.
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!