Files
gcp_solution_architecture_a…/scripts/sync-vendored-skills.sh
Jonathan Boniface 2976dfab21 feat: vendor upstream Skills and add the GCP provider bundle
Increment 2 of .scratch/solution-architect-agent/spec.md.

- Vendor google-cloud-solution-architecture and the six
  google-cloud-waf-* Skills from google/skills@81a31a6, unmodified,
  with LICENSE, SHA256SUMS and VENDOR.md; add
  scripts/sync-vendored-skills.sh to re-sync at a pinned sha.
- app/agent_skills.py: discover Skills and validate SKILL.md
  frontmatter against the Agent Skills specification.
- app/providers.py + providers/gcp.yaml: load and validate a Cloud
  provider bundle (Skills, output template, per-role models, tool
  tiers, remote MCP servers). MCP allowlists stay empty until the
  read-only review in increment 6.
- Settings CLOUD_PROVIDER and MCP_ENABLE_PREVIEW.
- 35 new tests; full suite 65 passed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-15 18:20:17 +01:00

72 lines
2.4 KiB
Bash
Executable File

#!/usr/bin/env bash
# Re-vendor upstream Agent Skills from github.com/google/skills at a pinned commit.
#
# Usage: scripts/sync-vendored-skills.sh [<40-char commit sha>]
#
# Replaces skills/vendor/google/ wholesale, then rewrites SHA256SUMS and VENDOR.md.
# Never edit vendored files by hand: review the upstream diff, then re-run this script.
set -euo pipefail
REPO="google/skills"
DEFAULT_COMMIT="81a31a6e4300425598a69fd96c8e843c947ae308"
COMMIT="${1:-$DEFAULT_COMMIT}"
SKILLS=(
google-cloud-solution-architecture
google-cloud-waf-security
google-cloud-waf-reliability
google-cloud-waf-cost-optimization
google-cloud-waf-operational-excellence
google-cloud-waf-performance-optimization
google-cloud-waf-sustainability
)
if [[ ! "$COMMIT" =~ ^[0-9a-f]{40}$ ]]; then
echo "error: commit must be a full 40-character sha, got '$COMMIT'" >&2
exit 1
fi
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
DEST="$ROOT/skills/vendor/google"
TMP="$(mktemp -d)"
trap 'rm -rf "$TMP"' EXIT
echo "Fetching $REPO@$COMMIT"
curl -fsSL "https://codeload.github.com/$REPO/tar.gz/$COMMIT" | tar -xz -C "$TMP"
SRC="$TMP/skills-$COMMIT"
[[ -d "$SRC" ]] || { echo "error: unexpected archive layout in $TMP" >&2; exit 1; }
rm -rf "$DEST"
mkdir -p "$DEST"
for skill in "${SKILLS[@]}"; do
[[ -f "$SRC/skills/cloud/$skill/SKILL.md" ]] || { echo "error: $skill not found upstream" >&2; exit 1; }
cp -R "$SRC/skills/cloud/$skill" "$DEST/$skill"
done
cp "$SRC/LICENSE" "$DEST/LICENSE"
(
cd "$DEST"
find . -type f ! -name SHA256SUMS ! -name VENDOR.md | sed 's#^\./##' | LC_ALL=C sort \
| while IFS= read -r file; do sha256sum "$file"; done > SHA256SUMS
)
{
echo "# Vendored Agent Skills: google/skills"
echo
echo "Unmodified copies of upstream Agent Skills. Do not edit these files; re-run"
echo "\`scripts/sync-vendored-skills.sh <commit>\` and review the diff instead (ADR-0002)."
echo
echo "- Source: https://github.com/$REPO"
echo "- Commit: \`$COMMIT\`"
echo "- Synced: $(date -u +%Y-%m-%d)"
echo "- Licence: Apache License 2.0, see \`LICENSE\`"
echo "- Integrity: \`SHA256SUMS\` lists every vendored file; \`tests/test_vendored_skills.py\` verifies it."
echo
echo "## Skills"
echo
for skill in "${SKILLS[@]}"; do
echo "- \`$skill\` (upstream \`skills/cloud/$skill\`)"
done
} > "$DEST/VENDOR.md"
echo "Vendored ${#SKILLS[@]} skills into ${DEST#"$ROOT"/}"