Agent skill
applying-code-principles
Fundamental software principles - SOLID, DRY, Occam's Razor, Miller's Law, YAGNI, Readable Code. Triggers: 原則, シンプル, 複雑, アーキテクチャ, リファクタリング, 保守性, コード品質, design pattern, best practice, clean code
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/applying-code-principles
SKILL.md
コード原則
優先順序
| 優先度 | 原則 | 適用場面 |
|---|---|---|
| 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分以内に理解できる |
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?