> For the complete documentation index, see [llms.txt](https://docs.warp.dev/llms.txt).
> Markdown versions of each page are available by appending .md to any URL.

# Running an issue-to-PR Blueprint

Configure an issue-to-PR workflow in Warp Factories, approve a plan, request a revision, and inspect the resulting draft pull request.

Use a README improvement to test planning, approval, and revision in Warp Factories before changing application code. A [Blueprint](https://docs.warp.dev/factories/blueprints/) defines the stages and gates that wait for your answers. [Workers](https://docs.warp.dev/factories/factory-agents/) are the agents assigned to those stages: they propose, implement, and review the change on one draft PR. You approve the committed spec and decide whether to merge.

For smaller definitions with inline stage procedures, inspect the [linear workflow](https://github.com/warpdotdev/warp-factory-examples/tree/484a8b431d79407a4623b57503be1dd983080cf5/examples/blueprint-linear), [conditional routing and revision loop](https://github.com/warpdotdev/warp-factory-examples/tree/484a8b431d79407a4623b57503be1dd983080cf5/examples/blueprint-revision-loop), or [human decision gate](https://github.com/warpdotdev/warp-factory-examples/tree/484a8b431d79407a4623b57503be1dd983080cf5/examples/blueprint-human-gate).

## Prerequisites

-   Complete the [Warp Factories quickstart](https://docs.warp.dev/factories/quickstart/) for account, team role, and GitHub setup. Factory runs need available shared team usage; add usage if needed. See [funding factory runs](https://docs.warp.dev/support-and-community/plans-and-billing/plans-pricing-refunds/#funding-factory-runs).
-   Use two repositories you control: a disposable fork where workers change the README, and a separate repository that stores the factory definition. Check [plan eligibility for hosting your definition on GitHub](https://docs.warp.dev/support-and-community/plans-and-billing/plans-pricing-refunds/#warp-factories-plans).
-   Grant the Warp GitHub App access to both repositories. Runs need permission to read issues, update labels and comments, push branches, and open PRs. Keep human approval and merge requirements in your repository rules. See [GitHub permissions](https://docs.warp.dev/factories/integrations/github/#permissions).
-   Install Git and Python 3 on the machine where you prepare and validate the definition. Validation requires network access to Warp’s service.

## 1\. Prepare a disposable work repository

Use the pinned starting commit below. Its README does not yet document the validator command you will request.

1.  On GitHub, fork [warp-factory-examples](https://github.com/warpdotdev/warp-factory-examples) into your account. In the fork’s **Settings** > **General**, enable **Issues**.
    
2.  In your terminal, clone your fork and create the exercise branch:
    
    ```bash
    git clone \
      https://github.com/YOUR_GITHUB_USER/warp-factory-examples.git \
      blueprint-work
    cd blueprint-work
    git switch -c blueprint-demo 76f0f06f59a3c3d5fc29eb7699fe281073fa58c1
    git push -u origin blueprint-demo
    ```
    
    Replace `YOUR_GITHUB_USER` with the account that owns the fork.
    
3.  On GitHub, set the fork’s default branch to `blueprint-demo`. Check that its root README does not yet explain single-example validation or exit code 2.
    

## 2\. Copy and configure the Blueprint definition

Copy the [issue-to-PR example](https://github.com/warpdotdev/warp-factory-examples/tree/484a8b431d79407a4623b57503be1dd983080cf5/examples/sdlc-issue-to-pr) into the definition repository. Keep the work fork at its starting commit.

From a directory outside your work fork, run:

```bash
git clone https://github.com/warpdotdev/warp-factory-examples.git blueprint-source
git -C blueprint-source checkout --detach 484a8b431d79407a4623b57503be1dd983080cf5
git clone DEFINITION_REPO_URL blueprint-definition
cp -R blueprint-source/examples/sdlc-issue-to-pr/. blueprint-definition/
```

Replace `DEFINITION_REPO_URL` with your separate, empty definition repository’s clone URL. Keep its `.git` directory. Connect the directory containing the copied `factory.yaml` when you apply the definition.

In that copied definition:

1.  In `factory.yaml`, set `alias` to `blueprint-demo` and replace the sample work repositories with your fork. Update the repository filters in both `automations/github-mention-assign/` and `automations/github-pr-closed-or-merged/` to the same fork. In both automations, change `factory:Acme` to `factory:blueprint-demo`; preserve the mention, assignment, label, and closed-or-merged constraints.
2.  Remove the optional iOS extension together: its repository, `agents/mobile-build/`, `runners/macos-build.yaml`, and the `mobile-build` Blueprint stage. Remove mobile-only routes from intake, triage, spec, review, and handoff. Set `implement.to: review` and remove mobile references from the remaining stage inputs, outputs, prompts, implementer worker, and closed-or-merged automation. Keep the non-mobile approval, revision, and completion routes.
3.  Keep this exercise GitHub-only. Remove the Slack and Linear integration declarations together with `automations/slack-app-mentions/`, `automations/slack-dms/`, and `automations/linear-agent-sessions/`. Update the factory description and the foreman’s communication instructions to describe replies in the original GitHub issue.
4.  Set `platform.linux.dockerImage` to `python:3.12-bookworm` in both Linux runner files. Remove the Go `setupCommands` block from `runners/linux-build.yaml` and update its description. Confirm `git --version` and `python3 --version` in the actual runtime before running the exercise.
5.  In `skills/repository-conventions/SKILL.md`, name your fork and `blueprint-demo` PR base and require a draft through handoff. In `agents/implementer/skills/testing-standards/SKILL.md`, require `python3 scripts/check_conventions.py` and honest validator reporting for this prose-only change. Keep models, worker bindings, and scorers unchanged.

Read `factory.yaml` beside the worker files. Keep stage procedures and routes in the Blueprint rather than duplicating them in worker prompts. The spec stage must wait for your `spec-review` answer, implementation must reuse the branch and PR, and the reviewer must return findings without merging.

## 3\. Validate and apply the definition

Validate the complete definition before applying it. Parser validation checks the files without checking your team’s resources and access. Application checks those prerequisites too.

From the directory containing `blueprint-source` and `blueprint-definition`, run:

```bash
python3 blueprint-source/scripts/validate_factory_files.py blueprint-definition --server-root https://app.warp.dev
```

Continue only after exit code 0. On exit code 1, fix the reported diagnostics. Exit code 2 means validation did not run. Restore Python, network, or service access and retry.

Commit and push the definition. With separate authorization for a disposable factory, use the [GitHub-backed definition path](https://docs.warp.dev/factories/factory-as-code/#where-the-definition-lives) to connect that repository and apply its root definition. If you already have a disposable GitHub-backed factory, update its connected definition instead of creating a duplicate. Wait for a successful sync and compare the applied definition with your commit.

Before sending work, confirm that the applied factory has your fork, the intended Blueprint, and only the GitHub automations from the example. Check that the work checkout and eventual PR base use `blueprint-demo`. A parser pass or a commit in the definition repository does not establish either result.

## 4\. Send a request that requires a plan

1.  In your fork, create an issue titled `Document single-example validation`.
    
2.  Apply `factory:blueprint-demo` before mentioning the foreman. Then post a new comment with `@warp` followed by:
    
    ```text title="Issue request"
    In the root README, document how to validate only the SDLC example with
    python3 scripts/validate_factory_files.py examples/*sdlc-issue-to-pr
    Explain that exit code 2 means validation did not run and is not a pass.
    Keep implementation changes in README.md; the committed specification is
    the only other allowed file. Propose a short plan and wait for my approval
    before implementation. Run the repository's convention check and report the
    validator result honestly. Open a draft pull request. Do not merge.
    ```
    

The GitHub automation sends the request to the foreman. Because you explicitly required a plan, the foreman starts the spec stage. The spec worker commits the plan and requests your approval at `spec-review`.

Read the issue reply and linked run. The spec must name the README scope, single spec file, and checks. Confirm implementation has not started while approval is pending.

## 5\. Answer the spec-review gate

Before approving, request one spec change in the original issue, for example: `@warp Add the exact validator command to the spec acceptance criteria.` Confirm implementation stays blocked and the revised committed spec gets a new `spec-review` request.

Read that revision, then reply in the same issue with a new `@warp` mention. Include its PR link and committed revision, followed by:

```text title="Plan approval"
Approve this committed spec revision. Keep implementation in README.md; the
spec is the only other allowed file. Run the convention check and keep the
same pull request draft. Do not merge.
```

The spec worker reports your answer, and the foreman routes the approved spec to implementation.

## 6\. Review the draft PR and request a revision

The implementer edits the README and reports its checks and draft PR. The foreman sends the change to a separate reviewer. Corrections use the same branch and PR, followed by independent review of the revised head.

1.  Open the draft PR. Confirm the base is `blueprint-demo`, the diff changes only `README.md` and the single committed spec file, and the description reports the actual convention-check and validator outcomes.
    
2.  Read the independent review. Then return to the original issue conversation, mention `@warp`, and send:
    
    ```text title="Same-PR revision"
    Revise the same pull request to explain that validation needs network
    access. Keep implementation in README.md, retain only the committed spec
    as the other file, and rerun the convention check. Do not merge.
    ```
    
3.  Check that the existing PR receives the revision and another independent review. Confirm the README now explains the command, exit code 2, and network requirement.
    

## 7\. Make the human handoff decision

Review the final diff, check results, and findings yourself. The worker’s review is advisory. At `handoff-decision`, request a revision, report a merge or closure, or cancel. Leave this trial unmerged and explicitly cancel when you finish inspecting it. In real work, merge only through your normal human review process.

If someone closes the PR without merging, the foreman must report closure rather than mark the work merged or complete.

## Troubleshooting

-   **Validation cannot run** - Check Python, network access, and the service URL reported by the validator. Retry after restoring access; do not treat exit code 2 as success.
-   **The mention produces no workflow run** - Confirm the app can access the fork and the applied automation’s repository, handle, and label filters match. Apply the label, then send a new mention. This example’s specialized automation does not handle nonmatching events; do not assume another route does.
-   **An integration is unavailable** - Remove its declaration and automations together, or finish its connection before applying the definition.
-   **Work is waiting for you** - Answer the named gate in the original conversation. A question back or an unrelated message does not approve a plan.
-   **Approval is stale or the spec PR is closed** - Read and approve the current committed spec on an open PR. A replacement spec needs fresh approval.
-   **A required check fails** - Keep the PR draft, request a correction, and inspect the rerun and independent review of the new head.
-   **A definition change does not affect the current run** - Apply the definition and start separate test work. Follow-ups to the existing run keep its selected Blueprint.

## Next steps

The exercise connects a README issue to plan approval, independent review, and a same-PR revision, with merge left to you.

-   [Blueprints](https://docs.warp.dev/factories/blueprints/) - Adapt stages, transitions, and gates
-   [Factory definition as code](https://docs.warp.dev/factories/factory-as-code/#blueprint) - Change the versioned workflow configuration
-   [How to review AI-generated code](https://docs.warp.dev/guides/agent-workflows/how-to-review-ai-generated-code/) - Check a worker’s proposed changes
