corrections
CI / CI configuration security checks (push) Successful in 6s
CI / Python tests and compilation (push) Failing after 12s
CI / QMD unit tests (push) Skipped
CI / Capabilities and shell quality (push) Successful in 1m50s
CI / Build and inspect generated packages (push) Skipped
CI / Bash integration and installation guards (push) Skipped
CI / Installed client configuration smoke tests (push) Skipped
CI / PowerShell tests on Ubuntu (push) Failing after 7m24s

This commit is contained in:
Julian Lechner committed 2026-11-19 10:30:43 +01:00
1 parent b35e2254b3
commit c3e22eb902
39 files changed
+246 -151

No files matched your search

+12 -1
View File
@@ -51,9 +51,12 @@ foreach ($pluginEntry in $pluginEntries) {
if (-not (Test-Path -LiteralPath $capabilityManifest)) { throw "Missing capability manifest: $capabilityManifest" }
$agentTools = @{}
$agentSkills = @{}
foreach ($entry in @(Import-Csv -LiteralPath $capabilityManifest -Delimiter ([char]9))) {
if ([string]::IsNullOrWhiteSpace($entry.role) -or [string]::IsNullOrWhiteSpace($entry.tools)) { throw 'Invalid capability manifest row.' }
$agentTools[$entry.role] = $entry.tools
# Optional: skills whose full content Claude preloads into the subagent at startup.
$agentSkills[$entry.role] = @(([string]$entry.skills).Split(',') | ForEach-Object { $_.Trim() } | Where-Object { $_ })
}
# Build into a private sibling directory and swap it into place only after validation, so a failed
@@ -171,7 +174,14 @@ foreach ($shell in @('powershell','bash')) {
$ruleContent = Get-Content $ruleSkill.Body -Raw
$ruleTitle = (Get-Content $ruleSkill.Body | Where-Object { $_ -match '^#+\s+' } | Select-Object -First 1) -replace '^#+\s+', ''
if ([string]::IsNullOrWhiteSpace($ruleTitle)) { throw "Missing rule title in $($ruleSkill.Body)" }
$ruleDescription = "Use when the task concerns $ruleTitle."
# The rule's opening "Apply ..."/"For ..." sentence states when it applies; it is a better trigger than the title.
$ruleLead = Get-Content $ruleSkill.Body | Where-Object { $_.Trim() -and $_ -notmatch '^#' } | Select-Object -First 1
if ($ruleLead -match '^(Apply|For)\s') {
$sentenceEnd = $ruleLead.IndexOf('. ')
$ruleDescription = if ($sentenceEnd -ge 0) { $ruleLead.Substring(0, $sentenceEnd + 1) } else { $ruleLead.TrimEnd() }
} else {
$ruleDescription = "Use when the task concerns $ruleTitle."
}
$skillBody = "---`r`nname: $($ruleSkill.Name)`r`ndescription: $(Quote-Toml $ruleDescription)`r`n---`r`n`r`n$ruleContent"
Set-Content (Join-Path $skillDir 'SKILL.md') $skillBody -Encoding UTF8
if ($ruleSkill.References -and (Test-Path -LiteralPath $ruleSkill.References)) {
@@ -206,6 +216,7 @@ foreach ($shell in @('powershell','bash')) {
if ($tools) { $tools = Expand-ShellPlaceholders $tools $shell }
$frontmatter = "---`r`nname: $name`r`ndescription: $description`r`n"
if ($tools) { $frontmatter += "tools: $tools`r`n" }
if ($agentSkills[$name]) { $frontmatter += "skills:`r`n" + (($agentSkills[$name] | ForEach-Object { " - $_`r`n" }) -join '') }
Set-Content (Join-Path $agentsOutput "$name.md") ($frontmatter + "---`r`n`r`n$instructions") -Encoding UTF8
}
}
+24 -4
View File
@@ -65,11 +65,13 @@ expand_shell_placeholders() {
[ -f "$plugin_manifest" ] || { printf 'Missing plugin manifest: %s\n' "$plugin_manifest" >&2; exit 1; }
awk -F '\t' 'NR == 1 { next } NF == 0 { next } $1 == "" || $3 == "" || $6 == "" { print "Invalid plugin manifest row." > "/dev/stderr"; exit 1 } seen[$1]++ { print "Duplicate plugin name in manifest: " $1 > "/dev/stderr"; exit 1 }' "$plugin_manifest"
[ -f "$capability_manifest" ] || { printf 'Missing capability manifest: %s\n' "$capability_manifest" >&2; exit 1; }
declare -A agent_tools
while IFS=$'\t' read -r role tools; do
declare -A agent_tools agent_skills
while IFS=$'\t' read -r role tools skills; do
[ "$role" != role ] || continue
[ -n "$role" ] && [ -n "$tools" ] || { printf 'Invalid capability manifest row.\n' >&2; exit 1; }
agent_tools[$role]="$tools"
# Optional: skills whose full content Claude preloads into the subagent at startup.
agent_skills[$role]="${skills:-}"
done < "$capability_manifest"
copy_directory() {
@@ -178,7 +180,16 @@ while IFS= read -r rule_path; do
mkdir -p "$skill_dir"
rule_title=$(sed -n 's/^#\{1,6\} *//p' "$rule_body" | head -n 1)
if [ -z "$rule_title" ]; then printf 'Missing rule title in %s\n' "$rule_body" >&2; exit 1; fi
rule_description="Use when the task concerns $rule_title."
# The rule's opening "Apply ..."/"For ..." sentence states when it applies; it is a better trigger than the title.
rule_lead=$(grep -v -e '^#' -e '^[[:space:]]*$' "$rule_body" | head -n 1 | tr -d '\r')
case "$rule_lead" in
'Apply '*|'For '*)
rule_description=${rule_lead%%. *}
if [ "$rule_description" != "$rule_lead" ]; then rule_description="$rule_description."; fi
rule_description=${rule_description%"${rule_description##*[![:space:]]}"}
;;
*) rule_description="Use when the task concerns $rule_title." ;;
esac
{ printf -- '---\nname: %s\ndescription: %s\n---\n\n' "$skill_name" "$(quote_toml "$rule_description")"; cat "$rule_body"; } > "$skill_dir/SKILL.md"
if [ -n "$references_dir" ] && [ -d "$references_dir" ]; then
copy_directory "$references_dir" "$skill_dir/references"
@@ -207,7 +218,16 @@ for client in codex claude; do
printf 'name = %s\ndescription = %s\ndeveloper_instructions = %s\n' "$(quote_toml "$name")" "$(quote_toml "$description")" "$(quote_toml "$instructions")" > "$agents_output/$name.toml"
else
tools=$(expand_shell_placeholders "${agent_tools[$name]:-}" "$shell")
if [ -n "$tools" ]; then printf '%s\nname: %s\ndescription: %s\ntools: %s\n%s\n\n%s\n' '---' "$name" "$description" "$tools" '---' "$instructions" > "$agents_output/$name.md"; else printf '%s\nname: %s\ndescription: %s\n%s\n\n%s\n' '---' "$name" "$description" '---' "$instructions" > "$agents_output/$name.md"; fi
{
printf -- '---\nname: %s\ndescription: %s\n' "$name" "$description"
if [ -n "$tools" ]; then printf 'tools: %s\n' "$tools"; fi
if [ -n "${agent_skills[$name]:-}" ]; then
printf 'skills:\n'
IFS=',' read -r -a preload <<<"${agent_skills[$name]}"
for skill in "${preload[@]}"; do skill=${skill//[[:space:]]/}; [ -z "$skill" ] || printf ' - %s\n' "$skill"; done
fi
printf -- '---\n\n%s\n' "$instructions"
} > "$agents_output/$name.md"
fi
done
done