uncomplex-analyzer/SKILL.md
Find complex code, analyze intent, recommend battle-tested library replacements. Uses radon/eslint for detection, GitHub quality search for alternatives.
npx skillsauth add snqb/my-skills uncomplex-analyzerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Detect complexity → understand intent → replace with libraries or simplify.
# Python
radon cc <file_or_dir> -s --min C
# JS/TS
bunx eslint <file_or_dir> --rule 'complexity: [error, 15]' --format json
Cyclomatic complexity:
# Python — install once: pip install radon
radon cc <directory> -s -j --min C | jq '.'
radon hal <file> # Halstead: effort > 500 = hard to read
# JS/TS
bunx eslint <directory> --rule 'complexity: [error, 15]' --format json
Circular dependencies:
# Python — install once: pip install pydeps
pydeps <directory> --no-output --show-cycles
# JS/TS
bunx madge --circular <directory>
Duplication:
bunx jscpd . --threshold 5 --reporters console --ignore "**/*.json,**/*.md,**/*.lock,**/node_modules/**"
Thresholds: CC 15+ = review. CC 20+ = strong replacement candidate. CC 25+ = split or replace.
For each complex function, answer: what is this trying to accomplish? (not how)
Then check if someone already solved it:
| Code Pattern | Intent | Python | JS/TS |
|---|---|---|---|
| Manual base64 + HMAC | JWT auth | pyjwt | jose |
| Nested retry loops | Retry with backoff | tenacity | p-retry |
| Date string parsing | Date manipulation | pendulum | dayjs |
| Deep object merging | Object utilities | deepmerge | lodash/merge |
| Manual HTML parsing | Web scraping | beautifulsoup4 | cheerio |
| Regex-heavy validation | Schema validation | pydantic | zod |
| Hand-rolled state machine | FSM / workflow | transitions | xstate |
| Manual CSV/Excel parsing | Tabular data | pandas | papaparse |
| Custom caching logic | Cache with TTL/LRU | cachetools | lru-cache |
| Manual rate limiting | Rate limiter | ratelimit | bottleneck |
| Hand-rolled queue | Task queue | celery, rq | bull |
| Custom logging format | Structured logging | structlog | pino |
| Subprocess orchestration | Task runner | invoke | execa |
If the pattern isn't in this table, search:
~/.pi/agent/skills/github-quality-search/github_search.py \
"<intent keywords>" -l <language> -s 100 -n 3 --json
Quality gates: 100+ stars, MIT/Apache/BSD, commit in last 6 months, has docs.
Replace when the problem is generic (dates, HTTP, validation, parsing) and a quality library exists.
Refactor when logic is domain-specific or a library would be overkill. Keep it simple:
Leave alone when:
Create uncomplex-report-YYYYMMDD.md with:
hotspot-detective (high churn + high complexity = act first)dead-code-reapergithub-quality-searchCombo: hotspot-detective → uncomplex-analyzer → dead-code-reaper
pip install radon pydeps # Python
# JS/TS: bunx eslint, bunx jscpd, bunx madge (zero-install)
documentation
Enrich Markdown articles with inline Wikipedia links. First mention of each notable entity gets a hyperlink. Use when asked to add wiki links, enrich, or add references to .md files.
development
Structured visual QA: screenshot → batch issues → fix all → verify. Replaces the 300-cycle screenshot→edit death spiral. Optional bishkek review as exit gate. Use when building/polishing UI with browser testing, or when user asks for N iterations/reviews.
research
Research real-world UI patterns from curated galleries (Collect UI, Component Gallery, Mobbin). Use when exploring what exists: dropdowns, accordions, inputs, navigation, cards, modals, etc.
development
Complete UI/UX design system: 50+ styles, 97 palettes, 57 font pairings, composition principles, visual hierarchy, Gestalt, accessibility. Use for: design, build, review, fix UI. Covers React, Next.js, Vue, Svelte, SwiftUI, Flutter, Tailwind, shadcn/ui.