Important
This repository is archived. It was built for the AWS re:Invent 2025 demo and is no longer maintained. The code is provided as-is for reference. No further updates, bug fixes, or security patches will be made, and issues and pull requests will not be reviewed.
If you adapt this code, treat it as a starting point — not a production-ready template. In particular, review the IAM policies, the agent's command allowlist, and the test-verification gates against your own threat model before deploying to any account that holds real workloads or data.
An autonomous agent system that builds full-stack applications from GitHub issues using AWS Bedrock AgentCore and the Claude Agent SDK.
- AWS account with Bedrock AgentCore access
- GitHub repository with Actions enabled
- Docker installed locally
- AWS CLI and CDK configured
agentcoreCLI installed (pip install bedrock-agentcore) — Note: theagentcore launch/push/buildsubcommands are broken; usemaketargets instead (see below)
# 0. Copy and fill in your local config
cp Makefile.local.example Makefile.local
# Edit Makefile.local: set AWS_PROFILE, AWS_REGION, VPC_ID, GITHUB_REPO
# 1. Deploy CDK infrastructure (ECR, S3 buckets, CloudFront, IAM roles)
make deploy-infra
# 2. Build and push the Docker image (ECR URI from: make show-config)
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin <ECR_URI>
docker build --platform linux/arm64 -t <ECR_URI>:latest .
docker push <ECR_URI>:latest
# 3. Create the AgentCore runtime (first time only)
make create-runtime
# Copy the agentRuntimeId from the output into Makefile.local as AGENT_RUNTIME_ID
# Then update the runtime environment:
make update-runtime-env-
Secrets (Settings > Secrets and variables > Actions > Secrets):
Secret Description 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 (output of CDK deploy) AWS_PREVIEW_DEPLOY_ROLE_ARNIAM role ARN for deploying previews (output of CDK deploy) AWS_INFRA_DEPLOY_ROLE_ARNIAM role ARN for deploying agent-written CDK infra (output of CDK deploy) -
Variables (Settings > Secrets and variables > Actions > Variables):
Variable Description AUTHORIZED_APPROVERSComma-separated GitHub usernames who can approve builds AWS_REGIONAWS region where infrastructure is deployed (e.g. us-east-1)AGENTCORE_AGENT_IDAgentCore runtime ID (from make create-runtimeoutput)APP_CDK_STACK_NAMECDK stack name for agent-generated app (e.g. canopy-app-stack)PREVIEWS_BUCKET_NAMES3 bucket for preview deployments (output of CDK deploy) PREVIEWS_CDN_DOMAINCloudFront domain for previews (output of CDK deploy) PREVIEWS_DISTRIBUTION_IDCloudFront distribution ID for cache invalidation (output of CDK deploy) -
Labels (must exist for workflows):
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 at runtime:
| Secret Name | Description |
|---|---|
claude-code/{env}/anthropic-api-key |
Anthropic API key (not needed if using Bedrock) |
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).
- User creates a 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 - On completion, the
agent-completelabel is added - Deploy preview workflow builds and deploys to CloudFront
Recommended: Run
claudein this repo for an interactive guided setup. Claude will check your prerequisites, help you create a BUILD_PLAN.md, deploy infrastructure, and trigger the agent — all conversationally.
The agent uses PROJECT_NAME to find build plans and configure each project. To build something other than the default Canopy app:
prompts/
myapp/
BUILD_PLAN.md # Required: full project specification
EXAMPLE_TEST.txt # Optional: example test for the agent to follow
DEBUGGING_GUIDE.md # Optional: project-specific debugging tips
This is the most important file. It tells the agent exactly what to build. Include:
- Project overview — what the app does, who it's for
- Technology stack — framework, build tools, styling, backend
- API specification — endpoints, request/response schemas
- Data models — entities, relationships, database design
- UI specification — pages, components, layout
- Test requirements — what tests to write, how to run them
See prompts/canopy/BUILD_PLAN.md for a complete example.
# Via make
make launch PROJECT_NAME=myapp
# Or override just the variable
make launch-local PROJECT_NAME=myappprompts/{PROJECT_NAME}/BUILD_PLAN.mdis loaded as the build planprompts/{PROJECT_NAME}/EXAMPLE_TEST.txtis loaded as test guidanceprompts/{PROJECT_NAME}/DEBUGGING_GUIDE.mdis loaded for debugging context- Shared prompts in
prompts/system_prompt.txtandprompts/DEBUGGING_GUIDE.mdare always loaded
To wipe all agent state and start fresh:
make resetThis performs the following:
- Deletes the
agent-runtimebranch (local and remote) — removes all generated code - Closes all open issues with the
agent-buildinglabel - Clears SSM parameters —
/claude-code/current-issue,/claude-code/session-id,/claude-code/infra/deploy-state - Empties S3 buckets — screenshots and previews
- Invalidates CloudFront caches — ensures stale content is purged
After reset, create a new GitHub issue and add a reaction to trigger a fresh build.
Override any variable on the command line:
make launch PROJECT_NAME=myapp SESSION_DURATION_HOURS=2.0 DEFAULT_MODEL=us.anthropic.claude-opus-4-6-v1Key variables (set in Makefile or via environment):
| Variable | Default | Description |
|---|---|---|
PROJECT_NAME |
canopy |
Which build plan to use (prompts/{name}/) |
DEFAULT_MODEL |
us.anthropic.claude-opus-4-6-v1 |
Bedrock model ID |
SESSION_DURATION_HOURS |
7.0 |
Max agent session length |
PUSH_INTERVAL_SECONDS |
300 |
How often to push commits |
SCREENSHOT_INTERVAL_SECONDS |
300 |
How often to capture screenshots |
AWS_PROFILE |
default |
AWS CLI profile |
AWS_REGION |
us-east-1 |
AWS region |
GITHUB_REPO |
(set in Makefile.local) | Target GitHub repo (owner/repo) |
Run make show-config to see all current values.
├── bedrock_entrypoint.py # Main orchestrator — clones repo, starts agent
├── claude_code.py # Agent session manager (Claude SDK wrapper)
├── src/
│ ├── cloudwatch_metrics.py # Heartbeat and metrics
│ ├── github_integration.py # GitHub API operations
│ └── git_operations.py # Git commit/push logic
├── prompts/
│ ├── system_prompt.txt # Shared system prompt (all projects)
│ ├── DEBUGGING_GUIDE.md # Shared debugging tips
│ ├── FRONTEND_AESTHETICS_GUIDE.md # UI design guidance
│ └── canopy/ # Canopy project build plan
│ ├── BUILD_PLAN.md
│ ├── EXAMPLE_TEST.txt
│ ├── DEBUGGING_GUIDE.md
│ └── system_prompt.txt
├── frontend-scaffold-template/ # React + Vite + Tailwind scaffold
├── infrastructure/ # CDK stack (ECR, S3, CloudFront, IAM)
├── .github/workflows/
│ ├── issue-poller.yml # Polls for approved issues
│ ├── agent-builder.yml # Invokes AgentCore
│ └── deploy-preview.yml # Deploys built app to CloudFront
└── Makefile # All management commands
Apache 2.0