skills/atyantik/quality-fixer/SKILL.md
Automatically apply safe quality fixes including formatting (Black, isort), linting (Ruff auto-fixes), and resolve formatter conflicts. Use when quality checks fail or before committing code.
npx skillsauth add aiskillstore/marketplace quality-fixerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
BEFORE applying quality fixes, you MUST read and understand the following project documentation:
After reading these files, proceed with your quality fixing task below.
Automatically apply safe quality fixes to Python code, resolving formatting issues, linting problems, and formatter conflicts.
make checkmake lint or make format reports fixable issues✅ Formatting Issues
✅ Linting Issues (Safe Auto-Fixes)
✅ Type Hint Issues (Safe Cases)
-> None to functions without return✅ Formatter Conflicts
# Run comprehensive quality fixes
apply quality fixes to the entire project
Actions:
make format (Black + isort)--fix flag# Fix a single file
fix quality issues in src/python_modern_template/validators.py
Actions:
# Focus on conflicts
resolve Black and Ruff formatter conflicts
Actions:
# See what would be fixed without applying
preview quality fixes for src/
Actions:
# Apply Black formatting
make format
# This runs:
# - black src/ tests/
# - isort src/ tests/
What gets fixed:
# Run Ruff with auto-fix
uv run ruff check --fix src/ tests/
# Safe fixes include:
# - Remove unused imports
# - Remove unused variables (when safe)
# - F-string conversion
# - Simplify expressions
What gets fixed:
# Check if Black and Ruff agree
make format && make lint
Common conflicts:
Strategy 1: Extract Message Variables
# Before (conflict - too long)
logger.error("This is a very long error message that exceeds the line length limit")
# After (resolved)
msg = "This is a very long error message that exceeds the line length limit"
logger.error(msg)
Strategy 2: Use Parentheses for Line Breaks
# Before (conflict)
result = some_function(arg1, arg2, arg3, arg4, arg5, arg6)
# After (resolved)
result = some_function(
arg1, arg2, arg3, arg4, arg5, arg6
)
Strategy 3: Split Long Strings
# Before (conflict)
text = "This is a very long string that should be split across multiple lines for readability"
# After (resolved)
text = (
"This is a very long string that should be "
"split across multiple lines for readability"
)
# Run complete quality check
make check
Must pass:
Run both tools and compare:
# Apply Black
black src/python_modern_template/module.py
# Check Ruff
ruff check src/python_modern_template/module.py
# If Ruff still complains about formatting, there's a conflict
Long String Literals → Extract to variable or split across lines
Complex Expressions → Add parentheses and line breaks
Long Function Calls → Break arguments to multiple lines
Comment Placement → Move comments above the line
Type Annotation Complexity → Split to multiple lines with proper indentation
Problem:
# Black formats this way:
raise ValueError("The email address provided is not valid because it does not contain the required @ symbol")
# Ruff complains: E501 Line too long (92 > 88)
Solution:
# Extract message variable
error_msg = (
"The email address provided is not valid because it "
"does not contain the required @ symbol"
)
raise ValueError(error_msg)
# Both Black and Ruff are satisfied!
❌ Complex Logic Issues
❌ Non-Obvious Type Hints
❌ Docstring Content
❌ Test Failures
❌ Breaking Changes
After applying fixes, provide a report:
## Quality Fixes Applied
**Files Modified:** X
**Total Changes:** X lines
### Formatting Fixes
- ✅ Applied Black formatting to X files
- ✅ Sorted imports with isort in X files
- ✅ Fixed line length issues: X lines
### Linting Fixes
- ✅ Removed X unused imports
- ✅ Converted X strings to f-strings
- ✅ Simplified X expressions
- ✅ Fixed X Ruff issues
### Conflicts Resolved
- ✅ Extracted X message variables
- ✅ Split X long strings
- ✅ Reformatted X function calls
### Quality Check Results
```bash
make check
[Show output]
git diffmake test
## Safety Features
### Dry Run Mode
Always available for preview:
```bash
# Format preview
black --check --diff src/
# Ruff preview
ruff check --fix --diff src/
Verify changes before committing:
# See what changed
git diff
# Stage specific changes
git add -p
For large fixes, create a commit first:
# Commit current state
git commit -m "Before quality fixes"
# Apply fixes
[quality-fixer runs]
# Review changes
git diff HEAD~1
# Undo if needed
git reset --hard HEAD~1
# Just formatting
make format
# Just linting (with fixes)
make lint
# Complete check (no auto-fix)
make check
Add to .pre-commit-config.yaml:
- repo: local
hooks:
- id: quality-fixer
name: Quality Fixer
entry: python .claude/skills/quality-fixer/scripts/auto_fix.py
language: system
types: [python]
Run in CI with --check mode:
# CI should verify, not fix
make check
# If it fails, developers run:
[quality-fixer to fix locally]
Fix only specific types of issues:
# Only formatting
[quality-fixer] --format-only
# Only import cleanup
[quality-fixer] --imports-only
# Only conflicts
[quality-fixer] --conflicts-only
Respect configuration in pyproject.toml:
[tool.ruff.lint]
ignore = ["E501"] # Don't auto-fix line length in specific cases
[tool.black]
extend-exclude = '''
/(
| generated
)/
'''
Define project-specific fixes:
# .claude/skills/quality-fixer/scripts/custom_rules.py
def fix_common_typos(code: str) -> str:
"""Fix project-specific common mistakes."""
fixes = {
"recieve": "receive",
"seperator": "separator",
}
for typo, correction in fixes.items():
code = code.replace(typo, correction)
return code
git diffmake test to ensure no breaking changes# 1. Apply fixes
[quality-fixer]
# 2. Review changes
git diff
# 3. Test
make test
# 4. Commit
git add .
git commit -m "feat: add new feature"
# Code reviewer says: "Fix formatting and linting"
# 1. Apply fixes
[quality-fixer]
# 2. Verify all issues resolved
make check
# 3. Push
git push
# CI reports quality issues
# 1. Pull latest
git pull
# 2. Apply fixes
[quality-fixer]
# 3. Verify locally
make check
# 4. Push fix
git commit -am "fix: resolve quality issues"
git push
Solution: Manually review the conflicting lines and apply advanced strategies:
# noqa comments sparingly for unavoidable casesSolution:
git checkout -- <file>git diffNote: This skill only applies auto-fixable issues. Pylint often requires manual fixes:
_ prefix or removeQuality fixes are TOOLS, not SUBSTITUTES for good code:
This skill helps you maintain code quality efficiently, but good coding practices are still essential!
development
Apple Human Interface Guidelines for content display components. Use this skill when the user asks about charts component, collection view, image view, web view, color well, image well, activity view, lockup, data visualization, content display, displaying images, rendering web content, color pickers, or presenting collections of items in Apple apps. Also use when the user says how should I display charts, what's the best way to show images, should I use a web view, how do I build a grid of items, what component shows media, or how do I present a share sheet. Cross-references: hig-foundations for color/typography/accessibility, hig-patterns for data visualization patterns, hig-components-layout for structural containers, hig-platforms for platform-specific component behavior.
tools
Automate HelpDesk tasks via Rube MCP (Composio): list tickets, manage views, use canned responses, and configure custom fields. Always search tools first for current schemas.
testing
Expert Haskell engineer specializing in advanced type systems, pure functional design, and high-reliability software. Use PROACTIVELY for type-level programming, concurrency, and architecture guidance.
tools
GraphQL gives clients exactly the data they need - no more, no less. One endpoint, typed schema, introspection. But the flexibility that makes it powerful also makes it dangerous. Without proper controls, clients can craft queries that bring down your server. This skill covers schema design, resolvers, DataLoader for N+1 prevention, federation for microservices, and client integration with Apollo/urql. Key insight: GraphQL is a contract. The schema is the API documentation. Design it carefully.