Skip to content

Commit 3e6cf86

Browse files
committed
ai: update skills, chores
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
1 parent cd8790b commit 3e6cf86

3 files changed

Lines changed: 25 additions & 1 deletion

File tree

.agents/greenfield-direct-new-resource-types.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ To ensure stability and reproducibility, this task is pinned to the following re
7676
2. **Implement Identity**: Use skill `.gemini/skills/kcc-direct-identity-implementer/SKILL.md` with:
7777
- resource_kind: <Kind>
7878
- template: <GCP_URL_Template> (e.g. projects/{project}/locations/{location}/<plural>/{<resource>})
79+
- **Crucial**: Ensure you also create the corresponding `_identity_test.go` file.
7980
8081
3. **Run local validations**:
8182
- run `scripts/validate-prereqs.sh`, if the script fails the output will contain agent hints for fixing the errors.

.gemini/skills/kcc-direct-greenfield-types-implementer/SKILL.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,24 @@ Apply the baseline validations from `kcc-direct-base-types-implementer`, plus th
4141
- **Enums**:
4242
- Use `*string` for the Go type of proto enum fields (do NOT use custom wrapped string types).
4343
- 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`).
4462

4563
### 4. Journaling
4664
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.

.gemini/skills/kcc-direct-identity-implementer/SKILL.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@ This skill guides the implementation of the IdentityV2 and ExternalIdentifier in
2121
- Implement `ExternalIdentifier()`.
2222
- Implement `ParentString() string` to return the GCP parent URI (e.g., `projects/{project}` or `projects/{project}/locations/{location}`).
2323

24-
2. **Parent & Hierarchy Support**:
24+
2. **Implement Identity Tests**:
25+
Create `apis/<service>/<api_version>/<resource_lower>_identity_test.go`.
26+
- 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**:
2530
- Ensure the `Spec` struct has a `ProjectRef` (and `Location` if applicable).
2631
- **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.
2732

0 commit comments

Comments
 (0)