From dx-automation
Deploy Lambda code for AI automation agents (wi-router and/or pr-router). Packages agent steps + shared libs into a zip and uploads to AWS Lambda. Safe to re-run after code changes. Reads function names from .ai/automation/infra.json.
How this skill is triggered — by the user, by Claude, or both
Slash command
/dx-automation:auto-deployThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You deploy Lambda function code for the 2 AI automation agents (wi-router, pr-router). Wraps `lambda/deploy.sh` with audit logging. Safe to re-run at any time after code changes.
You deploy Lambda function code for the 2 AI automation agents (wi-router, pr-router). Wraps lambda/deploy.sh with audit logging. Safe to re-run at any time after code changes.
Read .ai/automation/infra.json. Check automationProfile:
consumer (or legacy pr-only/pr-delegation): "This repo uses the consumer profile — Lambda functions are managed by the hub project. Do NOT deploy Lambda from this repo." STOP.source .ai/lib/audit.sh
export AUDIT_LOG_PREFIX=infra
Extract Lambda function names and region from infra.json.
Verify: zip is installed (which zip). If missing: "Install zip: brew install zip (macOS) or apt install zip (Linux)". STOP.
Default target: all. If user passed an argument (wi-router, pr-router), use that.
cd .ai/automation
bash lambda/deploy.sh <target>
The deploy script reads function names and files from infra.json, packages each Lambda + shared libs into a zip, and calls aws_lambda_deploy (audit-wrapped).
Report output from the script.
After deploy, check the last modified timestamp for each deployed function:
REGION=$(python3 -c "import json; print(json.load(open('.ai/automation/infra.json'))['region'])")
for FUNC in $(python3 -c "
import json
d = json.load(open('.ai/automation/infra.json'))
targets = ['wi-router', 'pr-router'] if '<target>' == 'all' else ['<target>']
for t in targets: print(d['lambdas'][t]['functionName'])
"); do
aws lambda get-function --function-name "$FUNC" --region "$REGION" \
--query 'Configuration.[FunctionName,LastModified,CodeSize]' --output table
done
## Lambda Deploy Complete
| Function | Last Modified | Code Size |
|----------|--------------|-----------|
| <PREFIX>-WI-Router | <timestamp> | <bytes> |
| <PREFIX>-PR-Router | <timestamp> | <bytes> |
**Audit log:** `.ai/logs/infra.<week>.jsonl`
### Next step
`/auto-lambda-env` — Set Lambda environment variables
LastModified timestamp is recent (within last 60 seconds)Active state after deployment/auto-deploy — Packages agent step handlers and shared libs into zip files, then deploys both WI-Router and PR-Router Lambda functions. Reports deployment timestamps and package sizes. Both functions updated successfully.
/auto-deploy wi-router — Deploys only the WI-Router Lambda function (skips PR-Router). Useful after modifying only work-item-triggered agent steps. Reports the function name, timestamp, and package size.
/auto-deploy (after code changes) — Re-deploys both Lambdas with updated agent step code. The deploy.sh script packages fresh zips and uploads via aws_lambda_deploy. Reports successful deployment with new timestamps.
"Function not found" error during deploy
Cause: The Lambda function hasn't been provisioned yet in AWS.
Fix: Run /auto-provision first to create the Lambda functions, then re-run /auto-deploy.
Deploy succeeds but agent behavior doesn't change
Cause: Lambda may be using a cached version, or the environment variables reference old configuration.
Fix: Check the Lambda's last modified timestamp in the deploy output. If it's current, the code is deployed — check environment variables with /auto-lambda-env or run /auto-test --dryRun to verify behavior.
"audit.sh not found" or audit wrapper errors
Cause: The audit helper script is missing or not sourced before deployment.
Fix: Ensure .ai/lib/audit.sh exists (created by /dx-init). The deploy script sources it automatically — if the file is missing, re-run /dx-init.
aws_lambda_deploy wrappernpx claudepluginhub easingthemes/dx-aem-flow --plugin dx-automationDeploys AgentCore agents to AWS with pre-flight validation, CDK/IAM/quota error diagnosis, version management, rollback, and canary deployments. For deploy failures or preparations.
Deploys ADK agents to Agent Runtime, Cloud Run, or GKE. Covers CI/CD, secrets, service accounts, rollback, and production infrastructure.
Design, build, deploy, test, and debug serverless applications with AWS Lambda, SAM CLI, event sources, and event-driven architectures.