contributing
Skill2.1k starsChanged 12 months agoApache-2.0View on GitHub
End-to-end workflow for contributing to Cloud Foundation Fabric: triaging GitHub issues, proactive feature development, validating with tests and Policy Troubleshooter, and submitting sanitized Pull Requests. Use when addressing a Fabric GitHub issue, developing a module or FAST stage change, or preparing a branch for a pull request.
- Commits and pushes
13 other projects use a version of this.
Trending
More talk lately.about the whole repository
Most recently taken up by
- kortix-ai/sunatheir own version, first seen Oct 5, 2026
- rokokol/contributing-skilltheir own version, first seen Sep 15, 2026
- crmne/ruby_llmtheir own version, first seen Sep 14, 2026
- cloudflare/cloudflare-docstheir own version, first seen Sep 14, 2026
- Dpro-at/Tel-Agenttheir own version, first seen Sep 13, 2026
- tronschell/shinbotheir own version, first seen Sep 12, 2026
Who's talking about GoogleCloudPlatform/cloud-foundation-fabric
- GoogleCloudPlatform/genai-factory“[FR] Add factory for Cloud Run GPU”GitHub · Aug 8, 2025 · 1 reactions
- opentofu/opentofu“Needs OpenTofu image version compatible with terraform version 1.7.x”GitHub · Jun 6, 2024 · 1 reactions
- hashicorp/terraform-provider-google“google_beta >= 4.32 google_container_node_pool update issue”GitHub · Sep 14, 2022 · 1 reactions
- Cyclenerd/bookmarks-manager“Bump service-account-cloud-run-bookmarks-manager::cloud-foundation-fabric from 58.0.0 to 59.0.0 in /gcp”GitHub · Oct 4, 2026
- Cyclenerd/bookmarks-manager“Bump gcs-bookmarks-manager-database::cloud-foundation-fabric from 58.0.0 to 59.0.0 in /gcp”GitHub · Oct 4, 2026
The biggest 5 of 39 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 39
Talked about on GitHub (39 times).
On GitHub · 39
- Aug 8, 2025[FR] Add factory for Cloud Run GPU — GoogleCloudPlatform/genai-factory1 reaction · 2 comments
- Jun 6, 2024Needs OpenTofu image version compatible with terraform version 1.7.x — opentofu/opentofu1 reaction · 6 comments
- Sep 14, 2022google_beta >= 4.32 google_container_node_pool update issue — hashicorp/terraform-provider-google1 reaction · 8 comments
- Oct 4, 2026Bump service-account-cloud-run-bookmarks-manager::cloud-foundation-fabric from 58.0.0 to 59.0.0 in /gcp — Cyclenerd/bookmarks-manager0 reactions
- Oct 4, 2026Bump gcs-bookmarks-manager-database::cloud-foundation-fabric from 58.0.0 to 59.0.0 in /gcp — Cyclenerd/bookmarks-manager0 reactions
34 more on GitHub
- Oct 4, 2026Bump artifact-registry-container::cloud-foundation-fabric from 58.0.0 to 59.0.0 in /gcp — Cyclenerd/bookmarks-manager0 reactions
- Oct 3, 2026agent-skills.github.googlecloudplatform.cloud-foundation-fabric: 58.0.0 → 59.0.0 — sudosubin/agents.nix0 reactions
- Oct 2, 2026Update Terraform github.com/GoogleCloudPlatform/cloud-foundation-fabric to v59 — iht/beam-cloud-build-terraform0 reactions
- Sep 27, 2026agent-skills.github.googlecloudplatform.cloud-foundation-fabric: init at 58.0.0 — sudosubin/agents.nix0 reactions
- Jun 22, 2026build(deps): bump project::cloud-foundation-fabric from 23.0.0 to 56.2.0 — GoogleCloudPlatform/deploystack-auditlogs-to-bq0 reactions
- Jun 22, 2026build(deps): bump bigquery-dataset::cloud-foundation-fabric from 23.0.0 to 56.2.0 — GoogleCloudPlatform/deploystack-auditlogs-to-bq0 reactions
- May 21, 2026Update Terraform github.com/GoogleCloudPlatform/cloud-foundation-fabric to v56 — GoogleCloudPlatform/nvidia-nemo-on-gke0 reactions
- May 10, 2026Dependency Dashboard — GoogleCloudPlatform/cloud-networking-solutions0 reactions
- Apr 16, 2026Configure Renovate — GoogleCloudPlatform/mdk-lightweight0 reactions
- Oct 27, 2025build(deps): bump service-account-sql::cloud-foundation-fabric from 23.0.0 to 46.0.0 — GoogleCloudPlatform/deploystack-cloudsql-multiregion0 reactions
- Oct 27, 2025build(deps): bump vpc::cloud-foundation-fabric from 23.0.0 to 46.0.0 — GoogleCloudPlatform/deploystack-cloudsql-multiregion0 reactions
- Oct 27, 2025build(deps): bump firewall::cloud-foundation-fabric from 23.0.0 to 46.0.0 — GoogleCloudPlatform/deploystack-cloudsql-multiregion0 reactions
- Oct 27, 2025build(deps): bump project::cloud-foundation-fabric from 23.0.0 to 46.0.0 — GoogleCloudPlatform/deploystack-cloudsql-multiregion0 reactions
- Oct 27, 2025build(deps): bump vpc-firewall::cloud-foundation-fabric from 23.0.0 to 46.0.0 — GoogleCloudPlatform/deploystack-gcs-to-bq-with-least-privileges0 reactions
- Oct 27, 2025build(deps): bump service-account-bq::cloud-foundation-fabric from 23.0.0 to 46.0.0 — GoogleCloudPlatform/deploystack-gcs-to-bq-with-least-privileges0 reactions
- Oct 27, 2025build(deps): bump service-account-df::cloud-foundation-fabric from 23.0.0 to 46.0.0 — GoogleCloudPlatform/deploystack-gcs-to-bq-with-least-privileges0 reactions
- Oct 27, 2025build(deps): bump nat::cloud-foundation-fabric from 23.0.0 to 46.0.0 — GoogleCloudPlatform/deploystack-gcs-to-bq-with-least-privileges0 reactions
- Oct 27, 2025build(deps): bump gcs-data::cloud-foundation-fabric from 23.0.0 to 46.0.0 — GoogleCloudPlatform/deploystack-gcs-to-bq-with-least-privileges0 reactions
- Sep 10, 2025Update Terraform github.com/GoogleCloudPlatform/cloud-foundation-fabric to v41.1.0 — GoogleCloudPlatform/cloudnetworking-config-solutions0 reactions
- Sep 10, 2025Update Terraform github.com/GoogleCloudPlatform/cloud-foundation-fabric to v40.2.0 — GoogleCloudPlatform/cloudnetworking-config-solutions0 reactions
- Jul 17, 2025Update Terraform github.com/GoogleCloudPlatform/cloud-foundation-fabric to v39.2.0 — GoogleCloudPlatform/cloudnetworking-config-solutions0 reactions
- May 9, 2025Update Terraform github.com/GoogleCloudPlatform/cloud-foundation-fabric to v38.2.0 — GoogleCloudPlatform/cloudnetworking-config-solutions0 reactions
- May 5, 2025Update Terraform github.com/GoogleCloudPlatform/cloud-foundation-fabric to v39.2.0 — GoogleCloudPlatform/nvidia-nemo-on-gke0 reactions
- Feb 11, 2025Dependency Dashboard — iht/beam-cloud-build-terraform0 reactions
- Jan 26, 2025Bump project::cloud-foundation-fabric from 36.0.1 to 37.1.0 in /examples/basic — benjaminwestern/dataform-terraform0 reactions
- Jan 26, 2025Bump dataform-sa::cloud-foundation-fabric from 36.0.1 to 37.1.0 in /examples/basic — benjaminwestern/dataform-terraform0 reactions
- Jan 26, 2025Bump dataform-ssh-key::cloud-foundation-fabric from 36.0.1 to 37.1.0 in /examples/basic — benjaminwestern/dataform-terraform0 reactions
- Jan 21, 2025Dependency Dashboard — GoogleCloudPlatform/gcc-conversational_ai_analytics0 reactions
- Jan 10, 2025Update Terraform github.com/GoogleCloudPlatform/cloud-foundation-fabric to v36.2.0 — GoogleCloudPlatform/cloudnetworking-config-solutions0 reactions
- Jun 10, 2024Dependency Dashboard — GoogleCloudPlatform/dataflow-solution-guides0 reactions
- May 18, 2024Expose the retention variable in apigee-x-core — apigee/terraform-modules0 reactions · 1 comment
- May 1, 2024Dependency Dashboard — GoogleCloudPlatform/nvidia-nemo-on-gke0 reactions
- Apr 14, 2023Implement Support for VPC Flow Logs — apigee/terraform-modules0 reactions
- Jul 4, 2022unable to provision regional managed proxy — GoogleCloudPlatform/k8s-config-connector0 reactions · 6 comments
Other versions13 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 13
- kortix-ai/suna★ 20ksame name
- cloudflare/cloudflare-docs★ 5.3ksame name
- crmne/ruby_llm★ 4.4ksame name
- Dpro-at/Tel-Agent★ 1.1ksame name
- butterbase-ai/butterbase-skills★ 533same name
- ZaxbyHub/opencode-swarm★ 485same name
- GoogleCloudPlatform/race-condition★ 234same name
- Dqz00116/skill-lib★ 22same name
- wcollins/skills-and-specs-lab★ 3same name
- Pradnyeshp/Claude-Skills★ 2same name
3 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository7 other files it gives its agents.
- AGENTS.mdAGENTS.md
- fabric-builderSkill
- fabric-importerSkill
- fast-prerequisitesSkill
- release-processSkill
- fast-setup-pocSkill
- tool-test-skillSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
31 rules. 0 are common, 17 are distinctive, and 14 are very specific to this project.
0
Common
Most of the 13 edited versions we read keep these.
17
Distinctive
This author's own choices. Worth a look.
14
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 12
If it is unclear which mode applies, ask the user before proceeding.
- Distinctive: line 51
Retrieve Issue Details: Use the GitHub CLI to view the issue context.
- Distinctive: line 60
Read Provider Documentation: If the issue involves Google Cloud resources, retrieve and read the documentation for the involved GCP …
- Distinctive: line 61
Start from the provider registry, e.g.
- Distinctive: line 63
Only rely on documentation for functionality available in a released provider version: docs from the provider's main branch may describe …
- Distinctive: line 79
Before writing code, present the proposed design for approval:
- Distinctive: line 88
Align with Fabric Zen: Ensure the design focuses on composition, encapsulates logical entities (like IAM and log sinks directly inside …
- Very specific: line 93
If you are not already on a feature branch, create one named after your username and the feature/fix (e.g., <username>/<feature-name>, such …
- Distinctive: line 98
If preparing an existing branch (Mode B), do NOT create a new one.
- Distinctive: line 104
Stable State Keys: Always use maps instead of lists for collection variables to avoid index shifts in Terraform state.
- Very specific: line 105
Scope Isolation: Use private locals (prefixed with _) for intermediate transformations, reserving module-level locals for values referenced …
- Very specific: line 106
Locals Separation for Complex Manipulations: When adding complex conditional strings, string interpolations, or transformations to resource …
- Very specific: line 107
Validate ENUM Variables: When adding or exposing variables that mirror ENUM values in the underlying Terraform provider, always include a …
- Very specific: line 133
Always keep variables in variables.tf and outputs in outputs.tf in strict alphabetical order.
- Very specific: line 149
Run Python tooling through uv run — the scripts in tools/ declare their dependencies inline, so no virtual environment setup is needed.
- Distinctive: line 156
Update Documentation: If you changed variables or outputs, check consistency and regenerate the README documentation tables:
- Very specific: line 171
Regenerate Test Inventories: If module-level tests (tftest.yaml) or README example inventories fail due to intentional plan output changes, …
- Distinctive: line 186
Check the diff against this checklist:
- Distinctive: line 201
When code modifications affect GCP resource structures or APIs, run a live E2E sandbox deployment test.
- Very specific: line 207
Create Sandbox Directory: Create a temporary sandbox folder under scratch/e2e_sandbox/ (the scratch/ directory is gitignored).
- Very specific: line 215
Run terraform init and terraform apply -auto-approve in the sandbox folder.
- Very specific: line 219
Verify the deployed state through the service's read API (e.g.
- Distinctive: line 224
Verify the change behaves as expected from the perspective of a consumer of the deployed infrastructure.
- Very specific: line 230
IAM conditional bindings: use Google Cloud's official IAM Policy Troubleshooter as the behavioral check (gcloud policy-troubleshoot iam) to …
- Distinctive: line 242
Delete the sandbox directory.
- Distinctive: line 243
If verification surfaced failures, fix the code and loop back to Step 3 before re-deploying.
- Very specific: line 256
Format the PR Title: Do NOT use Conventional Commits format (no feat: or fix: prefixes).
- Distinctive: line 261
CRITICAL PII SANITIZATION: Before writing the PR description, MUST scrub all developer PII (real GCP project IDs, numeric project numbers, …
- Very specific: line 271
Do NOT touch CHANGELOG.md: release notes are generated from PR labels and upgrade-note blocks by maintainers using tools/changelog.py.
- Very specific: line 276
CRITICAL PITFALL: Do NOT pass the body inline on the CLI if it contains backticks (e.g.
- Distinctive: line 277
Instead, write the body to a temporary file using your file-writing tool, then reference it:
“Common” is measured: kept by at least 6 in 10 of the 13 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Fabric Contribution Flow Skill
This skill defines the end-to-end workflow for contributing to Cloud Foundation Fabric. It supports two entry modes:
- Mode A: Issue Triage & Bug Fix: You are addressing an assigned or reported GitHub Issue. Start at Step 1.
- Mode B: Proactive Development & PR Prep: You are actively building a feature, refactoring code, or preparing an existing branch for a Pull Request. Jump directly to the Design Sign-off Gate before Step 2.
If it is unclear which mode applies, ask the user before proceeding.
Human-in-the-Loop Gates
Gate on steps that are hard to reverse, costly, or where your judgment is likely to diverge from a maintainer's. Keep mechanical, reversible steps (linting, tests, doc and inventory regeneration) autonomous. Gates are blocking: if you are running non-interactively and cannot get an answer, stop — never assume approval.
| Gate | When | What the human decides |
| Triage Disposition | End of Step 1 (Mode A) | Whether the issue is in scope and worth pursuing: proceed, reject, or escalate. |
| Design Sign-off | Before Step 2 | Approves the proposed design and scope. Mandatory for new features and interface changes; skippable for trivial fixes where the design is self-evident. |
| E2E Opt-in | Step 5 | Whether to run live cloud verification. Providing a sandbox project ID is the consent to deploy to it. |
| Behavioral Verification Opt-in | Step 5, after read-back verification | Whether to also verify runtime behavior of the deployed resources, given the described extra time and cost. |
| PR Approval | Step 6 | Reviews the final sanitized PR body before submission. |
Step-by-Step Workflow
graph TD
M1[Mode A: Issue Triage] --> A[1. Triage Issue]
A --> GT{Gate: Triage Disposition}
GT -->|Human approves| GD{Gate: Design Sign-off}
GT -->|Human rejects| X[Stop / Report Back]
M2[Mode B: Proactive Dev] --> GD
GD --> B[2. Develop Fix / Feature]
B --> C[3. Tests, Lint & Inventories]
C --> D[4. Pre-Submission Self-Review]
D -->|Issues found| B
D -->|Clean| GE{Gate: E2E Opt-in}
GE -->|Project ID provided| G[5. Live E2E Verification]
GE -->|Skipped| GS{Gate: PR Approval}
G -->|Failures| B
G -->|Verified| GS
GS --> F[6. Commit & Submit Sanitized PR]Step 1: Triage the Issue (Mode A Only)
- Retrieve Issue Details: Use the GitHub CLI to view the issue context.
gh issue view <issue-number> - Explore the Codebase: Identify the target module (
modules/<module-name>) or FAST stage (fast/stages/<stage-name>) that requires modification. - Evaluate Fit & Scope: Assess whether the issue is relevant for Fabric. Ensure it aligns with Fabric's core philosophy (modules should be lean, composable, and represent a single resource type context). Confirm the change has a sufficiently large scope and represents a generic, valuable addition to the module or FAST stage rather than a highly specific, one-off customization.
- Read Provider Documentation: If the issue involves Google Cloud resources, retrieve and read the documentation for the involved GCP resources or Terraform provider resource/datasource to ensure accurate implementation of its attributes, behaviors, and constraints.
- Start from the provider registry, e.g. https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_address.
- Check the pinned provider range: the repo pins the
googleprovider in default-versions.tf. If the feature you are implementing requires provider functionality released after the pinned minimum version, that is a good reason to bump the pin — do it across the board withuv run tools/versions.py --provider-min-version <x.y.z> --write-defaults, which rewritesdefault-versions.tfand propagates it to every module and stageversions.tf(linting enforces they stay in sync). Never edit version pins in individual modules only. - Only rely on documentation for functionality available in a released provider version: docs from the provider's
mainbranch may describe unreleased attributes that no released provider accepts at plan time.
[!WARNING] Do NOT rely solely on the proposed solution, examples, or partial specifications provided in the issue description. Always retrieve and review the complete documentation schema from the official provider registry.
Workaround for Registry Page JS/Redirection Errors: If the registry page fails to load properly with your URL-fetching tool (e.g. returns "Please enable Javascript" or truncates due to HTML formatting issues), find the source markdown file on GitHub and fetch its raw content using
curlto a scratch file (thescratch/directory is gitignored), using the tag of the provider release whose docs you need (e.g.v7.40.0):curl -s https://raw.githubusercontent.com/hashicorp/terraform-provider-google/v7.40.0/website/docs/r/workstations_workstation_config.html.markdown -o scratch/workstation_config_doc.mdYou can then search and view it locally to identify all supported arguments and blocks. Use this information to make an informed decision on which arguments to support. While 100% coverage is not always necessary or desirable, make a deliberate choice to include all arguments that are useful and align with Fabric's composability and simplicity goals, rather than missing them by omission.
- Gate — Triage Disposition: Present your assessment (target module/stage, fit with Fabric's philosophy, scope evaluation) and let the human decide whether to proceed. If the issue fails the fit test, report your reasoning and stop — do NOT comment on, label, or close the issue yourself; disposition of the issue is a maintainer decision.
Gate: Design Sign-off (Modes A & B)
Before writing code, present the proposed design for approval:
- The target module(s)/stage(s) and the shape of the variable interface (new/changed variables, whether
contextsupport is added). - For provider-surface changes: the explicit list of provider arguments you intend to include and exclude, with reasoning.
- Whether the change requires bumping the pinned provider version (a repo-wide change — see Step 1.4).
This gate is mandatory for new features and interface changes. For trivial fixes (typos, one-line bugfixes with an obvious solution) where the design is self-evident, state your intent and proceed without blocking.
Step 2: Develop the Fix or Feature (Modes A & B)
- Align with Fabric Zen: Ensure the design focuses on composition, encapsulates logical entities (like IAM and log sinks directly inside modules), adopts common interfaces, and keeps code flat and easy to evolve.
[!IMPORTANT] You MUST strictly follow the design principles and coding conventions defined in CONTRIBUTING.md and GEMINI.md when designing variables, modules, and factories.
- Set Up the Git Branch:
- If you are not already on a feature branch, create one named after your username and the feature/fix (e.g.,
<username>/<feature-name>, such asjohndoe/feature-name):git checkout master && git pull git checkout -b <username>/<feature-name> - If preparing an existing branch (Mode B), do NOT create a new one; instead make sure it is up to date with
master(rebase or merge) before submission. - Direct branches require push access to the repo (granted to regular contributors on request). Without it, use the fork-based flow described in CONTRIBUTING.md; the rest of this workflow is identical.
- If you are not already on a feature branch, create one named after your username and the feature/fix (e.g.,
- Apply Fabric/FAST Design Conventions:
- Context Interpolation: If context support is relevant and needed for the module (e.g., to support resolving symbolic references like
"$project_ids:myprj"), add acontextvariable block and implementctx/ctx_plocals inmain.tf. Do not add it blindly if the module does not benefit from symbolic interpolation. - Compact Variables: Leverage objects with
optional()attributes to keep user interfaces clean. Preferoptional()without an explicit default so the provider applies whatever default value it defines; only set a default when module logic needs a known value. - Stable State Keys: Always use maps instead of lists for collection variables to avoid index shifts in Terraform state.
- Scope Isolation: Use private locals (prefixed with
_) for intermediate transformations, reserving module-level locals for values referenced by resources. - Locals Separation for Complex Manipulations: When adding complex conditional strings, string interpolations, or transformations to resource attributes, compute the map in
localsso the resource block references a clean index likelocal.my_map[each.key]. This keeps resource blocks legible (<79 chars) and avoids cluttering resource definitions. - Validate ENUM Variables: When adding or exposing variables that mirror ENUM values in the underlying Terraform provider, always include a
validationblock to check for allowed values at plan time. Example frommodules/gcs:variable "storage_class" { description = "Bucket storage class." type = string default = "STANDARD" validation { condition = contains(["STANDARD", "MULTI_REGIONAL", "REGIONAL", "NEARLINE", "COLDLINE", "ARCHIVE"], var.storage_class) error_message = "Storage class must be one of STANDARD, MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE." } }
- Context Interpolation: If context support is relevant and needed for the module (e.g., to support resolving symbolic references like
- Reference Implementations & Knowledge Sources:
- compute-vm: Ideal reference for compact variable design, optional objects with defaults, and map variables.
- project: Best reference for logical entity encapsulation (IAM, log sinks, Shared VPC configurations), complex locals transformation, and context-based interpolation.
- adrs/: Architectural Decision Records documenting the rationale behind key design patterns (e.g. the IAM ADR explains the full
iam*interface). Before designing, build an index of all ADRs with their title and status:
Read in full any ADR whose title relates to the area you are changing. Weigh them by status: ignorefind adrs -name '*.md' ! -name 'README.md' | sort | while read -r f; do st=$(awk '/^## Status/ {getline; while ($0 == "") getline; print; exit}' "$f") printf '%s | %s | %s\n' "$f" "$(head -1 "$f" | sed 's/^# //')" "$st" doneRejectedones, treatDraft/Proposedas directional rather than settled, and remember that even implemented ADRs can lag behind the code — on conflict, the current code and golden-path modules are the source of truth.
- Maintain Code Consistency:
- Always keep variables in
variables.tfand outputs inoutputs.tfin strict alphabetical order. For larger modules, variables and outputs can be grouped logically into separate files (e.g.variables-logging.tf), each internally alphabetically sorted. - Limit line length to 79 characters (relaxed for long attribute names and descriptions).
- JSON Schema & Factory Alignment: When a change is made to a module that implements a factory (e.g.,
cloud-workstations) or is the base for one (e.g.,net-vpc-factoryto2-networking), the schemas MUST be updated (including their.schema.mddocumentation files), and the factory code should be updated to mirror the changed variable surface. Ensure you regenerate the schema documentation by running:uv run tools/schema_docs.py - Duplicated Files: Some files (e.g. schemas, factory test fixtures) are intentionally duplicated across modules and stages, and CI enforces that copies stay identical. When changing such a file, sync all its copies; the duplicate groups are listed in tools/duplicate-diff.py — update that list when adding new duplicated files.
- Always keep variables in
- Update or Add Tests:
- For modules: If the change introduces a new feature or configuration option, update an existing example in the module's
README.md(or add a new one) to demonstrate its usage. Ensure the example includes# tftestparameters and update the corresponding inventory YAML files undertests/modules/<module_name>/examples/. - For FAST stages: Update
tftest.yamlscenarios and tfvars/yaml inventories undertests/fast/....
[!NOTE] Module directories use hyphens (
modules/net-vpn-ha) while test directories generally use underscores (tests/modules/net_vpn_ha). Always check the actual test directory name — a mistyped path makespytestsilently collect zero tests. - For modules: If the change introduces a new feature or configuration option, update an existing example in the module's
Step 3: Run Tests, Linting & Inventory Regeneration (Modes A & B)
Run Python tooling through uv run — the scripts in tools/ declare their dependencies inline, so no virtual environment setup is needed. For faster Terraform testing, always set TF_PLUGIN_CACHE_DIR=/tmp/tfcache.
- Run Unified Linting: Execute
tools/lint.shto check copyright boilerplates, Terraform format (terraform fmt), alphabetical sorting, and schema validations:uv run --with-requirements tools/requirements.txt tools/lint.sh - Update Documentation: If you changed variables or outputs, check consistency and regenerate the README documentation tables:
uv run tools/check_documentation.py modules/<module-name> uv run tools/tfdoc.py --replace modules/<module-name> - Run Impacted Tests: Execute
pyteston the target module/stage (using the plugin cache directory for speed):mkdir -p /tmp/tfcache # tftest.yaml scenarios (note: underscores in the test directory name) TF_PLUGIN_CACHE_DIR=/tmp/tfcache uv run --with-requirements tests/requirements.txt pytest tests/modules/<module_name> # README example tests TF_PLUGIN_CACHE_DIR=/tmp/tfcache uv run --with-requirements tests/requirements.txt pytest -k 'modules and <module-name>:' tests/examples - Regenerate Test Inventories: If module-level tests (
tftest.yaml) or README example inventories fail due to intentional plan output changes, regenerate them usinggenerate_plan_summary.py:# For module-level tftest.yaml inventories: uv run tools/generate_plan_summary.py tests/modules/<module_name>/tftest.yaml <test-name> --save # For README.md example inventories: uv run tools/generate_plan_summary.py modules/<module-name>/README.md "<Example Heading>" --save[!CAUTION]
--saveoverwrites the assertion baseline, so a regenerated inventory makes the test pass by construction. After regenerating, diff the inventory against the previous version (git diff tests/), verify that every changed line maps to the intended feature or fix, and report the inventory diff to the user. If a changed line is not explained by your change, treat it as a bug in your code, not a baseline to save.
Step 4: Pre-Submission Self-Review (Modes A & B)
Review your own diff (git diff HEAD, or git diff master...HEAD for an existing branch) against the repository guidelines (GEMINI.md, CONTRIBUTING.md) before submission. This is a pre-flight self-check; the canonical automated review runs in CI after the PR is opened (Automated PR Review workflow) — do NOT imitate its output format or header.
Check the diff against this checklist:
- Naming conventions respected (variables, outputs, resources).
- Context support (
ctxvariables) present where the module warrants it. - IAM follows the standard
iam*interface patterns. - Examples with
# tftestparameters cover the new/changed behavior. - CRITICAL TESTING RULE: if resource blocks were modified (adding a new argument or modifying an existing one), the Terraform plan output changes — the corresponding test inventory YAML files (
tests/.../*.yaml) MUST be updated in the diff. If they are not, this is a critical testing failure. - JSON schemas and factory code consistent with the changed variable surface.
- Documentation tables regenerated (
tfdoc), alphabetical order preserved. - Breaking Changes: If any variable or YAML interface changed in a backwards-incompatible way, verify the PR description draft includes the
**Breaking Changes**/upgrade-noteblock.
Report the outcome as a short plain-text list of issues found (or "no issues found") under a Pre-submission self-review heading — no emojis, no status tables. Fix any issue and loop back to Step 3 until the checklist passes.
Step 5: Live Verification — E2E Sandbox & Policy Troubleshooter (Modes A & B — Optional / Recommended)
When code modifications affect GCP resource structures or APIs, run a live E2E sandbox deployment test. Run it only once the diff is stable (tests and self-review pass) to avoid repeated cloud deployments.
- Gate — E2E Opt-in: Ask the user for a GCP project ID (and if applicable, parent folder / billing account details) for E2E sandbox testing, stating explicitly that providing the project ID authorizes you to deploy and destroy resources in it with
-auto-approve. If no project is provided, skip this step entirely. - Verify Credentials: Confirm
gcloudauthentication and Application Default Credentials are available (gcloud auth list) before attempting any deployment, and surface a clear error rather than failing mid-apply. - Create Sandbox Directory: Create a temporary sandbox folder under
scratch/e2e_sandbox/(thescratch/directory is gitignored). - Generate Test Configuration:
- Generate a root Terraform module
main.tfin the sandbox directory. - CRITICAL: The
sourceargument of the module call MUST point to the local path of the modified module in the repository (e.g.source = "../../modules/<module-name>"), NOT the GitHub reference, to ensure your local changes are tested. - Set up necessary providers and variables.
- Generate a root Terraform module
- Deploy:
- Run
terraform initandterraform apply -auto-approvein the sandbox folder. - Confirm that all resources are created successfully. A clean apply is the baseline, not the goal: it only proves the API accepted the request, not that the change behaves as intended.
- Run
- Read-Back Verification (required):
- Verify the deployed state through the service's read API (e.g.
gcloud compute backend-services describe, or the equivalentGET/describesurface for the resource), not just the Terraform state or plan output. - For every field or block touched by the change, confirm the live resource contains the intended value and structure (e.g. one API list entry per input element, correct nesting, no silently dropped attributes).
- Verify the deployed state through the service's read API (e.g.
- Behavioral Verification (optional — Gate):
- Gate — Behavioral Verification Opt-in: after read-back verification passes, explicitly ask the user whether to also verify runtime behavior, describing what the check would entail for this specific change (resources involved, expected extra time such as propagation delays, any additional cost). Proceed only on explicit approval; skipping is a valid outcome and must be recorded in the PR body.
- Verify the change behaves as expected from the perspective of a consumer of the deployed infrastructure. Examples:
- Compute instances: connect to the instance (SSH/serial) and check it is reachable and its startup configuration behaves as expected.
- Networking, load balancers, DNS: send traffic through the deployed path and verify routing, reachability, and response attributes (e.g.
curlthrough a load balancer and inspect status and headers, resolve records, test connectivity across peerings or VPN tunnels). - Serverless and workloads (Cloud Run, Cloud Functions, GKE): invoke the deployed service and verify the response.
- Data services (GCS, BigQuery, Pub/Sub): perform a representative read/write operation (upload an object, run a query, publish and pull a message).
- Account for propagation delays (load balancers, CDN, IAM can take several minutes); retry before concluding failure.
- IAM conditional bindings: use Google Cloud's official IAM Policy Troubleshooter as the behavioral check (
gcloud policy-troubleshoot iam) to verify runtime evaluation against live target resources. - CRITICAL: GCP IAM runtime evaluates
resource.nameusing numeric Project Numbers. Always test conditions against--resource-namewith the numeric Project Number:gcloud policy-troubleshoot iam //logging.googleapis.com/projects/<PROJECT_NUMBER>/locations/global/buckets/<BUCKET> \ --permission=logging.buckets.write \ --principal-email=<TEST_PRINCIPAL_EMAIL> \ --resource-name=projects/<PROJECT_NUMBER>/locations/global/buckets/<BUCKET> \ --format="json(access,explainedPolicies[].bindingExplanations)"
- Destroy Resources:
- Once verified, run
terraform destroy -auto-approveto tear down all created resources and avoid ongoing cloud costs. - Delete the sandbox directory.
- If verification surfaced failures, fix the code and loop back to Step 3 before re-deploying.
- Once verified, run
Step 6: Commit & Submit the PR (Modes A & B)
- Sanitize Before Committing: PII sanitization applies to everything that leaves your machine — commits, file contents, and the PR body. Never commit files containing real GCP project IDs, numeric project numbers, personal email addresses, or custom resource names from live testing; verify
git statusshows no stray sandbox or scratch files before staging. - Commit and Push: Stage the relevant files, commit with a short imperative message describing the change, make sure the branch is up to date with
master(rebase if needed), and push:git add <files> git commit -m "Add <feature> to modules/<module-name>" git push -u origin <username>/<feature-name> - Format the PR Title: Do NOT use Conventional Commits format (no
feat:orfix:prefixes). Use a short, capitalized, imperative title (e.g., "Add native tag bindings support tomodules/net-firewall-policy"). - Write the PR Body:
- Explain the problem, rationale, and the fix clearly.
- Document Verification & E2E Testing Methodology: Detail local unit tests and, for E2E runs, the apply, read-back, and behavioral verification results (or note that behavioral verification was skipped) so reviewers can see the exact testing rationale and methodology.
- CRITICAL PII SANITIZATION: Before writing the PR description, MUST scrub all developer PII (real GCP project IDs, numeric project numbers, personal email addresses, usernames, and custom bucket/resource names) and replace them with generic placeholders (e.g.,
my-project,123456789012,user:tester@example.com,test-bucket). - Breaking Changes & Upgrade Notes: Whenever a change requires users to upgrade their variable or YAML surface (e.g. variable type changes, deleted attributes, changed schema structures), you MUST append a
**Breaking Changes**section with anupgrade-notecode fence at the bottom of the PR description. This is automatically parsed bytools/changelog.pywhen generating release notes. Format:**Breaking Changes** ```upgrade-note `modules/organization`: `custom_roles` variable type changed from `map(list(string))` to `map(object({...}))`. Existing code passing permission lists directly must be updated to pass `{ permissions = [...] }`. ``` - Do NOT touch
CHANGELOG.md: release notes are generated from PR labels andupgrade-noteblocks by maintainers usingtools/changelog.py.
- Gate — PR Approval: Present the final sanitized PR title and body to the user and get explicit approval before creating the PR.
- Create the PR:
- CRITICAL PITFALL: Do NOT pass the body inline on the CLI if it contains backticks (e.g.
gh pr create --body "Fixesbug") as the shell will evaluate backticks, corrupting the description. Do NOT use shell redirection or heredocs to create the body file either (seeGEMINI.md). - Instead, write the body to a temporary file using your file-writing tool, then reference it:
gh pr create --title "Your PR Title" --body-file /tmp/pr-body.md
- CRITICAL PITFALL: Do NOT pass the body inline on the CLI if it contains backticks (e.g.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

