Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

code-quality代码质量

Agent Skill

code-quality 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

5,273

周安装

215

GitHub Stars

4

下载量

2,820
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:code-quality(代码质量)
来源仓库:https://github.com/eyadsibai/ltk
仓库路径:skills/code-quality
安装命令:
npx skills add https://github.com/eyadsibai/ltk --skill 'Code Quality'
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/eyadsibai/ltk --skill 'Code Quality'

简介

code-quality 用于查找、检索和筛选相关信息。

  • 适合根据关键词、任务场景或来源线索快速定位候选结果。
  • 可结合来源仓库和原始 README 核验具体用法。
  • 安装前需确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Code Quality Analysis

Comprehensive code quality analysis skill covering style, complexity, dead code detection, and type checking.

Core Capabilities

Style Compliance

Check adherence to language-specific style guides:

Python (PEP8/Black):

  • Line length (88 chars for Black, 79 for PEP8)
  • Indentation (4 spaces)
  • Import ordering (standard, third-party, local)
  • Naming conventions (snake_case for functions/variables, PascalCase for classes)
  • Whitespace usage

Style check commands:

# Black formatting check
black --check --diff .

# Flake8 linting
flake8 --max-line-length=88 .

# isort import sorting
isort --check-only --diff .

Complexity Metrics

Measure and report code complexity:

Cyclomatic Complexity:

  • Number of independent paths through code
  • Target: < 10 per function
  • Warning: 10-20
  • Critical: > 20

Cognitive Complexity:

  • Mental effort to understand code
  • Accounts for nesting depth and control flow

Function Length:

  • Target: < 50 lines
  • Warning: 50-100 lines
  • Critical: > 100 lines

Nesting Depth:

  • Target: < 4 levels
  • Warning: 4-6 levels
  • Critical: > 6 levels

Complexity analysis:

# Using radon for Python
radon cc . -a -s  # Cyclomatic complexity
radon mi .        # Maintainability index
radon hal .       # Halstead metrics

Dead Code Detection

Identify unused code elements:

Unused Imports:

# Python - using autoflake
autoflake --check --remove-all-unused-imports .

# Using flake8 with F401
flake8 --select=F401 .

Unused Variables:

  • Local variables assigned but never read
  • Function parameters ignored
  • Class attributes never accessed

Unused Functions/Classes:

  • Defined but never called
  • Private methods not used internally
  • Dead code branches (always false conditions)

Unreachable Code:

  • Code after return/raise/break/continue
  • Branches with impossible conditions
  • Deprecated code still in codebase

Type Hint Analysis

Validate type annotations:

Missing Type Hints:

# Using mypy
mypy --strict .

# Check specific strictness levels
mypy --disallow-untyped-defs .
mypy --disallow-incomplete-defs .

Type Errors:

  • Incompatible types in assignments
  • Wrong argument types
  • Missing return types
  • Generic type issues

Type Coverage:

  • Percentage of code with type annotations
  • Target: > 80% coverage

Quality Metrics Dashboard

When analyzing a codebase, report:

MetricValueTargetStatus
Style ComplianceX%> 95%Pass/Fail
Avg Cyclomatic ComplexityX< 10Pass/Fail
Max Function LengthX lines< 50Pass/Fail
Dead CodeX items0Pass/Fail
Type CoverageX%> 80%Pass/Fail

Analysis Workflow

Full Quality Analysis

To perform comprehensive quality check:

  1. Style check: Run linters and formatters
  2. Complexity analysis: Calculate metrics
  3. Dead code scan: Find unused elements
  4. Type check: Validate annotations
  5. Report generation: Summarize findings

Quick Quality Check

For rapid assessment of changes:

  1. Get changed files from git diff
  2. Run focused linting on changed files
  3. Check complexity of modified functions
  4. Validate types in touched code

Language-Specific Guidance

Python

Recommended tooling:

  • Black (formatting)
  • isort (import sorting)
  • flake8 (linting)
  • mypy (type checking)
  • radon (complexity)
  • vulture (dead code)

Configuration (pyproject.toml):

[tool.black]
line-length = 88
target-version = ['py311']

[tool.isort]
profile = "black"
line_length = 88

[tool.mypy]
python_version = "3.11"
strict = true

JavaScript/TypeScript

Recommended tooling:

  • ESLint (linting)
  • Prettier (formatting)
  • TypeScript compiler (type checking)

Configuration (.eslintrc.json):

{
  "extends": ["eslint:recommended"],
  "rules": {
    "complexity": ["warn", 10],
    "max-depth": ["warn", 4],
    "max-lines-per-function": ["warn", 50]
  }
}

Common Quality Issues

High Priority Fixes

  1. Unused imports: Remove immediately
  2. Type errors: Fix type mismatches
  3. High complexity: Refactor into smaller functions
  4. Long functions: Extract logical blocks

Medium Priority

  1. Style violations: Apply formatter
  2. Missing type hints: Add annotations
  3. Moderate complexity: Consider refactoring
  4. Unused variables: Remove or use

Low Priority

  1. Minor style preferences: Team decision
  2. Optional type hints: Add gradually
  3. Documentation gaps: Address incrementally

Output Format

Present findings organized by severity:

Errors (must fix):

  • Type errors
  • Syntax issues
  • Critical complexity

Warnings (should fix):

  • Unused code
  • High complexity
  • Missing types in public APIs

Info (consider):

  • Style suggestions
  • Optimization opportunities
  • Best practice recommendations

Integration

Coordinate with other skills:

  • refactoring skill: For complexity reduction
  • documentation skill: For missing docstrings
  • security-scanning skill: For security-related quality issues

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.5%
按下载量换算973

Claude

32.01%
按下载量换算903

Cursor

17.18%
按下载量换算484

Gemini CLI

9.78%
按下载量换算276

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills