shitcode-scan

A scanner that measures technical debt and code smells—patterns that make software harder to understand or change—in a code repository. It supports Python, Go, Java, Rust, C and C++, JavaScript, TypeScript, and SQL.

In plain words
What is it for?
It reports an overall code-health score, language distribution, problem dimensions, and the files and functions most in need of refactoring.
Why use it?
It turns vague concerns about messy code into scores and ranked findings tied to specific files, functions, and lines.

Skill for Claude CodeCodexCursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/ymhhh/cursor-implements/shitcode-scan
Any agent
npx skills add ymhhh/cursor-implements --skill shitcode-scan
Clone the repo
git clone --depth 1 https://github.com/ymhhh/cursor-implements

Made for: Claude Code, Codex, Cursor.

Per session 221 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,550 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00221 $0.02550
Opus 5 $0.00111 $0.01275
Sonnet 5 $0.00044 $0.00510
Haiku 4.5 $0.00022 $0.00255

Measured 2d ago against content hash 76ab7a150553, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

shitcode-scan scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/shitcode_scorer.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/skills/shitcode-scan/SKILL.md · 127 lines

How it starts

The opening of the file, as written. The whole thing — 127 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Shitcode Scan · 多语言屎山代码扫描

对一个代码仓库量化"有多屎",输出 8 维度加权总分(0–100,越高越屎)+ 字母等级, 并给出 最烂文件 Top-N最烂函数 Top-N(带 path:line),让"重构从哪下手"有据可依。

Agent 工作流(必读)

  1. 先读本文件,再用本 skill 目录下的脚本扫描(勿用 ~/.claude/... 或其他副本)。
  2. 默认目标:用户未指定路径时,扫当前 workspace root。
  3. 执行(在本 skill 目录下,或对脚本用绝对/相对路径均可):
python3 scripts/shitcode_scorer.py <repo_path> --top 15
  1. 汇报结构(简洁,可直接给用户):
    • 屎山指数 + 等级 + 语言分布
    • 得分最高的 2–3 个短板维度(带关键 evidence)
    • 最烂文件 Top(含坏味道标签)
    • 最烂函数 Top(name @ path:line,便于跳转)
    • 一句重构建议(从 Top 函数/文件入手,勿空谈)

需要结构化结果时加 --json /tmp/shitcode-scan.json

用法

引擎脚本(相对本 skill 根目录):

scripts/shitcode_scorer.py
python3 scripts/shitcode_scorer.py <repo_path> [选项]
选项 说明 默认
<repo_path> 待评估仓库路径(必填)
--top N 排行榜条数(文件榜/函数榜各 N 条) 20
--lang a,b 限定语言:py3,go,java,rust,cpp,js,sql(逗号分隔)。py/py2/py3 均扫 .py,py2-isms 由 LEG 维度检测 全部
--json out.json 结果写入 JSON(含 worst_files/worst_functions/8维dimensions/summary)
--warehouse auto|on|off 数仓专属启发式。auto 仅当命中数仓指纹(分层目录/Modify By 头/ETL工具函数)才启用 auto
--no-inspect-zips 不开箱 zip(快扫或无文件权限时);此时 zip 一律不计入死重以免误伤源码 开箱

典型调用:

# 最常用:跑分 + 看排行榜
python3 scripts/shitcode_scorer.py /path/to/repo --top 15

# 出结构化结果给后续处理/写报告
python3 scripts/shitcode_scorer.py /path/to/repo --json /tmp/scan.json

# 只看 go 代码
python3 scripts/shitcode_scorer.py /path/to/repo --lang go --top 20

8 个维度(权重)

维度 名称 看什么 权重
DUP 重复度 完全重复文件、副本簇、变体命名(_copy/_bak/日期戳) 0.18
DEAD 死重/僵尸 制品包/二进制占比(zip 开箱按内容分类,源码包绝不当死重) 0.10
SIZE 体量 单文件行数分布、超大(>1000)/巨型(>3000)文件占比 0.10
CPX 复杂度 逐函数算圈复杂度、最大嵌套、超长函数占比(屎山核心) 0.22
GOV 工程治理 依赖清单/README/CI/linter/真实测试缺失(按语言判定) 0.17
ORG 组织结构 逗号目录、tmp/sandbox 散落、嵌套 .git;人名目录仅数仓模式计入 0.10
DOC 可维护性 注释率异常 0.05
LEG 语言遗留/EOL python2-isms、各语言废弃 API(见下) 0.08

Read the full file on GitHub · 127 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 127 lines · 221 tokens per session scan A 76ab7a150553

Subscribe to this mod's changes

shitcode-scan is a skill published in the GitHub repository ymhhh/cursor-implements (2 stars, last pushed 26d ago), licensed MIT. It adds 221 tokens to every session and 2,550 once invoked, about $0.0011 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.

obra/superpowers · 37 tokens

auto-perf-optimize

Run agent-driven VS Code performance or memory investigations. Use when asked to launch Code OSS, automate a VS Code scenario, run the Chat memory smoke runner, capture renderer heap snapshots, take workflow screenshots, compare run summaries, or drive a repeatable scenario before heap-snapshot analysis.

microsoft/vscode · 62 tokens

chat-perf

Run chat perf benchmarks and memory leak checks against the local dev build or any published VS Code version. Use when investigating chat rendering regressions, validating perf-sensitive changes to chat UI, or checking for memory leaks in the chat response pipeline.

microsoft/vscode · 51 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens