OpenHands can enhance every phase of your software development lifecycle (SDLC), from planning through deployment. This guide shows how to integrate OpenHands into your development workflows effectively.
Integration with Development Workflows
Planning Phase
Use OpenHands during planning to accelerate technical decisions:
Technical specification assistance:
Create a technical specification for adding search functionality:
Requirements from product:
- Full-text search across products and articles
- Filter by category, price range, and date
- Sub-200ms response time at 1000 QPS
Provide:
1. Architecture options (Elasticsearch vs. PostgreSQL full-text)
2. Data model changes needed
3. API endpoint designs
4. Estimated implementation effort
5. Risks and mitigations
Sprint planning support:
Review these user stories and create implementation tasks:
Story 1: As a user, I can reset my password via email
Story 2: As an admin, I can view user activity logs
For each story, create:
- Technical subtasks
- Estimated effort (hours)
- Dependencies on other work
- Testing requirements
Development Phase
OpenHands excels during active development:
Feature implementation:
- Write new features with clear specifications
- Follow existing code patterns automatically
- Generate tests alongside code
- Create documentation as you go
Bug fixing:
- Analyze error logs and stack traces
- Identify root causes
- Implement fixes with regression tests
- Document the issue and solution
Code improvement:
- Refactor for clarity and maintainability
- Optimize performance bottlenecks
- Update deprecated APIs
- Improve error handling
Testing Phase
Automate test creation and improvement:
Add comprehensive tests for the UserService module:
Current coverage: 45%
Target coverage: 85%
1. Analyze uncovered code paths
2. Write unit tests for edge cases
3. Add integration tests for API endpoints
4. Create test data factories
5. Document test scenarios
Review Phase
Accelerate code reviews:
Review this PR for our coding standards:
Check for:
1. Security issues (SQL injection, XSS, etc.)
2. Performance concerns
3. Test coverage adequacy
4. Documentation completeness
5. Adherence to our style guide
Provide actionable feedback with severity ratings.
Deployment Phase
Assist with deployment preparation:
Prepare for production deployment:
1. Review all changes since last release
2. Check for breaking API changes
3. Verify database migrations are reversible
4. Update the changelog
5. Create release notes
6. Identify rollback steps if needed
CI/CD Integration
GitHub Actions Integration
Integrate OpenHands into your GitHub workflows:
# .github/workflows/openhands-assist.yml
name: OpenHands Assist
on:
issues:
types: [opened, labeled]
pull_request:
types: [opened, synchronize]
issue_comment:
types: [created]
jobs:
auto-review:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: OpenHands PR Review
uses: openhands/review-action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
issue-triage:
if: github.event_name == 'issues' && contains(github.event.issue.labels.*.name, 'needs-analysis')
runs-on: ubuntu-latest
steps:
- uses: openhands/triage-action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
Automated PR checks:
- Code review on every PR
- Test coverage verification
- Security scanning
- Documentation checks
GitLab CI Integration
# .gitlab-ci.yml
stages:
- review
- test
- deploy
openhands-review:
stage: review
script:
- openhands review --format gitlab
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
openhands-test-generation:
stage: test
script:
- openhands generate-tests --coverage-target 80
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml
Jenkins Integration
// Jenkinsfile
pipeline {
agent any
stages {
stage('OpenHands Analysis') {
steps {
script {
sh 'openhands analyze --output analysis.json'
}
}
}
stage('Review') {
when {
changeRequest()
}
steps {
script {
sh 'openhands review --format jenkins'
}
}
}
}
post {
always {
archiveArtifacts artifacts: 'analysis.json'
}
}
}
CircleCI:
version: 2.1
jobs:
openhands-review:
docker:
- image: openhands/cli:latest
steps:
- checkout
- run:
name: Run OpenHands Review
command: openhands review --format circleci
Azure DevOps:
trigger:
- main
pool:
vmImage: 'ubuntu-latest'
steps:
- task: Bash@3
inputs:
targetType: 'inline'
script: |
openhands review --format azure
Team Workflows
Solo Developer Workflows
For individual developers:
Daily workflow:
- Morning review: Have OpenHands analyze overnight CI results
- Feature development: Use OpenHands for implementation
- Pre-commit: Request review before pushing
- Documentation: Generate/update docs for changes
Best practices:
- Set up automated reviews on all PRs
- Use OpenHands for boilerplate and repetitive tasks
- Keep AGENTS.md updated with project patterns
Small Team Workflows
For teams of 2-10 developers:
Collaborative workflow:
Team Member A: Creates feature branch, writes initial implementation
OpenHands: Reviews code, suggests improvements
Team Member B: Reviews OpenHands suggestions, approves or modifies
OpenHands: Updates documentation, adds missing tests
Team: Merges after final human review
Communication integration:
- Slack notifications for OpenHands findings
- Automatic issue creation for bugs found
- Weekly summary reports
Enterprise Team Workflows
For larger organizations:
Governance and oversight:
- Configure approval requirements for OpenHands changes
- Set up audit logging for all AI-assisted changes
- Define scope limits for automated actions
- Establish human review requirements
Scale patterns:
Central Platform Team:
├── Defines OpenHands policies
├── Manages integrations
└── Monitors usage and quality
Feature Teams:
├── Use OpenHands within policies
├── Customize for team needs
└── Report issues to platform team
Best Practices
Code Review Integration
Set up effective automated reviews:
# .openhands/review-config.yml
review:
focus_areas:
- security
- performance
- test_coverage
- documentation
severity_levels:
block_merge:
- critical
- security
require_response:
- major
informational:
- minor
- suggestion
ignore_patterns:
- "*.generated.*"
- "vendor/*"
Pull Request Automation
Automate common PR tasks:
| Trigger | Action |
|---|
| PR opened | Auto-review, label by type |
| Tests fail | Analyze failures, suggest fixes |
| Coverage drops | Identify missing tests |
| PR approved | Update changelog, check docs |
Quality Gates
Define automated quality gates:
quality_gates:
- name: test_coverage
threshold: 80%
action: block_merge
- name: security_issues
threshold: 0 critical
action: block_merge
- name: code_review_score
threshold: 7/10
action: require_review
- name: documentation
requirement: all_public_apis
action: warn
Automated Testing
Integrate OpenHands with your testing strategy:
Test generation triggers:
- New code without tests
- Coverage below threshold
- Bug fix without regression test
- API changes without contract tests
Example workflow:
on:
push:
branches: [main]
jobs:
ensure-coverage:
steps:
- name: Check coverage
run: |
COVERAGE=$(npm test -- --coverage | grep "All files" | awk '{print $10}')
if [ "$COVERAGE" -lt "80" ]; then
openhands generate-tests --target 80
fi
Common Integration Patterns
Pre-Commit Hooks
Run OpenHands checks before commits:
# .git/hooks/pre-commit
#!/bin/bash
# Quick code review
openhands review --quick --staged-only
if [ $? -ne 0 ]; then
echo "OpenHands found issues. Review and fix before committing."
exit 1
fi
Post-Commit Actions
Automate tasks after commits:
# .github/workflows/post-commit.yml
on:
push:
branches: [main]
jobs:
update-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Update API docs
run: openhands update-docs --api
- name: Commit changes
run: |
git add docs/
git commit -m "docs: auto-update API documentation" || true
git push
Scheduled Tasks
Run regular maintenance:
# Weekly dependency check
on:
schedule:
- cron: '0 9 * * 1' # Monday 9am
jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check dependencies
run: |
openhands check-dependencies --security --outdated
- name: Create issues
run: openhands create-issues --from-report deps.json
Event-Triggered Workflows
Respond to specific events:
# Respond to new issues
on:
issues:
types: [opened]
jobs:
triage:
if: contains(github.event.issue.labels.*.name, 'bug')
runs-on: ubuntu-latest
steps:
- name: Analyze bug report
uses: openhands/triage-action@v1
with:
action: |
Analyze this bug report and:
1. Identify likely affected code
2. Suggest reproduction steps
3. Estimate severity
4. Recommend assignee based on code ownership
Start with simple integrations and expand as your team becomes comfortable. Not every workflow needs automation—focus on high-impact, repetitive tasks first.