Skip to content

docs, feat(SREP-4460, SREP-4926: Add Standardized Claude hooks, skill, agents. Update standardised docs)#329

Open
devppratik wants to merge 1 commit into
openshift:masterfrom
devppratik:add-claude-and-docs
Open

docs, feat(SREP-4460, SREP-4926: Add Standardized Claude hooks, skill, agents. Update standardised docs)#329
devppratik wants to merge 1 commit into
openshift:masterfrom
devppratik:add-claude-and-docs

Conversation

@devppratik
Copy link
Copy Markdown
Contributor

@devppratik devppratik commented May 29, 2026

What type of PR is this?

docs/feature

What this PR does / why we need it?

  • This PR brings the docs up to Agentic SDLC contribution standard
  • It also adds .claude which includes standardized hooks, skills and agents

References

Summary by CodeRabbit

  • Documentation
    • Added comprehensive agent, skill, hook, developer, testing, and contributing guides that document automated workflows, validation patterns, and reporting/output formats.
  • Chores
    • Strengthened pre-commit/CI validation and hook behavior, added secret-scanning rules and safety policies, expanded command permission controls, and included helper scripts and CI-focused configs to improve local/CI parity and developer safety.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label May 29, 2026
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented May 29, 2026

@devppratik: This pull request references SREP-4460 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

This pull request references SREP-4926 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "5.0.0" version, but no target version was set.

Details

In response to this:

What type of PR is this?

docs/feature

What this PR does / why we need it?

  • This PR brings the docs up to Agentic SDLC contribution standard
  • It also adds .claude which includes standardized hooks, skills and agents

References

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci Bot requested review from AlexSmithGH and joshbranham May 29, 2026 08:15
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 2026

Warning

Review limit reached

@devppratik, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 9 minutes and 23 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 6c1d092a-f5cb-4c29-bea6-8879335b2f2f

📥 Commits

Reviewing files that changed from the base of the PR and between baf3bc1 and fa70215.

📒 Files selected for processing (21)
  • .claude/agents/README.md
  • .claude/agents/ci-agent.md
  • .claude/agents/docs-agent.md
  • .claude/agents/lint-agent.md
  • .claude/agents/security-agent.md
  • .claude/agents/test-agent.md
  • .claude/hooks/README.md
  • .claude/hooks/cleanup.sh
  • .claude/hooks/pre-edit.sh
  • .claude/hooks/stop-prek-validation.sh
  • .claude/settings.json
  • .claude/skills/README.md
  • .claude/skills/prow-ci/SKILL.md
  • .gitleaks.toml
  • .prek-version
  • CONTRIBUTING.md
  • DEVELOPMENT.md
  • TESTING.md
  • hack/ci.sh
  • hack/prek.ci.toml
  • prek.toml

Walkthrough

Adds Claude agents/skills documentation, Prek hook configs and scripts (pre-edit/stop/cleanup), gitleaks config and Prek pin, expanded Claude settings, CI entry updates, and developer guides (CONTRIBUTING/DEVELOPMENT/TESTING).

Changes

Claude AI Framework and Developer Tooling

Layer / File(s) Summary
Claude Agents Framework and Agent Definitions
.claude/agents/README.md, .claude/agents/{ci,docs,lint,security,test}-agent.md
Introduces the agent architecture, reporting format, extension guide, and five agent playbooks: lint-agent, test-agent, security-agent, docs-agent, and ci-agent.
Prek hooks, scripts, and hook docs
.claude/hooks/README.md, .claude/hooks/{cleanup.sh,pre-edit.sh}, .claude/hooks/stop-prek-validation.sh
Adds hook documentation, a no-op cleanup script, a pre-edit blocker/warning script for generated/high-risk files, and an updated stop-hook that checks for jq, respects CLAUDE_LINT_ON_STOP, and runs Prek with the CI config.
Pre-commit / CI configs and secret scanning
prek.toml, hack/prek.ci.toml, hack/ci.sh, .prek-version, .gitleaks.toml
Updates prek.toml to add hygiene hooks and external repos (rh-pre-commit, gitleaks, golangci-lint), adds a CI-focused hack/prek.ci.toml, updates hack/ci.sh to use the CI config and checks for prek, pins Prek to v0.4.1, and adds .gitleaks.toml with custom rules.
Claude settings and skills
.claude/settings.json, .claude/skills/README.md, .claude/skills/prow-ci/SKILL.md
Expands Claude command permissions (allow/ask/deny) and introduces Skills docs including a prow-ci skill for querying Prow/Tekton CI results.
Developer documentation
CONTRIBUTING.md, DEVELOPMENT.md, TESTING.md
Rewrites CONTRIBUTING.md into a streamlined checklist and adds DEVELOPMENT.md and TESTING.md with prerequisites, common commands, testing workflows, and troubleshooting guidance.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 14 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Test Structure And Quality ⚠️ Warning Test files lack meaningful assertion messages (e.g., no context in Expect(err) calls), have no timeouts on cluster operations despite using envtest, and some tests assert multiple unrelated behaviors. Add assertion messages like Expect(err).NotTo(HaveOccurred(), "failed to create resource"), use Eventually/Consistently with timeouts for operations accessing k8s, split multi-behavior tests into single-responsibility tests.
✅ Passed checks (14 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title references multiple JIRA issues and mentions the main changes (standardized Claude hooks, skills, agents, docs updates), but is somewhat verbose with JIRA ticket references and uses a structure that could be clearer.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed This PR adds only documentation and configuration files with no new Ginkgo test files. The check for stable test names is not applicable.
Microshift Test Compatibility ✅ Passed PR adds no new Ginkgo e2e tests—only documentation, configuration, and shell scripts. The check is not applicable to non-test files.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No new Ginkgo e2e tests are added in this PR. The PR contains documentation, configuration, and script files only. TESTING.md documents how to write tests but adds no test implementations.
Topology-Aware Scheduling Compatibility ✅ Passed Deployment manifest added with replicas: 1 and no problematic scheduling constraints (no affinity, topology spread, nodeSelector). Single replica is topology-compatible.
Ote Binary Stdout Contract ✅ Passed PR contains no Go code or OTE binaries; changes are documentation, config, and utility shell scripts. OTE Binary Stdout Contract check applies only to Go test binaries, which are absent here.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed 11 new unit tests added use Ginkgo with mocks and envtest only. No hardcoded IPv4 addresses, IPv4-specific parsing, external connectivity, or e2e tests found.
No-Weak-Crypto ✅ Passed PR adds documentation and configuration only; no weak crypto (MD5, SHA1, DES, RC4, 3DES, Blowfish, ECB), custom implementations, or unsafe secret comparisons detected.
Container-Privileges ✅ Passed No K8s manifests or container specifications present in PR. Changes are documentation, configuration, and bash scripts only.
No-Sensitive-Data-In-Logs ✅ Passed No sensitive data exposed in logs. Security code examples marked FORBIDDEN are educational anti-patterns. Tool outputs contain only validation errors and file references, not secrets.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.34%. Comparing base (d2110f5) to head (fa70215).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #329   +/-   ##
=======================================
  Coverage   58.34%   58.34%           
=======================================
  Files          26       26           
  Lines        1942     1942           
=======================================
  Hits         1133     1133           
  Misses        731      731           
  Partials       78       78           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 14

🧹 Nitpick comments (1)
.claude/agents/ci-agent.md (1)

149-150: ⚡ Quick win

Replace placeholder version diff with a real CI source comparison.

This compares pre-commit revisions against a static placeholder, so it can’t detect drift. Point the right-hand side to the actual CI source (or remove this check to avoid false confidence).

Suggested fix
-# Compare pre-commit and CI tools
-diff <(grep "rev:" .pre-commit-config.yaml) <(echo "# CI versions from boilerplate")
+# Compare pre-commit tool revisions with boilerplate-pinned revisions (example path)
+# Adjust the CI file path to the actual mirrored pipeline definition in this repo.
+diff \
+  <(grep "rev:" .pre-commit-config.yaml | sort) \
+  <(grep -E "golangci-lint|gitleaks|rev:" .tekton/*.yaml | sort)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/agents/ci-agent.md around lines 149 - 150, The current diff compares
"rev:" from .pre-commit-config.yaml to a static placeholder via diff <(grep
"rev:" .pre-commit-config.yaml) <(echo "# CI versions from boilerplate"); update
this to compare against the real CI source or remove the check: replace the
right-hand process substitution (echo "# CI versions from boilerplate") with a
command that outputs the actual CI versions (e.g., cat or grep on the real CI
config file) so the diff detects drift, or delete the comparison step entirely
if you don't want this validation; ensure you update the command invoked in the
script that runs this diff so it references the actual CI file instead of the
placeholder.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.claude/agents/docs-agent.md:
- Around line 179-180: The current pipeline that starts with "grep '```bash'
*.md | grep 'make '" wrongly filters to fence markers and never captures actual
make commands; replace that pipeline (the line containing the grep of fenced
bash blocks) with a command that recursively searches Markdown files for literal
"make <target>" occurrences, extracts the second token (the target name) and
then sorts unique results — i.e., use a recursive/whole-match grep (restricting
to *.md), then pull the second field (awk or cut) and pipe to sort -u so make
targets are correctly extracted.
- Line 188: The fenced output block currently ends with a plain triple-backtick
and lacks a language tag; update the fenced block in
.claude/agents/docs-agent.md (the Markdown fenced output block containing the
changelog snippet) to include a language identifier such as "text" or "diff"
(e.g., change ``` to ```text) so the block declares its language for markdown
lint compliance and consistent rendering.

In @.claude/agents/lint-agent.md:
- Around line 23-24: Replace the invalid `go fmt -l .` invocations with `gofmt
-l .` in the markdown (specifically change the lines that read "Run `go fmt -l
.`" to "Run `gofmt -l .`") and update the repeated instance later in the file
(the same "Run `go fmt -l .`" occurrence around the second block) so both
occurrences use `gofmt -l .`; leave the `go fmt ./...` auto-fix line unchanged.

In @.claude/agents/test-agent.md:
- Around line 31-39: The script currently pipes CHANGED_FILES into xargs to
compute PACKAGES and will misbehave or error when CHANGED_FILES is empty; add an
early guard after computing CHANGED_FILES (and before using xargs dirname) to
check if CHANGED_FILES is empty and exit successfully (or skip tests) to avoid
calling xargs with no input; update the block that sets PACKAGES and the
subsequent for pkg loop to be skipped when CHANGED_FILES is empty so the go test
invocation only runs when there are changed .go files.

In @.claude/hooks/README.md:
- Around line 182-183: Update the README doc text to match the actual stop hook
implementation: replace the stated command `prek run --all-files` with the real
invocation used in .claude/hooks/stop-prek-validation.sh (`prek run --config
hack/prek.ci.toml`) and describe that the script runs the command conditionally
(only when relevant files are present/when the environment detects CI),
mirroring the script's behavior rather than the old blanket `--all-files`
description.
- Line 3: The README line currently reads "OCM Agent Operator" but should use
this repository's actual project name ("GCP Project Operator"); update the text
on that line in .claude/hooks/README.md to replace "OCM Agent Operator" with the
correct project name so wording is consistent across docs and contributors
aren't confused.

In @.claude/hooks/stop-prek-validation.sh:
- Around line 69-72: The current PREK invocation in
.claude/hooks/stop-prek-validation.sh stores output in PREK_OUTPUT and exit code
in PREK_EXIT but calls `prek run --config hack/prek.ci.toml` which only checks
the default (staged) scope and thus misses unstaged/untracked edits; update the
PREK command to include all working-tree files (e.g., add prek's --all-files
flag) or build an explicit file list from git (git status/ls-files + untracked)
and pass those paths to prek so unstaged/untracked changes are validated, and
keep using PREK_OUTPUT and PREK_EXIT for reporting/exit behavior.

In @.claude/settings.json:
- Around line 37-39: Replace the overly specific deny entries "Bash(git commit
--no-verify)", "Bash(git push --force origin master)" and "Bash(git push --force
origin main)" with broader wildcard-deny patterns to prevent bypassing via
argument order or alternate refs; update the deny rules to match any git command
using --no-verify (e.g., use a pattern like Bash(git * --no-verify *)) and any
force-push invocation (e.g., Bash(git * push * --force *)) so that
functions/matches around those entries will catch all variations instead of only
the exact strings.

In @.claude/skills/README.md:
- Around line 66-72: The README directory-structure code fence is missing a
language tag which triggers MD040; edit the fenced block in
.claude/skills/README.md (the directory-structure block that starts with ``` )
and change it to declare a language such as text (i.e., use ```text) so the
block becomes a labeled text code block while keeping the same contents.
- Line 3: Update the README intro that currently reads "Reusable workflow skills
for OCM Agent Operator development." to reference the correct repository name;
replace "OCM Agent Operator" with "gcp-project-operator" (or an appropriate
description for gcp-project-operator) so the opening line accurately describes
this repo; modify the string in .claude/skills/README.md (the intro sentence
containing "OCM Agent Operator") accordingly.

In @.gitleaks.toml:
- Around line 25-32: The global allowlist in .gitleaks.toml currently contains
the broad pattern '.*_test\.go' inside the paths = [...] array which causes all
Go test files to be skipped; remove that pattern from the paths array and keep
only the intended specific exclusions (for example the existing
'''test/fixtures/.*''', '''test/deploy/.*''', '''boilerplate/.*''',
'''vendor/.*''', '''zz_generated\..*\.go''') so gitleaks will scan *_test.go
files; update the paths array in .gitleaks.toml accordingly and run a quick
gitleaks scan to verify tests are no longer globally excluded.

In `@CONTRIBUTING.md`:
- Around line 1-3: Update the heading and intro to use the canonical product
name and remove the duplicated word: change the heading text "# Contributing to
Gcp Project" to "# Contributing to GCP Project Operator" and edit the intro line
"Thank you for your interest in contributing to the Gcp Project project." to
"Thank you for your interest in contributing to GCP Project Operator." Ensure
both occurrences use the exact same capitalization and phrasing "GCP Project
Operator".

In `@hack/ci.sh`:
- Line 9: The prek invocation uses a relative path "hack/prek.ci.toml" which
breaks when the script is run from a non-root working directory; change the
script to resolve the config file path relative to the script location (e.g.,
compute the script directory/REPO_ROOT and construct an absolute path to
hack/prek.ci.toml) and use that absolute path in the "prek run --config ...
--all-files" call so config resolution is independent of the caller's cwd.

In `@TESTING.md`:
- Around line 266-275: The TESTING.md section is contradictory about whether the
pre-commit hook id "go-test" (entry: make go-test) runs automatically; either
remove the YAML snippet and clearly state that "go-test" is not enabled and
contributors must run "make go-test" manually, or add the hook to the
repository's pre-commit configuration and update the text to say it runs
automatically; update the lines that mention the pre-commit behavior and the
"go-test" id and the "make go-test" command so they consistently reflect the
single correct workflow.

---

Nitpick comments:
In @.claude/agents/ci-agent.md:
- Around line 149-150: The current diff compares "rev:" from
.pre-commit-config.yaml to a static placeholder via diff <(grep "rev:"
.pre-commit-config.yaml) <(echo "# CI versions from boilerplate"); update this
to compare against the real CI source or remove the check: replace the
right-hand process substitution (echo "# CI versions from boilerplate") with a
command that outputs the actual CI versions (e.g., cat or grep on the real CI
config file) so the diff detects drift, or delete the comparison step entirely
if you don't want this validation; ensure you update the command invoked in the
script that runs this diff so it references the actual CI file instead of the
placeholder.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: ee0c90e8-a1b5-4e59-a528-811ac93235ed

📥 Commits

Reviewing files that changed from the base of the PR and between d2110f5 and cba58f6.

📒 Files selected for processing (21)
  • .claude/agents/README.md
  • .claude/agents/ci-agent.md
  • .claude/agents/docs-agent.md
  • .claude/agents/lint-agent.md
  • .claude/agents/security-agent.md
  • .claude/agents/test-agent.md
  • .claude/hooks/README.md
  • .claude/hooks/cleanup.sh
  • .claude/hooks/pre-edit.sh
  • .claude/hooks/stop-prek-validation.sh
  • .claude/settings.json
  • .claude/skills/README.md
  • .claude/skills/prow-ci/SKILL.md
  • .gitleaks.toml
  • .prek-version
  • CONTRIBUTING.md
  • DEVELOPMENT.md
  • TESTING.md
  • hack/ci.sh
  • hack/prek.ci.toml
  • prek.toml

Comment on lines +179 to +180
grep '```bash' *.md | grep 'make ' | sed 's/.*make \([a-z-]*\).*/\1/' | sort -u

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix target extraction command; current pipeline cannot capture make commands.

At Line 179, grep '```bash' *.md filters to fence lines, so downstream extraction of make targets won’t work.

Suggested fix
-grep '```bash' *.md | grep 'make ' | sed 's/.*make \([a-z-]*\).*/\1/' | sort -u
+grep -RhoE 'make [a-zA-Z0-9_.-]+' --include="*.md" . | awk '{print $2}' | sort -u
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/agents/docs-agent.md around lines 179 - 180, The current pipeline
that starts with "grep '```bash' *.md | grep 'make '" wrongly filters to fence
markers and never captures actual make commands; replace that pipeline (the line
containing the grep of fenced bash blocks) with a command that recursively
searches Markdown files for literal "make <target>" occurrences, extracts the
second token (the target name) and then sorts unique results — i.e., use a
recursive/whole-match grep (restricting to *.md), then pull the second field
(awk or cut) and pipe to sort -u so make targets are correctly extracted.

## Output Format

When updating docs, report:
```
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add a language tag to the fenced output block.

The fenced block at Line 188 should declare a language for markdown lint compliance and consistency.

Suggested fix
-```
+```text
 Updated: DEVELOPMENT.md
 - Added section on new make target: go-bench
 ...
</details>

<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

```suggestion

🧰 Tools
🪛 markdownlint-cli2 (0.22.1)

[warning] 188-188: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/agents/docs-agent.md at line 188, The fenced output block currently
ends with a plain triple-backtick and lacks a language tag; update the fenced
block in .claude/agents/docs-agent.md (the Markdown fenced output block
containing the changelog snippet) to include a language identifier such as
"text" or "diff" (e.g., change ``` to ```text) so the block declares its
language for markdown lint compliance and consistent rendering.

Comment on lines +23 to +24
2. Run `go fmt -l .` to detect formatting issues
3. Auto-fix formatting: `go fmt ./...`
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify supported flags and command semantics for go fmt/gofmt.
set -euo pipefail

go help fmt | sed -n '1,140p'
echo "----"
gofmt -h | sed -n '1,120p'

Repository: openshift/gcp-project-operator

Length of output: 1058


Fix formatting-check command in .claude/agents/lint-agent.md

go fmt -l . is not a valid go fmt invocation (go fmt accepts only [-n] [-x] [packages]; -l is a gofmt flag). Replace it with gofmt -l . (and apply the same change to the repeated instance at lines 55-59).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/agents/lint-agent.md around lines 23 - 24, Replace the invalid `go
fmt -l .` invocations with `gofmt -l .` in the markdown (specifically change the
lines that read "Run `go fmt -l .`" to "Run `gofmt -l .`") and update the
repeated instance later in the file (the same "Run `go fmt -l .`" occurrence
around the second block) so both occurrences use `gofmt -l .`; leave the `go fmt
./...` auto-fix line unchanged.

Comment on lines +31 to +39
CHANGED_FILES=$(git diff --name-only HEAD | grep "\.go$")

# Extract packages
PACKAGES=$(echo "$CHANGED_FILES" | xargs -n1 dirname | sort -u | tr '\n' ' ')

# Run targeted tests
for pkg in $PACKAGES; do
go test -v ./$pkg/...
done
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Guard empty changed-file sets before xargs dirname.

If no Go files changed, the current snippet can error or run unnecessarily. Add an early exit.

Suggested fix
 CHANGED_FILES=$(git diff --name-only HEAD | grep "\.go$")
+if [ -z "$CHANGED_FILES" ]; then
+  echo "No changed Go files."
+  exit 0
+fi
 
 # Extract packages
 PACKAGES=$(echo "$CHANGED_FILES" | xargs -n1 dirname | sort -u | tr '\n' ' ')
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
CHANGED_FILES=$(git diff --name-only HEAD | grep "\.go$")
# Extract packages
PACKAGES=$(echo "$CHANGED_FILES" | xargs -n1 dirname | sort -u | tr '\n' ' ')
# Run targeted tests
for pkg in $PACKAGES; do
go test -v ./$pkg/...
done
CHANGED_FILES=$(git diff --name-only HEAD | grep "\.go$")
if [ -z "$CHANGED_FILES" ]; then
echo "No changed Go files."
exit 0
fi
# Extract packages
PACKAGES=$(echo "$CHANGED_FILES" | xargs -n1 dirname | sort -u | tr '\n' ' ')
# Run targeted tests
for pkg in $PACKAGES; do
go test -v ./$pkg/...
done
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/agents/test-agent.md around lines 31 - 39, The script currently
pipes CHANGED_FILES into xargs to compute PACKAGES and will misbehave or error
when CHANGED_FILES is empty; add an early guard after computing CHANGED_FILES
(and before using xargs dirname) to check if CHANGED_FILES is empty and exit
successfully (or skip tests) to avoid calling xargs with no input; update the
block that sets PACKAGES and the subsequent for pkg loop to be skipped when
CHANGED_FILES is empty so the go test invocation only runs when there are
changed .go files.

Comment thread .claude/hooks/README.md Outdated
Comment thread .claude/skills/README.md
Comment on lines +66 to +72
```
.claude/skills/
├── README.md
└── skillname/
├── SKILL.md # Required: skill definition
└── reference/ # Optional: supporting docs
```
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add fenced code block language to satisfy markdown lint.

The directory-structure block should declare a language (e.g., text) to address MD040.

Suggested update
-```
+```text
 .claude/skills/
 ├── README.md
 └── skillname/
     ├── SKILL.md          # Required: skill definition
     └── reference/        # Optional: supporting docs
</details>

<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

```suggestion

🧰 Tools
🪛 markdownlint-cli2 (0.22.1)

[warning] 66-66: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/skills/README.md around lines 66 - 72, The README
directory-structure code fence is missing a language tag which triggers MD040;
edit the fenced block in .claude/skills/README.md (the directory-structure block
that starts with ``` ) and change it to declare a language such as text (i.e.,
use ```text) so the block becomes a labeled text code block while keeping the
same contents.

Comment thread .gitleaks.toml
Comment on lines +25 to +32
paths = [
'''test/fixtures/.*''',
'''test/deploy/.*''',
'''.*_test\.go''',
'''boilerplate/.*''',
'''vendor/.*''',
'''zz_generated\..*\.go''',
]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

In gitleaks v8, does a global allowlist paths regex skip scanning of matching files entirely?

💡 Result:

Yes, in Gitleaks v8, defining paths in a global allowlist (configured via [[allowlists]] in your configuration file) causes Gitleaks to skip scanning those files entirely [1][2]. When a file path matches a pattern defined in the paths array of a global allowlist, Gitleaks effectively ignores that file during the scan, preventing any secrets from being detected within it [2][3]. This mechanism functions with high precedence [2][3]. Key points regarding this behavior: - Configuration: Global allowlists are defined at the top level of the gitleaks.toml configuration file using [[allowlists]] [2][4]. - Functionality: The paths field accepts regex patterns [1][3]. If a file path matches one of these regex patterns, the file is excluded from the scanning process [2][3]. - Precedence: Global allowlists have a higher order of precedence than rule-specific allowlists [2][3]. If a file is matched by a global allowlist path, it is skipped regardless of other individual rule configurations [2][3]. Note: Ensure your regex patterns in the paths array are correctly formatted (often using triple-quoted raw strings in TOML for ease of escaping, e.g., paths = ['''path/to/ignore/.*''']) to ensure they match the intended file paths accurately [1][2].

Citations:


Tighten the gitleaks global allowlist to avoid skipping all Go test files.

.*_test\.go in .gitleaks.toml (lines 25-32, line 28) causes gitleaks v8 to skip scanning every matching *_test.go file entirely, creating a blind spot where real secrets in tests could be missed. Remove this broad exemption and only exclude the specific fixture/deploy paths you already intend to ignore.

🔐 Suggested tightening
 paths = [
   '''test/fixtures/.*''',
   '''test/deploy/.*''',
-  '''.*_test\.go''',
   '''boilerplate/.*''',
   '''vendor/.*''',
   '''zz_generated\..*\.go''',
 ]
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
paths = [
'''test/fixtures/.*''',
'''test/deploy/.*''',
'''.*_test\.go''',
'''boilerplate/.*''',
'''vendor/.*''',
'''zz_generated\..*\.go''',
]
paths = [
'''test/fixtures/.*''',
'''test/deploy/.*''',
'''boilerplate/.*''',
'''vendor/.*''',
'''zz_generated\..*\.go''',
]
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.gitleaks.toml around lines 25 - 32, The global allowlist in .gitleaks.toml
currently contains the broad pattern '.*_test\.go' inside the paths = [...]
array which causes all Go test files to be skipped; remove that pattern from the
paths array and keep only the intended specific exclusions (for example the
existing '''test/fixtures/.*''', '''test/deploy/.*''', '''boilerplate/.*''',
'''vendor/.*''', '''zz_generated\..*\.go''') so gitleaks will scan *_test.go
files; update the paths array in .gitleaks.toml accordingly and run a quick
gitleaks scan to verify tests are no longer globally excluded.

Comment thread CONTRIBUTING.md
Comment on lines +1 to +3
# Contributing to Gcp Project

Thank you for your interest in contributing to the GCP Project Operator! This guide provides comprehensive instructions for setting up your development environment, running tests, and contributing code.
Thank you for your interest in contributing to the Gcp Project project.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix project naming and duplicated wording in the heading/intro.

Gcp Project and Gcp Project project are inconsistent and read as a typo. Use the canonical repo/product name consistently (e.g., GCP Project Operator).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@CONTRIBUTING.md` around lines 1 - 3, Update the heading and intro to use the
canonical product name and remove the duplicated word: change the heading text
"# Contributing to Gcp Project" to "# Contributing to GCP Project Operator" and
edit the intro line "Thank you for your interest in contributing to the Gcp
Project project." to "Thank you for your interest in contributing to GCP Project
Operator." Ensure both occurrences use the exact same capitalization and
phrasing "GCP Project Operator".

Comment thread hack/ci.sh
fi

prek run --all-files
prek run --config hack/prek.ci.toml --all-files
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Make prek config resolution independent of caller working directory.

Line 9 uses a relative config path, but this script no longer cds to repo root. Invocations from non-root directories can fail to find hack/prek.ci.toml.

Suggested fix
 if ! command -v prek &>/dev/null; then
   echo "Error: prek is not installed. Install with: uv tool install prek" >&2
   exit 1
 fi
 
-prek run --config hack/prek.ci.toml --all-files
+script_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
+repo_root="$(cd -- "${script_dir}/.." && pwd)"
+prek run --config "${repo_root}/hack/prek.ci.toml" --all-files
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
prek run --config hack/prek.ci.toml --all-files
if ! command -v prek &>/dev/null; then
echo "Error: prek is not installed. Install with: uv tool install prek" >&2
exit 1
fi
script_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
repo_root="$(cd -- "${script_dir}/.." && pwd)"
prek run --config "${repo_root}/hack/prek.ci.toml" --all-files
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@hack/ci.sh` at line 9, The prek invocation uses a relative path
"hack/prek.ci.toml" which breaks when the script is run from a non-root working
directory; change the script to resolve the config file path relative to the
script location (e.g., compute the script directory/REPO_ROOT and construct an
absolute path to hack/prek.ci.toml) and use that absolute path in the "prek run
--config ... --all-files" call so config resolution is independent of the
caller's cwd.

Comment thread TESTING.md
@devppratik devppratik force-pushed the add-claude-and-docs branch from cba58f6 to d0c98c0 Compare May 29, 2026 17:49
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 29, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: devppratik
Once this PR has been reviewed and has the lgtm label, please assign dakotalongrh for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@devppratik devppratik force-pushed the add-claude-and-docs branch from d0c98c0 to baf3bc1 Compare May 29, 2026 17:52
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.claude/agents/README.md:
- Line 3: Update the opening sentence in .claude/agents/README.md by replacing
the incorrect phrase "this operator development workflows" with the
grammatically correct "this operator's development workflows" (or "the
operator's development workflows") so the description reads naturally; edit the
top line of the README to use the possessive form.

In @.claude/skills/prow-ci/SKILL.md:
- Line 7: Update the heading text to use the standard acronym casing: replace
"Prow CI Access for Gcp Project" with "Prow CI Access for GCP Project" so the
acronym GCP matches repository/product naming conventions; ensure any other
occurrences of "Gcp" in SKILL.md are similarly corrected.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 692c0833-5cdf-446c-b7fb-e8b119d55e5e

📥 Commits

Reviewing files that changed from the base of the PR and between cba58f6 and d0c98c0.

📒 Files selected for processing (21)
  • .claude/agents/README.md
  • .claude/agents/ci-agent.md
  • .claude/agents/docs-agent.md
  • .claude/agents/lint-agent.md
  • .claude/agents/security-agent.md
  • .claude/agents/test-agent.md
  • .claude/hooks/README.md
  • .claude/hooks/cleanup.sh
  • .claude/hooks/pre-edit.sh
  • .claude/hooks/stop-prek-validation.sh
  • .claude/settings.json
  • .claude/skills/README.md
  • .claude/skills/prow-ci/SKILL.md
  • .gitleaks.toml
  • .prek-version
  • CONTRIBUTING.md
  • DEVELOPMENT.md
  • TESTING.md
  • hack/ci.sh
  • hack/prek.ci.toml
  • prek.toml
✅ Files skipped from review due to trivial changes (8)
  • .prek-version
  • .claude/agents/test-agent.md
  • TESTING.md
  • .claude/agents/lint-agent.md
  • CONTRIBUTING.md
  • DEVELOPMENT.md
  • .claude/agents/ci-agent.md
  • .claude/agents/security-agent.md
🚧 Files skipped from review as they are similar to previous changes (6)
  • hack/ci.sh
  • .claude/hooks/cleanup.sh
  • prek.toml
  • .claude/hooks/pre-edit.sh
  • .gitleaks.toml
  • .claude/settings.json

Comment thread .claude/agents/README.md
@@ -0,0 +1,244 @@
# Claude Agents

Specialized agents for this operator development workflows.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix grammar in the opening description.

“this operator development workflows” is grammatically incorrect and reads awkwardly. Consider: “this operator’s development workflows.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/agents/README.md at line 3, Update the opening sentence in
.claude/agents/README.md by replacing the incorrect phrase "this operator
development workflows" with the grammatically correct "this operator's
development workflows" (or "the operator's development workflows") so the
description reads naturally; edit the top line of the README to use the
possessive form.

trigger: prow, prow-ci, /prow-ci, ci results, check ci
---

# Prow CI Access for Gcp Project
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Use standard acronym casing in the heading.

“Gcp” should be “GCP” for consistency with the repository and product naming.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/skills/prow-ci/SKILL.md at line 7, Update the heading text to use
the standard acronym casing: replace "Prow CI Access for Gcp Project" with "Prow
CI Access for GCP Project" so the acronym GCP matches repository/product naming
conventions; ensure any other occurrences of "Gcp" in SKILL.md are similarly
corrected.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.claude/skills/prow-ci/SKILL.md:
- Around line 114-116: Replace the mention and command that reference pre-commit
with the repository's documented tool `prek`; specifically update the
heading/title "OR use pre-commit for comprehensive linting" and the example
command line `pre-commit run --all-files` to use `prek` (e.g., adjust the
heading text and change the command to `prek run --all-files`) so the doc
matches the repo's tooling.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: c8c0923d-059e-4d5d-aeee-9979035e0543

📥 Commits

Reviewing files that changed from the base of the PR and between d0c98c0 and baf3bc1.

📒 Files selected for processing (21)
  • .claude/agents/README.md
  • .claude/agents/ci-agent.md
  • .claude/agents/docs-agent.md
  • .claude/agents/lint-agent.md
  • .claude/agents/security-agent.md
  • .claude/agents/test-agent.md
  • .claude/hooks/README.md
  • .claude/hooks/cleanup.sh
  • .claude/hooks/pre-edit.sh
  • .claude/hooks/stop-prek-validation.sh
  • .claude/settings.json
  • .claude/skills/README.md
  • .claude/skills/prow-ci/SKILL.md
  • .gitleaks.toml
  • .prek-version
  • CONTRIBUTING.md
  • DEVELOPMENT.md
  • TESTING.md
  • hack/ci.sh
  • hack/prek.ci.toml
  • prek.toml
✅ Files skipped from review due to trivial changes (7)
  • .claude/agents/lint-agent.md
  • .claude/agents/test-agent.md
  • TESTING.md
  • .claude/agents/security-agent.md
  • CONTRIBUTING.md
  • DEVELOPMENT.md
  • .claude/agents/ci-agent.md
🚧 Files skipped from review as they are similar to previous changes (8)
  • hack/ci.sh
  • .gitleaks.toml
  • .prek-version
  • hack/prek.ci.toml
  • .claude/settings.json
  • .claude/hooks/stop-prek-validation.sh
  • prek.toml
  • .claude/hooks/pre-edit.sh

Comment on lines +114 to +116
# OR use pre-commit for comprehensive linting
pre-commit run --all-files

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Use prek command here to match repository tooling.

This section currently tells contributors to run pre-commit, but this repo’s documented hook manager in this PR is prek.

Suggested doc fix
-# OR use pre-commit for comprehensive linting
-pre-commit run --all-files
+# OR use prek for comprehensive linting
+prek run --all-files
Based on learnings: Preserve existing code style and patterns when making changes.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/skills/prow-ci/SKILL.md around lines 114 - 116, Replace the mention
and command that reference pre-commit with the repository's documented tool
`prek`; specifically update the heading/title "OR use pre-commit for
comprehensive linting" and the example command line `pre-commit run --all-files`
to use `prek` (e.g., adjust the heading text and change the command to `prek run
--all-files`) so the doc matches the repo's tooling.

@devppratik devppratik force-pushed the add-claude-and-docs branch from baf3bc1 to d83b6a5 Compare May 29, 2026 18:42
- Add .claude/ directory with agents, hooks, and skills
- Add prek validation framework (prek.toml, hack/prek.ci.toml)
- Add gitleaks secret scanning (.gitleaks.toml)
- Add CONTRIBUTING.md, DEVELOPMENT.md, TESTING.md
- Add CLAUDE.md (if not already present)
- Add stop hook for automatic validation

Based on ocm-agent-operator PR openshift#257 (SREP-4410, SREP-4411)

Brings the repo up to Agentic SDLC contribution standard
@devppratik devppratik force-pushed the add-claude-and-docs branch from d83b6a5 to fa70215 Compare May 29, 2026 18:47
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 29, 2026

@devppratik: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants