Detects ESLint configuration and available commands in a repository. Returns structured JSON output designed for consumption by the quality-gates-linter agent...
Detect ESLint presence and available commands in a repository, returning structured JSON data specifically formatted for the quality-gates-linter agent to consume.
Invoke this skill during Phase 0 (Environment Detection) of the quality-gates-linter agent workflow to:
This skill should NOT be invoked for general code review or linting tasks - only for environment detection.
Search for ESLint configuration files using Glob tool:
.eslintrc.js.eslintrc.json.eslintrc.yml.eslintrc.yamleslint.config.js (flat config)package.json (check for eslintConfig field)If NO configuration files found:
eslintDetected: falseIf configuration files found:
eslintDetected: trueSearch for ESLint commands in priority order:
If CLAUDE.md exists:
eslint, lint, make lint, npm run linteslint --fix, lint-fix, make lint-fix, npm run lint:fixRead package.json and examine the scripts section:
Lint check commands (look for these script names):
"lint""eslint""lint:check"npm run <script-name>Lint fix commands (look for these script names):
"lint:fix""lint-fix""fix""eslint:fix"npm run <script-name>Record package.json as source if commands found.
If Makefile exists:
eslint or lintlint, eslint, checklint-fix, fix, formatmake <target-name>If no commands found in any source:
npx eslint .npx eslint --fix ."fallback"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 otherwiseconfigFiles (array): List of all ESLint config files foundpath (string): Relative path to config filetype (string): Config type ("eslintrc", "eslint-config-js", "package-config")commands (object): Contains check and fix commandscheck (object): Lint check commandcommand (string): Exact command to runsource (string): Where command was foundfix (object): Lint fix commandcommand (string): Exact command to runsource (string): Where command was foundcommandSources (array): Ordered list of sources where commands were foundOutput 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>
Multiple config files found:
configFiles arrayCommand found in multiple sources:
commandSourcesOnly check OR only fix command found:
No ESLint config found:
{
"eslintDetected": false,
"configFiles": [],
"commands": {},
"commandSources": []
}
ESLint config found but no commands:
{
"eslintDetected": true,
"configFiles": [{...}],
"commands": {
"check": {
"command": "npx eslint .",
"source": "fallback"
},
"fix": {
"command": "npx eslint --fix .",
"source": "fallback"
}
},
"commandSources": ["fallback"]
}
The quality-gates-linter agent will:
eslintDetected to decide whether to proceed or exitcommands.check.command for verification runscommands.fix.command for auto-fix attemptscommandSources if needed for additional contextThe JSON structure is designed to provide everything the linter agent needs without requiring additional file reads for command detection.