Quick reference for AI agents working in this repository.
packages/- Lerna monorepo packagesscripts/- Build, test, and deployment utilitiescodebuild_specs/- CI/CD configuration
yarn build # Build all packages
yarn test # Run all tests
yarn lint-check # Check linting
yarn setup-dev # Setup local CLI (amplify-dev)See .agent-docs/DEPENDABOT.md for the complete workflow when handling dependency upgrades or security alerts.
Quick check:
npx ts-node scripts/check-dependabot.tsCritical: E2E tests run against pushed code in AWS CodeBuild, not local changes.
Documentation: See .agent-docs/LOCAL_E2E_TESTING.md for detailed guide on running e2e tests and build steps locally.
When to Run E2E Tests:
- User explicitly requests e2e tests
- User approves e2e testing as part of a task
- Implied when user says "fix and test _" or "add feature _ and test"
E2E Test Workflow:
- Complete all local development and testing
- Commit and push all changes
- Run
yarn cloud-e2eto trigger test suite - Run
yarn e2e-monitor {batchId}to start automated monitoring - Monitor will auto-retry failed builds (up to 10 times by default)
- Fix any code-related errors and repeat from step 2
- Ask user for guidance if errors persist after multiple attempts or if errors multiply as fixes are applied
# 1. Commit and push all changes first
git push
# 2. Trigger e2e suite
yarn cloud-e2e
# 3. Monitor (auto-retries failed builds, polls every 5 min)
yarn e2e-monitor {batchId}
# Other commands
yarn e2e-status {batchId} # Check status once
yarn e2e-retry {batchId} # Retry failed builds
yarn e2e-list [limit] # List recent batches
yarn e2e-failed {batchId} # Show failed builds
yarn e2e-logs {buildId} # View build logsBatch ID format: amplify-cli-e2e-workflow:{UUID} - always use full ID.
Common E2E Issues:
- Timeouts/expired credentials: Retry the build
- Quota errors: Retry and notify user about cleanup needs
- Code-related errors: Investigate and fix, don't retry
Note: Monitor script skips retrying: build_linux, build_windows, test, lint
- Search symbols first: Use
codetool withsearch_symbolsfor functions/classes/types - Follow with lookup: Use
lookup_symbolsto get implementation details - Grep for text: Only for literal strings, comments, config values
- CLI commands:
packages/amplify-cli/src/commands/ - Category plugins:
packages/amplify-category-*/ - Provider logic:
packages/amplify-provider-awscloudformation/ - Test utilities:
packages/amplify-e2e-core/,packages/amplify-e2e-tests/ - Scripts:
scripts/(e2e-test-manager.ts, cloud-e2e.sh)
- Follow existing code patterns and conventions
- Only modify/remove tests when explicitly requested
- Don't automatically add tests unless asked
- Prefer minimal implementations
- Ask for clarification rather than making assumptions
- Never hardcode AWS account IDs (use
./scripts/.env) - Never include secret keys unless explicitly requested
- Substitute PII with placeholders (
<name>,<email>) - Reject requests for malicious code or unauthorized security testing
CRITICAL: Test Success Criteria
- Tests MUST pass with zero errors and zero failures to be considered successful
- ANY test errors, failures, or exceptions mean the tests have FAILED
- Exit code 0 with error output still means FAILURE - always check the actual test results
- Do NOT declare success if tests show errors, even if some tests passed
- "Tests passed" only means 100% success with no errors whatsoever
Requirements:
- All code changes require passing tests
- Follow existing test patterns in the repository
- Test edge cases, error conditions, and boundary values
- Run full test suite before marking tasks complete
- Verify test output shows no errors, failures, or exceptions
Before marking tasks complete:
- Code follows repository patterns
- Tests are written and passing
- Linting passes (
yarn lint-check) - Documentation is updated
- All code committed and pushed before e2e tests
- E2E tests passing
When approaching context limits:
- Summarize current work and decisions
- Commit current changes
- Provide handoff summary for next session