ワンクリックで
code-quality-check
通用代码质量检查。在提交代码前自动执行,根据项目类型应用对应的检查规则
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
通用代码质量检查。在提交代码前自动执行,根据项目类型应用对应的检查规则
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Use when diagnosing central skill repository drift, especially when platform links look inconsistent, .skill-source.json metadata may be incomplete, verify.sh reports issues, or you want a one-command health check before larger maintenance.
Use when maintaining shared ui-polish references, helper scripts, demo assets, or bridge documents that support the ui-polish bundle.
Use when you need the non-negotiable ui-polish rules for UI direction, color, copy, spacing, readability, button feedback, and layout restraint before making interface decisions.
提升 Web、H5、小程序、Chrome 扩展、移动应用、Electron、Tauri 和桌面应用的界面质感、层级与一致性。用于任何涉及页面、组件、弹窗、设置页、面板、工具窗口、仪表盘或设计重构的任务,尤其当用户要求更好看、更高级、更有质感、更专业、减少 AI 味时。
Use before claiming a UI is done, polished, or good-looking to run the ui-polish blocking checks, lightweight validation, and final visual review.
UI/UX design intelligence for web and mobile. Includes 50+ styles, 161 color palettes, 57 font pairings, 161 product types, 99 UX guidelines, and 25 chart types across 10 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind, shadcn/ui, and HTML/CSS). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, and check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, and mobile app. Elements: button, modal, navbar, sidebar, card, table, form, and chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, and flat design. Topics: color systems, accessibility, animation, layout, typography, font pairing, spacing, interaction states, shadow, and gradient. Integrations: shadcn/ui MCP for component search and examples.
| name | code-quality-check |
| description | 通用代码质量检查。在提交代码前自动执行,根据项目类型应用对应的检查规则 |
| argument-hint | ["项目路径"] |
| disable-model-invocation | false |
| compatibility | {"claude-code":"full","codex":"basic","gemini":"basic"} |
在提交代码前自动检查代码质量,根据项目类型智能应用对应的检查规则。
自动检测项目类型,无需手动配置:
manifest.json 中的 Obsidian 特征manifest.json 中的 manifest_versionpackage.json 中的依赖package.json 中的 Electron根据项目类型应用不同级别的规则:
通用规则(所有项目)
↓
前端规则(前端项目)
↓
平台特定规则(Obsidian/浏览器扩展/Electron)
规则独立管理,易于扩展:
code-quality-check/
├── SKILL.md
└── scripts/
├── check.sh # 主检查脚本
└── rules/ # 规则库
├── common.sh # 通用规则
├── frontend.sh # 前端规则
└── obsidian.sh # Obsidian 规则
| 规则 | 级别 | 说明 |
|---|---|---|
| 硬编码的敏感信息 | 🔴 必须修复 | API key、password、secret、token |
| 正则表达式控制字符 | 🔴 必须修复 | \x00-\x1f 等控制字符 |
| 未使用的变量 | 🟡 建议优化 | ESLint 检测 |
| 规则 | 级别 | 说明 |
|---|---|---|
| innerHTML/outerHTML | 🔴 必须修复 | XSS 安全风险 |
| dangerouslySetInnerHTML | 🟡 建议优化 | React 特定(需注意) |
| console.log 残留 | 🟡 建议优化 | 生产环境清理 |
| 规则 | 级别 | 说明 |
|---|---|---|
| 直接创建 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
❌ 错误:
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 });
❌ 错误:
const style = document.createElement('style');
style.textContent = '.my-class { color: red; }';
document.head.appendChild(style);
✅ 修复:
将 CSS 移到 styles.css 文件
❌ 错误:
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);
}
❌ 错误:
const apiKey = "sk_live_1234567890abcdef";
✅ 修复:
// 使用环境变量或用户配置
const apiKey = this.settings.apiKey;
本 Skill 已集成到 commit-conventional 中,在提交时自动执行。
版本:v2.0(通用代码质量检查) 最后更新:2026-01-23