chore: trim agent rules under context limit, add review patterns#1322
Conversation
CLAUDE.md exceeded the 40k-char context limit. Dedupe the Anti-Patterns table (remove ~17 rows that restated dedicated rule sections) and compress the Documentation Style and test-coverage-gate prose. Add three new anti-pattern rows mined from recent PR review feedback: fail-closed negative/health checks, kyverno-json/chainsaw assertion traps, and denylist-to-allowlist security gates. AGENTS.md is regenerated as the line-5+ mirror.
📝 WalkthroughWalkthroughThis pull request refines agent guidance rules across two documentation files: Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Suggested labels
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
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/CLAUDE.md:
- Around line 581-589: Update the sentence that currently reads "Block if `make
test-coverage` fails (enforces the project-wide 70% floor from `.settings.yaml`;
do not use per-package profiles for this check)." to use 75% instead of 70% so
it matches `.settings.yaml` and docs; i.e., change the documented project-wide
coverage floor in the "Test coverage gate" section to 75% (retain the rest of
the sentence and surrounding guidance).
🪄 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: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: 6f71b092-0226-4f67-b335-d3b0a4672e0c
📒 Files selected for processing (2)
.claude/CLAUDE.mdAGENTS.md
Coverage Report ✅
Coverage BadgeNo Go source files changed in this PR. |
Summary
Trim
.claude/CLAUDE.md(and itsAGENTS.mdmirror) back under the 40k-char context limit, and add three high-signal anti-pattern rows mined from recent PR review feedback.Motivation / Context
.claude/CLAUDE.mdhad grown to ~40.1k chars, exceeding the context-window limit that Claude Code warns about. The growth was concentrated in redundancy: ~17 rows of the Anti-Patterns table simply restated rules already explained in full in the dedicated sections (Error Wrapping, Context Propagation, HTTP Client/Server, Logging, Constants, Kubernetes Patterns, Test Isolation). A review of the last ~40 merged PRs also surfaced recurring reviewer feedback not yet codified.Fixes: N/A
Related: N/A
Type of Change
Component(s) Affected
docs/,examples/).claude/CLAUDE.md,AGENTS.md)Implementation Notes
AGENTS.mdregenerated as the line-5+ mirror; the unrelated label/issue-policy section (added by chore: fix stale label guidance, add issue-type policy #1315 onmain) is untouched.Testing
./tools/check-agents-sync # AGENTS.md in sync with .claude/CLAUDE.md (line 5+)No Go sources changed, so the coverage/lint Go gates do not apply. The relevant merge gate is
check-agents-sync(part ofmake lint), verified locally.Risk Assessment
Rollout notes: N/A
Checklist
make testwith-race) — N/A, no Go changescheck-agents-syncverified)git commit -S)