Skip to content

Add learn-from-code-review skill#87

Open
neubig wants to merge 5 commits intomainfrom
openhands/learn-from-code-review-skill
Open

Add learn-from-code-review skill#87
neubig wants to merge 5 commits intomainfrom
openhands/learn-from-code-review-skill

Conversation

@neubig
Copy link
Contributor

@neubig neubig commented Mar 3, 2026

Summary

This PR adds a new skill that distills code review feedback from GitHub PRs into reusable skills and repository guidelines.

Closes #86

What this skill does

The learn-from-code-review skill analyzes PR review comments from a repository and extracts recurring patterns of feedback. These patterns are transformed into:

  • Repository-specific skills (.openhands/skills/) for domain-specific patterns (e.g., database queries, API design)
  • AGENTS.md updates for general coding conventions and best practices

Workflow

  1. Fetch PR review comments from the target repository using GitHub API
  2. Filter out noise (bot comments, low-signal responses like "LGTM", short comments)
  3. Categorize comments by type (security, performance, style, architecture, etc.)
  4. Identify recurring patterns (3+ similar comments)
  5. Generate skills and/or AGENTS.md updates
  6. Create a draft PR with the proposed changes

Trigger phrases

  • /learn-from-reviews
  • "learn from code reviews"
  • "distill reviews"

Files changed

  • skills/learn-from-code-review/SKILL.md - Main skill definition
  • skills/learn-from-code-review/README.md - Documentation
  • marketplaces/default.json - Added skill to marketplace

Testing

  • ✅ All existing tests pass (test_skills_have_readme.py)
  • ✅ Marketplace JSON is valid

Evidence

The skill was tested on the OpenHands/software-agent-sdk repository. The workflow analyzed 15 merged PRs from the past 30 days, processed 25+ review comments, and identified 4 recurring patterns.

Test PR: OpenHands/software-agent-sdk#2280

The test generated:

  • A new skill: .openhands/skills/eval-risk-assessment/SKILL.md
  • Updates to AGENTS.md with a Code Review Learnings section

Related

  • Inspired by dstl-code-review
  • Related skills: code-review, github-pr-review, skill-creator, agent-memory

This skill distills code review feedback from GitHub PRs into reusable
skills and repository guidelines. It analyzes review comments, filters
out noise, identifies recurring patterns, and generates:

- Repository-specific skills for domain patterns
- AGENTS.md updates for general conventions

Fixes #86

Co-authored-by: openhands <openhands@all-hands.dev>
@neubig neubig marked this pull request as ready for review March 3, 2026 14:04
Copy link

@all-hands-bot all-hands-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Acceptable - Interesting concept, but the execution needs refinement. The workflow is overly complex and lacks validation. See inline comments for specifics.

@neubig
Copy link
Contributor Author

neubig commented Mar 3, 2026

@OpenHands read all the review comments and reflect them

@openhands-ai
Copy link

openhands-ai bot commented Mar 3, 2026

I'm on it! neubig can track my progress at all-hands.dev

- Add Error Handling section documenting edge cases (few PRs, no patterns,
  token access issues, gh CLI unavailable)
- Remove manual git commands, use create_pr tool instead
- Replace Configuration Options table with simple defaults statement
  (30 days lookback)

Co-authored-by: openhands <openhands@all-hands.dev>
@openhands-ai
Copy link

openhands-ai bot commented Mar 3, 2026

Summary of Work Completed

I read all review comments on PR #87 and implemented the changes requested by @neubig based on his responses to the code review bot's feedback.

Changes Made to skills/learn-from-code-review/SKILL.md:

Review Feedback Action Taken
Add error handling for edge cases ✅ Added "Error Handling" section covering: few PRs, no patterns, token access issues, gh CLI unavailable
Remove manual git commands, use create_pr tool ✅ Simplified Step 6 from ~15 lines of git commands to a single instruction to use create_pr
Remove Configuration Options table ✅ Replaced with simple "Defaults" section stating 30-day lookback
Test skill on real repository with evidence ✅ Ran workflow on OpenHands/software-agent-sdk, created evidence PR

Evidence Generated:

Commits Pushed:

  • d80dd04 - "Address review feedback on learn-from-code-review skill"
  • PR description updated to include Evidence section

All requested changes have been implemented, pushed to the branch, and the PR has been updated. The changes are concise and directly address only the feedback items that @neubig agreed should be fixed.

Focus generated skills on actionable guidelines rather than
implementation details of how they were created.

Co-authored-by: openhands <openhands@all-hands.dev>
AGENTS.md typically already contains general coding guidelines,
so generated output should focus on creating focused skill files.

Co-authored-by: openhands <openhands@all-hands.dev>
Make it explicit that producing no skills is fine when the codebase
already has strong conventions or comments don't cluster into
recurring themes.

Co-authored-by: openhands <openhands@all-hands.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Learn from Code Review" Skill

3 participants