Configure and use Aider, an AI pair programming tool that helps you edit code in your git repository. Aider works with multiple LLM providers and can automatically commit changes, run tests, and fix linting issues.
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 configure and use Aider, an AI pair programming tool that works directly with your codebase through the command line.
Aider is a command-line AI coding assistant that:
Aider can be configured via a `.aider.conf.yml` file placed in your home directory or git repository root.
1. **Choose Your LLM Model**
- Set the `model` field to specify which AI model to use
- Common options: `gpt-4o`, `claude-3-5-sonnet-20240620`, `vertex_ai/gemini-2.5-flash`
- Use `weak-model` for cheaper operations like commit messages
2. **Configure API Keys**
- OpenAI keys: set `openai-api-key` in config or `OPENAI_API_KEY` in `.env`
- Anthropic keys: set `anthropic-api-key` in config or `ANTHROPIC_API_KEY` in `.env`
- Other providers: use `.env` file (see Aider documentation)
3. **Set File Access**
- `file`: List of files to edit (Aider can modify these)
- `read`: List of read-only files for context (rules, docs, plans)
4. **Git Integration**
- `auto-commits: false` - Disable automatic commits if you want manual control
- `dirty-commits: true` - Allow commits even if repo has uncommitted changes
- `gitignore: true` - Automatically add `.aider*` files to `.gitignore`
5. **Performance Optimization**
- `cache-prompts: true` - Enable prompt caching to reduce costs
- `map-tokens: 1024` - Control repo map size (set to 0 to disable)
- `stream: true` - Enable streaming responses for faster feedback
6. **Code Quality**
- `lint-cmd` - Specify linting commands per language
- `auto-lint: true` - Automatically lint after changes
- `test-cmd` - Command to run your test suite
- `auto-test: false` - Set to true to run tests automatically
Create `.aider.conf.yml` in your repository root:
```yaml
model: gpt-4o
cache-prompts: true
auto-commits: false
auto-lint: true
file: [
# Files you want Aider to edit
]
read: [
# Read-only files for context
"README.md",
"docs/architecture.md"
]
```
Create `.env` file in your repository root:
```bash
OPENAI_API_KEY=your-key-here
ANTHROPIC_API_KEY=your-key-here
```
```bash
aider
aider src/main.py tests/test_main.py
aider --message "Add error handling to the login function"
```
**In interactive mode:**
**Common workflows:**
**Linting Integration:**
```yaml
lint-cmd:
python: "flake8 --select=E,W,F"
javascript: "eslint --fix"
auto-lint: true
```
**Testing Integration:**
```yaml
test-cmd: "pytest tests/"
auto-test: true
```
**Custom Edit Formats:**
```yaml
edit-format: diff # or whole, udiff, editor-diff
```
**Repo Mapping:**
```yaml
map-tokens: 2048 # Increase for larger context
map-refresh: always # or auto, files, manual
```
**Example 1: Quick fix with auto-commit**
```bash
aider --message "Fix the SQL injection vulnerability in user_search()" --commit
```
**Example 2: Interactive feature development**
```bash
aider src/api/routes.py src/api/handlers.py
```
**Example 3: Test-driven development**
```yaml
test-cmd: "pytest tests/ -v"
auto-test: true
lint-cmd:
python: "black . && flake8"
auto-lint: true
```
**Example 4: Context-aware refactoring**
```bash
aider --read docs/architecture.md --read docs/style-guide.md src/legacy/
```
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/aider-ai-pair-programming-wu8p2w/raw