You are tasked with analyzing the feedback from a just-approved pull request and extracting generalized lessons that should be remembered for future development. Your goal is to update the CLAUDE.md file with these lessons to help prevent similar issues in the future.
- Review the PR comments and feedback - Look through all review comments, suggestions, and discussions EXCEPT those written by Claude. Never consider Claude's comments for lessons.
- Extract generalizable lessons - Focus on patterns and principles that apply beyond this specific PR
- Check existing guidelines - Verify if the lesson is already documented in CLAUDE.md
- Update CLAUDE.md - Add new lessons or emphasize existing ones that weren't followed
- Generalizable - Applies to multiple scenarios, not just this specific code
- Actionable - Provides clear guidance on what to do or avoid
- Specific enough - Not so vague that it's unhelpful
- Pattern-based - Identifies recurring issues or best practices
- "Always initialize repositories in the controller constructor, not in individual methods"
- "Use expect.assertions(n) in tests with conditional assertions to ensure all paths are tested"
- "Import test dependencies at the top of the file, not inside test cases"
- Overly specific fixes that only apply to one file
- Lessons that duplicate existing extensive documentation
- Minor style preferences already covered by linting
- Avoid anything written by Claude. Claude is an automated assistant and its comments should not be considered for lessons.
- Read through all PR review comments and feedback, excluding those by Claude.
- Identify patterns or principles that emerged from the review
- For each potential lesson, check if it's already in CLAUDE.md
- If new, add it to the appropriate section in CLAUDE.md
- If existing but not followed, consider emphasizing it or adding an example
- Group related lessons together for clarity
Update the CLAUDE.md file with:
- New lessons in the appropriate sections
- Enhanced examples or emphasis for existing lessons that were missed
- Clear, concise guidelines that will help future development
Important Instructions:
- Do NOT leave any new comments on the PR
- Simply update the CLAUDE.md file and commit your changes directly
- Only make changes if there are meaningful lessons to add
- If no lessons are worth documenting, do nothing (no comments needed)
Remember: The goal is continuous improvement. Not every PR will have lessons worth documenting, and that's okay. Focus on meaningful patterns that will genuinely help the team avoid similar issues in the future.