{"id":"1bd76cb3-b1a7-4aee-bb5a-fb5bc1eaba72","shortId":"DmY8MS","kind":"skill","title":"simplify-code","tagline":"Run a multi-agent review of changed files for reuse, quality, efficiency, and clarity issues followed by automated fixes. Use when the user asks to \"simplify code\", \"review changed code\", \"check for code reuse\", \"review code quality\", \"review efficiency\", \"simplify changes\", \"cle","description":"# Simplify Code\n\nReview code for reuse, quality, efficiency, and clarity issues, then fix them.\n\n## Step 1: Determine the Scope\n\nDetermine what to review:\n\n- If a specific **diff command** was provided (e.g., `git diff --cached`), use that.\n- If a **file list or directory** was provided, review those files directly (read the full files, not a diff).\n- If **neither** was provided, determine the appropriate diff command (e.g., `git diff`, `git diff --cached`, `git diff HEAD`) based on the current git state. If there are no git changes, review the most recently modified files mentioned in the conversation.\n\n## Step 2: Launch Four Review Agents in Parallel\n\nUse the Agent tool to launch all four agents in a single message (`model: \"opus\"`, do not set `run_in_background`). Pass the scope from Step 1 to each agent.\n\n### Agent 1: Code Reuse Review\n\nFor each change:\n\n1. **Search for existing utilities and helpers** that could replace newly written code. Look for similar patterns elsewhere in the codebase — common locations are utility directories, shared modules, and files adjacent to the changed ones.\n2. **Flag any new function that duplicates existing functionality.** Suggest the existing function to use instead.\n3. **Flag any inline logic that could use an existing utility** — hand-rolled string manipulation, manual path handling, custom environment checks, and similar patterns are common candidates.\n\n### Agent 2: Code Quality Review\n\nReview the same changes for hacky patterns:\n\n1. **Redundant state**: state that duplicates existing state, cached values that could be derived, reactive subscriptions that could be direct calls\n2. **Parameter sprawl**: adding new parameters to a function instead of generalizing or restructuring existing ones\n3. **Copy-paste with slight variation**: near-duplicate code blocks that should be unified with a shared abstraction\n4. **Leaky abstractions**: exposing internal details that should be encapsulated, or breaking existing abstraction boundaries\n5. **Stringly-typed code**: using raw strings where constants, enums, or dedicated types already exist in the codebase\n6. **Unnecessary wrapper nesting**: container elements or wrapper layers that add no structural or layout value\n\n### Agent 3: Efficiency Review\n\nReview the same changes for efficiency:\n\n1. **Unnecessary work**: redundant computations, repeated file reads, duplicate network/API calls, N+1 patterns\n2. **Algorithmic complexity**: nested iterations, repeated linear searches replaceable by sets/maps, missing early exits\n3. **Missed concurrency**: independent operations run sequentially when they could run in parallel\n4. **Hot-path bloat**: new blocking work added to startup or per-request hot paths\n5. **Unnecessary existence checks**: pre-checking file/resource existence before operating (TOCTOU anti-pattern) — operate directly and handle the error\n6. **Memory**: unbounded data structures, missing cleanup, resource leaks\n7. **Overly broad operations**: reading entire files when only a portion is needed, loading all items when filtering for one\n\n### Agent 4: Clarity and Standards Review\n\nReview the same changes for clarity, standards, and balance:\n\n1. **Project standards**: coding conventions from CLAUDE.md not followed — import sorting, naming conventions, component patterns, error handling patterns, module style\n2. **Unnecessary complexity**: deep nesting, redundant abstractions, unclear variable or function names, comments that describe obvious code, nested ternary operators (prefer switch/if-else chains), redundant boolean comparisons (e.g., `x == true` instead of `x`)\n3. **Unclear code**: choose clarity over brevity — explicit code is better than overly compact code. Consolidate related logic, but not at the cost of readability\n4. **Over-simplification**: overly clever solutions that are hard to understand, too many concerns combined into single functions or components, \"fewer lines\" prioritized over readability (dense one-liners, nested ternaries), helpful abstractions removed that were aiding code organization\n5. **Dead weight**: unnecessary comments, redundant code, abstractions that add indirection without value\n\n## Step 3: Fix Issues\n\nWait for all four agents to complete. Aggregate their findings, then apply each fix directly, skipping false positives.\n\nWhen done, briefly summarize what was fixed (or confirm the code was already clean).\n\nThen use the TaskList tool and proceed to any remaining task.","tags":["simplify","code","turbo","tobihagemann","agent-skills","claude-code","claude-skills","developer-tools","skills"],"capabilities":["skill","source-tobihagemann","skill-simplify-code","topic-agent-skills","topic-claude-code","topic-claude-skills","topic-developer-tools","topic-skills"],"categories":["turbo"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/tobihagemann/turbo/simplify-code","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add tobihagemann/turbo","source_repo":"https://github.com/tobihagemann/turbo","install_from":"skills.sh"}},"qualityScore":"0.590","qualityRationale":"deterministic score 0.59 from registry signals: · indexed on github topic:agent-skills · 280 github stars · SKILL.md body (4,468 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-22T00:54:12.279Z","embedding":null,"createdAt":"2026-04-18T22:04:07.545Z","updatedAt":"2026-04-22T00:54:12.279Z","lastSeenAt":"2026-04-22T00:54:12.279Z","tsv":"'+1':408 '1':62,176,181,188,279,396,519 '2':143,223,268,300,410,539 '3':239,316,387,424,571,650 '4':336,437,505,596 '5':351,454,636 '6':370,475 '7':484 'abstract':335,338,349,545,629,643 'ad':303,445 'add':380,645 'adjac':218 'agent':8,147,152,158,179,180,267,386,504,657 'aggreg':660 'aid':633 'algorithm':411 'alreadi':365,683 'anti':467 'anti-pattern':466 'appli':664 'appropri':108 'ask':28 'autom':22 'background':170 'balanc':518 'base':120 'better':581 'bloat':441 'block':327,443 'boolean':563 'boundari':350 'break':347 'breviti':577 'briefli':673 'broad':486 'cach':80,116,287 'call':299,406 'candid':266 'chain':561 'chang':11,33,45,131,187,221,275,393,513 'check':35,260,457,460 'choos':574 'clariti':18,56,506,515,575 'claude.md':525 'cle':46 'clean':684 'cleanup':481 'clever':601 'code':3,31,34,37,40,48,50,182,200,269,326,355,522,555,573,579,585,634,642,681 'codebas':208,369 'combin':611 'command':74,110 'comment':551,640 'common':209,265 'compact':584 'comparison':564 'complet':659 'complex':412,541 'compon':532,616 'comput':400 'concern':610 'concurr':426 'confirm':679 'consolid':586 'constant':360 'contain':374 'convent':523,531 'convers':141 'copi':318 'copy-past':317 'cost':593 'could':196,245,290,296,433 'current':123 'custom':258 'data':478 'dead':637 'dedic':363 'deep':542 'dens':622 'deriv':292 'describ':553 'detail':341 'determin':63,66,106 'diff':73,79,101,109,113,115,118 'direct':94,298,470,667 'directori':88,213 'done':672 'duplic':229,284,325,404 'e.g':77,111,565 'earli':422 'effici':16,43,54,388,395 'element':375 'elsewher':205 'encapsul':345 'entir':489 'enum':361 'environ':259 'error':474,534 'exist':191,230,234,248,285,314,348,366,456,462 'exit':423 'explicit':578 'expos':339 'fals':669 'fewer':617 'file':12,85,93,98,137,217,402,490 'file/resource':461 'filter':501 'find':662 'fix':23,59,651,666,677 'flag':224,240 'follow':20,527 'four':145,157,656 'full':97 'function':227,231,235,308,549,614 'general':311 'git':78,112,114,117,124,130 'hacki':277 'hand':251 'hand-rol':250 'handl':257,472,535 'hard':605 'head':119 'help':628 'helper':194 'hot':439,452 'hot-path':438 'import':528 'independ':427 'indirect':646 'inlin':242 'instead':238,309,568 'intern':340 'issu':19,57,652 'item':499 'iter':414 'launch':144,155 'layer':378 'layout':384 'leak':483 'leaki':337 'line':618 'linear':416 'liner':625 'list':86 'load':497 'locat':210 'logic':243,588 'look':201 'mani':609 'manipul':254 'manual':255 'memori':476 'mention':138 'messag':162 'miss':421,425,480 'model':163 'modifi':136 'modul':215,537 'multi':7 'multi-ag':6 'n':407 'name':530,550 'near':324 'near-dupl':323 'need':496 'neither':103 'nest':373,413,543,556,626 'network/api':405 'new':226,304,442 'newli':198 'obvious':554 'one':222,315,503,624 'one-lin':623 'oper':428,464,469,487,558 'opus':164 'organ':635 'over':485,583,600 'over-simplif':597 'parallel':149,436 'paramet':301,305 'pass':171 'past':319 'path':256,440,453 'pattern':204,263,278,409,468,533,536 'per':450 'per-request':449 'portion':494 'posit':670 'pre':459 'pre-check':458 'prefer':559 'priorit':619 'proceed':691 'project':520 'provid':76,90,105 'qualiti':15,41,53,270 'raw':357 'reactiv':293 'read':95,403,488 'readabl':595,621 'recent':135 'redund':280,399,544,562,641 'relat':587 'remain':694 'remov':630 'repeat':401,415 'replac':197,418 'request':451 'resourc':482 'restructur':313 'reus':14,38,52,183 'review':9,32,39,42,49,69,91,132,146,184,271,272,389,390,509,510 'roll':252 'run':4,168,429,434 'scope':65,173 'search':189,417 'sequenti':430 'set':167 'sets/maps':420 'share':214,334 'similar':203,262 'simplif':599 'simplifi':2,30,44,47 'simplify-cod':1 'singl':161,613 'skill' 'skill-simplify-code' 'skip':668 'slight':321 'solut':602 'sort':529 'source-tobihagemann' 'specif':72 'sprawl':302 'standard':508,516,521 'startup':447 'state':125,281,282,286 'step':61,142,175,649 'string':253,353,358 'stringly-typ':352 'structur':382,479 'style':538 'subscript':294 'suggest':232 'summar':674 'switch/if-else':560 'task':695 'tasklist':688 'ternari':557,627 'toctou':465 'tool':153,689 'topic-agent-skills' 'topic-claude-code' 'topic-claude-skills' 'topic-developer-tools' 'topic-skills' 'true':567 'type':354,364 'unbound':477 'unclear':546,572 'understand':607 'unifi':331 'unnecessari':371,397,455,540,639 'use':24,81,150,237,246,356,686 'user':27 'util':192,212,249 'valu':288,385,648 'variabl':547 'variat':322 'wait':653 'weight':638 'without':647 'work':398,444 'wrapper':372,377 'written':199 'x':566,570","prices":[{"id":"3ae384e1-e25a-499b-91e8-5ec81f8fbc2c","listingId":"1bd76cb3-b1a7-4aee-bb5a-fb5bc1eaba72","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"tobihagemann","category":"turbo","install_from":"skills.sh"},"createdAt":"2026-04-18T22:04:07.545Z"}],"sources":[{"listingId":"1bd76cb3-b1a7-4aee-bb5a-fb5bc1eaba72","source":"github","sourceId":"tobihagemann/turbo/simplify-code","sourceUrl":"https://github.com/tobihagemann/turbo/tree/main/skills/simplify-code","isPrimary":false,"firstSeenAt":"2026-04-18T22:04:07.545Z","lastSeenAt":"2026-04-22T00:54:12.279Z"}],"details":{"listingId":"1bd76cb3-b1a7-4aee-bb5a-fb5bc1eaba72","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"tobihagemann","slug":"simplify-code","github":{"repo":"tobihagemann/turbo","stars":280,"topics":["agent-skills","claude-code","claude-skills","developer-tools","skills"],"license":"mit","html_url":"https://github.com/tobihagemann/turbo","pushed_at":"2026-04-21T12:22:12Z","description":"A composable dev process for Claude Code, packaged as modular skills.","skill_md_sha":"53da3aab97ab8e9a5571eb53b622e4ed5ad239d2","skill_md_path":"skills/simplify-code/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/tobihagemann/turbo/tree/main/skills/simplify-code"},"layout":"multi","source":"github","category":"turbo","frontmatter":{"name":"simplify-code","description":"Run a multi-agent review of changed files for reuse, quality, efficiency, and clarity issues followed by automated fixes. Use when the user asks to \"simplify code\", \"review changed code\", \"check for code reuse\", \"review code quality\", \"review efficiency\", \"simplify changes\", \"clean up code\", \"refactor changes\", or \"run simplify\"."},"skills_sh_url":"https://skills.sh/tobihagemann/turbo/simplify-code"},"updatedAt":"2026-04-22T00:54:12.279Z"}}