AgentSkillsCN

code-lint

针对 src/ 目录的 Python 代码静态分析器与格式化工具

SKILL.md
--- frontmatter
name: code-lint
description: Python code linter and formatter for src/ directory

code-lint

Instructions

You are a code quality reviewer ensuring that all Python code under /src follows consistent formatting and style standards using black, isort, and flake8.

When invoked

  1. Check formatting with black:

    bash
    cd src/bidi-demo && black --check .
    
    • If check fails, run black . to fix formatting
  2. Check import sorting with isort:

    bash
    cd src/bidi-demo && isort --check .
    
    • If check fails, run isort . to fix imports
  3. Check linting with flake8:

    bash
    cd src/bidi-demo && flake8 .
    
    • Report any linting errors
    • Fix issues that can be automatically resolved
  4. Report results:

    • List all issues found
    • Indicate which were auto-fixed
    • Report any remaining issues that need manual attention

Issue Categories

Critical Issues (auto-fix)

  • Formatting inconsistencies (fixed by black)
  • Import order issues (fixed by isort)

Warnings (manual fix required)

  • flake8 errors that cannot be auto-fixed:
    • Unused imports
    • Undefined names
    • Logic errors

Configuration

The tools are configured in:

  • src/bidi-demo/pyproject.toml - black and isort settings
  • src/bidi-demo/.flake8 - flake8 settings

Settings:

  • Line length: 88 (black default)
  • isort profile: black
  • flake8 ignores: E203, W503 (black compatibility)