lint-manager
Lint Manager
Overview
Automated lint management for multi-language projects. Detects languages, generates configurations, installs tools, runs checks, and auto-fixes errors.
Workflow
1. Detect Languages
Use scripts/detect_language.py to identify programming languages in the project:
python3 scripts/detect_language.py /path/to/project
Returns language list with confidence scores. Primary language is the first result.
Example output:
{
"detected": [
{"language": "python", "confidence": 0.85, "score": 42},
{"language": "javascript", "confidence": 0.15, "score": 8}
],
"primary": "python"
}
2. Install Lint Tools
Use scripts/install_linter.py to install required lint tools:
# Install for specific language
python3 scripts/install_linter.py --language python --preset minimal
# Auto-detect and install all
python3 scripts/install_linter.py --preset minimal
Presets:
minimal: Essential rules only (fast, for new projects)full: All recommended rules (strict, for production)
Supported tools:
- JavaScript/TypeScript: ESLint
- Python: Ruff
- Swift: SwiftLint
- Go: golangci-lint
3. Generate Configuration
Copy appropriate template from assets/ to project root:
| Language | Config File | Template |
|---|---|---|
| JavaScript | .eslintrc.json |
assets/eslintrc.json |
| TypeScript | .eslintrc.json |
assets/eslintrc.typescript.json |
| Python | pyproject.toml |
assets/ruff.toml |
| Swift | .swiftlint.yml |
assets/swiftlint.yml |
| Go | .golangci.yml |
assets/golangci.yml |
Configuration strategy: Ask user to choose between minimal (recommended for new projects) or strict (for production codebases).
4. Run Lint
Use scripts/run_lint.py to run lint checks:
# Lint all files
python3 scripts/run_lint.py
# Lint staged files only (for pre-commit)
python3 scripts/run_lint.py --staged
# Lint specific files
python3 scripts/run_lint.py --language python --files src/main.py
# Auto-fix issues
python3 scripts/run_lint.py --fix
python3 scripts/run_lint.py --fix --staged
5. Fix Errors
If lint errors are found:
- Try auto-fix first with
--fixflag - For remaining errors, use Edit tool to fix each issue
- Re-run lint to verify fixes
Common Workflows
New Project Setup
- Detect languages:
python3 scripts/detect_language.py - Install tools:
python3 scripts/install_linter.py --preset minimal - Ask user: "Use minimal or strict configuration?"
- Copy config template to project root
- Run initial lint:
python3 scripts/run_lint.py
Pre-commit Hook
- Run:
python3 scripts/run_lint.py --staged --fix - If errors remain, fix them with Edit tool
- Re-run until clean
Adding Lint to Existing Project
- Detect languages
- Install tools
- Ask: "Keep existing config or generate new?"
- If new, copy template (ask: minimal or strict?)
- Run lint and fix any errors
Resources
scripts/
detect_language.py
- Scans project files and directories
- Returns detected languages with confidence scores
- Usage: Auto-detection step
install_linter.py
- Installs lint tools for detected languages
- Checks if already installed
- Supports minimal/full presets
- Usage: Tool installation
run_lint.py
- Runs lint tools on project files
- Supports staged-only mode for pre-commit
- Supports auto-fix mode
- Usage: Lint execution
references/
Language-specific lint documentation:
javascript.md- ESLint rules, TypeScript setuppython.md- Ruff configuration, commandsswift.md- SwiftLint rules, Xcode integrationgo.md- golangci-lint setup, CI integration
Load when:
- User asks about specific lint tool
- Need to troubleshoot linter issues
- User wants customization options
assets/
Configuration file templates for each language. Copy to project root when generating configs.
Error Handling
Tool not installed:
- Run
python3 scripts/install_linter.py --language <lang>
Config file missing:
- Copy template from
assets/ - Ask user: minimal or strict?
Lint errors found:
- Run with
--fixfirst - For remaining errors, parse and fix manually
- Re-run to verify
Permission denied:
- Check file permissions
- Ensure tool is in PATH
More from yijingjia/skills
design-extractor
从参考网站提取完整设计系统,生成 design tokens、color palette、设计系统文档和可交互 HTML playground,并保存为可复用文件供后续页面开发使用。当用户想复刻、参考或提取某个网站的设计风格、配色、动效、排版、组件结构时触发。也适用于"我想参考 X 网站的风格来做我的网站"、"帮我提取这个网站的设计规范"、"复刻这个网站的导航/卡片/组件"等场景。
10markdown-to-image
将 Markdown 文件渲染为小红书卡片图片(3:4 竖版 PNG)。支持文本、代码块、表格、列表、引用、图片等内容块,自动分页,支持四种视觉主题。当用户提到"生成小红书图片"、"把文章做成卡片"、"导出图片"、"/md2img"时触发此 skill。
7