Amber is a background agent that automatically handles GitHub issues and creates pull requests. This system allows team members to trigger automated fixes, refactoring, and test additions without requiring direct access to Claude Code.
graph LR
A[Create Issue] --> B[Add Label]
B --> C[GHA Triggers]
C --> D[Amber Executes]
D --> E[Create PR]
E --> F[Review & Merge]
- Create Issue: Team member creates an issue using one of the Amber templates
- Add Label: Apply appropriate label (
amber:auto-fix,amber:refactor,amber:test-coverage) - GHA Triggers: GitHub Actions workflow detects label and starts Amber
- Amber Executes: Amber analyzes the issue and makes changes
- Create PR: Amber creates a pull request with the changes
- Review & Merge: Team reviews and merges the PR
Trigger Label: amber:auto-fix
Use For:
- Code formatting (gofmt, black, prettier)
- Linting violations
- Unused import removal
- Documentation formatting
Template: .github/ISSUE_TEMPLATE/amber-auto-fix.yml
Example:
Title: [Amber] Fix frontend linting errors
Label: amber:auto-fix
Body:
Issue: Frontend code fails eslint checks
Files: components/frontend/src/**/*.tsx
Fix Type: Linting ViolationsExpected Outcome: PR with automated formatting/linting fixes, all tests pass
Trigger Label: amber:refactor
Use For:
- Breaking large files into modules
- Extracting repeated patterns
- Replacing
context.TODO()with proper context - Improving error handling
Template: .github/ISSUE_TEMPLATE/amber-refactor.yml
Example:
Title: [Amber Refactor] Break sessions.go into modules
Label: amber:refactor
Body:
Current State: handlers/sessions.go is 3,495 lines
Desired State: Break into lifecycle.go, status.go, jobs.go, validation.go
Constraints: Maintain backward compatibility, all tests pass
Priority: P0Expected Outcome: PR with refactored code, detailed migration notes, all tests pass
Trigger Label: amber:test-coverage
Use For:
- Adding missing unit tests
- Contract tests for API endpoints
- Edge case coverage
- Improving test coverage percentage
Template: .github/ISSUE_TEMPLATE/amber-test-coverage.yml
Example:
Title: [Amber Tests] Add contract tests for sessions API
Label: amber:test-coverage
Body:
Untested Code: components/backend/handlers/sessions.go
Test Type: Contract Tests (API endpoints)
Test Scenarios:
- Happy path: create session with valid spec
- Error: missing API key
- Edge case: very long prompt
Target Coverage: 60%Expected Outcome: PR with new tests following project conventions (table-driven for Go)
You can trigger Amber by commenting on an existing issue using either:
/amber execute
Or simply mention Amber:
@amber
Both commands tell Amber to execute the proposal described in the issue body. Amber will read the full issue context and determine the appropriate action.
Use Cases:
- After discussing a refactoring approach in an issue, comment
@amberto have Amber implement it - Quick fixes without needing to add labels:
@amber please fix the linting errors in this file - Code review requests:
@amber review this approach and suggest improvements
For Amber to work effectively, structure your issue body like this:
## Problem
[Describe what needs to be fixed]
## Files
File: `path/to/file.go`
File: `path/to/another.py`
## Instructions
[Step-by-step instructions for Amber]
## Success Criteria
- [ ] All linters pass
- [ ] All tests pass
- [ ] Follows CLAUDE.md standardsKey Fields:
File:orPath:- Amber extracts file paths automaticallyInstructions:orTask:- Main instructions section- Success criteria checklist
Amber's behavior is controlled by:
- Workflow:
.github/workflows/amber-issue-handler.yml - Config:
.claude/amber-config.yml(automation policies) - Project Standards:
CLAUDE.md(Amber follows all project conventions)
Amber classifies changes by risk:
| Risk | Actions | Auto-Merge | Examples |
|---|---|---|---|
| Low | Auto-fix, create PR | No (requires review) | Formatting, linting |
| Medium | Create PR with proposal | No | Refactoring, test additions |
| High | Report only, no PR | N/A | Breaking changes, security issues |
The workflow follows strict security practices:
- No Command Injection: All user input (issue titles, bodies) passed via environment variables
- Token Scoping:
GITHUB_TOKENhas minimal permissions (contents:write, issues:write, pull-requests:write) - Anthropic API Key: Stored as GitHub secret (
ANTHROPIC_API_KEY) - Branch Protection: Never pushes to
main, always creates feature branches
Reference: GitHub Actions Security Guide
# Via GitHub CLI
gh run list --workflow=amber-issue-handler.yml
# Watch specific run
gh run watch <run-id>
# View logs
gh run view <run-id> --logAll PRs created by Amber have:
- Title:
[Amber] Fix: <issue title> - Labels:
amber-generated,auto-fix,<action-type> - Body: Detailed summary with links back to original issue
Possible Causes:
- Wrong label applied (must be exact:
amber:auto-fix, notamber auto-fix) - Issue not in correct repository
ANTHROPIC_API_KEYsecret not configured
Debug:
gh run list --workflow=amber-issue-handler.yml --limit 5Expected Behavior: Amber runs linters/tests before committing, but CI may have additional checks.
Actions:
- Review PR, identify failing test
- Add comment to PR:
/amber fix-tests - Amber will update the PR with fixes
Alternative: Close PR, update original issue with additional context, re-trigger Amber
Amber will comment on the issue with error details:
⚠️ Amber encountered an error while processing this issue.
**Action Type:** refactor
**Workflow Run:** [link to logs]
Please review the workflow logs for details.
Common Issues:
- Issue description lacks sufficient context
- Specified files don't exist
- Changes too complex for automation (requires manual intervention)
Auto-Fix:
Title: [Amber] Fix Go formatting in backend handlers
Label: amber:auto-fix
## Problem
Backend handlers fail gofmt checks after recent commits.
## Files
File: `components/backend/handlers/*.go`
## Fix Type
Code FormattingRefactoring:
Title: [Amber Refactor] Extract git operations from sessions.go
Label: amber:refactor
## Current State
File: `components/backend/handlers/sessions.go` (line 1200-1800)
Issue: Git operations mixed with session handling logic
## Desired State
Create new file: `components/backend/git/session_operations.go`
Move git clone, fork, PR creation functions
## Constraints
- Maintain current API (no breaking changes)
- Add unit tests for extracted functions
- All existing tests must passTest Coverage:
Title: [Amber Tests] Add contract tests for Projects API
Label: amber:test-coverage
## Untested Code
File: `components/backend/handlers/projects.go`
Functions: CreateProject, DeleteProject, ListProjects
## Test Scenarios
- Happy path: create project with valid name
- Error: create project with duplicate name
- Error: create project with invalid characters
- Edge: list projects when none exist
## Target Coverage
60% for projects.goToo Vague:
Title: Fix stuff
Label: amber:auto-fix
Make the code better.Issue: No specific files, instructions, or success criteria
Too Broad:
Title: Refactor entire backend
Label: amber:refactor
Rewrite all backend code to be perfect.Issue: Scope too large, no clear boundaries
Security Risk:
Title: Update API keys in code
Label: amber:auto-fix
Hardcode new API keys in handlers.Issue: Amber will refuse (security violation)
-
Update workflow (
.github/workflows/amber-issue-handler.yml):if: | github.event.label.name == 'amber:your-new-type'
-
Create issue template (
.github/ISSUE_TEMPLATE/amber-your-type.yml) -
Update config (
.claude/amber-config.yml):automation_policies: your_new_type: enabled: true categories: - name: "Your New Type" patterns: ["pattern1", "pattern2"]
-
Document in this file
Track Amber's effectiveness:
# Count Amber-generated PRs
gh pr list --label amber-generated --state all
# Amber success rate (merged vs. closed)
gh pr list --label amber-generated --state merged | wc -l
gh pr list --label amber-generated --state closed | wc -l
# Average time from issue creation to PR merge
# (requires custom script or GitHub API)Goal: 90% of Amber PRs merged without modification
Q: Can Amber handle multiple files in one PR? A: Yes, specify multiple files in the issue body. Amber will modify all relevant files.
Q: Can I trigger Amber without an issue? A: No, issues provide context and audit trail. For ad-hoc tasks, create a temporary issue.
Q: What happens if Amber's PR conflicts with other work? A: Standard git conflict resolution. Review the PR, resolve conflicts manually, or close and re-trigger after merging other work.
Q: Can Amber create breaking changes? A: No, Amber is configured to reject breaking changes. It will comment on the issue if it detects a breaking change request.
Q: How much does Amber cost (API usage)? A: Depends on task complexity. Typical auto-fix: ~10K tokens ($0.03), refactoring: ~50K tokens ($0.15), test coverage: ~30K tokens ($0.09). Monitor via Anthropic dashboard.
- Amber Configuration - Automation policies
- Project Standards - Conventions Amber follows
- GitHub Actions Security - Official security guide
Issues with Amber automation:
- Check workflow logs:
gh run view --log - Review issue format requirements (above)
- Create issue with label
amber:helpfor manual review
Feature Requests:
Create issue titled [Amber Feature Request] ... describing desired capability.
Last Updated: 2025-11-21 Maintained By: Platform Team