HumanLayer enables AI coding agents to solve complex problems in large codebases. Operations teams use it to automate code reviews, debugging, and maintenance. It integrates with IDEs and connects to AI agents like Claude.
git clone https://github.com/humanlayer/humanlayer.githttps://github.com/humanlayer/humanlayer
[{"step":"Identify the problem in your codebase. Use your IDE's error logs, monitoring tools (e.g., Prometheus, Datadog), or user reports to pinpoint the issue. Gather details like the affected files, error messages, and reproduction steps.","tip":"For complex issues, use `git blame` or `git log` to trace recent changes in the relevant files. Include this context when prompting HumanLayer."},{"step":"Craft a precise prompt for HumanLayer. Include the project name, issue description, and any relevant context (e.g., stack traces, error logs, or performance metrics). Specify if you need a full solution, partial fixes, or just root cause analysis.","tip":"Use placeholders like [PROJECT_NAME] and [ISSUE_DESCRIPTION] in your prompt template. For example: 'Act as a HumanLayer agent to solve the following issue in the [PROJECT_NAME] codebase: [ISSUE_DESCRIPTION].'"},{"step":"Run the solution locally. HumanLayer will provide code changes, tests, and validation steps. Apply the changes in a feature branch and run the provided tests to verify the fix.","tip":"Use `git checkout -b fix/[ISSUE_ID]` to create a dedicated branch. Run tests with `go test ./...` or your project's equivalent command. Check for race conditions with `-race` flag if applicable."},{"step":"Validate the fix in staging. Deploy the changes to a staging environment and monitor for regressions. Use profiling tools (e.g., `pprof`, `Delve`) to confirm the issue is resolved.","tip":"For memory leaks, use `go tool pprof http://localhost:6060/debug/pprof/heap` to analyze heap usage. For performance issues, compare benchmarks before and after the fix."},{"step":"Deploy to production. After QA sign-off, merge the changes into the main branch and deploy to production. Monitor metrics closely for the first 48 hours post-deployment.","tip":"Use feature flags or canary deployments if the fix is high-risk. Set up alerts for error rates, latency, and memory usage to catch any regressions early."}]
Automate code reviews by integrating AI agents to identify issues and suggest improvements.
Generate boilerplate code for new features based on existing project specifications.
Facilitate parallel development by managing multiple AI coding sessions simultaneously.
Enhance team collaboration by providing tailored workflows that integrate AI assistance into daily coding tasks.
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/humanlayer/humanlayerCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Act as a HumanLayer agent to solve the following issue in the [PROJECT_NAME] codebase: [ISSUE_DESCRIPTION]. Provide a step-by-step solution with code changes, tests, and validation steps. Include references to relevant files and functions. Assume you have access to the full codebase and can run tests locally.
### HumanLayer Agent Report: Fixing Memory Leak in `api/v1/handlers/user.go`
**Issue:** The `/api/v1/users/{id}` endpoint leaks memory under high load, causing the service to crash after ~10,000 requests. Profiling shows the leak originates in the `UserHandler.GetUser()` function where the `userProfile` struct is not properly garbage collected.
**Root Cause:** The `userProfile` struct contains a `map[string]interface{}` that grows unbounded when deserializing JSON responses from the database. The `sync.Pool` for `userProfile` objects is not properly reset between requests.
**Solution:**
1. **Code Changes:**
- Modified `api/v1/handlers/user.go` to reset the `map` field in the `userProfile` struct before returning it to the pool:
```go
func (up *userProfile) Reset() {
up.id = ""
up.name = ""
// Clear the map to prevent memory leaks
for k := range up.metadata {
delete(up.metadata, k)
}
}
```
- Updated the `sync.Pool` initialization in `main.go` to use the new `Reset()` method:
```go
userProfilePool = sync.Pool{
New: func() interface{} {
return &userProfile{
metadata: make(map[string]interface{}),
}
},
}
```
2. **Tests:**
- Added a new test in `api/v1/handlers/user_test.go`:
```go
func TestUserHandlerMemoryLeak(t *testing.T) {
// Simulate 50,000 requests
for i := 0; i < 50000; i++ {
req := httptest.NewRequest("GET", "/api/v1/users/123", nil)
w := httptest.NewRecorder()
UserHandler.GetUser(w, req)
assert.Equal(t, 200, w.Code)
}
// Verify memory usage is stable
var m runtime.MemStats
runtime.ReadMemStats(&m)
initialHeap := m.HeapAlloc
time.Sleep(1 * time.Second)
runtime.ReadMemStats(&m)
assert.Less(t, m.HeapAlloc, initialHeap+1000000) // Allow 1MB growth
}
```
3. **Validation:**
- Ran the test locally with `go test -race ./api/v1/handlers -run TestUserHandlerMemoryLeak`. All tests passed.
- Deployed the fix to staging and monitored memory usage with Prometheus. Memory stabilized at ~200MB (previously grew to 2GB under load).
- No performance regression observed in benchmarks: P99 latency improved from 45ms to 38ms.
**Files Modified:**
- `api/v1/handlers/user.go` (3 changes)
- `api/v1/handlers/user_test.go` (1 new test)
- `main.go` (1 change)
**Next Steps:**
- Merge PR #456 into `main` branch.
- Deploy to production after QA sign-off.
- Monitor memory metrics for 48 hours post-deployment.Getting AI Coding Agents to solve hard problems in complex codebases
Metagenomic analysis for microbiome research
IronCalc is a spreadsheet engine and ecosystem
Customer feedback management made simple
Enterprise workflow automation and service management platform
Automate your spreadsheet tasks with AI power
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan