安全诊断并修复 ESLint error、warning 和配置兼容问题。用于用户要求运行 lint、解释 ESLint 报错、限定范围自动修复或迁移 ESLint 配置时;优先使用项目锁定的包管理器与版本,先预检再修改,不自动下载最新版或批量改写无关源码。
npx skills add https://github.com/laolaoshiren/claude-code-skills-zh --skill eslint-fix
读取:
package.json 中的 scripts、devDependencies 和 packageManager。eslint.config.*、.eslintrc.*、.eslintignore、Prettier 和 TypeScript 配置。优先运行仓库已有的 lint script。只有确认 ESLint 已被当前项目锁定并安装时,才使用对应包管理器的本地执行方式。若缺失依赖,先报告;安装包、更新 lockfile 或迁移配置需要单独授权。
先对用户指定或本轮相关范围运行不修改文件的检查,记录:
不要默认扫描整个大型仓库,也不要用未锁定依赖、可能联网下载新版本的 npx 调用。
--fix-dry-run、JSON 输出或等价能力判断预计改动。--fix,不自动扩大到整个仓库。no-explicit-any、未处理 Promise、React Hooks 依赖等语义规则,结合类型、调用方和运行路径修改,不能机械替换。常见可自动修复规则包括 semi、quotes、indent、no-trailing-spaces、comma-dangle、arrow-parens 和 prefer-const;dry-run 和 diff 只能预览改动,最终仍需按风险运行类型检查、测试或构建。
实际修改后:
## ESLint 检查结果
- 范围:
- ESLint / 包管理器版本:
- 基线:X error,Y warning
- 实际命令与退出状态:
## 修改
| 文件 | 规则 | 处理方式 |
|------|------|----------|
## 复验
- lint:
- 类型检查 / 测试 / 构建:
- 未解决问题与原因:
Use when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation
Use when completing tasks, implementing major features, or before merging to verify work meets requirements
Execute git commit with conventional commit message analysis, intelligent staging, and message generation. Use when user asks to commit changes, create a git commit, or mentions "/commit". Supports: (1) Auto-detecting type and scope from changes, (2) Generating conventional commit messages from diff, (3) Interactive commit with optional type/scope/description overrides, (4) Intelligent file staging for logical grouping
Comprehensive GitHub code review with AI-powered swarm coordination
Behavioral guidelines to reduce common LLM coding mistakes. Use when writing, reviewing, or refactoring code to avoid overcomplication, make surgical changes, surface assumptions, and define verifiable success criteria.
Use this skill to review code. It supports both local changes (staged or working tree) and remote Pull Requests (by ID or URL). It focuses on correctness, maintainability, and adherence to project standards.
Refactor bloated AGENTS.md, CLAUDE.md, or similar agent instruction files to follow progressive disclosure principles. Splits monolithic files into organized, linked documentation.
Create high-quality git commits: review/stage intended changes, split into logical commits, and write clear commit messages (including Conventional Commits). Use when the user asks to commit, craft a commit message, stage changes, or split work into multiple commits.
Take laolaoshiren/eslint-fix from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.