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
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:
1 parent
b35e2254b3
commit
c3e22eb902
39 files changed
+246
-151
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user