Skip to content

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

Open
devppratik wants to merge 6 commits into
openshift:masterfrom
devppratik:add-claude-and-docs
Open

docs, feat(SREP-4460, SREP-4926: Add Standardized Claude hooks, skill, agents. Update standardised docs)#437
devppratik wants to merge 6 commits 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

  • New Features

    • Prow CI artifact fetcher and failure analysis tool for structured reports.
  • Documentation

    • Added CONTRIBUTING, DEVELOPMENT, TESTING guides.
    • Added user-facing docs for automated agents, hooks, and reusable skills covering lint/test/security/CI/docs workflows.
  • Chores

    • Added pre-commit/CI hook configurations, stop-hook and pre-edit safeguards, secret-scan rules, session permissions/settings, CI helper script, and gitignore/tool-version updates.

@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.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 29, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 7f315137-4c68-4a58-8112-66e077d3bf20

📥 Commits

Reviewing files that changed from the base of the PR and between 77377ba and b5537cb.

📒 Files selected for processing (3)
  • .claude/agents/docs-agent.md
  • .claude/hooks/session-start-prek-setup.sh
  • .claude/settings.json
✅ Files skipped from review due to trivial changes (1)
  • .claude/hooks/session-start-prek-setup.sh
🚧 Files skipped from review as they are similar to previous changes (2)
  • .claude/settings.json
  • .claude/agents/docs-agent.md

Walkthrough

This PR adds a Claude Agents framework (lint/test/security/ci/docs), Prek-based hooks and edit-guards, Prow CI fetch/analyze skills and scripts, Prek/CI configurations, gitleaks rules, Claude command permissions, and comprehensive developer documentation (CONTRIBUTING, DEVELOPMENT, TESTING).

Changes

Claude Agents & Automation Framework

Layer / File(s) Summary
Agent Framework & Core Design
.claude/agents/README.md
Introduces the Claude Agents catalog (lint, test, security, CI, docs), invocation patterns (single/multi-agent, pre-commit/pre-PR), shared design principles, agent output format, and extension guide.
Individual agent specs
.claude/agents/lint-agent.md, .claude/agents/test-agent.md, .claude/agents/security-agent.md, .claude/agents/ci-agent.md, .claude/agents/docs-agent.md
Adds per-agent specifications: lint-agent (gofmt/golangci-lint flow and auto-fix rules), test-agent (targeted test execution, flaky detection, coverage rules), security-agent (gitleaks, RBAC wildcard checks, insecure-pattern detection), ci-agent (Tekton parity/validation and runbooks), and docs-agent (doc validation and style rules).

Pre-commit Hook Infrastructure & File Guards

Layer / File(s) Summary
Hook Architecture & Configuration Guide
.claude/hooks/README.md
Documents Prek-based hook architecture, stop-hook vs pre-commit categories, file-edit protection behavior, security guardrails, performance targets, and troubleshooting.
File Edit Protection Guard
.claude/hooks/pre-edit.sh
Pre-edit script normalizing/validating target paths; blocks edits to generated files and vendor; warns+requires confirmation for CRD manifests, go.sum, boilerplate edits, high-risk patterns, and large files.
Conditional Stop-Hook Validator
.claude/hooks/stop-prek-validation.sh
Stop-hook that uses prek/hack/prek.ci.toml to validate changed files, emits JSON blocking decisions on failures, prevents re-entry, and checks CLI prerequisites (jq, prek).
Session-start hook
.claude/hooks/session-start-prek-setup.sh
Session-start script that ensures prek availability and attempts to install/prep pre-commit hooks on session start.

Pre-commit Validation Configurations

Layer / File(s) Summary
Prek Hook Configurations & CI Wrapper
prek.toml, hack/prek.ci.toml, hack/ci.sh, .prek-version, .gitignore
prek.toml configures full pre-commit checks (formatting, InfoSec, gitleaks, golangci, local build/module/RBAC checks); hack/prek.ci.toml is CI-optimized; hack/ci.sh invokes CI Prek; .prek-version pins version; .gitignore adds .work/.

Claude Code Configuration

Layer / File(s) Summary
Claude Settings & Permissions
.claude/settings.json
Adds shell command permission rules (allow, ask, deny) for common Go/git/prek workflows, blocks high-risk commands, and registers session-start and stop hook scripts.

Prow CI Analysis Skill

Layer / File(s) Summary
Skills Framework & Prow Skill Definition
.claude/skills/README.md, .claude/skills/prow-ci/SKILL.md
Introduces Skills and defines prow-ci skill with prerequisites, usage, artifact flow, log parsing, reporting, troubleshooting, and CI integration notes.
Prow Artifact Fetching
.claude/skills/prow-ci/fetch_prow_artifacts.py
CLI to parse Prow job URLs, derive GCS base paths, and download prowjob.json (optional) and build-log.txt (required) via gcloud storage cp.
Prow Failure Analysis
.claude/skills/prow-ci/analyze_failure.py
CLI to analyze build-log.txt and optional prowjob.json, count failure patterns, collect top ERROR/FAIL/WARNING lines, and emit Markdown/JSON/plaintext reports (hard-fails when build-log missing).

Developer Documentation

Layer / File(s) Summary
Contribution Guide & Workflows
CONTRIBUTING.md
Adds contribution rules, pre-submission checks (format/lint/test/security), AI/human workflows, regeneration instructions, commit conventions, and PR checklist.
Development Setup & Workflows
DEVELOPMENT.md
Provides developer setup, build/test/lint workflows, codegen, debugging tips, repository architecture pointers, and CI parity guidance.
Testing Framework & Patterns
TESTING.md
Adds testing guide covering Ginkgo v2/Gomega/GoMock/envtest usage, commands, patterns, coverage, CI expectations, and flaky-test handling.

Security & Miscellaneous Configuration

Layer / File(s) Summary
Gitleaks Secret Detection Configuration
.gitleaks.toml
Adds gitleaks config with allowlist entries and several custom detection rules for tokens, pull secrets, kubeconfig certs, and PEM keys.
Version Pinning & Ignores
.prek-version, .gitignore
Pins Prek to v0.4.1 and ignores .work/.

🎯 4 (Complex) | ⏱️ ~60 minutes


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error, 1 inconclusive)

Check name Status Explanation Resolution
No-Sensitive-Data-In-Logs ❌ Error Unfiltered command output logged: stop-prek-validation.sh logs full prek stderr/stdout (lines 84, 99), and fetch_prow_artifacts.py logs raw gcloud stderr, both exposing sensitive diagnostic data. Sanitize command output before logging; filter prek output to only relevant errors, and avoid exposing raw stderr from external commands that may contain credentials.
Title check ❓ Inconclusive The title describes multiple changes (Claude hooks, skills, agents, and documentation updates) but lacks clarity about the primary change; it uses ticket references and vague phrasing. Simplify the title to focus on the main objective. Consider: 'Add Claude agent framework and standardized developer workflow documentation' or similar to clarify the primary change without excessive ticket references.
✅ Passed checks (13 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 81.82% 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 PR contains no Ginkgo test files or code; check is not applicable to documentation/configuration/hook changes.
Test Structure And Quality ✅ Passed PR contains no Ginkgo test code; check is not applicable. PR adds documentation, config files, and utility scripts only.
Microshift Test Compatibility ✅ Passed This PR adds no new Ginkgo e2e tests; it only adds documentation, configuration files, and helper scripts. The check does not apply.
Single Node Openshift (Sno) Test Compatibility ✅ Passed PR contains no new Ginkgo e2e tests. Added files are documentation, configuration, and utility scripts only. Check is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed PR contains only documentation, configuration, and helper scripts; no deployment manifests, operator code, or controllers that would introduce scheduling constraints were modified.
Ote Binary Stdout Contract ✅ Passed PR adds only documentation, configuration, and utility scripts (no Go test code). Does not modify any test binaries, main functions, or OTE integration points subject to stdout contract requirements.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed This PR adds documentation, configuration, and helper scripts only. No Ginkgo e2e tests are added, so the IPv6/disconnected network compatibility check does not apply.
No-Weak-Crypto ✅ Passed PR adds documentation and configuration only. MD5/SHA1/DES references are in security documentation recommending developers check for weak crypto, not actual implementations.
Container-Privileges ✅ Passed PR adds no new privileged container configurations. No K8s manifests with privileged: true, hostPID, hostNetwork, hostIPC, SYS_ADMIN, allowPrivilegeEscalation: true, or runAsUser: 0 were added.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@openshift-ci openshift-ci Bot requested review from boranx and nephomaniac May 29, 2026 08:16
@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 tnierman 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

@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 72.44%. Comparing base (926f030) to head (b5537cb).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #437   +/-   ##
=======================================
  Coverage   72.44%   72.44%           
=======================================
  Files          11       11           
  Lines         704      704           
=======================================
  Hits          510      510           
  Misses        173      173           
  Partials       21       21           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@clcollins
Copy link
Copy Markdown
Member

/hold

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 29, 2026
@devppratik devppratik force-pushed the add-claude-and-docs branch 5 times, most recently from 9c8534a to d010c85 Compare June 2, 2026 07:00
@devppratik devppratik force-pushed the add-claude-and-docs branch 2 times, most recently from dd433bd to 6f9f342 Compare June 2, 2026 16:11
Copy link
Copy Markdown
Contributor

@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: 16

🧹 Nitpick comments (1)
.claude/hooks/stop-prek-validation.sh (1)

21-21: 💤 Low value

Consider adding -e flag to strict mode for fail-fast behavior.

Line 21 sets set -uo pipefail but omits the -e flag. This means command failures won't immediately exit the script. While the current implementation handles errors explicitly (jq checks, exit code capture for prek), adding -e would provide fail-fast protection for any future additions.

🔒 Proposed fix
-set -uo pipefail
+set -euo pipefail

Review the script to ensure all intentional non-zero exits are handled with || true or explicit conditionals.

🤖 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/hooks/stop-prek-validation.sh at line 21, The script currently
enables strict mode with "set -uo pipefail" but omits "-e", so add "-e" to make
it "set -euo pipefail" to enable fail-fast behavior; after adding this, audit
the stop-prek-validation.sh script for any commands that intentionally may
return non-zero and make them explicit (e.g., append "|| true" or wrap in
conditionals) — pay special attention to the existing jq checks and the prek
exit-code handling to ensure those still behave as intended.
🤖 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/ci-agent.md:
- Around line 52-60: The parity validation commands currently grep
.pre-commit-config.yaml but the new source of truth is prek.toml; update the two
grep invocations (the "Check pre-commit uses same golangci-lint version as CI"
and "Check gitleaks version" commands referenced around the parity validation
block and the duplicate at lines 148-149) to point at prek.toml instead of
.pre-commit-config.yaml so the CI/local comparison validates prek.toml as
intended.
- Around line 23-30: The placeholder pipeline names "this repository-*.yaml" in
.claude/agents/ci-agent.md should be replaced with the real Tekton pipeline
filenames; update the list, the `tkn` example, and the failure report to use:
splunk-forwarder-operator-pull-request.yaml,
splunk-forwarder-operator-push.yaml,
splunk-forwarder-operator-e2e-pull-request.yaml,
splunk-forwarder-operator-e2e-push.yaml,
splunk-forwarder-operator-pko-push.yaml, and
splunk-forwarder-operator-pko-pull-request.yaml so every occurrence of "this
repository-..." is swapped to the corresponding splunk-forwarder-operator-...
filename (search for the text "this repository-" to locate all places, including
the pipeline list, the tkn example, and the failure report).

In @.claude/agents/docs-agent.md:
- Around line 31-37: Replace all references to docs/development.md with the
repo-root DEVELOPMENT.md so the doc trigger paths are consistent: update the
list entries that currently mention "New dependencies: Update
`docs/development.md`" (and the similar occurrences at lines 90-93) to point to
"DEVELOPMENT.md" instead, and verify other entries referring to development docs
(e.g., in the "Build process" and "Make targets" bullets) use the root
DEVELOPMENT.md consistently while leaving other filenames (CLAUDE.md,
docs/design.md, TESTING.md, CONTRIBUTING.md) unchanged.
- Around line 174-183: The current pipeline using "grep '```bash' *.md | grep
'make '" never captures make invocations because it only matches fence lines;
replace that pipeline with a pipeline that scans all markdown files for fenced
bash blocks and extracts lines starting with "make " (e.g., use find + xargs +
awk to enter fenced ```bash blocks and print lines beginning with make), then
pipe the results through the existing sed/sort logic to extract and unique the
target names; update the section that currently runs grep '```bash' *.md | grep
'make ' | sed ... to use this fenced-block-aware extractor so documented make
targets are detected.

In @.claude/agents/lint-agent.md:
- Around line 21-25: Replace the invalid use of the "go fmt -l ." command with
the correct "gofmt -l ." wherever it appears (the occurrences that currently
read "go fmt -l .", including the Validation Flow and the duplicate block later)
so the documentation invokes the tool that accepts the -l flag; search for the
literal string "go fmt -l ." and change it to "gofmt -l ." to fix the
lint-agent.md commands.

In @.claude/agents/test-agent.md:
- Around line 29-39: The targeted-test flow fails when CHANGED_FILES is empty
because xargs dirname runs on no input; add a guard after computing
CHANGED_FILES (or before computing PACKAGES) to detect an empty value and
skip/exit successfully (e.g., check [ -z "$CHANGED_FILES" ] and echo/exit 0) so
PACKAGES and the for pkg in $PACKAGES loop are not executed on docs-only
changes; update the snippet around CHANGED_FILES, PACKAGES, and the for loop to
implement this guard.

In @.claude/hooks/README.md:
- Line 334: The README entry showing a pinned Prek version is out of sync:
update the documentation string that currently shows "v0.3.9" (the line with
"cat .prek-version") to match the actual .prek-version content "v0.4.1" so the
README and the .prek-version file are consistent; modify the README.md text to
display v0.4.1 (or alternatively update .prek-version if the doc is
authoritative) and commit the change.
- Line 182: Update the README to reflect the actual smart-triggering behavior:
clarify that by default the stop hook (see stop-prek-validation.sh) only runs
`prek run --all-files` when there are uncommitted changes, and that the "runs on
every turn" behavior only occurs in strict mode when CLAUDE_LINT_ON_STOP=true;
reference the stop-prek-validation.sh script and the CLAUDE_LINT_ON_STOP env var
so readers can locate the implementation and the strict vs default behavior.

In @.claude/skills/prow-ci/analyze_failure.py:
- Around line 22-24: The loop currently uses root.findall('.//testsuite') which
omits the root when the document root is a <testsuite>; change the iteration to
include the root node when root.tag == 'testsuite' (e.g. build a suites list
like: include root if root.tag == 'testsuite' otherwise extend with
root.findall('.//testsuite')) and then iterate over that suites list to find
testcase elements (still using testcase = testsuite.findall('.//testcase') or
.findall('testcase') as appropriate) so top-level <testsuite> documents are
processed.
- Around line 11-18: The parse_junit_xml function currently uses
xml.etree.ElementTree.parse on untrusted CI artifacts; either harden it by
switching to a secure parser from defusedxml (e.g.,
defusedxml.ElementTree.parse) and add a runtime dependency check/clear error if
defusedxml is missing, or guard/remove the JUnit path so it never tries to parse
absent/untrusted files (e.g., skip when fetch_prow_artifacts does not download
junit files). Update parse_junit_xml and any callers to use
defusedxml.ElementTree (or early-return/log when junit*.xml not present) and
ensure the package requirement is listed so defusedxml is available at runtime.

In @.claude/skills/prow-ci/fetch_prow_artifacts.py:
- Around line 78-93: The fetcher currently only pulls prowjob.json and
build-log.txt (in fetch_prowjob_json and fetch_build_log) so analyze_failure.py
never sees artifacts/**/junit*.xml; update the fetch step to also download the
artifacts tree (or at minimum all files matching artifacts/**/junit*.xml) from
GCS under gcs_base_path (e.g., implement a new
download_artifacts_or_download_junit_matching function invoked from the same
place as fetch_prowjob_json/fetch_build_log) so the JUnit XMLs are present for
analyze_failure.py, or alternatively remove the JUnit-specific claims from the
skill if you prefer to not fetch artifacts. Ensure the change references the
same gcs_base_path/output_dir convention and uses the existing download_from_gcs
or a recursive GCS listing/downloader to retrieve artifacts/**/junit*.xml.
- Around line 130-139: The script's main() always returns 0 even if
fetch_build_log(parsed['gcs_base_path'], output_dir) fails; change the control
flow in main() so that when fetch_build_log(...) returns False you return a
non-zero exit code (e.g., return 1 or call sys.exit(1)) instead of continuing to
print success and returning 0; update the logic around the fetch_build_log call
and the final return so callers receive a failure status when the build-log.txt
download fails.
- Around line 61-75: The download_from_gcs function should also catch
FileNotFoundError (in addition to subprocess.CalledProcessError) and return
False with a clear stderr warning so the script won't crash if gcloud is
missing; update the download_from_gcs function to catch FileNotFoundError and
print a similar warning message to stderr. Also update main() to treat failures
of essential artifact downloads (specifically the prowjob.json and build-log.txt
download attempts) as fatal by returning a non-zero exit code when those
downloads fail instead of always returning 0; adjust the logic that calls
download_from_gcs for those two artifacts so main exits with non-zero on
failure. Finally, add a short note (or comment) near the analyze_failure.py
reference or SKILL.md mention to clarify that JUnit XMLs are optional and won't
be reported unless downloaded.

In `@CONTRIBUTING.md`:
- Around line 7-8: Update the Go version requirement in CONTRIBUTING.md so it
matches the repository's go.mod declaration: change the current "Go 1.22.7+"
text to reflect "go 1.25.9" (or "Go 1.25.9+") as declared in go.mod; ensure the
install step text ("Setup: Install Go ...") and any other references in
CONTRIBUTING.md are updated to the same version string to keep docs consistent
with go.mod.

In `@hack/prek.ci.toml`:
- Around line 55-62: The CI hook "rbac-wildcard-check" currently runs the
Makefile target rbac-wildcard-check which always exits 0, so wildcard RBAC
findings do not block CI; update the rbac-wildcard-check Makefile target to
detect violations and exit with a non-zero status when any are found (so the
hook fails) and ensure the hook in hack/prek.ci.toml still references the same
entry; alternatively, if you want warn-only behavior, update
.claude/hooks/README.md to change the documented "Action: BLOCK commit" to
reflect that the check is warn-only—pick one approach and implement it
consistently (Makefile target name: rbac-wildcard-check; docs file:
.claude/hooks/README.md).

In `@TESTING.md`:
- Around line 132-148: The markdown has duplicated code fences around the test
block which breaks rendering; fix by keeping a single opening fence ("```go")
before the It("should reconcile resource", func() { ... }) block and a single
closing fence ("```") after the closing parenthesis, removing the
extra/duplicate opening and closing backticks so the test snippet (the It(...)
test that creates resource, calls reconciler.Reconcile, and asserts
Status.Conditions) is enclosed in exactly one proper Go code fence.

---

Nitpick comments:
In @.claude/hooks/stop-prek-validation.sh:
- Line 21: The script currently enables strict mode with "set -uo pipefail" but
omits "-e", so add "-e" to make it "set -euo pipefail" to enable fail-fast
behavior; after adding this, audit the stop-prek-validation.sh script for any
commands that intentionally may return non-zero and make them explicit (e.g.,
append "|| true" or wrap in conditionals) — pay special attention to the
existing jq checks and the prek exit-code handling to ensure those still behave
as intended.
🪄 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 YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: bde6f7ee-d59b-48a4-ba96-a91b03f67e41

📥 Commits

Reviewing files that changed from the base of the PR and between 72d29cf and dd433bd.

📒 Files selected for processing (24)
  • .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
  • .claude/skills/prow-ci/analyze_failure.py
  • .claude/skills/prow-ci/fetch_prow_artifacts.py
  • .gitignore
  • .gitleaks.toml
  • .prek-version
  • CONTRIBUTING.md
  • DEVELOPMENT.md
  • TESTING.md
  • hack/ci.sh
  • hack/prek.ci.toml
  • prek.toml

Comment thread .claude/agents/ci-agent.md
Comment thread .claude/agents/ci-agent.md
Comment thread .claude/agents/docs-agent.md
Comment thread .claude/agents/docs-agent.md
Comment thread .claude/agents/lint-agent.md
Comment thread .claude/skills/prow-ci/fetch_prow_artifacts.py
Comment thread .claude/skills/prow-ci/fetch_prow_artifacts.py Outdated
Comment thread CONTRIBUTING.md
Comment thread hack/prek.ci.toml
Comment thread TESTING.md
@devppratik devppratik force-pushed the add-claude-and-docs branch from 6f9f342 to c618f25 Compare June 2, 2026 18:21
Copy link
Copy Markdown
Contributor

@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.

🧹 Nitpick comments (2)
.claude/skills/prow-ci/SKILL.md (2)

80-80: ⚡ Quick win

Simplify the directory change command.

The command cd $PWD/.claude/skills/prow-ci is unnecessarily complex. Since $PWD expands to the current directory's absolute path, this could be confusing. Use a simpler relative path instead.

📝 Proposed fix
-cd $PWD/.claude/skills/prow-ci
+cd .claude/skills/prow-ci

Or clarify the starting directory assumption:

+# From repository root:
-cd $PWD/.claude/skills/prow-ci
+cd .claude/skills/prow-ci
🤖 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 80, The cd invocation uses an
unnecessary $PWD prefix; replace the command `cd $PWD/.claude/skills/prow-ci`
with a simple relative change into the skills directory (e.g., `cd
.claude/skills/prow-ci`) or add a brief note clarifying the expected starting
directory before using the absolute path, updating the line where the shell
command appears so the intent is clear.

78-83: ⚡ Quick win

Consider documenting Python requirements.

The documentation references Python scripts (fetch_prow_artifacts.py, analyze_failure.py) but doesn't specify Python version requirements or dependencies. Users may encounter import errors if dependencies aren't installed.

📋 Suggested addition

Add a Python requirements note in the Prerequisites section (after line 20):

**Python Requirements**:
- Python 3.7 or later
- Dependencies: Install with `pip install -r .claude/skills/prow-ci/requirements.txt` (if requirements file exists)

Or add inline before first script usage (around line 78):

### Step 2: Fetch and Analyze

**Prerequisites**: Ensure Python 3.7+ is installed and any required packages are available.

Run the fetch script first:
🤖 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 78 - 83, Update the SKILL.md
doc to document Python requirements: add a brief "Python Requirements" note in
the Prerequisites section (or immediately before the first script usage around
the fetch example) that specifies Python 3.7+ and instructs users to install
dependencies via pip (e.g. "pip install -r
.claude/skills/prow-ci/requirements.txt") if a requirements file exists; mention
the two scripts by name (fetch_prow_artifacts.py and analyze_failure.py) so
readers know which tools need the environment.
🤖 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.

Nitpick comments:
In @.claude/skills/prow-ci/SKILL.md:
- Line 80: The cd invocation uses an unnecessary $PWD prefix; replace the
command `cd $PWD/.claude/skills/prow-ci` with a simple relative change into the
skills directory (e.g., `cd .claude/skills/prow-ci`) or add a brief note
clarifying the expected starting directory before using the absolute path,
updating the line where the shell command appears so the intent is clear.
- Around line 78-83: Update the SKILL.md doc to document Python requirements:
add a brief "Python Requirements" note in the Prerequisites section (or
immediately before the first script usage around the fetch example) that
specifies Python 3.7+ and instructs users to install dependencies via pip (e.g.
"pip install -r .claude/skills/prow-ci/requirements.txt") if a requirements file
exists; mention the two scripts by name (fetch_prow_artifacts.py and
analyze_failure.py) so readers know which tools need the environment.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 9ef3833f-f58b-4f81-8bd7-d87e948aadcd

📥 Commits

Reviewing files that changed from the base of the PR and between dd433bd and c618f25.

📒 Files selected for processing (7)
  • .claude/hooks/README.md
  • .claude/hooks/pre-edit.sh
  • .claude/hooks/stop-prek-validation.sh
  • .claude/skills/README.md
  • .claude/skills/prow-ci/SKILL.md
  • .claude/skills/prow-ci/analyze_failure.py
  • .claude/skills/prow-ci/fetch_prow_artifacts.py
✅ Files skipped from review due to trivial changes (2)
  • .claude/skills/README.md
  • .claude/hooks/README.md
🚧 Files skipped from review as they are similar to previous changes (4)
  • .claude/hooks/pre-edit.sh
  • .claude/hooks/stop-prek-validation.sh
  • .claude/skills/prow-ci/fetch_prow_artifacts.py
  • .claude/skills/prow-ci/analyze_failure.py

@devppratik devppratik force-pushed the add-claude-and-docs branch from c618f25 to df970bc Compare June 2, 2026 18:34
- Update settings.json with prek permissions and comprehensive deny rules
- Update hooks (stop-prek-validation.sh, pre-edit.sh, README.md)
- Update agents with repo-specific references
- Update skills with repo-specific prow-ci examples
- Ensure all references are operator-specific

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@devppratik
Copy link
Copy Markdown
Contributor Author

/label tide/merge-method-squash

@openshift-ci openshift-ci Bot added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Jun 3, 2026
Copy link
Copy Markdown
Contributor

@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:
- Line 7: The top-level Markdown heading "# Prow CI Analysis for " is incomplete
and renders broken; update that heading in SKILL.md to include the missing
subject (e.g., "# Prow CI Analysis for <project/name>" or a generic complete
title like "# Prow CI Analysis") so the page title is a full phrase and renders
correctly.
🪄 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 YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 35ddff82-6136-4c93-8f73-335f0fed8ab0

📥 Commits

Reviewing files that changed from the base of the PR and between c618f25 and 435411c.

📒 Files selected for processing (11)
  • .claude/agents/README.md
  • .claude/agents/ci-agent.md
  • .claude/agents/docs-agent.md
  • .claude/hooks/README.md
  • .claude/hooks/pre-edit.sh
  • .claude/hooks/stop-prek-validation.sh
  • .claude/settings.json
  • .claude/skills/README.md
  • .claude/skills/prow-ci/SKILL.md
  • .claude/skills/prow-ci/analyze_failure.py
  • .claude/skills/prow-ci/fetch_prow_artifacts.py
✅ Files skipped from review due to trivial changes (3)
  • .claude/hooks/README.md
  • .claude/agents/README.md
  • .claude/agents/ci-agent.md

Comment thread .claude/skills/prow-ci/SKILL.md Outdated
- Make pre-edit.sh canonicalization portable across GNU/BSD/macOS
  - Add python fallback for path normalization
  - Works with non-existent files
- Fix stop-prek-validation.sh to explicitly validate changed files
  - Prevents validation scope ambiguity
  - Validates staged + unstaged + untracked files
- Complete prow-ci SKILL.md title with operator name

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@devppratik
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 3, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

- Copy latest analyze_failure.py and fetch_prow_artifacts.py from AAO
- Fix gitleaks: narrow test file allowlist to testdata dirs
- Remove broad .*_test.go pattern that disabled scanning for all test files
Copy link
Copy Markdown
Contributor

@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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.claude/skills/prow-ci/fetch_prow_artifacts.py (1)

61-75: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Catch FileNotFoundError when gcloud CLI is missing.

When gcloud is not installed, subprocess.run() raises FileNotFoundError, which crashes the script with an unclear traceback instead of a helpful error message.

🛠️ Proposed fix
 def download_from_gcs(gcs_path, local_path):
     """Download a file from GCS using gcloud storage cp."""
     try:
         os.makedirs(os.path.dirname(local_path), exist_ok=True)
         cmd = [
             'gcloud', 'storage', 'cp',
             gcs_path,
             local_path,
             '--no-user-output-enabled'
         ]
         subprocess.run(cmd, check=True, capture_output=True)
         return True
+    except FileNotFoundError:
+        print("Error: gcloud CLI not found. Install Google Cloud SDK first.", file=sys.stderr)
+        return False
     except subprocess.CalledProcessError as e:
         print(f"Warning: Could not download {gcs_path}: {e.stderr.decode()}", file=sys.stderr)
         return False
🤖 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/fetch_prow_artifacts.py around lines 61 - 75,
download_from_gcs currently only catches subprocess.CalledProcessError so a
missing gcloud executable (which raises FileNotFoundError) will crash; update
download_from_gcs to also catch FileNotFoundError and print a clear stderr
message (including the gcs_path and instruction that gcloud CLI is not found)
then return False, keeping existing behavior for CalledProcessError in the
except block or via a combined except for (subprocess.CalledProcessError,
FileNotFoundError) to ensure the function never raises when gcloud is missing.
🤖 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/hooks/pre-edit.sh:
- Around line 33-57: The python fallback currently embeds $FILE and $REPO_ROOT
directly into the -c string which allows command injection; change the
python3/python invocations to pass the paths as safe shell arguments (e.g., use
sys.argv) instead of interpolating them into the code string so that CANONICAL
is computed from python using argv[1] and argv[2]; update the two places that
call python3 -c and python -c to call python with a short script that reads
sys.argv (or use a here-doc) and ensure FILE and REPO_ROOT are passed as quoted
positional parameters to avoid shell interpretation, keeping the rest of the
surrounding CANONICAL assignment and checks intact.

In @.claude/hooks/stop-prek-validation.sh:
- Around line 79-88: Replace whitespace-splitting file handling with
null-delimited output and null-safe xargs: produce CHANGED_FILES using git diff
--name-only -z and git ls-files --others --exclude-standard -z (instead of plain
git commands), and when invoking prek use xargs -0 (or pipe the null-delimited
CHANGED_FILES via printf '%s\0' into xargs -0) so the PREK_OUTPUT assignment
that currently does echo "$CHANGED_FILES" | xargs prek run --config
hack/prek.ci.toml --files 2>&1 becomes null-safe; keep the same empty-check
logic around CHANGED_FILES/PREK_OUTPUT but ensure you handle the null-delimited
form correctly when testing for empty.

---

Outside diff comments:
In @.claude/skills/prow-ci/fetch_prow_artifacts.py:
- Around line 61-75: download_from_gcs currently only catches
subprocess.CalledProcessError so a missing gcloud executable (which raises
FileNotFoundError) will crash; update download_from_gcs to also catch
FileNotFoundError and print a clear stderr message (including the gcs_path and
instruction that gcloud CLI is not found) then return False, keeping existing
behavior for CalledProcessError in the except block or via a combined except for
(subprocess.CalledProcessError, FileNotFoundError) to ensure the function never
raises when gcloud is missing.
🪄 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 YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 3c96e500-db36-4185-94f2-a335ed68665d

📥 Commits

Reviewing files that changed from the base of the PR and between 435411c and 77377ba.

📒 Files selected for processing (6)
  • .claude/hooks/pre-edit.sh
  • .claude/hooks/stop-prek-validation.sh
  • .claude/skills/prow-ci/SKILL.md
  • .claude/skills/prow-ci/analyze_failure.py
  • .claude/skills/prow-ci/fetch_prow_artifacts.py
  • .gitleaks.toml
✅ Files skipped from review due to trivial changes (1)
  • .claude/skills/prow-ci/SKILL.md

Comment thread .claude/hooks/pre-edit.sh
Comment thread .claude/hooks/stop-prek-validation.sh
Changes:
- Added SessionStart hook to .claude/settings.json that runs session-start-prek-setup.sh
- Copied session-start-prek-setup.sh hook script to .claude/hooks/
- Updated docs-agent.md to include .claude/settings.json in sync triggers

The SessionStart hook ensures prek is installed and configured when Claude Code
starts a session, improving developer experience.

Related: CodeRabbit review feedback on hook configuration documentation
@krishvoor
Copy link
Copy Markdown
Member

/test validate

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Jun 5, 2026

@devppratik: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/validate b5537cb link true /test validate

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

do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants