Configure and use Aider, an AI pair programming tool that can edit code in your local git repository. This skill configures Aider with optimal settings for collaborative AI coding sessions.
This skill has safety concerns that you should review before use. Some patterns were detected that may pose a risk.Safety score: 60/100.
KillerSkills scans all public content for safety. Use caution before installing or executing flagged content.
This skill helps you set up and use Aider, an AI pair programming tool that can edit code directly in your local git repository using various AI models.
Aider is a command-line tool that lets you pair program with AI to edit code in your local git repository. It can:
Based on the SLU.ad static site configuration, here are the key settings:
Create a `.aider.conf.yml` file in your git repository root with these essential settings:
```yaml
model: 4o
edit-format: diff
auto-commits: false # Manual control over commits
watch-files: true # Enable file watching for AI comments
auto-lint: true
```
**Basic usage:**
```bash
aider <file1> <file2> <file3>
```
**With read-only reference files:**
```bash
aider --file main.py --read utils.py --read config.json
```
**Single message mode (non-interactive):**
```bash
aider --message "Add error handling to the login function"
```
Once in the Aider chat interface:
**Common commands:**
When `watch-files: true` is enabled:
1. Add special comments to your code files:
```python
def process_user_data(data):
return data
```
2. Aider will detect these comments and suggest or make changes automatically
**Configure linting per language:**
```yaml
lint-cmd:
- "python: flake8 --select=E,W"
- "javascript: eslint"
```
**Configure testing:**
```yaml
test-cmd: pytest
auto-test: false # Set to true for automatic testing after changes
```
**Switch models easily:**
```yaml
model: 4o # GPT-4o
```
**Use model aliases for custom models:**
```yaml
alias:
- "fast=gpt-4o-mini"
- "smart=claude-3-5-sonnet-20241022"
```
**Map tokens (for repository understanding):**
```yaml
map-tokens: 2048 # Tokens for repo map
map-refresh: auto # auto, always, files, manual
```
**History and logging:**
```yaml
chat-history-file: .aider.chat.history.md
restore-chat-history: true
llm-history-file: .aider.llm.history
```
**Output customization:**
```yaml
dark-mode: true # or light-mode: true
pretty: true
stream: true
show-diffs: true # Show diffs when committing
```
```bash
aider src/main.py
```
```bash
aider --file src/api.py --file src/models.py --file tests/test_api.py
```
```bash
aider --lint
```
```bash
echo "Add docstrings to all public functions" > instructions.txt
aider --message-file instructions.txt src/*.py
```
1. **Git Repository Required**: Aider requires a git repository by default (disable with `git: false`)
2. **API Keys**: Store API keys in `.env` file in git root:
```env
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...
```
3. **Model-Specific Edit Formats**: Some models work better with specific edit formats:
- `diff` - Best for most models, precise changes
- `architect` - For high-level planning
- `editor-diff` - For editor models
4. **File Size Limits**: Large files may exceed context windows. Use `--read` for reference files you don't need to edit.
5. **Auto-commits Off**: With `auto-commits: false`, you must manually commit changes. This gives you review control but requires discipline.
1. **Start Small**: Begin with one or two files, add more as needed
2. **Use Read-Only Files**: Reference configuration and documentation with `--read`
3. **Review Diffs**: Always review changes before committing
4. **Commit Often**: Even with auto-commits off, commit working states frequently
5. **Use Descriptive Messages**: Let Aider generate commit messages, but review them
6. **Watch Mode for Large Refactors**: Use file watching for systematic improvements
7. **Test Integration**: Configure `test-cmd` and `lint-cmd` for quality assurance
**Aider won't start:**
**Changes not being made:**
**Performance issues:**
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/aider-ai-coding-assistant-kypj1o/raw