🐛 fix(playbook): address reported repo issues
normalize Windows path-like TOML config values, regenerate .agents/index.md on sync, keep the SKILLS.md superpowers section route-only, and ignore generated Python cache dirs. add regression coverage for load_config() and the standards sync behavior touched by these fixes.
This commit is contained in:
@@ -60,58 +60,7 @@ done
|
||||
|
||||
printf "%s\n" "${names[@]}" | sort > "$SUPERPOWERS_LIST"
|
||||
|
||||
update_block() {
|
||||
local file="$1"
|
||||
local start="<!-- superpowers:skills:start -->"
|
||||
local end="<!-- superpowers:skills:end -->"
|
||||
local tmp
|
||||
|
||||
tmp="$(mktemp)"
|
||||
{
|
||||
echo "### Third-party Skills (superpowers)"
|
||||
echo ""
|
||||
echo "$start"
|
||||
while IFS= read -r name; do
|
||||
[ -n "$name" ] || continue
|
||||
echo "- $name"
|
||||
done < "$SUPERPOWERS_LIST"
|
||||
echo "$end"
|
||||
} > "$tmp"
|
||||
|
||||
if grep -q "$start" "$file"; then
|
||||
awk -v start="$start" -v end="$end" -v block="$tmp" '
|
||||
BEGIN {
|
||||
while ((getline line < block) > 0) { buf[++n] = line }
|
||||
close(block)
|
||||
inblock=0
|
||||
replaced=0
|
||||
}
|
||||
{
|
||||
if (!replaced && $0 == start) {
|
||||
for (i=1; i<=n; i++) print buf[i]
|
||||
inblock=1
|
||||
replaced=1
|
||||
next
|
||||
}
|
||||
if (inblock) {
|
||||
if ($0 == end) { inblock=0 }
|
||||
next
|
||||
}
|
||||
print
|
||||
}
|
||||
' "$file" > "${file}.tmp"
|
||||
mv "${file}.tmp" "$file"
|
||||
else
|
||||
echo "" >> "$file"
|
||||
cat "$tmp" >> "$file"
|
||||
fi
|
||||
|
||||
rm -f "$tmp"
|
||||
}
|
||||
|
||||
update_block "SKILLS.md"
|
||||
|
||||
git add codex/skills SKILLS.md "$SUPERPOWERS_LIST"
|
||||
git add codex/skills "$SUPERPOWERS_LIST"
|
||||
|
||||
if git diff --cached --quiet; then
|
||||
echo "No changes to sync."
|
||||
|
||||
Reference in New Issue
Block a user