You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .gemini/skills/kcc-direct-greenfield-types-implementer/SKILL.md
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,6 +41,24 @@ Apply the baseline validations from `kcc-direct-base-types-implementer`, plus th
41
41
-**Enums**:
42
42
- Use `*string` for the Go type of proto enum fields (do NOT use custom wrapped string types).
43
43
- Use `// +kubebuilder:validation:Enum=VALUE1;VALUE2` to provide validation in the CRD while keeping the Go type simple.
44
+
-**Naming Conventions & Acronyms**:
45
+
- Structs in `*_types.go` must be strictly CamelCased (no snake_case allowed).
46
+
- Ensure GCP acronyms are capitalized correctly in resource and field names (e.g., `APIHub`, `SIP`, `JSON`, `PDF`, `DER`, `CEL`).
47
+
-**No Exceptions**: Do **NOT** add new exceptions to `tests/apichecks/testdata/exceptions/acronyms.txt`. Fix the Go field names instead.
48
+
-**Pointers**: Validate that optional or nullable fields (like `Location`, booleans, integers) are correctly typed as pointers (e.g., `*string`, `*bool`) rather than raw values.
49
+
-**ETag Exclusion**: Remove `etag` fields from the KRM spec; they are generally disallowed. Do **NOT** add exceptions to `spec_dislike_etag.txt`.
50
+
-**KCC References (`missingrefs.txt`)**:
51
+
- Ensure fields representing GCP resources are implemented using the KCC Ref pattern (e.g., `ProjectRef`, `NetworkRef`) rather than plain strings.
52
+
-**No Exceptions**: Do **NOT** add exceptions to `tests/apichecks/testdata/exceptions/missingrefs.txt`. Fix the underlying field types instead.
53
+
- Reuse existing refs from `apis/refs/v1beta1/` (e.g., `Compute`, `BigQueryDataset`). If creating a new ref, put it in a service-specific file (e.g., `apis/dlp/v1alpha1/dlprefs.go`).
54
+
-**Avoiding Scope Creep**:
55
+
- Do **NOT** modify anything under `apis/<service>/v1beta1/` (especially `generate.sh` scripts) when implementing a `v1alpha1` resource.
56
+
- Do **NOT** add CI presubmits/workflows (e.g., `.github/workflows/ci-presubmit.yaml`).
57
+
- Do **NOT** include the controller implementation (`pkg/controller/direct/...`).
58
+
-**Package Collisions & Generation**:
59
+
- Instead of copying raw protos into `mockgcp/`, use the `generate.sh` script with the specific upstream SHA to fetch the protos.
60
+
- Ensure `docs/reports/crd_report.md` and `.csv` are correctly updated and committed after running `make generate`.
61
+
- If validations fail, ensure Go clients are regenerated (`./scripts/generate-go-crd-clients/generate-clients.sh`).
44
62
45
63
### 4. Journaling
46
64
Append any quirks about the proto-to-struct mapping (e.g., field name collisions) to `.gemini/journals/<service>.md` using the format described in the `kcc-agentic-journaler` skill.
- Ensure every `<resource_lower>_identity.go` file has a corresponding test file.
27
+
- The test file should verify that `FromExternal()` can parse valid external identities and `String()` can generate correct external identities.
28
+
29
+
3.**Parent & Hierarchy Support**:
25
30
- Ensure the `Spec` struct has a `ProjectRef` (and `Location` if applicable).
26
31
-**Hierarchical Branching**: If the GCP resource supports multiple hierarchies (e.g., Global and Regional), implement logic in `String()` and `FromExternal()` to handle both. Use the presence of the `location` field in the Spec to determine which pattern to use.
0 commit comments