ai-agent-lint

star 27

AI Agent code quality check - Use Ruff to check code standards for LangChain, AutoGen, and other AI Agent projects

y1feng200156 By y1feng200156 schedule Updated 2/10/2026

name: ai-agent-lint description: AI Agent code quality check - Use Ruff to check code standards for LangChain, AutoGen, and other AI Agent projects

AI Agent Lint Skill

๐Ÿ“‹ Overview

This skill uses Ruff (an extremely fast Python linter) to check AI Agent project code quality, specifically targeting:

  • LangChain applications
  • AutoGen multi-agent systems
  • CrewAI collaborative agents
  • General AI Agent development projects

๐Ÿ”ง Prerequisites

Tool Min Version Check Command Installation
Python 3.10+ python --version python.org
Ruff 0.1.0+ ruff --version pip install ruff

Note: If Ruff is not installed, the script will provide a friendly prompt instead of failing.

๐Ÿš€ Usage

Method 1: Use AI Assistant

Tell the AI directly:

"Use ai-agent-lint skill to check my project"

AI will automatically:

  1. Read this SKILL.md to understand usage
  2. Execute the check script
  3. Report found issues

Method 2: Run Script Directly

Windows (PowerShell):

.\.agent\skills\ai-agent-lint\scripts\lint.ps1

Linux/Mac (Bash):

./.agent/skills/ai-agent-lint/scripts/lint.sh

Method 3: Specify Target Directory

# Windows
.\.agent\skills\ai-agent-lint\scripts\lint.ps1 -Path ".\src"

# Linux/Mac
./.agent/skills/ai-agent-lint/scripts/lint.sh src

๐ŸŽฏ What It Checks

Python Code Standards

  • โœ… PEP 8 style compliance
  • โœ… Type hint completeness
  • โœ… Import statement ordering
  • โœ… Unused variables and imports
  • โœ… Code complexity check

AI Agent Specific Checks

  • โœ… Prompt template string safety
  • โœ… Hardcoded API key detection
  • โœ… Async code patterns
  • โœ… Error handling completeness
  • โœ… Resource leak detection (unclosed LLM clients)

Security Checks

  • โš ๏ธ eval() and exec() usage warnings
  • โš ๏ธ SQL injection risks
  • โš ๏ธ Sensitive data logging
  • โš ๏ธ Unsafe deserialization

๐Ÿ“Š Output Example

๐Ÿ” AI Agent Lint - Checking project...

๐Ÿ“ Scanning directory: C:\Users\WJ\Desktop\MyAgent
๐Ÿ“ฆ Detected: LangChain project

โœ… src/main.py - No issues
โš ๏ธ  src/agent.py:15:1 - F401 [unused-import] 'os' imported but unused
โŒ src/config.py:23:5 - S105 [hardcoded-password-string] Possible hardcoded password

โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
๐Ÿ“Š Check Results:
   โœ… Passed: 45 files
   โš ๏ธ  Warnings: 3 issues
   โŒ Errors: 1 issue
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

๐Ÿ’ก Tip: Run 'ruff check --fix' to auto-fix some issues

โš™๏ธ Configuration

Create pyproject.toml or ruff.toml in the project root to customize rules:

# pyproject.toml
[tool.ruff]
line-length = 88
target-version = "py310"

[tool.ruff.lint]
select = [
    "E",    # pycodestyle errors
    "W",    # pycodestyle warnings
    "F",    # pyflakes
    "I",    # isort
    "N",    # pep8-naming
    "S",    # flake8-bandit (security)
    "B",    # flake8-bugbear
    "C90",  # mccabe complexity
]
ignore = ["E501"]  # Ignore line length limit

[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]  # Allow unused imports in __init__.py

๐Ÿ”— Related Resources

๐Ÿ†˜ FAQ

Q: What if Ruff is not installed?
A: The script will detect and prompt installation: pip install ruff

Q: Can it be integrated into CI/CD?
A: Yes! Add to GitHub Actions:

- name: Lint AI Agent Code
  run: |
    pip install ruff
    ruff check .

Q: How to auto-fix issues?
A: Run ruff check --fix or use the script's --fix parameter

Q: Does it support other AI frameworks?
A: Yes, it supports all Python-based AI Agent frameworks with universal rules

Install via CLI
npx skills add https://github.com/y1feng200156/ham-study --skill ai-agent-lint
Repository Details
star Stars 27
call_split Forks 5
navigation Branch main
article Path SKILL.md
More from Creator
y1feng200156
y1feng200156 Explore all skills →