code-quality-check

General code quality check: an automated tool run before code submission that applies checks according to project type to assess code quality.

Last repository push
GitHub Stars
126
Forks
23
Issues / PRs
0

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "code-quality-check" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-675fefc3cebc8fe13f08ce8d88a9fef9e3ed96501bb0312eaf055500cf3230c1. Verify the upstream source and version against https://github.com/ryfineZ/my-ai-skills before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

github.com

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

General code quality check: an automated tool run before code submission that applies checks according to project type to assess code quality.

0 Downloads

Introduction source: third_party · ryfineZ · 0.0.1 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: code-quality-check
description: 通用代码质量检查。在提交代码前自动执行,根据项目类型应用对应的检查规则
argument-hint: [项目路径]
disable-model-invocation: false

compatibility:
  claude-code: full
  codex: basic
  gemini: basic

通用代码质量检查 Skill

在提交代码前自动检查代码质量,根据项目类型智能应用对应的检查规则。


🎯 核心特性

1. 智能项目类型识别

自动检测项目类型,无需手动配置:

  • Obsidian 插件:检测 manifest.json 中的 Obsidian 特征
  • 浏览器扩展:检测 manifest.json 中的 manifest_version
  • React/Vue/Angular:检测 package.json 中的依赖
  • Electron 应用:检测 package.json 中的 Electron
  • 通用项目:其他所有项目

2. 分层检查规则

根据项目类型应用不同级别的规则:

通用规则(所有项目)
    ↓
前端规则(前端项目)
    ↓
平台特定规则(Obsidian/浏览器扩展/Electron)

3. 模块化设计

规则独立管理,易于扩展:

code-quality-check/
├── SKILL.md
└── scripts/
    ├── check.sh           # 主检查脚本
    └── rules/             # 规则库
        ├── common.sh      # 通用规则
        ├── frontend.sh    # 前端规则
        └── obsidian.sh    # Obsidian 规则

📋 检查规则

通用规则(所有项目)

规则 级别 说明
硬编码的敏感信息 🔴 必须修复 API key、password、secret、token
正则表达式控制字符 🔴 必须修复 \x00-\x1f 等控制字符
未使用的变量 🟡 建议优化 ESLint 检测

前端规则(React/Vue/前端项目)

规则 级别 说明
innerHTML/outerHTML 🔴 必须修复 XSS 安全风险
dangerouslySetInnerHTML 🟡 建议优化 React 特定(需注意)
console.log 残留 🟡 建议优化 生产环境清理

Obsidian 插件规则

规则 级别 说明
直接创建 style 元素 🔴 必须修复 必须使用 styles.css
导入 Node.js 模块 🔴 必须修复 禁止 fs、path 等模块

🚀 使用方式

自动触发(推荐)

通过 commit-conventional skill 自动触发:

# 1. 修改代码
# 2. 暂存文件
git add .

# 3. 触发提交(会自动执行检查)
# 对 AI 说:"帮我提交代码"

手动触发

# 在项目根目录运行
bash ~/.claude/skills/code-quality-check/scripts/check.sh

# 或指定项目路径
bash ~/.claude/skills/code-quality-check/scripts/check.sh /path/to/project

🔧 常见问题修复

1. innerHTML/outerHTML(XSS 风险)

❌ 错误:

element.innerHTML = `<div class="content">${text}</div>`;

✅ 修复:

// 通用方案
const div = document.createElement('div');
div.className = 'content';
div.textContent = text;
element.appendChild(div);

// Obsidian 专用
const div = element.createEl('div', { cls: 'content', text: text });

2. 创建 style 元素(Obsidian)

❌ 错误:

const style = document.createElement('style');
style.textContent = '.my-class { color: red; }';
document.head.appendChild(style);

✅ 修复: 将 CSS 移到 styles.css 文件

3. Node.js 模块(Obsidian)

❌ 错误:

import fs from 'fs';
const content = fs.readFileSync('file.txt', 'utf-8');

✅ 修复:

const file = this.app.vault.getAbstractFileByPath('file.txt');
if (file instanceof TFile) {
    const content = await this.app.vault.read(file);
}

4. 硬编码敏感信息

❌ 错误:

const apiKey = "sk_live_1234567890abcdef";

✅ 修复:

// 使用环境变量或用户配置
const apiKey = this.settings.apiKey;

🎯 与 commit-conventional 集成

本 Skill 已集成到 commit-conventional 中,在提交时自动执行。


版本:v2.0(通用代码质量检查) 最后更新:2026-01-23

Current listing version

0.0.1

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value85/100

Highlights

  • 支持多种项目类型的智能识别和对应检查规则
  • 提供分层检查机制,从通用到特定平台的完整覆盖
  • 与commit-conventional集成实现自动化检查流程
Trigger Precision88/100

Highlights

  • 触发描述清晰明确,涵盖主要功能和使用场景
  • argument-hint参数定义合理,便于用户理解使用方法
Structure and Standards92/100

Highlights

  • 文档结构完整,包含特性介绍、规则说明、使用指南和常见问题
  • 提供详细的代码示例和修复方案,便于开发者理解和实施
  • frontmatter配置完整,符合Skill开发规范
Execution Reliability45/100

Areas to improve

  • 缺少实际执行脚本文件 Reported severity: Major

    文档中提到了scripts/check.sh主检查脚本和rules目录下的规则文件,但实际未提供这些关键执行文件的内容

    Recommendation: 需要提供完整的脚本实现,包括check.sh主脚本和各个规则文件(common.sh, frontend.sh, obsidian.sh)的具体内容

Evidence Verifiability (mean of the first four)78/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.