kcc-identity-reference

Generate KCC identity and reference files implementing IdentityV2 and refs.Ref.

1.1k|367|Updated Apr 8, 2019
One-click install
npx skills add https://github.com/GoogleCloudPlatform/k8s-config-connector --skill kcc-identity-reference
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kcc-identity-reference
Source: https://github.com/GoogleCloudPlatform/k8s-config-connector/tree/main/.gemini/skills/kcc-identity-reference
Command: npx skills add https://github.com/GoogleCloudPlatform/k8s-config-connector --skill kcc-identity-reference

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill solves the problem of KCC resource identity and external reference code drifting from the canonical gcpurls.Template pattern, which can break normalization and downstream identity/ref resolution.

Core Features & Use Cases

  • Creates or updates KCC identity implementations: Generates or refreshes the resource’s <kind>_identity.go to implement identity.IdentityV2 using the canonical gcpurls.Template.
  • Creates or updates KCC reference implementations: Generates or refreshes the resource’s <kind>_reference.go to implement refs.Ref, including GVK registration and external parsing.
  • Ensures correct URL formatting and field mapping: Uses docs/ai/metadata/cloudassetinventory_names.jsonl (or existing implementations) to derive exact GCP URL segments and enforce struct-field/template-variable alignment.
  • Handles normalization inputs safely: Ensures getIdentityFrom<Kind>Spec can handle both typed objects and *unstructured.Unstructured during Normalize.

Quick Start

Ask the AI to update the identity and reference for MemoryStoreInstance so the _identity.go and _reference.go files match the canonical gcpurls.Template and implement IdentityV2 and refs.Ref.

Frequently Asked Questions about kcc-identity-reference

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement IdentityV2 for Config Connector resources?

To implement IdentityV2 for Config Connector resources, you generate or update the resource's `_identity.go` file to conform to the canonical `gcpurls.Template` pattern. This ensures proper identity normalization and downstream resolution across multiple API groups and versions.

Why does KCC reference parsing break for unstructured inputs?

KCC reference parsing breaks for unstructured inputs when `getIdentityFrom<Kind>Spec` cannot handle `*unstructured.Unstructured` objects during Normalize. You must update the implementation to safely process both typed objects and unstructured inputs without causing panics.

How do I map GCP URL template variables to KCC struct fields?

You map GCP URL template variables to KCC struct fields by deriving the exact URL segments from `cloudassetinventory_names.jsonl` or existing implementations. This enforces struct-field and template-variable alignment to prevent underscore mismatches during identity resolution.

What's the best way to generate KCC reference boilerplate for external parsing?

The best way to generate KCC reference boilerplate is to update the resource's `_reference.go` file to implement `refs.Ref`, including GVK registration and external parsing. This maintains canonical reference parsing and prevents code from drifting away from the `gcpurls.Template` pattern.

Does KCC identity normalization require go vet and go build validation?

Yes, KCC identity normalization requires validating compilation via `go vet` and `go build` after updating the identity and reference files. This validation ensures the generated IdentityV2 and refs.Ref implementations compile correctly without structural errors.