AgentSkillsCN

lint-doctor

Toolr Suite UI 设计系统,适用于 React + Tailwind CSS 应用。当您需要为 seedr、configr,或其他 toolr 套件应用构建或美化 UI 组件时,此功能便能助您一臂之力。当用户输入:“美化这个组件”、“匹配 toolr 设计”、“使用我们的设计系统”、“添加提示信息”、“创建按钮”、“美化卡片”、“调整配色”,或在 toolr 套件的前端组件上进行开发时,此功能便能迅速响应。

SKILL.md
--- frontmatter
name: lint-doctor
description: |
  Diagnose and configure linting for any project based on universal best practices.
  Use when asked to: set up linting, configure ESLint, add code quality rules, fix lint config,
  set up pre-commit hooks, improve code quality tooling, or when phrases like "lint", "code quality",
  "static analysis", "eslint", "ruff", "clippy", "checkstyle" appear.
  Supports: JavaScript/TypeScript (ESLint + sonarjs, unicorn), React/Vue/Angular, Python (ruff),
  Java (Checkstyle, Google style), Rust (clippy), Go (golangci-lint). Handles monorepos.

Lint Doctor

Diagnose project environment and configure linting with universal best practices (Google style fallback).

Workflow

1. Detect Environment

Scan project root for config files:

Files FoundStack Detected
package.json, tsconfig.jsonJS/TS
package.json + react in depsReact
angular.jsonAngular
vite.config.ts + vueVue
pyproject.toml, setup.py, requirements.txtPython
pom.xml, build.gradleJava
Cargo.tomlRust
go.modGo

For monorepos: check for workspaces in package.json, multiple config files in subdirectories.

2. User Interaction

Ask initial question using AskUserQuestion:

code
header: "Mode"
question: "How should I configure linting?"
options:
  - label: "Automatic (Recommended)"
    description: "Apply best practices with sensible defaults"
  - label: "Interactive"
    description: "Ask about each configuration choice"

If Interactive, also ask:

code
header: "Strictness"
question: "What strictness level?"
options:
  - label: "Moderate (Recommended)"
    description: "Warnings for style, errors for bugs"
  - label: "Relaxed"
    description: "Mostly warnings, fewer rules"
  - label: "Strict"
    description: "More rules, errors for style violations"
code
header: "Pre-commit"
question: "Set up pre-commit hooks?"
options:
  - label: "No (Recommended)"
    description: "Just configure the linter"
  - label: "Yes"
    description: "Add husky + lint-staged for JS, or pre-commit for Python"

3. Configure

Based on detected stack, apply rules from the appropriate reference:

Priority: Enhance existing configs. Only create new files if none exist.

4. Output

  1. Show changes - Display diff of config modifications
  2. List dependencies - Show packages to install
  3. Ask to install - Use AskUserQuestion to confirm installation
  4. Ask about --fix - Offer to run auto-fix after setup
code
header: "Install"
question: "Install these dependencies?"
options:
  - label: "Yes (Recommended)"
    description: "Run npm install / pip install now"
  - label: "No"
    description: "I'll install manually"
code
header: "Auto-fix"
question: "Run auto-fix on existing code?"
options:
  - label: "Yes"
    description: "Run linter with --fix flag"
  - label: "No (Recommended)"
    description: "Just configure, don't modify code yet"

Severity Guidelines

Follow best practice conventions:

CategorySeverityExamples
Bugserrorno-undef, no-unused-vars
Securityerrorno-eval, no-implied-eval
Complexitywarncognitive-complexity, max-depth
Stylewarnprefer-const, no-var
FormattingoffLet Prettier handle it