telagod avatar

Checking Code Quality

This runs automated quality checks on your codebase, flagging complexity, duplication, long functions, and naming issues against configurable thresholds. It's meant for post-refactor validation and catching code smells before they spread, not for blocking emergency fixes. The thresholds are guidelines, not verdicts. You're expected to judge whether a cyclomatic complexity of 15 is genuinely bad or just an honest state machine. If abyss is available, it layers on hotspot analysis to prioritize which files actually matter. The documentation is refreshingly blunt about when to ignore the rules, like exempting CLI entry points from file length limits or accepting magic numbers when they're obviously 0, 1, or 2. Outputs to stdout or JSON for CI pipelines.

GitHub stars
224
last updated
Jun 10, 2026

Install

$ npx -y skills add telagod/code-abyss --skill checking-code-quality --agent claude-code

Installs into .claude/skills of the current project.

Files

代码质量校验关卡

阈值是 heuristic,不是判决。主动判断哪些超标值得拆,哪些是合理复杂度。

何时使用

场景跑判据
重构完成✅验证拆分有效,未引入新异味
复杂模块新增✅早期发现可读性问题
提交前(>30 行变更)✅防腐烂
PR review✅客观度量替代主观争论
紧急修复❌优先稳定,质量在收口阶段补
算法/性能关键路径⚠工具阈值不适用,按性能基准判断

abyss 集成

如果 abyss 可用,质量检查时额外使用 hotspot 数据:

abyss map --json  # 获取热点文件列表
  • hotspot_score > 10000 的文件:标记为「高风险热点」,优先拆分
  • change_count > 20 且 complexity > 100:建议拆分为更小的文件/函数
  • coupling_score > 80%:提醒耦合文件需要同步审查

阈值与处置

指标阈值超标处置何时容忍
圈复杂度≤10拆分函数、引入策略模式有限状态机/解析器(结构性复杂)
函数长度≤50 行提取子函数配置/常量声明、大型 switch
文件长度≤500 行拆分模块自动生成代码、protobuf
参数数量≤5封装参数对象构造函数(builder 模式更佳)
嵌套深度≤4早返回、提取函数、查表罕见情况下的状态机
行长度≤120换行长字符串字面量、SQL

例外说明:bin/ 下带 Node shebang 的 CLI 入口按命令编排层处理,不参与文件长度阈值;其业务逻辑仍应优先下沉到 bin/lib/。

代码异味

异味严重度处置
重复代码 >10 行High提取公共函数;判断是否真重复(结构相似但语义不同时不要强抽)
参数 >5 个Medium封装参数对象
魔法数字Medium提取常量;常见数(0, 1, 2)可豁免
死代码/注释代码块Low删除;用 git history 追溯,不要靠注释保留

命名规范

Sponsors

Details

Repository
github.com/telagod/code-abyss
Category
Code Review & Quality
License
MIT
First seen
Jun 11, 2026

More from telagod/code-abyss

All 30
1laurigates avatarpython-code-qualitylaurigates/claude-pluginsPython code quality with ruff and ty. Use when the user mentions ruff, ty, linting, formatting, type checking, or Python code style.1Kskills.sh installs
2miles990 avatarcode-qualitymiles990/claude-software-skillsClean code principles, SOLID, and code review practices785skills.sh installs
3dietrichgebert avatarponytail-reviewdietrichgebert/ponytailCode review focused exclusively on over-engineering. Finds what to delete: reinvented standard library, unneeded dependencies, speculative abstractions, dead fl67.7Kskills.sh installs
4DietrichGebert avatarponytail-reviewDietrichGebert/ponytailCode review focused exclusively on over-engineering. Finds what to delete: reinvented standard library, unneeded dependencies, speculative abstractions, dead fl67.7Kskills.sh installs
5tursodatabase avatarcode-qualitytursodatabase/tursoGeneral Correctness rules, Rust patterns, comments, avoiding over-engineering. When writing code always take these into account1.8Kskills.sh installs
6omer-metin avatarcode-architecture-reviewomer-metin/skills-for-antigravityReview code architecture for maintainability, catch structural issues before they become debtUse when "Reviewing pull requests with structural changes, Planning270skills.sh installs