Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

eslint-detector

БесплатноБез исполняемых скриптовНе проверен

Detects ESLint configuration and available commands in a repository. Returns structured JSON output designed for consumption by the quality-gates-linter…

alex-popov-techот alex-popov-tech★ 94 звезды на GitHub20 установок в других каталогах

Об этом скилле

Purpose

Detect ESLint presence and available commands in a repository, returning structured JSON data specifically formatted for the quality-gates-linter agent to consume.

When to Use

Invoke this skill during Phase 0 (Environment Detection) of the quality-gates-linter agent workflow to:

  • Verify ESLint is configured in the repository
  • Identify available ESLint commands (check and fix)
  • Locate command sources for the agent to read directly

This skill should NOT be invoked for general code review or linting tasks - only for environment detection.

Detection Process

Step 1: Check for ESLint Configuration

Search for ESLint configuration files using Glob tool:

  • .eslintrc.js
  • .eslintrc.json
  • .eslintrc.yml
  • .eslintrc.yaml
  • eslint.config.js (flat config)
  • package.json (check for eslintConfig field)

If NO configuration files found:

  • Set eslintDetected: false
  • Return early with minimal JSON structure

If configuration files found:

  • Set eslintDetected: true
  • Record all found config files with paths and types
  • Proceed to Step 2

Step 2: Detect ESLint Commands

Search for ESLint commands in priority order:

2a. Check CLAUDE.md (Highest Priority)

If CLAUDE.md exists:

  • Read the file
  • Search for sections: "Linting", "Development Commands", "Code Quality", "Common Commands"
  • Look for command patterns:
    • Check commands: eslint, lint, make lint, npm run lint
    • Fix commands: eslint --fix, lint-fix, make lint-fix, npm run lint:fix
  • Extract exact commands mentioned
  • Record CLAUDE.md as source if commands found

2b. Check package.json Scripts

Read package.json and examine the scripts section:

Lint check commands (look for these script names):

  • "lint"
  • "eslint"
  • "lint:check"
  • Extract as: npm run <script-name>

Lint fix commands (look for these script names):

  • "lint:fix"
  • "lint-fix"
  • "fix"
  • "eslint:fix"
  • Extract as: npm run <script-name>

Record package.json as source if commands found.

2c. Check Makefile

If Makefile exists:

  • Read the file
  • Search for targets containing eslint or lint
  • Common target patterns:
    • Check: lint, eslint, check
    • Fix: lint-fix, fix, format
  • Extract as: make <target-name>
  • Record Makefile as source if commands found

2d. Fallback Commands

If no commands found in any source:

  • Use fallback commands:
    • Check: npx eslint .
    • Fix: npx eslint --fix .
  • Record source as: "fallback"

Step 3: Build JSON Response

Construct JSON object with this exact structure:

{
  "eslintDetected": true,
  "configFiles": [
    {
      "path": ".eslintrc.json",
      "type": "eslintrc"
    },
    {
      "path": "package.json",
      "type": "package-config"
    }
  ],
  "commands": {
    "check": {
      "command": "npm run lint",
      "source": "package.json"
    },
    "fix": {
      "command": "npm run lint:fix",
      "source": "package.json"
    }
  },
  "commandSources": [
    "package.json"
  ]
}

Field Specifications:

  • eslintDetected (boolean): true if config found, false otherwise
  • configFiles (array): List of all ESLint config files found
    • path (string): Relative path to config file
    • type (string): Config type ("eslintrc", "eslint-config-js", "package-config")
  • commands (object): Contains check and fix commands
    • check (object): Lint check command
      • command (string): Exact command to run
      • source (string): Where command was found
    • fix (object): Lint fix command
      • command (string): Exact command to run
      • source (string): Where command was found
  • commandSources (array): Ordered list of sources where commands were found

Step 4: Return JSON

Output the JSON structure in a code block with clear formatting:

## ESLint Detection Results

```json
{
  "eslintDetected": true,
  "configFiles": [...],
  "commands": {...},
  "commandSources": [...]
}
```

**Summary:**
- ESLint detected: Yes/No
- Config files: <count>
- Commands source: <primary source>

Priority Rules

  1. Command Priority: CLAUDE.md > package.json > Makefile > fallback
  2. Use First Match: For each command type (check/fix), use the first match found
  3. Source Transparency: Always record where commands were found
  4. Config Completeness: List ALL config files found, not just the first one

Edge Cases

Multiple config files found:

  • List all in configFiles array
  • No impact on command detection

Command found in multiple sources:

  • Use highest priority source (CLAUDE.md wins)
  • Record only the used source in commandSources

Only check OR only fix command found:

  • Return the found command
  • For missing command, use fallback for that specific type

No ESLint config found:

{
  "eslintDetected": false,
  "configFiles": [],
  "commands": {},
  "commandSources": []
}

ESLint config found but no commands:

{
  "eslintDete
Полный SKILL.md на GitHub

Установить eslint-detector в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл eslint-detector?

Detects ESLint configuration and available commands in a repository. Returns structured JSON output designed for consumption by the quality-gates-linter agent. Checks for ESLint config files, extracts lint commands from package.json, Makefile, and CLAUDE.md, and provides command sources for the agent to read directly.

Как установить скилл eslint-detector?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл eslint-detector запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить eslint-detector с