Skip to content
Book demo

Coding

Pull request review triage

Review incoming pull requests against repo conventions, then approve, request changes, or route the PR to a human reviewer.

githubpull requestcode reviewautomationai reviewci

[ workflow / coding ]

Pull request review triage

Whenever a PR opens, Cosmos gathers the diff, nearby files, repository conventions, and prior review notes. It runs an AI review pass, posts what it found, and routes the PR based on confidence: approve simple changes, request fixes, or escalate to a human reviewer.

07 nodes

04 edges

Trigger[trigger]
Pull request opened

Webhook from GitHub / GitLab

System step[collect]
Cosmos gathers context

Diff, related files, conventions

AI Agent step[review]
AI review pass

Spots bugs, style and risk

Decision

Safe to auto-approve?

Confidence ≥ threshold

No
Human-in-the-loop[human]
Request human review

Assign repo CODEOWNERS

Yes
Bypass (already solved)[approve]
Auto-approve

Cosmos posts approval

YES
Output / Result[summary]
Post review summary

Inline comments + checklist

Workflow prompt

Paste this into Augment to reproduce the workflow end-to-end.

Build a Cosmos workflow that triages every new pull request on our GitHub repositories.

Trigger: a webhook fires whenever a pull request is opened or updated.

Steps:
1. Cosmos gathers context: the diff, related files, the repo's conventions and any prior review notes.
2. Run an AI review pass that flags bugs, style issues and risky changes.
3. Decision: "Safe to auto-approve?". Compare the AI confidence score against a configurable threshold:
   - If yes, post an approval review on behalf of Cosmos.
   - If no, request a human review and assign the matching CODEOWNERS.
4. Either path ends by posting a single summary comment on the PR with inline review comments and a checklist.

Keep the flow auditable: every action posts back to the PR so reviewers can see what Cosmos saw, what it decided, and why.