Token导航 LogoToken导航

Agent Skill · 前端设计

code-standards-checker(代码标准检查器)

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

code-standards-checker 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证为 MIT,第三方扫描已通过,按安装量在前端设计类的 10,216 个 Skill 里排第 7,705。

总安装 349周安装 15GitHub Stars 8下载 122核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/kanopi/cms-cultivator --skill code-standards-checker

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

用于自动检查代码是否符合既定风格指南。强调一致性降低认知负担与提升协作效率。适用于团队协作与自动化流水线集成。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。基于可读性优先原则制定通用规则。

code-standards-checker 属于前端设计类 Skill,可作为该场景下的辅助能力补充。支持社区标准采纳与工具化强制执行。

来源仓库内路径:skills/code-standards-checker

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/kanopi/cms-cultivator --skill code-standards-c…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

code-standards-checker 怎么安装?

在终端执行 npx skills add https://github.com/kanopi/cms-cultivator --skill code-standards-checker。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

code-standards-checker 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

code-standards-checker 需要什么权限?

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

code-standards-checker 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

code-standards-checker 用的人多吗?

公开数据是累计安装 349 次,近一周安装 15 次,下载 122 次,GitHub 8 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

code-standards-checker 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理前端设计类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
frontend-design

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
code-standards-checker

代码标准检查器 · 本页

3498需要联网MIT通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Code Standards Checker

Automatically check code against coding standards and style guides.

Philosophy

Consistent code style makes collaboration seamless and reduces cognitive load.

Core Beliefs

  1. Standards Reduce Friction: Consistent style means less time debating formatting
  2. Automated Enforcement Saves Time: Tools catch style issues faster than humans
  3. Community Standards Build Better Software: Following established patterns improves code quality
  4. Readability is Paramount: Code is read far more often than it's written

Why Coding Standards Matter

  • Team Collaboration: Everyone writes code the same way
  • Easier Maintenance: Consistent patterns are easier to understand and modify
  • Fewer Bugs: Many standards prevent common mistakes
  • Professional Quality: Shows attention to detail and best practices

When to Use This Skill

Activate this skill when the user:

  • Asks "does my code follow standards?"
  • Mentions "coding standards", "code style", or "best practices"
  • Asks "is this code compliant?"
  • References "PHPCS", "ESLint", "WordPress Coding Standards", or "Drupal Coding Standards"
  • Shows code and asks if it's properly formatted
  • Asks "should I lint this?"

Decision Framework

Before running standards checks, consider:

What Platform Is This?

  1. Drupal → Use Drupal Coding Standards (via PHPCS)
  2. WordPress → Use WordPress Coding Standards (via PHPCS)
  3. Generic PHP → Use PSR-12 (via PHPCS)
  4. JavaScript → Use ESLint with project config
  5. Mixed → Run both PHP and JavaScript checks

What's the Scope?

  • Specific file(s) - User shows code or mentions file → Check that file
  • Recent changes - User mentions "my changes" → Check git diff
  • Entire project - User says "whole project" → Run project-wide check
  • Directory - User mentions component/module → Check that directory

What Standard Should Apply?

Automatic detection:

  • Drupal project → Drupal Coding Standards
  • WordPress project → WordPress Coding Standards
  • .eslintrc present → Use project's ESLint config
  • composer.json with PHPCS → Use configured standard

User-specified:

  • User mentions specific standard → Use that standard
  • No config found → Suggest installing standards tools

Should This Auto-Fix?

  • ✅ Yes - User asks "can you fix these?" → Provide --fix commands
  • ❌ No - Just checking compliance → Report violations only
  • ⚠️ Ask - Many violations found → Suggest auto-fix option

Decision Tree

User asks about standards
    ↓
Detect platform (Drupal/WordPress/Generic)
    ↓
Determine scope (file/changes/project)
    ↓
Check for existing config (.phpcs.xml, .eslintrc)
    ↓
Run appropriate tool
    ↓
Report violations
    ↓
Auto-fix? → Provide --fix commands if requested

Workflow

1. Detect Project Type

Check for indicators:

Drupal:

# Check for Drupal
test -f web/core/lib/Drupal.php && echo "Drupal project"
test -f docroot/core/lib/Drupal.php && echo "Drupal project"

WordPress:

# Check for WordPress
test -f wp-config.php && echo "WordPress project"
test -f web/wp-config.php && echo "WordPress project"

JavaScript/Frontend:

# Check for Node project
test -f package.json && echo "Node project"

2. Quick Start for Kanopi Projects

For projects with Kanopi DDEV add-ons:

Drupal/WordPress:

# Run all code quality checks
ddev composer code-check

# Individual checks
ddev composer phpstan      # Static analysis
ddev composer phpcs        # Coding standards
ddev composer rector-check # Modernization check

Themes with Node:

# ESLint for JavaScript
ddev theme-npm run lint
# or
ddev exec npm run lint

3. Manual Analysis (Non-Kanopi Projects)

PHP Standards (Drupal/WordPress)

Check if PHPCS is available:

test -f vendor/bin/phpcs && echo "PHPCS found"

Run PHPCS:

# Drupal
vendor/bin/phpcs --standard=Drupal,DrupalPractice web/modules/custom

# WordPress
vendor/bin/phpcs --standard=WordPress wp-content/themes/custom-theme
vendor/bin/phpcs --standard=WordPress wp-content/plugins/custom-plugin

Common Issues to Report:

  • Missing docblocks
  • Incorrect indentation (2 spaces for Drupal, tabs for WordPress)
  • Line length violations
  • Naming conventions (camelCase vs snake_case)
  • Missing/incorrect type hints
JavaScript Standards

Check if ESLint is available:

test -f node_modules/.bin/eslint && echo "ESLint found"

Run ESLint:

npx eslint src/**/*.js
npx eslint themes/custom/js/**/*.js

Common Issues to Report:

  • Missing semicolons (or extra semicolons)
  • Incorrect quotes (single vs double)
  • Unused variables
  • Console.log statements
  • Missing JSDoc comments

4. Analyze Specific Code Snippet

If user shows code without running tools:

PHP Analysis Checklist:

  • ✅ Proper indentation (2 spaces Drupal, 4 spaces or tabs WordPress)
  • ✅ Opening braces on same line (PHP) or next line (JS)
  • ✅ Docblocks present for functions/classes
  • ✅ Type hints for parameters and return types
  • ✅ No deprecated functions
  • ✅ SQL queries use placeholders (no concatenation)
  • ✅ Strings use proper quotes (single for non-interpolated)

JavaScript Analysis Checklist:

  • ✅ Consistent semicolon usage
  • ✅ Proper quote style (single or double, consistent)
  • ✅ No var (use const or let)
  • ✅ Arrow functions where appropriate
  • ✅ Proper JSDoc comments
  • ✅ No console.log in production code

5. Report Results

Format:

## Code Standards Check Results

**Project Type**: Drupal 10
**Standard**: Drupal Coding Standards + DrupalPractice

### Summary
- ✅ 45 files checked
- ⚠️ 12 warnings
- ❌ 3 errors

### Errors (Must Fix)

1. **Missing type hint** - `src/Controller/MyController.php:23`

public function process($data) { // Missing type hint


**Fix**: Add type hint `public function process(array $data): void {`

1. **SQL Injection Risk** - `src/Service/UserService.php:45` `db_query("SELECT * FROM users WHERE id = ". $id);` **Fix**: Use placeholders `db_query("SELECT * FROM users WHERE id =:id", [':id' => $id]);`

### Warnings (Should Fix)

1. **Line too long** - `src/Form/MyForm.php:67`
  - Line length: 95 characters (exceeds 80)
  - Consider breaking into multiple lines

### Quick Fixes Available

Run this to auto-fix formatting issues:

ddev composer code-fix

or manually

vendor/bin/phpcbf --standard=Drupal web/modules/custom

Integration with CMS Cultivator

This skill complements the /quality-standards slash command:

  • This Skill: Automatically triggered during conversation

- "Is this code up to standards?" - "Does this follow Drupal conventions?" - Quick checks on code snippets

  • /quality-standards Command: Explicit full project scan

- Comprehensive standards check - CI/CD integration - Full project analysis

Platform-Specific Standards

Drupal Coding Standards

Key Conventions:

  • 2-space indentation
  • Opening brace on same line
  • Type hints required (PHP 7.4+)
  • Drupal-specific naming (snake_case for functions, PascalCase for classes)
  • Services over procedural code
  • Dependency injection preferred

Example Good Code:

<?php

namespace Drupal\mymodule\Controller;

use Drupal\Core\Controller\ControllerBase;

/**
 * Provides route responses for the My Module module.
 */
class MyModuleController extends ControllerBase {

  /**
   * Returns a render array for the page.
   *
   * @return array
   *   A render array.
   */
  public function content(): array {
    return [
      '#markup' => $this->t('Hello World'),
    ];
  }

}

WordPress Coding Standards

Key Conventions:

  • Tab indentation (not spaces)
  • Yoda conditions (if (true === $condition))
  • Braces on next line for control structures
  • WordPress naming (underscores, not camelCase)
  • Escaping and sanitization required
  • Nonces for forms

Example Good Code:

<?php
/**
 * Display user dashboard widget.
 *
 * @param int $user_id User ID.
 * @return void
 */
function my_theme_display_dashboard( $user_id ) {
	if ( ! is_user_logged_in() ) {
		return;
	}

	$user_data = get_userdata( $user_id );

	if ( ! $user_data ) {
		return;
	}

	echo '<div class="dashboard">';
	echo '<h2>' . esc_html( $user_data->display_name ) . '</h2>';
	echo '</div>';
}

JavaScript Standards

Modern JavaScript Best Practices:

// Good: const/let, arrow functions, template literals
const getUserName = (user) => {
  return `${user.firstName} ${user.lastName}`;
};

// Bad: var, function keyword, concatenation
var getUserName = function(user) {
  return user.firstName + ' ' + user.lastName;
};

Common Standards Violations

High Priority (Security/Functionality)

  1. SQL Injection

- Direct query string concatenation - Missing prepared statements

  1. XSS Vulnerabilities

- Unescaped output - Missing sanitization

  1. Missing Access Checks

- No permission verification - Unauthenticated endpoints

Medium Priority (Maintainability)

  1. Missing Type Hints
  2. Poor Function/Variable Names
  3. Missing Documentation
  4. Overly Long Functions
  5. Deep Nesting

Low Priority (Style)

  1. Whitespace Issues
  2. Line Length
  3. Brace Placement
  4. Comment Formatting

Example Interactions

Example 1: Quick snippet check

User: "Is this WordPress code following standards?"
[Shows code with tabs and proper escaping]

Skill: "Let me check that against WordPress Coding Standards...
✅ Proper tab indentation
✅ Output properly escaped with esc_html()
✅ Correct brace placement
⚠️ Missing docblock - should document the function

Overall: Good! Just add a docblock."

Example 2: Project-wide check

User: "Does my custom module follow Drupal standards?"

Skill: "I'll run PHPCS on your custom module...
[Runs ddev composer phpcs or vendor/bin/phpcs]

Found 3 errors and 12 warnings across 8 files.
Most common issues:
- Missing type hints (5 occurrences)
- Lines too long (7 occurrences)

Would you like me to show the specific issues or run the auto-fixer?"

Resources

平台分布

Cursor

29.95%
按下载量换算37

weavefox

24.1%
按下载量换算29

Codex

19.2%
按下载量换算23

Claude Code

11.83%
按下载量换算14

Antigravity

4.46%
按下载量换算5

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

继续浏览同类 Skills