https://github.com/anthropics/riv2025-long-horizon-coding-agent-demo.git
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.
agent-runtime branchagent-complete label is added.bedrock_agentcore.yaml.template to .bedrock_agentcore.yaml| 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-... |
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 |
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 |
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 |
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"
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) |
{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
โโโ 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
Apache 2.0