$npx -y skills add awslabs/agent-plugins --skill amplify-workflowBuild and deploy full-stack web and mobile apps with AWS Amplify Gen2
| 1 | # AWS Amplify Gen2 |
| 2 | |
| 3 | Build and deploy full-stack applications using AWS Amplify Gen2's TypeScript |
| 4 | code-first approach. This skill covers backend resource creation, frontend |
| 5 | integration across 8 frameworks, and deployment workflows. |
| 6 | |
| 7 | ## Prerequisites |
| 8 | |
| 9 | - Node.js ^18.19.0 || ^20.6.0 || >=22 and npm |
| 10 | - AWS credentials configured (`aws sts get-caller-identity` succeeds) |
| 11 | - For sandbox: `npx ampx --version` returns a valid version |
| 12 | - For mobile: Platform-specific tooling (Xcode, Android Studio, Flutter SDK) |
| 13 | |
| 14 | ## Defaults & Assumptions |
| 15 | |
| 16 | When the user does not specify a framework: |
| 17 | |
| 18 | - **Web:** You **SHOULD** default to **React** (Vite) and explain the choice. |
| 19 | - **Mobile:** You **MUST** ask which platform the user wants (Flutter, |
| 20 | Swift, Android, or React Native). There is no universal mobile default. |
| 21 | - **Neither specified:** If the user says "build an app" without clarifying web |
| 22 | vs. mobile, you **MUST** ask before proceeding. |
| 23 | - **Backend only:** If only backend changes are requested and no frontend |
| 24 | framework is mentioned, skip the frontend integration step entirely. |
| 25 | |
| 26 | When the user does not specify tooling or strategy: |
| 27 | |
| 28 | - **Package manager:** You **SHOULD** default to **npm** unless the user |
| 29 | specifies yarn or pnpm. |
| 30 | - **Language:** You **SHOULD** default to **TypeScript**. Gen2 backends are |
| 31 | TypeScript-only; frontends **SHOULD** follow the project's existing language. |
| 32 | - **Next.js:** You **SHOULD** default to **App Router** unless the user |
| 33 | specifies Pages Router. |
| 34 | - **React Native:** Ask the user whether they use **Expo** or **bare |
| 35 | React Native CLI**. |
| 36 | - **Auth:** You **MUST** ask which login method the user wants |
| 37 | (email/password, social login, SAML, passwordless, etc.). Do not assume a default. |
| 38 | - **Data authorization:** default to **`publicApiKey`** |
| 39 | (`allow.publicApiKey()`) — this is the starter template default. When |
| 40 | auth is added, switch to **owner-based** (`allow.owner()`) with |
| 41 | `defaultAuthorizationMode: 'userPool'`. |
| 42 | |
| 43 | ## Quick Start — Route to the Right Reference |
| 44 | |
| 45 | ### Step 0: Read Core Reference (ALWAYS) |
| 46 | |
| 47 | You **MUST** read the core reference for your target platform **before |
| 48 | reading any other reference file**. These contain Gen2 detection, |
| 49 | `Amplify.configure()` placement per framework, sandbox commands, required |
| 50 | packages, and directory structure rules — patterns needed for **all** tasks, |
| 51 | not just new projects. |
| 52 | |
| 53 | - **Web** (React, Next.js, Vue, Angular, React Native): You **MUST** read |
| 54 | [core-web.md](references/core-web.md) |
| 55 | - **Mobile** (Flutter, Swift, Android): You **MUST** read |
| 56 | [core-mobile.md](references/core-mobile.md) |
| 57 | - **Backend only** (no frontend work): Skip to Step 1. |
| 58 | |
| 59 | ### Step 1: Identify the Task Type |
| 60 | |
| 61 | | Task | Go To | |
| 62 | | ---------------------------------------- | ------------------------------------------------------------------------ | |
| 63 | | **Create a new project** | → [scaffolding.md](references/scaffolding.md), then Step 2 and/or Step 3 | |
| 64 | | **Add or modify a backend feature** | → Step 2 (Backend Features) | |
| 65 | | **Connect frontend to existing backend** | → Step 3 (Frontend Integration) | |
| 66 | | **Deploy the application** | → [deployment.md](references/deployment.md) | |
| 67 | |
| 68 | ### Step 2: Backend Features |
| 69 | |
| 70 | You **MUST** read the corresponding reference for each backend feature: |
| 71 | |
| 72 | | Feature | Reference | When to Use | |
| 73 | | ---------------- | ------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | |
| 74 | | Authentication | [auth-backend.md](references/auth-backend.md) | Email/password, social login, MFA, SAML/OIDC |