Pull Requests
frg pr drafts and publishes a pull request description, reviews the pull request, prepares it for a safe merge, and answers questions about it. Use it after the implementation for an issue exists and a pull request is open on your code platform.
Prerequisites
-
A valid Telerik license. See Licensing.
-
A supported coding agent, installed and authenticated. Check it with
frg status. -
A code platform configured in
.forge/config/toolchain.toml([code_platform]). See Toolchain Configuration. -
An Issue ID and a PR ID in the current context. Without an Issue ID, Forge stops with
Issue ID required for 'pr' operations.bashfrg config set-issue 123 # or: export FORGE_ISSUE_ID=123 frg config set-pr 456 # or: export FORGE_PR_ID=456 frg config show-contextpr_idin the context file can be an integer or a string, and PR-related workflow steps require a non-emptypr_id. -
An open pull request.
frg prdoes not create the pull request; push your branch and open it on your code platform first.
Subcommands at a glance
All local files are written to .forge/work/job_<issue_id>/pr/pr_<pr_id>/.
| Subcommand | What it does | Typical inputs | Outputs | Default role |
|---|---|---|---|---|
draft | Creates the pull request description | PR changes, the associated issue | pull_request.md | software_engineer |
publish | Publishes the local description to the code platform | pull_request.md (required) | Updated PR description (no local file) | software_engineer |
review | Reviews checks, code quality, reviewer feedback, and merge conflicts; applies safe fixes locally | The PR on the platform | status_check_fixes.md, code_quality_improvements.md, minor_merge_conflicts.md, high_risk_merge_conflicts.md, pr_review.md (lite: pr_review.md only) | software_architect |
merge | Analyzes merge safety and prepares the branch for merging; does not merge | Review files from pr review | Local rebase and commits | software_engineer |
ask | Answers a question about the pull request | Question, review files | answer.md | software_engineer |
Typical flow
This end-to-end example takes an issue from draft to a pull request that is ready to merge.
issue draft ──► issue review ──► issue publish ──► issue plan
│
┌─────────────────────────────────────────────────┘
▼
code create ──► code review ──► code review --auto-fix
│
┌─────────────────────────────────┘ (push branch, open PR, set PR ID)
▼
pr draft ──► pr publish ──► pr review ──► pr merge ──► merge on the platform (you)
-
Prepare the issue and plan:
bashfrg config set-issue 123 frg issue draft frg issue review frg issue publish frg issue plan -
Implement and review the code:
bashfrg code create frg code review frg code review --auto-fix major -
Push your branch, open a pull request on your code platform, and save its number:
bashgit push -u origin HEAD frg config set-pr 456 -
Draft and publish the pull request description:
bashfrg pr draft frg pr publish -
Review the pull request and let Forge apply safe fixes locally:
bashfrg pr review -
Prepare the branch for merging, then push and merge through your code platform:
bashfrg pr merge
Options shared by all subcommands
Every frg pr subcommand accepts these options.
| Option | Description | Default |
|---|---|---|
-a, --agent <NAME> | Coding agent for this run: claude_code, github_copilot, or opencode. | Agent in agents.toml |
-r, --role <ROLE> | Overrides the default role: product_manager, software_engineer, software_architect, technical_writer, security_analyst, sre. Cannot be combined with --custom-agent. | Subcommand default role |
--custom-agent <NAME> | Selects a custom agent configuration inside your coding agent. Cannot be combined with --role. | None |
-m, --model <MODEL> | Overrides the model configured in agents.toml. | Model in agents.toml |
-c, --context-file <FILE> | Adds a file path as context. Repeatable. | None |
--context-dir <DIR> | Adds a directory as context. Repeatable. Up to 100 files per directory and 1 MB per file. | None |
--clear | Clears the existing agent session and starts fresh. | Off |
--retry [<INSTRUCTIONS>] | Continues the previous session to complete missing outputs. Requires an existing session; cannot be combined with --clear. | Off |
--auto-retry | Retries once automatically when expected outputs are missing. Cannot be combined with --clear. | Off |
--print-prompt | Prints the compiled prompt without running the agent. | Off |
--bypass-safety-checks | Skips prompt-injection validation. Bypasses are logged. | Off |
-q, --quiet | Suppresses all output except errors. | Off |
frg pr draft
Creates a pull request description from the pull request changes and the associated issue.
frg pr draft [OPTIONS]
| Option | Description |
|---|---|
--edit [<INSTRUCTIONS>] | Refines the description with your instructions, given inline or in edit.md. |
--lite | Concise description with essential information only. Flag only. |
--lite-edit [<INSTRUCTIONS>] | Concise description with your instructions, given inline or in lite-edit.md. |
frg pr draft
frg pr draft --edit "Document the breaking change in the API section"
Output: .forge/work/job_<issue_id>/pr/pr_<pr_id>/pull_request.md.
frg pr publish
Publishes pull_request.md as the pull request description. Only the description is updated; state, labels, reviewers, and other metadata are left unchanged.
frg pr publish [OPTIONS]
No additional options.
frg pr publish
Notes:
publishrequires.forge/work/job_<issue_id>/pr/pr_<pr_id>/pull_request.md. If the file does not exist, the agent stops and reports that it cannot find the draft to publish. Runfrg pr draftfirst.- No local output file is written.
pr publish and issue publish transfer the draft body to the platform by file reference instead of inline text, so the published description matches pull_request.md as authored. This is internal behavior; there is no frg option for it.
frg pr review
Reviews the pull request. Forge retrieves the platform metadata (declared target branch, base and head commits, merge state, CI status) and all existing reviewer feedback, including Copilot review summaries and inline comments. It then records each actionable item and applies safe, in-scope fixes locally.
frg pr review [OPTIONS]
| Option | Description |
|---|---|
--edit [<INSTRUCTIONS>] | Refines the existing review with your instructions, given inline or in edit.md. |
--lite | Actionable feedback only (blocking issues, failing tests, conflicts), in a single output file. Flag only. |
--lite-edit [<INSTRUCTIONS>] | Focused review with your instructions, given inline or in lite-edit.md. |
frg pr review
frg pr review --lite
Outputs in .forge/work/job_<issue_id>/pr/pr_<pr_id>/:
| File | Standard | Lite | Content |
|---|---|---|---|
status_check_fixes.md | Yes | No | Recommended fixes for failing CI checks |
code_quality_improvements.md | Yes | No | Code quality issues and responses to reviewer comments |
minor_merge_conflicts.md | Yes | No | Recommendations for minor merge conflicts |
high_risk_merge_conflicts.md | Yes | No | Root-cause analysis for high-risk merge conflicts |
pr_review.md | Yes | Yes | Summary of all findings |
Notes:
- Review does not push, change remote PR metadata, or reply to or resolve review threads. Local commits follow Commit Behavior.
frg pr reviewhas no--auto-fixoption. To fix code-review findings by severity, usefrg code review --auto-fix <LEVEL>before or after the PR review.- In built-in workflows that wait for pull request status before reviewing, Forge waits for an AI review only when the pull request actually has an AI review request.
frg pr merge
Prepares the pull request for a safe merge. It does not perform the merge.
frg pr merge [OPTIONS]
| Option | Description |
|---|---|
--fix [<INSTRUCTIONS>] | Fixes merge issues using your instructions, given inline or in fix.md. |
frg pr merge
frg pr merge --fix "Resolve the failing lint check first"
What merge does, in order:
refresh PR metadata ──► verify clean source-branch checkout ──► fetch target branch ──► rebase
──► fix status checks ──► apply code-quality fixes and safe feedback ──► validate ──► local commits
Notes:
- If the checkout is not the PR source branch or the worktree is dirty, Forge stops and reports the mismatch.
- Forge resolves only non-destructive rebase conflicts. For high-risk or ambiguous conflicts, it aborts the rebase and reports the base and head details and the conflicted files.
- Forge never pushes, merges on the platform, edits remote PR metadata, or resolves review threads. Push and merge yourself after you validate the result.
- Run
frg pr reviewfirst.mergereads the review files and works with either a standard or a lite review.
frg pr ask
Answers a question about the pull request, using the pull request, the codebase, and available review files.
frg pr ask [OPTIONS] [QUESTION]
No additional options.
frg pr ask "What files changed?"
frg pr ask "Are there any breaking changes?"
Output: .forge/work/job_<issue_id>/pr/pr_<pr_id>/answer.md.
See Also
- Issue Management and Code Operations: the steps before a pull request.
- Commit Behavior: which PR operations commit locally.
- Lite Mode and Modifiers.
- Workflow Commands.
- Command Reference.