lint-and-validate
它能做什么
这个工具会检查你的代码是否编写得整洁、正确,并遵循项目设定的规则。它能帮你在错误造成问题之前及时发现。
适用场景
- ✓在修改代码之后。
- ✓在完成任务或交付成果之前。
- ✓当项目设有格式和类型检查规则时。
技能链接
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/lint-and-validate/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“帮我检查一下我的 Python 代码是否整洁,有没有类型错误。”
每周 5 个新技能,1 分钟读完。
工作原理
这个工具会运行项目专用的命令,检查代码质量和类型是否正确。它会报告每项检查是通过还是失败,以及哪些检查无法运行。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Lint and Validate
When to Use
Use after behavior or configuration changes when a repository has relevant lint or type checks. Read the repository's instructions and package scripts first. Run focused checks during development and the required checks before completion.
Procedure
- Identify the changed languages, configured commands, and installed tools. Inspect package scripts before executing them: a script named
lintcan modify files or run arbitrary project code. - Run the project's read-only lint/type-check commands. For Node projects, prefer declared scripts such as
npm run lintandnpm run typecheck. Do not usenpxto silently fetch an absent checker. - For Python, use configured, already installed tools such as
ruff check .ormypy .. Do not assume everypyproject.tomlconfigures both. Never add--fixwithout inspecting the proposed changes and the task's authorization. - Fix relevant failures without deleting user work, weakening rules, or raising timeouts just to pass. If a required tool is unavailable, report the exact check that did not run.
- Report commands, exit results, scope and remaining limitations. Passing lint does not prove the absence of runtime or security defects.
Example
After correcting a TypeScript behavior, inspect package.json, run the configured focused regression test, then npm run lint and npm run typecheck if those scripts exist. If TypeScript is declared but not installed, report the missing local checker; do not substitute a downloaded package or call the result a pass.
Bundled helpers
python scripts/lint_runner.py /absolute/project: runs a conservative set of candidate checks. Node fallback checkers must exist in localnode_modules/.bin; Python candidates must be installed. Inspect the project scripts first. A missing command or failing check exits 1; no configured checks or invalid project metadata exits 2. Exit 0 means the invoked checks passed, not that every needed check was discovered. Python detection is heuristic and may suggest unconfigured Ruff/MyPy commands.python scripts/type_coverage.py /absolute/project: read-only annotation inventory, despite its retained compatibility filename. Samples at most 30 files per language, skips links and build/dependency directories, and bounds file reads. Python uses AST nodes to avoid double-counting functions. TypeScript reports lexical: anyoccurrences, including possible comments and strings. No quality percentage or pass/fail threshold is inferred. Exit 2 means no applicable files; parse/read errors exit 1.
Limitations
The runner executes trusted project commands, which may mutate files or access the network. It does not install dependencies, detect every monorepo configuration, or replace the project's CI contract. The inventory is a bounded source sample, not semantic type coverage; inferred types, generics, decorator behavior and correctness require the actual type checker. Do not label unrun checks as successful.
常见问题
什么是 lint 和类型检查?
它们是自动检查工具,能帮你发现拼写错误、格式问题和代码中的不一致之处,让代码更易读、更好维护。
这个工具会自动修复错误吗?
不会,它只负责找出错误。看过修改建议后,你需要自己手动修复。
检查“没有运行”是什么意思?
这表示工具无法执行该项检查,可能是因为所需的工具没有安装,或者在项目中配置不正确。
详情
作者的原始描述
Run configured lint and type checks, distinguish failures from checks that did not run, and report concrete validation results.
热度
- GitHub 星标
- 48k
- 排名
- #5068
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
00-andruia-consultant
48k帮你的智能体启动或改进 AI 项目。它可以分析代码、推荐工具,并用西班牙语制定行动计划。
007
48k让你的智能体执行安全审计和威胁建模。它有助于保护项目免受攻击和漏洞的威胁。
10-andruia-skill-smith
48k帮你的智能体创建或改进 AI 工具。它可以定义工具的工作方式、编写文档,并验证其结构。
20-andruia-niche-intelligence
48k让你的智能体创建某个特定行业的摘要。它有助于借助可靠的信息来源,了解项目的背景、规则、使用模式和风险。