diff --git a/README.md b/README.md index de54498..c478c1c 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Documentation is available at https://kiro.dev/docs/powers/ --- ### aws-devops-agent -**AWS DevOps Agent** - AI agent for AWS operational intelligence. Investigate incidents, optimize costs, review architecture, map topology, chat with the agent, get remediation, run automated release tests (UI and API), and trigger pre-merge release readiness reviews — all enhanced with your local workspace context. +**AWS DevOps Agent** - AI agent for AWS operational intelligence. Investigate incidents, optimize costs, review architecture, map topology, chat with the agent, get remediation, run automated release tests (UI and API), and trigger pre-merge code change risk analyses — all enhanced with your local workspace context. **MCP Servers:** aws-devops-agent (remote MCP Server, supports Bearer token + SigV4 auth), aws-mcp diff --git a/aws-devops-agent/POWER.md b/aws-devops-agent/POWER.md index 9a17867..c79b7bf 100644 --- a/aws-devops-agent/POWER.md +++ b/aws-devops-agent/POWER.md @@ -1,7 +1,7 @@ --- name: "aws-devops-agent" displayName: "AWS DevOps Agent" -description: "AI agent for AWS operational intelligence. Investigate incidents, optimize costs, review architecture, map topology, chat with the agent, get remediation, run automated release tests (UI and API), and trigger pre-merge release readiness reviews — all enhanced with your local workspace context." +description: "AI agent for AWS operational intelligence. Investigate incidents, optimize costs, review architecture, map topology, chat with the agent, get remediation, run automated release tests (UI and API), and trigger pre-merge code change risk analyses — all enhanced with your local workspace context." keywords: - "devops" - "investigation" @@ -33,6 +33,9 @@ keywords: - "end-to-end" - "release" - "release readiness" + - "code change risk analysis" + - "ccra" + - "change review" - "release testing" - "code review" - "pull request" @@ -67,7 +70,7 @@ You are enhanced with the **AWS DevOps Agent**, an AI-powered operational intell **Your superpower**: Combine local workspace knowledge (files, git, terminal) with the DevOps Agent's cloud knowledge (CloudWatch, X-Ray, IAM, topology) by packing local context into tool parameters. -**Extended capabilities**: In addition to investigations and chat, you can run **automated release testing** (UI and API) against pre-configured test profiles, and trigger **pre-merge release readiness reviews** on GitHub PRs, GitLab MRs, or local branches. +**Extended capabilities**: In addition to investigations and chat, you can run **automated release testing** (UI and API) against pre-configured test profiles, and trigger **pre-merge code change risk analyses** on GitHub PRs, GitLab MRs, or local branches. --- @@ -122,13 +125,14 @@ Two auth options. Both connect to the same remote DevOps Agent endpoint — they | `get_release_ui_testing_report` | Retrieve the final UI test report | `agent:read` | | `get_release_api_testing_report` | Retrieve the final API test report | `agent:read` | -### Release Readiness Review +### Code Change Risk Analysis | Tool | Purpose | Scope | |------|---------|-------| -| `create_release_readiness_review` | Start release readiness review on a PR | `agent:operate` | -| `cancel_release_readiness_review` | Cancel a running release readiness review | `agent:operate` | -| `get_release_readiness_report` | Retrieve the final release readiness report | `agent:read` | +| `create_code_change_risk_analysis` | Start code change risk analysis on a PR | `agent:operate` | +| `list_code_change_risk_analyses` | List code change risk analyses, newest first | `agent:read` | +| `cancel_code_change_risk_analysis` | Cancel a running code change risk analysis | `agent:operate` | +| `get_code_change_risk_analysis_report` | Retrieve the final code change risk analysis report | `agent:read` | ### Recommendations @@ -169,8 +173,8 @@ The tools visible to you depend on the authentication method and token scope: | Scope | Available Tools | Notes | |-------|----------------|-------| -| Bearer `agent:read` | `get_agent_space`, `list_associations`, `get_task`, `list_tasks`, `list_journal_records`, `list_executions`, `list_recommendations`, `get_recommendation`, `list_goals`, `list_chats`, QA reports | Read-only — can poll investigations but NOT start them | -| Bearer `agent:operate` | All read tools + `investigate`, `chat`, `create_chat`, `send_message`, `create_investigation`, `update_recommendation`, `start_evaluation`, `create_release_testing_job`, `cancel_release_testing_job`, `create_release_readiness_review`, `cancel_release_readiness_review` | Full agent interaction — **this is the recommended scope** | +| Bearer `agent:read` | `get_agent_space`, `list_associations`, `get_task`, `list_tasks`, `list_journal_records`, `list_executions`, `list_recommendations`, `get_recommendation`, `list_goals`, `list_chats`, QA reports, `list_code_change_risk_analyses`, `get_code_change_risk_analysis_report` | Read-only — can poll investigations but NOT start them | +| Bearer `agent:operate` | All read tools + `investigate`, `chat`, `create_chat`, `send_message`, `create_investigation`, `update_recommendation`, `start_evaluation`, `create_release_testing_job`, `cancel_release_testing_job`, `create_code_change_risk_analysis`, `cancel_code_change_risk_analysis` | Full agent interaction — **this is the recommended scope** | | SigV4 (fallback `aws-mcp`) | All tools + `list_agent_spaces`, `list_services`, `get_service` | Limited only by IAM policy, not token scope | **Key behaviors:** @@ -197,11 +201,11 @@ When the user describes a problem, **automatically choose the right workflow**: **Action**: Load `steering/release-testing.md` for workflow details, then `create_release_testing_job(test_profile_id="...")` → poll `get_task` + `list_journal_records` → `get_release_ui_testing_report` or `get_release_api_testing_report` -### → Release Readiness Review (pre-merge, 10+ min) +### → Code Change Risk Analysis (pre-merge, 10+ min) -**Triggers**: release analysis, analyze PR, analyze MR, review PR, risk analysis, pre-merge, safe to ship, ready to merge, ready to commit, any risks, before merging, validate changes, release management, pull request +**Triggers**: code change risk analysis, CCRA, release readiness review, RRR, code review, change review, release analysis, analyze PR, analyze MR, review PR, risk analysis, pre-merge, safe to ship, ready to merge, ready to commit, any risks, before merging, validate changes, release management, pull request -**Action**: Load `steering/release-readiness.md` for content format, then `create_release_readiness_review(content={...})` → poll `get_task` + `list_journal_records` → `get_release_readiness_report` +**Action**: Load `steering/release-readiness.md` for content format, then `create_code_change_risk_analysis(content={...})` → poll `get_task` + `list_journal_records` → `get_code_change_risk_analysis_report` ### → Chat (fast, real-time 5-30s) **Triggers**: cost, optimize, architecture, review, topology, dependency, security, audit, what if, compare, plan, knowledge, skills, runbooks, capabilities, what do you know @@ -220,7 +224,7 @@ Default to `chat` — it's instant and the agent can suggest investigation if wa | `chat` | 5-30s | Depends on query complexity; simple questions ~5s, detailed analysis ~20-30s | | `investigate` | 5-8 min | Async — poll with `get_task` every 30-45s | | `create_release_testing_job` | 10+ min | Async — poll with `get_task` every 30-45s | -| `create_release_readiness_review` | 10+ min | Async — poll with `get_task` every 30-45s | +| `create_code_change_risk_analysis` | 10+ min | Async — poll with `get_task` every 30-45s | | `get_task`, `list_journal_records` | 1-3s | Standard API calls | | `list_agent_spaces`, `get_agent_space` | 1-2s | Lightweight discovery (`list_agent_spaces` SigV4 only) | @@ -274,9 +278,9 @@ send_message(execution_id="exec-123", content="Detail the ECS costs") → answer > ⚠️ **MANDATORY**: You MUST load the steering file `steering/release-testing.md` before executing this workflow. Do NOT attempt to call release testing tools without reading the full instructions first. -### Release Readiness Review (Pre-Merge, 10+ min) +### Code Change Risk Analysis (Pre-Merge, 10+ min) -> ⚠️ **MANDATORY**: You MUST load the steering file `steering/release-readiness.md` before executing this workflow. Do NOT attempt to call release readiness review tools without reading the full instructions first. +> ⚠️ **MANDATORY**: You MUST load the steering file `steering/release-readiness.md` before executing this workflow. Do NOT attempt to call code change risk analysis tools without reading the full instructions first. --- @@ -348,7 +352,7 @@ Stream: aws___call_aws("aws devops-agent list-journal-records --agent-space-id S **Release testing fallback** — see `steering/release-testing.md` for the aws-mcp flow. -**Release readiness review fallback** — see `steering/release-readiness.md` for the aws-mcp flow. +**Code change risk analysis fallback** — see `steering/release-readiness.md` for the aws-mcp flow. See `steering/steering.md` for complete fallback instructions. @@ -409,26 +413,26 @@ Pass `agent_space_id` explicitly in tool args when targeting a specific space. Check if `.kiro/hooks/devops-agent-post-spec-completion.kiro.hook` already exists in the workspace. - If it exists → continue silently (do not mention it). - If it does NOT exist: - - Tell the user: "Adding a hook that will suggest a release readiness review after each spec task completes. You can opt out — just say 'skip the hook' or delete `.kiro/hooks/devops-agent-post-spec-completion.kiro.hook` anytime." + - Tell the user: "Adding a hook that will suggest a code change risk analysis after each spec task completes. You can opt out — just say 'skip the hook' or delete `.kiro/hooks/devops-agent-post-spec-completion.kiro.hook` anytime." - **Default action: install the hook.** Only skip if the user replies with an opt-out ("skip", "no", "don't install", "not now"). - Create `.kiro/hooks/devops-agent-post-spec-completion.kiro.hook` with: ```json { "enabled": true, - "name": "Release Readiness Review — Auto-run on Spec Task Completion", - "description": "After each spec task completes, automatically run release readiness review if changes are substantial", + "name": "Code Change Risk Analysis — Auto-run on Spec Task Completion", + "description": "After each spec task completes, automatically run code change risk analysis if changes are substantial", "version": "1", "when": { "type": "postTaskExecution" }, "then": { "type": "askAgent", - "prompt": "A spec task just completed. Evaluate the changes made during this task. If the changes are substantial enough to warrant a release readiness review (e.g., multiple files modified, logic changes, new APIs, dependency updates, security-sensitive code, infrastructure changes), immediately run the release readiness review workflow from the aws-devops-agent power autonomously — do not ask the user for confirmation. Skip the branch creation confirmation step in the local flow and proceed without asking for approval to create/push the branch. If the changes are trivial (e.g., a single typo fix, comment update, formatting-only, renaming a variable), do nothing." + "prompt": "A spec task just completed. Evaluate the changes made during this task. If the changes are substantial enough to warrant a code change risk analysis (e.g., multiple files modified, logic changes, new APIs, dependency updates, security-sensitive code, infrastructure changes), immediately run the code change risk analysis workflow from the aws-devops-agent power autonomously — do not ask the user for confirmation. Skip the branch creation confirmation step in the local flow and proceed without asking for approval to create/push the branch. If the changes are trivial (e.g., a single typo fix, comment update, formatting-only, renaming a variable), do nothing." } } ``` - - Confirm: "Hook installed. I'll automatically run release readiness review after spec tasks that make substantial changes." - - If the user opts out: "Skipping the hook. Say 'install release-readiness-review hook' anytime to set it up later." Do not ask again this session. + - Confirm: "Hook installed. I'll automatically run code change risk analysis after spec tasks that make substantial changes." + - If the user opts out: "Skipping the hook. Say 'install the code change risk analysis hook' anytime to set it up later." Do not ask again this session. --- @@ -457,7 +461,8 @@ These tools are read-only and cannot modify any AWS resource or DevOps Agent sta "list_chats", "get_release_ui_testing_report", "get_release_api_testing_report", - "get_release_readiness_report" + "list_code_change_risk_analyses", + "get_code_change_risk_analysis_report" ] }, "aws-mcp": { @@ -478,7 +483,7 @@ These tools are read-only and cannot modify any AWS resource or DevOps Agent sta ### What still requires approval -**aws-devops-agent**: Mutation tools (`chat`, `send_message`, `investigate`, `create_investigation`, `create_release_testing_job`, `create_release_readiness_review`, `cancel_release_testing_job`, `cancel_release_readiness_review`, `create_agent_space`, `update_recommendation`). +**aws-devops-agent**: Mutation tools (`chat`, `send_message`, `investigate`, `create_investigation`, `create_release_testing_job`, `create_code_change_risk_analysis`, `cancel_release_testing_job`, `cancel_code_change_risk_analysis`, `create_agent_space`, `update_recommendation`). **aws-mcp**: `aws___call_aws` and `aws___run_script` can perform both reads and writes, so they cannot be safely auto-approved. diff --git a/aws-devops-agent/steering/release-readiness.md b/aws-devops-agent/steering/release-readiness.md index f033037..eca6314 100644 --- a/aws-devops-agent/steering/release-readiness.md +++ b/aws-devops-agent/steering/release-readiness.md @@ -1,19 +1,19 @@ --- name: release-readiness -description: Guide for running release readiness reviews via the aws-devops-agent remote MCP server (typed tools). Use when the user wants to trigger a release readiness review, check execution status, view execution journal, or cancel a review. +description: Guide for running code change risk analyses (formerly release readiness reviews) via the aws-devops-agent remote MCP server (typed tools). Use when the user wants to trigger a code change risk analysis, release readiness review, code review or change review on a PR/MR, check execution status, view execution journal, or cancel a review. --- ## Overview -This skill uses the typed tools from the `aws-devops-agent` remote MCP server to run release readiness reviews via the Release Readiness Review Agent. It handles the full execution lifecycle — starting reviews, polling for progress, streaming journal output, and retrieving the final release readiness report. +This skill uses the typed tools from the `aws-devops-agent` remote MCP server to run code change risk analyses via the Code Change Risk Analysis Agent. It handles the full execution lifecycle — starting reviews, polling for progress, streaming journal output, and retrieving the final code change risk analysis report. ## Usage Use this skill when: -- You want to trigger a release readiness review on a code change before merging -- You want to check the status of a release readiness review execution -- You want to view the journal/progress of a running release readiness review -- You want to cancel a release readiness review +- You want to trigger a code change risk analysis on a code change before merging +- You want to check the status of a code change risk analysis execution +- You want to view the journal/progress of a running code change risk analysis +- You want to cancel a code change risk analysis ## Instructions @@ -46,7 +46,7 @@ Has the user provided a pull request/code review/merge request link or ID? - `repository` (required): `owner/repo` from the PR URL - 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`) - `hostname`: Extract from the URL (e.g., `github.com` or a self-hosted hostname) -- Pass these fields to `create_release_readiness_review` under `content.githubPrContent` as an **array of objects** (even for a single PR). +- Pass these fields to `create_code_change_risk_analysis` under `content.githubPrContent` as an **array of objects** (even for a single PR). **Example:** ```json @@ -73,7 +73,7 @@ Has the user provided a pull request/code review/merge request link or ID? - `repository` (required): `owner/repo` from the MR URL - 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`) - `hostname`: Extract from the URL (e.g., `gitlab.com` or a self-hosted hostname) -- Pass these fields to `create_release_readiness_review` under `content.gitlabMrContent` as an **array of objects** (even for a single MR). +- Pass these fields to `create_code_change_risk_analysis` under `content.gitlabMrContent` as an **array of objects** (even for a single MR). **Example:** ```json @@ -115,7 +115,7 @@ When the user references a repository without a PR/MR link, use this flow: - If there are one or more unpushed commits (rev-list count >= 1), tell the user: > "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?" - If there are no other unpushed commits (rev-list count = 0), tell the user: - > "I'll commit your uncommitted changes and push them to a new branch for release readiness review. Shall I proceed?" + > "I'll commit your uncommitted changes and push them to a new branch for code change risk analysis. Shall I proceed?" - If triggered by a hook/spec task, skip the confirmation and proceed directly. - **Do NOT proceed until the user approves.** If they decline, stop. If the user specifies a different scope, adjust accordingly. @@ -123,20 +123,20 @@ When the user references a repository without a PR/MR link, use this flow: - If ahead by more than 1 commit, tell the user: > "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?" - If ahead by exactly 1 commit, tell the user: - > "I'll push your latest commit to a new branch for release readiness review. Shall I proceed?" + > "I'll push your latest commit to a new branch for code change risk analysis. Shall I proceed?" - If triggered by a hook/spec task, skip the confirmation and proceed directly. - **Do NOT proceed until the user approves.** If they decline, stop. 4. **Stash uncommitted changes** (skip this step if working directory is clean): ```bash - git stash push --include-untracked -m "release-analysis: preserve working changes" + git stash push --include-untracked -m "code-change-risk-analysis: preserve working changes" ``` 5. **Create review branch** (do this BEFORE committing so the snapshot commit only lives on the disposable branch): ```bash ORIGINAL_BRANCH=$(git rev-parse --abbrev-ref HEAD) - BRANCH_NAME="feat/release-readiness-review" - git checkout -b $BRANCH_NAME 2>/dev/null || { BRANCH_NAME="feat/release-readiness-review-$(date +%Y%m%d-%H%M%S)"; git checkout -b $BRANCH_NAME; } + 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; } ``` 6. **Apply stashed changes and commit on the review branch** (skip this step if working directory was clean — go straight to step 7): @@ -155,7 +155,7 @@ When the user references a repository without a PR/MR link, use this flow: Once confirmed (or no sensitive files found): ```bash git add -A - git commit -m "chore: snapshot for release readiness review" + git commit -m "chore: snapshot for code change risk analysis" ``` 7. **Push all unpushed commits**: @@ -168,8 +168,8 @@ When the user references a repository without a PR/MR link, use this flow: - GitLab URLs (gitlab.com or self-hosted) → use `gitlabMrContent`, hostname from URL 9. **Build 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: - - GitHub: `{"githubPrContent": [{"repository": "owner/repo", "headBranch": "feat/release-readiness-review", "hostname": "github.com"}]}` - - GitLab: `{"gitlabMrContent": [{"repository": "namespace/repo", "headBranch": "feat/release-readiness-review", "hostname": "gitlab.com"}]}` + - GitHub: `{"githubPrContent": [{"repository": "owner/repo", "headBranch": "feat/code-change-risk-analysis", "hostname": "github.com"}]}` + - GitLab: `{"gitlabMrContent": [{"repository": "namespace/repo", "headBranch": "feat/code-change-risk-analysis", "hostname": "gitlab.com"}]}` 10. **Inform the user**: Tell them which branch was created and pushed, then proceed with the standard workflow below. 11. **After analysis completes**: Clean up and restore working state: @@ -183,7 +183,7 @@ When the user references a repository without a PR/MR link, use this flow: git stash pop ``` -**Important**: Do NOT create a PR/MR — only push the branch. The release readiness review agent will read the branch directly. +**Important**: Do NOT create a PR/MR — only push the branch. The code change risk analysis agent will read the branch directly. ### Core workflow @@ -212,11 +212,11 @@ The `skip_automated_testing` parameter controls whether the agent runs automated #### 2. Check tool availability -Verify that the `create_release_readiness_review` tool is available. If it is not present, use the Fallback (aws-mcp) path described at the bottom of this document instead of continuing with the steps below. +Verify that the `create_code_change_risk_analysis` tool is available. If it is not present, use the Fallback (aws-mcp) path described at the bottom of this document instead of continuing with the steps below. #### 3. Start the Job -Call `create_release_readiness_review` with: +Call `create_code_change_risk_analysis` with: - `content`: the content object built above (containing `githubPrContent` or `gitlabMrContent`) - `skip_automated_testing`: `true` in spec mode (always). In vibe mode, `true` or `false` based on user's response to the prompt in step 1. @@ -240,10 +240,10 @@ Once `IN_PROGRESS`, poll for progress in a loop: Once the job reaches a terminal status: - If `COMPLETED`: - 1. Call `get_release_readiness_report(execution_id=EXEC_ID)` to retrieve the full release readiness report. + 1. Call `get_code_change_risk_analysis_report(execution_id=EXEC_ID)` to retrieve the full code change risk analysis report. 2. Write the report contents to a markdown file: ``` - release-readiness-review-.md + code-change-risk-analysis-.md ``` 3. Inform the user that the report was saved, including the file path. 4. **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. Do NOT skip this step under any circumstances when risks are identified. @@ -259,17 +259,17 @@ Once the job reaches a terminal status: - Scan the relevant code, interpret the risks/issues from the report. Then: - If triggered by a hook/spec task, skip the confirmation and proceed directly. - Otherwise, tell the user: - > "The report identified N actionable issues. I can generate the fixes in your local repository, and can push them to a new branch `feat/release-readiness-fix`. Shall I proceed?" + > "The report identified N actionable issues. I can generate the fixes in your local repository, and can 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: ```bash cd - git checkout -b feat/release-readiness-fix 2>/dev/null || { git checkout -b "feat/release-readiness-fix-$(date +%Y%m%d-%H%M%S)"; } + 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 release readiness review" + 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/release-readiness-fix*`. Do NOT push if you're on any other branch (e.g., `main`, the original feature branch). + - **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 (e.g., `main`, the original feature branch). ```bash git push -u origin HEAD ``` @@ -279,14 +279,18 @@ Once the job reaches a terminal status: - If `FAILED` or `TIMED_OUT`: Present the error information and suggest next steps. - If `CANCELED`: Inform the user the job was canceled and no report is available. +### Finding an earlier analysis + +If the user asks about an earlier analysis and its task ID isn't in context, call `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 `get_task` and its `executionId` with `get_code_change_risk_analysis_report`. + ### Cancelling a job -Call `cancel_release_readiness_review(task_id=TASK_ID)`. +Call `cancel_code_change_risk_analysis(task_id=TASK_ID)`. ### Error handling 1. If `FAILED` or `TIMED_OUT` — stop and present the error. If the job failed quickly (within the first poll or two), call `list_associations` to check whether the target repository's hosting service (GitHub/GitLab hostname) is associated with the agent space. If no matching association exists, inform the user that the repository's source provider needs to be associated with their agent space before analysis can run. -2. If job does not reach `IN_PROGRESS` within 5 minutes — cancel with `cancel_release_readiness_review`. +2. If job does not reach `IN_PROGRESS` within 5 minutes — cancel with `cancel_code_change_risk_analysis`. 3. If throttled (`429` or `ThrottlingException`) — wait 30 seconds, retry up to 3 times. 4. If the error does not match any known pattern above, present the raw error output to the user. @@ -294,15 +298,15 @@ Call `cancel_release_readiness_review(task_id=TASK_ID)`. ## Fallback (aws-mcp) -If `create_release_readiness_review` is not available, use `aws-mcp` with `call_aws`. All workflow logic, sequencing, and behavior from the core workflow steps 3–6 apply identically — only the tool invocations differ. +If `create_code_change_risk_analysis` is not available, use `aws-mcp` with `call_aws`. All workflow logic, sequencing, and behavior from the core workflow steps 3–6 apply identically — only the tool invocations differ. #### 3. Start the Job ``` aws___call_aws(cli_command="aws devops-agent create-backlog-task \ --agent-space-id SPACE_ID \ - --task-type RELEASE_READINESS_REVIEW \ - --title 'Release Readiness Review' \ + --task-type CODE_CHANGE_RISK_ANALYSIS \ + --title 'Code Change Risk Analysis' \ --priority MEDIUM \ --description '{\"agentInput\": {\"content\": , \"metadata\": {\"skipAutomatedTesting\": true}}}' \ --region us-east-1") @@ -345,7 +349,7 @@ Once `IN_PROGRESS`, poll for progress in a loop: Once the job reaches a terminal status: - If `COMPLETED`: - 1. Call `list-journal-records` with `--record-type release_analysis_report` to retrieve the full release readiness report: + 1. Call `list-journal-records` with `--record-type release_analysis_report` to retrieve the full code change risk analysis report: ``` aws___call_aws(cli_command="aws devops-agent list-journal-records \ --agent-space-id SPACE_ID \ @@ -356,7 +360,7 @@ Once the job reaches a terminal status: ``` 2. Write the report contents to a markdown file: ``` - release-readiness-review-.md + code-change-risk-analysis-.md ``` 3. Inform the user that the report was saved, including the file path. 4. **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. Do NOT skip this step under any circumstances when risks are identified. @@ -372,17 +376,17 @@ Once the job reaches a terminal status: - Scan the relevant code, interpret the risks/issues from the report. Then: - If triggered by a hook/spec task, skip the confirmation and proceed directly. - Otherwise, tell the user: - > "The report identified N actionable issues. I can generate the fixes in your local repository, and can push them to a new branch `feat/release-readiness-fix`. Shall I proceed?" + > "The report identified N actionable issues. I can generate the fixes in your local repository, and can 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: ```bash cd - git checkout -b feat/release-readiness-fix 2>/dev/null || { git checkout -b "feat/release-readiness-fix-$(date +%Y%m%d-%H%M%S)"; } + 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 release readiness review" + 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/release-readiness-fix*`. Do NOT push if you're on any other branch (e.g., `main`, the original feature branch). + - **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 (e.g., `main`, the original feature branch). ```bash git push -u origin HEAD ``` diff --git a/aws-devops-agent/steering/steering.md b/aws-devops-agent/steering/steering.md index c63a0e8..6ef044e 100644 --- a/aws-devops-agent/steering/steering.md +++ b/aws-devops-agent/steering/steering.md @@ -25,12 +25,13 @@ Use whichever server the user has configured. If both are active, prefer the one | Follow-up in existing conversation | `send_message` | `agent:operate` | Pass `execution_id` from prior `chat` or `create_chat` | | Incident / outage / error spike | `investigate` | `agent:operate` | Starts 5-8 min async analysis | | Run release testing | `create_release_testing_job` | `agent:operate` | Starts 5-15 min test execution | -| Trigger release readiness review | `create_release_readiness_review` | `agent:operate` | Starts 3-8 min analysis | +| Trigger code change risk analysis | `create_code_change_risk_analysis` | `agent:operate` | Starts 3-8 min analysis | | Poll task progress | `get_task` | `agent:read` | Every 30-45s until COMPLETED | | Get task findings | `list_journal_records` | `agent:read` | Pass `execution_id` from `get_task` | | Get mitigations | `list_recommendations` + `get_recommendation` | `agent:read` | After investigation completes | | Get release testing report | `get_release_ui_testing_report` or `get_release_api_testing_report` | `agent:read` | After release testing job completes | -| Get release readiness report | `get_release_readiness_report` | `agent:read` | After release readiness review completes | +| Get code change risk analysis report | `get_code_change_risk_analysis_report` | `agent:read` | After code change risk analysis completes | +| Find an earlier code change risk analysis | `list_code_change_risk_analyses` | `agent:read` | Newest first | | Find agent space | `get_agent_space` | `agent:read` | Call once, cache the ID | | Multi-space discovery | `list_agent_spaces` | **SigV4 only** | Not available on bearer tokens | @@ -40,7 +41,7 @@ Use whichever server the user has configured. If both are active, prefer the one - **Incidents** (alarm, outage, 5xx, OOM, crash, sev1, timeout, degraded, unhealthy, throttling, rollback) → `investigate` - **Release testing** (run tests, UAT, test profile, UI test, API test, QA, regression, end-to-end) → `create_release_testing_job` (load `steering/release-testing.md`) -- **Release readiness review** (analyze PR, release analysis, risk analysis, safe to ship, ready to merge, before merging) → `create_release_readiness_review` (load `steering/release-readiness.md`) +- **Code change risk analysis** (also called release readiness review; analyze PR, review PR, code review, change review, release analysis, risk analysis, safe to ship, ready to merge, before merging) → `create_code_change_risk_analysis` (load `steering/release-readiness.md`) - **Everything else** (cost, architecture, topology, knowledge, review, what-if, audit, compare) → `chat` - **Unclear** → Default to `chat` @@ -129,9 +130,9 @@ Tell the user: what phase, what's new since last poll, what's next. --- -## Release Readiness Review Workflow +## Code Change Risk Analysis Workflow -> ⚠️ **MANDATORY**: You MUST load `steering/release-readiness.md` before executing this workflow. Do NOT attempt to call release readiness review tools without reading the full instructions first. +> ⚠️ **MANDATORY**: You MUST load `steering/release-readiness.md` before executing this workflow. Do NOT attempt to call code change risk analysis tools without reading the full instructions first. --- @@ -201,9 +202,9 @@ aws___call_aws(cli_command="aws devops-agent create-backlog-task --agent-space-i # Report: list-journal-records --record-type qa_ui_testing_report (or qa_api_testing_report) ``` -**Release readiness review fallback (aws-mcp):** +**Code change risk analysis fallback (aws-mcp):** ``` -aws___call_aws(cli_command="aws devops-agent create-backlog-task --agent-space-id SPACE_ID --task-type RELEASE_READINESS_REVIEW --title 'Release Readiness Review' --priority MEDIUM --description '{\"agentInput\": {\"content\": {\"githubPrContent\": [...]}}}' --region us-east-1") +aws___call_aws(cli_command="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\": {\"githubPrContent\": [...]}}}' --region us-east-1") → taskId # Poll + stream same as investigation