generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 31
feat: add aws-amplify plugin #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
must1d
wants to merge
2
commits into
awslabs:main
Choose a base branch
from
must1d:aws-amplify
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+493
−0
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| { | ||
| "author": { | ||
| "name": "Amazon Web Services" | ||
| }, | ||
| "description": "Build full-stack apps with AWS Amplify Gen 2 using guided workflows for authentication, data models, storage, GraphQL APIs, and Lambda functions.", | ||
| "homepage": "https://github.com/awslabs/agent-plugins", | ||
| "keywords": [ | ||
| "aws", | ||
| "amplify", | ||
| "fullstack", | ||
| "authentication", | ||
| "data", | ||
| "storage", | ||
| "graphql", | ||
| "functions" | ||
| ], | ||
| "license": "Apache-2.0", | ||
| "name": "aws-amplify", | ||
| "repository": "https://github.com/awslabs/agent-plugins", | ||
| "version": "1.0.0" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "mcpServers": { | ||
| "aws-mcp": { | ||
| "command": "uvx", | ||
| "timeout": 100000, | ||
| "type": "stdio", | ||
| "args": [ | ||
| "mcp-proxy-for-aws@latest", | ||
must1d marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "--log-level", | ||
| "ERROR", | ||
| "https://aws-mcp.us-east-1.api.aws/mcp" | ||
| ] | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,214 @@ | ||
| --- | ||
| name: amplify-workflow | ||
| description: Orchestrates AWS Amplify Gen 2 workflows for building full-stack apps with React, Next.js, Vue, Angular, React Native, Flutter, Swift, or Android. Use when user wants to BUILD, CREATE, or DEPLOY Amplify projects, add authentication, data models, storage, GraphQL APIs, Lambda functions, or deploy to sandbox/production. Do NOT invoke for conceptual questions, comparisons, or troubleshooting unrelated to active development. | ||
| --- | ||
|
|
||
| # Amplify Workflow | ||
|
|
||
| Orchestrated workflow for AWS Amplify Gen 2 development. | ||
|
|
||
| ## Available references | ||
|
|
||
| - **`references/backend.md`** -- Backend phase: SOP retrieval, constraints, error handling | ||
| - **`references/frontend.md`** -- Frontend & testing phase: SOP retrieval, local testing | ||
| - **`references/deploy.md`** -- Deploy phase: SOP retrieval, deployment type mapping | ||
|
|
||
| ## Available scripts | ||
|
|
||
| - **`scripts/prereq-check.sh`** -- Validates Node.js, npm, and AWS credentials | ||
|
|
||
| --- | ||
|
|
||
| ## Step 1: Validate Prerequisites | ||
|
|
||
| Run the prerequisite check script: | ||
|
|
||
| ```bash | ||
| bash scripts/prereq-check.sh | ||
| ``` | ||
|
|
||
| The script checks Node.js >= 18, npm, and AWS credentials in one pass and reports a clear PASS/FAIL summary. | ||
|
|
||
| If the AWS credentials check fails, **STOP** and present this message to the user: | ||
|
|
||
| ``` | ||
| ## AWS Credentials Required | ||
|
|
||
| I can't proceed without AWS credentials configured. Please set up your credentials first: | ||
|
|
||
| **Setup Guide:** https://docs.amplify.aws/react/start/account-setup/ | ||
|
|
||
| **Quick options:** | ||
| - Run `aws configure` to set up access keys | ||
| - Run `aws sso login` if using AWS IAM Identity Center | ||
|
|
||
| Once your credentials are configured, **come back and start a new conversation** to continue building with Amplify. | ||
| ``` | ||
|
|
||
| **Do NOT proceed with Amplify work until credentials are configured.** The user must restart the conversation after setting up credentials. | ||
must1d marked this conversation as resolved.
Show resolved
Hide resolved
must1d marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| --- | ||
|
|
||
| ## Step 2: Understand the Project | ||
|
|
||
| Once all prerequisites pass: | ||
|
|
||
| 1. Read all necessary project files (e.g., `amplify/`, `package.json`, existing code) to understand the current state | ||
| 2. If unsure about Amplify capabilities or best practices, use documentation tools to search and read AWS Amplify docs | ||
|
|
||
| Do this BEFORE proposing a plan. | ||
|
|
||
| --- | ||
|
|
||
| ## Step 3: Determine Applicable Phases | ||
|
|
||
| Based on the user's request and project state, determine which phases apply: | ||
|
|
||
| | Phase | Applies when | Reference | | ||
| | ------------------ | -------------------------------------------------------- | ------------------------ | | ||
| | 1: Backend | User needs to create or modify Amplify backend resources | `references/backend.md` | | ||
| | 2: Sandbox | Deploy to sandbox for testing | `references/deploy.md` | | ||
| | 3: Frontend & Test | Frontend needs to connect to Amplify backend | `references/frontend.md` | | ||
| | 4: Production | Deploy to production | `references/deploy.md` | | ||
|
|
||
| Common patterns: | ||
|
|
||
| - **New full-stack app:** 1 -> 2 -> 3 -> 4 | ||
| - **Backend only (no frontend):** 1 -> 2 | ||
| - **Add feature to existing backend:** 1 -> 2 | ||
| - **Redeploy after changes:** 2 only | ||
| - **Connect existing frontend:** 3 only | ||
| - **Deploy to production:** 4 only | ||
|
|
||
| **IMPORTANT: Only include phases that the user actually needs.** If the user asks for backend work only (e.g., "add auth", "create a data model", "add storage"), do NOT include Phase 3 (Frontend & Test). Frontend phases should only be included when the user explicitly asks for frontend work, a full-stack app, or to connect a frontend to Amplify. | ||
|
|
||
| --- | ||
|
|
||
| ## Step 4: Present Plan and Confirm | ||
|
|
||
| Present to the user: | ||
|
|
||
| ``` | ||
| ## Plan | ||
|
|
||
| ### What I understood | ||
| - [Brief summary of what the user wants] | ||
|
|
||
| ### Features | ||
| [list features if applicable] | ||
|
|
||
| ### Framework | ||
| [framework if known] | ||
|
|
||
| ### Phases I'll execute | ||
| 1. [Phase name] - [one-line description] -> SOP: [sop-name] | ||
| 2. [Phase name] - [one-line description] -> SOP: [sop-name] | ||
| ... | ||
| (Include SOP name for phases 1 and 3. Phases 2 and 4 use the amplify-deployment-guide SOP.) | ||
|
|
||
| Ready to get started? | ||
| ``` | ||
|
|
||
| **WAIT for user confirmation before proceeding.** | ||
|
|
||
| **Once the user approves the plan, you MUST stick to it. Do not deviate from the planned phases or SOPs unless the user explicitly asks for changes.** | ||
|
|
||
| --- | ||
|
|
||
| ## Step 5: Execute Phases | ||
|
|
||
| After the user confirms the plan, read **ONLY the first phase's reference file** (from the table in Step 3). | ||
|
|
||
| **Do NOT read any other phase reference files yet.** | ||
|
|
||
| ### Phase Execution | ||
|
|
||
| When starting a phase, announce it as a header: | ||
|
|
||
| ``` | ||
| ## Phase 1: Backend | ||
| [Next: Phase 2: Sandbox Deployment] | ||
| ``` | ||
|
|
||
| Omit "[Next: ...]" if it's the last phase in your plan. | ||
|
|
||
| ### Resuming After a Phase Completes | ||
|
|
||
| When a phase completes (the reference file will indicate the phase is done), the orchestrator takes over: | ||
|
|
||
| 1. Summarize what the phase accomplished | ||
| 2. If there are more phases in the plan, ask: "Phase [N] complete. Ready to proceed to Phase [N+1]: [next phase name]?" | ||
| 3. **WAIT for the user to confirm before proceeding.** | ||
| 4. After the user confirms, read the next phase's reference file. | ||
|
|
||
| Do NOT re-run prerequisites or re-present the plan. Simply execute the next phase. | ||
|
|
||
| --- | ||
|
|
||
| ### Phase 1: Backend | ||
|
|
||
| Read [references/backend.md](references/backend.md) and follow its instructions completely. | ||
|
|
||
| --- | ||
|
|
||
| ### Phase 2: Sandbox Deployment | ||
|
|
||
| Read [references/deploy.md](references/deploy.md) and follow its instructions. The deployment type is **sandbox** (deployment_type: `sandbox`). | ||
|
|
||
| --- | ||
|
|
||
| ### Phase 3: Frontend & Test | ||
|
|
||
| **Prerequisite:** `amplify_outputs.json` must exist. If not, run Phase 2 first. | ||
|
|
||
| Read [references/frontend.md](references/frontend.md) and follow its instructions completely. | ||
|
|
||
| --- | ||
|
|
||
| ### Phase 4: Production Deployment | ||
|
|
||
| Read [references/deploy.md](references/deploy.md) and follow its instructions. The deployment type is **production** (deployment_type: `cicd`). | ||
|
|
||
| **After completion:** | ||
|
|
||
| ``` | ||
| ## You're live! | ||
|
|
||
| ### Production URL | ||
| [url from deployment output] | ||
|
|
||
| ### Amplify Console | ||
| https://console.aws.amazon.com/amplify/home | ||
|
|
||
| Your app is now deployed! Future updates: just push to your repo and it auto-deploys. | ||
| ``` | ||
|
|
||
| This is the final phase. The workflow is complete. | ||
|
|
||
| --- | ||
|
|
||
| ## Critical Rules | ||
|
|
||
| 1. **Always follow SOPs completely** -- Do not improvise or skip steps | ||
| 2. **Never use Gen 1 patterns** -- This is for Amplify Gen 2 only (TypeScript code-first, `defineAuth`/`defineData`/`defineStorage`/`defineFunction`) | ||
| 3. **Wait for confirmation between phases** -- After each phase completes, ask the user to confirm before executing the next phase. Do not proceed until the user confirms. | ||
| 4. **If you encounter an error or get sidetracked:** | ||
| - Fix the immediate issue | ||
| - Return to the SOP and continue from where you left off | ||
| - Do NOT abandon the SOP or start improvising | ||
| 5. **If you lose track of where you were in the SOP:** | ||
| - Use the SOP retrieval tool to get the SOP again | ||
| - Identify which step you completed last | ||
| - Continue from the next step | ||
|
|
||
| --- | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| If issues occur during any phase: | ||
|
|
||
| 1. Check the SOP's troubleshooting section first | ||
| 2. Use documentation tools to search AWS Amplify docs for the error message | ||
| 3. Read the relevant documentation page | ||
|
|
||
| **After resolving the issue, immediately return to the SOP and continue from where you left off. Do not abandon the workflow.** | ||
41 changes: 41 additions & 0 deletions
41
plugins/aws-amplify/skills/amplify-workflow/references/backend.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| # Backend Phase Instructions | ||
|
|
||
| Create or modify Amplify Gen 2 backend resources. | ||
|
|
||
| ## Prerequisites Confirmed | ||
|
|
||
| Prerequisites (Node.js, npm, AWS credentials) were already validated by the orchestrator workflow. Do not re-validate. | ||
|
|
||
| ## Critical Constraints | ||
|
|
||
| - **Do NOT create frontend scaffolding or templates during this phase.** Do not run `create-next-app`, `create-react-app`, `create-vite`, `npm create`, or any frontend project generators. This phase is strictly for Amplify backend resources (the `amplify/` directory). If a frontend project already exists, leave it untouched. If no frontend project exists and the user only asked for backend work, do NOT create one. | ||
|
|
||
| - Before creating any files, ensure `.gitignore` exists in the project root and includes: `node_modules/`, `.env*`, `amplify_outputs.json`, `.amplify/`, `dist/`, `build/`. Create or update it if these entries are missing. | ||
|
|
||
| ## Retrieve and Follow the SOP | ||
|
|
||
| **Do NOT write any code until you have retrieved and read the SOP.** | ||
|
|
||
| Use the SOP retrieval tool to get **"amplify-backend-implementation"** and follow it completely. | ||
|
|
||
| **If SOP retrieval fails** (empty result, error, or timeout), STOP and inform the user: "I couldn't retrieve the backend implementation guide. Please verify that the aws-mcp server is active and try again." Do NOT attempt to write backend code from general knowledge. | ||
|
|
||
| ### SOP Overrides | ||
|
|
||
| - **Skip the SOP's Step 1** ("Verify Dependencies") -- prerequisites were already validated by the orchestrator. | ||
| - **Skip the SOP's Step 12** ("Determine Next SOP Requirements") -- phase sequencing is controlled by the orchestrator workflow, not the SOP. | ||
|
|
||
| Follow all other SOP steps (2 through 11) completely. Do not improvise or skip them. | ||
|
|
||
| ### Error Handling | ||
|
|
||
| 1. If you encounter an error, fix the immediate issue | ||
| 2. Return to the SOP and continue from where you left off | ||
| 3. Do NOT abandon the SOP or start improvising | ||
| 4. If you lose track, retrieve the SOP again, identify your last completed step, and continue | ||
|
|
||
| ## Phase Complete | ||
|
|
||
| After the SOP is fully executed, summarize what was created (which resources, files, configurations). | ||
|
|
||
| This phase is now complete. Do not read other reference files or proceed to the next phase — return control to the orchestrator workflow (SKILL.md). |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's also bump the marketplace version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, when we release. There may be other updates prior to bumping the marketplace version (as they may pull as soon as merged)