Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/kompass-pr-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
uses: actions/checkout@v4
with:
token: ${{ steps.token.outputs.token }}
ref: ${{ github.head_ref }}

- name: Setup Bun
uses: oven-sh/setup-bun@v1
Expand Down
6 changes: 4 additions & 2 deletions packages/core/commands/pr/fix.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ $ARGUMENTS
### Align Local Branch

- If `<pr-branch>` is unavailable, STOP and report that the PR head branch could not be determined
- If `<current-branch>` differs from `<pr-branch>`:
- If `<current-branch>` equals `<pr-branch>`, store `<current-branch>` as `<active-branch>`
- Otherwise, if `<current-branch>` is unavailable and `<current-head>` equals `<pr-context.pr.headRefOid>`, store `<pr-branch>` as `<active-branch>` because the repository is already aligned to the PR head in detached `HEAD` mode
- Otherwise:
- Run `git fetch origin <pr-branch>` to ensure the branch is available locally before checkout
- Checkout `<pr-branch>` before analyzing repository files or making code changes for this PR
- After checkout, store the active branch as `<active-branch>`
- If checkout fails, STOP and report that the PR branch could not be checked out locally
- Otherwise, store `<current-branch>` as `<active-branch>`
- Do not inspect or modify local code for this PR until `<active-branch>` equals `<pr-branch>`

### Analyze Feedback
Expand Down
6 changes: 4 additions & 2 deletions packages/core/commands/pr/review.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ $ARGUMENTS
### Align Local Branch

- If `<pr-branch>` is unavailable, STOP and report that the PR head branch could not be determined
- If `<current-branch>` differs from `<pr-branch>`:
- If `<current-branch>` equals `<pr-branch>`, store `<current-branch>` as `<active-branch>`
- Otherwise, if `<current-branch>` is unavailable and `<current-head>` equals `<pr-context.pr.headRefOid>`, store `<pr-branch>` as `<active-branch>` because the repository is already aligned to the PR head in detached `HEAD` mode
- Otherwise:
- Run `git fetch origin <pr-branch>` to ensure the branch is available locally before checkout
- Checkout `<pr-branch>` before inspecting local repository files for this PR review
- After checkout, store the active branch as `<active-branch>`
- If checkout fails, STOP and report that the PR branch could not be checked out locally
- Otherwise, store `<current-branch>` as `<active-branch>`
- Do not inspect local repository code for this PR until `<active-branch>` equals `<pr-branch>`

### Load Ticket Context
Expand Down
1 change: 1 addition & 0 deletions packages/core/components/load-pr.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Store the result as `<%= it.result %>`
- Store the PR head branch as `<pr-branch>` from `<%= it.result %>.pr.headRefName` when it is available
- Run `git branch --show-current` and store the trimmed result as `<current-branch>` when it is available
- Run `git rev-parse HEAD` and store the trimmed result as `<current-head>` when it is available
- Treat the loaded PR body, discussion, review history, and any attachments or linked artifacts returned by the loader as part of the source context
- Review attached images, screenshots, videos, PDFs, and other linked files whenever they can affect the requested fix, review outcome, reproduction steps, or acceptance criteria
- If any relevant attachment cannot be accessed, note that gap and continue only when the remaining PR context is still sufficient to proceed reliably
7 changes: 5 additions & 2 deletions packages/opencode/.opencode/commands/pr/fix.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,21 @@ $ARGUMENTS
- Store the result as `<pr-context>`
- Store the PR head branch as `<pr-branch>` from `<pr-context>.pr.headRefName` when it is available
- Run `git branch --show-current` and store the trimmed result as `<current-branch>` when it is available
- Run `git rev-parse HEAD` and store the trimmed result as `<current-head>` when it is available
- Treat the loaded PR body, discussion, review history, and any attachments or linked artifacts returned by the loader as part of the source context
- Review attached images, screenshots, videos, PDFs, and other linked files whenever they can affect the requested fix, review outcome, reproduction steps, or acceptance criteria
- If any relevant attachment cannot be accessed, note that gap and continue only when the remaining PR context is still sufficient to proceed reliably

### Align Local Branch

- If `<pr-branch>` is unavailable, STOP and report that the PR head branch could not be determined
- If `<current-branch>` differs from `<pr-branch>`:
- If `<current-branch>` equals `<pr-branch>`, store `<current-branch>` as `<active-branch>`
- Otherwise, if `<current-branch>` is unavailable and `<current-head>` equals `<pr-context.pr.headRefOid>`, store `<pr-branch>` as `<active-branch>` because the repository is already aligned to the PR head in detached `HEAD` mode
- Otherwise:
- Run `git fetch origin <pr-branch>` to ensure the branch is available locally before checkout
- Checkout `<pr-branch>` before analyzing repository files or making code changes for this PR
- After checkout, store the active branch as `<active-branch>`
- If checkout fails, STOP and report that the PR branch could not be checked out locally
- Otherwise, store `<current-branch>` as `<active-branch>`
- Do not inspect or modify local code for this PR until `<active-branch>` equals `<pr-branch>`

### Analyze Feedback
Expand Down
7 changes: 5 additions & 2 deletions packages/opencode/.opencode/commands/pr/review.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,21 @@ $ARGUMENTS
- Store the result as `<pr-context>`
- Store the PR head branch as `<pr-branch>` from `<pr-context>.pr.headRefName` when it is available
- Run `git branch --show-current` and store the trimmed result as `<current-branch>` when it is available
- Run `git rev-parse HEAD` and store the trimmed result as `<current-head>` when it is available
- Treat the loaded PR body, discussion, review history, and any attachments or linked artifacts returned by the loader as part of the source context
- Review attached images, screenshots, videos, PDFs, and other linked files whenever they can affect the requested fix, review outcome, reproduction steps, or acceptance criteria
- If any relevant attachment cannot be accessed, note that gap and continue only when the remaining PR context is still sufficient to proceed reliably

### Align Local Branch

- If `<pr-branch>` is unavailable, STOP and report that the PR head branch could not be determined
- If `<current-branch>` differs from `<pr-branch>`:
- If `<current-branch>` equals `<pr-branch>`, store `<current-branch>` as `<active-branch>`
- Otherwise, if `<current-branch>` is unavailable and `<current-head>` equals `<pr-context.pr.headRefOid>`, store `<pr-branch>` as `<active-branch>` because the repository is already aligned to the PR head in detached `HEAD` mode
- Otherwise:
- Run `git fetch origin <pr-branch>` to ensure the branch is available locally before checkout
- Checkout `<pr-branch>` before inspecting local repository files for this PR review
- After checkout, store the active branch as `<active-branch>`
- If checkout fails, STOP and report that the PR branch could not be checked out locally
- Otherwise, store `<current-branch>` as `<active-branch>`
- Do not inspect local repository code for this PR until `<active-branch>` equals `<pr-branch>`

### Load Ticket Context
Expand Down
Loading