Skip to content

ericrisco/rsc-harness / skills/gcp-essentials

gcp-essentials

Verified

Use when running a small product on core Google Cloud via the gcloud CLI: a project, Cloud Run deploys, a locked-down Cloud Storage bucket, managed Cloud SQL, and least-privilege IAM wiring them together. NOT AWS (that is `aws-essentials`), NOT the CI pipeline that ships the image (that is `deployment`), NOT Postgres schema/query tuning (that is `postgresdb`).

FileKindSize
SKILL.mdskill md14.6 KB
evals/README.mdmarkdown788 B
evals/cases.yamlconfig2.5 KB
references/deploy-recipes.mdmarkdown2.7 KB
references/iam-and-auth.mdmarkdown3.7 KB
references/networking-and-sql.mdmarkdown3.2 KB
scripts/verify.shexecutablescript5.5 KB

scripts/verify.sh

View on GitHub
#!/usr/bin/env bash
# verify.sh — offline static linter for GCP gcloud command blocks.
#
# Flags known-unsafe patterns in files that contain `gcloud` commands:
#   - service-account JSON key creation
#   - roles/owner or roles/editor bound to a serviceAccount member
#   - bucket create missing --uniform-bucket-level-access or --public-access-prevention
#   - Cloud SQL create using public IP (--assign-ip / no --no-assign-ip)
#   - Cloud Run deploy/replace missing --service-account
#
# No network, no gcloud, read-only. Prints PASS/FAIL per check.
# Exit 0 when the target is empty/clean, nonzero when any FAIL is found.
#
# Usage:
#   bash verify.sh <file-or-dir> [<file-or-dir> ...]
#   bash verify.sh                # defaults to the skill dir (SKILL.md + references/)

set -uo pipefail

# ---- collect target files -------------------------------------------------
declare -a TARGETS=()
if [[ $# -eq 0 ]]; then
  here="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
  TARGETS=("$here")
else
  TARGETS=("$@")
fi

declare -a FILES=()
for t in "${TARGETS[@]}"; do
  if [[ -d "$t" ]]; then
    while IFS= read -r f; do FILES+=("$f"); done < <(
      find "$t" -type f \( -name '*.sh' -o -name '*.md' -o -name '*.bash' -o -name '*.txt' \) 2>/dev/null
    )
  elif [[ -f "$t" ]]; then
    FILES+=("$t")
  else
    echo "WARN  no such file or directory: $t" >&2
  fi
done

if [[ ${#FILES[@]} -eq 0 ]]; then
  echo "PASS  no target files to lint (clean)"
  exit 0
fi

fails=0

# report FAIL <check> <file> <lineno> <line>
report() {
  printf 'FAIL  %-22s %s:%s: %s\n' "$1" "$2" "$3" "$4"
  fails=$((fails + 1))
}

for f in "${FILES[@]}"; do
  lineno=0
  # Track context for multi-line `gcloud` commands joined by trailing backslash.
  buf=""
  buf_start=0
  flush_buf() {
    [[ -z "$buf" ]] && return
    local cmd="$buf"
    # --- Cloud Run deploy/replace must carry --service-account ---
    if echo "$cmd" | grep -Eq 'gcloud[[:space:]]+run[[:space:]]+(deploy|services[[:space:]]+replace)'; then
      if ! echo "$cmd" | grep -q -- '--service-account'; then
        report "run-no-service-account" "$f" "$buf_start" "gcloud run deploy/replace without --service-account"
      fi
    fi
    # --- bucket create must carry UBLA and PAP ---
    if echo "$cmd" | grep -Eq 'gcloud[[:space:]]+storage[[:space:]]+buckets[[:space:]]+create'; then
      if ! echo "$cmd" | grep -q -- '--uniform-bucket-level-access'; then
        report "bucket-no-ubla" "$f" "$buf_start" "bucket create missing --uniform-bucket-level-access"
      fi
      if ! echo "$cmd" | grep -q -- '--public-access-prevention'; then
        report "bucket-no-pap" "$f" "$buf_start" "bucket create missing --public-access-prevention"
      fi
    fi
    # --- Cloud SQL create must not use public IP ---
    if echo "$cmd" | grep -Eq 'gcloud[[:space:]]+sql[[:space:]]+instances[[:space:]]+create'; then
      if echo "$cmd" | grep -Eq -- '--assign-ip([^a-z]|$)'; then
        report "sql-public-ip" "$f" "$buf_start" "Cloud SQL create uses --assign-ip (public IP)"
      elif ! echo "$cmd" | grep -q -- '--no-assign-ip'; then
        report "sql-no-private" "$f" "$buf_start" "Cloud SQL create missing --no-assign-ip (defaults to public IP)"
      fi
    fi
    buf=""
  }

  # For Markdown files, only lint inside fenced code blocks (```bash / ```sh /
  # ```). Prose and anti-pattern table cells (which quote unsafe commands on
  # purpose) must not trip the linter. Non-.md files are treated as all-code.
  in_code=true
  is_md=false
  case "$f" in
    *.md) is_md=true; in_code=false ;;
  esac

  while IFS= read -r line || [[ -n "$line" ]]; do
    lineno=$((lineno + 1))

    # Toggle fenced-code state for Markdown.
    if $is_md && [[ "$line" =~ ^[[:space:]]*\`\`\` ]]; then
      if $in_code; then in_code=false; else in_code=true; fi
      flush_buf
      continue
    fi
    if ! $in_code; then
      continue
    fi

    # Skip prose/comment-only lines for keyword checks but still scan for the
    # hard banned single-line patterns below.
    stripped="${line#"${line%%[![:space:]]*}"}"   # ltrim
    is_comment=false
    [[ "$stripped" == \#* ]] && is_comment=true

    # ---- single-line hard bans (checked on every non-comment line) ----
    if ! $is_comment; then
      # JSON key creation — never.
      if echo "$line" | grep -Eq 'gcloud[[:space:]]+iam[[:space:]]+service-accounts[[:space:]]+keys[[:space:]]+create'; then
        report "sa-json-key-create" "$f" "$lineno" "$stripped"
      fi
      # primitive owner/editor bound to a service account.
      if echo "$line" | grep -Eq -- '--role=("?)roles/(owner|editor)\b' \
         && echo "$line" | grep -q 'serviceAccount:'; then
        report "primitive-role-on-sa" "$f" "$lineno" "$stripped"
      fi
      # primitive owner/editor in a member+role grant spanning the same command
      # (covers the common case where role is on the same line).
    fi

    # ---- accumulate multi-line gcloud commands (backslash continuation) ----
    if $is_comment; then
      flush_buf
      continue
    fi
    if [[ -n "$buf" ]]; then
      buf="$buf $stripped"
    elif echo "$stripped" | grep -Eq '^gcloud([[:space:]]|$)'; then
      buf="$stripped"
      buf_start=$lineno
    fi
    # End of a command when the line does not end in a backslash.
    if [[ -n "$buf" && "${line%\\}" == "$line" ]]; then
      flush_buf
    fi
  done < "$f"
  flush_buf
done

echo "----"
if [[ $fails -eq 0 ]]; then
  echo "PASS  ${#FILES[@]} file(s) linted, no unsafe gcloud patterns found"
  exit 0
else
  echo "FAIL  $fails unsafe pattern(s) found across ${#FILES[@]} file(s)"
  exit 1
fi
writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deploymentStars: 322kUpdated Claude CodeCodexVerifiedInstall
xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release.Stars: 118kUpdated Claude CodeCodexVerifiedInstall