Skip to content

Instantly share code, notes, and snippets.

@techiechap
Forked from dfinke/Get-BootStrapPrompt.ps1
Created December 5, 2025 18:48
Show Gist options
  • Select an option

  • Save techiechap/7a4e273432382699759603b824003e13 to your computer and use it in GitHub Desktop.

Select an option

Save techiechap/7a4e273432382699759603b824003e13 to your computer and use it in GitHub Desktop.
Generates prompt engineering best practices for specified AI models
#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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment