doccker/cc-use-exp

size-check

>- 代码简化与文件行数检查。当用户描述"简化代码"、"检查文件大小"、"代码瘦身"时触发。 审查变更代码的复用性、质量和效率;扫描项目文件行数是否?

First seen Mar 10, 2026

Installation

$ npx skills add doccker/cc-use-exp --skill size-check

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from doccker/cc-use-exp · top by installs.

npx skills add doccker/cc-use-exp

Browse all from doccker/cc-use-exp

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 1.0K
License LICENSE
Default branch main
Open issues 5
Status Active

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 3,306 B
  • docs SUMMARY.md 247 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 11 installs

SKILL.md

Size Check - 代码简化与文件行数检查

功能 1:代码简化

审查变更代码的复用性、质量和效率,修复发现的问题。

检查项

检查项 说明
重复代码 提取公共方法/组件
过度抽象 简化不必要的设计模式
冗余逻辑 合并可简化的条件分支
未使用代码 删除死代码、无用 import

功能 2:文件行数扫描

行数阈值

语言 上限 拆分方式
Java 300 Service 拆分职责、提取 Helper/Converter
Go 400 按功能拆分同包文件
Vue 200 提取子组件、composables
TSX/JSX 200 提取子组件
TypeScript/JS 300 提取工具函数、常量、类型
Python 300 按职责拆分模块

执行流程

全项目扫描模式(用户未指定文件时):

1. 扫描项目所有代码文件(排除 node_modules、vendor、dist、build、.git)
2. 统计每个文件行数,对照阈值标记超限文件
3. 检测 Markdown 文件中的重复章节
4. 输出超限清单 + 拆分建议

输出格式

## 文件行数扫描结果

### 超限文件

| 文件 | 行数 | 阈值 | 超限 | 建议 |
|------|------|------|------|------|
| path/to/file.py | 450 | 300 | +150 | 按职责拆分为 xxx.py 和 yyy.py |

### 总结

- 扫描文件数:N
- 超限文件数:N
- 建议操作:[具体建议]

功能 3:CSS 提取检查

检查项 条件 建议
内联样式过长 <style> 块超过 30 行 提取公共样式到 assets/styles/
非 scoped 全局样式 Vue SFC 中存在 <style>(无 scoped) 移到 assets/styles/common.scss

修复流程

扫描完毕后,如发现超限文件或 CSS 提取建议,执行以下流程:

1. 用户确认

询问用户是否修复。

2. 执行修复

逐文件修复,每个文件:

  1. 阅读完整文件,理解上下文和调用关系
  2. 检查是否涉及重构

- 如果涉及表格列、数据结构、条件分支的修改,触发 refactor-safety 规则 - 完整读取原始代码(不凭记忆或推测) - 制作对比清单(列/字段/配置项) - 逐项验证一致性(数量/顺序/命名)

  1. 按扫描建议拆分/提取

- 行数超限 → 拆分文件 - CSS → 提取到 assets/styles/

  1. 确保拆分后的入口文件保持原有导出/接口不变
  2. 优先处理超限最严重的文件

重构安全检查

  • ✅ 表格重构:列数、列名、列顺序与原始代码一致
  • ✅ 数据结构重构:字段完整,没有遗漏
  • ✅ 条件分支重构:所有 if/else/switch 分支都已处理

安全原则

  • 先报告,确认后修复 — 扫描结果需用户确认才执行修复
  • 不改变现有行为 — 拆分后的入口文件保持原有接口
  • 渐进式处理 — 优先处理超限最严重的文件