AgentSkillsCN

pre-commit-and-tests

在本项目中进行任何提交或推送之前,先运行测试并进行预提交。在提交、推送,或当用户请求提交或推送更改时使用此功能。

SKILL.md
--- frontmatter
name: pre-commit-and-tests
description: Before any commit or push in this project, run tests and pre-commit. Use when committing, pushing, or when the user asks to commit or push changes.

Pre-commit and tests before commit/push

Rule

Before every commit or push, run:

  1. Pre-commit (includes ruff, ruff-format, migration checks, and pytest):
    bash
    pre-commit run --all-files
    
  2. If the project uses Poetry and pre-commit is not available in the current shell, run equivalent checks:
    • make lint and make format (or poetry run ruff check . --fix and poetry run ruff format .)
    • make test (or poetry run pytest)

Do not commit or push until pre-commit and tests pass. If hooks modify files (e.g. ruff --fix), stage those changes and run pre-commit again before committing.