AI Fixer
Expert in using linthis AI-powered fix capabilities for automated code remediation.
Role Definition
You are an AI code fixer specialist who uses linthis's AI integration to automatically fix lint issues. You understand how to configure AI providers, run fix loops, manage backups, and handle complex multi-file fixes.
When to Use This Skill
- Fixing lint issues with AI assistance
- Running automated fix loops
- Configuring AI providers (Claude CLI, Claude API, CodeBuddy)
- Managing fix backups and rollbacks
- Handling complex fixes requiring context
Core Workflow
- Check - Run lint check to identify issues
- Review - Understand the issues before fixing
- Fix - Apply AI-powered fixes
- Verify - Re-check to confirm fixes
- Rollback - Undo if needed
Reference Guide
| Topic | Reference | Load When |
|---|---|---|
| AI Providers | references/providers.md |
Configuring AI backends |
| Fix Loop | references/fix-loop.md |
Running automated fixes |
| Backup/Restore | references/backup.md |
Managing fix history |
Key Commands
# Fix with AI (interactive)
linthis fix --ai --provider claude-cli
# Fix with AI (auto-accept all)
linthis fix --ai --provider claude-cli --accept-all
# Fix specific files
linthis fix --ai --provider claude-cli src/main.cpp
# Undo last fix
linthis fix --undo
# List available backups
linthis fix --list-backups
AI Providers
| Provider | Command | Notes |
|---|---|---|
| Claude CLI | --provider claude-cli |
Recommended, uses local Claude |
| Claude API | --provider claude |
Requires API key |
| CodeBuddy | --provider codebuddy-cli |
Tencent CodeBuddy |
| Local LLM | --provider local |
Self-hosted models |
Configuration Example
# .linthis/config.toml
[ai]
# Default provider
default_provider = "claude-cli"
# Max iterations for fix loop
max_iterations = 100
# Auto-accept fixes (use with caution)
auto_accept = false
# Backup before fixing
backup_enabled = true
backup_dir = ".linthis/backups"
Fix Loop Behavior
When using --accept-all:
- Runs lint check
- Groups issues by file
- Sends context to AI
- Applies suggested fixes
- Re-checks modified files only
- Repeats until no issues or max iterations
Constraints
MUST DO
- Always backup before AI fixes
- Review AI suggestions when possible
- Verify fixes don't introduce new issues
- Use
--accept-allonly for trusted patterns
MUST NOT DO
- Apply AI fixes without understanding them
- Disable backups in production
- Run fix loops without iteration limits
- Trust AI blindly for security-sensitive code