Agent Skillsjhd3197/ServerKit › audit-less

audit-less

GitHub

扫描 LESS 样式表,检测编译时函数使用的 CSS 自定义变量、未定义或拼写错误的变量,以及主题敏感上下文中的非原始变量,提供文件行号及修复建议。

.claude/skills/audit-less/SKILL.md jhd3197/ServerKit

Trigger Scenarios

需要检查 LESS 样式变量错误时 前端构建可能因变量问题失败时

Install

npx skills add jhd3197/ServerKit --skill audit-less -g -y
More Options

Non-standard path

npx skills add https://github.com/jhd3197/ServerKit/tree/main/.claude/skills/audit-less -g -y

Use without installing

npx skills use jhd3197/ServerKit@audit-less

指定 Agent (Claude Code)

npx skills add jhd3197/ServerKit --skill audit-less -a claude-code -g -y

安装 repo 全部 skill

npx skills add jhd3197/ServerKit --all -g -y

预览 repo 内 skill

npx skills add jhd3197/ServerKit --list

SKILL.md

Frontmatter
{
    "name": "audit-less",
    "description": "Scan LESS stylesheets for variable errors — undefined variables, CSS custom properties passed to compile-time functions (fade, darken, lighten, etc.), and incorrect variable name patterns. Reports issues with file, line, and fix.",
    "argument-hint": "[file-or-directory]"
}

Audit LESS stylesheets in ServerKit for recurring build-breaking patterns. Scope: ${ARGUMENTS:-frontend/src/styles/}

What to Scan For

Pattern 1: CSS custom properties in LESS compile-time functions

LESS functions like fade(), darken(), lighten(), saturate(), spin(), mix() require real color values at compile time. Variables defined as var(--something) will fail.

Search for calls to these functions and check if any argument is a variable that resolves to a CSS custom property.

Broken — these variables use var(--...) and cannot be evaluated by LESS:

  • @bg-body, @bg-sidebar, @bg-card, @bg-hover, @bg-elevated, @bg-secondary, @bg-tertiary
  • @border-default, @border-subtle, @border-active, @border-hover
  • @text-primary, @text-secondary, @text-tertiary
  • @accent-primary, @accent-hover, @accent-glow, @accent-shadow
  • @shadow-sm, @shadow-md, @shadow-lg
  • @color-primary

Fix: Use the corresponding *-raw variant instead (e.g., @bg-hover@bg-hover-raw, @text-tertiary@text-tertiary-raw, @accent-primary@accent-primary-raw).

Pattern 2: Undefined or misspelled variables

Check for variables that don't exist in _variables.less. Common mistakes:

  • @card-bg → should be @bg-card
  • @accent-success → should be @success
  • @accent-danger → should be @danger
  • @accent-info → should be @info
  • @accent-warning → should be @warning
  • @primary-color → should be @accent-primary or @accent-primary-raw
  • @spacing-* → should be @space-*

Pattern 3: Non-raw variables in theme-sensitive contexts

For any LESS function that manipulates color values (fade, darken, lighten, contrast, saturate, desaturate, spin, mix, tint, shade), the argument MUST be a raw hex/rgb value or a *-raw variable.

Reference: Valid Variable Names

Read frontend/src/styles/_variables.less to get the authoritative list of defined variables. Any @variable used in a .less file that is not in _variables.less (and is not a local variable or LESS built-in) is a bug.

Output Format

For each issue found, report:

[FILE]:[LINE] — [ISSUE]
  Found:    [problematic code]
  Fix:      [corrected code]

At the end, provide a summary count: X issues found across Y files. If no issues are found, report: No LESS variable issues found.

Version History

  • 46a94c9 Current 2026-08-20 07:49

Same Skill Collection

.claude/skills/audit-subprocess/SKILL.md
.claude/skills/create-pr/SKILL.md
.claude/skills/db-inspect/SKILL.md
.claude/skills/deploy/SKILL.md
.claude/skills/new-feature/SKILL.md

Metadata

Files
0
Version
46a94c9
Hash
c2d8cd61
Indexed
2026-08-20 07:49

Accueil - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-27 23:09
浙ICP备14020137号-1 $Carte des visiteurs$