Stage all changes, commit using the commit skill, rebase onto upstream branch, and open an AWS CodeCommit PR
Stages all changes one file at a time, commits them using the commit skill, rebases onto a user-specified upstream branch, and creates a pull request in AWS CodeCommit.
Run git status --porcelain to get all modified, untracked, and deleted files.
For each file shown by git status --porcelain, stage it individually using git add <file> (or git rm <file> for deleted files). Do not use git add -A or git add ..
Invoke the commit skill to create a well-formatted conventional commit from the staged changes.
If an upstream branch was not provided as an argument, ask the user: "Which upstream branch should I rebase onto and target for the PR?" (e.g., main, develop).
git fetch origin <upstream-branch>
git rebase origin/<upstream-branch>
git rebase --continue, then let you know when done. Resume from step 6 once the user confirms the rebase is complete.Use the AWS CLI to create the pull request:
aws codecommit create-pull-request \
--title "<brief one-line summary of changes>" \
--description "<detailed description of what changed and why>" \
--targets repositoryName=<repo-name>,sourceReference=<current-branch>,destinationReference=<upstream-branch>
git rev-parse --abbrev-ref HEAD.git remote get-url origin (extract the repo name from the URL).git log origin/<upstream-branch>..HEAD --oneline and git diff origin/<upstream-branch>...HEAD --stat.Print the PR URL or ID returned by the AWS CLI so the user can view it.
git or aws command fails unexpectedly, stop immediately and show the error output to the user.--no-verify.