Aider AI Assistant
AI-powered coding assistant using Aider with Claude 3.5 Sonnet for intelligent code editing, repository mapping, and seamless git integration.
Description
This skill configures Aider, an AI pair programming tool, optimized for AI development workflows. It uses Claude 3.5 Sonnet for main tasks and Claude 3 Haiku for lighter operations like commit messages. Features include automatic repo mapping, git integration with AI attribution, diff-based editing, and smart linting.
Instructions
When using the Aider AI Assistant skill, follow these steps:
1. Environment Setup
Ensure `ANTHROPIC_API_KEY` is set in your environment or `.env` fileOptionally set `OPENAI_API_KEY` if using OpenAI modelsCreate a `.env` file following the `.env.example` pattern if needed2. Model Configuration
**Main model**: Use Claude 3.5 Sonnet (`claude-3-5-sonnet-20241022`) for primary development tasks**Weak model**: Use Claude 3 Haiku (`claude-3-haiku-20240307`) for commit messages and summariesEnable model warnings and settings validation for optimal experience3. Repository Mapping
Aider will automatically map the repository structure using 4000 tokensRepo map refreshes automatically as the project evolvesWhen no specific files are provided, use a 2x multiplier for broader context4. Editing Workflow
Use **diff edit format** for better collaboration and reviewAider will show diffs before committing changesEnable pretty output and streaming for responsive interactionsFiles are edited in-place with clear diff visualization5. Git Integration
**Auto-commits enabled**: Aider will automatically commit changes with descriptive messages**AI attribution**: Commits will include Co-authored-by tags attributing the AIAider automatically adds `.aider*` files to `.gitignore`Dirty commits are allowed for flexible developmentPre-commit hooks are not skipped by default6. Automatic Enhancement
**Auto-lint enabled**: Aider will run linters after making changes (when available)**Auto-test disabled**: Tests are not run automatically (enable manually if needed)Suggest shell commands when appropriate for development tasks7. History and Sessions
Chat history saved to `.aider.chat.history.md`Input history saved to `.aider.input.history`Sessions start clean (history not restored by default)8. Exclusions
Respect `.gitignore` patterns automaticallyUse `.aiderignore` file for additional exclusions specific to AiderGitignored files are not added to editing scope9. Usage Patterns
**For new features:**
```bash
aider --architect --message "Add user authentication system"
```
**For bug fixes:**
```bash
aider path/to/file.ts --message "Fix null pointer error in login handler"
```
**For refactoring:**
```bash
aider src/**/*.ts --message "Refactor authentication module to use async/await"
```
**Interactive mode:**
```bash
aider
Then interact conversationally with the AI
```
10. Best Practices
Start with specific files when possible for focused editsUse architect mode (`--architect`) for complex, multi-file changesReview diffs before accepting changesLet Aider handle git commits for proper AI attributionUse the weak model for routine tasks to save costsEnable URL detection when working with documentation11. Advanced Features
**Fancy input**: History and tab completion enabled**URL detection**: Automatically detects and processes URLs in context**UTF-8 encoding**: Full unicode support**Platform line endings**: Automatically matches your OS conventions**Notifications disabled**: Runs quietly without interruptionsConstraints
Requires valid `ANTHROPIC_API_KEY` in environmentSSL verification enabled (cannot be disabled for security)Analytics permanently disabled for privacyGUI mode not enabled by defaultAuto-test disabled by default (enable manually if needed)Example Configuration File
This skill generates an `.aider.conf.yml` file with the following key settings:
```yaml
model: claude-3-5-sonnet-20241022
weak-model: claude-3-haiku-20240307
edit-format: diff
auto-commits: true
auto-lint: true
attribute-co-authored-by: true
map-tokens: 4000
show-diffs: true
git: true
```
All settings are optimized for AI development workflows with strong git integration and automatic code quality checks.