npx claudepluginhub aimskr/aims-claude-toolkit --plugin aims-toolkitWant just this skill?
Then install: npx claudepluginhub u/[userId]/[slug]
코드 단순화, 복잡도 감소, 심플리파이, 가독성, KISS, 중첩 제거 - Simplifies overly complex code by reducing nesting, cyclomatic complexity, and unnecessary abstractions. Use when code exceeds complexity limits (nesting >3, function >50 lines) or after insight/review reports flag complexity. Do NOT use for full code reviews (use code-reviewer) or dead code removal (use refactor-cleaner).
This skill uses the workspace's default tool permissions.
Code Simpler - Complexity Reducer
Simplify overly complex code while preserving correctness.
When to Use
- Insight 리포트에서 복잡도 지적이 나왔을 때
- 중첩이 깊은 코드 (3단계 이상)
- 함수가 50줄을 초과할 때
- 불필요한 추상화가 감지될 때
- 조건문이 과도하게 복잡할 때
Simplification Techniques
1. Early Return (Guard Clause)
// Before: deeply nested
function process(data) {
if (data) {
if (data.isValid) {
if (data.items.length > 0) {
// actual logic
}
}
}
}
// After: flat
function process(data) {
if (!data) return;
if (!data.isValid) return;
if (data.items.length === 0) return;
// actual logic
}
2. Extract Method (Long Functions)
Split when a function does more than one thing:
- Each function = one responsibility
- Name describes WHAT, not HOW
- Max 50 lines per function
3. Remove Unnecessary Abstraction
// Before: premature abstraction
class UserValidatorFactory {
create(type) { return new UserValidator(type); }
}
// After: direct usage (if only one validator exists)
function validateUser(user) { ... }
4. Simplify Conditionals
// Before: complex boolean
if (user.age >= 18 && user.hasLicense && !user.isBanned && user.country === 'KR')
// After: named condition
const canDrive = user.age >= 18 && user.hasLicense && !user.isBanned;
const isKorean = user.country === 'KR';
if (canDrive && isKorean)
5. Replace Loop with Declarative
// Before: imperative
const results = [];
for (const item of items) {
if (item.active) {
results.push(item.name);
}
}
// After: declarative
const results = items.filter(i => i.active).map(i => i.name);
6. Flatten Callback Hell
Replace nested callbacks/promises with async/await or pipeline.
Process
1. Identify complexity (insight report or manual scan)
↓
2. Measure: nesting depth, function length, cyclomatic complexity
↓
3. Apply simplification technique (one at a time)
↓
4. Verify: behavior unchanged, tests still pass
↓
5. Repeat until within limits
Complexity Limits
| Metric | Limit | Action |
|---|---|---|
| Nesting depth | 3 levels | Apply early return |
| Function length | 50 lines | Extract method |
| Cyclomatic complexity | 10 | Split into smaller functions |
| File length | 200 lines | Split into modules |
| Parameters | 4 | Use object parameter |
Principles
- One change at a time - simplify incrementally
- Preserve behavior - never change what the code does
- Verify with tests - run tests after each simplification
- Don't over-simplify - 3 similar lines > premature abstraction
- KISS - the simplest correct solution is the best
문서화 (작업 완료 후 자동 실행)
작업 완료 시 auto-documenter를 호출하여 프로젝트 문서를 업데이트한다.
Completion
모든 복잡도 지표가 한도 이내이고 테스트가 통과하면 완료.
Troubleshooting
Simplification breaks tests: Revert immediately. The simplification changed behavior, not just structure. Re-analyze before retrying. Unclear if abstraction is "unnecessary": Check usage count. If used once → likely unnecessary. If used 3+ times → keep it. Team disagrees on complexity threshold: Defer to project’s existing conventions. If none exist, propose thresholds and get team consensus before applying.
Similar Skills
Activates when the user asks about AI prompts, needs prompt templates, wants to search for prompts, or mentions prompts.chat. Use for discovering, retrieving, and improving prompts.
Search, retrieve, and install Agent Skills from the prompts.chat registry using MCP tools. Use when the user asks to find skills, browse skill catalogs, install a skill for Claude, or extend Claude's capabilities with reusable AI agent components.
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.