lintro-verify
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseVerify Lintro Tool Implementation
验证Lintro工具实现
Use this skill to verify that a lintro tool implementation is complete and follows all
project standards.
使用此技能来验证lintro工具的实现是否完整且符合所有
项目标准。
Usage
使用方法
When asked to verify a tool (e.g., ), run through all checklist
items below.
/lintro-verify tsc当被要求验证某个工具(例如 )时,逐一检查以下所有清单项。
/lintro-verify tsc1. Core Implementation
1. 核心实现
Plugin Definition
插件定义
- exists
lintro/tools/definitions/<tool>.py - Uses decorator from
@register_toollintro.plugins.registry - Inherits from
BaseToolPlugin - includes:
ToolDefinition- - tool identifier (lowercase)
name - - clear description of what the tool does
description - - list of glob patterns (e.g.,
file_patterns)["*.ts", "*.tsx"] - - appropriate
tool_typeenum valueToolType - - boolean indicating if tool supports auto-fix
can_fix - - list of config files the tool uses (e.g.,
native_configs)["tsconfig.json"] - - command to check version (e.g.,
version_command)["tsc", "--version"] - - execution priority (default 50)
priority
- method implemented
check() - method implemented (or raises
fix()ifNotImplementedError)can_fix=False - Options defined with proper types and defaults
- 文件存在
lintro/tools/definitions/<tool>.py - 使用了 中的
lintro.plugins.registry装饰器@register_tool - 继承自
BaseToolPlugin - 包含以下内容:
ToolDefinition- - 工具标识符(小写)
name - - 工具功能的清晰描述
description - - 通配符模式列表(例如
file_patterns)["*.ts", "*.tsx"] - - 合适的
tool_type枚举值ToolType - - 布尔值,指示工具是否支持自动修复
can_fix - - 工具使用的配置文件列表(例如
native_configs)["tsconfig.json"] - - 检查版本的命令(例如
version_command)["tsc", "--version"] - - 执行优先级(默认值50)
priority
- 实现了 方法
check() - 实现了 方法(如果
fix(),则抛出can_fix=False)NotImplementedError - 使用正确的类型和默认值定义了选项
Parser
解析器
- directory exists with:
lintro/parsers/<tool>/- - exports parser and issue classes
__init__.py - - parses tool output into issues
<tool>_parser.py - - issue dataclass with
<tool>_issue.pymethodto_display_row()
- Parser handles all output formats the tool produces
- Parser handles edge cases (empty output, errors, warnings)
- 目录存在,包含:
lintro/parsers/<tool>/- - 导出解析器和问题类
__init__.py - - 将工具输出解析为问题
<tool>_parser.py - - 带有
<tool>_issue.py方法的问题数据类to_display_row()
- 解析器能处理工具生成的所有输出格式
- 解析器能处理边缘情况(空输出、错误、警告)
Enums (if needed)
枚举(如有需要)
- Tool added to if it has a
lintro/enums/tool_name.pyenumToolName
- 如果工具拥有 枚举,已将其添加到
ToolNamelintro/enums/tool_name.py
Version Management
版本管理
- Version added to (for external tools)
lintro/_tool_versions.py - Install hint added to
lintro/tools/core/version_checking.pytemplatesget_install_hints() - Version is reasonably current (check latest: or
npm view <tool> version)brew info <tool>
- 版本已添加到 (针对外部工具)
lintro/_tool_versions.py - 安装提示已添加到 的
lintro/tools/core/version_checking.py模板中get_install_hints() - 版本为合理的当前版本(检查最新版本:或
npm view <tool> version)brew info <tool>
Version Consistency (CRITICAL)
版本一致性(关键)
- All version sources are aligned:
- version
lintro/_tool_versions.py - version (for npm tools)
package.json - Plugin in tool definition
min_version - version
lintro/tools/manifest.json
- Renovate custom manager exists in for
renovate.json_tool_versions.py - uses caret (^) prefix matching
package.json(e.g., ^0.27.0)_tool_versions.py - Plugin equals or is less than
min_versionversion_tool_versions.py
- 所有版本源保持一致:
- 中的版本
lintro/_tool_versions.py - 中的版本(针对npm工具)
package.json - 工具定义中的插件
min_version - 中的版本
lintro/tools/manifest.json
- 中存在针对
renovate.json的Renovate自定义管理器_tool_versions.py - 使用脱字符(^)前缀匹配
package.json中的版本(例如 ^0.27.0)_tool_versions.py - 插件 等于或小于
min_version中的版本_tool_versions.py
Doctor Health Check
Doctor健康检查
- Tool added to in
TOOL_COMMANDSlintro/cli_utils/commands/doctor.py - shows tool with correct version (no "No cmd defined")
lintro doctor
- 工具已添加到 的
lintro/cli_utils/commands/doctor.py中TOOL_COMMANDS - 显示工具的正确版本(无"No cmd defined"提示)
lintro doctor
Command Builder (if needed)
命令构建器(如有需要)
- If tool needs special command building, added to
lintro/tools/core/command_builders.py
- 如果工具需要特殊的命令构建逻辑,已添加到
lintro/tools/core/command_builders.py
CLI Option Verification
CLI选项验证
- Run and compare against implemented
<tool> --helpparametersset_options() - Verify each option is a real CLI flag (not config-file-only)
- Test actually work:
--tool-optionslintro check . --tools <tool> --tool-options "<tool>:option=value" - Document which settings are CLI-available vs config-file-only in docs
- 运行 并与已实现的
<tool> --help参数进行对比set_options() - 验证每个选项都是真实的CLI标志(而非仅支持配置文件)
- 测试 实际可用:
--tool-optionslintro check . --tools <tool> --tool-options "<tool>:option=value" - 在文档中记录哪些设置支持CLI配置、哪些仅支持配置文件
Native Config Integration
原生配置集成
- Run (if available) to see default config structure
<tool> --init - If tool has config file with useful settings, check if
should parse it
lintro/utils/native_parsers.py - Verify in ToolDefinition lists all supported config files
native_configs
- 运行 (如果可用)查看默认配置结构
<tool> --init - 如果工具的配置文件包含有用设置,检查是否需要在 中解析它
lintro/utils/native_parsers.py - 验证 中的
ToolDefinition列出了所有支持的配置文件native_configs
2. Documentation
2. 文档
README.md
README.md
- Tool added to Supported Tools table with badge, language, and fix support
- Tool added to Optional External Tools list (for external tools) with install commands
- 工具已添加到支持的工具表格中,包含徽章、语言和修复支持信息
- 工具已添加到可选外部工具列表(针对外部工具),并附带安装命令
docs/getting-started.md
docs/getting-started.md
- Tool added to Optional External Tools section with install instructions
- Usage example section added (if tool has unique features)
- 工具已添加到可选外部工具章节,包含安装说明
- 添加了使用示例章节(如果工具具有独特功能)
docs/configuration.md
docs/configuration.md
- Full configuration section added including:
- Tool description
- Installation instructions (all methods: brew, npm/bun, pip, etc.)
- Native config file example
- Available table
--tool-options - Usage examples
- 添加了完整的配置章节,包括:
- 工具描述
- 安装说明(所有方式:brew、npm/bun、pip等)
- 原生配置文件示例
- 可用的 表格
--tool-options - 使用示例
docs/tool-analysis/{tool}-analysis.md
docs/tool-analysis/{tool}-analysis.md
- Tool analysis document created following the standard format:
- Overview of what the tool does
- Core Tool Capabilities (native features)
- Lintro Implementation Analysis:
- Preserved Features (what lintro exposes)
- Limited / Missing (what's NOT available via lintro)
- Enhancements (what lintro adds: timeout, normalization, etc.)
- Usage Comparison (native vs lintro commands)
- Configuration Strategy
- Priority and Conflicts
- Recommendations (when to use lintro vs native tool)
- 已按照标准格式创建工具分析文档:
- 工具功能概述
- 核心工具能力(原生功能)
- Lintro实现分析:
- 保留的功能(lintro暴露的功能)
- 受限/缺失的功能(无法通过lintro使用的功能)
- 增强功能(lintro添加的功能:超时、标准化等)
- 使用对比(原生命令vs lintro命令)
- 配置策略
- 优先级与冲突
- 使用建议(何时使用lintro vs 原生工具)
3. Tests
3. 测试
Unit Tests
单元测试
- directory with:
tests/unit/tools/<tool>/- - definition attributes, default options, set_options validation
test_options.py - - check/fix with mocked subprocess
test_execution.py
- - parser tests covering:
tests/unit/parsers/test_<tool>_parser.py- Single error/warning parsing
- Multiple issues parsing
- Empty output handling
- Edge cases (different file extensions, paths, etc.)
- output
to_display_row()
- 目录包含:
tests/unit/tools/<tool>/- - 定义属性、默认选项、set_options验证
test_options.py - - 模拟子进程的check/fix测试
test_execution.py
- - 解析器测试覆盖:
tests/unit/parsers/test_<tool>_parser.py- 单个错误/警告解析
- 多个问题解析
- 空输出处理
- 边缘情况(不同文件扩展名、路径等)
- 输出
to_display_row()
Integration Tests
集成测试
- with:
tests/integration/tools/test_<tool>_integration.py- for when tool not installed
pytest.mark.skipif - Fixtures for test files (with issues and clean)
- - name, can_fix
test_definition_attributes - - correct patterns
test_definition_file_patterns - - detects problems
test_check_file_with_issues - - no false positives
test_check_clean_file - - handles gracefully
test_check_empty_directory - - options work correctly
test_set_options
- 包含:
tests/integration/tools/test_<tool>_integration.py- 工具未安装时的 标记
pytest.mark.skipif - 测试文件的夹具(包含问题和无问题的文件)
- - 名称、can_fix验证
test_definition_attributes - - 正确的模式验证
test_definition_file_patterns - - 检测问题的验证
test_check_file_with_issues - - 无假阳性的验证
test_check_clean_file - - 优雅处理空目录的验证
test_check_empty_directory - - 选项功能正常的验证
test_set_options
- 工具未安装时的
Test Samples
测试样本
- directory with:
test_samples/tools/<language>/<tool>/- - file with deliberate issues (verify tool detects them)
<tool>_violations.<ext> - - valid file without issues (verify no false positives)
<tool>_clean.<ext>
- Violations file triggers actual tool errors when run directly:
<tool> <violations_file>
- 目录包含:
test_samples/tools/<language>/<tool>/- - 包含故意问题的文件(验证工具能检测到)
<tool>_violations.<ext> - - 无问题的有效文件(验证无假阳性)
<tool>_clean.<ext>
- 直接运行工具时,违规文件会触发实际错误:
<tool> <violations_file>
4. CI/CD & Docker
4. CI/CD & Docker
Dockerfile.tools
Dockerfile.tools
- Tool version verification added (e.g., )
tsc --version && \
- 添加了工具版本验证(例如 )
tsc --version && \
Dockerfile (runtime)
Dockerfile(运行时)
- Tool binary/wrapper copied from builder stage
- For Node.js tools: wrapper script created in
/usr/local/bin/
- 工具二进制文件/包装器已从构建阶段复制过来
- 针对Node.js工具:已在 创建包装器脚本
/usr/local/bin/
scripts/utils/install-tools.sh
scripts/utils/install-tools.sh
- Tool added to help text description
- Installation block added with version from
_tool_versions.py - Tool added to "Installed tools" echo list
- Tool added to array
tools_to_verify
- 工具已添加到帮助文本描述中
- 添加了安装块,使用 中的版本
_tool_versions.py - 工具已添加到“已安装工具”回显列表
- 工具已添加到 数组
tools_to_verify
scripts/ci/tools-image-verify.sh
scripts/ci/tools-image-verify.sh
- Tool version check added
- 添加了工具版本检查
.github/workflows/tools-image.yml
.github/workflows/tools-image.yml
- Verify trigger paths include relevant files (usually automatic via Dockerfile.tools)
- 验证触发路径包含相关文件(通常通过Dockerfile.tools自动实现)
5. User Experience
5. 用户体验
lintro list-tools
lintro list-tools
- Tool appears with correct name, language, actions, priority, config type
- 工具显示正确的名称、语言、操作、优先级、配置类型
Error Handling
错误处理
- Graceful handling when tool not installed
- Clear error messages with install hints
- No crashes on malformed tool output
- 工具未安装时能优雅处理
- 清晰的错误消息,附带安装提示
- 工具输出格式错误时不会崩溃
Install Hints
安装提示
- All common installation methods documented (brew, npm/bun, pip, cargo, etc.)
- Version placeholders work correctly in hints
- 已记录所有常见安装方式(brew、npm/bun、pip、cargo等)
- 提示中的版本占位符能正常工作
6. Verification Commands
6. 验证命令
Run these to verify implementation:
bash
undefined运行以下命令验证实现:
bash
undefinedUnit tests
单元测试
uv run pytest tests/unit/tools/<tool>/ tests/unit/parsers/test_<tool>_parser.py -v
uv run pytest tests/unit/tools/<tool>/ tests/unit/parsers/test_<tool>_parser.py -v
Integration tests (requires tool installed)
集成测试(需要安装工具)
uv run pytest tests/integration/tools/test_<tool>_integration.py -v
uv run pytest tests/integration/tools/test_<tool>_integration.py -v
Test on sample files
在样本文件上测试
uv run lintro check test_samples/tools/<language>/<tool>/ --tools <tool>
uv run lintro check test_samples/tools/<language>/<tool>/ --tools <tool>
Verify tool appears in list
验证工具出现在列表中
uv run lintro list-tools | grep <tool>
uv run lintro list-tools | grep <tool>
Full lint check
完整的lint检查
uv run lintro chk
uv run lintro chk
Full test suite
完整测试套件
uv run pytest tests/ -v
undefineduv run pytest tests/ -v
undefinedVersion Consistency Verification
版本一致性验证
bash
undefinedbash
undefinedCheck all version sources are aligned (replace <tool> with actual name)
检查所有版本源是否一致(将<tool>替换为实际名称)
echo "=== _tool_versions.py ===" && grep "<tool>" lintro/_tool_versions.py
echo "=== manifest.json ===" && grep -A3 '"<tool>"' lintro/tools/manifest.json
echo "=== package.json ===" && grep "<tool>" package.json
echo "=== Plugin min_version ===" && grep "min_version" lintro/tools/definitions/<tool>.py
echo "=== Renovate manager ===" && grep -A5 '"<tool>"' renovate.json | head -10
echo "=== Doctor TOOL_COMMANDS ===" && grep "<tool>" lintro/cli_utils/commands/doctor.py
undefinedecho "=== _tool_versions.py ===" && grep "<tool>" lintro/_tool_versions.py
echo "=== manifest.json ===" && grep -A3 '"<tool>"' lintro/tools/manifest.json
echo "=== package.json ===" && grep "<tool>" package.json
echo "=== Plugin min_version ===" && grep "min_version" lintro/tools/definitions/<tool>.py
echo "=== Renovate manager ===" && grep -A5 '"<tool>"' renovate.json | head -10
echo "=== Doctor TOOL_COMMANDS ===" && grep "<tool>" lintro/cli_utils/commands/doctor.py
undefinedCLI Option Verification Commands
CLI选项验证命令
bash
undefinedbash
undefinedCompare native CLI options against lintro implementation
对比原生CLI选项与lintro实现
<tool> --help
<tool> --help
Check version currency
检查版本时效性
npm view <tool> version # for npm packages
brew info <tool> # for Homebrew packages
pip index versions <tool> # for Python packages
npm view <tool> version # 针对npm包
brew info <tool> # 针对Homebrew包
pip index versions <tool> # 针对Python包
Test that tool-options actually work (should not error)
测试tool-options实际可用(不应报错)
uv run lintro check test_samples/ --tools <tool> --tool-options "<tool>:timeout=60"
uv run lintro check test_samples/ --tools <tool> --tool-options "<tool>:timeout=60"
Test each documented option (replace with actual options)
测试每个已记录的选项(替换为实际选项)
uv run lintro check . --tools <tool> --tool-options "<tool>:option_name=value"
uv run lintro check . --tools <tool> --tool-options "<tool>:option_name=value"
Generate default config to understand structure
生成默认配置以了解结构
<tool> --init # if available
---<tool> --init # 如果可用
---7. Common Issues to Check
7. 需要检查的常见问题
- No "Missing install hints for tools" warning when running lintro
- Tool respects passed via CLI
--tool-options - Tool uses native config file when present
- Parser correctly maps severity levels
- File paths in issues are correct (relative vs absolute)
- Line/column numbers are 1-indexed (not 0-indexed)
- Tool timeout is configurable and has reasonable default
- CLI options actually exist - verify with (some tools only support options via config file)
<tool> --help - Version is current - check if pinned version is significantly outdated
- Config-file-only options are not exposed as (will cause runtime errors)
--tool-options - Version consistency - ,
_tool_versions.py, and pluginpackage.jsonare alignedmin_version - Renovate manager - custom regex manager exists in for external tools
renovate.json
- 运行lintro时无“Missing install hints for tools”警告
- 工具遵守通过CLI传递的
--tool-options - 工具存在原生配置文件时会使用它
- 解析器正确映射严重级别
- 问题中的文件路径正确(相对路径vs绝对路径)
- 行/列号为1索引(而非0索引)
- 工具超时可配置且具有合理默认值
- CLI选项确实存在 - 使用 验证(部分工具仅支持通过配置文件设置选项)
<tool> --help - 版本为当前版本 - 检查固定版本是否已显著过时
- 仅支持配置文件的选项未作为 暴露(会导致运行时错误)
--tool-options - 版本一致性 - 、
_tool_versions.py和插件package.json保持一致min_version - Renovate管理器 - 针对外部工具的自定义正则管理器已存在于
renovate.json
Review Output Format
评审输出格式
After reviewing, provide a summary:
text
undefined评审完成后,提供摘要:
text
undefinedTool Review: <tool_name>
工具评审: <tool_name>
Status: PASS / FAIL / PARTIAL
状态: PASS / FAIL / PARTIAL
Checklist Summary
清单摘要
- Core Implementation: X/Y items
- Documentation: X/Y items
- Tests: X/Y items
- CI/Docker: X/Y items
- User Experience: X/Y items
- 核心实现: X/Y项
- 文档: X/Y项
- 测试: X/Y项
- CI/Docker: X/Y项
- 用户体验: X/Y项
Missing Items
缺失项
- [item description]
- [item description]
- [项描述]
- [项描述]
Recommendations
建议
- [recommendation]
- [recommendation]
undefined- [建议内容]
- [建议内容]
undefined