$npx -y skills add aws/agent-toolkit-for-aws --skill analyzing-release-readinessTrigger a pre-merge release readiness review on a GitHub PR, GitLab MR, or local branch. Use when the user wants to analyze code changes for risk, correctness, and potential rollback issues before merging. Trigger words include release readiness, analyze PR, analyze MR, review PR
| 1 | # Release Readiness Review |
| 2 | |
| 3 | > **AgentSpace routing (SigV4 only):** If `list_agent_spaces` is available in your tool list and the multi-space orchestration skill has NOT been invoked yet this session, invoke it first to determine which `agent_space_id` to use. Then pass `agent_space_id` on all tool calls below. For bearer token auth this is unnecessary — the token is already scoped to one space. |
| 4 | |
| 5 | Run a release readiness review via the AWS DevOps Agent. Analyzes a code change for risk, correctness, and potential rollback issues. Returns a structured report with actionable findings. |
| 6 | |
| 7 | **Rules:** |
| 8 | |
| 9 | - If a **PR/MR URL** is provided: Extract ALL fields from the URL. Do NOT inspect the local workspace or git state. |
| 10 | - **NEVER use `gh` CLI, `glab` CLI, or any external tool to fetch PR/MR details.** All required fields (repository, prNumber/mergeRequestIid, hostname) MUST be parsed directly from the URL or user input. The DevOps Agent fetches the content itself — you only need to pass identifiers. |
| 11 | - **Only** use the local workspace flows when the user references a repository or package **without** a PR/MR link. |
| 12 | |
| 13 | ## Gathering execution parameters |
| 14 | |
| 15 | Infer everything automatically from the user's request — do not ask for parameters that can be derived. |
| 16 | |
| 17 | **Input source decision tree:** |
| 18 | |
| 19 | ``` |
| 20 | Has the user provided a pull request/merge request link or ID? |
| 21 | ├── Yes: github.com PR URL → use "GitHub PR" flow below |
| 22 | ├── Yes: gitlab.com MR URL → use "GitLab MR" flow below |
| 23 | └── No link provided — repo name only → use "Local GitHub/GitLab repo" flow below |
| 24 | ``` |
| 25 | |
| 26 | --- |
| 27 | |
| 28 | ### GitHub PR (github.com URL or PR reference) |
| 29 | |
| 30 | - Parse the input to extract fields — do NOT attempt a web fetch unless fields cannot be determined from the input. |
| 31 | - `repository` (required): `owner/repo` from the PR URL |
| 32 | - At least one of the following is required: `headSha` (commit SHA), `headBranch` (branch name), `prNumber` (PR number as a **string**, e.g. `"8"` not `8`) |
| 33 | - `hostname`: Extract from the URL (e.g., `github.com` or a self-hosted hostname) |
| 34 | - Pass these fields to `create_release_readiness_review` under `content.githubPrContent` as an **array of objects** (even for a single PR). |
| 35 | |
| 36 | **Example:** |
| 37 | |
| 38 | ```json |
| 39 | { |
| 40 | "content": { |
| 41 | "githubPrContent": [ |
| 42 | { |
| 43 | "repository": "owner/repo", |
| 44 | "prNumber": "8", |
| 45 | "hostname": "github.com" |
| 46 | } |
| 47 | ] |
| 48 | } |
| 49 | } |
| 50 | ``` |
| 51 | |
| 52 | > **Critical format rules**: `githubPrContent` MUST be an array (not a single object). `prNumber` MUST be a string (not an integer). |
| 53 | |
| 54 | --- |
| 55 | |
| 56 | ### GitLab MR (gitlab.com URL) |
| 57 | |
| 58 | - Parse the input to extract fields — do NOT attempt a web fetch unless fields cannot be determined from the input. |
| 59 | - `repository` (required): `owner/repo` from the MR URL |
| 60 | - At least one of the following is required: `headSha` (commit SHA), `headBranch` (branch name), `mergeRequestIid` (MR number as a **string**, e.g. `"1"` not `1`) |
| 61 | - `hostname`: Extract from the URL (e.g., `gitlab.com` or a self-hosted hostname) |
| 62 | - Pass these fields to `create_release_readiness_review` under `content.gitlabMrContent` as an **array of objects** (even for a single MR). |
| 63 | |
| 64 | **Example:** |
| 65 | |
| 66 | ```json |
| 67 | { |
| 68 | "content": { |
| 69 | "gitlabMrContent": [ |
| 70 | { |
| 71 | "repository": "namespace/repo", |
| 72 | "mergeRequestIid": "1", |
| 73 | "hostname": "gitlab.com" |
| 74 | } |
| 75 | ] |
| 76 | } |
| 77 | } |
| 78 | ``` |
| 79 | |
| 80 | > **Critical format rules**: `gitlabMrContent` MUST be an array (not a single object). `mergeRequestIid` MUST be a string (not an integer). Violating either causes immediate task failure with no journal records. |
| 81 | |
| 82 | --- |
| 83 | |
| 84 | ### Local GitHub/GitLab repo (no PR/MR URL provided — local workspace ONLY) |
| 85 | |
| 86 | **MANDATORY**: When the user references a repository or branch without a PR/MR link, you MUST execute every step below in order. Do NOT shortcut by grabbing the remote URL and SHA directly — the review agent needs a pushed branch to read from. Skipping the push step will cause the analysis to fail or produce incomplete results. |
| 87 | |
| 88 | 1. **Navigate to the repository directory**: `cd` to the repo root (e.g., the clone directory). Ask the user if needed. |
| 89 | 2. **Determine the base branch**: Use `main` unless the user specifies a different branch. Verify the remote tracking branch exists: |
| 90 | |
| 91 | ```bash |
| 92 | BASE_BRANCH="main" |
| 93 | if ! git show-ref --verify --quiet refs/remotes/origin/$BASE_BRANCH; then |
| 94 | git fetch origin $BASE_BRANCH |
| 95 | fi |
| 96 | ``` |
| 97 | |
| 98 | If the fetch fails (e.g., "couldn't find remote ref"), ask the user to specify the base branch and stop. |
| 99 | 3. **Check for local changes**: Run `git status |