-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Refactor CLAUDE.md: add quality gates, reduce redundancy #14901
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This comment has been minimized.
This comment has been minimized.
Analyzed the last 25 PRs to identify patterns where better guidance could have prevented iteration. Key findings: - PRs had lint failures caught after submission - with_items→loop conversions broke list flattening - Missing input validation and explicit file modes - Duplicate DNS documentation in 3 places Changes: - Add Quality Gates section with mandatory pre-submission checks - Add Design Requirements checklist (validate inputs, explicit modes) - Add Ansible Pitfalls section (with_items vs loop, path variables) - Add Self-Review Checklist - Consolidate DNS architecture from 3 sections into 1 - Remove redundant sections (Final Notes, User Profiles, duplicate philosophy) - Condense linting rules into table format Result: 496 → 307 lines (-38%) while adding actionable new guidance 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1af3f0f to
10824b4
Compare
This comment has been minimized.
This comment has been minimized.
Analysis of PRs 26-50 revealed that 28% (7 PRs) were fixing Ansible 12 compatibility issues caused by jinja2_native mode being always enabled. Added guidance for: - Boolean conditionals requiring actual booleans - No nested templates in lookup() - JSON files needing explicit | from_json parsing - default() not triggering on empty strings (need true param) - Complex Jinja loops breaking in set_fact Also added "Undocumented workarounds" to What to Avoid section based on Scaleway/Vultr upstream module bug patterns. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
- Update Ansible version from "v9.x" to "v12+" for consistency with Jinja2 native mode guidance - Add one-line explanation to OpenSSL snippet for clarity 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This comment was marked as outdated.
This comment was marked as outdated.
- Remove "CRITICAL" and "Critical Gotcha" labels - Change "90% of routing issues are DNS" to "Many routing issues" - Add link to docs/troubleshooting.md for comprehensive diagnostics 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This comment was marked as outdated.
This comment was marked as outdated.
Change ambiguous "Verify before encoding" (encoding could mean data encoding) to clearer "Test assumptions - run the code before committing" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Code Review - CLAUDE.md RefactorThis is an excellent refactoring that significantly improves the utility of CLAUDE.md for LLM-assisted development. The changes are well-structured, evidence-based, and align perfectly with the project's philosophy. ✅ Strengths1. Quality Gates Section (Lines 51-68)
2. Jinja2 Native Mode Section (Lines 163-211)
3. Self-Review Checklist (Lines 96-105)
4. Ansible Pitfalls Section (Lines 107-161)
5. Information Architecture
🔍 Observations & Minor Suggestions1. Design Requirements Section (Lines 70-78)
2. Writing Effective Tests Section (Lines 312-331)
3. DNS Architecture Section (Lines 213-253)
4. Philosophy Section (Lines 19-26)
5. Missing Version Info
🎯 Consistency & StyleExcellent adherence to documentation principles:
One minor inconsistency:
🔒 Security & Best Practices
📊 Impact AssessmentBased on the PR description's analysis: Prevented future issues:
Measurable improvements:
Potential savings:
✅ Final RecommendationAPPROVE - This refactoring is ready to merge. Rationale:
The minor suggestions above are enhancements for future iterations, not blockers. The current state is a significant improvement over the existing documentation. Post-merge suggestion: Track whether PR iteration counts decrease after this change is merged to validate the hypothesis that better guidance reduces review cycles. |
Summary
Analyzed the last 50 PRs to identify patterns where better CLAUDE.md guidance could have prevented iteration.
PRs 1-25 Analysis
with_items→loopflattening bug, path issuesPRs 26-50 Analysis
jinja2_nativemode enabled by defaultKey finding: 28% of PRs 26-50 were Ansible 12 compatibility fixes.
Changes
Added (from PRs 1-25 analysis):
with_itemsvsloop, path variables,ignore_errorsvsfailed_whenAdded (from PRs 26-50 analysis):
lookup()| from_jsonfilterdefault()needstrueparam for empty stringsset_factConsolidated:
Removed:
Results
Test plan
🤖 Generated with Claude Code