{"id":"683cb8a4-b2d2-4b44-8c5c-52ea35fb1650","shortId":"wqfLGs","kind":"skill","title":"code-simplifier","tagline":"Simplifies and refines code for clarity, consistency, and maintainability while preserving all functionality. Use when the user needs to: (1) Simplify complex code, (2) Improve code readability, (3) Refactor for maintainability, (4) Apply coding standards, (5) Review and optimize","description":"# Code Simplifier\n\nExpert code simplification specialist focused on enhancing code clarity, consistency, and maintainability while preserving exact functionality.\n\n## Overview\n\nYou are an expert code simplification specialist focused on enhancing code clarity, consistency, and maintainability while preserving exact functionality. Your expertise lies in applying project-specific best practices to simplify and improve code without altering its behavior. You prioritize readable, explicit code over overly compact solutions.\n\n## Core Principles\n\n### 1. Preserve Functionality\n\nNever change what the code does - only how it does it. All original features, outputs, and behaviors must remain intact.\n\n### 2. Apply Project Standards\n\nFollow the established coding standards from CLAUDE.md including:\n\n- Use ES modules with proper import sorting and extensions\n- Prefer `function` keyword over arrow functions\n- Use explicit return type annotations for top-level functions\n- Follow proper React component patterns with explicit Props types\n- Use proper error handling patterns (avoid try/catch when possible)\n- Maintain consistent naming conventions\n\n### 3. Enhance Clarity\n\nSimplify code structure by:\n\n- Reducing unnecessary complexity and nesting\n- Eliminating redundant code and abstractions\n- Improving readability through clear variable and function names\n- Consolidating related logic\n- Removing unnecessary comments that describe obvious code\n- **IMPORTANT**: Avoid nested ternary operators - prefer switch statements or if/else chains for multiple conditions\n- Choose clarity over brevity - explicit code is often better than overly compact code\n\n### 4. Maintain Balance\n\nAvoid over-simplification that could:\n\n- Reduce code clarity or maintainability\n- Create overly clever solutions that are hard to understand\n- Combine too many concerns into single functions or components\n- Remove helpful abstractions that improve code organization\n- Prioritize \"fewer lines\" over readability (e.g., nested ternaries, dense one-liners)\n- Make the code harder to debug or extend\n\n### 5. Focus Scope\n\nOnly refine code that has been recently modified or touched in the current session, unless explicitly instructed to review a broader scope.\n\n## Refinement Process\n\n1. **Identify** the recently modified code sections\n2. **Analyze** for opportunities to improve elegance and consistency\n3. **Apply** project-specific best practices and coding standards\n4. **Ensure** all functionality remains unchanged\n5. **Verify** the refined code is simpler and more maintainable\n6. **Document** only significant changes that affect understanding\n\n## Usage\n\nThis skill operates autonomously and proactively, refining code immediately after it's written or modified without requiring explicit requests. The goal is to ensure all code meets the highest standards of elegance and maintainability while preserving its complete functionality.\n\n## Examples\n\n### Before: Nested Ternary (Avoid)\n\n```javascript\nconst status = user.isActive\n  ? user.isPremium\n    ? 'premium-active'\n    : 'basic-active'\n  : 'inactive';\n```\n\n### After: Clear Switch Statement\n\n```javascript\nfunction getUserStatus(user) {\n  if (!user.isActive) {\n    return 'inactive';\n  }\n  return user.isPremium ? 'premium-active' : 'basic-active';\n}\n\nconst status = getUserStatus(user);\n```\n\n### Before: Overly Compact\n\n```javascript\nconst result = data.filter(x => x.active).map(x => ({...x, processed: true})).reduce((acc, x) => acc + x.value, 0);\n```\n\n### After: Clear and Readable\n\n```javascript\nfunction processActiveData(data) {\n  const activeItems = data.filter(item => item.active);\n  const processedItems = activeItems.map(item => ({\n    ...item,\n    processed: true\n  }));\n  const total = processedItems.reduce((sum, item) => sum + item.value, 0);\n  return total;\n}\n\nconst result = processActiveData(data);\n```\n\n## Best Practices\n\n- **Explicit over Implicit**: Clear code is better than clever code\n- **Readable over Compact**: Prioritize understanding over brevity\n- **Consistent over Creative**: Follow project conventions\n- **Simple over Complex**: Reduce unnecessary abstractions\n- **Maintainable over Minimal**: Think about future developers\n\n## When to Use\n\n- After writing new code\n- After modifying existing code\n- When code reviews identify complexity issues\n- When refactoring for maintainability\n- When applying new coding standards\n\n## When NOT to Use\n\n- On stable, well-tested code that works\n- When functionality changes are needed (not just style)\n- On third-party or generated code\n- When project-specific patterns require certain structures","tags":["code","simplifier","awesome","skills","fanqingxuan","agent-skills","ai-agent","claude-code","claude-skills","codex","coding-assistant","developer-tools"],"capabilities":["skill","source-fanqingxuan","skill-code-simplifier","topic-agent-skills","topic-ai-agent","topic-claude-code","topic-claude-skills","topic-codex","topic-coding-assistant","topic-developer-tools","topic-qoder","topic-vercel-skills"],"categories":["awesome-skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/fanqingxuan/awesome-skills/code-simplifier","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add fanqingxuan/awesome-skills","source_repo":"https://github.com/fanqingxuan/awesome-skills","install_from":"skills.sh"}},"qualityScore":"0.459","qualityRationale":"deterministic score 0.46 from registry signals: · indexed on github topic:agent-skills · 19 github stars · SKILL.md body (4,605 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-04-23T07:01:11.690Z","embedding":null,"createdAt":"2026-04-18T23:06:24.825Z","updatedAt":"2026-04-23T07:01:11.690Z","lastSeenAt":"2026-04-23T07:01:11.690Z","tsv":"'0':491,519 '1':23,111,341 '2':27,134,348 '3':31,193,357 '4':35,255,367 '5':39,314,373 '6':383 'abstract':209,289,556 'acc':487,489 'activ':443,446,464,467 'activeitem':501 'activeitems.map':507 'affect':389 'alter':97 'analyz':349 'annot':165 'appli':36,85,135,358,586 'arrow':159 'autonom':395 'avoid':185,229,258,435 'balanc':257 'basic':445,466 'basic-act':444,465 'behavior':99,130 'best':89,362,526 'better':250,534 'breviti':245,544 'broader':337 'certain':623 'chain':238 'chang':115,387,604 'choos':242 'clariti':9,53,73,195,243,266 'claude.md':144 'clear':213,449,493,531 'clever':271,536 'code':2,7,26,29,37,43,46,52,66,72,95,104,118,141,197,207,227,247,254,265,292,308,319,346,365,377,399,417,532,537,570,574,576,588,599,616 'code-simplifi':1 'combin':278 'comment':223 'compact':107,253,474,540 'complet':429 'complex':25,202,553,579 'compon':174,286 'concern':281 'condit':241 'consist':10,54,74,190,356,545 'consolid':218 'const':437,468,476,500,505,512,522 'convent':192,550 'core':109 'could':263 'creat':269 'creativ':547 'current':329 'data':499,525 'data.filter':478,502 'debug':311 'dens':302 'describ':225 'develop':563 'document':384 'e.g':299 'eleg':354,423 'elimin':205 'enhanc':51,71,194 'ensur':368,415 'error':182 'es':147 'establish':140 'exact':59,79 'exampl':431 'exist':573 'expert':45,65 'expertis':82 'explicit':103,162,177,246,332,409,528 'extend':313 'extens':154 'featur':127 'fewer':295 'focus':49,69,315 'follow':138,171,548 'function':16,60,80,113,156,160,170,216,284,370,430,453,497,603 'futur':562 'generat':615 'getuserstatus':454,470 'goal':412 'handl':183 'hard':275 'harder':309 'help':288 'highest':420 'identifi':342,578 'if/else':237 'immedi':400 'implicit':530 'import':151,228 'improv':28,94,210,291,353 'inact':447,459 'includ':145 'instruct':333 'intact':133 'issu':580 'item':503,508,509,516 'item.active':504 'item.value':518 'javascript':436,452,475,496 'keyword':157 'level':169 'lie':83 'line':296 'liner':305 'logic':220 'maintain':12,34,56,76,189,256,268,382,425,557,584 'make':306 'mani':280 'map':481 'meet':418 'minim':559 'modifi':324,345,406,572 'modul':148 'multipl':240 'must':131 'name':191,217 'need':21,606 'nest':204,230,300,433 'never':114 'new':569,587 'obvious':226 'often':249 'one':304 'one-lin':303 'oper':232,394 'opportun':351 'optim':42 'organ':293 'origin':126 'output':128 'over':106,252,270,473 'over-simplif':259 'overview':61 'parti':613 'pattern':175,184,621 'possibl':188 'practic':90,363,527 'prefer':155,233 'premium':442,463 'premium-act':441,462 'preserv':14,58,78,112,427 'principl':110 'priorit':101,294,541 'proactiv':397 'process':340,484,510 'processactivedata':498,524 'processeditem':506 'processeditems.reduce':514 'project':87,136,360,549,619 'project-specif':86,359,618 'prop':178 'proper':150,172,181 'react':173 'readabl':30,102,211,298,495,538 'recent':323,344 'reduc':200,264,486,554 'redund':206 'refactor':32,582 'refin':6,318,339,376,398 'relat':219 'remain':132,371 'remov':221,287 'request':410 'requir':408,622 'result':477,523 'return':163,458,460,520 'review':40,335,577 'scope':316,338 'section':347 'session':330 'signific':386 'simpl':551 'simpler':379 'simplif':47,67,261 'simplifi':3,4,24,44,92,196 'singl':283 'skill':393 'skill-code-simplifier' 'solut':108,272 'sort':152 'source-fanqingxuan' 'specialist':48,68 'specif':88,361,620 'stabl':595 'standard':38,137,142,366,421,589 'statement':235,451 'status':438,469 'structur':198,624 'style':609 'sum':515,517 'switch':234,450 'ternari':231,301,434 'test':598 'think':560 'third':612 'third-parti':611 'top':168 'top-level':167 'topic-agent-skills' 'topic-ai-agent' 'topic-claude-code' 'topic-claude-skills' 'topic-codex' 'topic-coding-assistant' 'topic-developer-tools' 'topic-qoder' 'topic-vercel-skills' 'total':513,521 'touch':326 'true':485,511 'try/catch':186 'type':164,179 'unchang':372 'understand':277,390,542 'unless':331 'unnecessari':201,222,555 'usag':391 'use':17,146,161,180,566,593 'user':20,455,471 'user.isactive':439,457 'user.ispremium':440,461 'variabl':214 'verifi':374 'well':597 'well-test':596 'without':96,407 'work':601 'write':568 'written':404 'x':479,482,483,488 'x.active':480 'x.value':490","prices":[{"id":"2aa9f4ab-ff1e-4266-a92d-fb6f1c296515","listingId":"683cb8a4-b2d2-4b44-8c5c-52ea35fb1650","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"fanqingxuan","category":"awesome-skills","install_from":"skills.sh"},"createdAt":"2026-04-18T23:06:24.825Z"}],"sources":[{"listingId":"683cb8a4-b2d2-4b44-8c5c-52ea35fb1650","source":"github","sourceId":"fanqingxuan/awesome-skills/code-simplifier","sourceUrl":"https://github.com/fanqingxuan/awesome-skills/tree/main/skills/code-simplifier","isPrimary":false,"firstSeenAt":"2026-04-18T23:06:24.825Z","lastSeenAt":"2026-04-23T07:01:11.690Z"}],"details":{"listingId":"683cb8a4-b2d2-4b44-8c5c-52ea35fb1650","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"fanqingxuan","slug":"code-simplifier","github":{"repo":"fanqingxuan/awesome-skills","stars":19,"topics":["agent-skills","ai-agent","claude-code","claude-skills","codex","coding-assistant","developer-tools","qoder","vercel-skills"],"license":"mit","html_url":"https://github.com/fanqingxuan/awesome-skills","pushed_at":"2026-04-21T16:00:10Z","description":"热门skills推荐,包括编程以及非编程等各种热门实用的skill","skill_md_sha":"9dfc65f70798d9256c49f4a2d5c505acd4ebe637","skill_md_path":"skills/code-simplifier/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/fanqingxuan/awesome-skills/tree/main/skills/code-simplifier"},"layout":"multi","source":"github","category":"awesome-skills","frontmatter":{"name":"code-simplifier","description":"Simplifies and refines code for clarity, consistency, and maintainability while preserving all functionality. Use when the user needs to: (1) Simplify complex code, (2) Improve code readability, (3) Refactor for maintainability, (4) Apply coding standards, (5) Review and optimize code structure. Triggers on phrases like \"简化代码\", \"优化代码\", \"重构代码\", \"提升可读性\", \"代码审查\", \"simplify code\", \"refactor code\", \"improve code clarity\", \"code review\", \"clean up code\"."},"skills_sh_url":"https://skills.sh/fanqingxuan/awesome-skills/code-simplifier"},"updatedAt":"2026-04-23T07:01:11.690Z"}}