Created
December 5, 2025 13:22
-
-
Save dfinke/cd3990205acbc49f804570d083338fee to your computer and use it in GitHub Desktop.
Generates prompt engineering best practices for specified AI models
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Requires -Modules PSAI | |
| function Get-BootStrapPrompt { | |
| <# | |
| .SYNOPSIS | |
| Generates prompt engineering best practices for specified AI models. | |
| .DESCRIPTION | |
| For each AI model in the FavoriteAI array, this function uses an agent to research and produce | |
| #> | |
| param( | |
| [string[]]$FavoriteAI | |
| ) | |
| $FavoriteAI | ForEach-Object -Parallel { | |
| function global:Invoke-TavilySearch { | |
| param([string]$query) | |
| if ( -not $env:TAVILY_API_KEY) { | |
| return "Error: TAVILY_API_KEY environment variable is not set." | |
| } | |
| $tavilyParams = @{ | |
| api_key = $env:TAVILY_API_KEY | |
| # include_domains = "stackoverflow.com" | |
| query = $query | |
| } | |
| $body = $tavilyParams | ConvertTo-Json -Depth 10 | |
| Invoke-RestMethod -Method Post -Uri "https://api.tavily.com/search" -ContentType 'application/json' -Body $body | |
| } | |
| # Act as a prompt engineer, | |
| # Research the best practices for prompt engineering for the latest [YOUR FAVORITE AI] models. | |
| # Produce a prompt which takes a prompt as an input and rewrites it according to best practices. | |
| $favorite = $_ | |
| Write-Host "Generating prompt engineering best practices for $favorite..." -ForegroundColor Cyan | |
| $instructions = @" | |
| Date: $(Get-Date) | |
| Act as a prompt engineer | |
| Research the best practices for prompt engineering for the latest $favorite models. | |
| Use the tools for any necessary research. | |
| "@ | |
| $prompt = "Produce a prompt which takes a prompt as an input and rewrites it according to best practices." | |
| $agentParams = @{ | |
| Instructions = $instructions | |
| ShowToolCalls = $true | |
| Tools = 'Invoke-TavilySearch' | |
| LLM = New-OpenAIChat gpt-4.1 | |
| } | |
| $result = New-Agent @agentParams | Get-AgentResponse $prompt | |
| [PSCustomObject][ordered]@{ | |
| FavoriteAI = $favorite | |
| Result = $result | |
| } | |
| } | |
| } | |
| Get-BootStrapPrompt "Opus-4.5", "GPT-4.1", "GPT-5.1-Codex", "Gemini 3" |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
FavoriteAI : Opus-4.5
Result : Here is a prompt that takes another prompt as input and rewrites it according to best practices for Opus-4.5 and similar advanced models:
FavoriteAI : Gemini 3
Result : Here is a prompt template that takes a userΓÇÖs prompt as input and rewrites it according to the best practices for Gemini 3, as gathered from recent research:
FavoriteAI : GPT-4.1
Result : Based on the latest best practices for GPT-4.1 prompt engineering, hereΓÇÖs a prompt that takes a user-submitted prompt as input and rewrites it for optimal clarity, specificity, and effectiveness:
FavoriteAI : GPT-5.1-Codex
Result : Here is an advanced prompt that takes an input prompt and rewrites it according to best practices for the latest GPT-5.1-Codex models.