Skip to content

NO-JIRA: claude: Improve AGENTS.md and add agents for storing project knowledge#2251

Merged
openshift-merge-bot[bot] merged 2 commits intoopenshift:mainfrom
tchap:store-learning-in-AGENTS.md
Apr 16, 2026
Merged

NO-JIRA: claude: Improve AGENTS.md and add agents for storing project knowledge#2251
openshift-merge-bot[bot] merged 2 commits intoopenshift:mainfrom
tchap:store-learning-in-AGENTS.md

Conversation

@tchap
Copy link
Copy Markdown
Contributor

@tchap tchap commented Apr 13, 2026

Store what my Claude learned from the past sessions.
The most beneficial are the details regarding tests,
that is something that can get repetitive to tell the LLM.

Store what my Claude learned from the past sessions.
The most beneficial are the details regarding tests,
that is something that can get repetitive to tell the LLM.
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Apr 13, 2026
@openshift-ci-robot
Copy link
Copy Markdown

@tchap: This pull request explicitly references no jira issue.

Details

In response to this:

Store what my Claude learned from the past sessions.
The most beneficial are the details regarding tests,
that is something that can get repetitive to tell the LLM.

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 added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 13, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 13, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 13, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 9992aa42-3ab6-4a76-ad2c-63d8d34c0272

📥 Commits

Reviewing files that changed from the base of the PR and between 07a639a and d59339a.

📒 Files selected for processing (3)
  • .claude/agents/learn-history.md
  • .claude/agents/learn-session.md
  • README.md
✅ Files skipped from review due to trivial changes (2)
  • README.md
  • .claude/agents/learn-history.md

Walkthrough

This PR adds two new Claude agent configuration files for session and history learning, updates AGENTS.md with build/test timing and testing guidance, and adds a "Claude Code" section to README.md listing available agents.

Changes

Cohort / File(s) Summary
New Agent Configurations
.claude/agents/learn-history.md, .claude/agents/learn-session.md
Added learn-history and learn-session agent definitions: YAML/frontmatter metadata, model/tool constraints, workflows for extracting session/user corrections and reusable patterns, routing findings to AGENTS.md / agent-specific files / project memory / nowhere, and requirement to propose (not write) changes for approval.
Documentation Updates
AGENTS.md, README.md
AGENTS.md: added rough timing estimates for make oc/build/test/verify, clarified full build includes tools, added "Running Tests for a Single Package" with go test ./pkg/cli/admin/policy/... guidance and testing conventions (use typed builders, go-cmp with expected objects, fake.NewClientset action recording). README.md: added "Claude Code" section linking to agent docs and a table of available agents.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

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

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

@tchap tchap force-pushed the store-learning-in-AGENTS.md branch from b62b929 to 07a639a Compare April 13, 2026 10:20
@tchap tchap marked this pull request as ready for review April 13, 2026 10:27
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 13, 2026
@openshift-ci openshift-ci bot requested review from atiratree and ingvagabund April 13, 2026 10:27
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: 4

🧹 Nitpick comments (1)
AGENTS.md (1)

136-136: Update fake client guidance to reflect actual repository patterns.

Line 136 is overly specific and misleading. Codebase tests predominantly use NewSimpleClientset() from various fake client packages (image, build, template, etc.), not only NewClientset(). Generalize the documentation to guide contributors toward the appropriate constructor for their client package while maintaining the Actions() assertion guidance.

Proposed update
-- **Fake clients:** use `fake.NewClientset()` with action recording to verify API call options
+- **Fake clients:** use the fake client constructor provided by that client package (for example, `fake.NewSimpleClientset()` or `fake.NewClientset()`), and validate recorded `Actions()` to verify API call options
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@AGENTS.md` at line 136, Update the guidance about fake clients to avoid
naming a single constructor: replace the specific reference to
fake.NewClientset() with a general recommendation that contributors use the
appropriate fake client constructor for the API group they’re testing (e.g.,
NewSimpleClientset() from the fake package for image, build, template clients)
and keep the existing advice to use Actions() to assert recorded actions; ensure
mentions include the concrete symbol examples NewSimpleClientset,
fake.NewClientset, and Actions() so readers can locate relevant constructors in
their client package.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.claude/agents/learn-history.md:
- Line 4: The frontmatter tools list currently includes mutation tools ("Edit"
and "Write") which must be removed for an analysis-first, approval-gated flow;
update the frontmatter line containing "tools: Read, Grep, Glob, Bash, Edit,
Write" to remove "Edit" and "Write" so it reads only the read-only tools (e.g.,
"Read, Grep, Glob, Bash"), preserving the rest of the metadata and formatting
and ensuring any consumers expecting a tools list still parse it correctly.
- Line 23: The logic currently reads every project's MEMORY.md via a wildcard,
causing cross-project data bleed; change it to load only the current project's
memory file by replacing the wildcard read with a lookup that uses the current
project identifier (e.g., projectId or CURRENT_PROJECT) to construct the
MEMORY.md path for this project, validate that file exists before reading, and
skip or log a safe message if absent so no other projects' MEMORY.md are ever
read (search for the line referencing MEMORY.md and the wildcard and update that
behavior).

In @.claude/agents/learn-session.md:
- Line 4: The agent frontmatter currently includes mutation tools ("Edit",
"Write") in the tools list (tools: Read, Grep, Glob, Bash, Edit, Write) which
conflicts with the agent's proposal-only policy; remove "Edit" and "Write" from
that tools list so only read-only tools remain (e.g., leave Read, Grep, Glob,
Bash) to enforce least-privilege and prevent accidental writes.
- Line 27: The memory read currently targets
"~/.claude/projects/*/memory/MEMORY.md" which can pull in other projects'
memory; change the glob to read only the current project's memory (e.g., use the
current project path variable like projectPath, projectRoot or PROJECT_DIR) and
build the path as path.join(projectPath, 'memory', 'MEMORY.md') or equivalent;
update the logic that calls the glob/read so functions like readMemoryIndex or
loadProjectMemory reference the single-project path rather than the wildcard
pattern.

---

Nitpick comments:
In `@AGENTS.md`:
- Line 136: Update the guidance about fake clients to avoid naming a single
constructor: replace the specific reference to fake.NewClientset() with a
general recommendation that contributors use the appropriate fake client
constructor for the API group they’re testing (e.g., NewSimpleClientset() from
the fake package for image, build, template clients) and keep the existing
advice to use Actions() to assert recorded actions; ensure mentions include the
concrete symbol examples NewSimpleClientset, fake.NewClientset, and Actions() so
readers can locate relevant constructors in their client package.
🪄 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), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 914e1094-9017-4c85-810a-f2dacc850e2c

📥 Commits

Reviewing files that changed from the base of the PR and between 66dee73 and 07a639a.

📒 Files selected for processing (4)
  • .claude/agents/learn-history.md
  • .claude/agents/learn-session.md
  • AGENTS.md
  • README.md

Comment thread .claude/agents/learn-history.md Outdated
Comment thread .claude/agents/learn-history.md Outdated
Comment thread .claude/agents/learn-session.md Outdated
Comment thread .claude/agents/learn-session.md Outdated
These agents can be used to store knowledge learned during the last
session or across all sessions in the repository files to gradulaly
evolve and improve Claude.
@tchap tchap force-pushed the store-learning-in-AGENTS.md branch from 07a639a to d59339a Compare April 13, 2026 10:57
@tchap
Copy link
Copy Markdown
Contributor Author

tchap commented Apr 13, 2026

/retitle NO-JIRA: claude: Improve AGENTS.md and add agents for storing project knowledge

@openshift-ci openshift-ci bot changed the title NO-JIRA: AGENTS.md: Add some minor improvements NO-JIRA: claude: Improve AGENTS.md and add agents for storing project knowledge Apr 13, 2026
@ardaguclu
Copy link
Copy Markdown
Member

Thank you
/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 13, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 13, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ardaguclu, tchap

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

The pull request process is described 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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 13, 2026
@tchap
Copy link
Copy Markdown
Contributor Author

tchap commented Apr 13, 2026

/verified bypass
/retest

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Apr 13, 2026
@openshift-ci-robot
Copy link
Copy Markdown

@tchap: The verified label has been added.

Details

In response to this:

/verified bypass
/retest

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-merge-bot
Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD 66dee73 and 2 for PR HEAD d59339a in total

@tchap
Copy link
Copy Markdown
Contributor Author

tchap commented Apr 14, 2026

/retest

@tchap
Copy link
Copy Markdown
Contributor Author

tchap commented Apr 14, 2026

WTH is happening with tests...

/retest

@tchap
Copy link
Copy Markdown
Contributor Author

tchap commented Apr 15, 2026

/retest

2 similar comments
@tchap
Copy link
Copy Markdown
Contributor Author

tchap commented Apr 15, 2026

/retest

@tchap
Copy link
Copy Markdown
Contributor Author

tchap commented Apr 16, 2026

/retest

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 16, 2026

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

@openshift-merge-bot openshift-merge-bot bot merged commit 8d2e625 into openshift:main Apr 16, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants