New to FORGE? Start a free 30-day trial

Pull Requests

Updated on Oct 5, 2026

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.

    bash
    frg config set-issue 123     # or: export FORGE_ISSUE_ID=123
    frg config set-pr 456        # or: export FORGE_PR_ID=456
    frg config show-context

    pr_id in the context file can be an integer or a string, and PR-related workflow steps require a non-empty pr_id.

  • An open pull request. frg pr does 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>/.

SubcommandWhat it doesTypical inputsOutputsDefault role
draftCreates the pull request descriptionPR changes, the associated issuepull_request.mdsoftware_engineer
publishPublishes the local description to the code platformpull_request.md (required)Updated PR description (no local file)software_engineer
reviewReviews checks, code quality, reviewer feedback, and merge conflicts; applies safe fixes locallyThe PR on the platformstatus_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
mergeAnalyzes merge safety and prepares the branch for merging; does not mergeReview files from pr reviewLocal rebase and commitssoftware_engineer
askAnswers a question about the pull requestQuestion, review filesanswer.mdsoftware_engineer

Typical flow

This end-to-end example takes an issue from draft to a pull request that is ready to merge.

text
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)
  1. Prepare the issue and plan:

    bash
    frg config set-issue 123
    frg issue draft
    frg issue review
    frg issue publish
    frg issue plan
  2. Implement and review the code:

    bash
    frg code create
    frg code review
    frg code review --auto-fix major
  3. Push your branch, open a pull request on your code platform, and save its number:

    bash
    git push -u origin HEAD
    frg config set-pr 456
  4. Draft and publish the pull request description:

    bash
    frg pr draft
    frg pr publish
  5. Review the pull request and let Forge apply safe fixes locally:

    bash
    frg pr review
  6. Prepare the branch for merging, then push and merge through your code platform:

    bash
    frg pr merge

Options shared by all subcommands

Every frg pr subcommand accepts these options.

OptionDescriptionDefault
-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
--clearClears 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-retryRetries once automatically when expected outputs are missing. Cannot be combined with --clear.Off
--print-promptPrints the compiled prompt without running the agent.Off
--bypass-safety-checksSkips prompt-injection validation. Bypasses are logged.Off
-q, --quietSuppresses all output except errors.Off

frg pr draft

Creates a pull request description from the pull request changes and the associated issue.

text
frg pr draft [OPTIONS]
OptionDescription
--edit [<INSTRUCTIONS>]Refines the description with your instructions, given inline or in edit.md.
--liteConcise description with essential information only. Flag only.
--lite-edit [<INSTRUCTIONS>]Concise description with your instructions, given inline or in lite-edit.md.
bash
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.

text
frg pr publish [OPTIONS]

No additional options.

bash
frg pr publish

Notes:

  • publish requires .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. Run frg pr draft first.
  • 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.

text
frg pr review [OPTIONS]
OptionDescription
--edit [<INSTRUCTIONS>]Refines the existing review with your instructions, given inline or in edit.md.
--liteActionable 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.
bash
frg pr review
frg pr review --lite

Outputs in .forge/work/job_<issue_id>/pr/pr_<pr_id>/:

FileStandardLiteContent
status_check_fixes.mdYesNoRecommended fixes for failing CI checks
code_quality_improvements.mdYesNoCode quality issues and responses to reviewer comments
minor_merge_conflicts.mdYesNoRecommendations for minor merge conflicts
high_risk_merge_conflicts.mdYesNoRoot-cause analysis for high-risk merge conflicts
pr_review.mdYesYesSummary 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 review has no --auto-fix option. To fix code-review findings by severity, use frg 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.

text
frg pr merge [OPTIONS]
OptionDescription
--fix [<INSTRUCTIONS>]Fixes merge issues using your instructions, given inline or in fix.md.
bash
frg pr merge
frg pr merge --fix "Resolve the failing lint check first"

What merge does, in order:

text
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 review first. merge reads 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.

text
frg pr ask [OPTIONS] [QUESTION]

No additional options.

bash
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