- Value
- Description
- YOUR_ACCOUNT_ID
- Your AWS account ID
- YOUR_EXECUTION_ROLE
- IAM role for AgentCore runtime
- YOUR_PROJECT_NAME
- ECR repository name
Specs
- ValueDescription
- YOUR_ACCOUNT_IDYour AWS account ID
- YOUR_EXECUTION_ROLEIAM role for AgentCore runtime
- YOUR_PROJECT_NAMEECR repository name
- YOUR_AGENT_RUNTIME_IDAgentCore runtime ID (after first deploy)
- YOUR_CODEBUILD_ROLEIAM role for CodeBuild
- SecretDescription
- AWS_ACCESS_KEY_IDIAM user access key for GitHub Actions
- AWS_SECRET_ACCESS_KEYIAM user secret key
- AWS_AGENTCORE_ROLE_ARNIAM role ARN for invoking AgentCore
- AWS_PREVIEW_DEPLOY_ROLE_ARNIAM role ARN for deploying previews
- VariableDescription
- AUTHORIZED_APPROVERSComma-separated GitHub usernames who can approve builds with π
- PREVIEWS_BUCKET_NAMES3 bucket for preview deployments
- PREVIEWS_CDN_DOMAINCloudFront domain for previews
- PREVIEWS_DISTRIBUTION_IDCloudFront distribution ID for cache invalidation
- LabelColor
- agent-building#FBCA04 (yellow)
- agent-complete#0E8A16 (green)
- tests-failed#D93F0B (red)
- Secret NameDescription
- claude-code/{env}/anthropic-api-keyAnthropic API key for Claude
- claude-code/{env}/github-tokenDefault GitHub PAT (fallback)
- claude-code/{env}/github-token-{org}Org-specific GitHub PAT (optional)
README
π€ Long-Horizon Coding Agent Demo
An autonomous agent system that builds React applications from GitHub issues using AWS Bedrock AgentCore and the Claude Agent SDK. Demonstrated at AWS re:Invent 2025.
How It Works
End-to-End Flow
- User creates GitHub issue with a feature request
- Users vote with π reactions to prioritize what gets built
- Authorized user approves by adding a π reaction
- Issue poller (runs every 5 min) detects approved issues, sorted by votes
- Agent builder workflow acquires lock and invokes AWS Bedrock AgentCore
- Bedrock entrypoint clones the repo and starts the Claude agent
- Agent builds the feature following the build plan, taking screenshots, running tests
- Progress is tracked via commits pushed to the
agent-runtimebranch - Screenshots and updates are posted to the GitHub issue
- On completion, the agent signals done, commits are pushed, and
agent-completelabel is added - If more issues exist, the agent continues in enhancement mode
- Deploy preview workflow builds and deploys to CloudFront
Key Features
- Vote-based prioritization - Issues with more π reactions are built first
- Health monitoring - CloudWatch heartbeat detects stale sessions and triggers auto-restart
- Incremental builds - Agent builds new features on top of existing generated code
- Screenshot capture - Playwright takes screenshots throughout development
- Live previews - Each issue gets a CloudFront preview URL
Configuration
Prerequisites
- AWS account with Bedrock AgentCore access
- GitHub repository with Actions enabled
- Docker for local development
AWS Configuration
- Copy
.bedrock_agentcore.yaml.templateto.bedrock_agentcore.yaml - Fill in your AWS values:
| Value | Description | Example |
|---|---|---|
YOUR_ACCOUNT_ID |
Your AWS account ID | 123456789012 |
YOUR_EXECUTION_ROLE |
IAM role for AgentCore runtime | AmazonBedrockAgentCoreSDKRuntime-... |
YOUR_PROJECT_NAME |
ECR repository name | my-agent |
YOUR_AGENT_RUNTIME_ID |
AgentCore runtime ID (after first deploy) | my_agent-abc123 |
YOUR_CODEBUILD_ROLE |
IAM role for CodeBuild | AmazonBedrockAgentCoreSDKCodeBuild-... |
GitHub Repository Secrets
Configure in Settings β Secrets and variables β Actions β Secrets:
| Secret | Description |
|---|---|
AWS_ACCESS_KEY_ID |
IAM user access key for GitHub Actions |
AWS_SECRET_ACCESS_KEY |
IAM user secret key |
AWS_AGENTCORE_ROLE_ARN |
IAM role ARN for invoking AgentCore |
AWS_PREVIEW_DEPLOY_ROLE_ARN |
IAM role ARN for deploying previews |
GitHub Repository Variables
Configure in Settings β Secrets and variables β Actions β Variables:
| Variable | Description |
|---|---|
AUTHORIZED_APPROVERS |
Comma-separated GitHub usernames who can approve builds with π |
PREVIEWS_BUCKET_NAME |
S3 bucket for preview deployments |
PREVIEWS_CDN_DOMAIN |
CloudFront domain for previews |
PREVIEWS_DISTRIBUTION_ID |
CloudFront distribution ID for cache invalidation |
GitHub Repository Labels
The following labels must exist for the workflows to function properly:
| Label | Color | Description |
|---|---|---|
agent-building |
#FBCA04 (yellow) |
Agent is actively working on this issue |
agent-complete |
#0E8A16 (green) |
Agent has completed this issue |
tests-failed |
#D93F0B (red) |
Tests failed during agent build |
Create these at Settings β Labels, or via CLI:
gh api repos/OWNER/REPO/labels -f name="agent-building" -f color="FBCA04" -f description="Agent is actively working on this issue"
gh api repos/OWNER/REPO/labels -f name="agent-complete" -f color="0E8A16" -f description="Agent has completed this issue"
gh api repos/OWNER/REPO/labels -f name="tests-failed" -f color="D93F0B" -f description="Tests failed during agent build"
AWS Secrets Manager
The agent reads secrets from AWS Secrets Manager. Required secrets:
| Secret Name | Description |
|---|---|
claude-code/{env}/anthropic-api-key |
Anthropic API key for Claude |
claude-code/{env}/github-token |
Default GitHub PAT (fallback) |
claude-code/{env}/github-token-{org} |
Org-specific GitHub PAT (optional) |
Where {env} is the environment name (default: reinvent) and {org} is the GitHub organization name.
Org-specific tokens allow separation of concerns when working with multiple GitHub organizations. The agent checks for an org-specific token first, then falls back to the default:
# Create org-specific token (recommended for multi-org setups)
aws secretsmanager create-secret \
--name claude-code/reinvent/github-token-anthropics \
--secret-string "ghp_your_pat_here" \
--region us-west-2
# Or update existing default token
aws secretsmanager update-secret \
--secret-id claude-code/reinvent/github-token \
--secret-string "ghp_your_pat_here" \
--region us-west-2
Project Structure
βββ bedrock_entrypoint.py # Main orchestrator for AWS Bedrock AgentCore
βββ claude_code.py # Agent session manager and local runner
βββ src/ # Python modules
β βββ cloudwatch_metrics.py # Heartbeat and metrics
β βββ github_integration.py # GitHub API operations
β βββ git_operations.py # Git commit/push logic
βββ prompts/ # Build plans and system prompts
β βββ canopy/ # Project Management app build plan
βββ frontend-scaffold-template/ # React + Vite + Tailwind scaffold
βββ .github/workflows/ # GitHub Actions
βββ issue-poller.yml # Polls for approved issues
βββ agent-builder.yml # Invokes AgentCore
βββ deploy-preview.yml # Deploys to CloudFront
License
Apache 2.0