技能 lint-and-validate
📦

lint-and-validate

低风险 ⚙️ 外部命令

在代码上运行 linting 和验证

代码修改通常会引入语法错误或违反项目规范。此技能可自动执行 linting、类型检查和安全审计,以便在提交前发现问题。

支持: Claude Codex Code(CC)
🥉 73 青铜
1

下载技能 ZIP

2

在 Claude 中上传

前往 设置 → 功能 → 技能 → 上传技能

3

开启并开始使用

测试它

正在使用“lint-and-validate”。 Run lint on the project

预期结果:

LINT RUNNER - Project: /app/myproject
Type: node
Linters: 2

Running: npm lint...
[PASS] npm lint

Running: tsc...
[FAIL] tsc
Error: src/utils.ts(15,3): Type 'string' is not assignable to type 'number'

SUMMARY
[PASS] npm lint
[FAIL] tsc

正在使用“lint-and-validate”。 Check type coverage

预期结果:

TYPE COVERAGE CHECKER

[TYPESCRIPT]
[OK] Analyzed 12 TypeScript files
[!] 3 'any' types found (acceptable)
[!] Type coverage: 65 percent (improve)

[PYTHON]
[OK] Analyzed 8 Python files
[OK] Type hints coverage: 82 percent
[OK] No 'Any' types found

TYPE COVERAGE: 1 critical issues

安全审计

低风险
v1 • 2/25/2026

Static analyzer flagged 20 patterns but all are false positives. The subprocess.run calls execute known linter commands derived from project configuration, not user input. Markdown documentation examples were incorrectly flagged as shell execution. No cryptographic code exists. The skill is safe for publication with documented external command usage.

3
已扫描文件
398
分析行数
2
发现项
1
审计总数
低风险问题 (1)
External Command Execution via Subprocess
The skill uses subprocess.run to execute linting commands. Commands are derived from project configuration files (package.json, pyproject.toml) or hardcoded linter names, not direct user input. This is legitimate for a linting tool but should be documented.

风险因素

⚙️ 外部命令 (1)
审计者: claude

质量评分

45
架构
100
可维护性
85
内容
50
社区
88
安全
91
规范符合性

你能构建什么

提交前的开发者验证

在提交代码前运行全面的 linting,确保所有更改都符合项目规范。

代码审查准备

在提交拉取请求前验证代码更改,以减少审查周期。

遗留代码现代化

在迁移旧代码库时识别类型覆盖缺口和 linting 问题。

试试这些提示

基础 lint 检查
在我的当前项目上运行 lint 和 validate 技能,检查是否有任何问题。
指定路径验证
Lint 并验证 src/components 目录中的所有文件,并修复任何可自动修复的问题。
完整项目审计
运行包括 lint、类型检查和安全审计的完整验证。生成按严重程度分类的所有发现的摘要报告。
类型覆盖分析
分析整个代码库的类型覆盖情况。识别类型覆盖低于 70% 的文件,并列出需要添加注解的未类型化函数。

最佳实践

  • 每次代码修改后都运行 linting,而不仅仅是在提交前
  • 在运行验证前,在项目根目录文件中配置 linter 规则
  • 立即修复类型错误,而不是累积技术债务

避免

  • 为赶截止日期而跳过验证会在生产环境中引入 bug
  • 忽略类型检查器错误会导致运行时故障
  • 运行 linter 时不使用 --fix 参数会错过自动修复

常见问题

如果我的项目没有配置 linter 会怎样?
该技能会检测缺失的配置并建议创建带有适当设置的 .eslintrc、tsconfig.json 或 pyproject.toml 文件。
这个技能能否自动修复所有 linting 错误?
不能。--fix 参数可以处理自动修复的问题,如格式化。逻辑错误、类型不匹配和复杂违规需要手动修复。
这是否适用于 monorepo?
可以。使用特定项目路径参数运行此技能可以验证 monorepo 结构中的单个包。
验证需要多长时间?
典型运行在 5 到 30 秒内完成。每个 linter 对于大型代码库有 120 秒的超时限制。
支持哪些语言?
支持 Node.js、TypeScript 和 Python。其他语言需要自定义 linter 集成。
我的代码会被发送到外部服务吗?
不是。所有 linting 都在本地运行,使用已安装的工具。不会将任何代码传输到外部服务。

开发者详情

文件结构