Borrowing it
Nothing to install: this file belongs to ymhhh/cursor-implements. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/ymhhh/cursor-implements/main/.cursor/skills/shitcode-scan/SKILL.mdgit clone --depth 1 https://github.com/ymhhh/cursor-implementsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/ymhhh/cursor-implements/shitcode-scan)<a href="https://agentmods.dev/skills/ymhhh/cursor-implements/shitcode-scan"><img src="https://agentmods.dev/badge/skills/ymhhh/cursor-implements/shitcode-scan/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/ymhhh/cursor-implements/shitcode-scan"><img src="https://agentmods.dev/badge/skills/ymhhh/cursor-implements/shitcode-scan.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00221 | $0.02550 |
| Opus 5.5 | $0.00088 | $0.01020 |
| Sonnet 5.5 | $0.00044 | $0.00510 |
| Haiku 4.5 | $0.00022 | $0.00255 |
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 1mo ago.
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.
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 工作流(必读)
- 先读本文件,再用本 skill 目录下的脚本扫描(勿用
~/.claude/...或其他副本)。 - 默认目标:用户未指定路径时,扫当前 workspace root。
- 执行(在本 skill 目录下,或对脚本用绝对/相对路径均可):
python3 scripts/shitcode_scorer.py <repo_path> --top 15
- 汇报结构(简洁,可直接给用户):
- 屎山指数 + 等级 + 语言分布
- 得分最高的 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 |
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.
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.
- 1mo ago First seen · 127 lines · 221 tokens per session scan A 76ab7a150553
shitcode-scan is a skill published in the GitHub repository ymhhh/cursor-implements (2 stars, last pushed 2mo ago), licensed MIT. It adds 221 tokens to every session and 2,550 once invoked, about $0.0009 per session on Opus 5.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.
Other skills, from other repositories
sync-bridge
Reviews and guides Chromium Sync Model API (DataTypeSyncBridge) implementations, including DataTypeStore persistence and forwards/backwards compatibility for sync specifics. Use when implementing or reviewing a DataTypeSyncBridge subclass, DataTypeStore usage, sync metadata persistence, conflict resolution, or…
sync-model-processor
Reviews changes to Chromium Sync model internals in components/sync/model/, including ClientTagBasedDataTypeProcessor, ClientTagBasedRemoteUpdateHandler, ProcessorEntity, ProcessorEntityMetadata, and ProcessorEntityTracker. Use when modifying or reviewing processor state transitions, entity metadata tracking, conflict…
adversarial-reviewer
Stress-test a code change for concrete correctness defects, unsafe assumptions, and failure modes. Use when the user explicitly asks for an adversarial review, a deep bug hunt, or to tear a change apart, or to check your own change before submitting it. Do not use for ordinary review, style feedback, or general…
gsd-ns-review
Invoke this Pi skill with /skill:gsd-ns-review.
gitnexus
A code-graph analysis add-on for examining an existing codebase, including symbols, call paths, execution flows, and effects across repositories. It can query GitNexus through its command-line or MCP interfaces.
issue
Use when starting a chain from a GitHub issue — turning an issue URL or number into a triaged, planned, dispatched, and reviewed pull request. Classifies the thread (bug → root-cause discipline, feature → plan chain, question → drafted reply), synthesizes a spec from the issue's own acceptance criteria, then runs the…