AgentSkillsCN

quality-gates

当用户希望对 lazyopencode 项目执行代码质量检查(如 linting、格式化、类型检查、测试)时,应使用此技能。当用户被要求“运行质量门”“检查代码”“运行测试”“对代码进行 linting”或在提交前验证代码质量时,可使用此技能。

SKILL.md
--- frontmatter
name: quality-gates
description: This skill should be used when the user wants to run code quality checks (linting, formatting, type checking, tests) on the lazyopencode project. Use this skill when asked to "run quality gates", "check the code", "run tests", "lint the code", or verify code quality before committing.

Quality Gates

Run code quality checks for the lazyopencode project. This skill executes the same checks used in pre-commit hooks plus tests.

Quality Checks

The following checks are run in order:

CheckCommandPurpose
Ruff Lintuv run ruff check src tests --fixLint code and auto-fix issues
Ruff Formatuv run ruff format src testsFormat code consistently
Mypyuv run mypy srcStatic type checking
Pytestuv run pytest tests/ -qRun test suite

Usage

To run all quality gates:

bash
scripts/check_quality.sh

Or run individual checks as needed using the commands above.

Workflow

  1. Run the scripts/check_quality.sh script from the project root
  2. Review any failures and fix issues
  3. Re-run until all checks pass
  4. Present user with concise summary of results in markdown table format

Common Issues

  • Ruff lint failures: Usually auto-fixed. If not, check the error message for manual fixes needed.
  • Mypy errors: Type annotation issues. Add or fix type hints as indicated.
  • Test failures: Review test output, fix failing tests or underlying code.