skills/learn-from-code-review/SKILL.md
Distill code review feedback from GitHub PRs into reusable skills and guidelines. This skill should be used when users ask to "learn from code reviews", "distill PR feedback", "improve coding standards", "extract learnings from reviews", or want to generate skills/guidelines from historical review comments.
npx skillsauth add openhands/extensions learn-from-code-reviewInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Analyze code review comments from GitHub pull requests and distill them into reusable skills or repository guidelines that improve future code quality.
Code review feedback contains valuable institutional knowledge that often gets buried across hundreds of PRs. This skill extracts meaningful patterns from review comments and transforms them into:
.openhands/skills/ for domain-specific patternsGITHUB_TOKEN environment variable must be setgh) should be availableDetermine the repository to analyze:
# Get current repo info
gh repo view --json nameWithOwner -q '.nameWithOwner'
If not in a repository, ask the user which repository to analyze.
Retrieve PR review comments from the repository:
# Fetch merged PRs from the last 30 days (adjustable)
gh pr list --repo {owner}/{repo} \
--state merged \
--limit 50 \
--json number,title,mergedAt
# For each PR, fetch review comments
gh api repos/{owner}/{repo}/pulls/{pr_number}/comments \
--jq '.[] | {body: .body, path: .path, user: .user.login, created_at: .created_at}'
# Also fetch review-level comments (not tied to specific lines)
gh api repos/{owner}/{repo}/pulls/{pr_number}/reviews \
--jq '.[] | select(.body != "") | {body: .body, user: .user.login, state: .state}'
Apply noise filtering to keep only meaningful feedback:
Exclude:
Categorize remaining comments by:
For each category with sufficient examples (3+ similar comments), identify:
If clear, actionable patterns emerge, generate focused skill files. If no clear patterns emerge, report this to the user—it's fine to produce no output when the codebase already has strong conventions or when review comments don't cluster into recurring themes.
When creating skills, place them in .openhands/skills/{domain-name}/SKILL.md:
---
name: database-queries
description: Database query patterns and best practices for this repository.
---
# Database Query Guidelines
### Always Use Parameterized Queries
[Pattern description with examples]
### Connection Pool Management
[Pattern description with examples]
Prefer skills over AGENTS.md updates, since AGENTS.md typically already contains general coding guidelines.
Use the create_pr tool to open a draft PR with the proposed changes. The PR description should include:
---
name: api-error-handling
description: API error handling patterns for this repository.
---
# API Error Handling
## Always Return Structured Errors
❌ Avoid:
```python
return {"error": str(e)}
✅ Prefer:
return {
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid input",
"details": {"field": "email", "reason": "Invalid format"}
}
}
logger.error(f"API error in {endpoint}: {e}", exc_info=True)
return error_response(e)
## Defaults
This workflow analyzes PRs from the past 30 days by default.
## Best Practices
1. **Run periodically** - Schedule monthly or quarterly to capture evolving patterns
2. **Review before merging** - Generated content is a draft; human review is essential
3. **Iterate** - Refine patterns based on team feedback
4. **Avoid duplication** - Check existing AGENTS.md and skills before adding
5. **Cite sources** - Reference PR numbers when documenting patterns
## Error Handling
Handle these common edge cases gracefully:
- **Repository has few PRs**: If fewer than 10 merged PRs exist in the timeframe, inform the user that there may not be enough data to identify patterns. Proceed with analysis but note the limited sample size.
- **No patterns emerge**: When comments don't cluster into recurring themes (common for well-established codebases), report this to the user and suggest either expanding the time range or that the codebase may already have strong conventions.
- **Token lacks repository access**: If the GitHub API returns 403/404, explain that the token may not have access to the repository and suggest checking token permissions.
- **`gh` CLI unavailable**: Fall back to direct GitHub API calls using `curl` with `$GITHUB_TOKEN`, or inform the user that `gh` needs to be installed.
## Limitations
- Only analyzes accessible repositories (requires appropriate permissions)
- Cannot capture verbal feedback from pair programming or meetings
- Patterns may reflect individual reviewer preferences vs. team consensus
- Historical comments may reference outdated code patterns
## Additional Resources
For posting structured code reviews, see the `github-pr-review` skill.
For creating new skills, see the `skill-creator` skill.
tools
Iterate on a GitHub pull request — drive it through CI, code review, and QA until it is merge-ready. Poll verification layers with `gh` CLI, diagnose and fix CI failures, address review feedback, retry flaky checks, push fixes, and repeat. The agent is the orchestration loop.
development
Guides technical explanations toward flowing, direct, conversational prose. This skill should be used for engineering chat, design discussion, architecture analysis, code-review explanations, and technical recommendations that should be concise without becoming fragmented or vague.
tools
This skill should be used when the user asks to "set up a Jira automation to create pull requests", "poll Jira for create-pr issues", "automatically create GitHub PRs from Jira tickets", "deploy a Jira issue-to-PR automation", "create a Jira to GitHub PR workflow", or mentions automating GitHub PR creation from a Jira label. Deploys a cron-based OpenHands automation that watches a Jira Cloud project for issues labeled with a configurable label (default: "create-pr") and spawns an agent conversation to create a GitHub pull request for each new issue found. The target GitHub repository is read from the body of the Jira ticket - no repo parameter is required at deploy time.
tools
This skill should be used when the user asks to "create an automation", "schedule a task", "set up a cron job", "webhook integration", "event-triggered automation", or mentions automations, scheduled tasks, cron scheduling, or webhook events in OpenHands Cloud.