Agent skill

Code Quality Gate Checker

by telagod in telagod/code-abyss

Checks cyclomatic complexity, function and file length, parameter count, nesting depth and naming conventions against fixed thresholds, with a bundled Node.js script and hotspot integration.

MITAuto-check: notesDevelopment

SKILL.md written in Chinese; this summary is our English description.

Install Code Quality Gate Checker

skills CLI
$ npx skills add telagod/code-abyss --skill checking-code-quality -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install telagod/code-abyss checking-code-quality --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/telagod/code-abyss.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/checking-code-quality .claude/skills/checking-code-quality && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
checking-code-quality
GitHub stars
244
Token cost
~609 tokens
SKILL.md length
140 words
Files
3 (incl. scripts)
Skills in repo
38
Repo updated
First seen
Licence
MIT

At a glance

Checks cyclomatic complexity, function and file length, parameter count, nesting depth and naming conventions against fixed thresholds, with a bundled Node.js script and hotspot integration.

  • Running a quality gate after finishing a refactor
  • SKILL.md covers 何时使用, abyss 集成, 阈值与处置 and 代码异味, plus 5 more sections
  • Runs JavaScript scripts from its folder; calls node
  • Reviewing a complex new module for readability problems early

What it does

This skill, written in Chinese, treats its thresholds as heuristics rather than verdicts, asking the agent to judge which violations are worth splitting and which represent reasonable complexity. It runs after a refactor to confirm the split worked and introduced no new smells, when a complex module is added, before a commit larger than 30 changed lines, and during PR review as an objective measure in place of subjective argument; it is skipped during an urgent fix and only loosely applied on an algorithmic or performance-critical path.

Thresholds cover cyclomatic complexity at 10, function length at 50 lines, file length at 500 lines, parameter count at 5, nesting depth at 4 and line length at 120, each paired with a suggested fix such as extracting a sub-function or wrapping parameters in an object, and each with named exceptions like finite-state machines, generated code or long string literals. A code-smell table rates duplicated code over 10 lines as high severity, magic numbers and excess parameters as medium, and dead code as low, and a naming table fixes PascalCase for classes with snake_case or camelCase for functions depending on the language.

When a separate abyss tool is available, the skill pulls hotspot data to flag files with a hotspot score over 10000 for priority splitting, and the skill's own quality_checker.js script, runnable with a verbose or JSON flag, is the final arbiter: any threshold violation left in place must be explained in DESIGN.md rather than silently ignored. A hard rule blocks refactoring when tests are not already green.

When your agent uses it

  • Running a quality gate after finishing a refactor
  • Reviewing a complex new module for readability problems early
  • Checking a pull request's code quality with objective metrics instead of opinion
  • Deciding whether a flagged complexity violation is acceptable or needs splitting

Example prompts

  • “Run the quality checker on src/payments and tell me which functions exceed the complexity threshold.”
  • “Check this file for nesting depth and parameter count violations before I open the PR.”
  • “We just refactored the checkout flow. Verify no new code smells were introduced.”
  • “This function trips the length threshold but it's a state machine. Is that an acceptable exception?”

Requirements

  • Node.js 18 or later to run the bundled quality_checker.js script
  • Optionally the abyss hotspot tool for churn and coupling data
  • Compatibility (from SKILL.md): node>=18
  • Pre-approved tools (allowed-tools): Bash, Read, Glob

What it can do on your machine

Read from SKILL.md and the folder at commit 2544577. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash
    • Read
    • Glob

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (JavaScript), which the agent can run.

    Shell commands in SKILL.md call:

    • node

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    node>=18

    From compatibility in the SKILL.md frontmatter.

Context cost

Code Quality Gate Checker loads about 609 tokens when it runs. Until then it costs about 66 tokens; SKILL.md has 140 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~66
When it runs · the whole SKILL.md, loaded when a task matches
~609

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Bash, Read, Glob

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from telagod/code-abyss at commit 2544577, republished under its MIT licence (© telagod). 140 words, ~609 tokens.

Download SKILL.mdSave it as .claude/skills/checking-code-quality/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
checking-code-quality
description
Checks code quality metrics including complexity, duplication, naming conventions, and function length. Use when running quality gates, reviewing code smells, or checking lint rules. Automatically triggered on complex modules or post-refactor.
allowed-tools
Bash, Read, Glob
compatibility
node>=18
user-invocable
false
argument-hint
<扫描路径>

代码质量校验关卡

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

何时使用

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

abyss 集成

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

bash
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 追溯,不要靠注释保留

命名规范

实体规则
类PascalCase
函数snake_case (Python/Rust) / camelCase (JS/TS/Go)
常量UPPER_SNAKE
变量snake_case / camelCase(按语言)

跨语言项目按主语言定,不混搭。

判断式重构

python
# 深嵌套 → 早返回
def process(data):
    if not c1: return
    if not c2: return
    # 主逻辑

# 重复 → 提取
def common(): ...
def f1(): common()
def f2(): common()

重构红线:测试不绿不重构。先把测试补齐,才有改动的安全网。

与其他 skill 联动

使用

bash
node scripts/quality_checker.js <路径>
node scripts/quality_checker.js <路径> -v       # 详细
node scripts/quality_checker.js <路径> --json   # CI 用

收口

报告以 quality_checker.js 实际输出为准。超标项要么修复,要么在 DESIGN.md 留「为何接受」的说明。不允许悄悄忽略。

© telagod, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (scripts) in skills/checking-code-quality of telagod/code-abyss.

  • SKILL.md
  • agents/openai.yaml
  • scripts/quality_checker.js

Open the folder on GitHubat commit 2544577

Compare with similar skills

Code Quality Gate Checker next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Code Quality Gate Checker compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Code Quality Gate Checker this skilltelagod/code-abyss244—~609Automated safety check: NotesMIT
Sonarclaudeagentculture/culture113—~764Automated safety check: PassApache-2.0
Qe Quality Assessmentproffesor-for-testing/agentic-qe494—~1.9kAutomated safety check: PassMIT
Systematic Code Refactoringluongnv89/claude-howto42k—~3kAutomated safety check: PassMIT
Constraint-Driven Developmentaddyosmani/agent-skills102k2 repos~5.2kAutomated safety check: PassMIT
Dignified Python Standardsdocling-project/docling68k—~1.5kAutomated safety check: PassApache-2.0

Similar skills

  • Sonarclaude

    agentculture/culture

    Query SonarCloud API for code quality data. An agent skill from agentculture/culture.

    113 GitHub stars~764 tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Qe Quality Assessment

    proffesor-for-testing/agentic-qe

    Evaluates code quality through complexity analysis, lint results, code smell detection, and test health metrics.

    494 GitHub stars~1.9k tokensUpdated 3 days ago
    DevelopmentAuto-check passed
  • Systematic Code Refactoring

    luongnv89/claude-howto

    Guides refactoring in phases based on Martin Fowler's method: research, test coverage check, planning and small tested steps, with your approval at each phase.

    42k GitHub stars~3k tokensUpdated 7 days ago
    DevelopmentAuto-check passed
  • Constraint-Driven Development

    addyosmani/agent-skills

    Records a project's quality bar in CONSTRAINTS.md and watches diffs for signs an agent quietly weakened it, such as suppressions, skipped tests or lowered thresholds.

    102k GitHub starsUsed in 2 repos~5.2k tokens
    DevelopmentAuto-check passed
  • Dignified Python Standards

    docling-project/docling

    Applies opinionated production Python conventions chosen by the project's Python version: modern type syntax, pathlib, explicit checks and interface guidance.

    68k GitHub stars~1.5k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Clean Code Guard

    amElnagdy/guard-skills

    Reviews generated or changed production code against Clean Code, SOLID, DRY, KISS, YAGNI and LLM-specific failure modes before it ships, in any language.

    1.3k GitHub starsUsed in 2 repos~4.3k tokens
    DevelopmentAuto-check passed

More from telagod/code-abyss

All 38 skills in this repo
  • Security Gate Scanner

    telagod/code-abyss

    Scans code with a bundled Node scanner for injection, secret leaks and other dangerous patterns, and requires documented decisions for accepted risks.

    244 GitHub stars~552 tokensUpdated 2 mo ago
    Auto-check: notes
  • Persona Voice Card Builder

    telagod/code-abyss

    Distills a recurring agent voice from conversations into a restricted Persona Voice Card, validates it for schema, safety and distinctness, and prepares it for community submission.

    244 GitHub stars~716 tokensUpdated 2 mo ago
    Auto-check: notes
  • Skill Cultivation Funnel

    telagod/code-abyss

    Distills repeated workflows into new skills, improves existing ones and promotes them through local, project and community tiers after a default-deny safety scan.

    244 GitHub stars~794 tokensUpdated 2 mo ago
    Auto-check: notes
  • DOCX Processing Toolkit

    telagod/code-abyss

    Routes Word document tasks to the right tool: pandoc for text, raw OOXML for structure and comments, docx-js for new files, and a mandatory redlining flow for edits to others' documents.

    244 GitHub stars~668 tokensUpdated 2 mo ago
    Auto-check: notes
  • PDF Processing Toolkit

    telagod/code-abyss

    Picks the right Python library or CLI tool for a PDF task, text and table extraction, merging, splitting, OCR, watermarking or form filling, and points to a matching recipe.

    244 GitHub stars~532 tokensUpdated 2 mo ago
    Auto-check: notes
  • Code Change Analysis Gate

    telagod/code-abyss

    Checks what a code change touched, how far its impact reaches and whether design docs, tests and README files kept up, before commit or in review.

    244 GitHub stars~532 tokensUpdated 2 mo ago
    Auto-check: notes

Categories

Questions about Code Quality Gate Checker

What does Code Quality Gate Checker do?

Checks cyclomatic complexity, function and file length, parameter count, nesting depth and naming conventions against fixed thresholds, with a bundled Node.js script and hotspot integration. This skill, written in Chinese, treats its thresholds as heuristics rather than verdicts, asking the agent to judge which violations are worth splitting and which represent reasonable complexity. It runs after a refactor to confirm the split worked and introduced no new smells, when a complex module is added, before a commit larger than 30 changed lines, and during PR review as an objective measure in place of subjective argument; it is skipped during an urgent fix and only loosely applied on an algorithmic or performance-critical path.

When should I use Code Quality Gate Checker?

Code Quality Gate Checker fits situations like: running a quality gate after finishing a refactor; reviewing a complex new module for readability problems early; checking a pull request's code quality with objective metrics instead of opinion; deciding whether a flagged complexity violation is acceptable or needs splitting.

How do I install Code Quality Gate Checker in Claude Code?

Run `npx skills add telagod/code-abyss --skill checking-code-quality -a claude-code`. Or copy the skill folder (skills/checking-code-quality in telagod/code-abyss) into .claude/skills/checking-code-quality in your project. Claude Code loads it when a task matches its description.

How do I install Code Quality Gate Checker in Codex?

Run `npx skills add telagod/code-abyss --skill checking-code-quality -a codex`. Or copy the skill folder (skills/checking-code-quality in telagod/code-abyss) into .agents/skills/checking-code-quality in your project. Codex loads it when a task matches its description.

Can I use Code Quality Gate Checker in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add telagod/code-abyss --skill checking-code-quality -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/checking-code-quality, .gemini/skills/checking-code-quality, .github/skills/checking-code-quality and .opencode/skills/checking-code-quality in your project.

What does Code Quality Gate Checker need to run?

Going by SKILL.md and its folder, Code Quality Gate Checker needs JavaScript for the scripts in its folder and the command-line tools its instructions call (node). Our summary lists: Node.js 18 or later to run the bundled quality_checker.js script; Optionally the abyss hotspot tool for churn and coupling data. Its frontmatter pre-approves these tools: Bash, Read, Glob. Compatibility (from SKILL.md): node>=18.

Does Code Quality Gate Checker access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Code Quality Gate Checker safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Code Quality Gate Checker use?

Code Quality Gate Checker is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Code Quality Gate Checker use?

About 609 tokens (SKILL.md is roughly 2.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Code Quality Gate Checker?

Skills that share tags, products or a category with Code Quality Gate Checker: Sonarclaude (agentculture/culture, 113 stars), Qe Quality Assessment (proffesor-for-testing/agentic-qe, 494 stars), Systematic Code Refactoring (luongnv89/claude-howto, 42k stars) and Constraint-Driven Development (addyosmani/agent-skills, 102k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Code Quality Gate Checker?

telagod (a GitHub user) maintains it in telagod/code-abyss, which has 244 GitHub stars. The repository holds 38 skills in this directory. The repository was last updated on July 19, 2026.

Source: telagod/code-abyss on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.