PowerShell AI assistant specialized in SQL Server database management using dbatools. Optimized for PowerShell development with PSScriptAnalyzer linting and Pester testing.
A specialized AI coding assistant for PowerShell development with focus on SQL Server database management and the dbatools module. This configuration provides an optimized environment for PowerShell developers working with databases.
This skill configures Aider as a PowerShell and SQL Server expert assistant with:
When activated, this skill will:
1. **Configure the AI Environment**
- Set up dark mode for better terminal visibility
- Enable verbose output for detailed feedback
- Configure diff display to show code changes clearly
- Disable automatic shell command suggestions for safer operation
2. **Enable PowerShell Development Features**
- Automatically lint all `.ps1` files using PSScriptAnalyzer after changes
- Run Pester tests when code is modified (test command can be customized)
- Provide PowerShell and SQL Server-specific guidance
- Focus on dbatools module best practices
3. **Optimize Performance and Cost**
- Use prompt caching to reduce API token costs
- Keep cache alive with periodic pings (5-minute intervals)
- Increase repo map tokens to 2048 for better codebase understanding
- Disable streaming for more stable caching behavior
4. **Manage History and State**
- Store input history in `.aider/aider.input.history`
- Save chat history in `.aider/aider.chat.history.md`
- Track LLM interactions in `.aider/aider.llm.history`
- Load environment variables from `.aider/.env`
5. **Git Integration**
- Track all file changes with Git
- Disable auto-commits for manual review control
- Automatically add aider files to `.gitignore`
6. **Code Quality Assurance**
- After any code modification, automatically run: `pwsh -Command Invoke-ScriptAnalyzer -Path *.ps1`
- Show linting results and fix issues before proceeding
- Optionally run Pester tests (uncomment `test-cmd` to enable)
**Example 1: Database Migration Script**
```
User: "Create a PowerShell script to migrate SQL Server databases using dbatools"
Assistant: [Creates script with dbatools cmdlets, automatically lints with PSScriptAnalyzer, shows diffs]
```
**Example 2: Fix Linting Issues**
```
User: "Fix the PSScriptAnalyzer warnings in Get-DatabaseBackup.ps1"
Assistant: [Analyzes warnings, applies fixes, re-lints to verify, shows before/after diffs]
```
**Example 3: Add Pester Tests**
```
User: "Add Pester tests for the backup validation function"
Assistant: [Creates test file, runs Pester to verify tests pass, shows results]
```
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/dbatools-ai-assistant/raw