/aws-agents-for-devsecops:analyzing-release-readinessfrom aws-agents-for-devsecops
Analyzes code changes on GitHub PRs, GitLab MRs, or local branches for risk, correctness, and rollback issues before merging. Produces a structured report with actionable findings.
Ships in aws-agents-for-devsecops. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
AgentSpace routing (SigV4 only): If
list_agent_spacesis available in your tool list and the multi-space orchestration skill has NOT been invoked yet this session, invoke it first to determine whichagent_space_idto use. Then passagent_space_idon all tool calls below. For bearer token auth this is unnecessary — the token is already scoped to one space.
Run a code change risk analysis via the AWS DevOps Agent. Analyzes a code change for risk, correctness, and potential rollback issues. Returns a structured report with actionable findings.
Rules:
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.Infer everything automatically from the user's request — do not ask for parameters that can be derived.
Input source decision tree:
Has the user provided a pull request/merge request link or ID?
├── Yes: github.com PR URL → use "GitHub PR" flow below
├── Yes: gitlab.com MR URL → use "GitLab MR" flow below
└── No link provided — repo name only → use "Local GitHub/GitLab repo" flow below
repository (required): owner/repo from the PR URLheadSha (commit SHA), headBranch (branch name), prNumber (PR number as a string, e.g. "8" not 8)hostname: Extract from the URL (e.g., github.com or a self-hosted hostname)create_code_change_risk_analysis under content.githubPrContent as an array of objects (even for a single PR).Example:
{
"content": {
"githubPrContent": [
{
"repository": "owner/repo",
"prNumber": "8",
"hostname": "github.com"
}
]
}
}
Critical format rules:
githubPrContentMUST be an array (not a single object).prNumberMUST be a string (not an integer).
repository (required): owner/repo from the MR URLheadSha (commit SHA), headBranch (branch name), mergeRequestIid (MR number as a string, e.g. "1" not 1)hostname: Extract from the URL (e.g., gitlab.com or a self-hosted hostname)create_code_change_risk_analysis under content.gitlabMrContent as an array of objects (even for a single MR).Example:
{
"content": {
"gitlabMrContent": [
{
"repository": "namespace/repo",
"mergeRequestIid": "1",
"hostname": "gitlab.com"
}
]
}
}
Critical format rules:
gitlabMrContentMUST be an array (not a single object).mergeRequestIidMUST be a string (not an integer). Violating either causes immediate task failure with no journal records.
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.
Navigate to the repository directory: cd to the repo root (e.g., the clone directory). Ask the user if needed.
Determine the base branch: Use main unless the user specifies a different branch. Verify the remote tracking branch exists:
BASE_BRANCH="main"
if ! git show-ref --verify --quiet refs/remotes/origin/$BASE_BRANCH; then
git fetch origin $BASE_BRANCH
fi
If the fetch fails (e.g., "couldn't find remote ref"), ask the user to specify the base branch and stop.
Check for local changes: Run git status --short and git rev-list --count origin/$BASE_BRANCH..HEAD to determine the state and communicate accordingly:
Clean AND not ahead: Inform the user there's nothing new to analyze and stop.
Has uncommitted changes (with or without unpushed commits):
"You have uncommitted changes and N unpushed commits. I'll commit your uncommitted changes on top, then push all N+1 commits to a new branch for analysis. All changes will appear as a single diff against the base branch. Shall I proceed?"
"I'll commit your uncommitted changes and push them to a new branch for code change risk analysis. Shall I proceed?"
Clean but ahead of remote (rev-list count > 0, no uncommitted changes):
"You have N unpushed commits. I'll push all of them to a new branch for analysis. All changes will appear as a single diff against the base branch. Shall I proceed?"
"I'll push your latest commit to a new branch for code change risk analysis. Shall I proceed?"
Stash uncommitted changes (skip this step if working directory is clean):
git stash push --include-untracked -m "code-change-risk-analysis: preserve working changes"
Create review branch (do this BEFORE committing so the snapshot commit only lives on the disposable branch):
ORIGINAL_BRANCH=$(git rev-parse --abbrev-ref HEAD)
BRANCH_NAME="feat/code-change-risk-analysis"
git checkout -b $BRANCH_NAME 2>/dev/null || { BRANCH_NAME="feat/code-change-risk-analysis-$(date +%Y%m%d-%H%M%S)"; git checkout -b $BRANCH_NAME; }
Apply stashed changes and commit on the review branch (skip this step if working directory was clean — go straight to step 7):
git stash apply
Before staging, check for sensitive files:
git status --short | grep -iE '\.(env|pem|key|p12|pfx|credentials|secret)'
If sensitive files are detected, warn the user and ask for confirmation before proceeding. If the user declines, abort:
git checkout $ORIGINAL_BRANCH && git branch -D $BRANCH_NAME && git stash drop
Once confirmed (or no sensitive files found):
git add -A
git commit -m "chore: snapshot for code change risk analysis"
Push all unpushed commits (requires prior user approval): If the user already approved the push in step 3, proceed directly. Otherwise (e.g., the flow reached here without an explicit approval prompt), confirm before pushing:
"I'm about to push branch
$BRANCH_NAMEtoorigin. This is a prerequisite step, can I proceed?" Do NOT push until the user approves. If they decline, abort and skip to step 11.
Once approved (or if already approved in step 3):
git push -u origin HEAD
Determine the repository identifier and hostname: Run git remote get-url origin | sed 's|://[^@]*@|://|' to extract the owner/repo and hostname.
githubPrContent, hostname from URLgitlabMrContent, hostname from URLBuild the content: Set headBranch to $BRANCH_NAME, repository to the extracted owner/repo, and hostname to the value from step 8. Wrap the object in an array:
{"githubPrContent": [{"repository": "owner/repo", "headBranch": "feat/code-change-risk-analysis", "hostname": "github.com"}]}{"gitlabMrContent": [{"repository": "namespace/repo", "headBranch": "feat/code-change-risk-analysis", "hostname": "gitlab.com"}]}Inform the user: Tell them which branch was created and pushed, then proceed with the core workflow below.
After analysis completes: Clean up and restore working state:
git checkout $ORIGINAL_BRANCH
git push origin --delete $BRANCH_NAME 2>/dev/null || true
git branch -D $BRANCH_NAME 2>/dev/null || true
If step 4 was executed (uncommitted changes were stashed), also run:
git stash pop
Important: Do NOT create a PR/MR — only push the branch. The code change risk analysis agent will read the branch directly.
STRICT SEQUENCING: Steps below are numbered. You MUST complete each step before moving to the next. In particular, step 1 (automated testing prompt) MUST NOT happen until the entire "Gathering execution parameters" flow above is fully complete — all git operations done, branch pushed (if local flow), content object built, and user informed of the branch. Only THEN proceed to step 1.
review_depth (ask ONLY after content is ready)The review_depth parameter controls how deep the analysis goes: static analysis only, or static analysis plus automated testing (automated verification tests).
| Value | Behavior |
|---|---|
static-analysis | Static analysis only, no automated testing (fast — code review, risk assessment, dependency checks) |
verification-testing | Full analysis including automated testing (longer — spins up a testing environment, builds code, runs automated verification tests). Automated testing runs only on repositories where it is enabled in the agent space. |
Present the choice and wait for a response:
"Would you like a quick static analysis (code review, risk assessment, dependency checks), or a full analysis that also includes automated testing? Automated testing spins up a testing environment, builds your code, and runs automated verification tests — it's more thorough but takes longer."
Do NOT proceed until the user answers.
review_depth="verification-testing"review_depth="static-analysis"Verify that the following tools are available: aws_devops_agent__create_code_change_risk_analysis, aws_devops_agent__get_task, aws_devops_agent__list_journal_records, aws_devops_agent__get_code_change_risk_analysis_report. These tools are NOT deferred/lazy-loaded — if they do not appear in your tool list, they are unavailable. Do NOT search for them via ToolSearch. If any are missing, skip the remaining steps in this section and use the "Fallback (aws-mcp)" path below instead. Tell the user: "Remote server unavailable — using direct aws-mcp server fallback."
aws_devops_agent__create_code_change_risk_analysis(
content={...},
review_depth="static-analysis" | "verification-testing"
)
→ {"taskId": "...", "executionId": "...", "status": "started"}
Record the taskId and executionId from the response.
Call aws_devops_agent__get_task(task_id=TASK_ID) every 30 seconds until the status transitions to IN_PROGRESS or a terminal state (COMPLETED, FAILED, CANCELED, TIMED_OUT).
Once IN_PROGRESS, poll for progress in a loop:
aws_devops_agent__list_journal_records(execution_id=EXEC_ID, order="ASC") to fetch new findings.next_token from the response to fetch only new records on subsequent polls.aws_devops_agent__get_task(task_id=TASK_ID) periodically — stop when terminal status.Once the job reaches a terminal status:
COMPLETED:
Call aws_devops_agent__get_code_change_risk_analysis_report(execution_id=EXEC_ID) to retrieve the full report.
Write the report contents to a markdown file:
code-change-risk-analysis-<YYYY-MM-DD-HHmmss>.md
Inform the user that the report was saved, including the file path.
Auto-fix flow (MANDATORY): After saving the report, you MUST attempt to generate and present fixes for all actionable risks — this is the primary value of the review workflow, not an optional step.
ls to list available directories in the workspace.owner/repo or namespace/repo). For example, testgroupadthiru/repo1updated → look for a directory named repo1updated.<match> — is this the correct local copy of <namespace/repo>?"<repo-name>. Is it available locally under a different name, or should I just show the suggested fixes?"Verify branch: Run git -C <repo-directory> branch --show-current to confirm you're on the expected branch. If not on the expected branch, check out the correct one before proceeding.
Scan the relevant code, interpret the risks/issues from the report. Then tell the user:
"The report identified N actionable issues. I can generate the fixes in your local repository, and push them to a new branch
feat/code-change-risk-analysis-fix. Shall I proceed?"
Do NOT proceed until the user approves. If they decline, stop.
Once approved, generate the fixes. Then:
cd <repo-directory>
git checkout -b feat/code-change-risk-analysis-fix 2>/dev/null || { git checkout -b "feat/code-change-risk-analysis-fix-$(date +%Y%m%d-%H%M%S)"; }
# Apply the fixes
git add -A
git commit -m "fix: Address issues identified by code change risk analysis"
Before pushing, verify branch again: Run git branch --show-current and confirm it shows feat/code-change-risk-analysis-fix*. Do NOT push if you're on any other branch.
git push -u origin HEAD
Inform the user: which issues were fixed, what branch was created, and that the fix has been pushed.
suggestedFix field from each risk. Format them as code blocks the user can copy-paste directly. Walk through each actionable risk: explain the issue, show the exact fix, and state which file/line it targets.FAILED or TIMED_OUT: Present the error information and suggest next steps.CANCELED: Inform the user the job was canceled and no report is available.If the user asks about an earlier analysis and its task ID isn't in context, call aws_devops_agent__list_code_change_risk_analyses(). It returns analyses newest first, including ones created as release readiness reviews. Pick the one that matches (by title, or by repository in its description), then use its taskId with aws_devops_agent__get_task and its executionId with aws_devops_agent__get_code_change_risk_analysis_report.
aws_devops_agent__cancel_code_change_risk_analysis(task_id=TASK_ID)
FAILED or TIMED_OUT — stop and present the error. If the job failed quickly (within the first poll or two), call aws_devops_agent__list_associations() to check whether the target repository's hosting service (GitHub/GitLab hostname) is associated with the agent space.IN_PROGRESS within 5 minutes — cancel with cancel_code_change_risk_analysis.429 or ThrottlingException) — wait 30 seconds, retry up to 3 times.review_depth) and how to resolve them.If the aws-devops-agent remote server is unavailable, use the AWS CLI directly:
Tell the user: "Remote server unavailable — using the aws-mcp server fallback."
List available agent spaces:
aws devops-agent list-agent-spaces --region us-east-1
Present the list to the user and ask which agent space they'd like to use. Do NOT proceed until the user has selected one. Use the selected agentSpaceId as SPACE_ID in all subsequent calls.
aws devops-agent create-backlog-task \
--agent-space-id SPACE_ID \
--task-type CODE_CHANGE_RISK_ANALYSIS \
--title 'Code Change Risk Analysis' \
--priority MEDIUM \
--description '{\"agentInput\": {\"content\": <CONTENT_JSON>, \"metadata\": {\"reviewDepth\": \"static-analysis\", \"skipAutomatedTesting\": true}}}' \
--region us-east-1
CRITICAL: The
contentvalue must be a single object — NOT wrapped in a list. Correct:"content": {"githubPrContent": [...]}. Incorrect:"content": [{"githubPrContent": [...]}]. Wrapping in a list causes a Pydantic validation failure on the backend. The values in the content should all be of string format e.g. the PR number should be a string.
Default is "reviewDepth": "static-analysis" with "skipAutomatedTesting": true (static only). Set "reviewDepth": "verification-testing" with "skipAutomatedTesting": false only if the user explicitly opted into automated testing. Always set both together.
aws devops-agent get-backlog-task \
--agent-space-id SPACE_ID \
--task-id TASK_ID \
--region us-east-1
Poll every 30 seconds until the status transitions to IN_PROGRESS or a terminal state (COMPLETED, FAILED, CANCELED, TIMED_OUT).
Once IN_PROGRESS, poll for progress in a loop:
aws devops-agent list-journal-records \
--agent-space-id SPACE_ID \
--execution-id EXEC_ID \
--order ASC \
--region us-east-1
next_token from the response to fetch only new records on subsequent polls.get-backlog-task periodically — stop when terminal status.Once the job reaches a terminal status:
COMPLETED:
Retrieve the report:
aws devops-agent list-journal-records \
--agent-space-id SPACE_ID \
--execution-id EXEC_ID \
--record-type release_analysis_report \
--order ASC \
--region us-east-1
Write the report contents to a markdown file:
code-change-risk-analysis-<YYYY-MM-DD-HHmmss>.md
Inform the user that the report was saved, including the file path.
Auto-fix flow (MANDATORY): After saving the report, you MUST attempt to generate and present fixes for all actionable risks — this is the primary value of the review workflow, not an optional step. Follow the same auto-fix flow described in the Core workflow section above (locate repo, verify branch, generate fixes, push to feat/code-change-risk-analysis-fix).
FAILED or TIMED_OUT: Present the error information and suggest next steps.CANCELED: Inform the user the job was canceled and no report is available.aws devops-agent update-backlog-task \
--agent-space-id SPACE_ID \
--task-id TASK_ID \
--task-status CANCELED \
--region us-east-1
What SKILL.md sets; muted values are Claude Code's defaults
13 skills in this plugin
/chatting-with-aws-devops-agentHave a fast, conversational analysis with the AWS DevOps Agent. Use for cost optimization, architecture review, topology mapping, knowledge / runbook discovery, security audits, dependency questions, and quick diagnostics — anything that needs a 5-30 second answer rather than a 5-8 minute deep investigation. Trigger words include cost, optimize, review, architecture, topology, what runbooks, show me, compare, audit, what if./coordinating-multi-space-devops-agentCoordinate the AWS DevOps Agent across multiple AgentSpaces from one Claude Code session — route questions to the right space (prod vs staging vs knowledge), query several spaces in parallel and synthesize, or compare findings across accounts. Use whenever the user has more than one AgentSpace configured, mentions multiple AWS accounts, or asks something like "check both prod and staging", "compare across accounts", or "ask the knowledge space"./diff-scanning-with-aws-security-agentRun a fast AWS Security Agent diff scan on only the changed code since a git ref. Use when the user asks to scan changes, run a diff scan, check what changed for security issues, scan before committing, scan before PR, or any pre-commit/pre-push security check./investigating-incidents-with-aws-devops-agentRun a deep root-cause investigation on the AWS DevOps Agent. Use when the user describes an incident, alarm, outage, or unexplained behavior — keywords like "5xx", "503", "OOM", "latency spike", "deployment failure", "rollback", "sev1", "investigate", "root cause", "debug", "alarm fired", "service down". Polls and streams progress, then surfaces recommendations./pentesting-with-aws-security-agentRun an AWS Security Agent penetration test against a live web application — registers and verifies the target domain, exercises the supplied endpoints with the managed Security Agent service, and returns verified runtime findings. Use when the user asks to pentest, run a penetration test, test their app's attack surface, find runtime vulnerabilities, register or verify a target domain, or check pentest status / findings./remediating-with-aws-security-agentPull AWS Security Agent findings (penetration tests and code reviews) and drive remediation. Use this whenever the user mentions Security Agent, security findings, pentest or penetration test results, code review findings, vulnerabilities found in their AWS account, "what did the security scan find", remediating or triaging security risks, or wants to start fixing reported vulnerabilities — even if they don't name the service explicitly. Trigger it for phrases like "get my security findings", "what vulnerabilities do we have", "let's fix the pentest results", or "triage the security report". The skill discovers scans, exports findings to a gitignored local directory (so sensitive exploit detail is never committed), produces a prioritized triage summary, and offers to start fixing the highest-risk issues.npx claudepluginhub aws/agent-toolkit-for-aws --plugin aws-agents-for-devsecopsOther plugins' skills for the same job