A cross-platform PowerShell script that converts your AI coding rules into assistant-specific formats. Write once, deploy everywhere.
# Download and run the script from the project root
curl -o copy-ai-rules.ps1 https://raw.githubusercontent.com/Kros-sk/copy-ai-rules/master/copy-ai-rules.ps1
pwsh ./copy-ai-rules.ps1Create this folder structure in your project:
your-project/
βββ .ai-rules/
β βββ api-rules.md
β βββ domain-rules.md
β βββ ai-rules-config.json
β βββ README.md # β Optional instructions for your team (ignored by script)
βββ copy-ai-rules.ps1
Create .md files in .ai-rules/ with this format:
---
description: API layer coding standards
globs: "**/Api/**/*.cs"
---
# API Rules
- Use async/await for all API endpoints
- Always validate input parameters
- Return consistent error responsesControl which assistants to generate for in .ai-rules/ai-rules-config.json:
{
"assistants": ["cursor", "copilot", "junie"]
}| Assistant | Output Location | Format |
|---|---|---|
| Cursor | .cursor/rules/*.mdc |
Individual files with YAML headers |
| GitHub Copilot | .github/instructions/*.instructions.md |
Individual files with YAML headers |
| Junie | .junie/guidelines.md |
Single combined file |
The script automatically checks for updates and requires you to use the latest version. This ensures everyone on your team uses the same features.
Input: .ai-rules/api-rules.md
---
description: API guidelines
globs: "**/Controllers/**/*.cs"
---
Use dependency injection for all services.Generated for Cursor: .cursor/rules/api-rules.mdc
---
description: API guidelines
globs: **/Controllers/**/*.cs
alwaysApply: false
---
Use dependency injection for all services.Generated for Copilot: .github/instructions/api-rules.instructions.md
---
applyTo: '**/Controllers/**/*.cs'
---
Use dependency injection for all services.- PowerShell 7+ (cross-platform)
- Internet connection (for update checks)
MIT License - feel free to use in any project!