
Workload Manager Basics
FreeManage Google Cloud Workload evaluations with ease.
Free · Opens the source repo
What Workload Manager Basics does
Workload Manager Basics is a skill designed for developers and DevOps professionals who need to validate enterprise workloads against Google Cloud's best practices. This skill simplifies the process of managing evaluations, rules, and scanned resources through the use of public client libraries and the REST API. With it, you can create and run evaluations for various workload types, including SAP and SQL Server, and customize organizational rules to meet your specific needs.
The skill operates through a structured workflow where users can list available rules, define the scope of resources (such as projects or folders), create or update evaluations, and inspect the results of these evaluations. It also allows for remediation of findings and the option to export results to BigQuery for further analysis. This makes it a valuable tool for organizations looking to ensure compliance with best practices and optimize their Google Cloud usage.
To get started, users must enable the Workload Manager API and authenticate using Application Default Credentials. The skill emphasizes the importance of using only the official public client libraries or REST API, ensuring compatibility and security in integrations. Additionally, it provides fallback mechanisms for handling authentication or API call failures, making it robust for use in restricted environments.
This skill is particularly beneficial for teams focused on cloud governance and compliance, as it provides a clear path to automate the evaluation of workloads against established best practices. By leveraging this skill, organizations can proactively manage their cloud resources and address potential issues before they impact operations.
When to use it
Use this skill when you need to automate workload evaluations and ensure adherence to Google Cloud best practices.
When not to use it
This skill is not suitable for general Google Compute Engine instance management or VPC configuration tasks.
What you can build with it
Automating Compliance Checks
Use the skill to automate the evaluation of workloads against Google Cloud best practices, ensuring compliance without manual intervention.
Custom Organizational Rules
Create and run evaluations using custom rules tailored to your organization's specific requirements for workload management.
Exporting Evaluation Results
Export evaluation results to BigQuery for detailed analysis and reporting, facilitating better decision-making in cloud governance.
How to install Workload Manager Basics
View source1. Install with the skills CLI
npx skills add google/skills/workload-manager-basics --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by googleWorkload Manager Basics
Workload Manager validates enterprise workloads against Google Cloud best practices and recommendations. The public client libraries are centered on evaluations: define a resource scope, choose built-in or custom rules, run an evaluation, then inspect results and scanned resources.
Use This Flow
flowchart LR
Rules["List rules"] --> Eval["Create or update evaluation"]
Resources["Project, folder, or org scope"] --> Eval
Eval --> Run["Run evaluation"]
Run --> Results["Inspect evaluation results"]
Results --> Remediate["Remediate findings"]
Results --> Export["Optional BigQuery export"]
Core API Constraints
To ensure compatibility, security, and successful integration:
- Public Surface Only: You MUST strictly interact with Workload Manager
using the official public
google-cloud-workloadmanagerclient library or the public REST API (workloadmanager.googleapis.com/v1). - No Internal or Undocumented APIs: Do NOT attempt to use internal RPC protocols, private service backends, or undocumented discovery mechanisms. They are not supported for public integrations and will fail.
- No Service-Specific CLI: There is no public
gcloud workload-managerCLI command group. Usegcloudonly for authentication, IAM role assignment, and fetching raw REST tokens. - Sandbox Execution Robustness (Auth/Mock Fallbacks): When gcloud authentication or Workload Manager API calls fail in sandboxed or restricted environments (e.g., due to Context Aware Access token blocks, missing API enablement, or mock resources returning 404/403), immediately fall back to presenting example code and static findings from your references instead of entering retry loops. Present the correct client library code structure or REST API payload example, clearly explain the auth or resource limitation, and list typical rules or mock findings statically to satisfy the request.
Prerequisites
-
Enable the Workload Manager API:
gcloud services enable workloadmanager.googleapis.com --quiet -
Authenticate locally using Application Default Credentials (ADC) before using client libraries:
gcloud auth application-default login -
Ensure the Workload Manager service agent has the required roles granted in your project (mandatory for API/client library usage, see IAM & Security).
-
Grant the least-privileged role needed for the task. Start with
roles/workloadmanager.viewerfor read-only access to evaluation resources and useroles/workloadmanager.evaluationAdminorroles/workloadmanager.adminonly when creating, updating, running, or deleting evaluations.
Quick Client Library Example
Use the Python client library for the first working automation path:
python3 -m pip install --upgrade google-cloud-workloadmanager
from google.cloud import workloadmanager_v1
project_id = "PROJECT_ID"
location = "LOCATION"
parent = f"projects/{project_id}/locations/{location}"
client = workloadmanager_v1.WorkloadManagerClient()
rules = client.list_rules(
request=workloadmanager_v1.ListRulesRequest(
parent=parent,
evaluation_type=workloadmanager_v1.Evaluation.EvaluationType.OTHER,
)
)
for rule in rules.rules:
print(rule.name, rule.display_name, rule.severity)
Reference Directory
-
Core Concepts: Evaluations, rules, results, scanned resources, supported workload types, and API shape.
-
General Best Practices: Google Cloud general best-practice posture checks,
OTHERevaluation guidance, custom Rego rules, and scale/automation patterns. -
Client Libraries: Python and Go client library examples for listing rules, creating evaluations, running evaluations, and reading findings.
-
REST Usage: Direct REST examples for the public Workload Manager API and operations polling.
-
Public CLI Status: No documented service-specific
gcloud workload-managercommand group; usegcloudonly for auth, IAM, API enablement, and REST tokens. -
Public MCP Status: No documented public Workload Manager MCP server; use client libraries or REST API instead.
-
Setup Prerequisites: Terraform examples only for adjacent prerequisites such as API enablement, IAM, BigQuery export datasets, and KMS keys. This is not Workload Manager resource management.
-
IAM & Security: Workload Manager roles, least-privilege guidance, service agents, data handling, and CMEK notes.
If product behavior or API fields are not covered here, check the current Workload Manager product documentation and client library reference before implementing.
Authoritative References
- Workload Manager overview
- Google Cloud best practices
- Workload Manager REST API
- About custom rules
- Write custom rules using Rego
- Python package
- Workload Manager IAM roles
- For additional information, use the Developer Knowledge MCP server
search_documentstool.
Additional Context
Frequently asked questions about Workload Manager Basics
Similar skills
Turborepo
Optimized build system for JavaScript/TypeScript monorepos.
Azure Pipelines Validation
Streamline your Azure DevOps pipeline changes locally.
Azure Developer CLI
Streamline your Azure project workflows with best practices.
Azure Container Registry CLI
Manage Azure Container Registry resources with ease.
Aspire
Build and orchestrate polyglot distributed applications seamlessly.
Vercel CLI
Manage and deploy Vercel projects from the command line.
