v1.0.0 to v1.1.0

134 added, 90 removed. Audit A to A.

What this update changes in the checks

No check changed: every fixed check gives the same answer before and after this update.

A tripped check is a label, not a verdict: read the matched text and the lines below. This week's updates that newly trip a check.

---
name: gcloud-cli-health-check
description: >
Run a Google Cloud CLI (gcloud) health check — verify installation, authentication, active
- project, enabled APIs (gmail, calendar, Cloud Run), API token, billing, and Cloud Run services.
- Use this skill when the user says "gcloud health check", "check gcloud", "is gcloud working",
- "GCP health check", "check Google Cloud", "gcloud CLI health check", "test gcloud auth",
- "check Cloud Run", or any request to verify that the gcloud CLI is installed and operational.
- Also triggered by the scheduled task named "gcloud-cli-health-check".
+ project, recommended region, enabled APIs (run, cloudbuild, artifactregistry, secretmanager,
+ cloudresourcemanager, iam, plus gmail/calendar/monitoring/logging), API access token, billing,
+ IAM bindings, service accounts, and Cloud Run services across both primary and secondary
+ projects. Use this skill when the user says "gcloud health check", "check gcloud", "is gcloud
+ working", "GCP health check", "check Google Cloud", "gcloud CLI health check", "test gcloud
+ auth", "check Cloud Run", or any request to verify that the gcloud CLI is installed and
+ operational. Also triggered by the scheduled task named "gcloud-cli-health-check" (or the
+ legacy name "gcloud-health-check").
metadata:
- version: "1.0.0"
- updated: "2026-04-06"
+ version: "1.1.0"
+ updated: "2026-04-20"
author: "MSApps"
---
- This skill may run in an automated/scheduled context with no user present. Execute all steps autonomously without asking clarifying questions. For write actions (send, post, create, update, delete), only take them if explicitly requested. When in doubt, produce a report.
+ This skill may run in an automated/scheduled context with no user present. Execute all steps autonomously without asking clarifying questions. For write actions (send, post, create, update, delete), only take them if explicitly requested. When in doubt, produce a report of what you found.
## Critical: Use Desktop Commander — Not the Bash Tool
- All `gcloud` commands MUST run via `mcp__Desktop_Commander__start_process`. The Bash tool runs in a sandboxed Linux environment where gcloud is not installed. The user's Mac has Google Cloud SDK installed and accessible from Desktop Commander.
+ All `gcloud` commands MUST run via `mcp__Desktop_Commander__start_process`. The Bash tool runs in a sandboxed Linux environment where gcloud is not installed AND the sandbox proxy returns `403 blocked-by-allowlist` for every Google endpoint (dl.google.com, sdk.cloud.google.com, oauth2.googleapis.com, www.googleapis.com, accounts.google.com). The user's Mac has Google Cloud SDK installed at `/opt/homebrew/bin/gcloud` with auth already configured.
```
- ✅ mcp__Desktop_Commander__start_process → runs on user's Mac → gcloud found
- ❌ Bash tool → runs in Linux sandbox → gcloud not found
+ ✅ mcp__Desktop_Commander__start_process → runs on user's Mac → gcloud found, auth available
+ ❌ Bash tool → runs in Linux sandbox → gcloud not found, Google blocked
```
+ If Desktop Commander is unavailable, do NOT try to install gcloud in the sandbox — it is impossible (no network access to Google, no sudo). Write a report documenting the block and stop.
+
+ ## Expected State
+
+ | Thing | Expected value |
+ |---|---|
+ | gcloud binary | `/opt/homebrew/bin/gcloud` (macOS, Homebrew) |
+ | Active account | `michal@opsagents.agency` (primary) |
+ | Active project | `opsagent-491114` |
+ | Compute region | `me-west1` (Israeli prod) |
+ | Secondary project | `socialjetopsagent` (SocialJet Gmail/Calendar services) |
+
+ Legacy accepted account: `msmobileapps@gmail.com` (same billing family — flag as ⚠️ informational, not ❌).
+
## Step 1 — Verify gcloud is installed
```bash
- gcloud --version 2>/dev/null || ~/google-cloud-sdk/bin/gcloud --version 2>/dev/null || echo "NOT_FOUND"
+ /opt/homebrew/bin/gcloud --version
```
- If output contains "NOT_FOUND", mark Installation as ❌ and skip remaining steps.
+ Fall back to `gcloud --version` if the explicit path is missing. If both fail → mark Installation ❌ and stop.
## Step 2 — Check authentication
```bash
- gcloud auth list 2>&1
+ /opt/homebrew/bin/gcloud auth list
+ /opt/homebrew/bin/gcloud auth print-access-token --account=michal@opsagents.agency | head -c 20
+ /opt/homebrew/bin/gcloud auth application-default print-access-token | head -c 20
```
- Parse the output to identify:
- - Which accounts are authenticated (look for `*` prefix = active account)
- - Expected active account: `msmobileapps@gmail.com`
- - If active account differs from expected, mark Auth as ⚠️ and note the mismatch
- - If no accounts at all, mark Auth as ❌
+ Parse:
+ - Active account (line starting with `*`).
+ - `michal@opsagents.agency` present? User-token OK?
+ - ADC token OK?
- ## Step 3 — Check active project
+ If no accounts at all → mark Auth ❌. If wrong account active → mark ⚠️ and note. If ADC missing → mark ⚠️ (some SDKs need it).
+ ## Step 3 — Check active project and region
+
```bash
- gcloud config get-value project 2>&1
+ /opt/homebrew/bin/gcloud config get-value project
+ /opt/homebrew/bin/gcloud config get-value compute/region
+ /opt/homebrew/bin/gcloud projects describe opsagent-491114 --format="value(lifecycleState,projectId,name)"
```
- - Expected project: `opsagent-491114`
- - If the output matches, mark ✅
- - If it's a different project ID, mark ⚠️ and note the discrepancy
- - If unset/empty, mark ❌
+ - Project must be `opsagent-491114` and `lifecycleState=ACTIVE` → ✅
+ - Region should be `me-west1` (warn ⚠️ if different, it still works)
+ - Mismatch on project → ⚠️
- ## Step 4 — Check enabled APIs
+ ## Step 4 — Billing
```bash
- gcloud services list --enabled --format="value(config.name)" --limit=25 2>&1
+ /opt/homebrew/bin/gcloud billing projects describe opsagent-491114
```
- Note: this runs against the currently active project. If the active project is wrong (Step 3), the API list may not reflect `opsagent-491114`.
+ - `billingEnabled: true` → ✅
+ - Missing / false → ⚠️ (Cloud Run free tier still applies but deploys require billing linked)
- Flag if any of these are missing:
+ Do NOT run `gcloud alpha billing accounts list` — it triggers an interactive prompt to install beta components and hangs in automated runs.
+
+ ## Step 5 — Enabled APIs (critical + optional)
+
+ ```bash
+ /opt/homebrew/bin/gcloud services list --enabled --project=opsagent-491114 --format="value(config.name)"
+ ```
+
+ Critical (must be enabled — flag ❌ if missing):
+ - `run.googleapis.com`
+ - `cloudbuild.googleapis.com`
+ - `artifactregistry.googleapis.com`
+ - `secretmanager.googleapis.com`
+ - `cloudresourcemanager.googleapis.com`
+ - `iam.googleapis.com`
+
+ Optional (flag ⚠️ if missing):
- `gmail.googleapis.com`
- `calendar-json.googleapis.com`
- - `run.googleapis.com` (needed for Cloud Run deployments)
+ - `monitoring.googleapis.com`
+ - `logging.googleapis.com`
- ## Step 5 — Test API connectivity (access token)
+ ## Step 6 — Cloud Run services (multi-region, multi-project)
```bash
- gcloud auth print-access-token 2>&1 | head -c 40 && echo "...[truncated]"
+ /opt/homebrew/bin/gcloud run services list --region=me-west1 --project=opsagent-491114
+ /opt/homebrew/bin/gcloud run services list --region=us-central1 --project=opsagent-491114
+ /opt/homebrew/bin/gcloud run services list --project=socialjetopsagent
```
- If a token is returned (starts with `ya29.`), mark API Access as ✅. If it fails, mark as ❌.
+ Record: service name, region, URL, last deployed. If all three return zero services → ⚠️ (not yet deployed / expected in early stage). If any unexpected error → note it.
- ## Step 6 — Check billing
+ ## Step 7 — IAM roles for michal@opsagents.agency
- Use this command (avoids triggering beta component install prompts):
```bash
- gcloud billing projects describe $(gcloud config get-value project 2>/dev/null) 2>&1
+ /opt/homebrew/bin/gcloud projects get-iam-policy opsagent-491114 \
+ --flatten="bindings[].members" \
+ --format="table(bindings.role)" \
+ --filter="bindings.members:michal@opsagents.agency"
```
- Parse the output:
- - `billingEnabled: true` → mark ✅
- - `billingEnabled: false` or error → mark ⚠️ (Cloud Run deployments require billing to be linked, though the free tier covers normal usage)
+ Record the roles. If `roles/owner` or `roles/editor` is present → ✅. If empty → ❌ (account has no access to project).
- Do NOT run `gcloud alpha billing accounts list` — it prompts to install beta components interactively.
+ ## Step 8 — Service accounts
- ## Step 7 — Check Cloud Run services
+ ```bash
+ /opt/homebrew/bin/gcloud iam service-accounts list --project=opsagent-491114
+ ```
+ Record the list. Flag if the default Compute Engine SA still has broad permissions (security best practice: replace with scoped SAs + Workload Identity).
+
+ ## Step 9 — Configurations
+
```bash
- gcloud run services list --platform=managed --format="table(SERVICE,REGION,URL,LAST_DEPLOYED_BY,LAST_DEPLOYED_AT)" 2>&1
+ /opt/homebrew/bin/gcloud config configurations list
```
- - If services are listed: show table, mark ✅
- - If no services yet: mark ⚠️ (not yet deployed — expected in early stage)
- - If error about billing or permissions: mark ⚠️ and note reason
+ Record which configuration is active.
- ## Step 8 — Save report
+ ## Step 10 — Save report
- Save as `gcloud-health-check-YYYY-MM-DD.md` in the workspace folder:
+ Save as `gcloud-health-check-YYYY-MM-DD.md` in the workspace outputs folder (overwriting any prior `BLOCKED` report from the same day):
```markdown
# gcloud CLI Health Check — YYYY-MM-DD HH:MM
+ **Account:** michal@opsagents.agency
+ **Project:** opsagent-491114 (+ socialjetopsagent)
+ **Runner:** Desktop Commander (user's Mac)
+ **Overall:** ✅ / ⚠️ / ❌
+
## Summary Table
| Check | Status |
|-------|:------:|
- | Installation | ✅/❌ |
- | Authentication | ✅/⚠️/❌ |
- | Active Project | ✅/⚠️/❌ |
- | Enabled APIs | ✅/⚠️/❌ |
- | API Access (token) | ✅/❌ |
- | Billing | ✅/⚠️/❌ |
- | Cloud Run | ✅/⚠️/❌ |
+ | a. Installation | ✅/❌ |
+ | b. Authentication (user + ADC) | ✅/⚠️/❌ |
+ | c. Active Project + Region | ✅/⚠️/❌ |
+ | d. Billing | ✅/⚠️/❌ |
+ | e. Critical APIs | ✅/⚠️/❌ |
+ | f. Optional APIs | ✅/⚠️ |
+ | g. Cloud Run (me-west1 / us-central1 / socialjetopsagent) | ✅/⚠️/❌ |
+ | h. IAM roles for michal | ✅/❌ |
+ | i. Service accounts | ✅/⚠️ |
+ | j. Configurations | ✅ |
## Details
- ### Installation
- - SDK version: X.X.X
-
- ### Authentication
- - Active account: <account>
- - Expected: msmobileapps@gmail.com
- - Status: matches / mismatch ⚠️
-
- ### Active Project
- - Project: <project-id>
- - Expected: opsagent-491114
- - Status: matches / mismatch ⚠️
+ (Each section with raw output, parsed findings, diffs vs expected state.)
- ### Enabled APIs
- - List of enabled APIs
- - Missing: <list any missing critical APIs>
+ ## Notes
+ (Mismatches, unexpected errors, proposed fixes.)
+ ```
- ### API Access (token)
- - Token: ya29.xxxx...[truncated]
- - Status: valid / failed
+ ## AUTO-FIX LOOP
- ### Billing
- - billingAccountName: <account>
- - billingEnabled: true/false
+ If any step fails, attempt these fixes via Desktop Commander before giving up (max 3 attempts per step):
- ### Cloud Run Services
- | Service | Region | URL |
- |---------|--------|-----|
- | <name> | <region> | <url> |
+ 1. **gcloud not found at `/opt/homebrew/bin/gcloud`**:
+ - `which gcloud` to find an alternate path
+ - `brew install --cask google-cloud-sdk` (may prompt for password — document if it does)
+ 2. **Wrong active account**: `gcloud config set account michal@opsagents.agency`
+ 3. **Wrong active project**: `gcloud config set project opsagent-491114`
+ 4. **Region unset**: `gcloud config set compute/region me-west1`
+ 5. **ADC missing**: `gcloud auth application-default login` (requires interactive browser — flag as manual)
+ 6. **API disabled**: `gcloud services enable <api-name> --project=opsagent-491114`
+ 7. **Billing not linked**: flag as manual (requires billing account admin)
- ## Notes
- (Any issues, mismatches, or action items)
- ```
+ Always save the final report regardless of pass/fail count. Document every fix attempt.
## Account Architecture Reference
| Account | Project | Role |
|---------|---------|------|
- | msmobileapps@gmail.com | opsagent-491114 | Core ops / MSApps infra — owns gcloud CLI, GCP projects |
- | socialjetopsagents@gmail.com | socialjetopsagent | SocialJet ops — Gmail API, Calendar services |
+ | michal@opsagents.agency | opsagent-491114 | Primary — OpsAgent core infra, Cloud Run, IAM |
+ | msmobileapps@gmail.com | opsagent-491114 | Legacy billing owner — same project, org-level |
+ | socialjetopsagents@gmail.com | socialjetopsagent | SocialJet ops — separate project |
## Cloud Run Free Tier (reference)
- - 2 million requests/month free
- - 360,000 GB-seconds of memory free
+ - 2M requests/month free
+ - 360,000 GB-seconds memory free
- 180,000 vCPU-seconds free
- - Scales to zero when idle — no idle cost
- - Billing account must be linked (free tier still applies)
+ - Scales to zero — no idle cost
+ - Billing must be linked (free tier still applies)
## Autonomy Rules
- - Read auth/project/APIs/token/billing/Cloud Run status: ✅ always allowed (read-only)
- - Modify any GCP settings or create/delete resources: ❌ never without explicit user confirmation
+ - Read auth/project/APIs/token/billing/IAM/Cloud Run/service accounts/configs: ✅ always allowed (read-only)
+ - `gcloud config set` for account/project/region: ✅ allowed in auto-fix loop (reversible)
+ - `gcloud services enable`: ✅ allowed in auto-fix loop (no cost, already-billed project)
+ - Create/delete any resource, grant IAM, change billing: ❌ never without explicit user confirmation