npx skills add ...
npx skills add google/skills --skill application-design-center-design-deploy
Processes GCP infrastructure design and deployment workflows within Application Design Center (ADC). Use when: - Designing GCP infrastructure with Terraform. - Validating local HCL. - Performing best-practice plan scans. - Importing templates to Application Design Center (ADC). - Deploying templates. - Troubleshooting deployment failures. Boundaries: - Only use for GCP-specific cloud infrastructure. - Only use for Terraform coding within the ADC context.
npx skills add google/skills --skill application-design-center-design-deploy
This skill provides a prescriptive, production-grade workflow for the entire
infrastructure lifecycle on Google Cloud Platform (GCP). It replaces the
automated, opaque-box GAD design_infra tool with an agent-controlled design
and validation loop utilizing modular Terraform and local CLI validation,
followed by a shifted-left best practices plan scan prior to synchronization
with the Application Design Center (ADC) registry for deployment and lifecycle
management.
Always maintain the persona of a Principal Cloud Architect. Keep the local Terraform configuration as the source of truth, and ensure the design is fully compliant with best practices before importing it into the cloud registry.
Before executing Phase 1, you must perform the following setup steps:
Confirm Target Project & Location:
Explicitly ask the user to confirm the target GCP project ID and location (region).
If the user does not specify a location, use us-central1 as the
default.
Verify that your local environment has the active project set:
Goal: Transform user requirements and codebase characteristics into a 100% validated, secure, and compile-ready Terraform configuration locally.
Invoke the design Skill: Call and execute the design skill (defined
in design)
for the user's prompt.
design skill will autonomously perform the Codebase Analysis,
query the catalog registry, planning, HCL generation, and local CLI
validation loop (terraform init, validate, plan) in a dedicated
scratch directory.Locate Validated HCL: Identify the scratch directory where the design
skill saved the validated, compile-ready Terraform files (e.g.,
scratch/tf_validate_<session_id>/).
Verify Handover (MANDATORY): Ensure that the local validation loop in
the design skill completed successfully with a clean plan before
proceeding. Meticulously inspect the HCL to verify:
terraform.tfvars or HCL
resource blocks. All sensitive inputs must be wired through GCP Secret
Manager.backend "gcs" {}) in the HCL files. State must remain
local in the scratch folder during validation, allowing ADC to handle
the remote state registry upon import.Export Terraform Plan to JSON (MANDATORY): In the scratch directory, run the following commands to generate a binary plan and convert it into a clean JSON representation:
Verify that the tfplan.json file is successfully written in your scratch
directory.
Goal: Validate the local plan's alignment with security, cost, and reliability benchmarks BEFORE importing it into the cloud registry, using the native ADC plan assessment API.
Discover Space ID (MANDATORY): Before running the assessment or creating templates, you must dynamically discover the active ADC Space ID in your target location:
List Spaces: Run the command:
Select Space: Parse the output to identify the active space (e.g.,
test-deploy or googlespace). If multiple spaces exist, ask the user
to confirm. If no space exists, ask the user or create one:
Execute Plan Assessment via gcloud: Run the plan-based assessment using
the discovered Space ID and your exported tfplan.json file. Execute the
command directly in your terminal:
Analyze Findings: Present all findings to the user in a clean tabular format, detailing specific violations, resource scopes, and associated severity levels.
Local Remediation Loop:
Do not attempt to import or commit insecure code.
Edit your local HCL files in the scratch directory to fix the reported violations (e.g., adding encryption keys, enabling OS Login, or restricting IAM scopes).
Re-run Phase 1 local validation and plan export:
Re-run the plan assessment command shown in step 2.
Exit Criteria:
Goal: Synchronize the fully validated and best-practice-compliant local HCL configuration with the ADC cloud registry to establish the deployable template resource.
Verify or Create the Application Template (MANDATORY): Before importing the HCL, you must ensure the parent Application Template resource exists in the discovered ADC space.
Check Existence: Run gcloud design-center spaces application-templates describe <template_id> --space=<space_id> --project=<project_id> --location=<location> to check if the template
exists.
Create if Missing: If the describe command returns a NOT_FOUND
error, create the template resource first by running:
Strict HCL Parser Constraints (CRITICAL): Before calling the import operation, ensure your local HCL complies with the ADC registry's strict ingestion rules:
resource blocks inside the imported HCL. Only
module, variable, output, and provider blocks are allowed. If a
resource is required (e.g. Private Service Access peering) but no
standalone module is registered for it in the catalog, you MUST check if
it is supported as a built-in configuration option inside an existing
registered module (e.g. setting private_service_access_config inside
module "vpc").subnet_private_access = "true", NOT
as a boolean true.terraform {}
version constraint block. Omit it entirely from providers.tf or
main.tf.Import to ADC Template: Once the template resource is confirmed to exist
and the HCL is validated against the above constraints, invoke the hosted
application_design_center:manage_application_template MCP tool with the
APPLICATION_TEMPLATE_OPERATION_IMPORT_IAC operation:
Arguments:
project: The target project ID.
location: The GCP deployment region (e.g., us-central1).
spaceId: The discovered ADC space ID.
applicationTemplateId: A unique name for your application
template.
operation: APPLICATION_TEMPLATE_OPERATION_IMPORT_IAC
iacModule: A structured object containing the files list:
Resilience & Retries (MANDATORY):
IMPORT_IAC call fails due to a transient error (e.g., 502 Bad Gateway, 504 Gateway Timeout, or 429 Rate Limit), do not
immediately retry.gcloud alpha design-center spaces application-templates describe
to check if the import actually succeeded in the background. Only
retry if the template was not updated.Capture Template URI: Upon success, this establishes the template
resource in your space. Construct the applicationTemplateUri using the
pattern:
projects/{project}/locations/{location}/spaces/{spaceId}/applicationTemplates/{applicationTemplateId}
Goal: Deploy the validated, best-practice-compliant application template to the GCP environment.
application_design_center:manage_application MCP tool with the
APPLICATION_OPERATION_DEPLOY operation:
project: Target project ID.location: Target deployment location.spaceId: Target space ID.applicationId: A unique ID for the deployed application instance.applicationTemplateUri: The URI established in Phase 3.serviceAccount: The deployment service account.DEPLOY operation fails with transient network or gateway
errors (e.g., 502, 504), apply exponential backoff with
jitter before retrying.gcloud design-center spaces applications describe to confirm its status before retrying the
deploy call, avoiding concurrent conflicting deployments.done: true using the command gcloud design-center operations describe <operation_name>.done is true and there is no error field, proceed
to Phase 6.error field is present, analyze the error type and
proceed to Phase 5.Goal: Diagnose and remediate deployment failures iteratively using the specialized troubleshooting skill and established cloud resolution patterns.
Iterative Cloud Resolution Patterns (CRITICAL): If the deployment fails
with a REVISION_FAILED or TERRAFORM error, check for these common
resource conflicts:
Service Account 409 Conflict (alreadyExists): If the deployment
fails because a service account generated by the module (e.g.
frontend-service-us-central-sa) already exists in the project,
remediate the local HCL by disabling service account creation and
referencing the existing one:
Container Image 404 NotFound: If the deployment fails because a
container image is not found, confirm that the image exists in your
registry. For testing or hello-world deployments, leverage the official
public Google hello-world image:
us-docker.pkg.dev/cloudrun/container/hello
Delegate to the Troubleshooting Skill: If a deployment failure occurs
and does not match the above patterns, invoke and execute the specialized
infra-deployment-debugging guide (located in
infra-deployment-debugging).
Select the Troubleshooting Context:
Apply Local-First Remediation:
Follow the troubleshooting skill's remediation guides to formulate a fix.
MANDATORY: Apply the fix directly to your local HCL files in the scratch directory, re-run local validation, re-import the HCL, and trigger a new deployment.
Re-run Phase 1 local validation and plan export:
Re-run the plan assessment (Phase 2) to ensure no new violations are introduced.
Re-import the corrected HCL to ADC using
APPLICATION_TEMPLATE_OPERATION_IMPORT_IAC.
Trigger a new deployment using APPLICATION_OPERATION_DEPLOY.
Iteration Threshold: Repeat the troubleshooting, validation, import, and redeployment cycle up to five (5) times. If it still fails, report the full history and diagnostics to the user.
Goal: Confirm that the deployed services are healthy and fully functional.
application_design_center:manage_application MCP tool with the
APPLICATION_OPERATION_GET operation to retrieve the resource details,
public endpoints, and output parameters.Report bugs or improvements for this skill at Google Skills Issues.