Update agent configuration

This commit is contained in:
den (work)
2025-11-07 11:41:54 -08:00
parent e20d79e78b
commit 161a415274
7 changed files with 42 additions and 23 deletions

View File

@@ -171,7 +171,7 @@ function Generate-Commands {
'md' {
Set-Content -Path $outputFile -Value $body -NoNewline
}
'chatmode.md' {
'agent.md' {
Set-Content -Path $outputFile -Value $body -NoNewline
}
}
@@ -180,16 +180,16 @@ function Generate-Commands {
function Generate-CopilotPrompts {
param(
[string]$ChatmodesDir,
[string]$AgentsDir,
[string]$PromptsDir
)
New-Item -ItemType Directory -Path $PromptsDir -Force | Out-Null
$chatmodeFiles = Get-ChildItem -Path "$ChatmodesDir/speckit.*.chatmode.md" -File -ErrorAction SilentlyContinue
$agentFiles = Get-ChildItem -Path "$AgentsDir/speckit.*.agent.md" -File -ErrorAction SilentlyContinue
foreach ($chatmodeFile in $chatmodeFiles) {
$basename = $chatmodeFile.Name -replace '\.chatmode\.md$', ''
foreach ($agentFile in $agentFiles) {
$basename = $agentFile.Name -replace '\.agent\.md$', ''
$promptFile = Join-Path $PromptsDir "$basename.prompt.md"
$content = @"
@@ -278,12 +278,12 @@ function Build-Variant {
}
}
'copilot' {
$chatmodesDir = Join-Path $baseDir ".github/chatmodes"
Generate-Commands -Agent 'copilot' -Extension 'chatmode.md' -ArgFormat '$ARGUMENTS' -OutputDir $chatmodesDir -ScriptVariant $Script
$agentsDir = Join-Path $baseDir ".github/agents"
Generate-Commands -Agent 'copilot' -Extension 'agent.md' -ArgFormat '$ARGUMENTS' -OutputDir $agentsDir -ScriptVariant $Script
# Generate companion prompt files
$promptsDir = Join-Path $baseDir ".github/prompts"
Generate-CopilotPrompts -ChatmodesDir $chatmodesDir -PromptsDir $promptsDir
Generate-CopilotPrompts -AgentsDir $agentsDir -PromptsDir $promptsDir
# Create VS Code workspace settings
$vscodeDir = Join-Path $baseDir ".vscode"

View File

@@ -95,21 +95,21 @@ generate_commands() {
{ echo "description = \"$description\""; echo; echo "prompt = \"\"\""; echo "$body"; echo "\"\"\""; } > "$output_dir/speckit.$name.$ext" ;;
md)
echo "$body" > "$output_dir/speckit.$name.$ext" ;;
chatmode.md)
agent.md)
echo "$body" > "$output_dir/speckit.$name.$ext" ;;
esac
done
}
generate_copilot_prompts() {
local chatmodes_dir=$1 prompts_dir=$2
local agents_dir=$1 prompts_dir=$2
mkdir -p "$prompts_dir"
# Generate a .prompt.md file for each .chatmode.md file
for chatmode_file in "$chatmodes_dir"/speckit.*.chatmode.md; do
[[ -f "$chatmode_file" ]] || continue
# Generate a .prompt.md file for each .agent.md file
for agent_file in "$agents_dir"/speckit.*.agent.md; do
[[ -f "$agent_file" ]] || continue
local basename=$(basename "$chatmode_file" .chatmode.md)
local basename=$(basename "$agent_file" .agent.md)
local prompt_file="$prompts_dir/${basename}.prompt.md"
# Create prompt file with agent frontmatter
@@ -166,10 +166,10 @@ build_variant() {
generate_commands gemini toml "{{args}}" "$base_dir/.gemini/commands" "$script"
[[ -f agent_templates/gemini/GEMINI.md ]] && cp agent_templates/gemini/GEMINI.md "$base_dir/GEMINI.md" ;;
copilot)
mkdir -p "$base_dir/.github/chatmodes"
generate_commands copilot chatmode.md "\$ARGUMENTS" "$base_dir/.github/chatmodes" "$script"
mkdir -p "$base_dir/.github/agents"
generate_commands copilot agent.md "\$ARGUMENTS" "$base_dir/.github/agents" "$script"
# Generate companion prompt files
generate_copilot_prompts "$base_dir/.github/chatmodes" "$base_dir/.github/prompts"
generate_copilot_prompts "$base_dir/.github/agents" "$base_dir/.github/prompts"
# Create VS Code workspace settings
mkdir -p "$base_dir/.vscode"
[[ -f templates/vscode-settings.json ]] && cp templates/vscode-settings.json "$base_dir/.vscode/settings.json"