{"id":"7ff2e716-f693-4cde-92a8-351a4b3ebb5f","shortId":"ky37LL","kind":"skill","title":"audit-complexity","tagline":"Use when the goal is to reduce code size, remove unnecessary complexity, or simplify a module without removing user-facing behavior.","description":"target_module = $ARGUMENTS\n\nIf no target module path is provided, ask for one.\n\n**Optional flags** (parse from $ARGUMENTS if present):\n- `--tiers 1-3` — run only specified tier range\n- `--files foo.py bar.py` — scope to specific files instead of full module\n\nYou are the team lead for a distillation. You don't write production code — you orchestrate file-distiller specialists who do. Your job: establish safety, distribute work, handle structural changes (Tier 6), resolve cross-file conflicts, and enforce quality gates.\n\n## Mission\n\nMaximize net LOC reduction while improving or maintaining readability.\n\n**Primary metric:** `git diff --stat` net line delta (negative = good).\n**Hard constraint:** Tests pass. External behavior unchanged for auto-applied changes.\n\n## Two Modes\n\n- **Auto-fix** — everything preserving user-facing capabilities. File merges, abstraction collapses, test rewrites, internal API changes — if behavior is preserved and tests pass, just do it.\n- **Propose** — user-facing capability removal only (endpoints, tools, CLI commands, features). You can't verify usage patterns, so these need sign-off.\n\n## File-Distiller Teammate\n\nThe teammate prompt lives at `${CLAUDE_SKILL_DIR}/agents/file-distiller.md`. Read the prompt file and spawn a teammate with the full content as their prompt. Prepend the file assignment and any dead code scanner findings:\n\n```\nYou own `{file_path}` (and `{test_file_path}` if applicable).\nDead code scanner findings for this file: {findings or \"none available\"}\nTier restriction: {tier range or \"all tiers\"}\n\n<full content of agents/file-distiller.md>\n```\n\nSpawn teammates in the working repo (no worktree isolation). Each teammate owns exactly one file; assignments are disjoint, so concurrent edits don't collide. Run teammates in parallel — when one teammate's changes affect another file's imports, fix those in Tier 6.\n\nWhy teammates instead of serial analysis: a single context doing file-by-file analysis loses steam after easy wins. It skims Tiers 2-5 and declares \"code is tight.\" Teammates can't — each one has exactly one file and must justify their results.\n\n## Setup\n\nRun tests first. If they fail, stop — distillation requires a passing baseline.\n\nRecord baseline LOC for the target module. Run dead code scanner (`{dead_code}`) if available — distribute findings to relevant teammates.\n\nSmall modules (<500 LOC, <5 files): handle directly without spawning teammates.\n\n## Tier 6 — Structural Simplification (Lead Only)\n\nAfter all teammates finish, handle cross-file structural work they can't do in isolation:\n\n- **File merges** — single-function files into consumer. Thin `types.py`/`schemas.py`/`exceptions.py` into adjacent modules. Any file under ~30 lines that isn't `__init__.py` — question whether it needs to exist.\n- **Abstraction collapse** — ABC/Protocol with one impl: delete ABC. Factory constructing one type: inline. Service class of static methods: module functions.\n- **Solution simplification** — complex library when stdlib suffices. Class with state when a function would do.\n- **Config knob removal** — knobs always set to the same value in every environment.\n\n**Do not hesitate on structural work.** Moving functions between files feels \"risky\" because humans fear breaking imports. You grep every reference and fix them all in one pass. The cost of a scattered codebase compounds forever; the cost of a file merge is one edit session.\n\nFix all import references in one pass. Run full lint + test suite after Tier 6.\n\n## Report\n\nReport `git diff --stat` and reduction percentage against baseline.\n\nIf no user-facing features were flagged, just report the stats. Otherwise:\n\n```\n## Auto-fix complete: -XX lines (tests pass)\n\nFeature removal — needs your call:\n\n1. **Remove submit_test_feedback tool** — only used during testing phase, never\n   called in production. ~-40 lines. Risk: feature removal.\n\nWhich should I remove? (e.g., \"1\" or \"all\" or \"none\")\n```","tags":["audit","complexity","dotclaude","jhostalek","agent-skills","ai-coding","anthropic","claude","claude-code","claude-code-skills","code-review","codex-cli"],"capabilities":["skill","source-jhostalek","skill-audit-complexity","topic-agent-skills","topic-ai-coding","topic-anthropic","topic-claude","topic-claude-code","topic-claude-code-skills","topic-code-review","topic-codex-cli","topic-cursor","topic-developer-tools","topic-git-workflow","topic-multi-agent"],"categories":["dotclaude"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/JHostalek/dotclaude/audit-complexity","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add JHostalek/dotclaude","source_repo":"https://github.com/JHostalek/dotclaude","install_from":"skills.sh"}},"qualityScore":"0.454","qualityRationale":"deterministic score 0.45 from registry signals: · indexed on github topic:agent-skills · 8 github stars · SKILL.md body (3,951 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-05-18T19:13:14.288Z","embedding":null,"createdAt":"2026-05-18T13:20:30.345Z","updatedAt":"2026-05-18T19:13:14.288Z","lastSeenAt":"2026-05-18T19:13:14.288Z","tsv":"'-3':48 '-40':603 '-5':326 '/agents/file-distiller.md':205 '1':47,588,613 '2':325 '30':430 '5':383 '500':381 '6':97,301,391,551 'abc':450 'abc/protocol':445 'abstract':152,443 'adjac':425 'affect':292 'alway':482 'analysi':307,316 'anoth':293 'api':157 'appli':137 'applic':240 'argument':28,43 'ask':36 'assign':224,274 'audit':2 'audit-complex':1 'auto':136,142,576 'auto-appli':135 'auto-fix':141,575 'avail':251,373 'bar.py':56 'baselin':358,360,561 'behavior':25,132,160 'break':506 'call':587,600 'capabl':149,173 'chang':95,138,158,291 'class':457,470 'claud':202 'cli':178 'code':11,78,228,242,329,368,371 'codebas':524 'collaps':153,444 'collid':282 'command':179 'complet':578 'complex':3,15,465 'compound':525 'concurr':278 'config':478 'conflict':102 'constraint':128 'construct':452 'consum':419 'content':217 'context':310 'cost':520,528 'cross':100,402 'cross-fil':99,401 'dead':227,241,367,370 'declar':328 'delet':449 'delta':124 'diff':120,555 'dir':204 'direct':386 'disjoint':276 'distil':72,83,195,354 'distribut':91,374 'e.g':612 'easi':320 'edit':279,535 'endpoint':176 'enforc':104 'environ':490 'establish':89 'everi':489,510 'everyth':144 'exact':271,338 'exceptions.py':423 'exist':442 'extern':131 'face':24,148,172,566 'factori':451 'fail':352 'fear':505 'featur':180,567,583,606 'feedback':592 'feel':501 'file':54,60,82,101,150,194,209,223,233,237,247,273,294,313,315,340,384,403,412,417,428,500,531 'file-by-fil':312 'file-distil':81,193 'find':230,244,248,375 'finish':399 'first':349 'fix':143,297,513,537,577 'flag':40,569 'foo.py':55 'forev':526 'full':63,216,545 'function':416,462,475,498 'gate':106 'git':119,554 'goal':7 'good':126 'grep':509 'handl':93,385,400 'hard':127 'hesit':493 'human':504 'impl':448 'import':296,507,539 'improv':113 'init':435 'inlin':455 'instead':61,304 'intern':156 'isn':433 'isol':267,411 'job':88 'justifi':343 'knob':479,481 'lead':69,394 'librari':466 'line':123,431,580,604 'lint':546 'live':200 'loc':110,361,382 'lose':317 'maintain':115 'maxim':108 'merg':151,413,532 'method':460 'metric':118 'mission':107 'mode':140 'modul':19,27,32,64,365,380,426,461 'move':497 'must':342 'need':189,440,585 'negat':125 'net':109,122 'never':599 'none':250,617 'one':38,272,288,336,339,447,453,517,534,542 'option':39 'orchestr':80 'otherwis':574 'own':270 'parallel':286 'pars':41 'pass':130,165,357,518,543,582 'path':33,234,238 'pattern':186 'percentag':559 'phase':598 'prepend':221 'present':45 'preserv':145,162 'primari':117 'product':77,602 'prompt':199,208,220 'propos':169 'provid':35 'py':436 'qualiti':105 'question':437 'rang':53,255 'read':206 'readabl':116 'record':359 'reduc':10 'reduct':111,558 'refer':511,540 'relev':377 'remov':13,21,174,480,584,589,607,611 'repo':264 'report':552,553,571 'requir':355 'resolv':98 'restrict':253 'result':345 'rewrit':155 'risk':605 'riski':502 'run':49,283,347,366,544 'safeti':90 'scanner':229,243,369 'scatter':523 'schemas.py':422 'scope':57 'serial':306 'servic':456 'session':536 'set':483 'setup':346 'sign':191 'sign-off':190 'simplif':393,464 'simplifi':17 'singl':309,415 'single-funct':414 'size':12 'skill':203 'skill-audit-complexity' 'skim':323 'small':379 'solut':463 'source-jhostalek' 'spawn':211,259,388 'specialist':84 'specif':59 'specifi':51 'stat':121,556,573 'state':472 'static':459 'stdlib':468 'steam':318 'stop':353 'structur':94,392,404,495 'submit':590 'suffic':469 'suit':548 'target':26,31,364 'team':68 'teammat':196,198,213,260,269,284,289,303,332,378,389,398 'test':129,154,164,236,348,547,581,591,597 'thin':420 'tier':46,52,96,252,254,258,300,324,390,550 'tight':331 'tool':177,593 'topic-agent-skills' 'topic-ai-coding' 'topic-anthropic' 'topic-claude' 'topic-claude-code' 'topic-claude-code-skills' 'topic-code-review' 'topic-codex-cli' 'topic-cursor' 'topic-developer-tools' 'topic-git-workflow' 'topic-multi-agent' 'two':139 'type':454 'types.py':421 'unchang':133 'unnecessari':14 'usag':185 'use':4,595 'user':23,147,171,565 'user-fac':22,146,170,564 'valu':487 'verifi':184 'whether':438 'win':321 'without':20,387 'work':92,263,405,496 'worktre':266 'would':476 'write':76 'xx':579","prices":[{"id":"867345b6-d4f6-4d2f-97bf-2b630288a5ed","listingId":"7ff2e716-f693-4cde-92a8-351a4b3ebb5f","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"JHostalek","category":"dotclaude","install_from":"skills.sh"},"createdAt":"2026-05-18T13:20:30.345Z"}],"sources":[{"listingId":"7ff2e716-f693-4cde-92a8-351a4b3ebb5f","source":"github","sourceId":"JHostalek/dotclaude/audit-complexity","sourceUrl":"https://github.com/JHostalek/dotclaude/tree/main/skills/audit-complexity","isPrimary":false,"firstSeenAt":"2026-05-18T13:20:30.345Z","lastSeenAt":"2026-05-18T19:13:14.288Z"}],"details":{"listingId":"7ff2e716-f693-4cde-92a8-351a4b3ebb5f","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"JHostalek","slug":"audit-complexity","github":{"repo":"JHostalek/dotclaude","stars":8,"topics":["agent-skills","ai-coding","anthropic","claude","claude-code","claude-code-skills","code-review","codex-cli","cursor","developer-tools","git-workflow","multi-agent","prompt-engineering","skill-md"],"license":"cc0-1.0","html_url":"https://github.com/JHostalek/dotclaude","pushed_at":"2026-05-17T15:07:41Z","description":"Agent skills for agentic coding tools. Extremely opinionated. Updated (almost) daily.","skill_md_sha":"2e660752300a1183c05a8b32694ba2695e9399f8","skill_md_path":"skills/audit-complexity/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/JHostalek/dotclaude/tree/main/skills/audit-complexity"},"layout":"multi","source":"github","category":"dotclaude","frontmatter":{"name":"audit-complexity","description":"Use when the goal is to reduce code size, remove unnecessary complexity, or simplify a module without removing user-facing behavior."},"skills_sh_url":"https://skills.sh/JHostalek/dotclaude/audit-complexity"},"updatedAt":"2026-05-18T19:13:14.288Z"}}