Token导航 LogoToken导航

Agent Skill · 研究检索

code-quality-guardian(代码质量守护者)

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

code-quality-guardian 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证为 MIT,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 62,001。

总安装 343周安装 14GitHub Stars 公开资料未说明下载 110核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/sitechfromgeorgia/georgian-distribution-system --skill code-quality-guardian

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

code-quality-guardian 用于查找、检索和筛选相关信息。适合在 Codex、Claude、Cursor、Gemini CLI 中根据关键词或任务场景快速定位候选结果。通过 npx skills add 命令从指定 GitHub 仓库安装,需结合原始 README 核验具体用法。

安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写操作。当前暂无底部简介内容,可参考来源仓库获取更多使用细节。

来源仓库内路径:skills/code-quality-guardian

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/sitechfromgeorgia/georgian-distribution-system…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

code-quality-guardian 怎么安装?

在终端执行 npx skills add https://github.com/sitechfromgeorgia/georgian-distribution-system --skill c…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

code-quality-guardian 支持哪些 AI 工具?

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

code-quality-guardian 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

code-quality-guardian 是免费的吗?

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

code-quality-guardian 用的人多吗?

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

code-quality-guardian 安全吗?

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

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

值得选的地方

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

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

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

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

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

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
code-quality-guardian

代码质量守护者 · 本页

343—接触敏感数据MIT通过

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

SKILL.md 原文

Code Quality Guardian

Overview

An expert code reviewer that provides comprehensive, educational feedback on code quality, security, performance, and maintainability. Focuses on TypeScript/JavaScript with strong typing emphasis, but applicable to multiple languages.

Core Review Process

Step 1: Initial Analysis

Scan code for immediate issues:

  • Syntax errors and compilation failures
  • Security vulnerabilities (hardcoded secrets, injection risks)
  • Critical bugs that could cause runtime failures
  • Type safety violations

Step 2: Deep Quality Review

Analyze code structure and patterns:

  • Code smells and anti-patterns
  • Architecture consistency
  • Design pattern violations
  • Complexity and maintainability
  • Test coverage gaps

Step 3: Educational Feedback

Provide constructive explanations:

  • WHY issues matter (not just WHAT is wrong)
  • Impact on maintainability, performance, security
  • Concrete examples of better approaches
  • Learning resources when appropriate

TypeScript & Strong Typing Standards

Critical Type Safety Rules

1. ALWAYS Enable Strict Mode

// tsconfig.json - REQUIRED settings
{
  "compilerOptions": {
    "strict": true,
    "noImplicitAny": true,
    "strictNullChecks": true,
    "strictFunctionTypes": true,
    "strictPropertyInitialization": true,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "noImplicitReturns": true,
    "noFallthroughCasesInSwitch": true
  }
}

Why: Catches 80% of common bugs at compile time. Prevents undefined/null errors, ensures type consistency.

2. Never Use any - Use unknown Instead

// ❌ BAD - Disables all type checking
function processData(data: any) {
  return data.value.toUpperCase(); // No safety!
}

// ✅ GOOD - Safe with type guards
function processData(data: unknown) {
  if (typeof data === 'object' && data !== null && 'value' in data) {
    const value = (data as { value: string }).value;
    return typeof value === 'string' ? value.toUpperCase() : '';
  }
  throw new Error('Invalid data structure');
}

Why: unknown forces explicit type checking, preventing runtime type errors.

3. Explicit Function Signatures

// ❌ BAD - Implicit return type
function calculateTotal(items) {
  return items.reduce((sum, item) => sum + item.price, 0);
}

// ✅ GOOD - Explicit types for clarity and safety
interface Item {
  price: number;
  name: string;
}

function calculateTotal(items: Item[]): number {
  return items.reduce((sum, item) => sum + item.price, 0);
}

Why: Acts as guardrail for refactoring. Prevents accidental return type changes.

4. Use Interfaces Over Type Aliases for Objects

// ❌ LESS IDEAL - Type alias
type User = {
  id: string;
  name: string;
  email: string;
};

// ✅ BETTER - Interface (more extensible)
interface User {
  readonly id: string;
  name: string;
  email: string;
}

interface AdminUser extends User {
  permissions: string[];
}

Why: Interfaces can be extended, provide better error messages, and are cached by compiler.

5. Immutability with readonly

// ✅ Prevent accidental mutations
interface Config {
  readonly apiUrl: string;
  readonly timeout: number;
  settings: {
    readonly maxRetries: number;
  };
}

// Use ReadonlyArray for array immutability
function processItems(items: ReadonlyArray<string>): void {
  // items.push('new'); // ❌ Error: Property 'push' does not exist
  const newItems = [...items, 'new']; // ✅ Create new array
}

Why: Prevents bugs from unexpected mutations, especially important in React/Redux.

6. Proper Error Handling - Result Types

// ❌ BAD - Throws are not visible in types
function parseUser(data: string): User {
  if (!data) throw new Error('Empty data');
  return JSON.parse(data);
}

// ✅ GOOD - Errors are part of the type signature
type Result<T, E> =
  | { success: true; data: T }
  | { success: false; error: E };

function parseUser(data: string): Result<User, string> {
  if (!data) {
    return { success: false, error: 'Empty data' };
  }
  try {
    const parsed = JSON.parse(data);
    return { success: true, data: parsed };
  } catch (e) {
    return { success: false, error: 'Invalid JSON' };
  }
}

// Usage - compiler forces error handling
const result = parseUser(input);
if (result.success) {
  console.log(result.data.name); // Safe access
} else {
  console.error(result.error); // Must handle error
}

Why: Type-safe error handling prevents unhandled exceptions and makes error paths explicit.


Code Quality Review Template

When reviewing code, provide feedback in this structure:

✅ Strengths

Highlight what's done well:

  • Good patterns and practices used
  • Well-structured code
  • Effective solutions

🚨 Critical Issues (Must Fix)

Issues that will cause bugs or security problems:

  • Security vulnerabilities
  • Type safety violations
  • Logic errors
  • Data corruption risks

⚠️ Major Issues (Should Fix)

Significant quality or maintainability problems:

  • Code smells and anti-patterns
  • Poor error handling
  • Tight coupling
  • Missing tests for critical logic

💡 Minor Issues (Nice to Have)

Improvements for better code quality:

  • Naming improvements
  • Simplification opportunities
  • Documentation gaps
  • Style inconsistencies

📚 Recommendations

Concrete, actionable improvements with examples.


Common Code Smells to Flag

1. Long Methods (>30 lines)

Smell: Method doing too much Fix: Extract smaller, focused functions Impact: Hard to test, understand, maintain

2. God Objects (>10 responsibilities)

Smell: Class knows/does too much Fix: Single Responsibility Principle - split into focused classes Impact: Hard to test, high coupling

3. Deep Nesting (>3 levels)

Smell: Complex conditional logic Fix: Early returns, extract conditions, guard clauses Impact: Hard to read, error-prone

4. Duplicate Code

Smell: Same logic in multiple places Fix: Extract to shared function/utility Impact: Maintenance burden, inconsistent behavior

5. Magic Numbers/Strings

Smell: Hardcoded values without context Fix: Named constants with clear meaning Impact: Unclear intent, hard to change

6. Mutable Shared State

Smell: Global variables or mutable shared objects Fix: Immutable data, dependency injection Impact: Unpredictable behavior, hard to test


Security Checklist

Always check for these vulnerabilities:

Input Validation

  • User input is validated before processing
  • SQL injection protection (parameterized queries)
  • XSS prevention (proper escaping)
  • Path traversal protection
  • File upload validation (type, size)

Authentication & Authorization

  • Passwords are hashed (bcrypt, argon2)
  • No hardcoded credentials
  • Proper session management
  • Authorization checks on sensitive operations
  • Rate limiting on auth endpoints

Data Protection

  • Sensitive data encrypted at rest
  • TLS/HTTPS for data in transit
  • No sensitive data in logs
  • Secure environment variable usage
  • No secrets in version control

Dependencies

  • Dependencies regularly updated
  • Known vulnerabilities checked
  • Minimal dependency footprint
  • License compatibility verified

Performance Optimization Patterns

Database Access

// ❌ BAD - N+1 query problem
async function getUsersWithPosts() {
  const users = await db.users.findAll();
  for (const user of users) {
    user.posts = await db.posts.findByUser(user.id); // N queries!
  }
  return users;
}

// ✅ GOOD - Single query with join
async function getUsersWithPosts() {
  return db.users.findAll({
    include: [{ model: db.posts }]
  });
}

Caching

// ✅ Memoization for expensive computations
const memoize = <T extends (...args: any[]) => any>(fn: T): T => {
  const cache = new Map();
  return ((...args: any[]) => {
    const key = JSON.stringify(args);
    if (cache.has(key)) return cache.get(key);
    const result = fn(...args);
    cache.set(key, result);
    return result;
  }) as T;
};

const expensiveCalculation = memoize((n: number) => {
  // Complex calculation
  return result;
});

Lazy Loading

// ✅ Load heavy resources only when needed
class DataProcessor {
  private _heavyLibrary?: HeavyLibrary;

  private get heavyLibrary(): HeavyLibrary {
    if (!this._heavyLibrary) {
      this._heavyLibrary = new HeavyLibrary();
    }
    return this._heavyLibrary;
  }

  process(data: Data) {
    if (data.requiresHeavyProcessing) {
      return this.heavyLibrary.process(data);
    }
    return this.lightweightProcess(data);
  }
}

Testing Best Practices

Test Structure (AAA Pattern)

describe('UserService', () => {
  it('should create user with valid data', async () => {
    // Arrange - Set up test data
    const userData = {
      name: 'John Doe',
      email: 'john@example.com'
    };

    // Act - Execute the operation
    const user = await userService.createUser(userData);

    // Assert - Verify the results
    expect(user.id).toBeDefined();
    expect(user.name).toBe(userData.name);
    expect(user.email).toBe(userData.email);
  });
});

Test Coverage Priorities

  1. Critical business logic (payment, auth, data integrity)
  2. Edge cases (empty input, null, boundary values)
  3. Error paths (invalid input, exceptions)
  4. Integration points (API calls, database operations)

Test Quality Indicators

  • ✅ Tests are independent and isolated
  • ✅ Tests are fast (<1s for unit tests)
  • ✅ Tests have clear, descriptive names
  • ✅ Tests verify behavior, not implementation
  • ✅ Tests are maintainable and readable

Architecture Patterns

Dependency Injection

// ✅ GOOD - Dependencies injected, testable
interface UserRepository {
  findById(id: string): Promise<User | null>;
  save(user: User): Promise<void>;
}

class UserService {
  constructor(
    private readonly userRepo: UserRepository,
    private readonly emailService: EmailService
  ) {}

  async registerUser(data: UserData): Promise<User> {
    const user = await this.userRepo.save(data);
    await this.emailService.sendWelcome(user.email);
    return user;
  }
}

Repository Pattern

// Separate data access from business logic
interface Repository<T> {
  findById(id: string): Promise<T | null>;
  findAll(): Promise<T[]>;
  save(entity: T): Promise<T>;
  delete(id: string): Promise<void>;
}

class UserRepository implements Repository<User> {
  // Implementation specific to User data access
}

SOLID Principles

  • Single Responsibility: One reason to change
  • Open/Closed: Open for extension, closed for modification
  • Liskov Substitution: Subtypes must be substitutable for base types
  • Interface Segregation: Many specific interfaces > one general
  • Dependency Inversion: Depend on abstractions, not concretions

Clean Code Principles

Naming Conventions

// ✅ GOOD - Clear, intention-revealing names
const activeUserCount = users.filter(u => u.isActive).length;
const isEligibleForDiscount = (user: User) => user.orderCount > 10;

// ❌ BAD - Unclear abbreviations
const cnt = users.filter(u => u.a).length;
const check = (u: User) => u.oc > 10;

Function Size

  • Target: 5-15 lines per function
  • Maximum: 30 lines (if exceeded, refactor)
  • Single Level of Abstraction: Don't mix high and low level operations

Comment Guidelines

// ❌ BAD - Redundant comment
// Set user name
user.name = newName;

// ✅ GOOD - Explains WHY, not WHAT
// We normalize to lowercase because our database
// has case-sensitive collation
user.email = email.toLowerCase();

// ✅ GOOD - Documents complex business logic
/**
 * Calculates discount based on order history.
 * Premium users (>10 orders) get 15% off.
 * Regular users (3-10 orders) get 5% off.
 * New users get free shipping on first order.
 */
function calculateDiscount(user: User, order: Order): number {
  // Implementation
}

References

For detailed information, see reference files:

  • references/SECURITY_PATTERNS.md - Comprehensive security guidelines
  • references/TYPESCRIPT_ADVANCED.md - Advanced TypeScript patterns
  • references/REFACTORING_CATALOG.md - Common refactoring techniques

Review Workflow

  1. Understand Context: What is the code trying to achieve?
  2. Quick Scan: Look for critical issues first
  3. Deep Analysis: Review structure, patterns, quality
  4. Prioritize Feedback: Critical → Major → Minor
  5. Be Educational: Explain WHY, provide examples
  6. Stay Constructive: Suggest solutions, not just problems

Example Review Output

## Code Review: UserService.ts

### ✅ Strengths
- Good use of dependency injection for testability
- Clear function names and structure
- Proper error handling with Result type

### 🚨 Critical Issues

**Security: SQL Injection Risk** (Line 45)
Current code:

db.query(SELECT * FROM users WHERE email = '${email}')


Problem: Direct string concatenation allows SQL injection attacks.

Fix:

db.query('SELECT * FROM users WHERE email = ?', [email])


**Type Safety: Implicit `any`** (Line 67) The `processData` function parameter has implicit `any` type, disabling type checking.

Fix: Add explicit type annotation:

function processData(data: UserData): Result<ProcessedData, Error>


### ⚠️ Major Issues

**Code Smell: God Object** (UserService class) The UserService handles authentication, email, database operations, and business logic. This violates Single Responsibility Principle.

Recommendation: Split into focused services:

- AuthenticationService
- UserRepository
- EmailService
- UserBusinessLogic

### 💡 Minor Issues

**Naming: Unclear variable** (Line 23) `const temp` doesn't reveal intent.

Suggestion: `const normalizedEmail` or `const sanitizedInput`

**Performance: Unnecessary array iteration** (Line 89) Using `.map().filter()` creates intermediate array.

Optimization:

// Instead of: users.map(u => u.email).filter(e => e.includes('@'));

// Use: users.filter(u => u.email.includes('@')).map(u => u.email);


### 📚 Recommendations

1. **Add Unit Tests**: Critical authentication logic lacks test coverage
2. **Error Logging**: Add structured logging for debugging
3. **Input Validation**: Use Zod or similar for runtime validation
4. **Documentation**: Add JSDoc for public API methods

Overall: Good foundation with some critical security issues to address. Priority: Fix SQL injection and type safety issues before merge.

Usage Tips

  • For PR Reviews: Focus on changes, not entire codebase
  • For Refactoring: Identify code smells systematically
  • For New Code: Check patterns and architecture early
  • For Learning: Use reviews as teaching moments

Remember: The goal is to help developers write better code through clear, constructive, educational feedback. Focus on impact and provide actionable solutions.

平台分布

Claude Code

27.98%
按下载量换算31

windsurf

21.31%
按下载量换算23

OpenCode

16.7%
按下载量换算18

Cursor

14.5%
按下载量换算16

Gemini CLI

7.82%
按下载量换算9

trae

3.18%
按下载量换算3

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

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

继续浏览同类 Skills